There is no such thing as "Unknown root directory". You always have some root: the root of each volume on the system. You can get all logical drives using
System.IO.DriveInfo.GetDrives
and the root directory of each using
System.IO.DriveInfo.GetDrives.RootDirectory
, please see:
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.getdrives.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.rootdirectory.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx[
^].
Now, let me tell you that
for ASP.NET it makes no sense at all, anyway. Where do you want to search for directory? On client side? A Web application does not have access to the client side. On server side? A Web application can access only the directories relative to the root path of the site.
So, on the server side, your real root is the one returned as
Server.MapPath("~/");
please see:
http://msdn.microsoft.com/en-us/library/ms178116.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx[
^].
There is nothing else you can do.
Anything else is not accessible by your Web application.
—SA