Bonjours je cherche a savoir comment faire pour détecter si il y a une clef usb de connecté après l'ordinateur et si oui pourvoir écrire dessus.
Merci d'avance
TrollTop c++\cli
Bonjours je cherche a savoir comment faire pour détecter si il y a une clef usb de connecté après l'ordinateur et si oui pourvoir écrire dessus.
Merci d'avance
TrollTop c++\cli
est-ce qu'il y aurais quelqu'un qui pourrait m'aider s.v.p
Merci
TrollTop c++\cli
J'ai fait ceci mais je sais pas si il va détecté seulement les clefs usb. en tout cas à date ca fonctionne.
TrollTop c++/cli
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 private: System::Void RechercheUSB_Click(System::Object^ sender, System::EventArgs^ e) { array<String ^> ^drives = Environment::GetLogicalDrives(); array<String ^, 2> ^driveTrouver = gcnew array<String ^,2>(10,3); int i = 0; for each (String ^drive in drives) { try { DriveInfo ^monDriveInfo = gcnew DriveInfo(drive); // Vérification qu'on a bien affaire à un lecteur USB if (monDriveInfo->DriveType == DriveType::Removable) { // Vérification si il y a un USB if (monDriveInfo->IsReady == true) { driveTrouver[i,0] = monDriveInfo->Name; driveTrouver[i,1] = monDriveInfo->TotalSize.ToString(); driveTrouver[i,2] = monDriveInfo->TotalFreeSpace.ToString(); i++; } } } catch (Exception ^e) { //textBox17->Text = "Ceci n'est pas un lecteur USB !"; } } if (i==0) { MessageBox::Show(this,"Clef USB non trouvée","Error",MessageBoxButtons::OK,MessageBoxIcon::Error); return; } for (i=0; i<10; i++) { if (driveTrouver[i,0] != nullptr) { //textBox2->Text = textBox2->Text + driveTrouver[i,0] ; //textBox2->Text = textBox2->Text + " Total Size :" + driveTrouver[i,1] + " Total FreeSpace :" + driveTrouver[i,2]; } } }
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager