| | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 06/27/2008 5:57:22 PM Posts: 436, Visits: 942 |
| | I cant seem to figure out how to determine if a folder is read-only through VB .NET. Any help? Thanks |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 1:52:08 PM Posts: 400, Visits: 1,618 |
| | Hi, Try the following code: Dim myDirectory As New System.IO.DirectoryInfo("C:\TEMP")If myDirectory.Attributes = System.IO.FileAttributes.ReadOnly Then ' Add your code here.End If
Edhy RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 06/27/2008 5:57:22 PM Posts: 436, Visits: 942 |
| | | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Today @ 3:11:51 PM Posts: 1,148, Visits: 2,831 |
| The attributes property is a bitwise flag, so you actually want to use something like this:
Dim myDirectory As New System.IO.DirectoryInfo("C:\TEMP")
If (myDirectory.Attributes And System.IO.FileAttributes.ReadOnly) = System.IO.FileAttributes.ReadOnly Then
' Add your code here.
End If |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 11:54:01 AM Posts: 4,104, Visits: 4,177 |
| Yup...Greg nailed it! |
| |
|
|