更改系统日期格式 [英] Change System Date Format

查看:98
本文介绍了更改系统日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码..

RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@Control Panel\International,true);

rkey.SetValue( sShortDate,dd / MM / yyyy);



此更改发生在重启或注销电脑后

怎么办这个代码执行后



谢谢

anushika

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

推荐答案

把它放在Program.cs中的最后一条指令?



真的,没有任何更多的信息或为什么你需要这个的背景,这真的很难给你一个体面的答案。



那些说不存在愚蠢问题的人从来没有读过Codeproject的QA
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


您的代码确实更改了日期格式(如果您打开一个windows_explorer新窗口,您将看到日期采用新格式),但要使桌面显示新格式,您必须重新启动桌面浏览器(see [ ^ ])...

无论如何改变用户设置的格式,如时间日期格式是一种非常糟糕的做法,它很烦人,并且可能类似于使用您的软件的恶意软件行为!
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!


这篇关于更改系统日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