Hi ABC, you said that you wanted to retrieve the short date pattern
that you specified in Control Panel, right? As far as I know, the
invariant info always returns the same thing whatever culture and
settings are. I think it returned what you expected was just a
coincidence. Have you tried changing things in Control Panel and run it
again?
I think the Current info would work. I suspect that you have changed it
prevously somewhere in your application. To test this, you might write
a simple console program which writes current culture info on screen.
If you have changed the app current culture, and then want to get the
user's regional settings in Control Panel, you should backed up the
current culture before changing it. A alternative is using my code
above, but instead of CultureInfo.CurrentCulture.LCID, you might want
to get the LCID by using Windows API GetUserDefaultLCID function.
Regards,
Thi -
http://thith.blogspot.com