pop3邮件检索附件 [英] pop3 mail retrieve attachments
本文介绍了pop3邮件检索附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以通过vb代码帮助我,以使用pop3检索电子邮件附件.我设法阅读邮件,但没有下载和保存任何附件. (我不是在寻找获得购买许可的dll)
>我需要vb代码(而且我不知道如何将C#代码转换为vb ...->有人建议在C#中使用解决方案的谢尔盖)
解决方案
<例如,此示例: http://sourceforge.net/projects/systemnetpop3/ [ http://sourceforge.net/directory/communications/电子邮件/邮局/pop3/os:windows/新鲜度:最近更新/ [ C#.NET中的POP3客户端 [^ ].
嗯, 您自己所做的主要是...所以我可以找到一些&和平... 对于那些可能感兴趣的人:这是结果&有用! -> gvMail是gridvieuw;): < pre lang ="vb"> 导入OpenPop.Pop3 导入OpenPop.Mime 导入System.io 公开课表格1 昏暗的SSL作为布尔值 昏暗的PopHost作为字符串 昏暗的用户名作为字符串 昏暗的WW作为字符串 Dim PortNm作为整数 受保护的Sub Page_Load(以对象的ByBy发件人身份,以EventArgs的ByVal e属性)处理Me.Load PopHost ="pop.gmail.com" PortNm = 995 WW =密码" 用户名= someone@gmail.com TxtHostname.Text = PopHost CboAccount.Text =用户名 TxtPort.Text = PortNm 结束子 私有Sub CmdGetM_Click(ByVal发送者为System.Object,ByVal e为System.EventArgs)处理CmdGetM.Click 如果ChbSSL.Checked = True,则 SSL =真 别的 SSL =假 万一 我.Read_Emails() 结束子 私人子Read_Emails() Me.Cursor =游标.WaitCursor 昏暗的pop3Client作为Pop3Client pop3Client =新的Pop3Client() pop3Client.Connect(PopHost,Val(PortNm),SSL) 如果pop3Client.Connected = False,则 TxtCounter.BackColor =颜色.红色 别的 TxtCounter.BackColor = Color.LightGreen pop3Client.Authenticate(UserName,WW,AuthenticationMethod.UsernameAndPassword) 如果ChbReset.Checked = True,则pop3Client.Reset() 昏暗计数为整数= pop3Client.GetMessageCount() TxtCounter.Text =计数 TxtCounter.Update() 电子邮件昏暗(7)作为字符串,GvIndex作为整数= -1,消息作为消息 对于i作为整数=计数到1步骤-1 TxtCounter.Text = GvIndex + 2& "/"&数数 TxtCounter.Update() 消息= pop3Client.GetMessage(i) 电子邮件(1)= i'MessageNumber 电子邮件(2)= message.Headers.Subject.ToString 电子邮件(3)= message.Headers.DateSent.ToString 电子邮件(4)= message.Headers.From.DisplayName.ToString& ("& message.Headers.From.Address.ToString&)" 电子邮件(5)=" 如果message.Headers.To.Count> 0然后 电子邮件(5)=电子邮件(5)& 收件人:"& vbCrLf 对于每个tomailaddress作为OpenPop.Mime.Header.RfcMailAddress在message.Headers.To中 电子邮件(5)=电子邮件(5)& tomailaddress.Address& vbCrLf 下一个 万一 如果message.Headers.Cc.Count> 0然后 电子邮件(5)=电子邮件(5)& "CC:"& vbCrLf 对于每个ccmailaddress,作为message.Headers.Cc中的OpenPop.Mime.Header.RfcMailAddress 电子邮件(5)=电子邮件(5)& ccmailaddress.Address& vbCrLf 下一个 万一 如果message.Headers.Bcc.Count> 0然后 电子邮件(5)=电子邮件(5)& 密件抄送:"& vbCrLf 对于每个bccmailaddress作为message.Headers.Bcc中的OpenPop.Mime.Header.RfcMailAddress 电子邮件(5)=电子邮件(5)& bccmailaddress.Address& vbCrLf 下一个 万一 昏暗的正文作为MessagePart = message.FindFirstHtmlVersion() 如果身体什么都不是 电子邮件(6)= body.GetBodyAsText() 别的 正文= message.FindFirstPlainTextVersion() 如果身体什么都不是 电子邮件(6)= body.GetBodyAsText() 万一 万一 昏暗的附件为List(Of MessagePart)= message.FindAllAttachments() 电子邮件(7)=" 对于每个附件作为附件中的MessagePart 如果Email(7)="然后 电子邮件(7)=电子邮件(7)& attachment.FileName 别的 电子邮件(7)=电子邮件(7)& vbCrLf& attachment.FileName 万一 '将昏暗的ContentID作为字符串= attachment.ContentId'如果已设置,则附件为内联. 'Dim ContentType As String = attachment.ContentType.MediaType'附件类型pdf,jpg,png等 File.WriteAllBytes(TxtAttDest.Text& attachment.FileName.ToString,attachment.Body)'//用附件覆盖MessagePart.Body 下一个 gvEmails.Rows.Add() GvIndex = GvIndex + 1 gvEmails.Item(0,GvIndex).Value =电子邮件(1) gvEmails.Item(1,GvIndex).Value =电子邮件(2) gvEmails.Item(2,GvIndex).Value =电子邮件(3) gvEmails.Item(3,GvIndex).Value =电子邮件(4) gvEmails.Item(4,GvIndex).Value =电子邮件(5) gvEmails.Item(5,GvIndex).Value =电子邮件(6) gvEmails.Item(6,GvIndex).Value =电子邮件(7) 下一个 pop3Client.Disconnect() 万一 Me.Cursor =游标.默认 结束子 结束类
这是我用来测试代码的形式:
< global.microsoft.visualbasic.compilerservices.designergenic()> _
局部类Form1
继承System.Windows.Forms.Form
''表单重写用于清理组件列表.
< system.diagnostics.debuggernonusercode()> _
受保护的重写Sub Dispose(ByVal以布尔方式进行处置)
试试
如果处置AndAlso组件一无所获,那么
components.Dispose()
如果结束
终于
MyBase.Dispose(处置)
结束尝试
结束子
''Windows窗体设计器需要
私有组件作为System.ComponentModel.IContainer
''注意:Windows窗体设计器需要执行以下步骤
可以使用Windows窗体设计器进行修改.
''请勿使用代码编辑器对其进行修改.
< system.diagnostics.debuggerstepthrough()> _
私有子InitializeComponent()
将DataGridViewCellStyle1昏暗为System.Windows.Forms.DataGridViewCellStyle =新System.Windows.Forms.DataGridViewCellStyle
将DataGridViewCellStyle2变暗为System.Windows.Forms.DataGridViewCellStyle =新的System.Windows.Forms.DataGridViewCellStyle
将DataGridViewCellStyle3变暗为System.Windows.Forms.DataGridViewCellStyle =新的System.Windows.Forms.DataGridViewCellStyle
将DataGridViewCellStyle4昏暗为System.Windows.Forms.DataGridViewCellStyle =新System.Windows.Forms.DataGridViewCellStyle
将DataGridViewCellStyle5昏暗为System.Windows.Forms.DataGridViewCellStyle =新System.Windows.Forms.DataGridViewCellStyle
将DataGridViewCellStyle6昏暗为System.Windows.Forms.DataGridViewCellStyle =新System.Windows.Forms.DataGridViewCellStyle
将DataGridViewCellStyle7变暗为System.Windows.Forms.DataGridViewCellStyle =新的System.Windows.Forms.DataGridViewCellStyle
作为System.ComponentModel.ComponentResourceManager昏暗的资源=新的System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.gvEmails =新的System.Windows.Forms.DataGridView
Me.MsgNr =新的System.Windows.Forms.DataGridViewTextBoxColumn
Me.Subject =新的System.Windows.Forms.DataGridViewTextBoxColumn
Me.Datesent =新的System.Windows.Forms.DataGridViewTextBoxColumn
Me.from =新System.Windows.Forms.DataGridViewTextBoxColumn
Me.Dest =新的System.Windows.Forms.DataGridViewTextBoxColumn
Me.Body =新的System.Windows.Forms.DataGridViewTextBoxColumn
Me.Attach =新的System.Windows.Forms.DataGridViewTextBoxColumn
Me.CmdGetM =新的System.Windows.Forms.Button
Me.TxtCounter =新的System.Windows.Forms.TextBox
Me.Label1 =新的System.Windows.Forms.Label
Me.Label3 =新的System.Windows.Forms.Label
Me.TxtHostname =新的System.Windows.Forms.TextBox
Me.Label4 =新的System.Windows.Forms.Label
Me.TxtPort =新的System.Windows.Forms.TextBox
Me.ChbSSL =新的System.Windows.Forms.CheckBox
Me.ChbReset =新的System.Windows.Forms.CheckBox
Me.TxtAttDest =新的System.Windows.Forms.TextBox
Me.Label5 =新的System.Windows.Forms.Label
Me.CboAccount =新的System.Windows.Forms.ComboBox
Me.CmdVnet =新的System.Windows.Forms.Button
CType(Me.gvEmails,System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
''
''gvEmails
''
Me.gvEmails.AllowUserToAddRows = False
Me.gvEmails.Anchor = CType(((((((System.Windows.Forms.AnchorStyles.Top或System.Windows.Forms.AnchorStyles.Bottom)_
或System.Windows.Forms.AnchorStyles.Left)_
或System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.gvEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.gvEmails.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn(){Me.MsgNr,Me.Subject,Me.Dateent,Me.from,Me.Dest,Me.Body,Me.Attach})
Me.gvEmails.Location =新的System.Drawing.Point(30,102)
Me.gvEmails.Name ="gvEmails"
Me.gvEmails.Size =新的System.Drawing.Size(834,148)
Me.gvEmails.TabIndex = 0
''
''MsgNr
''
DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter
Me.MsgNr.DefaultCellStyle = DataGridViewCellStyle1
Me.MsgNr.HeaderText ="MsgNr"
Me.MsgNr.Name ="MsgNr"
''
''主题
''
DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[真实]
Me.Subject.DefaultCellStyle = DataGridViewCellStyle2
Me.Subject.HeaderText =主题"
Me.Subject.Name =主题"
''
''日期
''
DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
Me.Datesent.DefaultCellStyle = DataGridViewCellStyle3
Me.Datesent.HeaderText =已发送日期"
Me.Datesent.Name =日期"
''
''来自
''
DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
Me.from.DefaultCellStyle = DataGridViewCellStyle4
Me.from.HeaderText =发件人"
Me.from.Name =来自"
''
''目标
''
DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[真实]
Me.Dest.DefaultCellStyle = DataGridViewCellStyle5
Me.Dest.HeaderText =目标."
Me.Dest.Name =目标"
Me.Dest.Width = 250
''
''身体
''
DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[真实]
Me.Body.DefaultCellStyle = DataGridViewCellStyle6
Me.Body.HeaderText =内容"
Me.Body.Name =身体"
Me.Body.Width = 250
''
''附加
''
DataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.[真实]
Me.Attach.DefaultCellStyle = DataGridViewCellStyle7
Me.Attach.HeaderText =附件"
Me.Attach.Name =附加"
''
''CmdGetM
''
Me.CmdGetM.Enabled = False
Me.CmdGetM.Location =新的System.Drawing.Point(527,15)
Me.CmdGetM.Name ="CmdGetM"
Me.CmdGetM.Size =新的System.Drawing.Size(113,20)
Me.CmdGetM.TabIndex = 1
Me.CmdGetM.Text =获取邮件"
Me.CmdGetM.UseVisualStyleBackColor = True
''
''TxtCounter
''
Me.TxtCounter.Location =新System.Drawing.Point(527,42)
Me.TxtCounter.Name ="TxtCounter"
Me.TxtCounter.ReadOnly = True
Me.TxtCounter.Size =新的System.Drawing.Size(113,20)
Me.TxtCounter.TabIndex = 2
Me.TxtCounter.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
''
''Label1
''
Me.Label1.AutoSize = True
Me.Label1.Location =新System.Drawing.Point(272,18)
Me.Label1.Name ="Label1"
Me.Label1.Size =新System.Drawing.Size(47,13)
Me.Label1.TabIndex = 5
Me.Label1.Text =帐户"
''
''Label3
''
Me.Label3.AutoSize = True
Me.Label3.Location =新System.Drawing.Point(31,18)
Me.Label3.Name ="Label3"
Me.Label3.Size =新的System.Drawing.Size(55,13)
Me.Label3.TabIndex = 8
Me.Label3.Text =主机名"
''
''TxtHostname
''
Me.TxtHostname.Location =新System.Drawing.Point(92,15)
Me.TxtHostname.Name ="TxtHostname"
Me.TxtHostname.ReadOnly = True
Me.TxtHostname.Size =新的System.Drawing.Size(151,20)
Me.TxtHostname.TabIndex = 7
''
''Label4
''
Me.Label4.AutoSize = True
Me.Label4.Location =新System.Drawing.Point(31,44)
Me.Label4.Name ="Label4"
Me.Label4.Size =新的System.Drawing.Size(26,13)
Me.Label4.TabIndex = 10
Me.Label4.Text =端口"
''
''TxtPort
''
Me.TxtPort.Location =新的System.Drawing.Point(92,41)
Me.TxtPort.Name ="TxtPort"
Me.TxtPort.ReadOnly = True
Me.TxtPort.Size =新的System.Drawing.Size(70,20)
Me.TxtPort.TabIndex = 9
''
''ChbSSL
''
Me.ChbSSL.AutoSize = True
Me.ChbSSL.Checked = True
Me.ChbSSL.CheckState = System.Windows.Forms.CheckState.Checked
Me.ChbSSL.Location =新的System.Drawing.Point(197,44)
Me.ChbSSL.Name ="ChbSSL"
Me.ChbSSL.Size =新的System.Drawing.Size(46,17)
Me.ChbSSL.TabIndex = 11
Me.ChbSSL.Text ="SSL"
Me.ChbSSL.UseVisualStyleBackColor = True
''
''ChbReset
''
Me.ChbReset.AutoSize = True
Me.ChbReset.Checked = True
Me.ChbReset.CheckState = System.Windows.Forms.CheckState.Checked
Me.ChbReset.Location =新的System.Drawing.Point(275,71)
Me.ChbReset.Name ="ChbReset"
Me.ChbReset.Size =新的System.Drawing.Size(128,17)
Me.ChbReset.TabIndex = 12
Me.ChbReset.Text =在服务器上重置邮件"
Me.ChbReset.UseVisualStyleBackColor = True
''
''TxtAttDest
''
Me.TxtAttDest.Location =新System.Drawing.Point(106,72)
Me.TxtAttDest.Name ="TxtAttDest"
Me.TxtAttDest.Size =新的System.Drawing.Size(137,20)
Me.TxtAttDest.TabIndex = 13
Me.TxtAttDest.Text ="C:\ Temp \"
''
''Label5
''
Me.Label5.AutoSize = True
Me.Label5.Location =新System.Drawing.Point(31,75)
Me.Label5.Name ="Label5"
Me.Label5.Size =新的System.Drawing.Size(69,13)
Me.Label5.TabIndex = 14
Me.Label5.Text =附加目标."
''
''CboAccount
''
Me.CboAccount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboAccount.FormattingEnabled = True
Me.CboAccount.Location =新的System.Drawing.Point(324,15)
Me.CboAccount.Name ="CboAccount"
Me.CboAccount.Size =新的System.Drawing.Size(160,21)
Me.CboAccount.TabIndex = 15
''
''CmdVnet
''
Me.CmdVnet.Location =新的System.Drawing.Point(679,14)
Me.CmdVnet.Name ="CmdVnet"
Me.CmdVnet.Size =新的System.Drawing.Size(113,20)
Me.CmdVnet.TabIndex = 16
Me.CmdVnet.Text =版本.net"
Me.CmdVnet.UseVisualStyleBackColor = True
''
''Form1
''
Me.AutoScaleDimensions =新的System.Drawing.SizeF(6.0 !, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize =新的System.Drawing.Size(884,262)
Me.Controls.Add(Me.CmdVnet)
Me.Controls.Add(Me.CboAccount)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.TxtAttDest)
Me.Controls.Add(Me.ChbReset)
Me.Controls.Add(Me.ChbSSL)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.TxtPort)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.TxtHostname)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TxtCounter)
Me.Controls.Add(Me.CmdGetM)
Me.Controls.Add(Me.gvEmails)
Me.Icon = CType(resources.GetObject("
Can anyone help me with vb code to retrieve email attachments with pop3. I manage to read the mails, but not to download and save any attachments. (i am not looking for dll''s that are under purchase license)
> i need vb code (and i do not know how to change C#-code into vb... -> it''s sergey who suggested sollutions in C#)
解决方案
For example, this one: http://sourceforge.net/projects/systemnetpop3/[^].
See also: http://sourceforge.net/directory/communications/email/postoffice/pop3/os:windows/freshness:recently-updated/[^].
This CodeProject article can also be useful: A POP3 Client in C# .NET[^].
—SA
Well, what you do yourself is mostly ... and so i could find some bits & peaces... for those who might be interested: here's the result & it works! ->gvMail is a gridvieuw ;): <pre lang="vb"> Imports OpenPop.Pop3 Imports OpenPop.Mime Imports System.io Public Class Form1 Dim SSL As Boolean Dim PopHost As String Dim UserName As String Dim WW As String Dim PortNm As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load PopHost = "pop.gmail.com" PortNm = 995 WW = "password" UserName = someone@gmail.com TxtHostname.Text = PopHost CboAccount.Text = UserName TxtPort.Text = PortNm End Sub Private Sub CmdGetM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdGetM.Click If ChbSSL.Checked = True Then SSL = True Else SSL = False End If Me.Read_Emails() End Sub Private Sub Read_Emails() Me.Cursor = Cursors.WaitCursor Dim pop3Client As Pop3Client pop3Client = New Pop3Client() pop3Client.Connect(PopHost, Val(PortNm), SSL) If pop3Client.Connected = False Then TxtCounter.BackColor = Color.Red Else TxtCounter.BackColor = Color.LightGreen pop3Client.Authenticate(UserName, WW, AuthenticationMethod.UsernameAndPassword) If ChbReset.Checked = True Then pop3Client.Reset() Dim count As Integer = pop3Client.GetMessageCount() TxtCounter.Text = count TxtCounter.Update() Dim Email(7) As String, GvIndex As Integer = -1, message As Message For i As Integer = count To 1 Step -1 TxtCounter.Text = GvIndex + 2 & "/" & count TxtCounter.Update() message = pop3Client.GetMessage(i) Email(1) = i 'MessageNumber Email(2) = message.Headers.Subject.ToString Email(3) = message.Headers.DateSent.ToString Email(4) = message.Headers.From.DisplayName.ToString & "(" & message.Headers.From.Address.ToString & ")" Email(5) = "" If message.Headers.To.Count > 0 Then Email(5) = Email(5) & "TO:" & vbCrLf For Each tomailaddress As OpenPop.Mime.Header.RfcMailAddress In message.Headers.To Email(5) = Email(5) & tomailaddress.Address & vbCrLf Next End If If message.Headers.Cc.Count > 0 Then Email(5) = Email(5) & "CC:" & vbCrLf For Each ccmailaddress As OpenPop.Mime.Header.RfcMailAddress In message.Headers.Cc Email(5) = Email(5) & ccmailaddress.Address & vbCrLf Next End If If message.Headers.Bcc.Count > 0 Then Email(5) = Email(5) & "BCC:" & vbCrLf For Each bccmailaddress As OpenPop.Mime.Header.RfcMailAddress In message.Headers.Bcc Email(5) = Email(5) & bccmailaddress.Address & vbCrLf Next End If Dim body As MessagePart = message.FindFirstHtmlVersion() If body IsNot Nothing Then Email(6) = body.GetBodyAsText() Else body = message.FindFirstPlainTextVersion() If body IsNot Nothing Then Email(6) = body.GetBodyAsText() End If End If Dim attachments As List(Of MessagePart) = message.FindAllAttachments() Email(7) = "" For Each attachment As MessagePart In attachments If Email(7) = "" Then Email(7) = Email(7) & attachment.FileName Else Email(7) = Email(7) & vbCrLf & attachment.FileName End If 'Dim ContentID As String = attachment.ContentId 'If this is set then the attachment is inline. 'Dim ContentType As String = attachment.ContentType.MediaType 'type of attachment pdf, jpg, png, etc. File.WriteAllBytes(TxtAttDest.Text & attachment.FileName.ToString, attachment.Body) '//overwrites MessagePart.Body with attachment Next gvEmails.Rows.Add() GvIndex = GvIndex + 1 gvEmails.Item(0, GvIndex).Value = Email(1) gvEmails.Item(1, GvIndex).Value = Email(2) gvEmails.Item(2, GvIndex).Value = Email(3) gvEmails.Item(3, GvIndex).Value = Email(4) gvEmails.Item(4, GvIndex).Value = Email(5) gvEmails.Item(5, GvIndex).Value = Email(6) gvEmails.Item(6, GvIndex).Value = Email(7) Next pop3Client.Disconnect() End If Me.Cursor = Cursors.Default End Sub End Class
here''s the form i used to test the code:
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
''Form overrides dispose to clean up the component list.
<system.diagnostics.debuggernonusercode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
''Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
''NOTE: The following procedure is required by the Windows Form Designer
''It can be modified using the Windows Form Designer.
''Do not modify it using the code editor.
<system.diagnostics.debuggerstepthrough()> _
Private Sub InitializeComponent()
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.gvEmails = New System.Windows.Forms.DataGridView
Me.MsgNr = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.Subject = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.Datesent = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.from = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.Dest = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.Body = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.Attach = New System.Windows.Forms.DataGridViewTextBoxColumn
Me.CmdGetM = New System.Windows.Forms.Button
Me.TxtCounter = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.TxtHostname = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.TxtPort = New System.Windows.Forms.TextBox
Me.ChbSSL = New System.Windows.Forms.CheckBox
Me.ChbReset = New System.Windows.Forms.CheckBox
Me.TxtAttDest = New System.Windows.Forms.TextBox
Me.Label5 = New System.Windows.Forms.Label
Me.CboAccount = New System.Windows.Forms.ComboBox
Me.CmdVnet = New System.Windows.Forms.Button
CType(Me.gvEmails, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
''
''gvEmails
''
Me.gvEmails.AllowUserToAddRows = False
Me.gvEmails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.gvEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.gvEmails.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.MsgNr, Me.Subject, Me.Datesent, Me.from, Me.Dest, Me.Body, Me.Attach})
Me.gvEmails.Location = New System.Drawing.Point(30, 102)
Me.gvEmails.Name = "gvEmails"
Me.gvEmails.Size = New System.Drawing.Size(834, 148)
Me.gvEmails.TabIndex = 0
''
''MsgNr
''
DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter
Me.MsgNr.DefaultCellStyle = DataGridViewCellStyle1
Me.MsgNr.HeaderText = "MsgNr"
Me.MsgNr.Name = "MsgNr"
''
''Subject
''
DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.Subject.DefaultCellStyle = DataGridViewCellStyle2
Me.Subject.HeaderText = "Subject"
Me.Subject.Name = "Subject"
''
''Datesent
''
DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
Me.Datesent.DefaultCellStyle = DataGridViewCellStyle3
Me.Datesent.HeaderText = "Date Sent"
Me.Datesent.Name = "Datesent"
''
''from
''
DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
Me.from.DefaultCellStyle = DataGridViewCellStyle4
Me.from.HeaderText = "From"
Me.from.Name = "from"
''
''Dest
''
DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.Dest.DefaultCellStyle = DataGridViewCellStyle5
Me.Dest.HeaderText = "Dest."
Me.Dest.Name = "Dest"
Me.Dest.Width = 250
''
''Body
''
DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.Body.DefaultCellStyle = DataGridViewCellStyle6
Me.Body.HeaderText = "Content"
Me.Body.Name = "Body"
Me.Body.Width = 250
''
''Attach
''
DataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft
DataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.Attach.DefaultCellStyle = DataGridViewCellStyle7
Me.Attach.HeaderText = "Attachment(s)"
Me.Attach.Name = "Attach"
''
''CmdGetM
''
Me.CmdGetM.Enabled = False
Me.CmdGetM.Location = New System.Drawing.Point(527, 15)
Me.CmdGetM.Name = "CmdGetM"
Me.CmdGetM.Size = New System.Drawing.Size(113, 20)
Me.CmdGetM.TabIndex = 1
Me.CmdGetM.Text = "Get Mails"
Me.CmdGetM.UseVisualStyleBackColor = True
''
''TxtCounter
''
Me.TxtCounter.Location = New System.Drawing.Point(527, 42)
Me.TxtCounter.Name = "TxtCounter"
Me.TxtCounter.ReadOnly = True
Me.TxtCounter.Size = New System.Drawing.Size(113, 20)
Me.TxtCounter.TabIndex = 2
Me.TxtCounter.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
''
''Label1
''
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(272, 18)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(47, 13)
Me.Label1.TabIndex = 5
Me.Label1.Text = "Account"
''
''Label3
''
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(31, 18)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(55, 13)
Me.Label3.TabIndex = 8
Me.Label3.Text = "Hostname"
''
''TxtHostname
''
Me.TxtHostname.Location = New System.Drawing.Point(92, 15)
Me.TxtHostname.Name = "TxtHostname"
Me.TxtHostname.ReadOnly = True
Me.TxtHostname.Size = New System.Drawing.Size(151, 20)
Me.TxtHostname.TabIndex = 7
''
''Label4
''
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(31, 44)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(26, 13)
Me.Label4.TabIndex = 10
Me.Label4.Text = "Port"
''
''TxtPort
''
Me.TxtPort.Location = New System.Drawing.Point(92, 41)
Me.TxtPort.Name = "TxtPort"
Me.TxtPort.ReadOnly = True
Me.TxtPort.Size = New System.Drawing.Size(70, 20)
Me.TxtPort.TabIndex = 9
''
''ChbSSL
''
Me.ChbSSL.AutoSize = True
Me.ChbSSL.Checked = True
Me.ChbSSL.CheckState = System.Windows.Forms.CheckState.Checked
Me.ChbSSL.Location = New System.Drawing.Point(197, 44)
Me.ChbSSL.Name = "ChbSSL"
Me.ChbSSL.Size = New System.Drawing.Size(46, 17)
Me.ChbSSL.TabIndex = 11
Me.ChbSSL.Text = "SSL"
Me.ChbSSL.UseVisualStyleBackColor = True
''
''ChbReset
''
Me.ChbReset.AutoSize = True
Me.ChbReset.Checked = True
Me.ChbReset.CheckState = System.Windows.Forms.CheckState.Checked
Me.ChbReset.Location = New System.Drawing.Point(275, 71)
Me.ChbReset.Name = "ChbReset"
Me.ChbReset.Size = New System.Drawing.Size(128, 17)
Me.ChbReset.TabIndex = 12
Me.ChbReset.Text = "Reset Mails on server"
Me.ChbReset.UseVisualStyleBackColor = True
''
''TxtAttDest
''
Me.TxtAttDest.Location = New System.Drawing.Point(106, 72)
Me.TxtAttDest.Name = "TxtAttDest"
Me.TxtAttDest.Size = New System.Drawing.Size(137, 20)
Me.TxtAttDest.TabIndex = 13
Me.TxtAttDest.Text = "C:\Temp\"
''
''Label5
''
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(31, 75)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(69, 13)
Me.Label5.TabIndex = 14
Me.Label5.Text = "Attach. Dest."
''
''CboAccount
''
Me.CboAccount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboAccount.FormattingEnabled = True
Me.CboAccount.Location = New System.Drawing.Point(324, 15)
Me.CboAccount.Name = "CboAccount"
Me.CboAccount.Size = New System.Drawing.Size(160, 21)
Me.CboAccount.TabIndex = 15
''
''CmdVnet
''
Me.CmdVnet.Location = New System.Drawing.Point(679, 14)
Me.CmdVnet.Name = "CmdVnet"
Me.CmdVnet.Size = New System.Drawing.Size(113, 20)
Me.CmdVnet.TabIndex = 16
Me.CmdVnet.Text = "Version .net"
Me.CmdVnet.UseVisualStyleBackColor = True
''
''Form1
''
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(884, 262)
Me.Controls.Add(Me.CmdVnet)
Me.Controls.Add(Me.CboAccount)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.TxtAttDest)
Me.Controls.Add(Me.ChbReset)
Me.Controls.Add(Me.ChbSSL)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.TxtPort)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.TxtHostname)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TxtCounter)
Me.Controls.Add(Me.CmdGetM)
Me.Controls.Add(Me.gvEmails)
Me.Icon = CType(resources.GetObject("
这篇关于pop3邮件检索附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文