Example #1
0
        //云打码解码
        private string YUDMDecode(Image img, out int resultId)
        {
            StringBuilder pCodeResult = new StringBuilder(new string(' ', 30));

            if (YunDaMaPassword.Equals("") || YunDaMaUserName.Equals(""))
            {
                YunDaMaUserName = AppConfigRWTool.ReadSetting("YunDaMaUserName");
                YunDaMaPassword = AppConfigRWTool.ReadSetting("YunDaMaPasswordMd5");
            }

            //保存文件到本地
            string jpgPath = System.Environment.CurrentDirectory + "\\Source\\code.jpg";

            if (!Directory.Exists(System.Environment.CurrentDirectory + "\\Source"))         //若文件夹不存在则新建文件夹
            {
                Directory.CreateDirectory(System.Environment.CurrentDirectory + "\\Source"); //新建文件夹
            }
            img.Save(jpgPath, img.RawFormat);

            //解码
            resultId = YunDaMaTool.YDM_EasyDecodeByPath(YunDaMaUserName, YunDaMaPassword, YunDaMaAppId, YunDaMaAppKey, jpgPath, YunDaMaCodeType, YunDaMaTimeOut, pCodeResult);

            if (resultId > 0)
            {
                return(pCodeResult.ToString());
            }
            else
            {
                return("");
            }
        }
        public EmailSetView()
        {
            InitializeComponent();
            this.textBoxSendUserName.Text    = AppConfigRWTool.ReadSetting("EMailSenderUserName");
            this.textBoxSendPassword.Text    = AppConfigRWTool.ReadSetting("EMailSenderPassword");
            this.textBoxRecieveUserName.Text = AppConfigRWTool.ReadSetting("EMailReceiverName");

            this.checkBox1.Checked       = AppConfigRWTool.ReadSetting("EmailRportChoose").Equals("false") ? false : true;
            this.comboBox1.SelectedIndex = Convert.ToInt32(AppConfigRWTool.ReadSetting("EmailReportTime"));

            if (!this.checkBox1.Checked)
            {
                this.comboBox1.Enabled = false;
            }
        }
        public YunDaMaSetView()
        {
            InitializeComponent();
            this.textBoxUsername.Text = AppConfigRWTool.ReadSetting("YunDaMaUserName");

            //假数据
            if (this.textBoxUsername.Text.Equals("") || AppConfigRWTool.ReadSetting("YunDaMaUserName").Equals(""))
            {
                this.textBoxPassword.Text = "";
            }
            else
            {
                this.textBoxPassword.Text = "%%%%%%%%%%%%%";
            }
        }
        //emial发送计时
        private void EmailTimer_Tick(object sender, EventArgs e)
        {
            if (AppConfigRWTool.ReadSetting("EmailRportChoose").Equals("true") &&
                Convert.ToInt32(AppConfigRWTool.ReadSetting("EmailReportTime")) == DateTime.Now.Hour)
            {
                string message = String.Format("<h2>当前正在运行的微博账号共有{0}个</h2><br/>", this.panel1.Controls.Count);

                for (int i = 1; i <= this.panel1.Controls.Count; i++)
                {
                    message += (i + ".<br/>");
                    message += ((UserLable)this.panel1.Controls[i - 1]).GetHtmlEmailMessage();
                    message += "<br/>";
                }

                EMailTool.SendMail("微博管家日报告", message);
            }
        }
Example #5
0
 public ADFilePathView()
 {
     InitializeComponent();
     this.textBox1.Text = AppConfigRWTool.ReadSetting("FilterADPath");
 }