亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pop3client.cs

?? Bug管理系統(tǒng)
?? CS
字號:
/*

[Corey Trager] I downloaded this code from the URL below September 14, 2003:

http://www.codeproject.com/csharp/pop3client.asp

On that page Bill Dean writes:

"I hope some of you find this useful. 
I'd love some feedback / comments. 
Please be aware that this code come with no warranty of any sort, express or implied. 
It is provided strictly "as is" and is indended solely for educational purposes. 
YOU USE IT AT YOUR OWN RISK. 
By using this code you agree to hold the Author and Restek blameless for any loss 
resulting from the use of the code." 


Here's a usage example from that page.
static void Main(string[] args)
{
            
    POP3Client.POP3client  Demo = new POP3Client.POP3client();
    Console.WriteLine ("****connecting to server:");
    Console.WriteLine (Demo.connect ("your_pop3_server"));
    Console.WriteLine ("****Issuing USER");
    Console.WriteLine (Demo.USER ("user_id"));
    Console.WriteLine ("****Issuing PASS");
    Console.WriteLine (Demo.PASS ("password"));
    Console.WriteLine ("****Issuing STAT");
    Console.WriteLine (Demo.STAT () );
    Console.WriteLine ("****Issuing LIST");
    Console.WriteLine (Demo.LIST () );
    Console.WriteLine ("****Issuing RETR 700...this will cause the POP3 server to gack a "
                            + "hairball since there is no message 700");  
    Console.WriteLine (Demo.RETR (700) );    // this will cause the pop3 server to throw 
                                                       // an error since there is no message 700
    Console.WriteLine ("****Issuing RETR 7");
    Console.WriteLine (Demo.RETR (7) );
    Console.WriteLine ("****Issuing QUIT");
    Console.WriteLine (Demo.QUIT ());

    Console.ReadLine ();
}



*/
using System;

namespace POP3Client
{
	using System.IO ;
	using System.Net;
	using System.Net.Sockets ;
	//Please note that all code is copyright 2002 by William J Dean
	public class POP3client
	{
		public enum connect_state {disc,AUTHORIZATION,TRANSACTION,UPDATE};

		public string user;
		public string pwd;
		public string pop;
		public bool error;
		public connect_state state=connect_state.disc ;

		//borrowed from Agus Kurniawan's article:"Retrieve Mail From a POP3 Server Using C#"  at http://www.codeproject.com/csharp/popapp.asp 
		private TcpClient Server;
		private NetworkStream NetStrm;
		private StreamReader  RdStrm;
		private string Data;
		private byte[] szData;
		private string CRLF = "\r\n";	

		public POP3client()
		{
			//nothing to do..just create to object	
		}

		public POP3client(string pop_server,string user_name,string password)
		{
			//put the specied server (pop_server), user (user_name) and password (password)
			//into the appropriate properties.
			pop=pop_server;
			user=user_name;
			pwd=password;
		}

		#region Utility Methods, some public, some private
		public string connect (string pop_server)
		{
			pop=pop_server;    //put the specified server into the pop property
			return(connect()); //call the connect method
		}
		public string connect()
		{
			//Initialize to the pop server.  This code snipped "borrowed"
			//with some modifications...
			//from the article "Retrieve Mail From a POP3 Server Using C#" at
			//www.codeproject.com by Agus Kurniawan
			//http://www.codeproject.com/csharp/popapp.asp

			// create server with port 110
			Server = new TcpClient(pop,110);								
		
			try
			{
				// initialization
				NetStrm = Server.GetStream();
				RdStrm= new StreamReader(Server.GetStream());

				//The pop session is now in the AUTHORIZATION state
				state=connect_state.AUTHORIZATION ;
				return(RdStrm.ReadLine ());
			}			
			catch(InvalidOperationException err)
			{
				return("Error: "+err.ToString());
			}

		}
		private string disconnect ()
		{
			string temp="disconnected successfully.";
			if(state !=connect_state.disc)
			{

				//close connection
				NetStrm.Close();
				RdStrm.Close();
				state=connect_state.disc ;
			}
			else
			{
				temp="Not Connected.";
			}
			return(temp);
		}

