如题,不知道怎么调!!各位帮忙,或者是服务器错误,或者是客户端错?服务器端:
[WebMethod(Description = "返回服务器上的Excel报表模板")]
        public IList getTemplateList()
        {
            string strFolder = @"F:\Project\";
            DirectoryInfo dir = new DirectoryInfo(strFolder);
            List<string> files = new List<string>();            foreach (FileInfo fChild in dir.GetFiles("*.xlt")) //设置文件类型
            {
                files.Add(fChild.Name); //网list里面添加文件名
            }            return files;        }VB客户端:
      Dim Soap As New SoapClient30
      Dim strTemplete As String
      Dim arrTemplete() As String
  
      Soap.MSSoapInit strWebService
      strTemplete = Soap.getTemplateList      '上面这一句报 灾难性故障      For i = 0 To UBound(arrTemplete)
        ctrlListTemplate.AddItem (arrTemplete(i))
      Next

解决方案 »

  1.   

    arrTemplete在哪赋值?你看看strTemplete 的值是什么
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 
    http://feiyun0112.cnblogs.com/
      

  2.   

    呵!谢谢!你说的那个是我笔误我把
    服务端改成这样就好了  [WebMethod(Description = "返回服务器上的Excel报表模板")]
            public string[] getTemplateList()
            {
                string strFolder = @"F:\Project\BizFramework\Module\ReportMdl\rptTemplate";
                DirectoryInfo dir = new DirectoryInfo(strFolder);            string[] files = new string[dir.GetFiles("*.xlt").Length];            int i = 0;
                foreach (FileInfo fChild in dir.GetFiles("*.xlt")) //设置文件类型
                {
                    files[i] = fChild.Name;
                    i++;
                }            return files;        }