- 爱易网页
-
ASP.NET教程
- ASP.NET Passport SingOut 方法
日期:2011-08-23 浏览次数:20420 次
public static void SignOut(string strSignOutDotGifFileName)
{
HttpContext httpContext = HttpContext.Current;
string[] strs6 = new string[]{"MSPAuth", "MSPProf", "MSPConsent", "MSPSecAuth", "MSPProfC"};
string[] strs1 = strs6;
strs6 = new string[]{"TicketDomain", "TicketDomain", "ProfileDomain", "SecureDomain", "TicketDomain"};
string[] strs2 = strs6;
strs6 = new string[]{"TicketPath", "TicketPath", "ProfilePath", "SecurePath", "TicketPath"};
string[] strs3 = strs6;
string[] strs4 = new string[5];
string[] strs5 = new string[5];
PassportIdentity passportIdentity = null;
int i = 0;
httpContext.Response.ClearHeaders();
try
{
if (httpContext.User.Identity is PassportIdentity)
{
passportIdentity = (PassportIdentity)httpContext.User.Identity;
}
else
{
passportIdentity = new PassportIdentity();
}
if (passportIdentity != null && _iPassportVer >= 3)
{
for (i = 0; i < 5; i++)
{
object local1 = passportIdentity.GetCurrentConfig(strs2[i]);
if (local1 != null && local1 is String)
{
strs4[i] = (String)local1;
}
}
for (i = 0; i < 5; i++)
{
object local2 = passportIdentity.GetCurrentConfig(strs3[i]);
if (local2 != null && local2 is String)
{
strs5[i] = (String)local2;
}
}
}
}
catch (Exception)
{
}
for (i = 0; i < 5; i++)
{
HttpCookie httpCookie = new HttpCookie(strs1[i], "");
httpCookie.Expires = new DateTime(1998, 1, 1);
if (strs4[i] != null && strs4[i].Length > 0)
{
&
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。