这是我的工作代码:
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
我知道这一定很容易,但我需要一些帮助。谢谢 !