Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string returnUrl = Request.Url.AbsoluteUri;

        UserLogin.LoginCheck ul = new UserLogin.LoginCheck();

        if (ul.UserIsLogin)
        {
            ProcessResponse pr = new ProcessResponse();

            string a = pr.createSamlResponse(Util.HashUserName(ul.UserName).ToLower(), "0", "0", "0", "0");

            Response.Write("<script>alert('" + Util.GetUserNameInGoogleUser(ul.UserName) + "');</script>");
           }
        else
        {
            Response.Redirect("http://passport.cga.com.cn/login/loginto.aspx?returnurl=" + Server.UrlEncode(returnUrl).ToString());//参数中带有参数
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// get the logined UserName
    /// </summary>
    /// <returns></returns>
    public static String getUserName()
    {
        UserLogin.LoginCheck login = new UserLogin.LoginCheck();

        return login.UserName;
    }