This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > September 2005 > HOW to solve ... System.Net.WebException: Connection closed





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HOW to solve ... System.Net.WebException: Connection closed
etantonio@gmail.com

2005-09-30, 3:17 am

Good morning, I've a problem, in the past I translate my site from
google or altavista with a code similar to this :

<%@ Page Language="c#" Trace="true" Debug="true" %>
<%@ import Namespace="System.Net" %>
<%@ import Namespace="System.IO" %>
<script runat="server">
void Page_Load(Object Src, EventArgs E )
{
if (!Page.IsPostBack)
{
String sAddressTime =
"http://translate.google.com/translate?u=http%3A%2F%2Fwww.etantonio.it%2FIT%2FUniversita%2FMasterSatellitare%2F&langpair=it%7Cen&hl=en&ie=UTF-8&c2coff=1&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools";

WebRequest req = WebRequest.Create(sAddressTime);
WebResponse result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
StreamReader reader = new StreamReader(ReceiveStream,
Encoding.ASCII);
String respHTML = reader.ReadToEnd();
Trace.Write("respHTML",respHTML);
}
}
</script>


Now this seems no more possible and the answer is

System.Net.WebException: Connection closed: Impossibile
impossible to connect to remote server

while if I directly insert the url in a browser

http://translate.google.com/transla...Flanguage_tools

I've the page correctly translated, there is a way to solve this my
problem ?? Many thanks.

Antonio

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews