1. // 获取程序的基目录。
  2. var dir1 = System.AppDomain.CurrentDomain.BaseDirectory;
  3.  
  4. // 获取模块的完整路径。
  5. var dir2 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
  6.  
  7. // 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。
  8. var dir3 = System.Environment.CurrentDirectory;
  9.  
  10. // 获取应用程序的当前工作目录。
  11. var dir4 = System.IO.Directory.GetCurrentDirectory();
  12.  
  13. // 获取和设置包括该应用程序的目录的名称。
  14. var dir5 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
  15.  
  16. string temp = AppDomain.CurrentDomain.BaseDirectory.Replace("bin\\Debug", "");
  17. string publicKeyPem = Path.Combine(temp, "rsa_public_key.pem");

.pem

-----BEGIN RSA PUBLIC KEY-----
xxxxxxxx-----END RSA PUBLIC KEY-----

Path.Combine(的更多相关文章

  1. 关于程序路径Path.Combine以及AppDomain.CurrentDomain.BaseDirectory

    关于程序路径 LucenePath:@(System.Configuration.ConfigurationManager.AppSettings["LucenePath"])&l ...

  2. C# Path.Combine 方法的用法

    C#   Path.Combine 方法的用法 *.注意: string filePath3= Path.Combine(string path1,string path2): 情况一: path2中 ...

  3. Path.Combine 合并两个路径字符串,会出现的问题

    Path.Combine(path1,path2) 1.如果path2字符串,以 \ 或 / 开头,则直接返回 path2

  4. 基于用Path.Combine的优化

    Path.Combine: 什么时候会用到Path.Combine呢?,当然是连接路径字符串的时候! 所以下面的代码可以完美的工作: public static void Main() { strin ...

  5. 使用System.IO.Combine(string path1, string path2, string path3)四个参数的重载函数提示`System.IO.Path.Combine(string, string, string, string)' is inaccessible due to its protection level

    今天用Unity5.5.1开发提取Assets目录的模块,使用时采用System.IO.Path.Combine(string, string, string, string)函数进行路径生成 明明是 ...

  6. c# Path.Combine

    Path.Combine: c#获取当前项目路径 : //获取包含当前执行的代码的程序集的加载文件的完整路径 var appPath = System.IO.Path.GetDirectoryName ...

  7. Path.Combine Method

    https://docs.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=netframework-4.8#System_IO_P ...

  8. C# Path.Combine 缺陷(http路径用Uri类)

    Path.Combine: 什么时候会用到Path.Combine呢?,当然是连接路径字符串的时候! 所以下面的代码可以完美的工作: public static void Main() { strin ...

  9. [原]System.IO.Path.Combine 路径合并

    使用 ILSpy 工具查看了 System.IO.Path 类中的 Combine 方法 对它的功能有点不放心,原方法实现如下: // System.IO.Path /// <summary&g ...

随机推荐

  1. oracle清除归档

    清除Oracle归档日志命令echo -e 'delete noprompt archivelog ALL COMPLETED BEFORE '\'SYSDATE-${DELETE_ARCHIVELO ...

  2. 【转】CAtlRegExp class .

    CAtlRegExp Class   CAtlRegExp 类用于表示并处理正则表达式.模板类,定义如下:     template < class CharTraits = CAtlRECha ...

  3. Leetcode题目322.零钱兑换(动态规划-中等)

    题目描述: 给定不同面额的硬币 coins 和一个总金额 amount.编写一个函数来计算可以凑成总金额所需的最少的硬币个数.如果没有任何一种硬币组合能组成总金额,返回 -1. 示例 1: 输入: c ...

  4. Xshell查看日志

    查询日志命令(复制后鼠标右键粘贴): tail  -1000f /mnt/logs/SMFManagement/SMFManagement_info.log

  5. 005-html+js+spring multipart文件上传

    一.概述 需求:通过html+js+java上传最大500M的文件,需要做MD5 消息摘要以及SHA256签名,文件上传至云存储 1.1.理解http协议 https://www.cnblogs.co ...

  6. c++ STL 最大值最小值

    #include <iostream>#include <algorithm>#include <deque> using namespace std; //二元谓 ...

  7. 08ListView动态列表组件 以及循环动态数据

    效果: main.dart import 'package:flutter/material.dart'; import 'res/listData.dart'; /* ListView:参数 scr ...

  8. [Scikit-learn] 1.1 Generalized Linear Models - Bayesian Ridge Regression

    1.1.10. Bayesian Ridge Regression 首先了解一些背景知识:from: https://www.r-bloggers.com/the-bayesian-approach- ...

  9. web布局收集整理

    /*样式文件*/ .fgw-right-p{ height: 38px; line-height: 38px; margin-bottom: 20px; padding-left: 24px; spa ...

  10. 知识点整理-网络IO知识总结

    UNIX 系统下的 I/O 模型有 5 种 同步阻塞 I/O.同步非阻塞 I/O.I/O 多路复用.信号驱动 I/O 和异步 I/O 什么是I/O 所谓的I/O 就是计算机内存与外部设备之间拷贝数据的 ...