只是NetShareEnum有错,不知道错怎么改才全部贴上来的..

解决方案 »

  1.   

    提示错误如下:
    f:\myproject\windowsapplication1\form1.cs(142,19): error CS0029: 无法将类型“WindowsApplication1.frMain.SHARE_INFO_1”隐式转换为“System.IntPtr”
    f:\myproject\windowsapplication1\form1.cs(145,8): error CS1502: 与“WindowsApplication1.frMain.NetShareEnum(string, uint, ref System.IntPtr, uint, ref uint, ref uint, ref uint)”最匹配的重载方法具有一些无效参数
    f:\myproject\windowsapplication1\form1.cs(145,32): error CS1503: 参数“3” : 无法从“System.IntPtr”转换为“ref System.IntPtr”
      

  2.   

    没错,你的api引用有问题,在类型转化的时候没有正确的设置
      

  3.   

    楼主的代码是不是从这个连接上看到的?你好像没有看完全吧!Marshal.PtrToStructure这段调用,你的代码中没有。如果想找更多的资料,你到google上找:NetShareEnum C#即可。
      

  4.   

    哦,我知道ildasm了,谢谢楼上各位!我再试一下!