G
Guest
have a big problem with this thread, after a long time iterations i get an
error message about few system
resources
Public Function Count1(ByVal iterations As Long) As Long
Dim objInfoProc As New ProcessStartInfo
Dim reg As Regex
Dim response As String = ""
Dim amatch As Match
Dim blnDomTrouv As Boolean = False
Dim i As Integer
Dim t As Thread = Thread.CurrentThread
Dim sr As System.IO.StreamReader
For i = 1 To iterations
Dim objProcess As System.Diagnostics.Process
objProcess = New System.Diagnostics.Process
objProcess.StartInfo.FileName = "nslookup.exe"
objProcess.StartInfo.UseShellExecute = False
objProcess.StartInfo.RedirectStandardOutput = True
objProcess.StartInfo.CreateNoWindow = True
objProcess.StartInfo.Arguments = " -querytype=any " & dominio(i)
& ".com"
objProcess.Start()
sr = objProcess.StandardOutput
objProcess.WaitForExit()
objProcess.Close()
reg = New Regex("nameserver = (?<server>[^\\\s]+)")
Do While (sr.Peek() > -1)
response = sr.ReadLine()
amatch = reg.Match(response)
If (amatch.Success) Then
pinga(i) = "X"
Exit Do
End If
Loop
objProcess.Dispose()
objProcess.Close()
objProcess = Nothing
reg = Nothing
Me.txtDisplay.Invoke(New ChangeTextControlDelegate(AddressOf
SetDisplayText), New Object() {t.Name, txtDisplay, i.ToString, 1})
Next
Me.txtDisplay.Invoke(New ChangeTextControlDelegate(AddressOf
SetDisplayText), New Object() {t.Name, txtDisplay, i.ToString, -9})
Return i
End Function
error message about few system
resources
Public Function Count1(ByVal iterations As Long) As Long
Dim objInfoProc As New ProcessStartInfo
Dim reg As Regex
Dim response As String = ""
Dim amatch As Match
Dim blnDomTrouv As Boolean = False
Dim i As Integer
Dim t As Thread = Thread.CurrentThread
Dim sr As System.IO.StreamReader
For i = 1 To iterations
Dim objProcess As System.Diagnostics.Process
objProcess = New System.Diagnostics.Process
objProcess.StartInfo.FileName = "nslookup.exe"
objProcess.StartInfo.UseShellExecute = False
objProcess.StartInfo.RedirectStandardOutput = True
objProcess.StartInfo.CreateNoWindow = True
objProcess.StartInfo.Arguments = " -querytype=any " & dominio(i)
& ".com"
objProcess.Start()
sr = objProcess.StandardOutput
objProcess.WaitForExit()
objProcess.Close()
reg = New Regex("nameserver = (?<server>[^\\\s]+)")
Do While (sr.Peek() > -1)
response = sr.ReadLine()
amatch = reg.Match(response)
If (amatch.Success) Then
pinga(i) = "X"
Exit Do
End If
Loop
objProcess.Dispose()
objProcess.Close()
objProcess = Nothing
reg = Nothing
Me.txtDisplay.Invoke(New ChangeTextControlDelegate(AddressOf
SetDisplayText), New Object() {t.Name, txtDisplay, i.ToString, 1})
Next
Me.txtDisplay.Invoke(New ChangeTextControlDelegate(AddressOf
SetDisplayText), New Object() {t.Name, txtDisplay, i.ToString, -9})
Return i
End Function