ファイルの印刷に問題があり*.prn
ます。これはコードです:
Process process1 = new Process();
process1.StartInfo.FileName = "copy";
process1.StartInfo.Arguments = string.Format(@" /b C:/test/test.prn \\127.0.0.1\{0}",
SelectPrinterForm.selectedLine);
process1.Start();
でSelectPrinterForm.selectedLine
私は選ばれたプリンターの名前を持っています。情報がファイルを見つけることができないStart()
メソッドでエラーが発生しました。
編集(スタックトレースを追加):
w System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
w System.Diagnostics.Process.Start()
質問:
このエラーが発生する理由について何か提案はありますか?
また、なぜ「@」を使用すると、"\\\\"
代わりにまだ持っているの"\\"
ですか?
ハンス・パッサントと上記の彼の答えの助けを借りた解決策
Process process1 = new Process();
string computerFullName = Program.GetFQDN();
process1.StartInfo.FileName = "cmd.exe";
process1.StartInfo.Arguments = string.Format(@" /c copy /B C:\test\test.prn \\{0}\{1}",
computerFullName,
SelectPrinterForm.selectedLine);
process1.Start();