最好的重载方法匹配有一些无效的参数

nat*_*tli 8 c#

TryGetValue出于某种原因无法上班.

Dictionary<String,String> testdict = new Dictionary<String,String>();
String teststr = "test";
if(testdict.TryGetValue(teststr,out value))
{
    //Ladida
}
Run Code Online (Sandbox Code Playgroud)

收到错误:

The best overloaded method match for 'System.Collections.Generic.Dictionary<string,string>.TryGetValue(string, out string)' has some invalid arguments
Run Code Online (Sandbox Code Playgroud)

谁能告诉我我的代码有什么问题?

Nic*_*Tek 8

创建字典后添加以下行:

String value = "";
Run Code Online (Sandbox Code Playgroud)