Using webClient = New System.Net.WebClient
Dim owner = ""
Try
owner = webClient.DownloadString("http://" + CurrentBlog.Domain + "/test.php")
Catch ex As Exception
End Try
appendToTextFile(CurrentBlog.Domain + checkdomainsowner(owner) + Microsoft.VisualBasic.vbNewLine, "gooddoorway.txt")
End Using
我想使用threadpool运行它。
这样做的方法是
Threading.ThreadPool.QueueUserWorkItem(
Sub()
Using webClient = New System.Net.WebClient
Dim owner = ""
Try
owner = webClient.DownloadString("http://" + CurrentBlog.Domain + "/test.php")
Catch ex As Exception
End Try
appendToTextFile(CurrentBlog.Domain + checkdomainsowner(owner) + Microsoft.VisualBasic.vbNewLine, "gooddoorway.txt")
End Using
End Sub)
我希望appendToTextFile(CurrentBlog.Domain + checkdomainsowner(owner) + Microsoft.VisualBasic.vbNewLine, "gooddoorway.txt")
与主线程同步。
这样做的简单方法是什么?我不想使用任何control.invoke,因为代码应该独立于任何控件运行。我不想使用全局变量,因为我的TA说这是件坏事。