/// <summary>
/// 将Office文件转换为Swf(需要print2flash软件)
/// </summary>
/// <param name="srcFile">需要转换的文件地址和文件名</param>
/// <param name="swfFile">转换后文件的目标地址</param>
/// <param name="strProcessPath">print2flash软件的地址(D:\Program Files\Print2Flash3\p2fServer.exe)</param>
public static void ConvertToSwf(string srcFile, string swfFile,string strProcessPath)
{
try
{
//设置进程物理路径
string flashPrinter = strProcessPath;
//创建进程实例
ProcessStartInfo StartInfo = new ProcessStartInfo();
//设置需要启动进程的程序或者文档
StartInfo.FileName = flashPrinter;
//设置需要启动进程的参数
StartInfo.Arguments = srcFile + " " + swfFile;
//是否启动该进程
StartInfo.CreateNoWindow = true;
//创建可以停止和启动进程的实例
Process process = new Process();
//设置进程
process.StartInfo = StartInfo;
//启用进程
bool isStart = process.Start();
process.WaitForExit(1000 * 60 * 5);
}
catch (Exception es)
{
MessageBox.Show(es.Message);
}
}