DllImport
namespace Util
{
#region
/// <summary>
/// This Class is used for get or set local machine time
/// </summary>
public class Cls_ChangeDT
{
//this function is used for get local machine time
[DllImport("Kernel32.dll")]
public static extern void GetLocalTime(SystemTime st); //this function is used for set local machine time
[DllImport("Kernel32.dll")]
public static extern void SetLocalTime(SystemTime st); //this structure define a systemtime
[StructLayout(LayoutKind.Sequential)]
public class SystemTime
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
} #endregion
}

解决方案 »

  1.   

    应该在.netIDE菜单里面的引用里引用它
      

  2.   

    不是! to wangsaokui(无间道II(前传)) 这个只能用类外面定义的函数,类里的没有办法,提示
    找不到entrypointto joelbh(ILoveYou)直接引用报错说unknow error
      

  3.   

    [DllImport("createFolder")]
    public static extern int createDir(string FolderName);
    [DllImport("CopyFileToPDA")]
    private static extern long CopyFileToWinCE(string strFileNamePC,string strFileNamePPC); 
    [DllImport("CopyFileToPDA")]
    private static extern long ExeFile(string FileName); 
    [DllImport("Kernel32")]
    private static extern long WinExec(string FileName,long status);