私は高い値段と低い値を検索しています。私は、form1のテキストボックスから文字列に値を取得する必要があり、私の場合はcopyコマンドやstorescpのようなものを実行するためにform4で使われています。 例: Form1: パブリックstatic string port1 port1 = Pt1.text; dicompath = location.text;複数のテキストボックスの値を別のフォームの文字列に渡すか、別のフォームのテキストボックスから値/文字列を呼び出す
Form4:
port1 = frm1.Port1.Text;
dicompath = frm1.location.text;
finalpath = port1 + " --fork -v -pm -fe .dcm -tn -sp -od " + ((char)34) + dicompath + ((char)34);
Process startInfo2 = new Process();
startInfo2.StartInfo.CreateNoWindow = true;
startInfo2.StartInfo.UseShellExecute = false;
startInfo2.StartInfo.RedirectStandardOutput = true;
startInfo2.StartInfo.RedirectStandardError = true;
startInfo2.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo2.StartInfo.FileName = @"C:\dcmtk\bin\storescp-tls.exe";
startInfo2.StartInfo.Arguments = finalpath;
startInfo2.StartInfo.RedirectStandardOutput = true;
何らかの理由で、「オブジェクト参照がオブジェクトのインスタンスに設定されていません」という問題が引き続き発生します。
'オブジェクトのインスタンスに設定されていません.'あなたのQは私には少し曖昧です。ユーザーはform1に値を入力し、その値をform4に使用したいですか?または、後で何かを実行するために、form1上のユーザー入力値とform4上の別のユーザー入力値を結合したいですか? –
別のフォームから呼び出すことができる独自の変数に格納する(結合しない)約4-6のテキストボックスがあります。 –