tengo el siguiente codigo:
System.NullReferenceException
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim proxyObject As New System.Net.WebProxy("http://172.20.1.9:8080", True)
Dim uri As New Uri("http://172.20.1.238/htfs0/NBossLog.txt")
Dim wreq As HttpWebRequest
wreq.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials() wreq.Proxy = proxyObject
wreq = CType(WebRequest.Create(uri), HttpWebRequest)
Dim cr As New System.Net.NetworkCredential("user", "password")
wreq.Credentials = cr
wreq.PreAuthenticate = True
wreq.Proxy.Credentials = cr
Dim wresp As WebResponse
Try
wresp = wreq.GetResponse
Dim s As Stream = wresp.GetResponseStream
Dim br As New BinaryReader(s)
MsgBox(s.Length, , "File Length")
Catch wex As WebException
Debug.WriteLine("Message: " & wex.Message)
Debug.WriteLine("Response: " & wex.Response.GetResponseStream.ToString)
Debug.WriteLine("ResponseURI: " & wex.Response.ResponseUri.ToString)
Debug.WriteLine("Source: " & wex.Source.ToString)
Debug.WriteLine("Status: " & wex.Status.ToString)
Catch ex As Exception
End Try
End Sub
End Class
pero en la linea que tengo remarcada me da el siguiente problema:
System.NullReferenceException
soy un poco nuevo en .net, porfa ayudenme, no se de que se trata ese error.gracias