1

I have a program that communicates with a network based RFID reader and I need to be able to read tags and update the database before the system is logged in. That shouldn't be difficult, just need to use the task scheduler or similar to run on system boot.

I cannot seem to find a solution on how to open my form when a user actually logs in.

To clarify, I want the program to start before any user logs in, then when a user logs in, I want the form to open. Then, from the form, I will have the User logout and the program will resume until the next user logs in. My main program will always be running regardless of the user state.

As far as I can tell, my only other option would be to have two separate applications, one that runs as a service and is suspended upon user login, the other that opens the form and resumes RFID monitoring while a user is logged in, then when the user logs out, the service resumes its monitoring.

Coding in C# with a Windows Form Application.

Thanks for your help!

M C
  • 11
  • 1
  • 1
    For the program to run before the user logs in probably means it has be configured as a service, and a service cannot have a GUI. You would have to make, essentially, two separate programs. – LarsTech Jun 20 '17 at 16:34
  • 2
    You definitely want a service, with an application that communicates with it for user entry. The Visual Studio "Windows Service" project will get you started. There are others (WCF, Azure, etc), so you may want to look at them to see which best suits your needs - I do not know our deployment requirements or whatnot. Once the service is deployed, you simply import it into the "User" application, and it is available for use. – Aaron Jun 20 '17 at 16:37
  • If you haven't already figured out a way to monitor users. I would take a look at this combined with a windows service. [How do you retrieve a list of logged-in/connected users in .NET?](https://stackoverflow.com/questions/132620/how-do-you-retrieve-a-list-of-logged-in-connected-users-in-net) And check the list occasionally for changes. – ECourant Jun 20 '17 at 16:41

0 Answers0