How to call an ASP page?

  • Thread starter Thread starter MeAgin
  • Start date Start date
M

MeAgin

Hi all,

I want to call a classic ASP page from my vb.net code. How this can be done?
Normally I would create an object from MSXML2.XMLHTTP and then call the Get
method and the ResponseText wiuld have the return value.

Thnaks.
Nadee
 
Nadee,

Can you describe a little bit more what you want to do with it, mostly
everybody is using this in another way.

Cor
 
Hi Cor,

I want to download some files from a web server. At the moment our server
system runs on classic ASP and we call an ASP page to download files from
our VFP application as shown below,

cString = "Some info to process"
cDownloadCheckURL = "http://221.68.56.163/WebSErver/Common/Download.asp" +
cString
oHTTP = CREATEOBJECT("MSXML2.XMLHTTP")
oHTTP.OPEN("GET", cDownloadCheckURL, .F.)
oHTTP.SEND(cString)
cReturn = oHTTP.ResponseText

If everything went fine the cReturn will have the downloaded file as a
binary sting. then we can save this string as a file on the clicnt sode.
Now i want to call the same ASP file to download some files. This if for a
protoype i'm doing in vb.net to mimic our client side.

Thanks
Nadee
 
Thanks Cor.
But i can't access these URLs.
Can u please advice? Wat is your web site? A simple one would be ok.

Nadee.
 
I reccomend putting your ASP page through IIS and ignoring DOTNET; it
is merely a passing fad.. and it's going to go through a 'visual fred'
phase _AGAIN_ this summer with the release of 'yet another piece of
shit IDE'
 
This is not the one the link is pointed to, this is more simple

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Multiline = True
Me.TextBox1.ScrollBars = ScrollBars.Both
'above only for showing the sample
Dim Doc As mshtml.IHTMLDocument2
Doc = New mshtml.HTMLDocumentClass
Dim wbReq As Net.HttpWebRequest = _
DirectCast(Net.WebRequest.Create("http://msdn.microsoft.com/"),
_
Net.HttpWebRequest)
Dim wbResp As Net.HttpWebResponse = _
DirectCast(wbReq.GetResponse(), Net.HttpWebResponse)
Dim wbHCol As Net.WebHeaderCollection = wbResp.Headers
Dim myStream As IO.Stream = wbResp.GetResponseStream()
Dim myreader As New IO.StreamReader(myStream)
Doc.write(myreader.ReadToEnd())
Doc.close()
wbResp.Close()

Cor
 
Back
Top