		private void issue_command(string command)
		{
			//send the command to the pop server.  This code snipped "borrowed"
			//with some modifications...
			//from the article "Retrieve Mail From a POP3 Server Using C#" at
			//www.codeproject.com by Agus Kurniawan
			//http://www.codeproject.com/csharp/popapp.asp
			Data= command + CRLF;
			szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
			NetStrm.Write(szData,0,szData.Length);

		}
		private string read_single_line_response()
		{
			//read the response of the pop server.  This code snipped "borrowed"
			//with some modifications...
			//from the article "Retrieve Mail From a POP3 Server Using C#" at
			//www.codeproject.com by Agus Kurniawan
			//http://www.codeproject.com/csharp/popapp.asp
			string temp;
			try
			{
				temp = RdStrm.ReadLine();
				was_pop_error(temp);				
				return(temp);
			}
			catch(InvalidOperationException err)
			{
				return("Error in read_single_line_response(): " + err.ToString ()) ;
			}

		}
		private string read_multi_line_response()
		{
			//read the response of the pop server.  This code snipped "borrowed"
			//with some modifications...
			//from the article "Retrieve Mail From a POP3 Server Using C#" at
			//www.codeproject.com by Agus Kurniawan
			//http://www.codeproject.com/csharp/popapp.asp
			string temp="";
			string szTemp;

			try
			{
				szTemp = RdStrm.ReadLine();
				was_pop_error(szTemp);				
				if(!error) 
				{
				
					while(szTemp!=".")
					{
						temp += szTemp+CRLF;
						szTemp = RdStrm.ReadLine();
					}
				}
				else
				{
					temp=szTemp;
				}
				return(temp);
			}
			catch(InvalidOperationException err)
			{
				return("Error in read_multi_line_response(): " + err.ToString ());
			}
		}
		private void was_pop_error(string response)
		{
			//detect if the pop server that issued the response believes that
			//an error has occured.

			if(response.StartsWith ("-"))
			{
				//if the first character of the response is "-" then the 
				//pop server has encountered an error executing the last 
				//command send by the client
				error=true;
			}
			else
			{
				//success
				error=false;
			}
		}
		#endregion
		#region POP commands
		public string DELE(int msg_number)
		{
			string temp;
			
			if (state != connect_state.TRANSACTION )
			{
				//DELE is only valid when the pop session is in the TRANSACTION STATE
				temp="Connection state not = TRANSACTION";
			}
			else
			{
				issue_command("DELE " + msg_number.ToString ());
				temp=read_single_line_response();			
			}
			return(temp);
		}

		public string LIST()
		{
			string temp="";
			if (state != connect_state.TRANSACTION )
			{
				//the pop command LIST is only valid in the TRANSACTION state
				temp="Connection state not = TRANSACTION";
			}
			else
			{
				issue_command ("LIST");
				temp=read_multi_line_response();
			}
			return(temp);			
		}

		public string LIST(int msg_number)
		{
			string temp="";

			if (state != connect_state.TRANSACTION )
			{
				//the pop command LIST is only valid in the TRANSACTION state
				temp="Connection state not = TRANSACTION";
			}
			else
			{
				issue_command ("LIST " + msg_number.ToString ());
				temp=read_single_line_response();  //when the message number is supplied, expect a single line response
			}
			return(temp);

		}

		public string NOOP()
		{
			string temp;
			if (state != connect_state.TRANSACTION )
			{
				//the pop command NOOP is only valid in the TRANSACTION state
				temp="Connection state not = TRANSACTION";
			}
			else
			{
				issue_command ("NOOP");
				temp=read_single_line_response();

			}
			return(temp);

		}
		public string PASS()
		{
			string temp;
			if (state != connect_state.AUTHORIZATION) 
			{
				//the pop command PASS is only valid in the AUTHORIZATION state
				temp="Connection state not = AUTHORIZATION";
			}
			else
			{
				if (pwd !=null)
				{
					issue_command ("PASS " + pwd);
					temp=read_single_line_response();

					if (!error)
					{
						//transition to the Transaction state
						state=connect_state.TRANSACTION;
					}
				}
				else
				{
					temp="No Password set.";
				}
			}
			return(temp);
		}
		public string PASS(string password)
		{
			pwd=password;   //put the supplied password into the appropriate property
			return(PASS()); //call PASS() with no arguement
		}

