Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i am in a situation that i need to detect pen drive wheather it is connected or not using c language ...
if anyone knows the solution or having any ideas about it kindly share with me.if possible please give some sample code for this.if any blogs,links you know for this kindly let me know.


thanking u all..
have a great day
Posted
Updated 24-Jul-13 2:11am
v2
Comments
pasztorpisti 24-Jul-13 11:16am    
Which platform? Windows, linux, bootsector, bios?

Uset GetLogicalDriveStrings()[^] to read all the available logical drives. Check for each drive type using GetDriveType()[^].

The drive having DRIVE_REMOVABLE as drive type and BusTypeSd as Bus type is either a pen drive or SD card.

You can check drive bus type using DeviceIoControl()[^] function.


Let me know if you anything else.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900