How to specify path in .config file relative to the file?

前端 未结 6 2665
清歌不尽
清歌不尽 2021-02-19 18:44

An app I use interprets a .NET .config file. I added a line specifying the path to a certificate it needs



        
6条回答
  •  南笙
    南笙 (楼主)
    2021-02-19 19:00

    I think in your case you need set file name. Folder where all files you know (if folder can be canged - set folder without ../)

    And where you need use path - combine current location of application(can be got in runtime ) and key from settings

    or use

    System.Web.HttpContext.Current.Server.MapPath("~/[PARTH_TO_FILE]") '
    

提交回复
热议问题