protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string ip = IPHelper.GetIP();
                try
                {
                    string   userInfo = EnterPrise_Server.GetSelfInfo(this.Request);
                    UserInfo userIn   = JsonConvert.DeserializeObject <UserInfo>(userInfo);
                    hid_Name.Value  = userIn.name;   //userIn.name;
                    hid_Phone.Value = userIn.mobile; // userIn.mobile;
                    LogHelper.Info("登陆方式:" + GetUserAgent() + "   登陆时间:" + System.DateTime.Now.ToString() + "   登陆IP:" + ip + "   登陆信息:" + userIn.name + ":" + userIn.mobile);
                }
                catch (Exception ex)
                {
                    LogHelper.Error(ex);
                }
                if (string.IsNullOrWhiteSpace(hid_Name.Value) || string.IsNullOrWhiteSpace(hid_Phone.Value))
                {
                    hid_Name.Value  = "一号位";         //userIn.name;
                    hid_Phone.Value = "13000000000"; // userIn.mobile;
                    LogHelper.Info("登陆方式:" + GetUserAgent() + "   登陆时间:" + System.DateTime.Now.ToString() + "   登陆IP:" + ip + "   登陆信息:" + hid_Name.Value + ":13000000000");
                }
                //hid_Name.Value = "关业龙";//userIn.name;
                //hid_Phone.Value = "13031190350";// userIn.mobile;

                //hid_Name.Value = "ttm";//userIn.name;
                //hid_Phone.Value = "21313213";// userIn.mobile;

                //hid_Name.Value = "刘泽";//userIn.name;
                //hid_Phone.Value = "13716753217";// userIn.mobile;
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var userInfo = EnterPrise_Server.GetSelfInfo(this.Request);

            if (userInfo != null)
            {
                UserInfo userIn = JsonConvert.DeserializeObject <UserInfo>(userInfo);

                ////测试页面
                //string stt = "当前用户名为:" + userIn.name + "   " + "手机号为:" + userIn.mobile + "   "
                //    + "邮箱地址:" + userIn.email + "   " + "部门ID:";
                //this.txt.Value = stt;
                HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(userCenter + "&ispage=false&Name=" + userIn.name + "&Phone=" + userIn.mobile + "&Status=1");
                request.Method            = "POST";
                request.ContentType       = "application/x-www-form-urlencoded";
                request.Accept            = "*/*";
                request.Timeout           = 10000;
                request.AllowAutoRedirect = false;
                StreamWriter requestStream = null;
                WebResponse  response      = null;
                string       responseStr   = null;
                try
                {
                    requestStream = new StreamWriter(request.GetRequestStream());
                    requestStream.Close();
                    response = request.GetResponse();
                    if (response != null)
                    {
                        StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
                        responseStr = reader.ReadToEnd();
                        reader.Close();
                        Response.Write(responseStr);
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error(ex);
                }
                finally
                {
                    request       = null;
                    requestStream = null;
                    response      = null;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    hid_MeetingID.Value  = Request.QueryString["MeetingID"] ?? "";
                    hid_BookedDate.Value = Request.QueryString["BookedDateID"] ?? "";

                    string   ip       = IPHelper.GetIP();
                    string   userInfo = EnterPrise_Server.GetSelfInfo(this.Request);
                    UserInfo userIn   = JsonConvert.DeserializeObject <UserInfo>(userInfo);
                    hid_Name.Value  = userIn.name;
                    hid_Phone.Value = userIn.mobile;
                    LogHelper.Info("登陆方式:" + GetUserAgent() + "   登陆时间:" + System.DateTime.Now.ToString() + "   登陆IP:" + ip + "   登陆信息:" + userIn.name + ":" + userIn.mobile);
                }
                catch (Exception ex)
                {
                    LogHelper.Error(ex);
                }
                //hid_Name.Value = "刘泽";
                //hid_Phone.Value = "13716753217";
            }
        }