Freeware
Programme
VB-Bibliotheken
VB-Sourcecode Tipps&Tricks
|
|
|
|
Internet-Programmierung unter VB
Client-Klassen
Beispiel-Code
HTTP-Client
Folgender Code ruft eine HTTP-Seite ab:
Dim http As New HttpClient
http.GetDocument "http://www.microsoft.com/"
Text1.Text = http.Document
|
Folgender Code speichert eine HTTP-Seite ab:
Dim http As New HttpClient
http.GetFile "http://www.microsoft.com/", "ms.html"
|
benötigt zusätzlich aus dem Download-Paket:
Socket.cls
Socket.bas
HttpClient.cls
FTP-Client
Folgender Code ruft eine FTP-Seite ab:
Dim ftp As New FtpClient
If ftp.Connect("ftp.microsoft.com", "anonymous", "anonymous@anonymous.com") Then
Text1.Text = ftp.GetDocument("/Softlib/index.txt")
'oder: ftp.GetFile "/Softlib/index.txt", "liste.txt"
ftp.Disconnect
Else
MsgBox "cannot connect"
End If
|
benötigt zusätzlich aus dem Download-Paket:
Socket.cls
Socket.bas
FtpClient.cls
SMPT-Client
Folgender Code versendet eine EMail:
Dim smtp As New SmtpClient
smtp.From = "test@thfu.de"
If smtp.Connect("smtp.puretec.de") Then
smtp.SendMail "test@fuessl.de", "Subject", "Mailtext..." + vbCrLf + "Thomas."
smtp.Disconnect
Else
MsgBox "cannot connect"
End If
|
benötigt zusätzlich aus dem Download-Paket:
Socket.cls
Socket.bas
SmtpClient.cls
POP-Client
Folgender Code ruft den Posteingang am POP-Server ab:
Dim pop As New PopClient
If pop.Connect("pop.xxxxx.de", "account", "passwd") Then
If pop.GetMails Then
For n% = 1 To pop.MessageCount
List1.AddItem pop.MessageDate(n%) + " " + pop.MessageFrom(n%) + " " + pop.MessageSubject(n%)
Next
End If
pop.Disconnect
End If
|
benötigt zusätzlich aus dem Download-Paket:
Socket.cls
Socket.bas
PopClient.cls
NNTP-Client
Folgender Code listet alle Newsgruppen eines News-Servers:
Private WithEvents nntp As NntpClient
Sub ListGroups()
Set nntp = New NntpClient
If nntp.Connect("news.heise.de") Then
nntp.GetAllGroups()
nntp.Disconnect
Else
MsgBox "cannot connect"
End If
Set nntp = Nothing
End Sub
Sub nntp_ListGroups(Group As String)
List1.AddItem Group
End Sub
|
benötigt zusätzlich aus dem Download-Paket:
Socket.cls
Socket.bas
NntpClient.cls
|
|