本文整理匯總了VB.NET中System.Reflection.FieldInfo.IsAssembly屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET FieldInfo.IsAssembly屬性的具體用法?VB.NET FieldInfo.IsAssembly怎麽用?VB.NET FieldInfo.IsAssembly使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Reflection.FieldInfo
的用法示例。
在下文中一共展示了FieldInfo.IsAssembly屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.Reflection
Public class Example
Public f_Public As Integer
Friend f_Friend As Integer
Protected f_Protected As Integer
Protected Friend f_Protected_Friend As Integer
Public Shared Sub Main()
Console.WriteLine(vbCrLf & _
"{0,-30}{1,-18}{2}", "", "IsAssembly", "IsFamilyOrAssembly")
Console.WriteLine("{0,-21}{1,-18}{2,-18}{3}" & vbCrLf, _
"", "IsPublic", "IsFamily", "IsFamilyAndAssembly")
For Each f As FieldInfo In GetType(Example).GetFields( _
BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public)
Console.WriteLine("{0,-21}{1,-9}{2,-9}{3,-9}{4,-9}{5,-9}", _
f.Name, _
f.IsPublic, _
f.IsAssembly, _
f.IsFamily, _
f.IsFamilyOrAssembly, _
f.IsFamilyAndAssembly _
)
Next
End Sub
End Class
輸出:
IsAssembly IsFamilyOrAssembly IsPublic IsFamily IsFamilyAndAssembly f_Public True False False False False f_Friend False True False False False f_Protected False False True False False f_Protected_Friend False False False True False