Example #1
0
        private void Gobutton_Click(object sender, EventArgs e)
        {
            string sLogin, sPassword, sFile, sBufSubj, sSubj, sBufBody, sBody;
            sLogin = LogintextBox.Text;
            sPassword = PasswordtextBox.Text;
            sFile = FiletextBox.Text;
            sBufSubj = SubjtextBox.Text;
            sBufBody = TexttextBox.Text;
            sSubj = System.Web.HttpUtility.UrlEncode(SubjtextBox.Text);
            sBody = System.Web.HttpUtility.UrlEncode(TexttextBox.Text);
            if (sLogin.Length == 0)
            {
                MessageBox.Show("Не задан пароль!");
                return;
            }
            if (sPassword.Length == 0)
            {
                MessageBox.Show("Не задан логин!");
                return;
            }
            if (sFile.Length == 0)
            {
                MessageBox.Show("Не указан файл!");
                return;
            }
            if (sSubj.Length == 0)
            {
                MessageBox.Show("Отсуствует заголовок сообщения!");
                return;
            }
            if (SubjtextBox.Text.Length > 30)
            {
                MessageBox.Show("Длина заголовка не должна быть больше 30 символов!");
                return;
            }
            if (sBody.Length == 0)
            {
                MessageBox.Show("Отсутствует текст сообщения!");
                return;
            }
            m_ssUsers = GetDict(sFile);
            if (m_ssUsers.Count == 0)
            {
                MessageBox.Show("В указанном файле ничего нет!");
                return;
            }
            throw new NotImplementedException("Login not updated to email");
            NerZul.Core.Network.Bot bt = new NerZul.Core.Network.Bot(sLogin, sLogin, sPassword, "Opera/9.99 (Windows NT 5.1; U; pl) Presto/9.9.9", (AutocaptchacheckBox.Checked) ? AutocaptchatextBox.Text : "", 0, bBeep);
            if (!bt.Login())
            {
                MessageBox.Show("Неверно указаны логин или пароль!");
                return;
            }
            int i = 0;
            ConsoleLog.WriteLine("Total to send " + m_ssUsers.Count.ToString());
            foreach (var p in m_ssUsers)
            {
                i++;
                ConsoleLog.WriteLine(i.ToString() + " of " + m_ssUsers.Count.ToString());
                int iId = int.Parse(p.Key);
                string sName = p.Value;
                sSubj = sBufSubj.Replace("%username%", sName);
                sSubj = System.Web.HttpUtility.UrlEncode(sSubj);

                sBody = sBufBody.Replace("%username%", sName);
                sBody = System.Web.HttpUtility.UrlEncode(sBody);

                bt.SendMessage(iId, sName, sSubj, sBody);
            }
            MessageBox.Show("Готово!");
        }