VintaSoft Twain .NET SDK v10.3
Vintasoft.WpfTwain.ImageUploading.Http Namespace / HttpUpload Class / Credentials Property

In This Topic
    Credentials Property (HttpUpload)
    In This Topic
    Provides authentication information for the request.
    Public Property Credentials As ICredentials
    Dim instance As HttpUpload
    Dim value As ICredentials
    instance.Credentials = value
    value = instance.Credentials
    public ICredentials Credentials {get; set;}
    public: __property ICredentials* get_Credentials();
    public: __property void set_Credentials( 
       ICredentials* value
    property ICredentials^ Credentials {
       ICredentials^ get();
       void set (    ICredentials^ value);
    The Credentials property contains authentication information to identify the maker of the request. The Credentials property can be either an instance of System.Net.NetworkCredential, in which case the user, password, and domain information contained in the NetworkCredential instance is used to authenticate the request, or it can be an instance of System.Net.CredentialCache, in which case the uniform resource identifier (URI) of the request is used to determine the user, password, and domain information to use to authenticate the request.
    The following example initializes a CredentialCache with multiple security credentials and uses those credentials with a HttpUpload:
    Private Sub SetCredentials(ByVal httpUpload1 As HttpUpload, ByVal userName As String, _
                               ByVal securelyStoredPassword As String, ByVal domain As String)
        Dim myCache As CredentialCache = New CredentialCache()
        myCache.Add(New Uri(""), "Basic", _
                        New NetworkCredential(userName, securelyStoredPassword))
        myCache.Add(New Uri(""), "Digest", _
                    New NetworkCredential(userName, securelyStoredPassword, domain))
        httpUpload1.Credentials = myCache
    End Sub
    public void SetCredentials(HttpUpload httpUpload, string userName,
        string securelyStoredPassword, string domain)
        CredentialCache myCache = new CredentialCache();
        myCache.Add(new Uri(""), "Basic",
                    new NetworkCredential(userName, securelyStoredPassword));
        myCache.Add(new Uri(""), "Digest",
                    new NetworkCredential(userName, securelyStoredPassword, domain));
        httpUpload.Credentials = myCache;

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2016, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also