日期:2014-05-18 浏览次数:20469 次
switch (extensionFilename) { case "doc": case "xls": case "txt": FileStream batFile = new FileStream(Server.MapPath("del.bat"), FileMode.Truncate); StreamWriter sw = new StreamWriter(batFile); string flashpaper2path = linq.Information.Single(i => i.Name == "flashpaper2path").Contents; sw.Write(flashpaper2path + " " + originalFile + " -o " + flashFile); //sw.Write("del C:\\Users\\Administrator\\Desktop\\1.txt"); //sw.Write("C:\\Windows\\system32\\notepad.exe"); sw.Close(); batFile.Close(); ToFlash(); newfile.FileRead = true; break; default: newfile.FileRead = false; break; }
protected void ToFlash() { System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(); psi.FileName = Server.MapPath("del.bat"); //psi.UseShellExecute = false; //psi.CreateNoWindow = true; System.Diagnostics.Process.Start(psi); }