.NET CF 2.0 webBrowser control

D

Don Tucker

Hello, I am attempting to parse some data from a web page using .NET CF 2.0
with Visual Studio 2005 in C#. In regular .NET 2.0, I use the following code
in the DocumentCompleted event handler:


HtmlWindowCollection frames = iPMSensorWebBrowser.Document.Window.Frames;
String page;

if (frames.Count > 0)
{
foreach (HtmlWindow frame in frames)
{
page = frame.Document.Body.InnerText.ToString();
if (page.Contains("Temp_Humid_Sensor_A1"))
ParseSensorData(page);
}
}




But, in CF there is no Document property of the webBrowser. I tried using
the DocumentText property, but I get an error at compile time when I try to
access it:

Error 1 The property or indexer
'System.Windows.Forms.WebBrowser.DocumentText' cannot be used in this context
because it lacks the get accessor

Is there any way to do what I did in .NET 2.0 in the .NET 2.0 Compact
Framework?

Thanks in advance,
Don
Post is abusive
 
D

Don Tucker

Thank you very much for your suggestion. I am attempting to implement the
HttoWebRequest example given here:

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetresponse(VS.80).aspx

I seem to recall having a problem implementing similar methods in the past
because of the existence of frames, but I'll give it a shot. ThreadPool does
not have a RegisterWaitForSingleObject member in .NET CF 2.0, so I am
replacing that line with result.AsyncWaitHandle.WaitOne(DefaultTimeout,
true); and hoping that it will work.

Don
 

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