Webbrowser with compact framework.

This code works fine in an windows application under visual studio 2005. I need the same funcionality working in Compact Framework. I'm using PocketPC 2003.

ie is a webbrowser control.
Dim a As String
        ie.Navigate("http://www.google.com") 'or some url
        While Not ie.ReadyState = 4
            Application.DoEvents()
        End While
        a = ie.DocumentText
        MsgBox(a & a.Length) 'I need to to do something with a

Open in new window

dibanezbAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ChetOS82Commented:
What isn't working exactly?  Do you get an error of some sort?  I don't think that ReadyState is available on 2003.
0
dibanezbAuthor Commented:
First, I receive this error:
Property 'DocumentText' is 'WriteOnly'  (This in line 'a = ie.DocumentText')
If I delete this line, I can run the program but I receive then this error:

NotSupportedException was handled
And shows this tip: "check to determine if there is a class that supports this funcionality"

This happens both, if I deploy the application to the Device (Ipaq hx 2415) or to emulator.

I ReadyState is not available, how to know if the browser ends reading? Also I need to know what the browser read.

0
ChetOS82Commented:
From the .NET Compact Framework documentation at http://msdn.microsoft.com/en-us/library/ms229657.aspx

"The .NET Compact Framework does not support the Document property and its related properties and events, except for the DocumentText property. You can use DocumentText to present HTML to your users, such as to provide links and a simple HTML form, but the .NET Compact Framework does not support accessing the HTML content of a Web page with this property."

This explains why DocumentText is WriteOnly.  I cannot find a work around for this.  If you are simply trying to get the HTML code for a web site (and just using the WebBrowser control to do it), you could use the System.Net.WebClient to do the same thing.
0
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

dibanezbAuthor Commented:
As you say, I just try to get the HTML code for a web site. System.Net.WebClient works fine with windows but it doesn't work with Pocket PC or Windows Mobile. Any other idea?
0
ChetOS82Commented:
You will have to use the System.Net.HttpWebRequest then.  It is harder to work with, but it works just as well.
0
dibanezbAuthor Commented:
Do you have an example or a link to obtain it?
0
ChetOS82Commented:
There are many, here is one: http://www.c-sharpcorner.com/UploadFile/mahesh/WebRequestNResponseMDB12012005232323PM/WebRequestNResponseMDB.aspx

Look at the bottom of the page (it talks about WebClient at the top).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dibanezbAuthor Commented:
Thanks, it works now.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.