开发者

How to identify if a directory is a symlink pointing to a network location in .NET

开发者 https://www.devze.com 2023-02-27 09:20 出处:网络
In .NET, what is the best way to identify if a directory is a symlink pointing to a network location?

In .NET, what is the best way to identify if a directory is a symlink pointing to a network location?

To determine if it's a symbolic开发者_JAVA技巧 link OR an NTFS junction point we can use:

System.IO.File.GetAttributes(folderName).HasFlags(FileAttributes.ReparsePoint);

But that's not precise enough as it returns true for junction points as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消