I want to run C# program when login screen appears

aqeelahmad87

New member
Local time
10:24 PM
Messages
1
I want to run C# program when login screen appears.
I will explain it

e-g there is no one sitting on my computer and my computer suddenly restarts and I want to run mine program which is very important all I want is that that program will run in background weather someone login the computer or not.

That program should be independent of user login.

Can anyone help me please
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
HP
OS
windows 7 home premium 32bit
CPU
core i3

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell XPS 420
OS
Windows 10, Home Clean Install
CPU
Intel Core2 processsor Q8200(2.33Ghz 1333FSB) Quad Core Tech
Motherboard
Dell
Memory
6 gb
Graphics Card(s)
ATI Radeon 256MB HD3650
Sound Card
Intergrated 7.1 Channel Audio
Monitor(s) Displays
Dell SP2009W 20"
Hard Drives
640 GB Serial ATA Hard drive
Cooling
Fan
Keyboard
Dell USB Keyboard
Mouse
Dell Premium Optical USB
Internet Speed
DSL 2.85
Services are designed to do exactly that job. If you can turn your program to run as a service then that will fulfill your whole requirements.

In short, services are just normal programs with a special interface to the OS. They can be started at system start before the user logins and keep running indefinitely irrespective of any login/logoff. Services are completely background processes, without any kind of user interface at all.

If you have the chance of modifying the program, then making it into a service should be relatively easy. For C#, look at the ServiceBase class, make a subclass of it then call your original code from it.

If you can't change the program at all you may use a wrapper program and have it run yours. A good option is NSSM.

In any case, once your program is installed as a service you can manage it like any standard Windows service using control panel.
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Back
Top