日期:2014-05-17  浏览次数:20854 次

急。。。。。。在线等。。。。接收邮件登陆的问题。。。。全代码。。
本帖最后由 kingboy_321 于 2012-12-13 19:59:17 编辑
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class frmjieshou : Form
    {
        public frmjieshou()
        {
            InitializeComponent();
        }
        public static string strserver;
        public static string pwd;
        public static int k;
        public static TcpClient tcpclient;
        public static StreamReader sreader;
        public static string strret;
        private string sendpopcmd(TcpClient tcpclient, string strcmd)
        {
            Byte[] arrcmd;
            string strret;
            Stream stream;
            stream = tcpclient.GetStream();
            strcmd = strcmd + "\r\n";
            arrcmd = Encoding.Default.GetBytes(strcmd.ToCharArray());
            stream.Write(arrcmd, 0, strcmd.Length);
            strret = sreader.ReadLine();
            return strret;
        }
        private string logon(TcpClient tcpclient, string user, string pass)
        {
            string strret;
            strret = sendpopcmd(tcpclient, "user" + user);
            strret = sendpopcmd(tcpclient, "pass" + pass);
            return strret;
        }
        private string[] staticmailbox(TcpClient tcpclient)
        {
            string strret;
            strret