本文整理匯總了VB.NET中System.Reflection.ParameterAttributes枚舉的典型用法代碼示例。如果您正苦於以下問題:VB.NET ParameterAttributes枚舉的具體用法?VB.NET ParameterAttributes怎麽用?VB.NET ParameterAttributes使用的例子?那麽, 這裏精選的枚舉代碼示例或許可以為您提供幫助。
在下文中一共展示了ParameterAttributes枚舉的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: paramatt
' 導入命名空間
Imports System.Reflection
Class paramatt
Public Shared Sub mymethod(ByVal str1 As String, ByRef str2 As String, _
ByRef str3 As String)
str2 = "string"
End Sub
Public Shared Function Main() As Integer
Console.WriteLine(ControlChars.CrLf + "Reflection.ParameterAttributes")
' Get the Type and the method.
Dim Mytype As Type = Type.GetType("paramatt")
Dim Mymethodbase As MethodBase = Mytype.GetMethod("mymethod")
' Display the method.
Console.WriteLine("Mymethodbase = " + Mymethodbase.ToString())
' Get the ParameterInfo array.
Dim Myarray As ParameterInfo() = Mymethodbase.GetParameters()
' Get and display the attributes for the second parameter.
Dim Myparamattributes As ParameterAttributes = Myarray(1).Attributes
Console.WriteLine("For the second parameter:" + ControlChars.CrLf _
+ "Myparamattributes = " + CInt(Myparamattributes).ToString() _
+ ", which is a " + Myparamattributes.ToString())
Return 0
End Function
End Class