473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Why no drive object?

dgk
Having searched far and wide in the net classes, and then having
searched far and wide in this newsgroup, it is obvious that there is
no Drive object. We have io.directory objects and a GetLogicalDrives
method, but no way to manipulate the drives returned by
GetLogicalDrives except for Management objects. Logically, shouldn't a
drive object just be part of System.IO? I really don't want to use the
FSO stuff.

This is lots of work just to duplicate the functionality of a
drivebox. Well, I'm sure MS had a good reason do make it so indirect.
Does anyone know what that reason is?
Nov 20 '05 #1
5 1105
"dgk" <so*********@zero-spam-hotmail.com> schrieb
Having searched far and wide in the net classes, and then having
searched far and wide in this newsgroup, it is obvious that there
is no Drive object. We have io.directory objects and a
GetLogicalDrives method, but no way to manipulate the drives returned
by GetLogicalDrives except for Management objects. Logically,
shouldn't a drive object just be part of System.IO? I really don't
want to use the FSO stuff.

This is lots of work just to duplicate the functionality of a
drivebox. Well, I'm sure MS had a good reason do make it so
indirect. Does anyone know what that reason is?


I think the question is not related to the VB.NET language. Please post to
one of the Framework groups (microsoft.public.framework[.*]).
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* dgk <so*********@zero-spam-hotmail.com> scripsit:
Having searched far and wide in the net classes, and then having
searched far and wide in this newsgroup, it is obvious that there is
no Drive object.


As Armin says, that's not the right place for the question.

In .NET 2.0, there will be a 'DriveInfo' class:

<http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.io/c/driveinfo/driveinfo.aspx>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
dgk
On 27 Dec 2003 00:06:53 +0100, hi***************@gmx.at (Herfried K.
Wagner [MVP]) wrote:
* dgk <so*********@zero-spam-hotmail.com> scripsit:
Having searched far and wide in the net classes, and then having
searched far and wide in this newsgroup, it is obvious that there is
no Drive object.


As Armin says, that's not the right place for the question.

In .NET 2.0, there will be a 'DriveInfo' class:

<http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.io/c/driveinfo/driveinfo.aspx>


Ok. Looks like something they just didn't have time to finish.
Nov 20 '05 #4
* dgk <so******************@zero-spam-hotmail.com> scripsit:
Having searched far and wide in the net classes, and then having
searched far and wide in this newsgroup, it is obvious that there is
no Drive object.


As Armin says, that's not the right place for the question.

In .NET 2.0, there will be a 'DriveInfo' class:

<http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.io/c/driveinfo/driveinfo.aspx>


Ok. Looks like something they just didn't have time to finish.


ACK. Have a look at the complete class tree, a lot of new classes will
be added which were missing since .NET 1.0.

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
dgk
On 27 Dec 2003 13:34:58 +0100, hi***************@gmx.at (Herfried K.
Wagner [MVP]) wrote:
* dgk <so******************@zero-spam-hotmail.com> scripsit:
Having searched far and wide in the net classes, and then having
searched far and wide in this newsgroup, it is obvious that there is
no Drive object.

As Armin says, that's not the right place for the question.

In .NET 2.0, there will be a 'DriveInfo' class:

<http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.io/c/driveinfo/driveinfo.aspx>


Ok. Looks like something they just didn't have time to finish.


ACK. Have a look at the complete class tree, a lot of new classes will
be added which were missing since .NET 1.0.

;-)


Just one more thing then. The example in the MSDN library for
Freespace uses FSO and I don't want to. I swiped some of this code
from a previous post of yours and I just cannot figure out how to drop
the drive name or volume or any other property into a listbox. Can you
please tell me what I'm doing wrong? The 1 to Length-1 is intentional,
I'm skipping A: because I didn't want to start off with a removable
drive just in case that was a problem. As is, I'm getting an Invalid
Class error for each drive. I've tried a hundred permutations of this
code.

For i = 1 To Drives.Length - 1
DriveL = "Win32_LogicalDisc.DeviceID=" & Chr(34) &
Drives(i).Substring(0, 2) & Chr(34)
'DriveL = "Win32_LogicalDisc.DeviceID=""C:" & """"
Dim Mydisk As New System.management.ManagementObject(DriveL)
MessageBox.Show("Testing " & Mydisk.Path.ToString) ' this is
just returning DriveL, which is a string. But no error.
Dim diskProperty As System.Management.PropertyData
Try
ListBox1.Items.Add(Mydisk.Properties("FreeSpace"). ToString)
'For Each diskProperty In Mydisk.Properties
' ListBox1.Items.Add(diskProperty.Name)
' 'ListBox1.Items.Add(diskProperty.Value)
'Next
' ListBox1.Items.Add(Mydisk.Properties("Name"))
Catch ex As System.Exception
MsgBox("Error is " & ex.Message)
End Try
Next
Nov 20 '05 #6

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

Similar topics

8
by: Ken Varn | last post by:
Everytime I call Process.GetCurrentProcess() the system goes out to the floppy drive. Why does this happen. I decided to use FileMon to get a log of what is happening when this occurs. Here is...
3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
7
by: GregT | last post by:
I program in C#. Is there a way to determine which of the local machine's logical drives are associated with CD drive(s)?
7
by: Eric.Jones | last post by:
I've encountered a strange error with loading delimited files from a Samba (SMB) network drive, has anyone else seen this before? (Platform: WinXP Pro, UDB PE 8015, level 02060106, SAMPLE db) ...
1
by: Iwan | last post by:
I have a speciffic task of which i do not know how to start on. The task is to create a virtual drive (like a ram drive og deamon tools). Through this drive files are to be saved and loaded like...
0
by: petro | last post by:
I am trying to deploy an asp.net application to my web server. My application uses system.data.oledb to connect to an oracle database. On my development machine I have the oracle client 10g...
14
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the...
4
by: robert d via AccessMonster.com | last post by:
When my app starts up, it creates a temporary database. This temp database is created from a 'model' database that is in the same folder as the application. Because there is a model, the creation...
1
by: Steve Marshall | last post by:
Hi All, Apologies if this has come up before, but how can I set up something that will notify me when a removeable drive (like a USB drive or CompactFlash card) is inserted into its slot? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.