我使用的線程文件和進程的內容閱讀。我有以下代碼:我該如何解決這個「不設置到對象的實例對象引用,使用新的」錯誤
Dim line As String = Nothing
Dim result As String = Nothing
Dim solved As Boolean
While strReader.EndOfStream <> True
SyncLock strReader
line = strReader.ReadLine()
result = "ERROR"
End SyncLock
solved = False
While solved = False
result = Process(line)
If Not result.Contains("ERROR") Then
solved = True
End If
End While
//some code
End While
,它給我的錯誤在行:如果不result.Contains(「ERROR」)然後
與標籤工作正常,但我看書上說他們是壞的編碼。
我怎樣才能擺脫這種錯誤的?我究竟做錯了什麼?
謝謝!
什麼是'過程()'?顯示你的函數的代碼,它似乎返回'Nothing'。這是一堂課嗎? – 2012-04-24 22:56:21
是的,你說得對,它被定義爲沒有第一 – 2012-04-24 22:58:08
顯示你的過程代碼() – JohnFx 2012-04-24 22:58:42