Visual Studio .NET - Accessing Web Client

Asked By Sriram Ethiraj
31-Dec-05 07:32 AM
hi iam using asp.net try to accsess webclient 

     Dim url As String = String.Empty
       url = "https://www.liveMeeting.com/cc/lmtrial2005/xml/4.0/GetPostingURLRequest"
       

        Try
            Dim wc As WebClient = New WebClient
            Dim output As Byte() = wc.DownloadData(url)
            Response.Write(System.Text.Encoding.UTF8.GetString(output, 0, output.Length))
        Catch ex As Exception
            Response.Write(ex.ToString())
        End Try



Iam getting the following Exception 

System.Net.WebException: The underlying connection was closed: 
Unable to connect to the remote server. at System.Net.HttpWebRequest.CheckFinalStatus() 
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 
at System.Net.HttpWebRequest.GetResponse() 
at System.Net.WebClient.DownloadData(String address) 
at TestDemo.WebForm1.Button2_Click(Object sender, EventArgs e) 
in c:\inetpub\wwwroot\TestDemo\WebForm1.aspx.vb:line 133 

do i have to set any special  permission ? or need to set any configruation.
iam unlucky in my google search.

Pls Help

Need to Setup Web Proxy  Need to Setup Web Proxy

01-Jan-06 11:55 PM
Asp.net requires Proxy information to process the request.


       Try
            Dim d1 As System.Net.WebProxy
            d1 = New System.Net.WebProxy("172.16.1.100", 3128)
            Dim lcUrl As String = "https://www.liveMeeting.com/cc/lmtrial2005/xml/4.0/GetPostingURLRequest"
            Dim loHttp As HttpWebRequest = CType(WebRequest.Create(lcUrl), HttpWebRequest)
            loHttp.Proxy = d1
            loHttp.Method = "GET"

            Dim loWebResponse As HttpWebResponse = CType(loHttp.GetResponse, HttpWebResponse)

            Dim enc As Encoding = System.Text.Encoding.GetEncoding(1252)

            Dim loResponseStream As StreamReader = New StreamReader(loWebResponse.GetResponseStream, enc)

            Dim lcHtml As String = loResponseStream.ReadToEnd

            loWebResponse.Close()

            loResponseStream.Close()
        Catch ex As Exception
            Response.Write(ex.ToString())
        End Try



 d1 = New System.Net.WebProxy("172.16.1.100", 3128)

172.16.1.100 = Proxy Server
3128 - Port.

thats all it works fine
Create New Account
help
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not