Michael,

I found this codeproject that uses windows API calls to determine the
UNC path of a directory

http://www.codeproject.com/KB/IP/networkshares.aspx

Hope it helps

Jamie

On Mon, Jun 28, 2010 at 2:45 PM, Michael Busch
<[email protected]> wrote:
> HI Guys.
>
> I have a problem.
>
> I want to list all shared network folders in my program. Thats working fine,
> code below.
>
> BUT I would like to show also the UNC name of the share (like
> \\server\folder\)
> This is not working.
>
> Does somebody can help me, and show to get this information.
> Volume Label is showing me the label of the drive volume, but not the share
> name.
>
>
>
> current code (short version)
>
>
> public void listNetworkFolders(ref DataTable dt)
>
> {
>
> dt.Rows.Clear();
>
> System.IO.DriveInfo[] allDrives = System.IO.DriveInfo.GetDrives();
>
> foreach (System.IO.DriveInfo d in allDrives)
>
> {
>
> if (d.DriveType.ToString().Contains("Network"))
>
> {
>
> DataRow row = dt.NewRow();
>
> row[0] = d.Name + " " + d.VolumeLabel.ToString();
>
> dt.Rows.Add(row);
>
> }
>
> }
>
> }
>
>
>
> Thanks in advance.
>
>
>
> Michael



-- 
Eagles Jingle More

http://www.google.com/profiles/jgsnell

Reply via email to