Don't try to make sense of this (the why), there is a purpose to it (I need the how).... I know .NET supports UNC paths for savings, deleting, blah blah, but the problem is you have to know both the computer name (or IP) and shared folder. Not a problem 99% of the time. The particular application I'm making though is suppose to go through the network and get all the computers within an IP range which I've done below:
Later, once I figure out the next piece of the puzzle rather than simply displaying the computer name I will be using it to search for shared folders, all of this information will go into a database for later use.
As you may or may not know you can't use the GetDirectories function because you will get an error (UNC paths must be in the format of //servername/share) - so I've been beating my brain out on this all day and I'm burnt; any ideas? Am I doing this the hard way for resolving IP address to common name? I've gone from really trying to find an answer exactly to randomly picking help files that are remotely close, all to no avail, so now that I've gotton to the I give up point... here I be....
Thanks,
Brian
C#:
//(string) ipaddress holds an ip-address is standard number
//format. I use a search range (ex: 169.0.0.1 - 169.0.0.255)
//prior to this code snippet in a loop incrementing the last octet
IPHostEntry hostInfo = Dns.Resolve(ipaddress);
Console.WriteLine("Computer: " + hostInfo.HostName);
Later, once I figure out the next piece of the puzzle rather than simply displaying the computer name I will be using it to search for shared folders, all of this information will go into a database for later use.
As you may or may not know you can't use the GetDirectories function because you will get an error (UNC paths must be in the format of //servername/share) - so I've been beating my brain out on this all day and I'm burnt; any ideas? Am I doing this the hard way for resolving IP address to common name? I've gone from really trying to find an answer exactly to randomly picking help files that are remotely close, all to no avail, so now that I've gotton to the I give up point... here I be....
Thanks,
Brian