-
February 3rd, 2021, 12:35 AM
#1
Windows form launching a console application
I have a C# console application that is launched from a WinForm application.
The output of the console application is well-formatted; however, user can run the console application directly. Is there a way to restrict/force the console application to be only run from the main application (WinForm)?
-
February 3rd, 2021, 12:41 AM
#2
Re: Windows form launching a console application
Use a named mutex. Create the mutex in the windows app before you launch the console app. When the console app starts up, try to open the mutex. It should open. If the mutex doesn't exist and the console app can't open it, you can assume the console app wasn't launched by the windows app.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|