如何在Windows中使用空格还原路径? [英] How to restore path with spaces in Windows ?
问题描述
我向注册表添加了一个密钥,这样当我右键单击jpeg文件时,我会看到一个新的转换"选项,该选项实际上会运行我的应用程序.
我的应用程序获取了所选文件的完整路径,并将其作为汇总(在"Main()"的"args"参数中).
问题是Windows将文件的完整路径转换为包含〜"字符的内容.例如:"A B C.JPG"变为"ABC〜1.JPG".
有什么方法可以在我的应用程序中还原文件的原始完整路径(包含空格)?
如果没有,您能建议一种解决方法吗?
谢谢!
Hi,
I added a key to the registry such that when I right click on a jpeg file I see a new "Transform" option that actually runs my application.
My application gets the full path of the selected file as an agrument (in "args" parameter of "Main()").
The problem is that Windows converts the full path of the file to something that contains "~" characters. For example: "A B C.JPG" becomes "ABC~1.JPG".
Is there any way to restore the original full path of the file (that contains spaces) in my application ?
If not, could you suggest a workaround ?
Thanks !
推荐答案
回答自己:
System.IO.Path.GetFullPath
Answering myself:
System.IO.Path.GetFullPath
这篇关于如何在Windows中使用空格还原路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!