예제 #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("");
            }
        }
예제 #2
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     if (!this.textBox1.Text.Equals(""))
     {
         AppConfigRWTool.WriteSetting("FilterADPath", this.textBox1.Text);
     }
 }
        public MainPageView()
        {
            InitializeComponent();
            this.FormClosing += MainPageView_FormClosing;
            this.Load        += MainPageView_Load;

            AppConfigRWTool.CreateConfigFile();
            EmailTimer.Tick   += EmailTimer_Tick;
            EmailTimer.Enabled = true;
        }
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (!(this.textBoxSendUserName.Text.Equals("") || this.textBoxSendPassword.Text.Equals("") || this.textBoxRecieveUserName.Text.Equals("")))
            {
                AppConfigRWTool.WriteSetting("EMailSenderUserName", this.textBoxSendUserName.Text);
                AppConfigRWTool.WriteSetting("EMailSenderPassword", this.textBoxSendPassword.Text);
                AppConfigRWTool.WriteSetting("EMailReceiverName", this.textBoxRecieveUserName.Text);

                AppConfigRWTool.WriteSetting("EmailReportTime", this.comboBox1.SelectedIndex.ToString());
                AppConfigRWTool.WriteSetting("EmailRportChoose", (this.checkBox1.Checked ? "true" : "false"));
            }
        }
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (!(this.textBoxUsername.Text.Equals("") || this.textBoxPassword.Text.Equals("")))
            {
                AppConfigRWTool.WriteSetting("YunDaMaUserName", this.textBoxUsername.Text);

                if (!this.textBoxPassword.Text.Equals("%%%%%%%%%%%%%"))
                {
                    //密码以Md5形式存储
                    AppConfigRWTool.WriteSetting("YunDaMaPasswordMd5", MD5EncryptTool.MD5Encrypt(this.textBoxPassword.Text));
                }
            }
        }
        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);
            }
        }
예제 #9
0
 public ADFilePathView()
 {
     InitializeComponent();
     this.textBox1.Text = AppConfigRWTool.ReadSetting("FilterADPath");
 }