You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
I don't know what "GetWeb" code you're referring to; I did a search
on "GetWeb" across all forums and didn't find anything by Dave.
However, if you're trying to download an asp file via http, it's
not going to work. When you issue an HTTP GET request of a server
that processes ASP files (IIS or one with Chilisoft ASP), the web
server executes the code in the ASP and displays the results. This
is different than what the typical web server does with regular
html files (just return them whole to the requestor).
There are some IIS exploits that will allow you to view the source
code of an asp rather than just the results of the execution, but
a normal HTTP GET won't do it.
I don't see troubles with this page.
But, of course, should be correct values in TCP OPEN.
+ it's necessary to use authorization with certain proxy servers.
Code:
#Compile Exe
#Register None
#Dim All
#Include "WIN32API.INC"
Function PbMain
Dim Buffer As String, kBuffer As Long, i As Long, j As Long
Tcp Open Port 80 At "www.lauritz.com" As #1 TimeOut 5000
Tcp Print #1, "GET <A HREF="http://www.lauritz.com/s_j/4.asp?ItemID=18836"" TARGET=_blank>http://www.lauritz.com/s_j/4.asp?ItemID=18836"</A> + " HTTP/1.0"
Tcp Print #1, ""
kBuffer = 2048: Buffer$ = Space$(kBuffer)
Open "Tmp.Html" For Output As #2
Do
Tcp Recv #1, kBuffer, Buffer
If Len(Buffer) = 0 Then Exit Do
Print #2, Buffer;
Locate 2, 1: Print "Read" + Str$(Lof(2)) + " bytes"
Loop
Close #2
Open "Tmp.Html" For Binary As #2: Get$ #2, Lof(2), Buffer: Close #2
i = Instr(Buffer, $CrLf + $CrLf)
If UCase$(Left$(Buffer, 5)) = "HTTP/" And i Then Buffer = Mid$(Buffer, i + 4)
Tcp Close #1
Open "Tmp.Html" For Output As #2: Print #2, Buffer;: Close #2
End Function
Unless a server enables "Allow ASP Source to be viewed" you will ONLY get the resulting html.
I wish it weren't true myself hehe, but it is.
Scott
------------------
Scott
Scott Turchin
MCSE, MCP+I http://www.tngbbs.com
---------------------- True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment