質問

このバットファイル "iarp.bat"

Content Begin
@ECHO OFF
npg -vv -f %1 -d %2
Content End
.

と、最初の引数とデバイス名(以前に宣言された変数)としてファイル名(ループ内)を2番目の引数として渡しようとしています。私はこれをやろうとしています:

for (int i = 1; i < arpFiles.Count; i++) {

p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.WorkingDirectory = Application.StartupPath;
p.StartInfo.FileName = Application.StartupPath + "\\iARP.bat";
String argument1 = Application.StartupPath + "\\" + arpFiles[0].Name;
p.StartInfo.Arguments = argument1 + deviceName;
p.StartInfo.Verb = "runas";
p.StartInfo.CreateNoWindow = true;
p.Start();
}
.

btw arpfiles= list. しかし、それは誰もがこれを手伝ってくれることはできませんか?

役に立ちましたか?

解決

Argumentsプロパティですべてを指定する必要があります。

p.StartInfo.Arguments = string.Format("{0} {1}", argument1, argument2);
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top