那么在Windows下路径斜线(/或\)的正确方向是什么? [英] So what IS the right direction of the path's slash (/ or \) under Windows?

查看:771
本文介绍了那么在Windows下路径斜线(/或\)的正确方向是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎Windows坚持在文件路径中写反斜杠\,而.NET的URI类用斜杠/编写.是否有正确的方法,即使在最原始的系统中也可以接受?为什么.NET的URI与Windows的其余部分相比会显示另一个斜杠?

It seems Windows insists on writing a backslash \ in file paths, whereas .NET's URI class writes them with a slash /. Is there any right way, that is accepted even in the most primitive systems? And why is .NET's URI showing the other slash compared with the rest of Windows?

推荐答案

文件路径和URI不同.在Windows文件路径中\是正确的,而在URI中/是正确的.

A file path and a URI are different. \ is correct in a Windows file path and / is correct in a URI.

因此,此文件路径:C:\Documents\Foo转换为以下URI:file:///C:/Documents/Foo

So this file path: C:\Documents\Foo translates to this URI: file:///C:/Documents/Foo

这篇关于那么在Windows下路径斜线(/或\)的正确方向是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