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