pop

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.Threading;

namespace

 

 

gamePop

{

 

 

public partial class Form1 :

Form

{

 

 

public

Form1()

{

InitializeComponent();

}

 

 

private void button1_Click(object sender, EventArgs

e)

{

 

 

Thread t = new Thread(new ThreadStart

(Calculate));

t.Start();

 

}

 

 

void

Calculate()

{

 

 

int

MAX = 147483647;

 

 

//931322574615478515625 Math.Pow(5, 30);

 

 

List<int> counts = new List<int

>();

 

 

List<List<string>> matrixList = new List<List<string

>>();

System.Diagnostics.

 

Stopwatch sw = new System.Diagnostics.Stopwatch

();

sw.Start();

 

 

 

try

{

 

 

//init

 

 

int

currentCount = 0;

 

 

List<string> currentMatrixList = new List<string

>(MAX);

#region

 

 

for

 

 

for (int

i1 = 0; i1 < 5; i1++)

{

 

 

for (int

i2 = 0; i2 < 5; i2++)

{

 

 

for (int

i3 = 0; i3 < 5; i3++)

{

 

 

for (int

i4 = 0; i4 < 5; i4++)

{

 

 

for (int

i5 = 0; i5 < 5; i5++)

{

 

 

for (int

i6 = 0; i6 < 5; i6++)

{

 

 

for (int

i7 = 0; i7 < 5; i7++)

{

 

 

for (int

i8 = 0; i8 < 5; i8++)

{

 

 

for (int

i9 = 0; i9 < 5; i9++)

{

 

 

for (int

i10 = 0; i10 < 5; i10++)

{

 

 

for (int

i11 = 0; i11 < 5; i11++)

{

 

 

for (int

i12 = 0; i12 < 5; i12++)

{

 

 

for (int

i13 = 0; i13 < 5; i13++)

{

 

 

for (int

i14 = 0; i14 < 5; i14++)

{

 

 

for (int

i15 = 0; i15 < 5; i15++)

{

 

 

for (int

i16 = 0; i16 < 5; i16++)

{

 

 

for (int

i17 = 0; i17 < 5; i17++)

{

 

 

for (int

i18 = 0; i18 < 5; i18++)

{

 

 

for (int

i19 = 0; i19 < 5; i19++)

{

 

 

for (int

i20 = 0; i20 < 5; i20++)

{

 

 

for (int

i21 = 0; i21 < 5; i21++)

{

 

 

for (int

i22 = 0; i22 < 5; i22++)

{

 

 

for (int

i23 = 0; i23 < 5; i23++)

{

 

 

for (int

i24 = 0; i24 < 5; i24++)

{

 

 

for (int

i25 = 0; i25 < 5; i25++)

{

 

 

for (int

i26 = 0; i26 < 5; i26++)

{

 

 

for (int

i27 = 0; i27 < 5; i27++)

{

 

 

for (int

i28 = 0; i28 < 5; i28++)

{

 

 

for (int

i29 = 0; i29 < 5; i29++)

{

 

 

for (int

i30 = 0; i30 < 5; i30++)

{

#endregion

#region

 

 

geneate str

 

 

StringBuilder currentMatrixStr = new StringBuilder

();

currentMatrixStr.Append(i1);

currentMatrixStr.Append(i2);

currentMatrixStr.Append(i3);

currentMatrixStr.Append(i4);

currentMatrixStr.Append(i5);

currentMatrixStr.Append(i6);

currentMatrixStr.Append(i7);

currentMatrixStr.Append(i8);

currentMatrixStr.Append(i9);

currentMatrixStr.Append(i10);

currentMatrixStr.Append(i11);

currentMatrixStr.Append(i12);

currentMatrixStr.Append(i13);

currentMatrixStr.Append(i14);

currentMatrixStr.Append(i15);

currentMatrixStr.Append(i16);

currentMatrixStr.Append(i17);

currentMatrixStr.Append(i18);

currentMatrixStr.Append(i19);

currentMatrixStr.Append(i20);

currentMatrixStr.Append(i21);

currentMatrixStr.Append(i22);

currentMatrixStr.Append(i23);

currentMatrixStr.Append(i24);

currentMatrixStr.Append(i25);

currentMatrixStr.Append(i26);

currentMatrixStr.Append(i27);

currentMatrixStr.Append(i28);

currentMatrixStr.Append(i29);

currentMatrixStr.Append(i30);

#endregion

currentCount++;

currentMatrixList.Add(currentMatrixStr.ToString());

 

 

//show count

 

 

if

(currentCount % 10000 == 0)

{

ShowText(MAX.ToString() +

 

"*" + counts.Count.ToString() + "+"

+ currentCount.ToString());

}

 

 

if

(currentCount == MAX)

{

counts.Add(currentCount);

matrixList.Add(currentMatrixList);

 

 

//reinit

currentCount = 0;

currentMatrixList =

 

new List<string

>(MAX);

}

#region

 

 

end for

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

#endregion

}

 

 

catch (Exception

ee)

{

sw.Stop();

}

sw.Stop();

 

 

long

cost = sw.ElapsedMilliseconds;

}

 

 

delegate void DShowText(string

text);

 

 

void ShowText(string

text)

{

 

 

if (this

.InvokeRequired)

{

 

 

this.Invoke(new DShowText

(ShowText), text);

}

 

 

else

{

 

 

this

.Text = text;

 

 

this

.Refresh();

 

 

Application

.DoEvents();

10-25
### POP3介绍 POP3(Post Office Protocol 3,邮局协议第3版)是一种用于接收电子邮件的协议,允许客户端(如电子邮件客户端软件)从邮件服务器上下载邮件。POP3协议定义了其默认的TCP端口号是110,若邮件服务器支持SSL/TLS加密的POP3(即POP3S),则默认使用端口995,这种加密方式可保护邮件数据在传输过程中的安全,防止被窃听或篡改。电子邮件系统采用C/S方式,连接基于TCP,POP3属于邮件读取协议 [^2][^4]。 ### POP3协议特性 POP3跟SMTP一样,是Request/Response协议,命令和响应都是基于ASCII文本,并以CR和LF(/r/n)符结束。响应包括一个表示返回状态的符号(+/-)以及描述信息。POP3在TCP协议110号端口(默认端口,可以更改)监听连接请求 [^3]。 ### POP3命令码 #### 基本命令集合 - `USER name`:指定用户名。 - `PASS string`:指定密码(明文)。 - `QUIT`:退出命令,结束当前POP3对话。 - `STAT`:统计邮件命令。 - `LIST [msg]`:列出当前邮件命令。 - `RETR msg`:根据邮件序号获取某一邮件。 - `DELE msg`:根据邮件序号删除某一邮件。 - `NOOP`:无操作。 - `RSET`:用于撤消`DELE`命令。 #### 可选命令集合 - `APOP name digest`:在AUTHORIZATION状态下有效。 - `TOP msg n`:在TRANSACTION状态下有效。 - `UIDL [msg]` POP3回复中,正向符号`+`表示成功,负向符号`-`表示失败 [^3]。 ### 常见问题 在配置POP3服务器时,需注意默认端口的使用。若使用默认的POP3协议,端口为110;若使用加密的POP3S协议,端口为995。同时,要确保邮件服务器和客户端的兼容性,遵循POP3协议的标准定义 [^2]。 以下是一个简单的Python示例,使用`poplib`库连接到POP3服务器并获取邮件信息: ```python import poplib # 连接到POP3服务器 pop_conn = poplib.POP3('pop.example.com') # 打印欢迎信息 print(pop_conn.getwelcome()) # 登录邮箱 pop_conn.user('your_email@example.com') pop_conn.pass_('your_password') # 获取邮件统计信息 num_messages = len(pop_conn.list()[1]) print(f"邮件数量: {num_messages}") # 关闭连接 pop_conn.quit() ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值