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