Atributi

Atributi

offline
  • Pridružio: 05 Sep 2003
  • Poruke: 7

Molim programere u VB da mi napisu proceduru za menjanje ATRIBUTA
svih fajlova u direktorijumu ili delimicnih (uslovljenih),.
HVALA !


Crying or Very sad Idea



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • Pridružio: 16 Jun 2003
  • Poruke: 240

Procedura za citanje atributov:

Sub ShowFiles() ' Displays the names and attributes of all files in ' the specifed directory Dim sAttr As Integer Dim fName As String Dim pName As String Dim fCount As Integer pName = InputBox("Enter a directory to search in: ") If Trim(pName) = " " Then Exit Sub If Right(pName, 1) <> "\" Then pName = pName & "\" sAttr = vbDirectory + vbArchive + vreadonly + _         vbHidden + vbSystem     'get the first file name and atributes fName = Dir(pName & "*.*", sAttr) If (fName <> " ") And _ ((fName <> ".") And (fName <> "..")) Then     ShowFileAttr pName & fName     fCount = 1 End If Do While (fName <> " ")     fName = Dir()     If ((fName <> ".") And (fName <> ".")) Then     ShowFileAttr pName & fName     fCount = fCount + 1     End If Loop MsgBox fCount & " files found." End Sub Sub ShowFileAttr(fName As String) 'displays a message box showing the file attributes of the 'filename in the fName argument Dim fAttr As Integer Dim mStr As String fAttr = GetAttr(fName) mStr = UCase(fName) mStr = mStr & " has these attributes: " & vbCr If (fAttr And vbReadOnly) Then _     mStr = mStr & "Read-Only" & vbCr If (fAttr And vbHidden) Then _     mStr = mStr & "Hidden" & vbCr If (fAttr And vbSystem) Then     mStr = mStr & "system" & vbCr If (fAttr And vbVolume) Then _     mStr = mStr & "Volume" & vbCr If (fAttr And vbDirectory) Then _     mStr = mStr & "Directory" & vbCr If (fAttr & vbArchive) Then _     mStr = mStr & "Archive" & vbCr End If MsgBox mStr End Sub

Sad samo obratni postupak.



offline
  • Pridružio: 05 Sep 2003
  • Poruke: 7

Zahvaljujem SantaCruz-u !

Ko je trenutno na forumu
 

Ukupno su 1291 korisnika na forumu :: 25 registrovanih, 9 sakrivenih i 1257 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: amaterSRB, bojank, bokisha253, Botovac, Brana01, cikadeda, DeerHunter, dragoljub11987, FileFinder, Fog of War, Georgius, ILGromovnik, Ivica1102, JOntra, Još malo pa deda, Kubovac, Lucije Kvint, Mcdado, Milos ZA, raptorsi, Srle993, Trpe Grozni, Tvrtko I, vladulns, voja64