Hier ist ein komplettes Beispiel {TEIL1}:
Imports System.Net
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtUrl As System.Windows.Forms.TextBox
Friend WithEvents txtTarget As System.Windows.Forms.TextBox
Friend WithEvents btnChooseLocation As System.Windows.Forms.Button
Friend WithEvents btnDownload As System.Windows.Forms.Button
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents dlgSaveFile As System.Windows.Forms.SaveFileDialog
Friend WithEvents prgBar As System.Windows.Forms.ProgressBar
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txtUrl = New System.Windows.Forms.TextBox
Me.txtTarget = New System.Windows.Forms.TextBox
Me.btnChooseLocation = New System.Windows.Forms.Button
Me.btnDownload = New System.Windows.Forms.Button
Me.btnExit = New System.Windows.Forms.Button
Me.dlgSaveFile = New System.Windows.Forms.SaveFileDialog
Me.prgBar = New System.Windows.Forms.ProgressBar
Me.SuspendLayout()
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(60, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Datei-URL:"
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(40, 44)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(26, 13)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Ziel:"
Me.txtUrl.Location = New System.Drawing.Point(76, 12)
Me.txtUrl.Name = "txtUrl"
Me.txtUrl.Size = New System.Drawing.Size(364, 20)
Me.txtUrl.TabIndex = 2
Me.txtUrl.Text = ""
Me.txtTarget.Location = New System.Drawing.Point(76, 40)
Me.txtTarget.Name = "txtTarget"
Me.txtTarget.Size = New System.Drawing.Size(336, 20)
Me.txtTarget.TabIndex = 3
Me.txtTarget.Text = ""
Me.btnChooseLocation.Location = New System.Drawing.Point(412, 40)
Me.btnChooseLocation.Name = "btnChooseLocation"
Me.btnChooseLocation.Size = New System.Drawing.Size(28, 20)
Me.btnChooseLocation.TabIndex = 4
Me.btnChooseLocation.Text = "..."
Me.btnDownload.Location = New System.Drawing.Point(292, 96)
Me.btnDownload.Name = "btnDownload"
Me.btnDownload.TabIndex = 5
Me.btnDownload.Text = "Download"
Me.btnExit.Location = New System.Drawing.Point(376, 96)
Me.btnExit.Name = "btnExit"
Me.btnExit.TabIndex = 6
Me.btnExit.Text = "Beenden"
Me.dlgSaveFile.FileName = "doc1"
Me.prgBar.Location = New System.Drawing.Point(12, 96)
Me.prgBar.Name = "prgBar"
Me.prgBar.Size = New System.Drawing.Size(264, 23)
Me.prgBar.TabIndex = 7
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(468, 129)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.prgBar, _
Me.btnExit, Me.btnDownload, Me.btnChooseLocation, Me.txtTarget, _
Me.txtUrl, Me.Label2, Me.Label1})
Me.Name = "Form1"
Me.Text = "Datei aus dem Web downloaden"
Me.ResumeLayout(False)
End Sub Steve |