VB.NET代码将本地路径转换为共享的UNC路径 [英] VB.NET code to Convert local path to shared UNC path

查看:157
本文介绍了VB.NET代码将本地路径转换为共享的UNC路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有Windows 2003 Server pc2,其中本地驱动器使用不同的名称共享.例如,本地驱动器E与名称数据路径"共享,以便网络访问中的所有用户都使用网络路径"\\ pc2 \ datapath \"进行驱动.我们需要VB.net代码进行转换 共享UNC路径的本地路径,即,如果我们输入"E:\ netuse",则代码必须返回"\\ pc2 \ datapath \ netuse".在VB.net中有什么方法可以做到这一点?请帮助

We have windows 2003 server pc2 in which local drives are shared with different names. For example local drive E is shared with name 'datapath' so that all users in network access that drive using network path '\\pc2\datapath\'. We need VB.net code to convert local path to  shared UNC path i.e if we input 'E:\netuse',code must return '\\pc2\datapath\netuse'. Is there any way to do this in VB.net?? Pls help

谢谢

推荐答案

你好,

看看 WNetGetUniversalName . VB.NET代码大约位于页面的一半.

Take a look at WNetGetUniversalName. The VB.NET code is about half way down the page.


这篇关于VB.NET代码将本地路径转换为共享的UNC路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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