Delphi - 当一个是UNC时比较两个路径名,一个是驱动器号指定 [英] Delphi - Comparing two pathnames when one is UNC and one is drive letter-specified
本文介绍了Delphi - 当一个是UNC时比较两个路径名,一个是驱动器号指定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你可以规范化一个路径C:\程序文件为\\ [此计算机名称] \C\Program文件?显然,我不能以其他方式,因为UNC格式的网络文件夹可能没有映射到它的相应的驱动器号。
解决方案
查看 ExpandUNCFileName 功能。
I have a situation where a user can specify two separate pathnames, and I need to check whether one pathname is "inside" the other one. I can do this if both pathnames are UNC, or both are drive-letter-based, but what if they are mixed?
Can you "normalise" a path such as "C:\Program Files" to "\\[this computer name]\C\Program Files"? Obviously, I can't go the other way, as a network folder in UNC format may not have a corresponding drive letter mapped to it.
解决方案
Have a look at ExpandUNCFileName function.
这篇关于Delphi - 当一个是UNC时比较两个路径名,一个是驱动器号指定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文