主题:大家帮忙看下我的问题怎么解决,有人遇到过吗?
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myHttpWebRequest As HttpWebRequest
Dim myHttpWebResponse As HttpWebResponse
Try
Dim URL As String = textBox1.Text
Dim myUri As Uri = New Uri(textBox1.Text)
Dim myWebRequest As WebRequest = WebRequest.Create(URL)
'使用Creat方法创建WebRequest实例
myHttpWebRequest = CType(myWebRequest, HttpWebRequest)
'实现WebRequest类型和HttpWebRequest类型的转换
Dim myWebResponse As WebResponse = myHttpWebRequest.GetResponse()
'获得响应信息
myHttpWebResponse = CType(myWebResponse, HttpWebResponse)
Dim myStream As Stream = myHttpWebResponse.GetResponseStream()
'获得从当前Internet资源返回的响应流数据
Dim srReader As StreamReader = New StreamReader(myStream, System.Text.Encoding.Default)
'利用获得的响应流和系统缺省编码来初始化StreamReader实例。
Dim sTemp As String = srReader.ReadToEnd()
'从响应流从读取数据
srReader.Close()
richTextBox1.Text = sTemp
'显示读取的数据 ( )
Catch WebExcp As WebException
MessageBox.Show(WebExcp.Message.ToString())
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End Sub
End Class
The remote server returned an error: (407) Proxy Authentication Required.
这个错误怎么解决啊!
[em18][em18][em18]
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myHttpWebRequest As HttpWebRequest
Dim myHttpWebResponse As HttpWebResponse
Try
Dim URL As String = textBox1.Text
Dim myUri As Uri = New Uri(textBox1.Text)
Dim myWebRequest As WebRequest = WebRequest.Create(URL)
'使用Creat方法创建WebRequest实例
myHttpWebRequest = CType(myWebRequest, HttpWebRequest)
'实现WebRequest类型和HttpWebRequest类型的转换
Dim myWebResponse As WebResponse = myHttpWebRequest.GetResponse()
'获得响应信息
myHttpWebResponse = CType(myWebResponse, HttpWebResponse)
Dim myStream As Stream = myHttpWebResponse.GetResponseStream()
'获得从当前Internet资源返回的响应流数据
Dim srReader As StreamReader = New StreamReader(myStream, System.Text.Encoding.Default)
'利用获得的响应流和系统缺省编码来初始化StreamReader实例。
Dim sTemp As String = srReader.ReadToEnd()
'从响应流从读取数据
srReader.Close()
richTextBox1.Text = sTemp
'显示读取的数据 ( )
Catch WebExcp As WebException
MessageBox.Show(WebExcp.Message.ToString())
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End Sub
End Class
The remote server returned an error: (407) Proxy Authentication Required.
这个错误怎么解决啊!
[em18][em18][em18]