⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loginfailedform.cs

📁 飞信的收发使用csharp进行开发
💻 CS
字号:
namespace Imps.Client.Pc.UserAccount
{
    using Imps.Client.Core;
    using Imps.Client.Pc.BizControls;
    using Imps.Client.Pc.Controls;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class LoginFailedForm : XIMDialog
    {
        private int _errorCode;
        private User _user;
        private XButton btnCancel;
        private XButton btnDetail;
        private XButton btnOk;
        private IContainer components;
        private XLabel lbInfo;
        private Panel pnlContainer;

        public LoginFailedForm(int ErrorCode, User currentUser)
        {
            this.InitializeComponent();
            this._user = currentUser;
            this._errorCode = ErrorCode;
        }

        private void Detail_Click(object sender, EventArgs e)
        {
            try
            {
                if (this._user.LoginListner != null)
                {
                    using (LoginFailedLog log = new LoginFailedLog(this._user.LoginListner.LoginLog))
                    {
                        log.ShowDialog();
                    }
                }
            }
            catch
            {
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(LoginFailedForm));
            this.pnlContainer = new Panel();
            this.btnDetail = new XButton();
            this.lbInfo = new XLabel();
            this.btnOk = new XButton();
            this.btnCancel = new XButton();
            this.pnlContainer.SuspendLayout();
            base.SuspendLayout();
            base.MinimizeBox = false;
            this.pnlContainer.BackColor = Color.Transparent;
            this.pnlContainer.Controls.Add(this.btnDetail);
            this.pnlContainer.Controls.Add(this.lbInfo);
            this.pnlContainer.Controls.Add(this.btnOk);
            this.pnlContainer.Controls.Add(this.btnCancel);
            this.pnlContainer.Dock = DockStyle.Fill;
            this.pnlContainer.Location = new Point(6, 0x1f);
            this.pnlContainer.Name = "pnlContainer";
            this.pnlContainer.Size = new Size(0x132, 0x85);
            this.pnlContainer.TabIndex = 0;
            this.btnDetail.Location = new Point(0x81, 90);
            this.btnDetail.Name = "btnDetail";
            this.btnDetail.Size = new Size(0x4b, 0x17);
            this.btnDetail.TabIndex = 2;
            this.btnDetail.Text = "详细信息";
            this.btnDetail.UseVisualStyleBackColor = true;
            this.btnDetail.Click += new EventHandler(this.Detail_Click);
            this.lbInfo.BorderColor = Color.Empty;
            this.lbInfo.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lbInfo.Location = new Point(11, 0x13);
            this.lbInfo.Name = "lbInfo";
            this.lbInfo.Size = new Size(0x124, 0x45);
            this.lbInfo.TabIndex = 0;
            this.lbInfo.Text = "抱歉,您现在无法登录。可能您的计算机的网络连接有问题{0}。建议您点击下面的\"开始网络诊断\"按钮进行网络连接诊断以帮助您解决问题。";
            this.btnOk.DialogResult = DialogResult.OK;
            this.btnOk.Location = new Point(0x1b, 90);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new Size(0x60, 0x17);
            this.btnOk.TabIndex = 1;
            this.btnOk.Text = "开始网络诊断";
            this.btnOk.UseVisualStyleBackColor = true;
            this.btnCancel.DialogResult = DialogResult.Cancel;
            this.btnCancel.Location = new Point(210, 90);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "取消";
            this.btnCancel.UseVisualStyleBackColor = true;
            base.AcceptButton = this.btnOk;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.CancelButton = this.btnCancel;
            base.ClientSize = new Size(0x14b, 0xac);
            base.Controls.Add(this.pnlContainer);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.Name = "LoginFailedForm";
            base.Padding = new Padding(6, 0x1f, 0x13, 8);
            base.Text = "登录失败";
            base.Load += new EventHandler(this.LoginFailedForm_Load);
            base.Controls.SetChildIndex(this.pnlContainer, 0);
            base.Controls.SetChildIndex(base.menubar, 0);
            this.pnlContainer.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void LoginFailedForm_Load(object sender, EventArgs e)
        {
            try
            {
                if (this._errorCode > 0)
                {
                    this.lbInfo.Text = string.Format(this.lbInfo.Text, string.Format("(错误号:{0})", this._errorCode.ToString()));
                }
                else
                {
                    this.lbInfo.Text = string.Format(this.lbInfo.Text, string.Empty);
                }
            }
            catch
            {
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -