HttpWebRequest.ConnectionGroupName 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
요청에 대한 연결 그룹의 이름을 가져오거나 설정합니다.
public:
virtual property System::String ^ ConnectionGroupName { System::String ^ get(); void set(System::String ^ value); };
public override string? ConnectionGroupName { get; set; }
public override string ConnectionGroupName { get; set; }
member this.ConnectionGroupName : string with get, set
Public Overrides Property ConnectionGroupName As String
속성 값
이 요청에 대한 연결 그룹의 이름입니다. 기본값은 null
입니다.
예제
사용자 정보를 사용 하 여 가정 하 고 연결 그룹을 형성 하는 방법을 다음 코드 예제에서는 변수 username
, password
, 및 domain
이 코드를 호출 하기 전에 애플리케이션에 의해 설정 됩니다.
// Create a secure group name.
// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
SHA1Managed^ Sha1 = gcnew SHA1Managed;
array<Byte>^updHash = Sha1->ComputeHash( Encoding::UTF8->GetBytes( "usernamepassworddomain" ) );
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 = gcnew 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();
// Create a secure group name.
// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
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();
' Create a secure group name.
' This example uses the SHA1 algorithm.
' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
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()
설명
속성을 ConnectionGroupName 사용하면 요청을 연결 그룹과 연결할 수 있습니다. 애플리케이션 데이터베이스 서버에서 고객 정보를 검색 하는 웹 사이트 등의 다른 사용자에 대 한 대 이상의 서버에 요청에서 하는 경우에 유용 합니다.
상속자 참고
각 연결 그룹은 서버에 대한 추가 연결을 만듭니다. 이로 인해 해당 서버의 속성에서 설정한 ConnectionLimit 연결 수를 초과할 수 있습니다.
적용 대상
추가 정보
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기