引用里加上 System.Runtime.InteropServices
vs2005里有DllImport

解决方案 »

  1.   

    我这里已经加了System.Runtime.InteropServices
    但没有的
      

  2.   

    “/WebSite1”应用程序中的服务器错误。
    --------------------------------------------------------------------------------编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS1513: 应输入 }源错误: 行 14:     protected void Page_Load(object sender, EventArgs e)
    行 15:     {
    行 16:         [DllImport("wininet.dll")]
    行 17:         private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
    行 18:         int flag;
     源文件: d:\My Documents\Visual Studio 2005\WebSites\WebSite1\Default.aspx.cs    行: 16 
      

  3.   

    你的什么版本,我用的TS版本有DLLIMPORT的。