Você está na página 1de 1

Sub Main()

Dim startTime As DateTime = DateTime.Now


Dim i As Integer = 0
Dim Strbuilder As New StringBuilder
Dim StrVal As String() = New String() {}
Dim ioLine As String ' Going to hold one line at a time
Dim ioLines As String ' Going to hold whole file
Dim ioFile As New StreamReader("C:\Documents and
Settings\309615\Desktop\LPMJson.txt")
ioLine = ioFile.ReadLine
ioLines = ioLine
While Not ioLine = ""
ioLine = ioFile.ReadLine
ioLines = ioLines & vbCrLf & ioLine
End While

StrVal = ioLines.Split(":")
For i = 0 To StrVal.Length - 1
If Not StrVal(i).Contains("{") AndAlso Not StrVal(i).Contains("}") Then
Strbuilder.Append((StrVal(i).Split(",")
(0)).ToString().Replace("""", "") & ",")
If i = StrVal.Length Then
Exit Sub
End If
End If
Next

Dim executionTime As TimeSpan = DateTime.Now - startTime


MessageBox.Show(executionTime.TotalMilliseconds.ToString() & "
Miliseconds.")
End Sub

Você também pode gostar