dotnet-Snippets.com
Snippets: 61 | Registered User: 61 | Visitors online: 11
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
Give file an attribute

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

Views: 2112

Description:

With this function you can give a file an attribute like ready-only.



Visual Basic
1
2
3
4
5
6
Public Sub SetAttribute(ByVal FileName As String, ByVal NewAttribute As FileAttribute)
    Dim Attr As FileAttributes
    Attr = File.GetAttributes(FileName)
    File.SetAttributes(FileName, Attr Or NewAttribute)
End Sub



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.)