WebProxy コンストラクタ (String, Boolean, String )
指定した URI、バイパス設定、およびバイパスする URI の一覧を使用して、WebProxy クラスの新しいインスタンスを初期化します。
名前空間: System.Net
アセンブリ: System (system.dll 内)
構文
'宣言
Public Sub New ( _
Address As String, _
BypassOnLocal As Boolean, _
BypassList As String() _
)
'使用
Dim Address As String
Dim BypassOnLocal As Boolean
Dim BypassList As String()
Dim instance As New WebProxy(Address, BypassOnLocal, BypassList)
public WebProxy (
string Address,
bool BypassOnLocal,
string[] BypassList
)
public:
WebProxy (
String^ Address,
bool BypassOnLocal,
array<String^>^ BypassList
)
public WebProxy (
String Address,
boolean BypassOnLocal,
String[] BypassList
)
public function WebProxy (
Address : String,
BypassOnLocal : boolean,
BypassList : String[]
)
パラメータ
- Address
プロキシ サーバーの URI。
- BypassOnLocal
ローカル アドレスのプロキシをバイパスする場合は true。それ以外の場合は false。
- BypassList
バイパスするサーバーの URI を含む正規表現文字列の配列。
例外
例外の種類 | 条件 |
---|---|
Address が無効な URI です。 |
解説
Address プロパティを Address が格納された Uri インスタンスに設定し、BypassProxyOnLocal プロパティを BypassOnLocal に設定し、BypassList プロパティを BypassList に設定して、WebProxy インスタンスを初期化します。
使用例
このコンストラクタを呼び出すコード例を次に示します。
public static WebProxy CreateProxyWithHostAndBypassList(bool bypassLocal)
{
// Do not use the proxy server for Contoso.com URIs.
string[] bypassList = new string[]{";*.Contoso.com"};
return new WebProxy("http://contoso",
bypassLocal,
bypassList);
}
WebProxy^ CreateProxyWithHostAndBypassList( bool bypassLocal )
{
// Do not use the proxy server for Contoso.com URIs.
array<String^>^ bypassList = {";*.Contoso.com"};
return gcnew WebProxy( "http://contoso",
bypassLocal,
bypassList );
}
public static WebProxy CreateProxyWithHostAndBypassList(boolean bypassLocal)
{
// Do not use the proxy server for Contoso.com URIs.
String bypassList[] = new String[] { ";*.Contoso.com" };
return new WebProxy("http://contoso", bypassLocal, bypassList);
} //CreateProxyWithHostAndBypassList
プラットフォーム
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
参照
関連項目
WebProxy クラス
WebProxy メンバ
System.Net 名前空間
BypassProxyOnLocal
BypassList