IIS7中通过C#代码调用的程序不执行?
Processprocess=newProcess();//创建进程对象ProcessStartInfostartInfo=newProcessStartInfo();s...
Process process = new Process(); //创建进程对象
ProcessStartInfo startInfo = new ProcessStartInfo();
string paperroot = ConfigurationManager.AppSettings["PaperPath"].ToString();
if (!File.Exists(paperroot))
{
web_ui.page_erroe("未正确安装文档虚拟打印机", false, "", true);
}
string extname = Path.GetExtension(ReturnStr[0]);
newFileName = Guid.NewGuid().ToString("N") + extname + ".swf";
om.OffDoc_FileNewName = newFileName;
string docFile = Server.MapPath(str_dirFile + Request.QueryString["Path"] + "/" + ReturnStr[0]);
string swfFile = Server.MapPath(str_dirFile + Request.QueryString["Path"] + "/" + newFileName);
Label1.Text = docFile;
int pos = this.Label1.Text.LastIndexOf(@"\");
om.OffDoc_FileName = this.Label1.Text.Substring(pos + 1);
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();
process.WaitForExit(); 展开
ProcessStartInfo startInfo = new ProcessStartInfo();
string paperroot = ConfigurationManager.AppSettings["PaperPath"].ToString();
if (!File.Exists(paperroot))
{
web_ui.page_erroe("未正确安装文档虚拟打印机", false, "", true);
}
string extname = Path.GetExtension(ReturnStr[0]);
newFileName = Guid.NewGuid().ToString("N") + extname + ".swf";
om.OffDoc_FileNewName = newFileName;
string docFile = Server.MapPath(str_dirFile + Request.QueryString["Path"] + "/" + ReturnStr[0]);
string swfFile = Server.MapPath(str_dirFile + Request.QueryString["Path"] + "/" + newFileName);
Label1.Text = docFile;
int pos = this.Label1.Text.LastIndexOf(@"\");
om.OffDoc_FileName = this.Label1.Text.Substring(pos + 1);
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();
process.WaitForExit(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询