2
WindowsフォームのappからWindowsの表示出力(終了コード)が可能です。例c#windowsフォーム出力コードをWindowsに表示する
[STAThread]
static void Main(string[] args)
{
if (args.Count() > 0)
{
Environment.Exit(4);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
そして、私はcmdをウィンドウを使用してアプリを実行します。
start test.exe param1 param2 param3
をそして、私はWindowsコンソール "4" の出力を取得します。私は代わりにvoid intを返すようにしました。 Environment.Exit(4)、Console.Writelineを使用してアプリケーションを閉じます。
'cmd'ウィンドウの' echo%ErrorLevel% '? – aschipfl