C#检测文件夹中路口的路径 [英] C# detect folder junctions in a path

查看:135
本文介绍了C#检测文件夹中路口的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个快速检查,如果在一个完整的路径用于交接点。我已经有一个函数来测试像 IsJunction)一个文件夹(但也许有一个其他的解决方案,不叫 IsJunction()上的每个子文件夹。

I want to make a quick check if in a complete path a Junction point is used. I already have a function to test a folder like IsJunction() but maybe there is an other solution to not call IsJunction() on every subfolder.

所以我在寻找不一样的测试 HasJunctionsInPath(字符串路径)函数,路径中的每个文件夹

So I'm looking for a function like HasJunctionsInPath(string path) without testing each folder of the path.

有一些东西,可以做到这一点。

Is there something which can do this?

编辑:

或者更好的...

是否有可能解决的路径所有路口得到一个文件的真实位置或夹?这将是更好的解决我的问题,我仍然能够与原来的路径比较的结果实施布尔HasJunctionsInPath(字符串路径)功能。

Is it possible to resolve all junctions in a path to get the real location of a file or folder? This would be even better solve my problem and I still can compare the result with the original path to implement a bool HasJunctionsInPath(string path) function.

推荐答案

看杰夫·布朗的解决方案。

Look at the solution of Jeff Brown.

他实施的功能在静态类,这似乎只是正常工作。

He implemented your features in a static class, that seems to just work fine.

http://www.codeproject.com/KB/files/JunctionPointsNet.aspx

这篇关于C#检测文件夹中路口的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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