简体   繁体   English

获取文件路径的方法

[英]How to get path of a file

I want to print the path of a file.我想打印文件的路径。 For example, I have a file named 'test'.例如,我有一个名为“test”的文件。 Then, the program I want to make will print "C:\\Users\\username\\Desktop\\test".然后,我要制作的程序将打印“C:\\Users\\username\\Desktop\\test”。 (Just example!) How can I make this? (只是例子!)我怎样才能做到这一点?

您可以像这样使用 double \\ follow: “C:\\\\Users\\\\username\\\\Desktop\\\\test”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM