当前位置:编程学习 > C#/ASP.NET >>

请教怎么得到本地管理权限下Window8网络映射驱动器的路径

我在本地管理员账号权限的window8下面映射了一个网络硬盘为W:

我做了一个程序,代码为:

MsgBox("6. " & System.IO.Path.GetPathRoot(System.Reflection.Assembly.GetExecutingAssembly.Location))
MsgBox("5. " & System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location))
MsgBox("4. " & System.Reflection.Assembly.GetExecutingAssembly.Location)
MsgBox("3. " & AppDomain.CurrentDomain.BaseDirectory)
MsgBox("2. " & System.Environment.CurrentDirectory)
MsgBox("1. " & Application.StartupPath)

如果用程序默认"requestedExecutionlevel = asInvoker" 生成app,然后放在这个W里面

那么所有的代码都可以正确得到以"W:"开头的路径。

如果把"requestedExecutionlevel = highavailable" 或者"requestedExecutionlevel = requirementadministrator"  再生成app,然后放在这个W里面

那么所有得到的路径都会以"\\"开头了

这个问题不发生在Win7,Vista,只发生在Win8.

也不发生在Win8 build-in 管理员权限下.

 请问有没有解决办法,感激不尽。(asInvoker的权限太小,不适合项目使用,必须用highavailable)

补充:.NET技术 ,  VB.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,