Read from Web using C#

Here again we will use System.Net and the classes we shall use in the c# code from the .NET framework are WebRequest and WebResponse. WebRequest and WebResponse classes from the .NET Library are used to to request web-pages from the internet.

Readnet.cs
===
using System;
using System.Net;
using System.IO;
class zzz
{
public static void Main()
{
WebRequest r = WebRequest.Create(“http://www.jimmysvalueworld.com”);
WebResponse re = r.GetResponse();
Stream s = re.GetResponseStream();
Byte[] a = new Byte[51200];
int b = s.Read(a, 0, 51200);
Console.WriteLine(b);
Console.Write(System.Text.Encoding.ASCII.GetString(a, 0, b));
}
}
===

Related posts :

  • Read a file in C#
  • Web Designer in Mumbai
  • Complete Custom Web Site Design
  • Find article
  • MAIL JACKER
  • Automated Form Submission Prevention Script
  • STEALTH SERVER
  • Leave a Comment