473,396 Members | 1,814 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,396 software developers and data experts.

Programmatically read file(s) from a USB device

Suppose I have one of those USB storage devices (like a mp3 player, USB
thumbdrive, or even digital camera) connected to my computer. I'd like
to write a C# program that can

- detect that the USB device is connected, and then
- read file(s) from that USB device.

How can I do that? Any reference?

Thanks a lot in advance
Dom

Nov 22 '05 #1
4 4628

<do****@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Suppose I have one of those USB storage devices (like a mp3 player, USB
thumbdrive, or even digital camera) connected to my computer. I'd like
to write a C# program that can

- detect that the USB device is connected, and then
- read file(s) from that USB device.


It's just a disk drive; you read files the same way as from any other disk.
Nov 22 '05 #2
Thanks for your reply.

When I plug in my USB drive, a pop-up saying "USB device detected" will
be displayed and then the USB drive will be displayed as a new drive
letter. How can I find out that the USB device is detected / connected?
Also, which drive letter has it been assigned to?

Dom

Nov 22 '05 #3
I am not sure if this would help, but there is a library available from
the makers of SharpDevelop [a free IDE for .NET] called sharpusblib.
Just google the name and visit their site, to see if it will be of
help to you...

Nov 22 '05 #4
Hi dom, this has been discussed before, and it can be a bit involved,
but there are two topics in this group
(microsoft.public.dotnet.languages.csharp) which helped me when i was
looking.

'c# code detect inset/remove events at usb port'
'get drive letter( Win32_Diskdrive)'

If you searched (i'm on googlegroups) there are code examples. if you
can't find them, let me know, i'll dig out my code :)

Nov 22 '05 #5

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

Similar topics

2
by: Mike Bennett | last post by:
Does the .NET framework (using VB.NET) support the ability to programmatically STOP a device prior to its removal from the system? I have need to move data from a computer on one network to a...
4
by: domtam | last post by:
Suppose I have one of those USB storage devices (like a mp3 player, USB thumbdrive, or even digital camera) connected to my computer. I'd like to write a C# program that can - detect that the...
6
by: Patrice Kadionik | last post by:
Hi all, I want to make a brief comparison between read() and fread() (under a Linux OS). 1. Family read and Co: open, close, read, write, ioctl... 2. Family fread and Co: fopen, fclose,...
1
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this....
13
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
3
by: Sean Liong via .NET 247 | last post by:
Hi, Is there any possibilities Read/Write a the storage file from a client system from a ASP.net web application? I think using the activeX component able to achieve this but is there any other...
5
by: Sumana | last post by:
Hi All, We developed our project on VC++.Net console application to create image of disk and to write the image We are having problem with reading and writing the sector beyond 6GB Disk or...
14
by: Lauren Wilson | last post by:
Discovered this interesting comment on MSDN: "To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI)...
2
by: Reza Solouki | last post by:
Hello, I never had to do anything with office tools programmatically till now(I guess there is first time for everything), so this might be a very silly and simple question for some of you. Any...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...

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.