示例#1
0
        private void Main_Load(object sender, EventArgs e)
        {
            readplayerinfo();
            XmlNode emailcnf = this.xmlDoc.GetElementsByTagName("emailconfig").Item(0);
            Type    t_email  = typeof(Emailconfiguration);

            FieldInfo[] f_email = t_email.GetFields();
            string[]    e_info  = new string[f_email.Length];
            for (int i = 0; i < f_email.Length; i++)
            {
                e_info[i] = emailcnf[f_email[i].Name].InnerText;
            }
            this.econfig       = new Emailconfiguration(e_info);
            this.ec            = (Emailconfiguration)this.econfig;
            this.login         = new NetworkCredential(ec.user, ec.pass);
            client             = new SmtpClient(ec.smtp);
            client.Port        = Convert.ToInt32(ec.port);
            client.EnableSsl   = Convert.ToBoolean(ec.ssl);
            client.Credentials = login;
            //econfig = ec;
            List <Player> ps = (List <Player>) this.players;

            playercount      = ps.Count;
            this.buttonArray = new Button[playercount];
            playersub        = new List <string>();
            playermsg        = new List <string>();
            for (int i = 0; i < playercount; i++)
            {
                playermsg.Add("DUMMY MSG");
                playersub.Add("NONE");
            }


            updateplayerlist();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Emailconfiguration econfig = (Emailconfiguration)this.econfig;

            econfig.user = this.textBox_user.Text;
            econfig.pass = this.textBox_pass.Text;
            econfig.port = this.textBox_port.Text;
            econfig.smtp = this.textBox_smtp.Text;
            econfig.ssl  = this.checkBox_ssl.Checked.ToString();
            this.Close();
        }