obtaining date/time values from a Time Server

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can go to a command prompt and type:

net time \\<any server name here>

and this utility will display the time on that server. i have applications that need to use the date and time returned by the command above when creating records for our databases. How can I obtain the date/time value for a given server programmatically?
 
Hi Patrick:

One way to use a command line program from .net is the Process class.
Look up the System.Diagnostics.Process class in help. This class will
allow you to start a process (with parameters) and read the standard
output stream.
 
Back
Top