ns.Write(outbytes,0,outbytes.Length) str_server=sr.ReadLine();
str_num=""; if (str_server.StartsWith("+OK")){ str_num=str_server.Split(' ')[1]; } else str_num="";
tB_status.Text=tB_status.Text+"\r\n"+str_server;
input = "QUIT" + "\r\n"; outbytes = System.Text.Encoding.ASCII.GetBytes(input.ToCharArray()); ns.Write(outbytes,0,outbytes.Length) tB_status.Text=tB_status.Text+"\r\n"+sr.ReadLine(); } catch(InvalidOperationException ioe){ tB_status.Text="Could not connect to mail server"; }
if (str_num!="") { WinForm1 form = new WinForm1(); form.str_num=str_num; form.ScrollShow(); } } }
private void WinForm_Activated(object sender, System.EventArgs e) { if (f_open) { this.Hide(); f_open=false; } }
private void menuItem3_Click(object sender, System.EventArgs e) { this.Close(); }
private void menuItem1_Click(object sender, System.EventArgs e) { this.Show(); this.Focus(); }
private void button2_Click(object sender, System.EventArgs e) { this.Hide(); }
private void timer1_Tick(object sender, System.EventArgs e) { button1_Click(sender,e); }
private void tB_pwd_TextChanged(object sender, System.EventArgs e) { timer1.Enabled=false; if ((tB_server.Text!="") && (tB_user.Text!="") && (tB_pwd.Text!="")) { timer1.Interval=System.Convert.ToInt32(tB_mins.Text); timer1.Enabled=true; } else { timer1.Enabled=false; } }
private void button3_Click(object sender, System.EventArgs e) { RegistryKey rk; Registry.CurrentUser.CreateSubKey("Software\\yousoft"); rk=Registry.CurrentUser.OpenSubKey("Software\\yousoft",true); rk.Setvalue("server",tB_server.Text); rk.Setvalue("user",tB_user.Text); rk.Setvalue("pwd",tB_pwd.Text); rk.Setvalue("interval",tB_mins.Text);
if (cB_autorun.Checked) { rk=Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run",true); rk.Setvalue("chkmail",Application.ExecutablePath); } else { rk=Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run",true); rk.Deletevalue("chkmail"); } rk.Close(); }
private void WinForm_Load(object sender, System.EventArgs e) { RegistryKey rk; rk=Registry.CurrentUser.OpenSubKey("Software\\yousoft",false); object srv=rk.Getvalue("server"); if (srv!=null) tB_server.Text=srv.ToString(); object usr=rk.Getvalue("user"); if (usr!=null) tB_user.Text=usr.ToString(); object pwd=rk.Getvalue("pwd"); if (pwd!=null) tB_pwd.Text=pwd.ToString(); object mins=rk.Getvalue("interval"); if (mins!=null) tB_mins.Text=mins.ToString(); rk.Close(); }
} }
|