473,467 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FSO vs. System.IO ??

FSO appears to provide more information -- specifically about the type of drive (i.e. floppy vs. hard drive vs. network drive vs. removable drive i.e. CD-ROM/DVD) than the System.IO .NET framework approach unless I just can't find the properties and/or method I need to get the information about a drive?

I'm trying to use

System.IO.Directory.GetLogicalDrives

I get the drives, but I can't seem to get any info about the drive like I could get with the FSO (File System Object) approach I used in VB6.

Thanks, Rob.
Nov 20 '05 #1
6 2802
Hi Rob,

It's bad to use FSO because it's unmanaged... you are however
(unfortunately) correct when you say you cannot derive drive types etc from
it... and you will have to resort to the Windows API for this.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations

"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:ua**************@TK2MSFTNGP09.phx.gbl...
FSO appears to provide more information -- specifically about the type of
drive (i.e. floppy vs. hard drive vs. network drive vs. removable drive i.e.
CD-ROM/DVD) than the System.IO .NET framework approach unless I just can't
find the properties and/or method I need to get the information about a
drive?

I'm trying to use

System.IO.Directory.GetLogicalDrives

I get the drives, but I can't seem to get any info about the drive like I
could get with the FSO (File System Object) approach I used in VB6.

Thanks, Rob.
Nov 20 '05 #2
* "Rob R. Ainscough" <ro*****@pacbell.net> scripsit:
FSO appears to provide more information -- specifically about the type of drive (i.e. floppy vs. hard drive
vs. network drive vs. removable drive i.e. CD-ROM/DVD) than the System.IO .NET framework approach unless I just
can't find the properties and/or method I need to get the information about a drive?


There are no classes about drives. The next release of the .NET
Framework will include a 'DriveInfo' class.

You can determine the type of a drive like this:

<http://www.mvps.org/dotnet/dotnet/code/filesystem/index.html#bkm1>
(Text is written in German, code in VB.NET)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Cor
Hi Rob,

I once changed the function from Herfried a little I thought, so as addition to his link, it is another approach to the same.

\\\needs a reference to system.management
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" _
)
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name, diskProperty.Value _
)
Next diskProperty
///

Cor

Nov 20 '05 #4
Thanks folks,

Unmanaged is the only way -- bummer. I was trying to keep everything
managed but the more I get into VB.NET with the requirements of my
project, the more I see it is pretty hard to stay "managed only".

Any word on when the next .NET Framework?

Thanks, Rob.

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #5
* "Tom Spink" <thomasdotspinkat@ntlworlddotcom> scripsit:
It's bad to use FSO because it's unmanaged... you are however
(unfortunately) correct when you say you cannot derive drive types etc from
it... and you will have to resort to the Windows API for this.


ACK. P/invoke on 'GetDriveType' or WMI (see my other post).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
* ro*****@msn-dot-com.no-spam.invalid (Robains) scripsit:
Unmanaged is the only way -- bummer. I was trying to keep everything
managed but the more I get into VB.NET with the requirements of my
project, the more I see it is pretty hard to stay "managed only".

Any word on when the next .NET Framework?


2H 2004.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
2
by: Scott | last post by:
Not sure if this is the right place to post this or not, but I am in the process of trying to find a Web Hosting/Isp Billing system that is reasonable in price and uses Access or SQL Server for a...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
5
by: laks | last post by:
Hi I have the following xsl stmt. <xsl:for-each select="JOB_POSTINGS/JOB_POSTING \"> <xsl:sort select="JOB_TITLE" order="ascending"/> This works fine when I use it. But when using multiple...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
1
by: Sky | last post by:
Yesterday I was told that GetType(string) should not just be with a Type, but be Type, AssemblyName. Fair enough, get the reason. (Finally!). As long as it doesn't cause tech support problems...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
2
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.