![]()
|
|
Visual Basic Quellcode |
1 2 |
Dim Messages As New List(Of String) Dim AttachArray As New ArrayList |
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim pop3 As New POPClient pop3.Disconnect() pop3.Connect("pop.host.de", 110) pop3.Authenticate("benutzeraccount", "benutzerpasswort") ListBox1.Items.Clear() For i As Integer = 1 To pop3.GetMessageCount Dim m As MIMEParser.Message = pop3.GetMessage(i, False) ListBox1.Items.Add("From: " & m.From & " <" & m.FromEmail & "> - " & m.Subject) If m.MessageBody.Count > 0 Then Dim Attach As New List(Of MIMEParser.Attachment) Messages.Add(m.MessageBody(m.MessageBody.Count - 1)) For ii As Integer = 1 To m.AttachmentCount - 1 Attach.Add(m.GetAttachment(ii)) Next AttachArray.Add(Attach) End If ' pop3.DeleteMessage(i) ' Wenn die Message nach abholung gelöscht werden soll Next pop3.Disconnect() End Sub |
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 |
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As ListBox, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged TextBox1.Text = Messages(sender.SelectedIndex) ListBox2.Items.Clear() For Each att As MIMEParser.Attachment In AttachArray(sender.SelectedIndex) ListBox2.Items.Add(att.ContentFileName & " " & att.ContentLength & " Byte") Next End Sub |
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Private Sub ListBox2_SelectedIndexChanged(ByVal sender As ListBox, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged Dim att As MIMEParser.Attachment = AttachArray(ListBox1.SelectedIndex)(sender.SelectedIndex) Dim fs As FileStream = File.Create(Application.StartupPath & "/attach/" & att.ContentFileName) Dim da() As Byte da = att.DecodedAttachment fs.Write(da, 0, da.Length) MsgBox("'" & att.ContentFileName & "' wurde gespeichert!") fs.Close() End Sub |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
String m.AttachmentBoundry String m.AttachmentBoundry2 Integer m.AttachmentCount Array(Of String) m.BCC Array(Of String) m.CC Array(Of String m.TO String m.ContentEncoding String m.ContentType String m.From String m.FromEmail Boolean m.HasAttachment String m.MessageID String m.Subject String m.Date String m.Received Boolean m.HTML String m.Importance String m.ReplyTo String m.ReplyToEmail Function(att As MIME.Parser.Attachment, Filename) m.SaveAttachment Function(Path) m.SacheAttachments |
Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »Dodo« (22. Juli 2009, 07:42)
Benutzerinformationen überspringen
Dabei seit: 30. November 2008
Wohnort: Attendorn / Sauerland / NRW
Benutzerinformationen überspringen
Dabei seit: 29. November 2007
Wohnort: wieder im schönen Oberschwaben...
Frühere Benutzernamen: powerprogger
.
das Programm hängt sich beim laden IMMER auf.
. |
|
Visual Basic Quellcode |
1 |
TextBox1.Text = Messages(sender.SelectedIndex)
|
Zitat
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{pageection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hallo Welt<o:p></o:p></p>
</div>
</body>
</html>
Zitat
17:42: Es funzt einfach nicht...
17:47: Habe den Fehler gefunden - meine Frau war's
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »Croasider« (7. Mai 2010, 10:28)
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »vbExtremeFan« (10. Mai 2010, 18:54)
) nur die ungelesenen E-Mails abrufen...