How to convert to UNC path

  • Thread starter Thread starter Elmo Watson
  • Start date Start date
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?
 
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.
 
Is there a way, then, to get the computer name, in code?
Then, at least I could convert the C:\ to \\ComputerName\C$
 
Back
Top