Исправить код скачивания интернет страницы - VB
Формулировка задачи:
Не работает, ругается, на выделенную строку пишет "Only comments may appear End Sub, End Function, End Property. Саму ошибку я понимаю, не знаю где исправить.
Решение задачи: «Исправить код скачивания интернет страницы»
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
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д