HttpGetClientProtocol 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 HttpGetClientProtocol 類別的新執行個體。
public:
HttpGetClientProtocol();
public HttpGetClientProtocol ();
Public Sub New ()
範例
// Math is a proxy class derived from HttpGetClientProtocol.
HttpGetClientProtocol^ myHttpGetClientProtocol = gcnew ::Math;
// Obtain password from a secure store.
String^ SecurelyStoredPassword = String::Empty;
// Set the client-side credentials using the Credentials property.
ICredentials^ credentials = gcnew NetworkCredential( "Joe","mydomain",SecurelyStoredPassword );
myHttpGetClientProtocol->Credentials = credentials;
Console::WriteLine( "Auto redirect is: {0}", myHttpGetClientProtocol->AllowAutoRedirect );
}
// Math is a proxy class derived from HttpGetClientProtocol.
HttpGetClientProtocol myHttpGetClientProtocol = new Math();
// Obtain password from a secure store.
String SecurelyStoredPassword = String.Empty;
// Set the client-side credentials using the Credentials property.
ICredentials credentials =
new NetworkCredential("Joe", "mydomain", SecurelyStoredPassword);
myHttpGetClientProtocol.Credentials = credentials;
Console.WriteLine("Auto redirect is: "
+ myHttpGetClientProtocol.AllowAutoRedirect);
}
}
' Math is a proxy class derived from HttpGetClientProtocol.
Dim myHttpGetClientProtocol As New Math()
' Obtain password from a secure store.
Dim SecurelyStoredPassword As String = String.Empty
' Set the client-side credentials using the Credentials property.
Dim credentials = _
New NetworkCredential("Joe", "mydomain", SecurelyStoredPassword)
myHttpGetClientProtocol.Credentials = credentials
' Allow the server to redirect the request.
myHttpGetClientProtocol.AllowAutoRedirect = True
Console.WriteLine("Auto redirect is: " _
& myHttpGetClientProtocol.AllowAutoRedirect)