1
Answer

Server Time Change

Photo of Gaurav Pal

Gaurav Pal

9y
858
1
Hi Members,

I am using below code in both window App and web app. and copy to my NTP server. window application is run on server but we application not working.

Please help.....

void setTime(string timeInYourSystemFormat)
{
var proc = new System.Diagnostics.ProcessStartInfo();
proc.UseShellExecute = true;
proc.WorkingDirectory = @"C:\Windows\System32";
proc.CreateNoWindow = true;
proc.FileName = @"C:\Windows\System32\cmd.exe";
proc.Verb = "runas";
proc.Arguments = "/C time " + timeInYourSystemFormat;
try
{
System.Diagnostics.Process.Start(proc);
}
catch
{
MessageBox.Show("Error to change time of your system");
Application.ExitThread();
}
}

Answers (1)