How to convert to UNC path

E

Elmo Watson

I know how to use the Path.GetDirectoryName, using System.IO, but what do I
use, or how do I convert it to a UNC path, so that if it's installed on a
different server/machine, entries to the log are UNC, showing the
computer/servername?
 
M

Matt Lacey

I know how to use the Path.GetDirectoryName, using System.IO, but what do I
use, or how do I convert it to a UNC path, so that if it's installed on a
different server/machine, entries to the log are UNC, showing the
computer/servername?

Doesn't a UNC path require that a directory is shared?
I believe it does which would mean that not every path can be
converted to a UNC equivalent. Therefore, I would assume that there
isn't a library function to support such an action and any attempt to
hack a solution wouldn't work in all situations.
 
E

Elmo Watson

Is there a way, then, to get the computer name, in code?
Then, at least I could convert the C:\ to \\ComputerName\C$
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top