asp.net项目中 利用flashpaper实现百度文库效果

 public void ProcessExec(string sourceFileName, string outPutFileName)
        {
            //FlashPaper文件安装路径 可自行设置
            //string flashPrinter = @"D:\Program Files\FlashPaper2.2\FlashPrinter.exe\";
            string flashPrinter = @"D:\Program Files\FlashPaper2.2\FlashPrinter.exe";
            Process pss = new Process();

            pss.StartInfo.FileName = flashPrinter;
            pss.StartInfo.UseShellExecute = true;
            pss.StartInfo.CreateNoWindow = false;
            pss.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

            pss.StartInfo.Arguments = string.Format(" {0} {1} -o {2}", "\"" +
                flashPrinter + "\"", "\"" + sourceFileName + "\"", "\"" + outPutFileName + "\"");
            try
            {
                pss.Start();
                pss.WaitForExit();
                pss.Close();

                //while (!pss.HasExited)
                //{
                //     continue;
                //}
                System.Threading.Thread.Sleep(4000);
                Response.Write("成功");
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }


            //protected void Button1_Click(object sender, EventArgs e)
            //{
            //    string source = Server.MapPath("doc/cao.txt");
            //    string output = Server.MapPath("swfp/cao.swf");

            //    ProcessExec(source, output);
            //}

posted @ 2012-04-28 09:57  好好学  阅读(1289)  评论(1编辑  收藏  举报