|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Nov 2003
Città: Battipaglia (Sa)
Messaggi: 910
|
Ms Dos
Scusate...
esiste un comando ms dos che salva una pagina internet su disco??? qualcosa del tipo: save(www.yahoo.it c:\yahoo_file.txt) che intuiitivamente www.yahoo.it nel file yahoo_file.txt nella cartella c:!!! Grazieeee |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
No...ma puoi provare a trovare una versione di mget per Windows...
Comunque c'è l'API InternetReadFile: Codice:
Const scUserAgent = "API-Guide test program"
Const INTERNET_OPEN_TYPE_DIRECT = 1
Const INTERNET_OPEN_TYPE_PROXY = 3
Const INTERNET_FLAG_RELOAD = &H80000000
Const sURL = "http://www.microsoft.com/index.htm"
Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet" (ByVal hInet As Long) As Integer
Private Declare Function InternetReadFile Lib "wininet" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetOpenUrl Lib "wininet" Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim hOpen As Long, hFile As Long, sBuffer As String, Ret As Long
'Create a buffer for the file we're going to download
sBuffer = Space(1000)
'Create an internet connection
hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, 0)
'Open the url
hFile = InternetOpenUrl(hOpen, sURL, vbNullString, ByVal 0&, INTERNET_FLAG_RELOAD, ByVal 0&)
'Read the first 1000 bytes of the file
InternetReadFile hFile, sBuffer, 1000, Ret
'clean up
InternetCloseHandle hFile
InternetCloseHandle hOpen
'Show our file
MsgBox sBuffer
End Sub
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 18:16.



















