예제 #1
0
        private void FillLastEntryControls(Online lastItem)
        {
            //Start by resetting everything to blank/unselected
            txtTitleDisplay.Text            = "";
            txtIssueDisplay.Text            = "";
            txtAuthorDisplay.Text           = "";
            txtLanguageDisplay.Text         = "";
            txtPagesDisplay.Text            = "";
            txtPriceDisplay.Text            = "";
            chkBxIsHardCoverDisplay.Checked = false;
            radBtnBookDisplay.Checked       = false;
            radBtnMagazineDisplay.Checked   = false;
            radBtnOnlineDisplay.Checked     = false;
            radBtnWeeklyDisplay.Checked     = false;
            radBtnMonthlyDisplay.Checked    = false;

            //fill in fields
            txtAuthorDisplay.Text   = lastItem.Author;
            txtLanguageDisplay.Text = lastItem.Language;
            txtPagesDisplay.Text    = lastItem.NumberOfPages.ToString();
            txtPriceDisplay.Text    = lastItem.Price.ToString();

            //fill in specific fields
            SetLastOnline(lastItem);
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.config = GeneralConfigInfo.Current;
            var online = Online.UpdateInfo();

            //if (UserGroup.FindByID((int)online.GroupID).RadminID != 1)
            if (!online.Group.Is¹ÜÀíÔ±)
            {
                HttpContext.Current.Response.Redirect("../");
                return;
            }
            int olid = online.ID;
            //OnlineUsers.DeleteRows(olid);
            var entity = Online.FindByID(olid);

            if (entity != null)
            {
                entity.Delete();
            }
            ForumUtils.ClearUserCookie();
            HttpCookie cookie = new HttpCookie("bbx_admin");

            HttpContext.Current.Response.AppendCookie(cookie);
            FormsAuthentication.SignOut();
        }
예제 #3
0
    public void creatInARandomPointMob(int id, int healthy, String name, long delay, Online strategy)
    {
        Online_EX onlineEx;
        int       randomPoint = rnd.Next(0, spawnPoints.Length);

        if (strategy == Online.OFFLINE)
        {
            if (randomPoint % 2 == 0)
            {
                mobGen.GetComponent <ENEMY_SPAWN>().newAction(mainSpawnPoint, healthy, name, delay, id);
            }
            else
            {
                mobGen.GetComponent <ENEMY_SPAWN>().newAction(spawnPoints[randomPoint], healthy, name, delay, id);
            }
        }
        else
        {
            onlineEx = game.GetComponent <GameScriptOnline>().getNewOnlineEx();
            if (randomPoint % 2 == 0)
            {
                mobGen.GetComponent <ENEMY_SPAWN>().newAction(mainSpawnPoint, healthy, name, delay, id, strategy, onlineEx);
            }
            else
            {
                mobGen.GetComponent <ENEMY_SPAWN>().newAction(spawnPoints[randomPoint], healthy, name, delay, id, strategy, onlineEx);
            }
        }
    }
예제 #4
0
        public async Task RefreshObserverMessagesAsync()
        {
            try
            {
                OnOperationStart?.Invoke(this, 2);
                var new_messages = await Online.GetNewMessagesAsync();

                OnOperationStep?.Invoke(this, null);
                if (new_messages.Any())
                {
                    var ins_codes = new_messages.Where(x => x.RelativeInstances != null).SelectMany(x => x.RelativeInstances);
                    var miss      = ins_codes.Where(x => !WebService.Instruments.Any(y => y.InsCode == x)).Distinct().ToList();
                    if (miss.Any())
                    {
                        await SaveWebServiceInstruments();
                    }

                    await Storage.SaveMessagesAsync(new_messages.Reverse());
                }
                OnOperationStep?.Invoke(this, null);
                OnOperationCompleted?.Invoke(this, EventArgs.Empty);
            }
            catch (Exception exception)
            {
                _logger.Error("RefreshObserverMessages", exception);
                OnOperationCompleted?.Invoke(this, EventArgs.Empty);
            }
        }
예제 #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            var config   = GeneralConfigInfo.Current;
            var text     = DNTRequest.GetQueryString("bgcolor").Trim();
            var queryInt = DNTRequest.GetQueryInt("textcolor", 1);
            var array    = text.SplitAsInt(",");
            var bgcolor  = Color.White;

            if (array.Length == 1 && text != string.Empty)
            {
                bgcolor = Utils.ToColor(text);
            }
            else
            {
                if (array.Length == 3)
                {
                    bgcolor = Color.FromArgb(array[0], array[1], array[2]);
                }
            }
            var online          = Online.UpdateInfo();
            var verifyImageInfo = VerifyImageProvider.Current.GenerateImage(online.VerifyCode, 120, 60, bgcolor, queryInt);
            var image           = verifyImageInfo.Image;

            HttpContext.Current.Response.ContentType = verifyImageInfo.ContentType;
            //image.Save(base.Response.OutputStream, verifyImageInfo.ImageFormat);
            var ms = new MemoryStream();

            image.Save(ms, verifyImageInfo.ImageFormat);
            ms.Position = 0;
            ms.CopyTo(Response.OutputStream);
        }
예제 #6
0
 public static void ReSetAllCache()
 {
     XCache.Current.FlushAll();
     Caches.EditDntConfig();
     //BBX.Data.OnlineUsers.CreateOnlineTable();
     Online.ResetOnlineList();
 }
예제 #7
0
        private void DelUserInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                int uid = DNTRequest.GetInt("uid", -1);
                if (this.AllowDeleteUser(this.userid, uid))
                {
                    bool delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
                    bool delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;

                    User user = XUser.FindByID(uid);
                    if (user.Delete(delposts, delpms))
                    {
                        Sync.DeleteUsers(uid.ToString(), "");
                        Avatars.DeleteAvatar(uid.ToString());
                        XForum.UpdateForumsFieldModerators(this.userName.Text);
                        Online.DeleteUserByUid(this.userInfo.ID);
                        AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:" + this.userName.Text);
                        base.RegisterStartupScript("PAGE", "window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';");
                        return;
                    }
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
                    return;
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败,你要删除的用户是创始人用户或是其它管理员,因此不能删除!');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
                }
            }
        }
예제 #8
0
파일: AdminPage.cs 프로젝트: xiongeee/BBX
        protected override void OnPreLoad(EventArgs e)
        {
            base.OnPreLoad(e);

            var online = Online.UpdateInfo();
            //var gp = UserGroup.FindByID((int)online.GroupID);
            var gp = online.Group;

            if (online.UserID <= 0 || !gp.Is管理员)
            {
                this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                return;
            }
            string secques = Users.GetUserInfo(online.UserID).Secques;

            if (this.Context.Request.Cookies["bbx_admin"] == null || this.Context.Request.Cookies["bbx_admin"]["key"] == null || ForumUtils.GetCookiePassword(this.Context.Request.Cookies["bbx_admin"]["key"].ToString(), this.config.Passwordkey) != online.Password + secques + online.UserID.ToString())
            {
                this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                return;
            }
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["bbx_admin"];

            httpCookie.Values["key"]    = ForumUtils.SetCookiePassword(online.Password + secques + online.UserID.ToString(), this.config.Passwordkey);
            httpCookie.Values["userid"] = online.UserID.ToString();
            httpCookie.Expires          = DateTime.Now.AddMinutes(30.0);
            HttpContext.Current.Response.AppendCookie(httpCookie);
            this.userid      = online.UserID;
            this.username    = online.UserName;
            this.usergroupid = (int)online.GroupID;
            this.useradminid = (short)gp.RadminID;
            this.grouptitle  = gp.GroupTitle;
            this.ip          = WebHelper.UserHost;
        }
예제 #9
0
파일: AdminPage.cs 프로젝트: xiongeee/BBX
        public bool CheckCookie()
        {
            config = GeneralConfigInfo.Current;
            if (!config.Adminipaccess.IsNullOrWhiteSpace())
            {
                string[] iparray = Utils.SplitString(this.config.Adminipaccess, "\n");
                if (!Utils.InIPArray(WebHelper.UserHost, iparray))
                {
                    this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                    return(false);
                }
            }
            var online = Online.UpdateInfo();

            //var gp = UserGroup.FindByID((int)online.GroupID);
            if (online.UserID <= 0 || !online.Group.Is管理员)
            {
                this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                return(false);
            }
            string secques = Users.GetUserInfo(online.UserID).Secques;

            if (this.Context.Request.Cookies["bbx_admin"] == null || this.Context.Request.Cookies["bbx_admin"]["key"] == null || ForumUtils.GetCookiePassword(this.Context.Request.Cookies["bbx_admin"]["key"].ToString(), this.config.Passwordkey) != online.Password + secques + online.UserID)
            {
                this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                return(false);
            }
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["bbx_admin"];

            httpCookie.Values["key"] = ForumUtils.SetCookiePassword(online.Password + secques + online.UserID, this.config.Passwordkey);
            httpCookie.Expires       = DateTime.Now.AddMinutes(30.0);
            HttpContext.Current.Response.AppendCookie(httpCookie);
            return(true);
        }
예제 #10
0
        // 搜索用户名 & 最近2小时内登录的用户
        private void BindGrid()
        {
            string name           = ttbSearchMessage.Text.Trim();
            IQueryable <Online> q = Online.Search(name);

            Grid1.BindGrid(q);
        }
예제 #11
0
        private void RemoveRelationship(DiscordRelationship rel, bool skipAll = false)
        {
            if (!skipAll)
            {
                if (_allList.Remove(rel))
                {
                    _syncContext.Post(a => All.Remove(rel), null);
                }
            }

            if (_onlineList.Remove(rel))
            {
                _syncContext.Post(a => Online.Remove(rel), null);
            }

            if (Pending.Contains(rel)) // is this actually faster?
            {
                _syncContext.Post(a => Pending.Remove(rel), null);
            }

            if (Blocked.Contains(rel)) // ^^
            {
                _syncContext.Post(a => Blocked.Remove(rel), null);
            }
        }
예제 #12
0
        public void OnlineOl(int userId)
        {
            User user = databaseContext.Users.Where(x => x.id == userId).FirstOrDefault();

            if (user != null)
            {
                Online onlineUser = databaseContext.Onlines.Where(x => x.User.id == userId).FirstOrDefault();

                if (onlineUser == null)
                {
                    databaseContext.Onlines.Add(new Online()
                    {
                        ConenctionId = Context.ConnectionId,
                        User         = user
                    });

                    databaseContext.SaveChanges();
                }
                else
                {
                    onlineUser.ConenctionId = Context.ConnectionId;
                    databaseContext.SaveChanges();
                }
            }
        }
예제 #13
0
파일: Channel.cs 프로젝트: Techial/TechBot
 ///<summary>
 ///Removes user from Channel
 ///</summary>
 private void RemoveUser(User user)
 {
     if (Online.Contains(user))
     {
         Online.Remove(user);
     }
 }
예제 #14
0
        /// <summary>被扣除积分以后,可能会降低用户级别</summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static int UpdateUserCredits(int userId)
        {
            User.UpdateUserCredits(userId);
            IUser user = (userId > 0) ? User.FindByID(userId) : null;

            if (user == null)
            {
                return(0);
            }

            // 被扣除积分以后,可能会降低用户级别
            var ug = UserGroup.FindByID(user.GroupID);

            if (ug != null && ug.IsCreditUserGroup)
            {
                ug = GetCreditsUserGroupId((float)user.Credits);
                if (ug.ID != user.GroupID)
                {
                    //BBX.Data.Users.UpdateUserGroup(user.ID.ToString(), ug.ID);
                    user.GroupID = ug.ID;
                    (user as User).Save();
                    Online.UpdateGroupid(user.ID, ug.ID);
                }
            }
            var httpCookie = HttpContext.Current.Request.Cookies["bbx"];

            if (httpCookie != null && httpCookie["userid"] == userId.ToString())
            {
                ForumUtils.WriteUserCreditsCookie(user, ug.GroupTitle);
            }
            return(1);
        }
예제 #15
0
파일: Channel.cs 프로젝트: Techial/TechBot
 ///<summary>
 ///Add user to Channel
 ///</summary>
 private void AddUser(User user)
 {
     if (!Online.Contains(user))
     {
         Online.Add(user);
     }
 }
예제 #16
0
        protected override void ShowPage()
        {
            this.pagetitle = "用户控制面板";
            if (!base.IsLogin())
            {
                return;
            }
            this.receivepmsetting = user.NewsLetter;
            if (DNTRequest.IsPost())
            {
                //Users.UpdateUserPreference(this.userid, "", 0, 0, DNTRequest.GetInt("templateid", 0));
                user.Avatar       = "";
                user.Avatarwidth  = 0;
                user.Avatarheight = 0;
                user.TemplateID   = Request["templateid"].ToInt();
                (user as IEntity).Save();

                this.UpdateUserForumSetting();
                Online.UpdateInvisible(this.olid, this.user.Invisible);
                this.WriteCookie();
                this.receivepmsetting = DNTRequest.GetInt("receivesetting", 1);
                //this.user.NewsLetter = (ReceivePMSettingType)this.receivepmsetting;
                this.user.NewsLetter = receivepmsetting;
                //Users.UpdateUserPMSetting(this.user);
                (user as IEntity).Save();
                base.SetUrl("usercppreference.aspx");
                base.SetMetaRefresh();
                base.SetShowBackLink(true);
                base.AddMsgLine("修改个性设置完毕");
            }
        }
예제 #17
0
        public UnregisterStatus Unregister(string Username)
        {
            GetUsersResponse resp = api.Helix.Users.GetUsersAsync(logins: new List <string>()
            {
                Username
            }).Result;
            List <UserResponse> user = resp.Users.Select(t => new UserResponse(t)).ToList();

            if (user.Count == 0)
            {
                return(UnregisterStatus.UserNotFound);
            }

            if (!Tracking.Contains(user[0].Id))
            {
                return(UnregisterStatus.NotTracking);
            }

            Tracking.Remove(user[0].Id);
            UserDatabase.Remove(user[0].Id);

            Offline.Remove(user[0].Id);
            Online.Remove(user[0].Id);

            return(UnregisterStatus.Success);
        }
예제 #18
0
        /// <summary>
        /// 上线
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_CopyToOnline_Click(object sender, EventArgs e)
        {
            Online onlineForm = new Online();

            onlineForm.ShowDialog();
            //this.ShowDialog(Online);
        }
예제 #19
0
    static void Main(string[] args)
    {
        Semester s  = new Semester("Fall");
        Faculty  t1 = new Faculty("Quirinus Quirrell");
        Faculty  t2 = new Faculty("Filius Flitwick");
        Course   c1 = new Course()
        {
            Title = "Advanced Black Arts", Number = 9899
        };
        Course c2 = new Course()
        {
            Title = "Third Year Charms", Number = 8499
        };

        Console.WriteLine("Semester = [{0}]", s.GetName());
        Console.WriteLine("Faculty = [{0}, {1}]", t1.GetName(), t2.GetName());
        Console.WriteLine("Course = [{0}, {1}]", c1.Title, c1.Number);
        Console.WriteLine("Course = [{0}, {1}]", c2.Title, c2.Number);

        OnCampus section1 = new OnCampus(s, c1, t1, "B06", 50);
        Online   section2 = new Online(s, c2, t2, "C03", 63);

        Console.WriteLine(section1.ToString());
        Console.WriteLine(section2.ToString());
        Console.ReadKey();
    }
예제 #20
0
 public void creatFirstStrategy(Online strategy, bool isOnline)
 {
     for (int i = isOnline? 1: 0; i < PLAYERS_COUNT; i++)
     {
         createNew(strategy, isOnline, i);
     }
 }
예제 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.config = GeneralConfigInfo.Current;
            if (!this.config.Adminipaccess.IsNullOrEmpty())
            {
                string[] iparray = Utils.SplitString(this.config.Adminipaccess, "\n");
                if (!Utils.InIPArray(WebHelper.UserHost, iparray))
                {
                    this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                    return;
                }
            }
            var online = Online.UpdateInfo();

            this.olid = online.ID;
            //var userGroupInfo = UserGroup.FindByID((int)online.GroupID);
            if (online.UserID <= 0 || !online.Group.Is¹ÜÀíÔ±)
            {
                this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                return;
            }
            string secques = Users.GetUserInfo(online.UserID).Secques;

            if (this.Context.Request.Cookies["bbx_admin"] == null || this.Context.Request.Cookies["bbx_admin"]["key"] == null || ForumUtils.GetCookiePassword(this.Context.Request.Cookies["bbx_admin"]["key"].ToString(), this.config.Passwordkey) != online.Password + secques + online.UserID)
            {
                this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx");
                return;
            }
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["bbx_admin"];

            httpCookie.Values["key"] = ForumUtils.SetCookiePassword(online.Password + secques + online.UserID.ToString(), this.config.Passwordkey);
            httpCookie.Expires       = DateTime.Now.AddMinutes(30.0);
            HttpContext.Current.Response.AppendCookie(httpCookie);
        }
예제 #22
0
        public override Task OnDisconnected(bool stopCalled)
        {
            // Log
            Trace.WriteLine("gone - " + Context.ConnectionId + " " + Context.User.Identity.Name);

            // Init db
            DataContext db = new DataContext();

            // Get user id
            User   userDTO = db.Users.Where(x => x.Username.Equals(Context.User.Identity.Name)).FirstOrDefault();
            string userId  = userDTO.Id;

            // Remove from db
            if (db.Online.Any(x => x.Id == userId))
            {
                Online online = db.Online.Find(userId);
                db.Online.Remove(online);
                db.SaveChanges();
            }

            // Update chat
            UpdateChat();

            // Return
            return(base.OnDisconnected(stopCalled));
        }
예제 #23
0
        //public static DataTable GetUserListByGroupidList(string groupIdList)
        //{
        //    return BBX.Data.Users.GetUserListByGroupid(groupIdList);
        //}

        public static int SendPMByGroupidList(string groupidlist, int topnumber, ref int start_uid, string msgfrom, int msguid, int folder, string subject, string postdatetime, string message)
        {
            //DataTable userListByGroupid = BBX.Data.Users.GetUserListByGroupid(groupidlist, topnumber, start_uid);
            //foreach (DataRow dataRow in userListByGroupid.Rows)
            var list = User.FindAllByGroupID(groupidlist, start_uid, topnumber);

            foreach (var item in list)
            {
                var msg = new ShortMessage();
                msg.Msgfrom      = msgfrom.Replace("'", "''");
                msg.MsgfromID    = msguid;
                msg.Msgto        = item.Name.Replace("'", "''");
                msg.MsgtoID      = item.ID;
                msg.Folder       = (Int16)folder;
                msg.Subject      = subject;
                msg.PostDateTime = postdatetime.ToDateTime();
                msg.Message      = message;
                msg.Create(false);
                start_uid = msg.MsgtoID;

                var entity = Online.FindByUserID(msg.MsgtoID);
                //if (OnlineUsers.GetOlidByUid(msg.MsgtoID) > 0)
                if (entity != null)
                {
                    Users.UpdateUserNewPMCount(msg.MsgtoID, entity.ID);
                }
            }
            return(list.Count);
        }
예제 #24
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.online)
            {
                hashcode = (hashcode * 397) + Online.GetHashCode();
            }
            if (__isset.chatMid)
            {
                hashcode = (hashcode * 397) + ChatMid.GetHashCode();
            }
            if (__isset.hostMids)
            {
                hashcode = (hashcode * 397) + HostMids.GetHashCode();
            }
            if (__isset.memberMids)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(MemberMids);
            }
            if (__isset.started)
            {
                hashcode = (hashcode * 397) + Started.GetHashCode();
            }
            if (__isset.mediaType)
            {
                hashcode = (hashcode * 397) + MediaType.GetHashCode();
            }
        }
        return(hashcode);
    }
예제 #25
0
        public void PostaviStavki()
        {
            if (CurrNaracka != null)
            {
                for (int i = 0; i < Stavki.Count; i++)
                {
                    if (i < CurrNaracka.Stavki.Count)
                    {
                        Stavki[i].UpdateObject(CurrNaracka.Stavki[i + indStavki]);
                    }
                    else
                    {
                        Stavki[i].UpdateObject(null);
                    }
                }

                lblVreme.Text  = (DateTime.Now - CurrNaracka.Vreme).ToString(@"dd\.hh\:mm");
                lblVkupno.Text = CurrNaracka.VkupnaCena.ToString();
                if (CurrNaracka is Onsite)
                {
                    Onsite os = CurrNaracka as Onsite;
                    lblMasa.Text = os.BrojMasa.ToString();
                }
                else
                {
                    Online os = CurrNaracka as Online;
                    lblCenaZaDostava.UpdateObject(os.CenaZaDostava);
                    lblMasa.Text    = os.AdresaZaDostava;
                    lblKlient.Text  = String.Format("{0} {1} ", os.ImeKlient, os.PrezimeKlient);
                    lblKontakt.Text = os.Kontakt;
                }
            }
        }
예제 #26
0
        public void SearchSkill()
        {
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "SearchSkill");
            GlobalDefinitions.Wait();
            TxtSearcSkill.SendKeys(ExcelLib.ReadData(2, "Category"));
            SearchIcon.Click();
            //Checking the right page
            Assert.AreEqual("Search", GlobalDefinitions.driver.Title);
            Base.test = Base.extent.StartTest("On Share Search page");
            TxtSubCategory.SendKeys(ExcelLib.ReadData(2, "SubCategory"));
            SearchUser.SendKeys(ExcelLib.ReadData(2, "SearchUser"));
            IList <IWebElement> optionsToSelect = GlobalDefinitions.driver.FindElements(By.XPath("//input[@placeholder='Search user']"));

            foreach (IWebElement options in optionsToSelect)
            {
                Console.WriteLine(options);
                if (options.Text.Equals(SearchUser))
                {
                    Console.WriteLine("Trying to select: " + SearchUser);
                    options.Click();
                    break;
                }
            }
            Onsite.Click();
            Online.Click();
            ShowAll.Click();
        }
예제 #27
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "MainPlayer")
     {
         Online aux = other.GetComponent <Online>();
         aux.Respawn();
     }
 }
예제 #28
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     #region 联网验证
     if (confighelper.lwyz == "1")
     {
         if (!Online.check())
         {
             return;
         }
         if (Online.getHtml("http://www.cnblogs.com/yyxhgy/p/5069227.html").Split(new string[] { "ALEX" }, StringSplitOptions.RemoveEmptyEntries)[1] != "开启")
         {
             MessageBox.Show("服务未开启!请联系开发人员");
             return;
         }
     }
     #endregion
     tips.Text = "";
     tips.Refresh();
     string username = txt_username.Text.Trim();
     string password = txt_password.Text.Trim();
     if (username == "" || password == "")
     {
         tips.Text = "账号/密码为空!";
         tips.Refresh();
         return;
     }
     string a = check_user(username, password);
     txt_username.Enabled  = false;
     txt_password.Enabled  = false;
     simpleButton1.Enabled = false;
     simpleButton1.Text    = "登录中";
     this.simpleButton1.Refresh();
     for (int i = 0; i < 4; i++)
     {
         Thread.Sleep(500);
         simpleButton1.Text += ".";
         this.simpleButton1.Refresh();
     }
     if (a == "1")
     {
         Main f1 = new Main();
         this.Hide();
         f1.ShowDialog();
         Application.ExitThread();
     }
     else
     {
         tips.Text = "账号/密码错误!";
         tips.Refresh();
         txt_username.Text     = "";
         txt_password.Text     = "";
         txt_username.Enabled  = true;
         txt_password.Enabled  = true;
         simpleButton1.Enabled = true;
         simpleButton1.Text    = "登录";
         this.simpleButton1.Refresh();
     }
 }
예제 #29
0
        //private string condition = "";

        protected override void ShowPage()
        {
            //type = DNTRequest.GetString("type", true);
            if (userid > 0 && useradminid > 0)
            {
                admingroupinfo = AdminGroup.FindByID(usergroupid);
            }
            if (config.Rssstatus == 1)
            {
                base.AddLinkRss("tools/rss.aspx", "最新主题");
            }

            if (forumid == -1)
            {
                var vs = Request["fidlist"];
                if (vs.IsNullOrWhiteSpace())
                {
                    vs = (Request["forums"] + "").ToLower();
                }
                if (vs.IsNullOrWhiteSpace() || vs.EqualIgnoreCase("all"))
                {
                    vs = GetForums();
                }
                vs     = GetAllowviewForums(vs);
                forums = vs;
            }
            navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);
            if (forumid > 0)
            {
                forum = Forums.GetForumInfo(forumid);
                if (forum == null)
                {
                    base.AddErrLine("不存在的版块ID");
                    return;
                }
                pagetitle      = Utils.RemoveHtml(forum.Name);
                forumnav       = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
                showforumlogin = ShowForumLogin();
                if (!UserAuthority.VisitAuthority(forum, usergroupinfo, userid, ref msg))
                {
                    base.AddErrLine(msg);
                    return;
                }
                subforumlist = Forums.GetSubForumCollection(forumid, forum.ColCount, config.Hideprivate, usergroupid, config.Moddisplay);
            }
            var condition = GetCondition();

            if (base.IsErr())
            {
                return;
            }

            pagetitle = ((type == "digest") ? "查看精华" : "查看新帖");
            SetPageIdAndNumber(condition);
            topiclist = Topics.GetTopicListByCondition(tpp, pageid, 0, 10, config.Hottopic, forum == null ? 0 : forum.AutoClose, forum == null ? 0 : forum.Topictypeprefix, condition, GetOrder(), direct);
            Online.UpdateAction(olid, UserAction.ShowForum, forumid, config.Onlinetimeout);
            ForumUtils.UpdateVisitedForumsOptions(forumid);
        }
예제 #30
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AgentID;
         hashCode = (hashCode * 397) ^ (MachineID != null ? MachineID.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DeviceGuid != null ? DeviceGuid.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomerID;
         hashCode = (hashCode * 397) ^ (CustomerName != null ? CustomerName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ FolderID.GetHashCode();
         hashCode = (hashCode * 397) ^ (AgentName != null ? AgentName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SystemName != null ? SystemName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MachineName != null ? MachineName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DomainName != null ? DomainName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CurrentLoggedUsers != null ? CurrentLoggedUsers.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ComputerDescription != null ? ComputerDescription.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Monitored.GetHashCode();
         hashCode = (hashCode * 397) ^ LastPatchManagementReceived.GetHashCode();
         hashCode = (hashCode * 397) ^ (AgentVersion != null ? AgentVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Favorite.GetHashCode();
         hashCode = (hashCode * 397) ^ ThresholdID.GetHashCode();
         hashCode = (hashCode * 397) ^ MonitoredAgentID.GetHashCode();
         hashCode = (hashCode * 397) ^ Created.GetHashCode();
         hashCode = (hashCode * 397) ^ Modified.GetHashCode();
         hashCode = (hashCode * 397) ^ Online.GetHashCode();
         hashCode = (hashCode * 397) ^ (ReportedFromIP != null ? ReportedFromIP.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AppViewUrl != null ? AppViewUrl.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Motherboard != null ? Motherboard.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Processor != null ? Processor.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Memory.GetHashCode();
         hashCode = (hashCode * 397) ^ (Display != null ? Display.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Sound != null ? Sound.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ProcessorCoresCount.GetHashCode();
         hashCode = (hashCode * 397) ^ (SystemDrive != null ? SystemDrive.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ProcessorClock != null ? ProcessorClock.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Vendor != null ? Vendor.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (VendorSerialNumber != null ? VendorSerialNumber.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (VendorBrandModel != null ? VendorBrandModel.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ProductName != null ? ProductName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OS != null ? OS.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OSType != null ? OSType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OSVersion != null ? OSVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OSBuild != null ? OSBuild.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (WindowsSerialNumber != null ? WindowsSerialNumber.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Office != null ? Office.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OfficeSP != null ? OfficeSP.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ OfficeOEM.GetHashCode();
         hashCode = (hashCode * 397) ^ (OfficeSerialNumber != null ? OfficeSerialNumber.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OfficeFullVersion != null ? OfficeFullVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LastLoginUser != null ? LastLoginUser.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HardwareDisks?.Sum(x => x.GetHashCode()) ?? 0);
         hashCode = (hashCode * 397) ^ (MacAddresses?.Sum(x => x.GetHashCode()) ?? 0);
         hashCode = (hashCode * 397) ^ (IpAddresses?.Sum(x => x.GetHashCode()) ?? 0);
         return(hashCode);
     }
 }
예제 #31
0
 public JsonResult GetOnlineList()
 {
     Online bll = new Online();
     return Json(bll.FindALL(), JsonRequestBehavior.AllowGet);
 }