日期:2014-05-17  浏览次数:20427 次

视频格式 之后 删除原始文件 提示process被占用
格式还在转换之中,但是已经调用了File.Delete(Video_Path)
要在转换格式完成之后才调用File.Delete(Video_Path)
怎样判断是否转换完成?

                    if (fileExt.ToLower() == "avi")
                    {
                        bool add = mydata.ExceSQL(sql);  
                        if (add)
                        {
                            uploadfile.SaveAs(Server.MapPath("~/") + fileName);//
                            //File.Copy(uploadfile.PostedFile.FileName, Server.MapPath("~/") + playFile);//复制一份到playFile *1*
                            bool ok=changeVideoFF(Server.MapPath("~/") + fileName, Server.MapPath("~/") + playFile, Server.MapPath("~/") + videoImg);
                            if (File.Exists(Server.MapPath("~/") + playFile) && File.Exists(Server.MapPath("~/") + videoImg))
                            {
                                Response.Write("<script language=javascript>alert('视频上传AND截图成功');</script>");                            }

                           File.Delete(Server.MapPath("~/") + fileName); 
                        }
                    }