protected void Page_Load(object sender, EventArgs e){if (!IsPostBack){videofile();}}public void videofile(){DataList1.DataSource = vob.getvideos();DataList1.DataBind();}if (this.FileUpload1.HasFile){string userflname = ".\\upload" + "\\"; //".\\userfolder\\" + ufdname + "\\";string cliptype = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName);if (cliptype == ".mpeg"){string clipname = FileUpload1.PostedFile.FileName;string name = clipname.Substring(clipname.LastIndexOf(@"\"));string name1 = name.Remove(name.IndexOf(@"."));string name2 = name1.Substring(1);string newclipname = (string)Session.SessionID + "_" + name2 + 1;string uploadpath = Request.MapPath(".\\upload\\");FileUpload1.PostedFile.SaveAs(uploadpath + newclipname);string apppath = Request.PhysicalApplicationPath;string inputpath = apppath + "upload\\" + newclipname;string ss = apppath + "upload\\" + newclipname;string outputpath = apppath + userflname + newclipname + ".flv";string fileargs = " -i \"" + inputpath + "\" \"" + outputpath + "\"";System.Diagnostics.Process proc = new System.Diagnostics.Process();proc.StartInfo.FileName = apppath + "ffmpeg\\ffmpeg.exe";proc.StartInfo.Arguments = fileargs;proc.StartInfo.UseShellExecute = false;proc.StartInfo.CreateNoWindow = false;proc.StartInfo.RedirectStandardOutput = false;proc.Start();proc.WaitForExit();string inputpath1 = apppath + userflname + newclipname + ".flv";string outputpath1 = apppath + userflname + "%d" + newclipname + ".jpg";string fileargs1 = " -i \"" + inputpath1 + "\" -an -ss 00:00:04 -an -r 1 -vframes 1 -y \"" + outputpath1 + "\"";System.Diagnostics.Process proc1 = new System.Diagnostics.Process();proc1.StartInfo.FileName = apppath + "ffmpeg\\ffmpeg.exe";proc1.StartInfo.Arguments = fileargs1;proc1.StartInfo.UseShellExecute = false;proc1.StartInfo.CreateNoWindow = false;proc1.StartInfo.RedirectStandardOutput = false;proc1.Start();proc1.WaitForExit();File.Delete(ss);string dt = System.DateTime.Now.ToShortDateString();string movie1 = newclipname + ".flv";string img1 = "1" + newclipname + ".jpg";string s = userflname + movie1;string s1 = userflname + img1;string str11 = Request.PhysicalApplicationPath;System.IO.FileStream theFLV = System.IO.File.OpenRead(str11 + s);string vidpath = userflname + newclipname + ".flv";string vidpic = userflname + img1;vob.getvideo_path = vidpath;vob.getvideo_pic = vidpic;vob.getcaption = TextBox1.Text;vob.getwhen = DateTime.Now;vob.videoinsert();}else if (cliptype == ".flv" || cliptype == ".swf"){string clipname = FileUpload1.PostedFile.FileName;string name = clipname.Substring(clipname.LastIndexOf(@"\"));string name1 = name.Remove(name.IndexOf(@"."));string name2 = name1.Substring(1);string newclipname = (string)Session.SessionID + "_" + name2 + 1;string uploadpath = Request.MapPath(".\\upload\\");FileUpload1.PostedFile.SaveAs(uploadpath + newclipname);string apppath = Request.PhysicalApplicationPath;string inputpath = apppath + "upload\\" + newclipname;string ss = apppath + "upload\\" + newclipname;string outputpath = apppath + userflname + newclipname + ".flv";string fileargs = " -i \"" + inputpath + "\" \"" + outputpath + "\"";System.Diagnostics.Process proc = new System.Diagnostics.Process();proc.StartInfo.FileName = apppath + "ffmpeg\\ffmpeg.exe";proc.StartInfo.Arguments = fileargs;proc.StartInfo.UseShellExecute = false;proc.StartInfo.CreateNoWindow = false;proc.StartInfo.RedirectStandardOutput = false;proc.Start();proc.WaitForExit();string inputpath1 = apppath + userflname + newclipname + ".flv";string outputpath1 = apppath + userflname + "%d" + newclipname + ".jpg";string fileargs1 = " -i \"" + inputpath1 + "\" -an -ss 00:00:04 -an -r 1 -vframes 1 -y \"" + outputpath1 + "\"";System.Diagnostics.Process proc1 = new System.Diagnostics.Process();proc1.StartInfo.FileName = apppath + "ffmpeg\\ffmpeg.exe";proc1.StartInfo.Arguments = fileargs1;proc1.StartInfo.UseShellExecute = false;proc1.StartInfo.CreateNoWindow = false;proc1.StartInfo.RedirectStandardOutput = false;proc1.Start();proc1.WaitForExit();File.Delete(ss);string dt = System.DateTime.Now.ToShortDateString();string movie1 = newclipname + ".flv";string img1 = "1" + newclipname + ".jpg";string s = userflname + movie1;string s1 = userflname + img1;string str11 = Request.PhysicalApplicationPath;System.IO.FileStream theFLV =System.IO.File.OpenRead(str11 + s);string vidpath = userflname + newclipname + ".flv";string vidpic = userflname + img1;vob.getvideo_path = vidpath;vob.getvideo_pic = vidpic;vob.getcaption = TextBox1.Text;vob.getwhen = DateTime.Now;vob.videoinsert();}TextBox1.Text = "";}else{Page.RegisterStartupScript("vob", "");}videobind(); }