1

現在、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();

リンクはこちら: http://social.msdn.microsoft.com/Forums/vstudio/en-US/ea9455e1-b254-49e1-99df-41718ea80b5b/how-to-run-perl-scripts-in-c

問題は、このコードを Visual Studio に入れるたびに、このコード ブロックが使用する ProcessStartInfo やその他の名前空間が認識されないことです。アセンブリがありませんか?...また、このブロックは正確に何をしますか? Nuget パッケージとアセンブリを検索しようとしましたが、.NetFramwork V4.5 と互換性がないためにインストールされない PCRE (Perl 互換正規表現) しか見つかりませんでした。

私の質問は、C#/ASP.NET アプリケーション内で perl スクリプトを実行するためのプロトコルは何ですか?

ありがとう。

4

1 に答える 1