本文整理汇总了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