[转]WPF 获取程序启动路径
本文转自:http://hi.baidu.com/lilipangtou/item/f1b7488e3c92c4d05e0ec1ab
在Windows Form程序中,获取自身的启动目录是非常容易的,可以使用
Application.StartupPath
Application.ExecutablePath
…
但是,这些方法,在WPF中都失效啦
在WPF中获取自身的启动路径,是采用进程的方式来获取的
其中Process的头文件是:using System,Diagnostics;
String appStartupPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
posted on 2014-02-20 09:14 freeliver54 阅读(316) 评论(0) 收藏 举报
 
                     
                    
                 
                    
                 
                
            
         
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号