Esempio n. 1
0
 /// <summary>
 /// 检查必要信息是否输入,验证操作员密码是否正确,验证通过实例化一个UserInformation的对象
 /// </summary>
 /// <param name="bucket"></param>
 /// <param name="operatorname"></param>
 /// <param name="pwd"></param>
 /// <param name="url"></param>
 /// <param name="internet"></param>
 /// <param name="ifremember"></param>
 /// <param name="ifauto"></param>
 public UserInformation(string bucket, string operatorname, string pwd, string url, string internet, bool ifremember, bool ifauto)
 {
     if (bucket == "")
     {
         XtraMessageBox.Show("空间名称不能为空!");
         upYun = null;
     }
     else if (operatorname == "")
     {
         XtraMessageBox.Show("操作员用户名不能为空!");
         upYun = null;
     }
     else if (pwd == "")
     {
         XtraMessageBox.Show("操作员密码不能为空!");
         upYun = null;
     }
     else
     {
         BucketName   = bucket;
         OperatorName = operatorname;
         OperatorPwd  = pwd;
         Url          = url;
         IfAutoLogin  = ifauto;
         IfRemember   = ifremember;
         Internet     = internet;
         upYun        = new UpYunLibrary.UpYun(BucketName, OperatorName, OperatorPwd);
         setNetWork();
         writeConfig();
         try
         {
             UseSpace = getUseSpace();
         }
         catch (Exception ex)
         {
             upYun = null;
             if (ex.Message.Contains("401"))
             {
                 XtraMessageBox.Show("操作员登录信息填写有误,请确认后再次登录!", "错误提示");
             }
             else
             {
                 XtraMessageBox.Show("网络未连接!", "错误提示");
             }
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 默认通过配置文件获取信息实例化UserInformation
 /// </summary>
 public UserInformation()
 {
     ToolsLibrary.IniFile ini = new ToolsLibrary.IniFile();
     if (ini.IniReadValue("ifconfig", "remember") != "" && !Convert.ToBoolean(string.Compare(ini.IniReadValue("ifconfig", "remember"), "true", true)))
     {
         BucketName   = ini.IniReadValue("operatorinformation", "bucket");
         OperatorName = ini.IniReadValue("operatorinformation", "operatorname");
         OperatorPwd  = ToolsLibrary.Tools.DecryptDES(ini.IniReadValue("operatorinformation", "operatorpwd"), "WORLDCOM");
         Url          = ini.IniReadValue("operatorinformation", "url");
         Internet     = ini.IniReadValue("operatorinformation", "internet");
         IfRemember   = Convert.ToBoolean(ini.IniReadValue("operatorinformation", "ifremember"));
         IfAutoLogin  = Convert.ToBoolean(ini.IniReadValue("operatorinformation", "ifauto"));
         upYun        = new UpYunLibrary.UpYun(BucketName, OperatorName, OperatorPwd);
         UseSpace     = upYun.getBucketUsage();
         setNetWork();
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 检查必要信息是否输入,验证操作员密码是否正确,验证通过实例化一个UserInformation的对象
        /// </summary>
        /// <param name="bucket"></param>
        /// <param name="operatorname"></param>
        /// <param name="pwd"></param>
        /// <param name="url"></param>
        /// <param name="internet"></param>
        /// <param name="ifremember"></param>
        /// <param name="ifauto"></param>
        public UserInformation(string bucket, string operatorname, string pwd, string url, string internet, bool ifremember, bool ifauto)
        {
            if (bucket == "")
            {
                XtraMessageBox.Show("空间名称不能为空!");
                upYun = null;
            }
            else if (operatorname == "")
            {
                XtraMessageBox.Show("操作员用户名不能为空!");
                upYun = null;
            }
            else if (pwd == "")
            {
                XtraMessageBox.Show("操作员密码不能为空!");
                upYun = null;
            }
            else
            {
                BucketName = bucket;
                OperatorName = operatorname;
                OperatorPwd = pwd;
                Url = url;
                IfAutoLogin = ifauto;
                IfRemember = ifremember;
                Internet = internet;
                upYun = new UpYunLibrary.UpYun(BucketName, OperatorName, OperatorPwd);
                setNetWork();
                writeConfig();
                try
                {
                    UseSpace = getUseSpace();
                }
                catch(Exception ex)
                {
                    upYun = null;
                    if (ex.Message.Contains("401"))
                        XtraMessageBox.Show("操作员登录信息填写有误,请确认后再次登录!", "错误提示");
                    else
                        XtraMessageBox.Show("网络未连接!", "错误提示");

                }
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 默认通过配置文件获取信息实例化UserInformation
 /// </summary>
 public UserInformation()
 {
     ToolsLibrary.IniFile ini = new ToolsLibrary.IniFile();
     if (ini.IniReadValue("ifconfig", "remember") != "" && !Convert.ToBoolean(string.Compare(ini.IniReadValue("ifconfig", "remember"), "true", true)))
     {
         BucketName = ini.IniReadValue("operatorinformation", "bucket");
         OperatorName = ini.IniReadValue("operatorinformation", "operatorname");
         OperatorPwd = ToolsLibrary.Tools.DecryptDES(ini.IniReadValue("operatorinformation", "operatorpwd"), "WORLDCOM");
         Url = ini.IniReadValue("operatorinformation", "url");
         Internet = ini.IniReadValue("operatorinformation", "internet");
         IfRemember = Convert.ToBoolean(ini.IniReadValue("operatorinformation", "ifremember"));
         IfAutoLogin = Convert.ToBoolean(ini.IniReadValue("operatorinformation", "ifauto"));
         upYun = new UpYunLibrary.UpYun(BucketName, OperatorName, OperatorPwd);
         UseSpace = upYun.getBucketUsage();
         setNetWork();
     }
 }