看来人气不够啊,楼主!
我帮你顶一下先!

解决方案 »

  1.   

    先关闭文件流在删 System.Text.Encoding resEncoding = System.Text.Encoding.GetEncoding("gb2312");//设置编码
    System.IO.FileInfo f = new FileInfo(Server.MapPath(RootDir + "/delinfo.txt"));
    System.IO.StreamWriter MyWriter = new StreamWriter(f.OpenWrite().ToString(),true,resEncoding,1000);
    tmpPath = Server.MapPath(RootDir +"/"+ Now_UserId.ToString() +"/"+ strDelPathInfo[i].ToString() + ".jpg");
    if (File.Exists(tmpPath))
    {   
    try
    {   
     MyWriter.Close();
    File.Delete(tmpPath);
    }
    catch
    {
    MyWriter.WriteLine(tmpPath);
    MyWriter.Close();
    }
    }