获取该项目路径下的文件路径

获取项目下的文件路径

1、例

//讲稿模板不存在
                        string noteTemPath = AppDomain.CurrentDomain.BaseDirectory + "DownLoad\noteMakeDoc.doc";
                        global::System.IO.File.Copy(noteTemPath, TemPath);
1 try
2             { 
3                 System.Diagnostics.Process.Start(AppDomain.CurrentDomain.BaseDirectory + ConfigService.SeatURL);
4             }
5             catch (Exception)
6             {
7                 MessageBox.Show("系统找不到指定文件!", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
8             }

2、例

1         /// <summary>
2         /// System.ini 配置文件
3         /// </summary>
4         public static string configSystemFilePath = AppDomain.CurrentDomain.BaseDirectory + "/Config/System.ini";

 3、例(读取ini文件的特定值)

1 var StartUpExe = Function.IniReadValue("SYSTEM", "StartUpExe", "", AppDomain.CurrentDomain.BaseDirectory + "/Config/System.ini");
2                 System.Diagnostics.Process.Start(StartUpExe);

System.ini文件

[SYSTEM]
UserName=人民法院
AppTitle=管理平台
#是否全屏
FullScreen=0
#页面名称控件宽度
TopicTitleWidth=700
#大屏客户端地址路径
StartUpExe=C:/Program Files (x86)/WPS-Interactive/WPS-Interactive.exe
原文地址:https://www.cnblogs.com/lijianda/p/6928775.html