Set Process 'image name' and 'descript

2020-07-18 08:42发布

I want to go into as much detail as possible so this question is easily understood and answer-able

Essentially I need a way set up the process name and process description with C# on the applications startup.

Here is an example of what I would like changing;

Note: I want to set my OWN C# applications image and description with CODE.

Example

I want to be able to change the following things in my application on startup. Image Name in the Processes list, as well as the Description in the Processes list. So far in my C# application i can set the process name with the properties but id rather be able to set it with some sort of code snippet (as well as the description).

I hope this has been a information question and you good clever people at stackoverflow can help.

标签: c# process
4条回答
叛逆
2楼-- · 2020-07-18 08:43

As close as I can come to an answer is to pragmatically create a new executable with the desired name and description launch that executable then allow your launch process to die.

查看更多
够拽才男人
3楼-- · 2020-07-18 08:45

You can't change the image name. It's the name of your executable file. The process description, however, can be changed on your C# project assembly info:

Right click on your C# project in Visual Studio > Properties > Application > Assembly information > Title.

You can't change the description at runtime from code: the OS loads the description at startup from the Version Information file resource.

查看更多
女痞
4楼-- · 2020-07-18 09:04

The Image Name property is the name of the executable itself (ie Foobar.exe), the Description property is the Title of the application in the Assembly Information dialogue box, as shown below:

Info

At this point, when you run your program, you will see two entries into the task manager as shown below:

Task Manager

One will say the name you specified in the Title box, the other will say vshost32.exe as the description. To fix this, untick the option called Enable the Visual Studio hosting process in the project properties page.

查看更多
Evening l夕情丶
5楼-- · 2020-07-18 09:05

Try using your application as a 'host' for another app. As soon as the application is launched, it downloads a file from a dropbox link (a direct download link) and saves it locally, (In the temp folder probably). Then our application launches that application and then kills itself with maybe an error. now the process running on that one would be gone, and we have a new process with our set title and description. Easy!

查看更多
登录 后发表回答