1. 在传统的Winform中获取

     可以使用: 

Application.StartupPath

Application.ExecutablePath

  很可惜,这些方法,在WPF中都失效啦

2. 在WPF中获取自身的启动路径,是采用进程的方式来获取的

  其中Process的头文件是: 

 using System.Diagnostics;

 String appStartupPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

  

参考:http://www.silverlightchina.net/html/study/WPF/2011/0706/8826.html

相关文章:

  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2022-02-16
  • 2021-07-31
  • 2021-05-25
猜你喜欢
  • 2022-02-17
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案