|
-
Sep 6th, 2000, 04:54 PM
#1
Thread Starter
New Member
Salut 
Mon problème est simple (je crois). J'ai un DriveListBox,
un DirListBox et un FileListbox associés entre-eux mais je
ne sais pas comment vérifier si le lecteur spécifié est
accessible.(ex: 'A:' ou 'D:')
I'm not like them
but I can pretend
-
Sep 6th, 2000, 05:25 PM
#2
Mon français est peu mauvais, cependant, je ferai mon le meilleur à expliquer. Vous essayez la gestion de l'erreur (pourrait être laid, cependant, du travail) pour voir si le lecteur est prêt ou pas
Code:
On Error GoTo EH
Open "D:\MyFile.txt" For Input As #1
EH:
If Err = 71 Then MsgBox ("Disk not ready")
[Edited by Megatron on 09-06-2000 at 06:30 PM]
-
Sep 6th, 2000, 05:48 PM
#3
_______
<?>
On Error GoTo EH:
Dir ("d:") 'or Dir (a
EH:
If Err.Number = 52 Then MsgBox ("Disk not ready")
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 6th, 2000, 06:21 PM
#4
Well, now that Megatron has kind of translated a language. I could kind of figure out what he meant, but I didn't want to say anything.
This will check to see if there is a disk or CD in the drive.
Code:
Function DiskInDrive() As Boolean
On Error GoTo ErrHan
Dir "D:\", vbDirectory
DiskInDrive = True
Exit Function
ErrHan:
DiskInDrive = False
End Function
Private Sub Command1_Click()
If DiskInDrive() Then
'do something if there is a disk/CD in D drive.
Else
'don't do anything if there is no disk/CD in D drive.
End If
End Sub
-
Sep 7th, 2000, 06:19 PM
#5
Fanatic Member
One would try
Quelqu'un essaierait (si vraiment il desirait une reponse)
de formuler sa question en Anglais, car la majorite des
gens dans ce forum ne parle que l'anglais.
Pourquoi les repondeurs doivent-ils faire un effort tandis
que ce serait mieux si cet effort etait mutuel!??
Merci
-
Sep 7th, 2000, 06:39 PM
#6
Hyperactive Member
Wow, I am impressed! When you attain guru status, you can understand French!
Touche' Megatron!
(I better get posting, if I ever want to learn what you guys are talking about)
-
Sep 7th, 2000, 06:52 PM
#7
dsy5: I knew all of those French courses I took would help me some day! 
Lafor: As I understand, he wants to see if a drive is ready (if there's a disk in it).
-
Sep 8th, 2000, 09:01 AM
#8
Fanatic Member
ok
Quelqu'un essaierait (si vraiment il desirait une reponse)
de formuler sa question en Anglais, car la majorite des
gens dans ce forum ne parle que l'anglais.
Pourquoi les repondeurs doivent-ils faire un effort tandis
que ce serait mieux si cet effort etait mutuel!??
Merci
Sorry Guys, this is the translation (responding to the
original person who submitted the message)
One would try (if indeed he wished to get an answer) to formulate his/her question in English since the majority
of people in this forum speak English only
Why should the "responders" make an effort while it would
be much better if this effort was mutual!??
Thank you
-
Sep 8th, 2000, 10:11 AM
#9
Hyperactive Member
Simple!
Tu peux faire comme les autres: mettre une protection contre les erreurs:
Code:
On error goto ErrHandler
dir1.path = drive1.drive
exit sub
Errhandler:
msgbox err.description, vbcritical, str$(err.number)
drive1.drive = dir1.path 'Retour au lecteur precedent
-
Sep 8th, 2000, 12:30 PM
#10
Lively Member
Wow! Je suis impressione! Du monde du Quebec sur VB-World.
En pire encore - des americains qui parlent francais!
Eh ben, on aura tout vu.
C/C++,Delphi, VB6,Java,PB (blech!),ASP,JSP,SQL...bla bla bla and bla
I love deadlines. I like the whooshing sound they make as they fly by.
—Douglas Adams
-
Sep 11th, 2000, 06:15 PM
#11
Thread Starter
New Member
Thank you/Merci
Well thank you Matthew Gates for your code (and your help) 
It works.
That's exactly what i needed.
I'm sorry I had to ask this question in french. I was in a
hurry and not much time for thinking about tanslation 
But I think I owe you (a least) a reply in english now that
I have some time to translate my sentences...
I'm not like them
but I can pretend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|