C#做的webservice获取目录下文件,失败

写了段获取目录下的文件信息,结果调用时,报错
图片说明
public Int32 GetserverImages(string imgFileKind, ref Fileinfos[] strFileinfos, ref string strMsg, ref Int32 irtn)
{
List str_fileinfos = new List(strFileinfos);
string path = ConfigurationManager.ConnectionStrings["FilePath"].ConnectionString;
DirectoryInfo folder = new DirectoryInfo(path);
foreach (FileInfo file in folder.GetFiles())
{
str_fileinfos.Add(new Fileinfos(file.Name,
file.Name,
file.Name,
file.FullName,
file.CreationTime.ToString(),
file.LastAccessTime.ToString(),
file.LastWriteTime.ToString()));
}
strFileinfos = str_fileinfos.ToArray();
irtn = 1;
strMsg = "获取文件资料成功!";
return 1;
}

查看全部
arfa12
arfa12
2016/01/14 10:15
  • c#
  • web service
  • 点赞
  • 收藏
  • 回答
    私信

1个回复