
用winform调用flashpaper2实现 doc转换swf
cmd命令可以实现转换winform里面不行string[]cmd=newstring[]{"C:\\ProgramFiles\\Macromedia\\FlashPap...
cmd命令可以实现转换 winform里面不行
string[] cmd = new string[] { "C:\\Program Files\\Macromedia\\FlashPaper 2\\flashprinter.exe E:\\aa3.doc -o E:\\output.swf" };
MessageBox.Show(Cmd(cmd));
public static string Cmd(string[] cmd)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.AutoFlush = true;
for (int i = 0; i < cmd.Length; i++)
{
p.StandardInput.WriteLine(cmd[i].ToString());
}
p.StandardInput.WriteLine("exit");
string strRst = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
return strRst; 展开
string[] cmd = new string[] { "C:\\Program Files\\Macromedia\\FlashPaper 2\\flashprinter.exe E:\\aa3.doc -o E:\\output.swf" };
MessageBox.Show(Cmd(cmd));
public static string Cmd(string[] cmd)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.AutoFlush = true;
for (int i = 0; i < cmd.Length; i++)
{
p.StandardInput.WriteLine(cmd[i].ToString());
}
p.StandardInput.WriteLine("exit");
string strRst = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
return strRst; 展开
2个回答
展开全部
System.Diagnostics.Process
p = new System.Diagnostics.Process();
p.StartInfo.FileName = @"E:\工作目录\FlashPaper\FlashPrinter.exe ";//需要启动的程序名
p.StartInfo.Arguments = @" c:\word1.doc -o c:\output.swf";//启动参数
p.Start();//启动
p = new System.Diagnostics.Process();
p.StartInfo.FileName = @"E:\工作目录\FlashPaper\FlashPrinter.exe ";//需要启动的程序名
p.StartInfo.Arguments = @" c:\word1.doc -o c:\output.swf";//启动参数
p.Start();//启动
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询