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

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

问题描述

如何确定文件是否位于已SUBST'ed 还是位于使用 C# 的用户文件夹中?

How can I figure out if a file is in a folder that has been SUBST'ed or is located in a user folder using C#?

推荐答案

我认为您需要为驱动器号 P/Invoke QueryDosDevice().Subst 驱动器将返回一个符号链接,类似于 ??C:lah.?? 前缀表示它已被替换,其余的为您提供驱动器+目录.

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

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

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