473,387 Members | 1,575 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,387 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 4627

<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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.