NetworkCredential 생성자

정의

NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

오버로드

NetworkCredential()

NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

NetworkCredential(String, SecureString)

지정된 사용자 이름과 암호를 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

NetworkCredential(String, String)

지정된 사용자 이름과 암호를 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

NetworkCredential(String, SecureString, String)

지정된 사용자 이름, 암호 및 도메인을 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

NetworkCredential(String, String, String)

지정된 사용자 이름, 암호 및 도메인을 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

NetworkCredential()

Source:
NetworkCredential.cs
Source:
NetworkCredential.cs
Source:
NetworkCredential.cs

NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

public:
 NetworkCredential();
public NetworkCredential ();
Public Sub New ()

설명

클래스에 대한 NetworkCredential 매개 변수가 없는 생성자는 모든 속성을 null로 초기화합니다.

적용 대상

NetworkCredential(String, SecureString)

Source:
NetworkCredential.cs
Source:
NetworkCredential.cs
Source:
NetworkCredential.cs

중요

이 API는 CLS 규격이 아닙니다.

지정된 사용자 이름과 암호를 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

public:
 NetworkCredential(System::String ^ userName, System::Security::SecureString ^ password);
[System.CLSCompliant(false)]
public NetworkCredential (string? userName, System.Security.SecureString? password);
[System.CLSCompliant(false)]
public NetworkCredential (string userName, System.Security.SecureString password);
public NetworkCredential (string userName, System.Security.SecureString password);
[<System.CLSCompliant(false)>]
new System.Net.NetworkCredential : string * System.Security.SecureString -> System.Net.NetworkCredential
new System.Net.NetworkCredential : string * System.Security.SecureString -> System.Net.NetworkCredential
Public Sub New (userName As String, password As SecureString)

매개 변수

userName
String

자격 증명과 관련된 사용자 이름입니다.

password
SecureString

자격 증명과 관련된 사용자 이름에 대한 암호입니다.

특성

예외

SecureString 클래스는 이 플랫폼에서 지원되지 않습니다.

설명

생성자는 속성이 NetworkCredential 로 설정되고 속성이 UserName 로 설정된 userName 개체를 Password 초기화합니다 password.

매개 변수는 passwordSecureString instance.

매개 변수가 로 설정된 null상태에서 password 이 생성자를 호출하면 의 SecureString 새 instance 초기화됩니다. 이 플랫폼에서 NotSupportedException 보안 문자열이 지원되지 않으면 가 throw됩니다.

적용 대상

NetworkCredential(String, String)

Source:
NetworkCredential.cs
Source:
NetworkCredential.cs
Source:
NetworkCredential.cs

지정된 사용자 이름과 암호를 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

public:
 NetworkCredential(System::String ^ userName, System::String ^ password);
public NetworkCredential (string userName, string password);
public NetworkCredential (string? userName, string? password);
new System.Net.NetworkCredential : string * string -> System.Net.NetworkCredential
Public Sub New (userName As String, password As String)

매개 변수

userName
String

자격 증명과 관련된 사용자 이름입니다.

password
String

자격 증명과 관련된 사용자 이름에 대한 암호입니다.

예제

다음 코드 예제에서는 지정 된 NetworkCredential 사용자 이름 및 암호를 사용 하 여 개체를 만듭니다.

// Call the onstructor  to create an instance of NetworkCredential with the
// specified user name and password.
NetworkCredential^ myCredentials = gcnew NetworkCredential( username,passwd );

// Create a WebRequest with the specified URL.
WebRequest^ myWebRequest = WebRequest::Create( url );
myCredentials->Domain = domain;
myWebRequest->Credentials = myCredentials;
Console::WriteLine( "\n\nCredentials Domain : {0} , UserName : {1} , Password : {2}",
   myCredentials->Domain, myCredentials->UserName, myCredentials->Password );
Console::WriteLine( "\n\nRequest to Url is sent.Waiting for response..." );

// Send the request and wait for a response.
WebResponse^ myWebResponse = myWebRequest->GetResponse();

// Process the response.
Console::WriteLine( "\nResponse received successfully." );

// Release the resources of the response object.
myWebResponse->Close();
 // Call the constructor to create an instance of NetworkCredential with the
 // specified user name and password.
 NetworkCredential myCredentials = new NetworkCredential(username,passwd);

