dotnet-Snippets.com
Snippets: 57 | Registered User: 27 | Visitors online: 1
Main Menu

Home
Random Snippet
FAQs
Contact Us
Imprint
RSS Feeds

Rss All languages
Rss C#
Rss VB.NET
Rss C++
Rss J#
Rss ASP.NET
Google Ads

Sri Lanka .NET 
                Forum Member
Read single attribute from file

Author: Tim Hartwig
Programming Language: VB.NET Rating:
not yet rated

Views: 722

Description:

With this function you are able to read a single attribute from a file like Read-Only. So you can easily check if a special file attribute is given.



Visual Basic
1
2
3
4
5
6
Public Function IsAttributeGiven(ByVal FileName As String, ByVal CheckAttribute As FileAttribute) As Boolean
    Dim Attr As FileAttributes
    Attr = File.GetAttributes(FileName)
    If (Attr And CheckAttribute) = CheckAttribute Then Return True
End Function



Poor Excellent
1 2 3 4 5 6 7 8 9 10
Sign in to vote for this snippet.

Comments:
(Please log in to wrtite an comment.)