22.08.2013 Views

Visual Basic 6 Kurs

Visual Basic 6 Kurs

Visual Basic 6 Kurs

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

If Atrybuty > 31 Then<br />

MsgBox "Archiwalny"<br />

Atrybuty = Atrybuty - 32<br />

End If<br />

If Atrybuty > 15 Then<br />

MsgBox "Katalog"<br />

Atrybuty = Atrybuty - 16<br />

End If<br />

If Atrybuty > 3 Then<br />

MsgBox "Systemowy"<br />

Atrybuty = Atrybuty - 4<br />

End If<br />

If Atrybuty > 1 Then<br />

MsgBox "Ukryty"<br />

Atrybuty = Atrybuty - 2<br />

End If<br />

If Atrybuty > 0 Then<br />

MsgBox "Tylko do odczytu"<br />

End If<br />

Oczywiście lepiej było by to zrobić na instrukcji Case jednak pokazanie tego na If pozwoli<br />

łatwiej to zrozumieć.<br />

35. Spis plików i katalogów<br />

http://visual.basic.kaem.forall.pl/<br />

W tym dziale opisze jak wyciągnąć za pomocą API nazwy plików oraz katalogów z<br />

wybranego katalogu. Jest to o wiele szybszy sposób niż wyciąganie nazw plików i<br />

folderów z umieszczonych na formie kontrolek FileListBox i DirListBox.<br />

Mając doczynienia z API musimy zadeklarować pewne procedury oraz typy zmiennych:<br />

Private Type FILETIME<br />

dwLowDateTime As Long<br />

dwHighDateTime As Long<br />

End Type<br />

Private Type WIN32_FIND_DATA<br />

Atrybuty As Long<br />

ftCreationTime As FILETIME<br />

ftLastAccessTime As FILETIME<br />

ftLastWriteTime As FILETIME<br />

RozmiarNaHDD As Long<br />

Rozmiar As Long<br />

dwReserved0 As Long<br />

dwReserved1 As Long<br />

Nazwa As String * 260<br />

cAlternate As String * 14<br />

End Type<br />

51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!