473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Programmatically access a web page via a windows service

Hello all,
I need help in trying to access a web page from a windows service. I've actually already built a windows application (vb.net) that does this using the AxSHDocVw.AxWebBrowser class. The code works perfectly in the windows application, but when I use the code in a windows service, the code doesn't work!

I'm assuming this is because somehow the AxWebBrowser needs a desktop context to interact with (e.g. AxWebBrowser.Navigate). I tried to use the option to "Allow service to interact with desktop", but that didn't seem to do anything!

What I ultimately want to do (as per the code below), is to be able to print an HTML document (that references data from an XML doc) on the server. This has to be done from a windows service, as users would never log on to the server to run the application.

Do you guys know how I can do this? I've been going crazy trying to find out the best way to do this, and would love to hear input from others.

Thanks again
kmsultan

AxWebBrowser.Navigate(strContractURL, Nothing, Nothing, Nothing, Nothing)
While Not (AxWebBrowser.ReadyState = SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
System.Windows.Forms.Application.DoEvents()
End While
AxWebBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRIN T, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER , Nothing, Nothing)
Jan 17 '07 #1
2 2338
kenobewan
4,871 Expert 4TB
Here is an article that may help:
HTML viewing and editing component for WinForms apps
Jan 18 '07 #2
I was able to create a windows .NET service that calls the windows application which has the web browser. When I made the service interact with the desktop (in the properties of the service), everything worked perfectly.

I had to remove all Msgbox windows from my appliation, since the application is running in the .NET service context, and does not display windows/forms/etc on the screen.

The application get called, and executes even when no user is logged on.

Just thought I should share in case anyone else is having this problem.

Thanks
Jan 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: doug.h.taylor.accipitersoftware.com | last post by:
Hi, I need a general direction. I don't even know where to start researching how to do this. I have an existing dot net web application (It's mine, I wrote it) that has some text fields and...
2
by: Vince Keller | last post by:
I dont know if this is the correct newsgroup to post questions on Windows Service. I am trying to install and uninstall a Windows Service programmatically. As far as I know, there isnt a class...
9
by: Hardy Wang | last post by:
Hi all: I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based ont the code...
13
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
3
by: Doug Bailey | last post by:
I am trying to control a Windows Service via a Web Service interface. (I am developing in .NET2003) I am using the ServiceController object which allows me to read the state of the services with...
3
by: Codex Twin | last post by:
Hello apologies if this is the wrong newsgroup to be sending this to. Basically, I have an ASP.NET application that I am trying to force to use a proxy server settings. This can be done by...
1
by: Lonewolf | last post by:
Hi, could someone please enlighten me on how I could turn on the above mentioned two windows services programmatically? Reason is i am writing a program which needs to turn on these two services...
7
by: sunil | last post by:
Hi all, I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based on the code...
2
by: MalikTahirMahmood | last post by:
Hi, i am developing a car rental application, in which i required to get data from "salik Web site" UAE Toll system, I created one Desktop application in which i placed on webbrowser control and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.