| | | 
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 @ 3:29:20 PM Posts: 400, Visits: 1,612 |
| | 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: Yesterday @ 7:28:28 PM Posts: 1,148, Visits: 2,830 |
| 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:13:06 AM Posts: 4,104, Visits: 4,176 |
| Yup...Greg nailed it! |
| |
|
|