現在、Visual Studio に C#/ASP.net アプリケーションがあります。C#/ASP.NET アプリケーション内で使用する必要がある、他の誰かが作成した perl スクリプトもあります。最終的な目標は、C#/ASP.NET コード内で生成された文字列をこの perl スクリプト (文字列はファイル パス) に渡して、perl スクリプトが実行され、適切な出力が得られるようにすることです。
私はすべてを見てきましたが、この例しか見つかりませんでした:
ProcessStartInfo perlStartInfo = new ProcessStartInfo(@"d:\Perl\bin\perl.exe");
perlStartInfo.Arguments = "c:\\word-splitter.pl " + "c:\\a.txt" + " ispell";
perlStartInfo.UseShellExecute = false;
perlStartInfo.RedirectStandardOutput = true;
perlStartInfo.RedirectStandardError = true;
perlStartInfo.CreateNoWindow = false;
Process perl = new Process();
perl.StartInfo = perlStartInfo;
perl.Start();
perl.WaitForExit();
string output = perl.StandardOutput.ReadToEnd();
問題は、このコードを Visual Studio に入れるたびに、このコード ブロックが使用する ProcessStartInfo やその他の名前空間が認識されないことです。アセンブリがありませんか?...また、このブロックは正確に何をしますか? Nuget パッケージとアセンブリを検索しようとしましたが、.NetFramwork V4.5 と互換性がないためにインストールされない PCRE (Perl 互換正規表現) しか見つかりませんでした。
私の質問は、C#/ASP.NET アプリケーション内で perl スクリプトを実行するためのプロトコルは何ですか?
ありがとう。