天天看點

在C#中能否直接調用WIN32API

要引用阿,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());

}

繼續閱讀