62,047
社区成员
发帖
与我相关
我的任务
分享
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
using System.Text;
using System.Diagnostics;
namespace WebApplication1
{
public partial class WebForm8 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Process process = new Process(); //创建进程对象
//try
//{
ProcessStartInfo startInfo = new ProcessStartInfo();
string paperroot = @"C:\FlashPaper\FlashPrinter.exe";
string docFile = Server.MapPath("Lee.doc");
string swfFile = Server.MapPath("Lee.swf");
startInfo.FileName = paperroot;
startInfo.Arguments = docFile + " -o " + swfFile;
startInfo.UseShellExecute = false; //不使用系统外壳程序启动
startInfo.RedirectStandardInput = false; //不重定向输入
startInfo.RedirectStandardOutput = false; //重定向输出
startInfo.CreateNoWindow = true; //不创建窗口
process.StartInfo = startInfo;
process.Start();
Response.Write("已经提交生成。<br />");
Response.Write(paperroot + "<br />" + docFile + " = " + swfFile);
//}
//catch (Exception ex)
//{
// Response.Write(ex.Message);
//}
//finally
//{
if (process != null)
process.Close();
// Response.Write("<br />finally");
//}
}