小编lan*_*981的帖子

错误字符串编码(Windows 10 + Visual Studio 2015 + Net 4.6)

我的代码:

Keys = new Dictionary<string, string>();
Keys.Add("?????_0", "raid_0");
Run Code Online (Sandbox Code Playgroud)

当我得到时Keys.ElementAt(0),我有这个:{[Íàáåã_0, raid_0]}.当然,当我运行程序时,key = "?????_0"没有定义,程序崩溃了System.Collections.Generic.KeyNotFoundException

当我使用Windows 8.1 + Visual Studio 2013 + net 3.5时,此代码工作正常

我该如何解决?

c# dictionary character-encoding visual-studio-2015 .net-4.6

6
推荐指数
2
解决办法
5160
查看次数