代碼
//SWF檔案產生
string cmdpath = "C:\WINDOWS\system32\cmd.exe";
string swfpath = "";//Flash工具所在路徑
Process p = new Process();
p.StartInfo.FileName = cmdpath;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string strOutput = null;
p.StandardInput.WriteLine(exepath + " " + sourcepath + " -o " + despath);
//p.StandardInput.WriteLine(@"c:\FlashPaper2.2\FlashPrinter.exe c:\測試文檔.txt -o c:\output.swf");
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
Console.WriteLine(strOutput);
p.WaitForExit();
p.Close();
//SWF開啟
代碼
//SWF檔案開啟
<embed id='swf' src='c:\output.swf' quality='high' width='1000' height='600' name='as-js' align='middle' allowscriptaccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />