WebProxy.GetProxy メソッド
アセンブリ: System (system.dll 内)

Public Function GetProxy ( _ destination As Uri _ ) As Uri
Dim instance As WebProxy Dim destination As Uri Dim returnValue As Uri returnValue = instance.GetProxy(destination)
public Uri GetProxy ( Uri destination )
戻り値
インターネット リソースがバイパス一覧に含まれている場合は、そのリソースの Uri インスタンス。それ以外の場合はプロキシの Uri インスタンス。

GetProxy メソッドは、WebRequest インスタンスがインターネット リソースにアクセスするために使用する URI を返します。
GetProxy は、IsBypassed メソッドを使用して、destination と BypassList の内容を比較します。IsBypassed が true を返す場合、GetProxy は destination を返し、WebRequest インスタンスはプロキシ サーバーを使用しません。
destination が BypassList にない場合、WebRequest インスタンスはプロキシ サーバーを使用し、Address プロパティが返されます。

WebProxy オブジェクトを作成し、このメソッドを呼び出して、リソースに選択されているプロキシを取得するコード例を次に示します。
// The following method creates a WebProxy object that uses Internet Explorer's // detected script if it is found in the registry; otherwise, it // tries to use Web proxy auto-discovery to set the proxy used for // the request. public static void CheckAutoGlobalProxyForRequest(Uri resource) { WebProxy proxy = new WebProxy(); // Display the proxy's properties. DisplayProxyProperties(proxy); // See what proxy is used for the resource. Uri resourceProxy = proxy.GetProxy(resource); // Test to see whether a proxy was selected. if (resourceProxy == resource) { Console.WriteLine("No proxy for {0}", resource); } else { Console.WriteLine("Proxy for {0} is {1}", resource.OriginalString , resourceProxy.ToString()); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWebProxy.GetProxy メソッドを検索する場合は、下記のリンクをクリックしてください。

- WebProxy.GetProxy メソッドのページへのリンク