私のアプリを開くコードです。そして自分のアプリケーションに引数を送信します。別のアプリケーションから文字列を取得
public partial class MainForm : Form
{
//public string[] ict_barcodes { get; set; }
class ParamHolder
{
public static string[] Params { get; set; }
}
public MainForm(string[] ict_barcodes)
{
InitializeComponent();
ParamHolder.Params = ict_barcodes;
}
private void MainForm_Load(object sender, EventArgs e)
{
try
{
MessageBox.Show(ParamHolder.Params[0]);
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
}
}
しかし、それは動作しませんでした:
Process.Start("C:\\Users\\Laca\\Documents\\Visual Studio 2013\\Projects\\SMT_Previous_StationsChecker_Before_ICT\\SMT_Previous_StationsChecker_Before_ICT\\bin\\Debug\\SMT_Previous_StationsChecker_Before_ICT.exe", "test");
私はそれを処理しようとしました。次のエラーが表示されます。
Application.Run(new MainForm()); ->>Error 1 'SMT_Previous_StationsChecker_Before_ICT.MainForm' does not contain a constructor that takes 0 arguments C:\Users\Laca\Documents\Visual Studio 2013\Projects\SMT_Previous_StationsChecker_Before_ICT\SMT_Previous_StationsChecker_Before_ICT\Program.cs 18 29 SMT_Previous_StationsChecker_Before_ICT
ご存じですか?あなたは次のように入力パラメータを追加する必要が
に、このパラメータを渡す
を何欲しいですか。問題を明記してください。 'MainForm'はどこで作成しますか? – Marusyk
別のプログラムが私のプログラムを開いてプログラムに文字列を送り、それを処理する必要がありますが、それは動作しません。 –
そして、そのコードはどこですか? [質問する方法](http://stackoverflow.com/help/how-to-ask)を参照し、質問の編集リンクを使用して追加情報を追加してください – Marusyk