WebProxy コンストラクタとは? わかりやすく解説

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

Uri インスタンスバイパス設定使用して、WebProxy クラス新しインスタンス初期化します。

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

Public Sub New ( _
    Address As Uri, _
    BypassOnLocal As Boolean _
)
Dim Address As Uri
Dim BypassOnLocal As Boolean

Dim instance As New WebProxy(Address,
 BypassOnLocal)
public WebProxy (
    Uri Address,
    bool BypassOnLocal
)
public:
WebProxy (
    Uri^ Address, 
    bool BypassOnLocal
)
public WebProxy (
    Uri Address, 
    boolean BypassOnLocal
)
public function WebProxy (
    Address : Uri, 
    BypassOnLocal : boolean
)

パラメータ

Address

プロキシ サーバーアドレス格納している Uri インスタンス

BypassOnLocal

ローカル アドレスプロキシバイパスする場合trueそれ以外場合false

解説解説
使用例使用例

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

public static WebProxy CreateProxyWithExampleAddress(bool
 bypassLocal)
{
    return new WebProxy(new
 Uri("http://contoso"), bypassLocal);
}
WebProxy^ CreateProxyWithExampleAddress( bool bypassLocal )
{
   return gcnew WebProxy( gcnew Uri( "http://contoso"
 ), bypassLocal );
}
public static WebProxy CreateProxyWithExampleAddress(boolean
 bypassLocal)
{
    return new WebProxy(new
 Uri("http://contoso"), bypassLocal);
} //CreateProxyWithExampleAddress
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

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

指定したホストポート番号使用して、WebProxy クラス新しインスタンス初期化します。

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

例外例外
例外種類条件

UriFormatException

HostPort組み合わせによって形成される URI有効な URI ではありません。

解説解説
使用例使用例

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

public static WebProxy CreateProxyWithHostAndPort()
{
    return new WebProxy("http://contoso",
 80);
}
WebProxy^ CreateProxyWithHostAndPort()
{
   return gcnew WebProxy( "http://contoso",80
 );
}
public static WebProxy CreateProxyWithHostAndPort()
{
    return new WebProxy("http://contoso",
 80);
} //CreateProxyWithHostAndPort
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

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 インスタンス

解説解説
使用例使用例

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

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

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

指定した URIバイパス設定使用して、WebProxy クラス新しインスタンス初期化します。

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

Public Sub New ( _
    Address As String, _
    BypassOnLocal As Boolean _
)
Dim Address As String
Dim BypassOnLocal As Boolean

Dim instance As New WebProxy(Address,
 BypassOnLocal)
public WebProxy (
    string Address,
    bool BypassOnLocal
)
public:
WebProxy (
    String^ Address, 
    bool BypassOnLocal
)
public WebProxy (
    String Address, 
    boolean BypassOnLocal
)
public function WebProxy (
    Address : String, 
    BypassOnLocal : boolean
)

パラメータ

Address

プロキシ サーバーURI

BypassOnLocal

ローカル アドレスプロキシバイパスする場合trueそれ以外場合false

例外例外
例外種類条件

UriFormatException

Address無効な URI です。

解説解説
使用例使用例

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

public static WebProxy CreateProxyWithHostAddress(bool
 bypassLocal)
{
    WebProxy proxy =  new WebProxy("http://contoso",
 bypassLocal);
    Console.WriteLine("Bypass proxy for local URIs?: {0}",
 
       proxy.BypassProxyOnLocal);
    return proxy;
}
WebProxy^ CreateProxyWithHostAddress( bool bypassLocal )
{
   WebProxy^ proxy = gcnew WebProxy( "http://contoso",bypassLocal
 );
   Console::WriteLine( "Bypass proxy for local URIs?: {0}",
 
      proxy->BypassProxyOnLocal );
   return proxy;
}
public static WebProxy CreateProxyWithHostAddress(boolean
 bypassLocal)
{
    WebProxy proxy = new WebProxy("http://contoso",
 bypassLocal);
    Console.WriteLine("Bypass proxy for local URIs?: {0}",
 
        (System.Boolean)proxy.get_BypassProxyOnLocal());
    return proxy;
} //CreateProxyWithHostAddress
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebProxy クラス
WebProxy メンバ
System.Net 名前空間
BypassProxyOnLocal

WebProxy コンストラクタ (SerializationInfo, StreamingContext)

既にシリアル化されたコンテンツ使用して、WebProxy クラスインスタンス初期化します。

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

Protected Sub New ( _
    serializationInfo As SerializationInfo, _
    streamingContext As StreamingContext _
)
Dim serializationInfo As SerializationInfo
Dim streamingContext As StreamingContext

Dim instance As New WebProxy(serializationInfo,
 streamingContext)
protected WebProxy (
    SerializationInfo serializationInfo,
    StreamingContext streamingContext
)
protected:
WebProxy (
    SerializationInfo^ serializationInfo, 
    StreamingContext streamingContext
)
protected WebProxy (
    SerializationInfo serializationInfo, 
    StreamingContext streamingContext
)
protected function WebProxy (
    serializationInfo : SerializationInfo, 
    streamingContext : StreamingContext
)

