quinta-feira, 30 de julho de 2015

X509Certificate Logoff

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;

namespace Source
{
    public partial class logoff : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SecureEndpoint ms = new SecureEndpoint();
                ServicePointManager.ServerCertificateValidationCallback = delegate(Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return (true); };
                SessionToken token = new SessionToken();
                token.MemberId = Request.Params["tokenMemberId"].ToString();
                token.Session = Request.Params["tokenSession"].ToString();

                ms.Logout(token);
            }
            catch { }
            Response.Clear();
            Response.Write("");

        }
    }
}


Postar um comentário