using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 JuSNS.Config;
using JuSNS.Common;

namespace JuSNS.Web.user.friend
{
    public partial class invite : JuSNS.UI.Page.UserPage
    {
        protected string sitenm = UiConfig.SiteName;
        protected string eml = string.Empty;
        protected string inviteurl = string.Empty;
        protected int reinvt = 0;
        protected string grootDir = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["r"]))
            {
                eml = Request.QueryString["r"];
                if (eml.Trim() != string.Empty)
                {
                    reinvt = 1;
                }
            }
            string sChar = UserID.ToString() + SecretConfig.InviteSeparator + JuSNS.Common.Rand.Str(5);
            string code = string.Empty;
        gCode:
            {
                code = DES.Encrypt(sChar, SecretConfig.InviteKey, SecretConfig.InviteIV);
            }
            if (code.IndexOf("+") > -1)
            {
                goto gCode;
            }
            inviteurl = UiConfig.RootUrl + rooDir + "/InviteReg.aspx?a=url&r=" + Input.URLEncode(code);
            DataBind();
        }
    }
}
