|
项目描述: |
Comprehensive example of how to convert a drive-based filespec to one using Universal Naming Convention (UNC). This is relatively simple if the file resides on a remote network share, but quite complicated if the file is local. Uses WNetGetUniversalName for remote files, and resorts to a best guess after using NetShareEnum for local files. This demo shows the extraordinary lengths one must go to in order to call "the same" function -- NetShareEnum -- on both NT and 9x platforms.
Important notes: Local files present a potential ambiguity, given that a file may exist on several local shares. Another unavoidable problem is that under NT the user must have Administrative privileges for NetShareEnum to return the path of a local share.
这是一个复杂的例子,演示了如何将一个基于驱动器的文件规范转换为相应使用Universal Naming Convention (UNC)的文件规范。如果文件位于远程网络共享中,这是相对简单的,但如果文件在本地将是很复杂的。使用WNetGetUniversalName 来处理远程文件,使用NetShareEnum 处理本地文件。这个例子演示了一个非常长的例子,必须调用在NT 和9x平台上调用“相同”的函数--NetShareEnum。
重要提示:本地文件具有一种潜在的模糊性,一个文件可能存在于几个本地共享目录中。另一个无法避免的问题是在NT下,用户必须有管理员权限来执行NetShareEnum 来返回本地共享的目录。
来源: http://www.mvps.org/vb/ |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
UncName |
 1.0  |
2004-04-18 |
下载 |
|
|