c#如何获取当前运行程序的文件名

来源:百度知道 编辑:UC知道 时间:2024/05/27 05:15:35
RT
小弟是菜鸟 但是希望各位大虾不要拿我打趣`

我的意思就是要获取程序的文件名

控制台下的```怎么取啊?

那如果application.exename 或者application.exename 找到某个程序后,能不能把它的窗口激活显示呢?我很想找这个方法,这样可以防止某些自己写的程序运行两遍

string strFullPath = Application.ExecutablePath;
string strFileName = System.IO.Path.GetFileName ( strFullPath );

application.ExecutalePath
没记错的话

程序运行时——任务管理器——应用程序

application.exename