GlobalProxySelection.GetEmptyWebProxy メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GlobalProxySelection.GetEmptyWebProxy メソッドの意味・解説 

GlobalProxySelection.GetEmptyWebProxy メソッド

空白プロキシ インスタンス返します

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

Public Shared Function GetEmptyWebProxy
 As IWebProxy
Dim returnValue As IWebProxy

returnValue = GlobalProxySelection.GetEmptyWebProxy
public static IWebProxy GetEmptyWebProxy ()
public:
static IWebProxy^ GetEmptyWebProxy ()
public static IWebProxy GetEmptyWebProxy ()
public static function GetEmptyWebProxy
 () : IWebProxy

戻り値
情報格納されていない IWebProxy。

解説解説

GetEmptyWebProxy メソッドは、インターネット リソースアクセスするためにプロキシ使用しないことを示すために、空白IWebProxy インスタンス返します

使用例使用例

プロキシ使用しない WebRequest インスタンス作成するコード例次に示します

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



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

辞書ショートカット

すべての辞書の索引

「GlobalProxySelection.GetEmptyWebProxy メソッド」の関連用語

GlobalProxySelection.GetEmptyWebProxy メソッドのお隣キーワード
検索ランキング

   

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



GlobalProxySelection.GetEmptyWebProxy メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS