473,503 Members | 5,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Howto get the servername and share of a networkdrive?

2 New Member
Aloha,

i want to do the following: i have the letter of a networkdrive (G:\)
and i want to get the servername and the sharename with c#
Example:
server is "myservername"
share is "pics\new_pics"

How can i get these infos? If i go into windows-explorer it says:
"new_pics on myservername\pics" (G:)

thanks for your answers

Markus
Nov 12 '07 #1
2 1116
Plater
7,872 Recognized Expert Expert
Mmm you could probably look up how to do it in WMI.
Or something with network shares. But I'm not sure how.

You could also do a scrape on the output of "NET USE" if you wanted
Nov 12 '07 #2
klony
2 New Member
Thanks alot!

using wmi is a good choice.

I only have to use the Win32_LogicalDisk - Class
The Property "Providername" returns the UNC-Name of the Network-Device if it is one, else null.

Markus
Nov 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3825
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
4
2857
by: Josef Sachs | last post by:
Is Andrew Kuchling's regex-to-re HOWTO available anywhere? I've found the following (dead) links on various Web pages: http://py-howto.sourceforge.net/regex-to-re/regex-to-re.html...
2
7899
by: tgru | last post by:
I am trying to script out the creation of database scripts. I am trying to use @@servername in the statement. I found out the select @@servername returns NULL. I used sp_dropserver to drop any...
0
1470
by: Mark Harrison | last post by:
HOWTO: Integrating Posgresql queries into an event loop. Mark Harrison mh@pixar.com May 27, 2004 Problem ------- The commonly used postgresql APIs will block until completed.
3
11563
by: Sako | last post by:
I am trying to teach myself perl by writing a program I've been meaning to implement, so I am pretty green in perl. I'm having problems sharing filehandles opened by a thread - been RTFM for a few...
1
2013
by: =?Utf-8?B?cm9nZXJfMjc=?= | last post by:
http://www.sqldbatips.com/showarticle.asp?ID=45 the tutorial I am looking at. I copied the last method. and I am using the following references using System; using...
3
2469
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 with Apache 2. How would I get the value of the "ServerName" attribute of the "<VirtualHostdirective in the Apache configuration (httpd.conf) file? I noticed that...
1
2964
by: Mark | last post by:
I am really struggling with this, trying to understand why it doesn't work. I've simplified the code down to the essentials. The GridView displays in ReadOnly mode just fine, Clicking the "edit"...
2
3139
by: Daniel Ngu | last post by:
Hi, I'm in the process of moving a database from a server running Windows 2000 SP4 to a PC running XP SP2. Basically, here's what I've managed to do so far: Made a full backup of the database...
0
7188
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
7258
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,...
1
6970
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...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.