473,388 Members | 1,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Converting physical folder path to UNC

Greetings

In VB 6.0 using WNetGetConnection Windows API you could convert a physical
drive designation to a UNC.

How do you convert a physical drive to a UNC within VB.NET?

Thank you
Nov 20 '05 #1
1 2011
Hi ,
You can use the same API in .Net. Here is how it has to be declared

Private Declare Function WNetGetConnection Lib "mpr.dll" Alias _
"WNetGetConnectionA" _
(ByVal lpszLocalName As String, _
ByVal lpszRemoteName As String, _
ByRef cbRemoteName As Int32) As Int32
Then use the following code to call this API
Dim y As String
y = Space(100)

WNetGetConnection("Y:", y, 100)
MsgBox(y)

Anand Balasubramanian
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike | last post by:
Hi guys, I need to convertvirtual (http:// ...) path to physical (c:\...) in the desktop application. Any ideas? Thansks, Mike
0
by: jason | last post by:
What is the best way to handle global includes for 3 subwebs that may at various times consume similiar include files such as ENQUIRY FORMS. I ask this question as I now have the oppportunity to...
2
by: Simon | last post by:
I wonder if someone can help with this - I 'm creating an IISVirtualDirectory, and setting its Path property to the physical path I want to reference. This works fine when I have a standard file...
0
by: Steven | last post by:
Hello In my asp.net app I'm using a xml viewer to display an xml document. I have several xml documents under C:\MyWebS\XMLDocs folder. Depending on the user selection I will be passing the...
1
by: Raed Sawalha | last post by:
I have a problem in getting asp.net application physical path in global.ascx static function in my global.ascx i have a static function : first i tried to get the physical path by refelection...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
9
by: dgk | last post by:
Is there some built in way to know whether a physical folder path is 'My Documents" for a specific user? I can always use xxx.StartsWith to compare it to the enumeration returned by the Personal...
4
by: Vaclav Jedlicka | last post by:
Hello, I created a web app using Visual Web Developer 2005 Express Edition. The project is called "mytest". When I view a page in the browser, its URL looks like ...
1
by: Mick Walker | last post by:
Hi all, I am wondering is it possible to create a physical Directory such as "C:\Test" using the DirectoryServices namespace. If so, does anyone have any resources on how to do it? I should...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.