"David" <da*********@yoowhoo.comschrieb:
>>>I would like to use a AxSHDocVw.WebBroswer control in a Windows service-
is this possible without creating a form? I added the reference I
usually use to add this object in a Windows Application but only SHDocVw
appears under References in the Solution Explorer.
I wonder why you would want to use a visual control in a service which
doesn't provide a user interface.
* What exactly do you want to archieve?
* Which version of .NET are you using?
I'm writing a service that will connect to a website on a regular basis,
retrieve information, and then update external devices- this works fine as
an application but I would rather not use task scheduler to run it and a
service sounds like the best method for this. I started out using
HttpWebRequest but was not successful logging into the website with it-
axWebBrowser worked nicely.
Which authentication model does the Web site use?
Maybe this code snippet is of use for you:
<URL:http://dotnet.mvps.org/dotnet/code/net/#CookieRequest>
Otherwise take a look at the 'NetworkCredentials' class.
I would not use the webbrowser control for this purpose. Instead you can
download the file in the background:
<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>
Parsing an HTML file:
MSHTML Reference
<URL:http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/reference.asp>
- or -
..NET Html Agility Pack: How to use malformed HTML just like it was
well-formed XML...
<URL:http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx>
Download:
<URL:http://www.codefluent.com/smourier/download/htmlagilitypack.zip>
- or -
SgmlReader 1.4
<URL:http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B90FDDCE-E60D-43F8-A5C4-C3BD760564BC>
If the file read is in XHTML format, you can use the classes contained in
the 'System.Xml' namespace for reading information from the file.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>