System.net question

P

pmclinn

I have the following asp.net code and I'm looking to see how I would
accomplish this task in the Compact Framework. What would I have to
modify in the following code to make this work in the mobile 5 world?
Any direction would be appreciated. I simply want to pull down a web
page programmatically.


Dim RequestUrl As String = "http://www.yahoo.com"

Dim WebRequestObject As HttpWebRequest
Dim sr As StreamReader

Try

Dim WebResponseObject As HttpWebResponse
WebRequestObject = CType(WebRequest.Create(RequestUrl),
HttpWebRequest)
WebRequestObject.Method = "GET"

WebResponseObject = CType(WebRequestObject.GetResponse(),
HttpWebResponse)
sr = New StreamReader(WebResponseObject.GetResponseStream)
Dim Results As String = sr.ReadToEnd
sr.Close()
Console.Out.WriteLine(Results)

Try

WebResponseObject.Close()
WebRequestObject.Abort()
Catch
End Try
Catch
End Try
 
P

pmclinn

From what I can see my problem might be related to the fact the
emulator for mobile 5 is not setup by default to have an intert
connection.
I'm curious, how do you check if a connection is present?
Next, if it is not active how do you establish one. I use a verizon
vx6700 and any feedback would be apperciated.

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top