0
我有下面的代碼,我想基本上覆制一個不斷變化的文本文件的內容並將其轉儲到文本框顯示,我有下面的代碼,但它不工作在這一刻。VB.net從另一個線程打印到文本框
If Not File.Exists(masterPath) Then
File.Create(masterPath).Dispose()
End If
Try
reader = New StreamReader(chatlog)
Catch
File.Create(chatlog)
bool = False
End Try
If bool Then
'Dim writer As New StreamWriter(masterPath)
Dim text As String
Do Until reader.EndOfStream
text = reader.ReadLine()
logMenu.AppendText(text & Environment.NewLine)
Loop
reader.Close()
File.Delete(chatlog)
File.Create(chatlog).Dispose()
End If
Thread.Sleep(1000)
Loop