Utilisation de VB6Comment obtenir seulement un nom de fichier?
Code.
Dim posn As Integer, i As Integer
Dim fName As String
posn = 0
For i = 1 To Len(flname)
If (Mid(flname, i, 1) = "\") Then posn = i
Next i
fName = Right(flname, Len(flname) - posn)
posn = InStr(fName, ".")
If posn <> 0 Then
fName = Left(fName, posn - 1)
End If
GetFileName = fName
FileName: Clockings8.mis06042009 120442.fin
Mais il montre un nom de fichier est "Clockings8". Il devrait montrer "Clockings8.mis06042009 120442"
Comment modifier un code?
besoin code VB6 Aide
Il existe également [GetFileName] (https://msdn.microsoft.com/en-us/library/office/gg264499.aspx), qui inclut l'extension (pour éviter que d'autres personnes effectuent une recherche comme moi, qui avaient besoin d'un VB6 équivalent de 'Path.FileName') – dlatikay