| |

VerySource

 Forgot password?
 Register
Search
View: 4065|Reply: 23

Super difficult question! How to judge whether it is a U disk according to the drive letter?

[Copy link]

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-9 20:30:01
| Show all posts |Read mode
Note that you cannot use GetDriveType to judge, because GetDriveType is a fixed disk for some U disks !!!!!!!!!


Please give detailed code Thank you !!!!!!!!!!!!!!!!!!
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Japan

Post time: 2020-5-31 22:00:01
| Show all posts
It cannot be judged based on the drive letter.
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-11 15:45:01
| Show all posts
Unless the partition is fixed, C\D\E\F...is a hard disk partition, everything else is a USB drive letter, otherwise there is no way
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-10 19:30:01
| Show all posts
If your program can be started before inserting the U disk, receive the USB insertion message BDT_DEVICEARRIVAL = $8000; and then scan the disk for changes, should this be possible? (It does not rule out that when you plug in a USB device, you also have a hard disk access, then it will not work)
    I have seen the source code of a program similar to the device manager before, but I couldn't find it there. That procedure should be solvable.
Reply

Use magic Report

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-7-10 20:45:01
| Show all posts
coolman214Your method won't work. If it has been inserted before running the program, you can't judge it. I heard that you can judge the bus type, but I don't know how to implement it. Does anyone know?????????? ??????
Reply

Use magic Report

0

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-7-19 14:30:01
| Show all posts
It can be obtained through SetupAPI with Volume query command~~
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-25 00:15:02
| Show all posts
TO: Use GetDriveType to judge your program!!
Cannot be judged by GetDriveType, because GetDriveType judges some U disks as fixed disks
Reply

Use magic Report

2

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-7-25 10:00:01
| Show all posts
Is there something wrong with your brain? ? Ask questions like this! ! ! ? ? ? ? ?

Just like you said, plug in the USB flash drive, then open the program, let the program to see if the flash drive is a USB flash drive?? Then I will tell you: it is impossible for him to recognize it if he is killed!!! Come out such a program!!!

Should the program always monitor whether there is an incident? ? Because when the U disk is inserted, the system will receive specific events, so your program can also receive specific events. That is to say, only when the USB flash drive is inserted or removed, can it be judged whether there is a USB flash drive inserted.

The improvised method:
In addition, because GetDriveType judges certain U disks as fixed disks, you have to look at the problem from another angle. It is not that this function is not working, but other people’s U disks are not compatible. Let him die and change the U disk!!!
Reply

Use magic Report

0

Threads

8

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-7-25 12:30:01
| Show all posts
Plug in the U disk, then open the program, let the program to see if the disk is a USB removable disk, it must be feasible!!!
As for the distinction between USB flash drives and USB mobile hard drives, there is nothing you can do~

The specific code needs to be provided for a fee~~
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-9 16:30:01
| Show all posts
It should be possible. For example, the general tax data collection software was developed with DELPHI to realize whether there is a USB flash drive on the computer, but I don't know how to achieve it, sorry
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list