|
-
Apr 25th, 2008, 01:56 PM
#1
Thread Starter
Lively Member
DirectoryInfo.GetDirectories() not working properly in .net 1.1
(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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|