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

Property Credentials As ICredentials
Dim instance As IWebProxy Dim value As ICredentials value = instance.Credentials instance.Credentials = value
ICredentials Credentials { get; set; }
/** @property */ ICredentials get_Credentials () /** @property */ void set_Credentials (ICredentials value)
function get Credentials () : ICredentials function set Credentials (value : ICredentials)
プロキシ サーバーへの要求を認証するために必要な資格情報を格納している ICredentials インスタンス。

Credentials プロパティは、HTTP 407 (プロキシ承認) ステータス コードに応答して、プロキシ サーバーに送信する承認資格情報を格納している 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

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

- IWebProxy.Credentials プロパティのページへのリンク