2012-04-10 3 views
0

このエラーを取得:C#無効なオプションファイルオプション:パッド= OPER

System.Diagnostics.Process pProcess = new System.Diagnostics.Process(); 
    pProcess.StartInfo.FileName = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Astyle.exe"; 

    //strCommandParameters are parameters to pass to program 
    //pProcess.StartInfo.Arguments = "--style=ansi --recursive "+System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)+"/*.cpp"; 

    pProcess.StartInfo.Arguments = " options=none test.cpp"; 
    //pProcess.StartInfo.Arguments = " -h"; 
    pProcess.StartInfo.UseShellExecute = false; 

    //Set output of program to be written to process output stream 
    pProcess.StartInfo.RedirectStandardOutput = true; 
    pProcess.StartInfo.RedirectStandardError = true; 
    //Optional 
    pProcess.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 

    //Start the process 
    pProcess.Start(); 

    //Get program output 
    string strOutput = pProcess.StandardOutput.ReadToEnd(); 
    string strError = pProcess.StandardError.ReadToEnd(); 
    //Wait for process to finish 
    pProcess.WaitForExit(); 

答えて

1

経由のastyleを起動しようとしている上の無効なオプションファイルのオプションあなたがthis linkを見てみた場合、正しい構文は

--options=none 
のようです
+0

+1リンクがなくてもドキュメントを掘り下げる – alexn

+0

@kingpin:あなたの問題を解決したのかどうか疑問に思っています... – Marco

+0

はい解決済み..... thnx:D – kingpin