zoukankan      html  css  js  c++  java
  • 获取该项目路径下的文件路径

    获取项目下的文件路径

    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
  • 相关阅读:
    集合异常原因与处理方式
    List的子类特点
    数据结构:数据的组织方式
    java对多态的了解
    JAVA电话本系统
    字符串转换数组
    登录用户名密码是否合法
    十三 spark 集群测试与基本命令
    十二 flume与kafka数据传输
    十一 spark- Standalone 集群
  • 原文地址:https://www.cnblogs.com/lijianda/p/6928775.html
Copyright © 2011-2022 走看看