GlobalProxySelection.Select プロパティ
アセンブリ: System (system.dll 内)

/** @property */ public static IWebProxy get_Select () /** @property */ public static void set_Select (IWebProxy value)
public static function get Select () : IWebProxy public static function set Select (value : IWebProxy)
HttpWebRequest.GetResponse へのすべての呼び出しが使用する IWebProxy。


Select プロパティは、要求でプロキシがサポートされていて、Proxy プロパティを使用してプロキシが 明示的に設定されていない場合に、すべての WebRequest インスタンスが使用するプロキシを設定します。現在、プロキシは FtpWebRequest および HttpWebRequest でサポートされています。

Select プロパティを空のプロキシに設定するコード例を次に示します。
using System; using System.Net; using System.IO; namespace Examples.Http { public class TestGlobalProxySelection { public static void Main() { // Create a request for the Web page at www.contoso.com. WebRequest request = WebRequest.Create("http://www.contoso.com"); // This application doesn't want the proxy to be used so it sets // the global proxy to an empty proxy. IWebProxy myProxy = GlobalProxySelection.GetEmptyWebProxy(); GlobalProxySelection.Select = myProxy; // Get the response. WebResponse response = request.GetResponse(); // Display the response to the console. Stream stream = response.GetResponseStream(); StreamReader reader = new StreamReader(stream); Console.WriteLine(reader.ReadToEnd()); // Clean up. reader.Close(); stream.Close(); response.Close(); } } }
#using <System.dll> using namespace System; using namespace System::Net; using namespace System::IO; int main() { // Create a request for the Web page at www.contoso.com. WebRequest^ request = WebRequest::Create( L"http://www.contoso.com" ); // This application doesn't want they proxy to be used so it sets // the global proxy to an empy proxy. IWebProxy^ myProxy = GlobalProxySelection::GetEmptyWebProxy(); // Get the response. WebResponse^ response = request->GetResponse(); // Display the response to the console. Stream^ stream = response->GetResponseStream(); StreamReader^ reader = gcnew StreamReader( stream ); Console::WriteLine( reader->ReadToEnd() ); // Clean up. reader->Close(); stream->Close(); response->Close(); return 0; }
package Examples.Http; import System.*; import System.Net.*; import System.IO.*; public class TestGlobalProxySelection { public static void main(String[] args) { // Create a request for the Web page at www.contoso.com. WebRequest request = WebRequest.Create("http://www.contoso.com"); // This application doesn't want they proxy to be used so it sets // the global proxy to an empy proxy. IWebProxy myProxy = GlobalProxySelection.GetEmptyWebProxy(); GlobalProxySelection.set_Select(myProxy); // Get the response. WebResponse response = request.GetResponse(); // Display the response to the console. Stream stream = response.GetResponseStream(); StreamReader reader = new StreamReader(stream); Console.WriteLine(reader.ReadToEnd()); // Clean up. reader.Close(); stream.Close(); response.Close(); } //main } //TestGlobalProxySelection


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に収録されているすべての辞書からGlobalProxySelection.Select プロパティを検索する場合は、下記のリンクをクリックしてください。

- GlobalProxySelection.Select プロパティのページへのリンク