当前位置:软件学习 > Flash >>

.net 调用 FlashPaper 实现文档转换为SWF

public static void TransformFile(string filepath)

{
string fppath = System.Configuration.ConfigurationManager.AppSettings["Flash易做图"];
string outpath = filepath.Substring(0, filepath.LastIndexOf(.)) + ".swf";
string param = fppath + " " + filepath + " -o " + outpath;
Process p = new Process();
p.StartInfo.FileName = "C:\WINDOWS\system32\cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
//p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
try
{
p.Start();
string strOutput = null;
p.StandardInput.WriteLine(param);
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
Console.WriteLine(strOutput);
p.WaitForExit();
p.Close();
}
catch (Exception ex)
{
throw ex;
}
}

 

注意:如果不能正常操作,是权限的问题,以iis 为例,请把IUSR_xxx授权到读写的文件夹。

    
补充:软件开发 , C# ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,