码迷,mamicode.com
首页 > Windows程序 > 详细

C#获取应用程序路径

时间:2018-09-19 13:49:38      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:class   process   windows   table   应用程序   ref   str   .exe   程序   

            string s = Environment.CurrentDirectory;
            //需添加Forms.DLL
            s = System.Windows.Forms.Application.StartupPath;
            s = System.Windows.Forms.Application.ExecutablePath;


            s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            s = System.Reflection.Assembly.GetEntryAssembly().Location;

 

C#获取应用程序路径

标签:class   process   windows   table   应用程序   ref   str   .exe   程序   

原文地址:https://www.cnblogs.com/xslwm/p/9674089.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!