如何确定目录路径是否为SUBST'd [英] How to determine if a directory path was SUBST'd

查看:78
本文介绍了如何确定目录路径是否为SUBST'd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图找出一个文件是否在已被替换或位于用户文件夹中的文件夹中使用C#

Trying to figure out if a file is in a folder that has been subst'd or is located in a user folder using C#

推荐答案

我想你需要P / Invoke QueryDosDevice()的驱动器号。 Subst驱动器将返回一个符号链接,类似于\ ?? \C:\blah。 \ ?? \前缀表示它被替换,其余的给你的驱动器+目录。

I think you need to P/Invoke QueryDosDevice() for the drive letter. Subst drives will return a symbolic link, similar to \??\C:\blah. The \??\ prefix indicates it is substituted, the rest gives you the drive+directory.

这篇关于如何确定目录路径是否为SUBST'd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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