.NET ソース コードによると、IsReadOnly
プロパティはファイルの属性をチェックするだけです。
特定のプロパティは次のとおりです。
public bool IsReadOnly {
get {
return (Attributes & FileAttributes.ReadOnly) != 0;
}
set {
if (value)
Attributes |= FileAttributes.ReadOnly;
else
Attributes &= ~FileAttributes.ReadOnly;
}
}
これは、次の VB.Net コードに変換されます
Public Property IsReadOnly() As Boolean
Get
Return (Attributes And FileAttributes.[ReadOnly]) <> 0
End Get
Set
If value Then
Attributes = Attributes Or FileAttributes.[ReadOnly]
Else
Attributes = Attributes And Not FileAttributes.[ReadOnly]
End If
End Set
End Property
なぜ複数の方法があるのかというと、これはいたるところで見られます。たとえば、StringBuilder.append("abc" & VbCrLf)
またはStringBuilder.appendLine("abc")