网页自动登录关键类

网页自动登录关键类

using  System;
using  System.Data;
using  System.Configuration;
using  System.Web;
using  System.Web.Security;
using  System.Web.UI;
using  System.Web.UI.WebControls;
using  System.Web.UI.WebControls.WebParts;
using  System.Web.UI.HtmlControls;
using  Microsoft.Reporting.WebForms;
using  System.Net;
using  System.Security.Principal;

///   <summary>
///  
///   </summary>
public   class  ReportServerCredentials : IReportServerCredentials
{
    
private   string  _userName;
    
private   string  _password;
    
private   string  _domain;

    
public  ReportServerCredentials( string  userName,  string  password,  string  domain)
    {
        _userName 
=  userName;
        _password 
=  password;
        _domain 
=  domain;
    }

    
public  WindowsIdentity ImpersonationUser
    {
        
get
        {
            
//  Use default identity.
             return   null ;
        }
    }

    
public  ICredentials NetworkCredentials
    {
        
get
        {
            
//  Use default identity.
             return   new  NetworkCredential(_userName, _password, _domain);
        }
    }

    
public   bool  GetFormsCredentials( out  Cookie authCookie,  out   string  user,  out   string  password,  out   string  authority)
    {
        
//  Do not use forms credentials to authenticate.
        authCookie  =   null ;
        user 
=  password  =  authority  =   null ;
        
return   false ;
    }
}

 

 

你可能感兴趣的:(登录)