Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Function which takes a file name and returns a str...
Website:
http://www.a1vbcode.com/
Submitted:
2/7/2000
Version:
VB3
Compatibility:
VB3,4,5,6
Category:
File Manipulation
Views:
20985
Function which takes a file name and returns a string containing all possible information about the file.
Declarations:
none
Code:
Public Function FileInfo(FileName) As String Dim File As String Dim Temp As String Dim Attrib As Integer File = FileName ' Use GetAttr function to get all attributes info Attrib = GetAttr(File) Temp = File & vbCrLf & vbCrLf Temp = Temp & "Date/Time: " & FileDateTime(File) & vbCrLf Temp = Temp & "Size: " & FileLen(File) & " bytes" & vbCrLf 'Test for read only attribute by masking bits If (Attrib And vbReadOnly) = vbReadOnly Then Temp = Temp & "ReadOnly: X" & vbCrLf End If ' Test for hidden attribute If (Attrib And vbHidden) = vbHidden Then Temp = Temp & "Hidden: X" & vbCrLf End If ' Test for system attribute If (Attrib And vbSystem) = vbSystem Then Temp = Temp & "System: X" & vbCrLf End If ' Test for archive attribute If (Attrib And vbArchive) = vbArchive Then Temp = Temp & "Archive: X" & vbCrLf End If ' Return Temp string containing all file info FileInfo = Temp End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement