当前位置: 代码迷 >> .NET相关 >> C#声明api函数出错,该如何解决
  详细解决方案

C#声明api函数出错,该如何解决

热度:255   发布时间:2016-04-24 03:04:45.0
C#声明api函数出错
在vs中声明一个对ini文件的写函数
 [System.Runtime.InteropServices.DllImport("kernel32")]
            private static extern long WritePrivateProfilesString(string section, string key, string val, string filePath);

错误 30 命名空间“System.Runtime.InteropServices”中不存在类型或命名空间名称“DllImport”。是否缺少程序集引用
------解决方案--------------------
打错了吧,是DllImport,两个L,一个I。
  相关解决方案