有个dll:mydll.dll,不能引用
在C#web程式里面我的方法是
using System.Runtime.InteropServices;

  
  [DllImport("mydll.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  public static extern int GetDLLInfo(char[] sDllVer);
  protected void Page_Load(object sender, EventArgs e)
  {
  char[] ss = null;
  int s= GetDLLInfo(ss);
  Response.Write(ss);  }
可是在int s= GetDLLInfo(ss);地方总是提示:Unable to load DLL mydll.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
有神马办法?

解决方案 »

  1.   

    提示很明显了,GetDLLInfo(ss)方法没有在mydll.dll中找到,明白如何解决了吧?
      

  2.   

    char[] ss = null;
      int s= GetDLLInfo(ss);

      Response.Write(ss);
    你怎么搞个null值放到getDllinfo()里
      

  3.   

    GetDLLInfo接受的是一个char数组类型,那我们怎么定义传入调用呢
      

  4.   

    VB的调用方法:
        Dim s As String * 128
        st = GetDLLInfo(s)
    对应的C#应该如何写呢
      

  5.   

    GetDLLInfo(char[] sDllVer)方法接受char类型的参数,你的参数保证是char类型即可。string str="youstring";
    char[] cs = str.ToCharArray();  //将string类型转为char[]
    st=GetDllInfo(s);
      

  6.   

    还是不行,我怀疑是不是dll有问题,是c++写的dll,我在web工程里面,不能引用dll,也不能用regsvr32注册dll