Исправить код скачивания интернет страницы - VB

Формулировка задачи:

Не работает, ругается, на выделенную строку пишет "Only comments may appear End Sub, End Function, End Property. Саму ошибку я понимаю, не знаю где исправить.
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal milliseconds As Long)
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Const SYNCHRONIZE = &H100000
Const INFINITE = &HFFFF
 
Private Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long
 
Public Function InternetConnected() As Boolean
InternetConnected = InternetGetConnectedState(0&, 0&)
 
[B]Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long[/B]
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    Dim lngRetVal As Long
    lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        If lngRetVal = 0 Then DownloadFile = True
End If
End Fucntion
End Function
End Function

Код к задаче: «Исправить код скачивания интернет страницы - VB»

textual
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal milliseconds As Long)
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpSFlags As Long, ByVal dwReserved As Long) As Long
 
Const SYNCHRONIZE = &H100000
Const INFINITE = &HFFFF
 
Public Function InternetConnected() As Boolean
    InternetConnected = InternetGetConnectedState(0&, 0&)
End Function 
 
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    Dim lngRetVal As Long
    lngRetVal = URLDownloadToFile(0&, URL, LocalFilename, 0&, 0&)
    DownloadFile = lngRetVal = 0
End Function

Нужна аналогичная работа?

Оформи быстрый заказ и узнай стоимость

13   голосов, оценка 3.923 из 5


СОХРАНИТЬ ССЫЛКУ