c# Relative Path convert to Absolute Path
Reference:
http://stackoverflow.com/questions/4796254/relative-path-to-absolute-path-in-c
http://stackoverflow.com/questions/1399008/how-to-convert-a-relative-path-to-an-absolute-path-in-a-windows-application
Relative Path => Absolute Path
var path = Path.Combine(FolderPath, relative);
path = Path.GetFullPath(path);
Absolute => Relative Path
var fileUri = new Uri(strTargetPath);
var refUri = new Uri(Application.ExecutablePath);
var strRelative = refUri.MakeRelativeUri(fileUri).ToString();
strRelative = Uri.UnescapeDataString(strRelative);
You should use Uri.UnescapteDataString to convert special character such as %23 to “#”.
Here is the reference:
http://stackoverflow.com/questions/575440/url-encoding-using-c-sharp
c# Relative Path convert to Absolute Path的更多相关文章
- go: GOPATH entry is relative; must be absolute path: "".
安装:vscode-go出现以下提示: go: GOPATH entry is relative; must be absolute path: "".Run 'go help g ...
- obout editor Absolute path for uploaded image
本文转自:https://www.obout.com/editor_new/KnowledgeBase.aspx?id=706 Absolute path for uploaded image Q ...
- Error: setup script specifies an absolute path
在安装sklearn的时候,出现: error: Error: setup script specifies an absolute path: /opt/xgboost-0.47/python-pa ...
- jenkins中配置svn 出现absolute path is not allowed
代码: 兵马未动,粮草先行 作者: 传说中的汽水枪 如有错误,请留言指正,欢迎一起探讨. 转载请注明出处. 想用jenkins作自动化部署tomcat. svn代码已经checkout到本地目录了(/ ...
- learning shell get script absolute path (3)
Shell get script absolute path [Purpose] Get shell script absolute path [Eevironment] ...
- DownLoadManager[20530:228829] DiskImageCache: Could not resolve the absolute path of the old directory.
uiwebview 模拟器打开PDF文件时崩溃.报下面错误,还不知道为什么 DownLoadManager[20530:228829] DiskImageCache: Could not resolv ...
- linux command line learn - get the absolute path of a file
get the absolute path of a file in linux readlink -f filenme [heshuai@login01 3_Variation_calling]$ ...
- 安装vmware-tools遇the path "" is not valid path to the gcc binary和the path "" is not a valid path to the 3.10.0-327.e17.x86_64 kernel headers问题解决
#./vmware-install.pl踩点: 1.the path "" is not valid path to the gcc binary 2.the path " ...
- os.path.abs()与os.path.realpath()的一点区别
相同点 1. 两者都是返回绝对路径,如果参数path为空,则返回当前文件所在目录的绝对路径 当前py文件所在的目录是revise print(os.path.abspath("") ...
随机推荐
- Java8中聚合操作collect、reduce方法详解
Stream的基本概念 Stream和集合的区别: Stream不会自己存储元素.元素储存在底层集合或者根据需要产生.Stream操作符不会改变源对象.相反,它会返回一个持有结果的新的Stream.3 ...
- css 多行文本以...代替
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- FFmpeg 'scale' filter not present, cannot convert pixel formats.
/*************************************************************************** * FFmpeg 'scale' filter ...
- freeMarker(五)——模板开发指南补充知识
学习笔记,选自freeMarker中文文档,译自 Email: ddekany at users.sourceforge.net 模板开发指南补充知识 1. 自定义指令 自定义指令可以使用 macro ...
- ffmpeg捕捉摄像头发送rtmp
打印 DirectShow 支持的设备列表(true 可用1替换): ffmpeg -list_devices true -f dshow -i dummy 本计算机打印出的信息如下:[dshow @ ...
- bzoj 1006: 神奇的国度 MCS
题目大意: 弦图的最小染色. 题解: 裸题. #include <vector> #include <cstdio> #include <cstring> #inc ...
- DEBUG命令说明
Debug在学习汇编的过程中,担任着一个非常重要的角色,是一个极其重要的调试工具,所以学会它是必须得. 命令格式 功能说明 A [地址] 输入汇编指令 C [范围] 起始地址 对由“范围”指定的区域与 ...
- nefu阶乘定理
Description 小明的爸爸从外面旅游回来给她带来了一个礼物,小明高兴地跑回自己的房间,拆开一看是一个很大棋盘(非常大),小明有所失望.不过没过几天发现了大棋盘的好玩之处.从起点(0,0)走到终 ...
- 关于KMeans的评价及聚簇结果的得到
import numpy as npfrom sklearn.cluster import KMeansfrom sklearn import metricsimport matplotlib.pyp ...
- LAMP 1.4 PHP编译安装
1.下载 ...