Gettime from server

Drstein99

Well-known member
Joined
Sep 26, 2003
Messages
283
Location
Audubon, Nj
Hello all, I have a simple question, I cant seem to find the answer to please help.

I want to get the time from my windows domain server, and also possibly synchronize that time on the local machine.

Im writing software that tracks statistics, so its very important for me to have the precise time when I record the data. Thanks.
 
Code:
Dim ps As New System.Diagnostics.ProcessStartInfo
        ps.FileName = "Net"
        ps.Arguments = "SEND \\<servername> /set /yes"

        Dim p As New System.Diagnostics.Process
        p.StartInfo = ps
        p.Start()
        p.WaitForExit()
 
I cut and pasted your code into a commandbutton click sub

replaced <<servername>> with the server I want to get time from, i .e:

"SEND \\MYSERV /set /yes"


Does not synchronize time with the server.
 
before you call the Start method add the line
Code:
ps.WindowStyle=ProcessWindowStyle.Hidden

Dispose isnt really needed on ps as it doesnt have any unmanged resources so the Garbage collector will sort it out for you anyway.
 
Back
Top