如何检查 Windows 7 文件夹中使用了哪些符号链接

发布于 2024-08-16 18:29:59 字数 392 浏览 3 评论 0 原文

我一直在查看 Windows 7 符号链接(使用 mklink)[编辑 - 它们是Windows Vista、Windows Server 2003Windows Server 2008]。是否可以以编程方式确定文件夹是否是符号链接?

I've been looking at the Windows 7 symbolic links (using mklink) [Edit - they are also supported on Windows Vista, Windows Server 2003, Windows Server 2008]. Is it possible to programmatically determine if a folder is a symlink?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溇涏 2024-08-23 18:30:00

使用 GetFileAttributes 并检查 FILE_ATTRIBUTE_REPARSE_POINT

预计到达时间:由于您现在已澄清是通过 C# 执行此操作,因此您可以在本地执行此操作:

System.IO.File.GetAttributes("some/path")

您可以在返回的枚举值中检查 ReparsePoint 标志。

Use GetFileAttributes and check for FILE_ATTRIBUTE_REPARSE_POINT.

ETA: Since you clarified now that you're doing this from C#, you can do this natively there:

System.IO.File.GetAttributes("some/path")

You can check for the ReparsePoint flag in the returned enum value.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文