我有这个代码
'Open a file for reading
'Get a StreamReader class that can be used to read the file
Dim objStreamReader As StreamReader
Dim variableArray(20) As String
objStreamReader = File.OpenText(filePath)
'Read one line at a time
Dim someString As String
Dim variableNum As Integer = 0
'Iterate through lines
While objStreamReader.Peek() <> -1
someString = objStreamReader.ReadLine()
variableArray(variableNum) = someString
variableNum = variableNum + 1
End While
For Each line As String In variableArray
Next
objStreamReader.Close()
我有一个在日志文件中输出结果的 vbscript,附加在每一行并由“|”分隔 只有两列。
这是VBScript代码的片段
f1.WriteLine("Server Name " & "|" & strName)
f1.WriteLine("OS Name: " & "|" & strCaption)
f1.WriteLine("OS Version: " & "|" & strVersion
f1.WriteLine("CSD Version: " & "|" & strCSDVer
f1.WriteLine("Serial Number: " & "|" & strSerial
我怎样才能让我的代码的 For Each 部分来阅读它,将其分解,然后创建一个显示结果的表格。