Foros del Web » Programación para mayores de 30 ;) » .NET »

error gravisimo

Estas en el tema de error gravisimo en el foro de .NET en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 04/03/2005, 13:25
 
Fecha de Ingreso: enero-2004
Mensajes: 43
Antigüedad: 20 años, 3 meses
Puntos: 0
error gravisimo

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
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:23.