// Create a WebRequest with the specified URL.
WebRequest myWebRequest = WebRequest.Create(url);
myCredentials.Domain = domain;
myWebRequest.Credentials = myCredentials;
Console.WriteLine("\n\nCredentials Domain : {0} , UserName : {1} , Password : {2}",
myCredentials.Domain, myCredentials.UserName, myCredentials.Password);
Console.WriteLine("\n\nRequest to Url is sent.Waiting for response...");

// Send the request and wait for a response.
WebResponse myWebResponse = myWebRequest.GetResponse();

// Process the response.
Console.WriteLine("\nResponse received successfully.");
// Release the resources of the response object.
myWebResponse.Close();
' Call the constructor  to create an instance of NetworkCredential with the
' specified user name and password.
Dim myCredentials As New NetworkCredential(username, passwd)
' Create a WebRequest with the specified URL. 
Dim myWebRequest As WebRequest = WebRequest.Create(url)
myCredentials.Domain = domain
myWebRequest.Credentials = myCredentials
Console.WriteLine(ControlChars.Cr + ControlChars.Cr + "Credentials Domain : {0} , UserName : {1} , Password : {2}", myCredentials.Domain, myCredentials.UserName, myCredentials.Password)
Console.WriteLine(ControlChars.Cr + ControlChars.Cr + "Request to Url is sent.Waiting for response...")
' Send the request and wait for a response.
Dim myWebResponse As WebResponse = myWebRequest.GetResponse()
' Process the response.
Console.WriteLine(ControlChars.Cr + "Response received successfully.")
' Release the resources of the response object.
myWebResponse.Close()

설명

생성자는 속성이 NetworkCredential 로 설정되고 속성이 UserName 로 설정된 userName 개체를 Password 초기화합니다 password.

적용 대상

NetworkCredential(String, SecureString, String)

Source:
NetworkCredential.cs
Source:
NetworkCredential.cs
Source:
NetworkCredential.cs

중요

이 API는 CLS 규격이 아닙니다.

지정된 사용자 이름, 암호 및 도메인을 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

public:
 NetworkCredential(System::String ^ userName, System::Security::SecureString ^ password, System::String ^ domain);
[System.CLSCompliant(false)]
public NetworkCredential (string? userName, System.Security.SecureString? password, string? domain);
[System.CLSCompliant(false)]
public NetworkCredential (string userName, System.Security.SecureString password, string domain);
public NetworkCredential (string userName, System.Security.SecureString password, string domain);
[<System.CLSCompliant(false)>]
new System.Net.NetworkCredential : string * System.Security.SecureString * string -> System.Net.NetworkCredential
new System.Net.NetworkCredential : string * System.Security.SecureString * string -> System.Net.NetworkCredential
Public Sub New (userName As String, password As SecureString, domain As String)

매개 변수

userName
String

자격 증명과 관련된 사용자 이름입니다.

password
SecureString

자격 증명과 관련된 사용자 이름에 대한 암호입니다.

domain
String

이러한 자격 증명과 관련된 도메인입니다.

특성

예외

SecureString 클래스는 이 플랫폼에서 지원되지 않습니다.

설명

생성자는 속성이 NetworkCredential 로 설정 userNamePassword 되고 속성이 UserName 로 설정되고 속성이 로 설정된 password개체를 Domain 초기화합니다domain.

매개 변수는 passwordSecureString instance.

매개 변수가 로 설정된 null상태에서 password 이 생성자를 호출하면 의 SecureString 새 instance 초기화됩니다. 이 플랫폼에서 NotSupportedException 보안 문자열이 지원되지 않으면 가 throw됩니다.

적용 대상

NetworkCredential(String, String, String)

Source:
NetworkCredential.cs
Source:
NetworkCredential.cs
Source:
NetworkCredential.cs

지정된 사용자 이름, 암호 및 도메인을 사용하여 NetworkCredential 클래스의 새 인스턴스를 초기화합니다.

public:
 NetworkCredential(System::String ^ userName, System::String ^ password, System::String ^ domain);
public NetworkCredential (string userName, string password, string domain);
public NetworkCredential (string? userName, string? password, string? domain);
new System.Net.NetworkCredential : string * string * string -> System.Net.NetworkCredential
Public Sub New (userName As String, password As String, domain As String)

매개 변수

userName
String

자격 증명과 관련된 사용자 이름입니다.

password
String

자격 증명과 관련된 사용자 이름에 대한 암호입니다.

domain
String

이러한 자격 증명과 관련된 도메인입니다.

설명

생성자는 속성이 NetworkCredential 로 설정 userNamePassword 되고 속성이 UserName 로 설정되고 속성이 로 설정된 password개체를 Domain 초기화합니다domain.

적용 대상