在C#中能否直接调用WIN32API?

wanhayln 2003-07-14 10:42:35
在C#中能否直接调用WIN32API?
...全文
87 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Mattary 2003-10-30
  • 打赏
  • 举报
回复
.NET 与 native 的交互中 P/Invoke, 在System.Runtim.InteropService 空间下.

huguguhu 2003-10-30
  • 打赏
  • 举报
回复
要引用阿,you see

[DllImport("KERNEL32.DLL", EntryPoint="MoveFileW", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall)]
public static extern bool MoveFile(String src, String dst);

public static void Main()
{
bool bl=MoveFile("y","u");
MessageBox.Show(bl.ToString());
}

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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