473,791 Members | 3,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect drives that could contain removeable media

Bob
Is there a simple approach in vb.net to search logical drives to determine
which are removeable media types (e.g., a zip drive or the A drive)?
I've used FSO with VB6 for this and am now searching for a vb.net replacement.
--
Thanks, Bob
Dec 18 '05 #1
3 1396
For Each di As DriveInfo In DriveInfo.GetDr ives()
If (di.DriveType = DriveType.Remov able) Then
Console.WriteLi ne (di.Name & " is removable")
End If
Next

"Bob" <Bo*@discussion s.microsoft.com > wrote in message
news:BE******** *************** ***********@mic rosoft.com...
Is there a simple approach in vb.net to search logical drives to determine
which are removeable media types (e.g., a zip drive or the A drive)?
I've used FSO with VB6 for this and am now searching for a vb.net
replacement.
--
Thanks, Bob
Dec 19 '05 #2
Bob
Thanks. How do I define DriveInfo? What reference do I use?
--
Thanks, Bob
"Siva M" wrote:
For Each di As DriveInfo In DriveInfo.GetDr ives()
If (di.DriveType = DriveType.Remov able) Then
Console.WriteLi ne (di.Name & " is removable")
End If
Next

"Bob" <Bo*@discussion s.microsoft.com > wrote in message
news:BE******** *************** ***********@mic rosoft.com...
Is there a simple approach in vb.net to search logical drives to determine
which are removeable media types (e.g., a zip drive or the A drive)?
I've used FSO with VB6 for this and am now searching for a vb.net
replacement.
--
Thanks, Bob

Dec 21 '05 #3
It is in System.IO namespace. Remember it is only from .NET 2.0

"Bob" <Bo*@discussion s.microsoft.com > wrote in message
news:11******** *************** ***********@mic rosoft.com...
Thanks. How do I define DriveInfo? What reference do I use?
--
Thanks, Bob
"Siva M" wrote:
For Each di As DriveInfo In DriveInfo.GetDr ives()
If (di.DriveType = DriveType.Remov able) Then
Console.WriteLi ne (di.Name & " is removable")
End If
Next

"Bob" <Bo*@discussion s.microsoft.com > wrote in message
news:BE******** *************** ***********@mic rosoft.com...
Is there a simple approach in vb.net to search logical drives to determine
which are removeable media types (e.g., a zip drive or the A drive)?
I've used FSO with VB6 for this and am now searching for a vb.net
replacement.
--
Thanks, Bob

Dec 23 '05 #4

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

Similar topics

3
5425
by: RunLevelZero | last post by:
I need a way to detect hard drives and their partitions... labels would be nice too... I did some googling but did not find anything all too useful. This will strictly be on Linux / Unix so any help would be greatly appreciated. TIA
1
1607
by: Travis L. Alltop | last post by:
All, To make a long story short, we are swapping out the "knock-off" drives that the NA purchased on E-Bay in one of our production SQL Servers (SQL Server 2000 Enterprise) this weekend for brand new ones (Compaq 15K RPM 32GB drives). We are currently experiencing ASR almost on a daily basis and it is really causing a disription in service. SO, The Network Admin ahs made this decison to replace these drives in attempt to solve this....
1
1976
by: Jon1996 | last post by:
How do you access the volume label for a hard drive through C#? I am very much a beginner with C# at the moment and am developing a windows explorer program to help me learn. I have tried the GetLogicalDrives method of the Directory class and have also used the FullName property of the DirectoryInfo class, but they only return the drive letter (ex...C:\, or A:\). I would like to be able to list the volume label of the disk (ex...Local Disk,...
5
16950
by: Vijay | last post by:
Hi all, i have TCP client server application written in C# using async socket methods, eg BeginReceive(), BeginEnd() etc server is continuesly running in the background, client connect to server and recives data from server. If server application shuts down client immedeatly recieves disconnection or exception, but im not able to detect if some body removed network cable of node , where server is running. Client continuesly waits for...
3
11683
by: Flix | last post by:
I need to detect the root directories of the installed hard disks (es: C:, D:, E:, etc.). I'm not interested in cd drives. I know that there is a way (a bit slow, if I remeber) to retrive all the drives using a code like this: ManagementClass diskClass = new ManagementClass("Win32_LogicalDisk"); ManagementObjectCollection disks = diskClass.GetInstances(); foreach (ManagementObject disk in disks) {
9
37210
by: Paul Steele | last post by:
I am writing a C# app that needs to periodically poll for cdroms and usb storage device insertions. I've looked at the WMI functions but haven't found anything all that useful. The closest is Win32_DiskDrive, but it doesn't seem to return any information on cdrom devices. I suspect there might be a Win32 API call, but I haven't found any info yet using Google. Is there a way to achieve this in C#?
4
5814
by: sanjana | last post by:
hi can anyone help me with this i want to write a code in c#.net which detects usb storage and media card insertion can anyone help me with this?? thanx
1
5594
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? Ideally I would like some sort of event that would call my code when it happens. The FileSystemWatcher object doesn't seem able to do this, unless I am missing something. Thanks
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10428
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10156
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7537
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.