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 634 korisnika na forumu :: 30 registrovanih, 3 sakrivenih i 601 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3028 - dana 22 Nov 2019 07:47

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: _commandos_, A.R.Chafee.Jr., Arhiv, bato3, bojank2, branko72, celeron, darios, doom83, dragisa dragisa, Faki-Valjevo, ikan, indja, ivance95, Jester, jumba, Konda2, KUZMAR, Mercury, Milan A. Nikolic, milimoj, Miskohd, nenad812, Sale.S, SD2, Toni, VJ, Vl veliki, VP3987, |_MeD_|