Reputation: 97
Hello all,
How would I go about turning off automatic internet time synchronization using C#?
I know I can turn it off by going to (Adjust Date & Time -> Internet Time) but I need to do it through C#. Maybe a registry key change?
Thanks much! Luke
Upvotes: 2
Views: 1593
Reputation: 97
I figured it out:
try
{
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters",
"Type", "NoSync", RegistryValueKind.String);
}
catch
{
Console.WriteLine("Could not change internet time sync. Registry error!!!");
}
Upvotes: 3