c#文件使用卷ID退出 [英] c# File Exits using Volume ID

查看:96
本文介绍了c#文件使用卷ID退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

寻找一种方法来确定文件是否以卷ID字符串作为路径退出。  ;从cmd提示符运行命令mountvol时,您可以看到卷ID字符串

Looking for a way to find out if a file exits using the volume ID string as the path.  You can see the volume ID string when you run the command mountvol from a cmd prompt

Ex。

var j =   文件 。存在( &"; \\?\\Volume {a32f8a49-38dc-11e8-8a89-0060e058c7c9} \\print.txt" );

var j =  File.Exists("\\?\\Volume{a32f8a49-38dc-11e8-8a89-0060e058c7c9}\\print.txt");

从运行行我输入
\\?\\Volume {a32f8a49-38dc-11e8-8a89-0060e058c7c9 }并且资源管理器打开

From the run line I can type \\?\\Volume{a32f8a49-38dc-11e8-8a89-0060e058c7c9} and explorer opens

任何想法,或者我需要导入的WIN32 dll

Any ideas, or is there a WIN32 dll I need to import

推荐答案

我认为你不能用除了音量指南和文件名之外别无其他。 毕竟,卷的文件系统中的不同文件夹中可以存在任意数量的同名文件。

I don't think that you can accomplish that with nothing but a volume guid and a file name.  After all, any number of files with the same name can exist in different folders in the volume's file system.


这篇关于c#文件使用卷ID退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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