Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Webbrowser with compact framework.

Posted on 2008-11-03
8
Medium Priority
?
1,500 Views
Last Modified: 2013-12-05
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

0
Comment
Question by:dibanezb
  • 4
  • 4
8 Comments
 
LVL 18

Expert Comment

by:ChetOS82
ID: 22870916
What isn't working exactly?  Do you get an error of some sort?  I don't think that ReadyState is available on 2003.
0
 

Author Comment

by:dibanezb
ID: 22871597
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
 
LVL 18

Expert Comment

by:ChetOS82
ID: 22877086
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dibanezb
ID: 22877410
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
 
LVL 18

Expert Comment

by:ChetOS82
ID: 22877534
You will have to use the System.Net.HttpWebRequest then.  It is harder to work with, but it works just as well.
0
 

Author Comment

by:dibanezb
ID: 22877906
Do you have an example or a link to obtain it?
0
 
LVL 18

Accepted Solution

by:
ChetOS82 earned 2000 total points
ID: 22877992
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
 

Author Closing Comment

by:dibanezb
ID: 31512836
Thanks, it works now.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question