IWebProxy.Credentials プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > IWebProxy.Credentials プロパティの意味・解説 

IWebProxy.Credentials プロパティ

認証用にプロキシ サーバー送信する資格情報

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

Dim instance As IWebProxy
Dim value As ICredentials

value = instance.Credentials

instance.Credentials = value
ICredentials Credentials { get; set; }
property ICredentials^ Credentials {
    ICredentials^ get ();
    void set (ICredentials^ value);
}
/** @property */
ICredentials get_Credentials ()

/** @property */
void set_Credentials (ICredentials value)
function get Credentials () : ICredentials

function set Credentials (value : ICredentials)

プロパティ
プロキシ サーバーへの要求認証するために必要な資格情報格納している ICredentials インスタンス

解説解説
使用例使用例

認証のためプロキシ サーバー送信される資格情報Credentials プロパティ使用して設定する例を次に示します

Public Class WebProxy_Interface
    Implements IWebProxy
    
    
    'The credentials to be used with the web proxy.
    Private iCredentials As ICredentials
    
    'Uri of the associated proxy server.
    Private webProxyUri As Uri
    
    
    Sub New(proxyUri As
 Uri)
        
        webProxyUri = proxyUri
    End Sub 'New 
    

    'Get and Set the Credentials property.
    
    Public Property Credentials() As
 ICredentials Implements IWebProxy.Credentials
        Get
            Return iCredentials
        End Get
        Set
            If iCredentials Is value Then
                iCredentials = value
            End If
        End Set
    End Property
     
    'Returns the web proxy for the specified destination(destUri).
    Public Function GetProxy(destUri As
 Uri) As Uri Implements IWebProxy.GetProxy
        
        'Always use the same proxy.
        Return webProxyUri
    End Function 'GetProxy
     
    
    'Returns whether the web proxy should be bypassed for the specified
 destination(hostUri).
    Public Function IsBypassed(hostUri As
 Uri) As Boolean Implements
 IWebProxy.IsBypassed
       'Never bypass the proxy.
        Return False
    End Function 'IsBypassed 
End Class 'WebProxy_Interface



public class WebProxy_Interface : IWebProxy

{

    // The credentials to be used with the web proxy.
    private ICredentials iCredentials;

    // Uri of the associated proxy server.
    private Uri webProxyUri;

    public WebProxy_Interface(Uri proxyUri) {

        webProxyUri = proxyUri;    

    }

    // Get and Set the Credentials property.
    public ICredentials Credentials {
        get {
            return iCredentials;
        }
        set {
            if(iCredentials != value)
                iCredentials = value;
        }
    }

    // Return the web proxy for the specified destination(destUri).
    public Uri GetProxy(Uri destUri) {

        // Always use the same proxy.
        return webProxyUri;

    }

    // Return whether the web proxy should be bypassed for the specified
 destination(hostUri).
    public bool IsBypassed(Uri hostUri) {

        // Never bypass the proxy.
        return false;

    }
};
public ref class WebProxy_Interface: public
 IWebProxy
{
private:
   // The credentials to be used with the web proxy.
   ICredentials^ iCredentials;

   // Uri of the associated proxy server.
   Uri^ webProxyUri;

public:
   WebProxy_Interface( Uri^ proxyUri )
   {
      webProxyUri = proxyUri;
   }

   property ICredentials^ Credentials 
   {
      // Get and Set the Credentials property.
      virtual ICredentials^ get()
      {
         return iCredentials;
      }
      virtual void set( ICredentials^ value
 )
      {
         if ( iCredentials != value )
         {
            iCredentials = value;
         }
      }
   }

   // Return the web proxy for the specified destination (destUri).
   virtual Uri^ GetProxy( Uri^ destUri )
   {
      // Always use the same proxy.
      return webProxyUri;
   }

   // Return whether the web proxy should be bypassed for the specified
 destination (hostUri).
   virtual bool IsBypassed( Uri^ hostUri )
   {
      // Never bypass the proxy.
      return false;
   }
};
public class WebProxyInterface implements IWebProxy
{
    // The credentials to be used with the web proxy.
    private ICredentials iCredentials;
    // Uri of the associated proxy server.
    private Uri webProxyUri;

    public WebProxyInterface(Uri proxyUri) 
    {
        webProxyUri = proxyUri;
    } //WebProxyInterface 
   
    // Get and Set the Credentials property.
   
    /** @property 
     */
    public ICredentials get_Credentials()
    {
        return iCredentials ;
    } //get_Credentials

    /** @property 
     */
    public void set_Credentials (ICredentials
 value)
    {
        if (iCredentials != value) {
            iCredentials = value;
        }
    } //set_Credentials
   
    // Return the web proxy for the specified destination(destUri).
    public Uri GetProxy(Uri destUri) 
    {
        // Always use the same proxy.
        return webProxyUri ;
    } //GetProxy

    // Return whether the web proxy should be bypassed for the specified
    //destination(hostUri).
    public boolean IsBypassed(Uri hostUri) 
    {
        // Never bypass the proxy.
        return false ;
    } //IsBypassed 
} //WebProxyInterface
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

IWebProxy.Credentials プロパティのお隣キーワード
検索ランキング

   

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



IWebProxy.Credentials プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS