This is not a valid directory name. If you are already have valid
DriveInfo d
for some drive, you can get a valid file name by using
System.IO.DriveInfo.RootDirectory
property:
string fileName =
fileName = string.Format(
"{0}{1}{2}",
d.RootDirectory,
System.IO.Path.PathSeparator,
fileName);
Please see:
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.rootdirectory%28v=vs.110%29.aspx[
^].
If you need the file in some subdirectories, first create them under the root using
System.IO.Directory.CreateDirectory
:
http://msdn.microsoft.com/en-us/library/system.io.directory.aspx[
^].
—SA