		public string QUIT()
		{
			//QUIT is valid in all pop states

			string temp;
			if (state !=connect_state.disc)
			{
				issue_command ("QUIT");
				temp=read_single_line_response();
				temp += CRLF + disconnect();
	
			}
			else
			{
				temp="Not Connected.";
			}
			return(temp);

		}
		public string RETR (int msg)
		{
			string temp="";
			if (state != connect_state.TRANSACTION )
			{
				//the pop command RETR is only valid in the TRANSACTION state
				temp="Connection state not = TRANSACTION";
			}
			else
			{
				// retrieve mail with number mail parameter
				issue_command ("RETR "+ msg.ToString ());
				temp=read_multi_line_response();
			}
			return(temp);

		}

		public string RSET()
		{
			string temp;
			if (state != connect_state.TRANSACTION )
			{
				//the pop command STAT is only valid in the TRANSACTION state
				temp="Connection state not = TRANSACTION";
			}
			else
			{
				issue_command("RSET");
				temp=read_single_line_response();
			}
			return(temp);

		}

		public string STAT()
		{
			string temp;
			if (state==connect_state.TRANSACTION)
			{
				issue_command("STAT");
				temp=read_single_line_response();

				return(temp);
			}
			else

			{
				//the pop command STAT is only valid in the TRANSACTION state
				return ("Connection state not = TRANSACTION");
			}
		}		

		public string USER()
		{
			string temp;
			if (state != connect_state.AUTHORIZATION) 
			{
				//the pop command USER is only valid in the AUTHORIZATION state
				temp="Connection state not = AUTHORIZATION";
			}
			else
			{
				if (user !=null)
				{   
					issue_command("USER "+ user);
					temp=read_single_line_response();
				}
				else
				{   //no user has been specified
					temp="No User specified.";
				}
			}
			return(temp);
		}

