473,624 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Services

I have two questions regarding services.

First of.
Is there any problem with creating VB9 services running timer events om
Winxp?
I built a service App and it installs and runs but the timer events doesn´t
klick.

Lastly, how do I logon to another computer Win2003 Server and restart /
check status of a service.
Jun 27 '08 #1
4 987
On 2008-06-27, Tomas Andersson <to************ *@heatex.comwro te:
I have two questions regarding services.

First of.
Is there any problem with creating VB9 services running timer events om
Winxp?
I built a service App and it installs and runs but the timer events doesn´t
klick.
What timer? System.Windows. Forms.Timer does NOT work in services. You need
to be using System.Threadin g.Timer or System.Timers.T imer.
Lastly, how do I logon to another computer Win2003 Server and restart /
check status of a service.
In what context? Programatically ? As a user?

--
Tom Shelton
Jun 27 '08 #2
I tried both System.threadin g.timer and system.timers.t imer and none seemed
to work

And I need to restart the service programmaticall y.

Here is the thing.

My program creates importfiles for another system. These files can have
multiple levels that has to be imported from the lowest level to the
highest. Therefore my program creates these imports and add them to a
database for temporary storage.

Another program then looks at the priority and dumps these files to a folder
where yet another program finds these files and imports them.

Problem is that this last step uses a little dodgy service that sometime
loses the connection to the importprogram, or rather the other way round.
Any who. The solution Is to restart the service so the connection goes up
again.

So when the middle program detects that there is imports cued in DB and a
already bumped importfile has not been touched for some time this should
restart the service

/Tomas

"Tom Shelton" <to*********@co mcastXXXXXXX.ne tskrev i meddelandet
news:<f6******* *************** ********@comcas t.com>...
On 2008-06-27, Tomas Andersson <to************ *@heatex.comwro te:
I have two questions regarding services.
First of.
Is there any problem with creating VB9 services running timer events
om Winxp?
I built a service App and it installs and runs but the timer events
doesn´t klick.
>
What timer? System.Windows. Forms.Timer does NOT work in services.
You need to be using System.Threadin g.Timer or System.Timers.T imer.
>
Lastly, how do I logon to another computer Win2003 Server and
restart / check status of a service.
>
In what context? Programatically ? As a user?
>
--
Tom Shelton

Jun 28 '08 #3

"Tomas Andersson" <to************ *@heatex.comwro te in message
news:OD******** ******@TK2MSFTN GP04.phx.gbl...
>I tried both System.threadin g.timer and system.timers.t imer and none seemed
to work
You must be doing something wrong.

>

And I need to restart the service programmaticall y.

Here is the thing.

My program creates importfiles for another system. These files can have
multiple levels that has to be imported from the lowest level to the
highest. Therefore my program creates these imports and add them to a
database for temporary storage.

Another program then looks at the priority and dumps these files to a
folder where yet another program finds these files and imports them.

Problem is that this last step uses a little dodgy service that sometime
loses the connection to the importprogram, or rather the other way round.
Any who. The solution Is to restart the service so the connection goes up
again.

So when the middle program detects that there is imports cued in DB and a
already bumped importfile has not been touched for some time this should
restart the service
You can use the Service Controller and stop or start a service running on
another machines. The programs would need to use an Admin account that's
active on both machines.

http://www.siccolo.com/Articles/Code...estart_NT.html

Jun 28 '08 #4
Tomas Andersson wrote:
Is there any problem with creating VB9 services running timer events om
Winxp?
There's no inherent problem - I do it all the time.
I built a service App and it installs and runs but the timer events doesn´t
klick.
One possibility is that your Timer /is/ firing, but that the timer's
Elapsed() routine cannot be JIT-loaded because there's a referenced Type
or Assembly missing. The Framework probably throws an exception about
this, but I've never managed to find anywhere in /my/ code that I can
/catch/ it!

Because of this, I only use a Timer /once/ to get me out of the
"Call-and-Return" structure invoked by the Service Control Manager to
/start/ the Server; after that, I use Sleep calls within my "main" routine:

Overrides Sub OnStart()
TimerX.Start()
End Sub

Sub TimerX_Elapsed( ... ) Handles TimerX.Elapsed
TimerX.Stop()

Do While Not m_bShutdownRequ ested

Try
DoSomethingUsef ul()
Catch ex as Exception
' Log it, or whatever
' Don't let the Service Process die
End Try

For i as integer = 1 to 15
System.Threadin g.Thread.Sleep( 1000 )
Next

Loop

End Sub

HTH,
Phill W.
Jun 30 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2238
by: rbt | last post by:
How does one associate a "Description" with a Windows service written in Python? I've just started experimenting with Python services. Here's my code... copied straight from Mr. Hammond's "Python Programming on Win32": import win32serviceutil import win32service import win32event class test_py_service(win32serviceutil.ServiceFramework): _svc_name_ = "test_py_service"
6
2555
by: cs | last post by:
I noticed there is some .net services on my winxp. One or two mention the CLR. Does that mean that my .net apps/services wont run before those services start? I need to run my service as early on as possible, it doesnt even need to be a service if there is a way to run .net apps before that, anyone knows what or where?
0
2153
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use a class contained in a extern dll so the web service and the application can use it and send or return via web services: public customObject myWebMethod(customObject obj); . I saw that web services can't deal with this cause the WS creates...
26
1887
by: Mr Newbie | last post by:
What do I need to run a web service on my PC ? I know I need the .NET Framework, but do I need IIS Running ?
3
6496
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp) but I don't want clients to have to add two web references and then manually have to edit the proxy classes. After doing some searching I found that putting references to multiple web services in a .disco...
7
6012
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is or do i need to write the xml as text from the web service and supply a DTD. Also any other pitfalls TIA
3
4991
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
2
2065
by: sdstraub | last post by:
I have created 5 services in my project, in the 1st service I set servicestorun = array of all 5 services, I have a project installer with 5 service installers, one for each service. I have code so that whenever any service starts, stops or timers elapse a log entry is created. When I install my project, and start the 1st service in the services console, it shows that the service started and I have the corresponding log entry confirming...
0
1802
by: krishnaraju | last post by:
HI to all, please help me.its urgent requirement. my question is this is the wsdl file i got from our client.please see at bottom. when iam trying to access that webmethods iam getting only byval params but i didnt get byref params.please let me know how to get byref values from web methods. please help me in this regard because its an urgent requirement. ------------------------wsdl...
1
2179
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading elements for running a business successfully. Now Days it's a trend to outsource Data Entry Work to reliable service provider who provides excellent output out of their work. Many Companies or Organization prefer to outsource data entry work to...
0
8175
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8625
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6111
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.