我正在尝试将文本写入文件,并且除了一个错误之外都拥有它。它说“预期表达”
这是代码:
Using writer As StreamWriter = New StreamWriter(filepath)
writer.Write("[HealthBarSettings]" & vbNewLine & _
"MaxHealthTicks = 50" & vbNewLine & _
"MaxHealthMicroTicks = 100" & vbNewLine & _
"DefaultHealthPerMicroTick = 50" & vbNewLine & _
"DefaultHealthPerTick = 200" & vbNewLine & _
"DefaultHealthPerMegaTick = 1000" & vbNewLine & _
& vbNewLine & _
"TickAlpha = 200" & vbNewLine & _
"MicroTickAlpha = 140" & vbNewLine & _
"MicroTickHeight = 0.5" & vbNewLine & _
"MegaTickAlpha = 255" & vbNewLine & _
"TickThickness = 1.0" & vbNewLine & _
"MicroTickThickness = 1.0" & vbNewLine & _
"MegaTickThickness = 2.0" & vbNewLine & _
& vbNewLine & _
"UseCompression = 1" & vbNewLine & _
"GoTransparent = 1" & vbNewLine & _
错误出现在第 8 行,如果它显示“& vbNewLine & _”,而该行没有其他内容,则第一个 & 带有下划线。像这样的其他行没有错误。