.NET sucks - unhandled exception

Discussion in 'OT Technology' started by Slid., Jul 22, 2004.

  1. Slid.

    Slid. I'm a guy.

    Oct 25, 2001
    Likes Received:
    Okay, I installed Visual Studio .NET today - I bought it to make my life easier but it is just giving me a headache. I'm attempting to do something very simple - get the source from a webpage. If I can get the source I'll clean it up and turn it into an auto-updated for a program I want to write.

    I am coding in VB .NET.

    I am using this function:

        Private Function getSource(ByVal URL As String) As String
            'Set URL
            Dim objResponse As Net.WebResponse
            Dim objRequest As Net.WebRequest
            objRequest = Net.HttpWebRequest.Create(URL)
            objResponse = objRequest.GetResponse
            'Grab data from URL
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(objResponse.GetResponseStream())
            'return the source
            Return sr.ReadToEnd()
        End Function
    When I make a call to it I get this error:

    An unhandled exception of type 'System.NotSupportedException' occurred in system.dll
    Additional information: The ServicePointManager does not support proxies of file scheme.
    All I am doing is plopping that function down then making a call to it - I'm not adding any controls or references (should I be?) I've tried everything I can think of but it just won't work.

    Any ideas? This is really important 'cause I'm going to burn this software tomorrow.
  2. SLED

    SLED custom title

    Sep 20, 2001
    Likes Received:
    Put a TRY.... CATCH around your code and catch an error object of type Exception(), then look at it's properties to get more info. That should be your first step when debugging .NET code.

Share This Page