A "new" .NET FileSystemObject?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I'm a little confused about something: Is there a .NET framework class that I am supposed to use now in place of all the goodies that the FileSystemObject used to provide? In particular, I'm looking for a Collection of avalable disk DRIVES and the data associated with them to iterate through in C#. Where might I find this

Thanks

Alex
 
Hello Alex,

Thanks for your post. The .NET System.IO model provides an object-based
tool for working with folders and files. Like FileSystemObject, it allows
you to use standard object.method syntax ¡ª with its own set of properties,
methods, and events ¡ª to process text and data, giving your applications
the ability to read from and write to files easily.

To get a collection of available disk DRIVES in .NET, you can use
Directory.GetLocicalDrives():

Directory.GetLogicalDrives Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemIODirectoryClassGetLogicalDrivesTopic.asp

For more classes relating to FileSystem, please refer to the following MSDN
section:

System.IO Namespace
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemio.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
In additon to Tian's comments, it's important to note that the System.IO name space, like the rest of the .NET framework, attempts to provide some platform-independent insulation, so you might not find it as all-encompassing or as well-encapsulated as the FileSystemObject you're used to. The .NET framework hopes to remain as platform independent as possible, so the fact that it provides a drive listing is a little confusing to me, but I guess it's better than taking existing functionality away in newer releases.
 
Back
Top