Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use following Code..
RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\International", true);
rkey.SetValue("sShortDate", "dd/MM/yyyy");

This Change happen after restart or log off the computer
how to do this after code execution

thanks
anushika
Posted

Place it as the last instructions in your Program.cs?

Really, without any more information or the context of why you need this, it's really hard to give you a decent answer.

People who say dumb question don't exist never read Codeproject's QA
 
Share this answer
 
Your code changes date format indeed (if you open a windows_explorer new window you will see that the dates are in the new format), but to make desktop show the new format you have to restart the desktop explorer (see[^])...
Anyway changing the format of a user setup, as the time-date format is, is a very bad practice, it is annoying and can resemble a malware behaviour for who use your software!
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900