本文整理汇总了VB.NET中System.Net.HttpWebRequest.ConnectionGroupName属性的典型用法代码示例。如果您正苦于以下问题:VB.NET HttpWebRequest.ConnectionGroupName属性的具体用法?VB.NET HttpWebRequest.ConnectionGroupName怎么用?VB.NET HttpWebRequest.ConnectionGroupName使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了HttpWebRequest.ConnectionGroupName属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: NetworkCredential
' Create a secure group name.
Dim Sha1 As New SHA1Managed()
Dim updHash As [Byte]() = Sha1.ComputeHash(Encoding.UTF8.GetBytes(("username" + "password" + "domain")))
Dim secureGroupName As [String] = Encoding.Default.GetString(updHash)
' Create a request for a specific URL.
Dim myWebRequest As WebRequest = WebRequest.Create("http://www.contoso.com")
' Set the authentication credentials for the request.
myWebRequest.Credentials = New NetworkCredential("username", "password", "domain")
myWebRequest.ConnectionGroupName = secureGroupName
' Get the response.
Dim myWebResponse As WebResponse = myWebRequest.GetResponse()
' Insert the code that uses myWebResponse here.
' Close the response.
myWebResponse.Close()