WebProxy コンストラクタ (Uri, Boolean, String , ICredentials)
指定した Uri インスタンス、バイパス設定、バイパスする URI の一覧、および資格情報を使用して、WebProxy クラスの新しいインスタンスを初期化します。
名前空間: System.Net
アセンブリ: System (system.dll 内)
構文
'宣言
Public Sub New ( _
Address As Uri, _
BypassOnLocal As Boolean, _
BypassList As String(), _
Credentials As ICredentials _
)
'使用
Dim Address As Uri
Dim BypassOnLocal As Boolean
Dim BypassList As String()
Dim Credentials As ICredentials
Dim instance As New WebProxy(Address, BypassOnLocal, BypassList, Credentials)
public WebProxy (
Uri Address,
bool BypassOnLocal,
string[] BypassList,
ICredentials Credentials
)
public:
WebProxy (
Uri^ Address,
bool BypassOnLocal,
array<String^>^ BypassList,
ICredentials^ Credentials
)
public WebProxy (
Uri Address,
boolean BypassOnLocal,
String[] BypassList,
ICredentials Credentials
)
public function WebProxy (
Address : Uri,
BypassOnLocal : boolean,
BypassList : String[],
Credentials : ICredentials
)
パラメータ
- Address
プロキシ サーバーのアドレスを格納している Uri インスタンス。
- BypassOnLocal
ローカル アドレスのプロキシをバイパスする場合は true。それ以外の場合は false。
- BypassList
バイパスするサーバーの URI を含む正規表現文字列の配列。
- Credentials
認証用にプロキシ サーバーに送信する ICredentials インスタンス。
解説
Address プロパティを Address に設定し、BypassProxyOnLocal プロパティを BypassOnLocal に設定し、BypassList プロパティを BypassList に設定し、Credentials プロパティを Credentials に設定して、WebProxy インスタンスを初期化します。
使用例
このコンストラクタを呼び出すコード例を次に示します。
public static WebProxy CreateProxyWithCredentials2(bool bypassLocal)
{
// Do not use the proxy server for Contoso.com URIs.
string[] bypassList = new string[]{";*.Contoso.com"};
return new WebProxy(new Uri("http://contoso"),
bypassLocal,
bypassList,
CredentialCache.DefaultCredentials);
}
WebProxy^ CreateProxyWithCredentials2( bool bypassLocal )
{
// Do not use the proxy server for Contoso.com URIs.
array<String^>^ bypassList = {";*.Contoso.com"};
return gcnew WebProxy( gcnew Uri( "http://contoso" ),
bypassLocal,
bypassList,
CredentialCache::DefaultCredentials );
}
public static WebProxy CreateProxyWithCredentials2(boolean bypassLocal)
{
// Do not use the proxy server for Contoso.com URIs.
String bypassList[] = new String[] { ";*.Contoso.com" };
return new WebProxy(new Uri("http://contoso"), bypassLocal,
bypassList, CredentialCache.get_DefaultCredentials());
} //CreateProxyWithCredentials2
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0