C#声明api函数出错

helmo 2013-08-08 09:32:54
在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”。是否缺少程序集引用
...全文
93 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
h82258652 2013-08-12
  • 打赏
  • 举报
回复
打错了吧,是DllImport,两个L,一个I。

1,979

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