考虑:
Dim line As String
Using readFile As New StreamReader(SalesUpdateFile)
While (line = readFile.ReadLine) IsNot Nothing
Run Code Online (Sandbox Code Playgroud)
我是 Visual Basic 新手。每次我运行此代码时都会出现此错误:
“IS”需要具有引用类型的操作数
我该如何解决这个问题?
虽然 Konamiman 的答案非常好,但我不喜欢重复自己,因此更喜欢以下模式以避免重复调用ReadLine():
Do
Dim line = reader.ReadLine()
If line Is Nothing Then Exit Do
' Process the line
Loop
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8008 次 |
| 最近记录: |