Click here to Skip to main content
16,016,562 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to keep my API on the working state when server is on and if its either in logout or login Condition...
Is there any way to do so?

What I have tried:

Please clarify my doubt and Thanks in advance.
Posted
Updated 1-Jan-21 8:10am

1 solution

There's no way to completely answer this question because of a complete lack of detail about your app. Did you write your "server" as a Windows Service app? Is it a Console app? ASP.NET? Windows Forms?

Your app has to be written as a service of some kind, either a Windows Service or ASP.NET app in order to run without anyone logged into the machine.
 
Share this answer
 
Comments
Member 14978771 4-Jan-21 9:23am    
My Application is a Windows Form Application,and also having gui interfaces in the application.
Dave Kreskowiak 4-Jan-21 10:06am    
You're going to have to rewrite your app as a Windows Service application.

You CANNOT have any GUI interface in these kinds of apps, so you'll have to keep that in mind when writing it.
Member 14978771 4-Jan-21 10:46am    
Yes, I Understand, But I Still Want a GUI to execute!
Is there any alternative ways to Run my API even though the Server is in log off state?
Thank you...
Dave Kreskowiak 4-Jan-21 10:53am    
You can NOT have a GUI execute when a user in not logged in.

In either case, API's never have a GUI in the first place, so I think you're using the term inappropriately.

You're going to have to rethink your entire application. If there's part of it that needs to run continuously, even if nobody is logged in, that needs to be broken out into its own Service application. The GUI part of the application can still be written as a Windows Forms app, and if it needs to, can communicate with the service over some IPC channel, like a named pipe.
Member 14978771 4-Jan-21 11:16am    
Thank you very much for your guidance...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900