		public string USER(string user_name)
		{
			user=user_name;  //put the user name in the appropriate propertity
			return(USER());  //call USER with no arguements
		}
		#endregion
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区三区免费观看 | 中文字幕欧美一区| 亚洲一区二区精品3399| 久久99精品视频| 欧美日韩国产综合一区二区三区| 久久久久99精品国产片| 亚洲国产日韩精品| 成人精品电影在线观看| 欧美大胆一级视频| 亚洲与欧洲av电影| 97超碰欧美中文字幕| 久久久久国产精品麻豆| 奇米四色…亚洲| 欧美无乱码久久久免费午夜一区| 亚洲欧洲日本在线| 高清在线观看日韩| 亚洲精品一线二线三线| 日本不卡一区二区三区高清视频| 色婷婷av久久久久久久| 国产精品久久二区二区| 国产精品一卡二卡| 欧美精品一区二区三| 麻豆精品在线播放| 欧美一区午夜视频在线观看| 亚洲国产视频网站| 欧美伊人久久大香线蕉综合69| 亚洲欧美一区二区视频| 成人在线视频首页| 日本一区二区三区国色天香| 国产乱一区二区| 2021久久国产精品不只是精品| 男女视频一区二区| 欧美成人在线直播| 国产一区二区三区在线观看免费视频 | 亚洲成a人v欧美综合天堂| 91网站视频在线观看| **网站欧美大片在线观看| av一区二区三区| 国产精品电影一区二区三区| www.欧美.com| 亚洲欧美日韩一区二区| 欧洲视频一区二区| 亚洲高清三级视频| 日韩一级二级三级精品视频| 美女一区二区三区| 久久久精品中文字幕麻豆发布| 国产精品18久久久久久久久| 国产女人18毛片水真多成人如厕| 成人网页在线观看| 夜夜嗨av一区二区三区| 欧美日韩国产高清一区| 久久99精品一区二区三区三区| 久久久久国产精品人| 91污在线观看| 午夜a成v人精品| 26uuu久久天堂性欧美| 国产91丝袜在线播放| 亚洲欧美激情插| 欧美精品tushy高清| 国产一区二区三区视频在线播放| 久久九九久久九九| 色综合久久久久久久久| 水野朝阳av一区二区三区| 精品久久人人做人人爰| 波多野结衣亚洲| 日韩vs国产vs欧美| 中文字幕国产一区| 69成人精品免费视频| 国产在线播放一区| 亚洲综合丁香婷婷六月香| 精品国产一区二区国模嫣然| 91一区在线观看| 日本亚洲最大的色成网站www| 国产欧美一区二区精品仙草咪| 91九色02白丝porn| 国产乱码一区二区三区| 一区二区三区在线免费播放| 精品日韩一区二区| 欧美三级乱人伦电影| 国产精品亚洲人在线观看| 亚洲一区二区三区四区在线观看 | 久久综合99re88久久爱| 欧美熟乱第一页| 国产成人一区在线| 日本大胆欧美人术艺术动态| 亚洲人成精品久久久久久| 日韩一区二区三区高清免费看看 | 久久你懂得1024| 在线看一区二区| 成人性生交大片免费看视频在线| 三级影片在线观看欧美日韩一区二区 | 欧美精品在欧美一区二区少妇| 国产69精品久久久久毛片 | 日韩一区二区不卡| 在线观看国产日韩| av亚洲精华国产精华精华| 国产一区二区三区高清播放| 日韩高清国产一区在线| 亚洲一区在线播放| 亚洲人成小说网站色在线| 国产欧美一区二区精品婷婷| 日韩欧美中文字幕公布| 欧美精品aⅴ在线视频| 欧美丝袜第三区| 欧美亚男人的天堂| 在线观看一区不卡| 色诱亚洲精品久久久久久| 久久久99精品久久| 欧美α欧美αv大片| 欧美精品一级二级| 在线播放亚洲一区| 欧美丰满高潮xxxx喷水动漫| 欧美日韩大陆在线| 欧美丰满少妇xxxbbb| 69p69国产精品| 日韩欧美国产一二三区| 日韩视频免费观看高清完整版| 9191成人精品久久| 日韩欧美国产电影| 精品国产乱码久久久久久1区2区| 日韩视频一区在线观看| 日韩精品一区二区三区蜜臀 | 亚洲高清在线精品| 丝袜美腿高跟呻吟高潮一区| 洋洋成人永久网站入口| 一区二区日韩av| 亚洲va欧美va人人爽| 免费高清在线视频一区·| 日本美女视频一区二区| 国产在线精品一区二区不卡了| 激情欧美日韩一区二区| 国产精品中文字幕日韩精品| 不卡的av中国片| 欧美在线啊v一区| 69av一区二区三区| 精品日韩成人av| 中文字幕乱码一区二区免费| 亚洲蜜臀av乱码久久精品| 一区二区理论电影在线观看| 天堂成人免费av电影一区| 美国一区二区三区在线播放| 国产69精品久久久久777| 日本韩国精品一区二区在线观看| 欧美亚洲综合一区| 精品三级av在线| 亚洲视频一区二区免费在线观看| 一区二区三区 在线观看视频| 日本午夜精品视频在线观看| 国产精品影视天天线| 色婷婷激情一区二区三区| 欧美日韩国产美女| 国产清纯在线一区二区www| 亚洲另类中文字| 日韩中文字幕亚洲一区二区va在线 | 一本大道久久a久久综合婷婷| 欧美日韩一区二区三区四区| 欧美一区二区三区小说| 久久精品人人做| 亚洲一区二区三区四区五区黄| 麻豆成人久久精品二区三区红 | 久久91精品国产91久久小草| 成人高清视频在线观看| 欧美撒尿777hd撒尿| 久久久久88色偷偷免费| 亚洲成人综合视频| av一区二区三区在线| 欧美大胆一级视频| 亚洲成av人片www| 成人美女在线观看| 欧美一区二区三区色| 国产精品乱人伦| 精品中文字幕一区二区小辣椒| 97se亚洲国产综合自在线观| 精品三级av在线| 午夜精品久久久久久久久久久| 99久久伊人网影院| 亚洲精品在线三区| 日韩精品1区2区3区| 色综合一个色综合亚洲| 久久精品综合网| 久久精品国产一区二区三| 欧美日韩性生活| 亚洲丝袜制服诱惑| 粉嫩蜜臀av国产精品网站| 欧美va在线播放| 午夜精品123| 色偷偷成人一区二区三区91| 国产人成亚洲第一网站在线播放 | 欧美裸体一区二区三区| 亚洲卡通欧美制服中文| 国产经典欧美精品| 精品少妇一区二区三区在线视频| 亚洲bt欧美bt精品| 欧美日韩一卡二卡三卡| 亚洲最新视频在线观看| 91香蕉国产在线观看软件| 国产精品国产自产拍高清av王其| 精品一区二区日韩| 2020国产精品久久精品美国| 免费在线一区观看|