刚入手C#,跟据教程写一段代码,已经加入引用using System.Runtime.InteropServices;
当到 [DllImport("w95_s7.dll")] 时出错了。VS2003中有这个函数吗?

解决方案 »

  1.   

    NET Framework 1.1版本前,SetSuspendState函数也可以使用PInvoke调用,和Application . ... DllImport("Powrprof.dll", SetLastError = true)] ...
      

  2.   


    [DllImport("w95_s7.dll")] 也有代替的吗?
      

  3.   

    有 参考http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute(v=VS.71).aspx
      

  4.   

    “当到 [DllImport("w95_s7.dll")] 时出错了”,说明动态有问题,有多种可能:
    1、动态库名称不正确
    2、动态库位置不正确
    3、依赖的动态库不存在或不在同一目录。。
    楼主好好查查。