これが私の作業コードです:
Dim commands() =
{
"stmotd -a {0}",
"stmotd -b 15 {0}"
}
Dim objLines = File.ReadAllLines("C:\temp\sObj.txt")
'Dim getcount = objLines.Length
Using SW As New IO.StreamWriter("c:\temp\MPadd.txt", True)
For Each line In objLines
For Each cmd In commands
SW.WriteLine(String.Format(cmd, line))
Next
Next
End Using
ここで、sObj.txt ファイルに次のエントリが含まれていると「言う」
WINMAC
WINPPC
WINVPN
上記のコードで得られる出力は次のとおりです。
stmotd -a WINMAC
stmotd -b 15 WINMAC
stmotd -a WINPPC
stmotd -b 15 WINPPC
stmotd -a WINVPN
stmotd -b 15 WINVPN
しかし、私は次のように出力したい:
stmotd -a WINMAC WINPPC WINVPN
stmotd -b 15 WINMAC WINPPC WINVPN
とても簡単なはずですが、ここで助けが必要です。ありがとう !