[英]Visual Basic- “IF” doesn't end
If My.Computer.FileSystem.FileExists("pack/locale_ro.epk") Then My.Computer.FileSystem.DeleteFile("pack/locale_ro.epk")
PB_GSM.Value = 10
If My.Computer.FileSystem.FileExists("pack/locale_ro.eix") Then My.Computer.FileSystem.DeleteFile("pack/locale_ro.eix")
PB_GSM.Value = 20
If My.Computer.FileSystem.FileExists("pack/root.epk") Then My.Computer.FileSystem.DeleteFile("pack/root.epk")
PB_GSM.Value = 30
If My.Computer.FileSystem.FileExists("pack/root.eix") Then My.Computer.FileSystem.DeleteFile("pack/root.eix")
PB_GSM.Value = 40
My.Computer.Network.DownloadFile("http://example")
I believe i wrote everything correct, but it doesn't matter how i write the "if"-s , i can not end them. 我相信我写的一切都正确,但是我写“ if” -s并不重要,我不能结束他们。 if i wrote End if next to a line it says something like "End if must be preceded by a matching if".
如果我在一行旁边写了“如果结束”,它会显示类似“如果必须在结束时加上匹配的如果”的信息。 And another problem , the line about the download link is underlined and it says"Overload resolution failed because no accessible 'DownloadFile' accepts this number of arguments".
另一个问题是,有关下载链接的行带有下划线,并显示“过载解析失败,因为没有可访问的'DownloadFile'接受此数量的参数”。
PS: this is a try for a metin2 patcher, i do not know exactly how to do it but i'm sure this is a way to update the game only at the files that i neeed.Thanks for help:) PS:这是一个尝试使用metin2修补程序的方法,我不知道该怎么做,但我敢肯定这是仅在需要的文件上更新游戏的一种方法。谢谢帮助:)
You have them all in one line. 您将它们全部放在一行中。 Don't put anything after the "Then" keyword.
不要在“ Then”关键字之后放置任何内容。
If My.Computer.FileSystem.FileExists("pack/locale_ro.epk") Then
My.Computer.FileSystem.DeleteFile("pack/locale_ro.epk")
PB_GSM.Value = 10
End If
If looking for an else-if situation, this would be the syntax: 如果寻找else-if情况,则语法如下:
If My.Computer.FileSystem.FileExists("pack/locale_ro.epk") Then
My.Computer.FileSystem.DeleteFile("pack/locale_ro.epk")
PB_GSM.Value = 10
ElseIf My.Computer.FileSystem.FileExists("pack/locale_ro.eix") Then
My.Computer.FileSystem.DeleteFile("pack/locale_ro.eix")
PB_GSM.Value = 20
' etc, etc
End If
Note though that this will only run the code on the first "True" line found. 注意,尽管这只会在找到的第一条“ True”行上运行代码。
For the DownloadFile, you also need to specify the destination: 对于DownloadFile,还需要指定目标位置:
My.Computer.Network.DownloadFile("http://example", "c:\temp\myfile.txt")
Substitute the c:\\temp\\
path with the one you are using. 用您正在使用的路径替换
c:\\temp\\
路径。
When you post the Then
statement followed by an expression that closes that If
statement. 当您发布
Then
语句后跟一个表达式,该表达式关闭该If
语句。 You have, in essence, already closed all your If
statements. 本质上,您已经关闭了所有
If
语句。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.