private static string myProcess(string str) { byte[] buffer = Convert.FromBase64String(str); return "123"; } private void btnTest_Click(object sender, EventArgs e) { bool OK= getStr(new Func<string, string>(null, (IntPtr) myProcess)); //这里报错:无法将方法组“myProcess”转换为非委托类型“System.IntPtr”。能否希望调用方法? }
求指导,万分感谢。
解决方案
40
new Func<string, string>(null, (IntPtr) myProcess)改成:new Func<string, string>(myProcess)