/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
try { var transferRequest = WebRequest.Create("http://www.snipplr.com"); transferRequest.Proxy = transferProxy; HttpWebResponse transferResponse = (HttpWebResponse)transferRequest.GetResponse(); System.IO.Stream outputStream = transferResponse.GetResponseStream(); System.Text.Encoding outputEncoding = System.Text.Encoding.GetEncoding("utf-8"); int readCount = outputReader.Read(chars, 0, 256); int totalRead = readCount; while(readCount > 0) { result.Append(str); readCount = outputReader.Read(chars, 0, 256); } transferResponse.Close(); outputStream.Close(); outputReader.Close(); } catch(Exception ex) { string str = ex.Message; } fileOut.WriteLine(result.ToString()); fileOut.Close();