パラメータ

serializationInfo

シリアル化データ

streamingContext

シリアル化されたデータコンテキスト

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

WebProxy コンストラクタ (Uri)

指定した Uri インスタンスから WebProxy クラス新しインスタンス初期化します。

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

解説解説
使用例使用例

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

public static WebProxy CreateProxyWithExampleAddress()
{
    return new WebProxy(new
 Uri("http://contoso"));
}
WebProxy^ CreateProxyWithExampleAddress()
{
   return gcnew WebProxy( gcnew Uri( "http://contoso"
 ) );
}
public static WebProxy CreateProxyWithExampleAddress()
{
    return new WebProxy(new
 Uri("http://contoso"));
} //CreateProxyWithExampleAddress
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

WebProxy コンストラクタ (String)

指定した URI使用して、WebProxy クラス新しインスタンス初期化します。

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

例外例外
例外種類条件

UriFormatException

Address無効な URI です。

解説解説
使用例使用例

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

public static WebProxy CreateProxyWithHost()
{
    return new WebProxy("http://contoso");
}
WebProxy^ CreateProxyWithHost()
{
   return gcnew WebProxy( "http://contoso"
 );
}
public static WebProxy CreateProxyWithHost()
{
    return new WebProxy("http://contoso");
} //CreateProxyWithHost
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

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 を含む正規表現文字列配列

例外例外
例外種類条件

UriFormatException

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebProxy クラス
WebProxy メンバ
System.Net 名前空間
BypassProxyOnLocal
BypassList

WebProxy コンストラクタ (String, Boolean, String[], ICredentials)

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

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

Public Sub New ( _
    Address As String, _
    BypassOnLocal As Boolean, _
    BypassList As String(), _
    Credentials As ICredentials _
)
Dim Address As String
Dim BypassOnLocal As Boolean
Dim BypassList As String()
Dim Credentials As ICredentials

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

パラメータ

Address

プロキシ サーバーURI

BypassOnLocal

ローカル アドレスプロキシバイパスする場合trueそれ以外場合false

BypassList

バイパスするサーバーURI を含む正規表現文字列配列

Credentials

認証用にプロキシ サーバー送信する ICredentials インスタンス

例外例外
例外種類条件

UriFormatException

Address無効な URI です。

解説解説
使用例使用例

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

public static WebProxy CreateProxyWithCredentials(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,
        CredentialCache.DefaultCredentials);
}
WebProxy^ CreateProxyWithCredentials( bool bypassLocal )
{
   // Do not use the proxy server for Contoso.com URIs.
   array<String^>^ bypassList = {";*.Contoso.com"};
   return gcnew WebProxy( "http://contoso"
,
      bypassLocal,
      bypassList,
      CredentialCache::DefaultCredentials );
}
public static WebProxy CreateProxyWithCredentials(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, 
        CredentialCache.get_DefaultCredentials());
} //CreateProxyWithCredentials
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebProxy クラス
WebProxy メンバ
System.Net 名前空間
BypassProxyOnLocal
BypassList

WebProxy コンストラクタ

WebProxy クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
WebProxy () WebProxy クラスの空のインスタンス初期化します。

.NET Compact Framework によってサポートされています。

WebProxy (String) 指定した URI使用してWebProxy クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

WebProxy (Uri) 指定した Uri インスタンスかWebProxy クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

WebProxy (SerializationInfo, StreamingContext) 既にシリアル化されたコンテンツ使用してWebProxy クラスインスタンス初期化します。
WebProxy (String, Boolean) 指定した URIバイパス設定使用してWebProxy クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

WebProxy (String, Int32) 指定したホストポート番号使用してWebProxy クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

WebProxy (Uri, Boolean) Uri インスタンスバイパス設定使用してWebProxy クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

WebProxy (String, Boolean, String[]) 指定した URIバイパス設定、およびバイパスする URI の一覧を使用してWebProxy クラス新しインスタンス初期化します。
WebProxy (Uri, Boolean, String[]) 指定した Uri インスタンスバイパス設定、およびバイパスする URI の一覧を使用してWebProxy クラス新しインスタンス初期化します。
WebProxy (String, Boolean, String[], ICredentials) 指定した URIバイパス設定バイパスする URI の一覧、および資格情報使用してWebProxy クラス新しインスタンス初期化します。
WebProxy (Uri, Boolean, String[], ICredentials) 指定した Uri インスタンスバイパス設定バイパスする URI の一覧、および資格情報使用してWebProxy クラス新しインスタンス初期化します。
参照参照

関連項目

WebProxy クラス
WebProxy メンバ
System.Net 名前空間

WebProxy コンストラクタ ()

WebProxy クラスの空のインスタンス初期化します。

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

解説解説
使用例使用例

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

public static WebProxy CreateProxy()
{
    return new WebProxy();
}
WebProxy^ CreateProxy()
{
   return gcnew WebProxy;
}
public static WebProxy CreateProxy()
{
    return new WebProxy();
} //CreateProxy
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebProxy コンストラクタ」の関連用語

WebProxy コンストラクタのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebProxy コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS