Пример #1
0
        private void formLogin_Shown()
        {
            try
            {
                string[] directorys  = System.IO.Directory.GetDirectories(AppDomain.CurrentDomain.BaseDirectory + "data\\");
                string[] rDirectorys = new string[directorys.Length];
                int      j           = 0;
                for (int i = 0; i < directorys.Length; i++)
                {
                    var time = DateTime.Now.AddDays(-1);
                    var path = directorys[i] + "\\usrCookie.cfg";
                    if (System.IO.File.Exists(path))
                    {
                        time = System.IO.File.GetLastWriteTime(path);
                        if (DateTime.Now.Subtract(time).TotalMinutes > 30)
                        {
                            System.IO.File.Delete(path);
                        }
                        else
                        {
                            rDirectorys[j++] =
                                directorys[i].Substring(directorys[i].LastIndexOf("\\")).Replace("\\", "");
                        }
                    }
                }
                if (rDirectorys[0] != null)
                {
                    var ql = new QuicklyLogin();
                    ql.Buttons = rDirectorys;
                    var popup = new Popup(ql)
                    {
                        AutoClose        = true,
                        FocusOnOpen      = false,
                        ShowingAnimation = PopupAnimations.Slide | PopupAnimations.LeftToRight,
                        HidingAnimation  = PopupAnimations.Slide | PopupAnimations.RightToLeft
                    };
                    popup.Closing += popup_Closing;
                    popup.Show(new Point(this.Location.X + this.Width + 3, this.Location.Y + 3));
                }
            }
            catch (Exception)
            {
            }
            finally { }


            GetRandCodeImg();
        }
Пример #2
0
        private void formLogin_Shown(object sender, EventArgs e)
        {
            try
            {
                string[] directorys = System.IO.Directory.GetDirectories(AppDomain.CurrentDomain.BaseDirectory + "data\\");
                string[] rDirectorys = new string[directorys.Length];
                int j = 0;
                for (int i = 0; i < directorys.Length; i++)
                {
                    var time = DateTime.Now.AddDays(-1);
                    var path = directorys[i] + "\\usrCookie.cfg";
                    if (System.IO.File.Exists(path))
                    {
                        time = System.IO.File.GetLastWriteTime(path);
                        if (DateTime.Now.Subtract(time).TotalMinutes > 30)
                        {
                            System.IO.File.Delete(path);
                        }
                        else
                        {
                            rDirectorys[j++] =
                                directorys[i].Substring(directorys[i].LastIndexOf("\\")).Replace("\\", "");
                        }
                    }
                }
                if (rDirectorys[0] != null)
                {
                    var ql = new QuicklyLogin();
                    ql.Buttons = rDirectorys;
                    var popup = new Popup(ql)
                    {
                        AutoClose = true,
                        FocusOnOpen = false,
                        ShowingAnimation = PopupAnimations.Slide | PopupAnimations.LeftToRight,
                        HidingAnimation = PopupAnimations.Slide | PopupAnimations.RightToLeft
                    };
                    popup.Closing += popup_Closing;
                    popup.Show(new Point(this.Location.X + this.Width + 3, this.Location.Y + 3));
                }
            }
            catch (Exception)
            {

               
            }
            finally { }
          

            GetRandCodeImg();    
        }