日期:2014-05-20  浏览次数:20747 次

C# SaveFileDialog 语言问题
我最近用VS2010做winform应用程序开发,用到SaveFileDialog,当我输入的文件名已经存在时,弹出一个对话框提示“File C:\Document and settings\XXX\XXX\XXX.dat already exists. Do you want to replace it?”.但是在中文的环境下它本应该提示“文件 C:\Document and settings\XXX\XXX\XXX.dat 已经存在,要替换它吗?”,简单的说就应中文版出现了英文的提示。
求高手帮忙解答。

------解决方案--------------------
C# code

[DllImport("Kernel32.dll")]
public static extern short GetSystemDefaultLangID();

System.Threading.Thread.CurrentThread.CurrentCulture = 
    System.Globalization.CultureInfo.GetCultureInfo(GetSystemDefaultLangID());