本文整理汇总了VB.NET中System.Runtime.Remoting.Messaging.CallContext.GetHeaders方法的典型用法代码示例。如果您正苦于以下问题:VB.NET CallContext.GetHeaders方法的具体用法?VB.NET CallContext.GetHeaders怎么用?VB.NET CallContext.GetHeaders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Remoting.Messaging.CallContext
的用法示例。
在下文中一共展示了CallContext.GetHeaders方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: myArrGetHeader
' Array of Headers with name and values initialized.
Dim myArrSetHeader As Header() = {New Header("Header0", "CallContextHeader0"), _
New Header("Header1", "CallContextHeader1")}
' Pass the Header Array with method call.
' Header will be set in the method by'CallContext.SetHeaders' method in remote object.
Console.WriteLine("Remote HeaderMethod output is " _
+ myService.HeaderMethod("CallContextHeader", myArrSetHeader))
Dim myArrGetHeader() As Header
' Get Header Array.
myArrGetHeader = CallContext.GetHeaders()
If myArrGetHeader Is Nothing Then
Console.WriteLine("CallContext.GetHeaders Failed")
Else
Console.WriteLine("Headers:")
End If
Dim myHeader As Header
For each myHeader in myArrGetHeader
Console.WriteLine("Value in Header '{0}' is '{1}'.",myHeader.Name,myHeader.Value)
Next