예제 #1
0
파일: MainForm.cs 프로젝트: hoku850/dp2
        internal void Channel_BeforeLogin(object sender,
                                          DigitalPlatform.LibraryClient.BeforeLoginEventArgs e)
        {
            if (e.FirstTry == true)
            {
                // string strPhoneNumber = "";

                {
                    e.UserName = this.textBox_cfg_userName.Text;

                    // e.Password = this.DecryptPasssword(e.Password);
                    e.Password = this.textBox_cfg_password.Text;

#if NO
                    strPhoneNumber = AppInfo.GetString(
                        "default_account",
                        "phoneNumber",
                        "");
#endif

                    bool bIsReader = false;

                    string strLocation = this.textBox_cfg_location.Text;

                    e.Parameters = "location=" + strLocation;
                    if (bIsReader == true)
                    {
                        e.Parameters += ",type=reader";
                    }
                }

                // 2014/9/13
                // e.Parameters += ",mac=" + StringUtil.MakePathList(SerialCodeForm.GetMacAddress(), "|");

                e.Parameters += ",client=fingerprintcenter|" + ClientInfo.ClientVersion;

                // 以手机短信验证方式登录
                //if (string.IsNullOrEmpty(strPhoneNumber) == false)
                //    e.Parameters += ",phoneNumber=" + strPhoneNumber;

                if (String.IsNullOrEmpty(e.UserName) == false)
                {
                    return; // 立即返回, 以便作第一次 不出现 对话框的自动登录
                }
            }

            e.ErrorInfo = "尚未配置服务器参数";
            e.Cancel    = true;
        }
예제 #2
0
        internal void Channel_BeforeLogin(object sender,
                                          DigitalPlatform.LibraryClient.BeforeLoginEventArgs e)
        {
            if (e.FirstTry == true)
            {
                {
                    e.UserName = dp2UserName;

                    // e.Password = this.DecryptPasssword(e.Password);
                    e.Password = dp2Password;

#if NO
                    strPhoneNumber = AppInfo.GetString(
                        "default_account",
                        "phoneNumber",
                        "");
#endif

                    bool bIsReader = false;

                    string strLocation = "";

                    e.Parameters = "location=" + strLocation;
                    if (bIsReader == true)
                    {
                        e.Parameters += ",type=reader";
                    }
                }

                e.Parameters += ",client=dp2ssl|" + WpfClientInfo.ClientVersion;

                if (String.IsNullOrEmpty(e.UserName) == false)
                {
                    return; // 立即返回, 以便作第一次 不出现 对话框的自动登录
                }
                else
                {
                    e.ErrorInfo = "尚未配置 dp2library 服务器用户名";
                    e.Cancel    = true;
                }
            }

            // e.ErrorInfo = "尚未配置 dp2library 服务器用户名";
            e.Cancel = true;
        }
예제 #3
0
파일: FirstRunDialog.cs 프로젝트: zgren/dp2
        internal void Channel_BeforeLogin(object sender,
                                          DigitalPlatform.LibraryClient.BeforeLoginEventArgs e)
        {
            if (e.FirstTry == true)
            {
                e.UserName    = this.textBox_server_userName.Text;
                e.Password    = this.textBox_server_password.Text;
                e.Parameters += ",client=dp2catalog|" + Program.ClientVersion;

                if (String.IsNullOrEmpty(e.UserName) == false)
                {
                    return; // 立即返回, 以便作第一次 不出现 对话框的自动登录
                }
            }

            e.Cancel = true;
            return;
        }
예제 #4
0
        internal void Channel_BeforeLogin(object sender,
                                          DigitalPlatform.LibraryClient.BeforeLoginEventArgs e)
        {
            if (e.FirstTry == true)
            {
                // string strPhoneNumber = "";

                {
                    e.UserName = this.textBox_cfg_userName.Text;

                    // e.Password = this.DecryptPasssword(e.Password);
                    e.Password = this.textBox_cfg_password.Text;

                    bool bIsReader = false;

                    string strLocation = this.textBox_cfg_location.Text;

                    e.Parameters = "location=" + strLocation;
                    if (bIsReader == true)
                    {
                        e.Parameters += ",type=reader";
                    }
                }

                // 2014/9/13
                // e.Parameters += ",mac=" + StringUtil.MakePathList(SerialCodeForm.GetMacAddress(), "|");

                e.Parameters += ",client=testreporting|" + ClientInfo.ClientVersion;

                if (String.IsNullOrEmpty(e.UserName) == false)
                {
                    return; // 立即返回, 以便作第一次 不出现 对话框的自动登录
                }
                else
                {
                    e.ErrorInfo = "尚未配置 dp2library 服务器用户名";
                    e.Cancel    = true;
                }
            }

            // e.ErrorInfo = "尚未配置 dp2library 服务器用户名";
            e.Cancel = true;
        }