登录
首页 » C# » C# pop3 邮件接收程序

C# pop3 邮件接收程序

于 2014-11-02 发布
0 155
下载积分: 1 下载次数: 0

代码说明:

private void Connect_Click(object sender, System.EventArgs e)        {            //将光标置为等待状态            Cursor cr = Cursor.Current;            Cursor.Current = Cursors.WaitCursor;            String a ,b,c;              //用110端口新建POP3服务器连接            Server = new TcpClient(PopServer.Text, 110);            Status.Items.Clear();             try            {                //初始化                NetStrm = Server.GetStream();                RdStrm = new StreamReader(Server.GetStream());                Status.Items.Add(RdStrm.ReadLine());                 //登录服务器过程                Data = "USER " Username.Text CRLF;                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());                NetStrm.Write(szData, 0, szData.Length);                Status.Items.Add(RdStrm.ReadLine());                 Data = "PASS " Password.Text CRLF;                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());                NetStrm.Write(szData, 0, szData.Length);                Status.Items.Add(RdStrm.ReadLine());                 //向服务器发送STAT命令,从而取得邮箱的相关信息:邮件数量和大小                Data = "STAT" CRLF;                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());                NetStrm.Write(szData, 0, szData.Length);                //Status.Items.Add(RdStrm.ReadLine());                 //改变按钮的状态                Connect.Enabled = false;                Disconnect.Enabled = true;                Retrieve.Enabled = true;                 //将光标置回原来状态                Cursor.Current = cr;             }            catch (InvalidOperationException err)            {                Status.Items.Add("Error: " err.ToString());            }        }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • TCPaUDP
    一段TCP和UDP通讯的程序,包含了服务器端和客户端的代码。(Some TCP and UDP communication procedures, including server and client code.)
    2014-07-21 08:28:29下载
    积分:1
  • C#应用第2版源码
    【实例简介】C#网络应用编程第2版源码
    2021-11-25 00:44:46下载
    积分:1
  • live555_vs2008_vs2015(live.2014.07.25)
    live555 rtsp build in vs2008 and vs2015. also make testRTSPClient execute project
    2020-06-19 19:00:01下载
    积分:1
  • 基于STM32F103ZET6实现的智能灯光亮度调节器
    【实例简介】本实验是一个期末大作业,是我写的第一个小项目。按键控制自动识别模式,或者手动调节模式。可调五档光的亮度。也可通过环境光的亮度自动调节,环境越亮,灯越暗。本代码由正点原子精英开发板完成,可直接烧入使用。
    2021-08-02 00:31:02下载
    积分:1
  • first
    实现固定时隙分配的TDMA算法,有完整的节点和进程模型,用opnet实现(The TDMA algorithm for fixed slot allocation has a complete node and process model, which is implemented by opnet.)
    2021-02-08 15:09:54下载
    积分:1
  • gofk
    说明:  c语言编的词法分析器,可以学习的源码,不错(C language of lexical analyzer, you can learn the source code, good)
    2018-12-25 21:44:27下载
    积分:1
  • winsock
    应用于windows 平台下的vc编程,主要是windows socket 下的网络编程(windows socket programming, including basic knowledge of the single-threaded, multi-threaded. Development and application in the windows platform)
    2012-04-25 11:43:29下载
    积分:1
  • DownLoad
    基于HTTP协议的支持断点续传的下载软件源码(HTTP protocol support for HTTP-based download software source)
    2013-03-27 16:54:24下载
    积分:1
  • C_MSN
    用C编写的简单仿MSN聊天软件,vs2005可正常编译,可作研究网络通信(Prepared with C a simple imitation MSN chat software, vs2005 can be a normal compile, can be used for research network communication)
    2009-11-15 00:22:04下载
    积分:1
  • 简单介绍如何使用dlgdemol
    说明:  简单介绍如何使用dlgdemol, 简单的例子,简单易懂(How to use dlgdemol, simple example, easy to understand)
    2020-06-27 05:00:01下载
    积分:1
  • 696518资源总数
  • 105877会员总数
  • 14今日下载