Path.Combine(
// 获取程序的基目录。
var dir1 = System.AppDomain.CurrentDomain.BaseDirectory; // 获取模块的完整路径。
var dir2 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; // 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。
var dir3 = System.Environment.CurrentDirectory; // 获取应用程序的当前工作目录。
var dir4 = System.IO.Directory.GetCurrentDirectory(); // 获取和设置包括该应用程序的目录的名称。
var dir5 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; string temp = AppDomain.CurrentDomain.BaseDirectory.Replace("bin\\Debug", "");
string publicKeyPem = Path.Combine(temp, "rsa_public_key.pem");
.pem
-----BEGIN RSA PUBLIC KEY-----
xxxxxxxx-----END RSA PUBLIC KEY-----
Path.Combine(的更多相关文章
- 关于程序路径Path.Combine以及AppDomain.CurrentDomain.BaseDirectory
关于程序路径 LucenePath:@(System.Configuration.ConfigurationManager.AppSettings["LucenePath"])&l ...
- C# Path.Combine 方法的用法
C# Path.Combine 方法的用法 *.注意: string filePath3= Path.Combine(string path1,string path2): 情况一: path2中 ...
- Path.Combine 合并两个路径字符串,会出现的问题
Path.Combine(path1,path2) 1.如果path2字符串,以 \ 或 / 开头,则直接返回 path2
- 基于用Path.Combine的优化
Path.Combine: 什么时候会用到Path.Combine呢?,当然是连接路径字符串的时候! 所以下面的代码可以完美的工作: public static void Main() { strin ...
- 使用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)函数进行路径生成 明明是 ...
- c# Path.Combine
Path.Combine: c#获取当前项目路径 : //获取包含当前执行的代码的程序集的加载文件的完整路径 var appPath = System.IO.Path.GetDirectoryName ...
- Path.Combine Method
https://docs.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=netframework-4.8#System_IO_P ...
- C# Path.Combine 缺陷(http路径用Uri类)
Path.Combine: 什么时候会用到Path.Combine呢?,当然是连接路径字符串的时候! 所以下面的代码可以完美的工作: public static void Main() { strin ...
- [原]System.IO.Path.Combine 路径合并
使用 ILSpy 工具查看了 System.IO.Path 类中的 Combine 方法 对它的功能有点不放心,原方法实现如下: // System.IO.Path /// <summary&g ...
随机推荐
- Chisel-LLDB命令插件,让调试更Easy
http://blog.cnbluebox.com/blog/2015/03/05/chisel/ LLDB 是一个有着 REPL 的特性和 C++ ,Python 插件的开源调试器.LLDB 绑定在 ...
- 记录学习Linux遇到的问题
shl@shl-tx:~$ ifconfig Command 'ifconfig' not found, but can be installed with: sudo apt install net ...
- 一个很好的开源视频播放器GiraffePlayer2(支持rtmp,rtsp,http,https)
一个很好的开源视频播放器GiraffePlayer2(支持rtmp,rtsp,http,https) https://github.com/tcking/GiraffePlayer2 GiraffeP ...
- 以太坊Geth通过私钥导入新地址到钱包步骤(3种方法)
一: 通过Geth客户端导入私钥: Open TextEdit Paste key into TextEdit without any extra characters or quotations S ...
- Hexo博客skapp主题部署填坑指南
相信大家都很喜欢 hexo skapp 的主题,由于作者采用结巴分词,加上需要依赖各种各样的环境 所以可能大家踩过很多坑,也许每个人踩得坑不一样,这里使用 Docker 容器 centos 来部署, ...
- mongodb and 和 or 查询
db.getCollection('gxyWarnEntity').find({ "schoolId" : "f11c8ea12f457dbc19c768a8bb6357 ...
- Oracle关联删除的几种方式
不多说了,我们来做实验吧. 创建如下表数据 select * from t1 ; select * from t2; 现需求:参照T2表,修改T1表,修改条件为两表的fname列内容一致. 方式1,u ...
- JAVA 基础编程练习题19 【程序 19 打印菱形图案】
19 [程序 19 打印菱形图案] 题目:打印出如下图案(菱形) * *** ************ ***** *** * 程序分析:先把图形分成两部分来看待,前四行一个 ...
- Shell脚本中怎么实现用户切换实现操作
当我们在服务器上面疯狂的进行操作的时候,我们用shell脚本来帮我们来完成一些基本的任务,但是一些命令或者一些操作需要我们不断切换用户来实现的话,在shell脚本就不那么好实现了,那么我们在shell ...
- Vulnhub-XXE靶机学习
------------恢复内容开始------------ 前两天在微信公众号上看见了这个XXE靶场,就想试一试,虽然网上关于这个的文章已经写了太多太多了,但还是要写出来划划水,233333333, ...