VB.NET Language in a Nutshell

   
GetAttr Function

Class

Microsoft. VisualBasic.FileSystem

Yes

Syntax

GetAttr( pathname )

pathname (required; String)

Filename and an optional pathname

Return Value

An integer representing the sum of the following constants or members of the FileAttribute enumeration, which reflect the attributes set for the file:

FileAttribute Enum

Constant

Value

Description

Normal

VbNormal

Normal

ReadOnly

VbReadOnly

1

Read-only

Hidden

VbHidden

2

Hidden

System

VbSystem

4

System

Directory

VbDirectory

16

Directory or folder

Archive

VbArchive

32

File has changed since last backup

Description

Determines which attributes have been set for a file or directory

Rules at a Glance

Programming Tips and Gotchas

If pathname is invalid, a FileNotFoundException exception is generated.

   

Категории