(language C#)
When I use this code:
DirectoryInfo drInfo = new DirectoryInfo(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites));
DirectoryInfo[] subDrInfo = drInfo.GetDirectories();
if (subDrInfo.Length > 0)
subDirInfo.Length returns 1 which is not true
When I use
DirectoryInfo drInfo = new DirectoryInfo(@"C:\Documents and Settings\myUserName\Favorites");
DirectoryInfo[] subDrInfo = drInfo.GetDirectories();
if (subDrInfo.Length > 0)
subDirInfo.Length returns 3 which is correct
But I have to use Environment.SpecialFolder.Favorites instead of giving full path of the folder. The same code works fine in .net 2.0 . Any help please?


Reply With Quote


