Click here to Skip to main content
15,883,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have problem with Shortdate format i have tried below code its working in Win 7 but not working in Win XP

VB
Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\International", "sShortDate", "dd/MM/yyyy")


MY exact requiremnt is i want change shortDAte Format of as Win XP system

Above Code is Changing the System Short dATe of Win 7 System but not Working in XP

PLease Help
Posted
Updated 23-Jan-14 22:36pm
v3
Comments
phil.o 24-Jan-14 3:37am    
Could you define 'not working'?
Omkaara 24-Jan-14 3:39am    
the system shorDAte Format IN WIN XP is not changing to dd/MM/yyyy
where as in WIN & its Working
Maciej Los 24-Jan-14 3:50am    
Why do you want to change it? Some useres have no provilleges to change it!

Please, read my comment first!

Have a look at Locale[^] and DateTimeFormatInfo[^]. If you want to change short date string using specific format, please use Culture[^]
 
Share this answer
 
Comments
phil.o 24-Jan-14 4:02am    
Right.
What is missing here is the exact requirement: is it to change the system setting programmatically (as I assumed it was), or is it to change the way datetimes are presented to the user in the specific application.
You could try to enclose given code in a try-catch block, so that you could intercept any problem that could happen during its execution.

It could be a permission problem; but impossible to tell exactly with so few details and diagnostic-elements.
 
Share this answer
 
Comments
Maciej Los 24-Jan-14 3:57am    
I'm not sure it would be helpful in this case, but it's valuable answer at all. +4!
Please, see my comment to the question and my answer.
phil.o 24-Jan-14 4:46am    
Thanks by the way :)

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