I have a simple console app that clients will install on their server which sends data to our API. They need to type in their username/password for our API and the program remembers this and uses it when the app is run using a daily scheduled task.
How can I create a GUI to let the end user type in their username/password (for our API) which the console app can read? Since the app needs installed (xcopy + set up of scheduled task), I presume I can do this in the same program?
Currently I’m using the Visual Studio Application Settings to store the username/password when they are passed as parameters to the app. When the app is run without parameters, it uses the stored data (which is encrypted with DPAPI).
You have two option :
As suggested by rene you can use a switch on the command line of the same application, or you can create a separate application to do it, in the case of a separate application maybe the winForm solution would be the best choice.