vb.net BC30205 VB 中预期的语句结束
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38507799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
BC30205 End of statement expected in VB
提问by ACift
I'm having issues with VB.net.
我在使用 VB.net 时遇到问题。
I'm trying to make a file pumper for myself, but I'm not really having much luck with it. upon typing a whole line of code, I eventually stumble upon the error of "BC30205 End of statement expected". I know this error has been asked here before, but my code is different.. I guess...Thhe specific line that gives me an error is:
我正在尝试为自己制作一个文件泵,但我真的不太走运。键入一整行代码后,我最终偶然发现了“BC30205 End of statement expected”的错误。我知道这里之前已经问过这个错误,但我的代码是不同的..我猜...给我一个错误的具体行是:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load rbtnMegaByte.Checked = True
Visual Studio recommends me to delete both "System" in the code and keep it as "Object" and "EventArgs" but upon listening to Visual Studio I still have the "End of statement expected" error.
Visual Studio 建议我删除代码中的“System”并将其保留为“Object”和“EventArgs”,但是在听 Visual Studio 时我仍然有“End of statement expected”错误。
I'm not really the best at this, so sorry if this is a really easy mistake.
我在这方面并不是最擅长的,如果这是一个非常容易的错误,那么抱歉。
回答by Matt Wilko
That one line of code:
那一行代码:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load rbtnMegaByte.Checked = True
Should be two lines:
应该是两行:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
rbtnMegaByte.Checked = True
I guess you have copied and pasted this from somewhere and it hasn't preserved the carriage returns?
我猜你是从某个地方复制粘贴的,它没有保留回车符?
You will also need End Subfurther down but I assume that you have that already? So your subroutine should look like this:
您还需要End Sub进一步下降,但我认为您已经有了?所以你的子程序应该是这样的:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
rbtnMegaByte.Checked = True
'Any other code here
End Sub
回答by Sanjiv Dhakal
This error may raised if you forget to close any block, check your blocks i.e check end iffor any if or check end subfor sub etc. it would be better if you share some more code of that module
如果您忘记关闭任何块,则可能会引发此错误,检查您的块,即检查end iffor any if 或检查end subfor sub 等。如果您共享该模块的更多代码会更好

