WebProxy コンストラクタ (Uri, Boolean, String )

指定した Uri インスタンス、バイパス設定、およびバイパスする URI の一覧を使用して、WebProxy クラスの新しいインスタンスを初期化します。

名前空間: System.Net
アセンブリ: System (system.dll 内)

構文

'宣言
Public Sub New ( _
    Address As Uri, _
    BypassOnLocal As Boolean, _
    BypassList As String() _
)
'使用
Dim Address As Uri
Dim BypassOnLocal As Boolean
Dim BypassList As String()

Dim instance As New WebProxy(Address, BypassOnLocal, BypassList)
public WebProxy (
    Uri Address,
    bool BypassOnLocal,
    string[] BypassList
)
public:
WebProxy (
    Uri^ Address, 
    bool BypassOnLocal, 
    array<String^>^ BypassList
)
public WebProxy (
    Uri Address, 
    boolean BypassOnLocal, 
    String[] BypassList
)
public function WebProxy (
    Address : Uri, 
    BypassOnLocal : boolean, 
    BypassList : String[]
)

パラメータ

  • Address
    プロキシ サーバーのアドレスを格納している Uri インスタンス。
  • BypassOnLocal
    ローカル アドレスのプロキシをバイパスする場合は true。それ以外の場合は false
  • BypassList
    バイパスするサーバーの URI を含む正規表現文字列の配列。

解説

Address プロパティを Address に設定し、BypassProxyOnLocal プロパティを BypassOnLocal に設定し、BypassList プロパティを BypassList に設定して、WebProxy インスタンスを初期化します。

使用例

このコンストラクタを呼び出すコード例を次に示します。

public static WebProxy CreateProxyWithBypassList(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);
}
WebProxy^ CreateProxyWithBypassList( 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 );
}
public static WebProxy CreateProxyWithBypassList(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);
} //CreateProxyWithBypassList

プラットフォーム

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 名前空間