where should i find information on interregating the system clock?  
Author Message
rickyg





PostPosted: .NET Base Class Library, where should i find information on interregating the system clock? Top

Hi i'm new to the .NET and wonder if anyone could point me in the best direction for any information on how to go about interrogating the system clock. I am trying to create a prototype host based intrusion detection system.

I'm also not sure in which language this would be best achieved.

Many thanks



.NET Development2  
 
 
ahmedilyas





PostPosted: .NET Base Class Library, where should i find information on interregating the system clock? Top

the language can be any .NET Based language, C# or VB.NET - totally your call.

any chance explaining more of what you want to do



 
 
rickyg





PostPosted: .NET Base Class Library, where should i find information on interregating the system clock? Top

Yeah i'm basically trying to say a user is only allowed to log on within a certain time criteria. Between 9am and 5pm for instance.If they log in outwith these times then this is deemed suspicious so take some action.
 
 
ahmedilyas





PostPosted: .NET Base Class Library, where should i find information on interregating the system clock? Top

pretty simple. You can use the DateTime class to get your current time:

DateTime.Now

so when they log in and authentication is successful, check the current time and if its between your values (9 am and 5pm) then cool - continue. So maybe something like:

if (successfulAuthentication)

{

if (DateTime.Now.Hour >= 9 && DateTime.Now.Hour <= 17)

{

//... they can continue

}

}

this is in C#

does this help



 
 
rickyg





PostPosted: .NET Base Class Library, where should i find information on interregating the system clock? Top

Yes that certainly gives me somewhere to start. I'll give it a go and get back to you.

Thanks for the quick reply.


 
 
ahmedilyas





PostPosted: .NET Base Class Library, where should i find information on interregating the system clock? Top

no worries, glad I could help! Be sure to post back should you have more queries.