ciao a tutti
come da titolo io vorrei fare una richiesta download da httpweb request
con credentiali user e pass
dovrei downloader un imagine
in ftb il codice l avevo gia messo a punto ed è questo ma con http non riesco a sviluppare
il codice
Try
Dim uri As New Uri("ftp://" & TextBox2.Text & "/var/php.***")
If TextBox2.Text = "" Then
MsgBox("Please Enter Ip, User, Pass")
ElseIf TextBox3.Text = "" Then
MsgBox("Please Enter Ip, User, Pass")
ElseIf TextBox4.Text = "" Then
MsgBox("Please Enter Ip, User, Pass")
Dim request As WebRequest = WebRequest.Create(uri)
request.Method = WebRequestMethods.Http.Connect
request.Credentials = New NetworkCredential(TextBox3.Text, TextBox4.Text)
request.Timeout = 5000
request.Proxy = Nothing
Dim response As FtpWebResponse = request.GetResponse()
Dim reader As New StreamReader(response.GetResponseStream())
Dim tmp As String = reader.ReadToEnd()
response.Close()
RichTextBox1.Text = tmp
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox4.Enabled = False
Button5.Enabled = True
CheckBox2.Enabled = True
CheckBox3.Enabled = True
CheckBox4.Enabled = True
End If