private string deletePictureFile(string fileFullPath)
{
try
{
string[] pathList = fileFullPath.Split(",");
string path;
for(int i=0;i<pathList.Length;i++)
{
path = pathList[i];
if (Directory.Exists(path))
{
// 2、根据路径字符串判断是文件还是文件夹
FileAttributes attr = System.IO.File.GetAttributes(path);
// 3、根据具体类型进行删除
if (attr == FileAttributes.Directory)
{
// 3.1、删除文件夹
Directory.Delete(path, true);
}
else
{
// 3.2、删除文件
System.IO.File.Delete(path);
}
System.IO.File.Delete(path);
}
}
return "success!";
}
catch (Exception ex) // 异常处理
{
return "false";// 异常信息
}
}