void Convert(string filepath)
        {
            string fppath = System.Configuration.ConfigurationManager.AppSettings["DocumentPath"];
            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;
            }这个是我的调用代码,当我的filepath参数传绝对路径,程序运行没错,但是当我的在页面中放入FileUpload控件时,我的程序不执行,也不报错,就连断点也不执行,这是为什么啊,请哪位高手指点一下,谢谢了。

解决方案 »

  1.   

    1,权限问题。匿名帐号没有执行exe权限,需要提升权限
    2,FileUpload你必须先 FileUpload.Save(xx)成服务器上的物理路径才能才能进行转换
      

  2.   

    string file = fpath.PostedFile.ToString();
                fpath.SaveAs(file);
                Convert(file);
    为什么我这样写了还是没用。
      

  3.   

    String f = Server.MapPath("~/") +  System.IO.Path.GetFileName(fpath.FileName);
    fpath.SaveAs(f);
    Convert(f);
      

  4.   

    String f = Server.MapPath("~/") + System.IO.Path.GetFileName(fpath.FileName);
    fpath.SaveAs(f);
    Convert(f);
    这个我也试了,好像还是没用,有别的方法吗?
      

  5.   

    你的操作系统是server 2003吧?
    如果是的话,就不要把时间浪费在设置权限上了,flashpaper在server 2003下的iis里面无法调用。
    想象其他方法把。