95e91fce8de2d9 1

How To Get The Source Code Of A Web Site Working With C# Programming Language

how to get the source code of a web site working with c# programming language

Go ahead and open up up your text editor or what ever you use to jot down your code in. On the initial line we must insert a reference.

working with System.Web;Now allows go on and make a course and put the leading statement in it.

using System.Internet;

class System

static void Primary(string args)

To create items wonderful and thoroughly clean lets go on and make a string identified as “url” and set in whatsoever url we wish to have the source code of. Then lets go ahead and use that While using the HttpWebRequest process.

making use of Method.Web;

class Application

static void Principal(string args)

string url = “http://www.quack ware.com”;

HttpWebRequest ask for = (HttpWebRequest)WebRequest.Produce(url);

Alright ended up performing excellent, now allows receive the response…

working with Program.Net

course Software

static void Main(string args)

string url = “http://www.quack ware.com”;

HttpWebRequest ask for = (HttpWebRequest)WebRequest.Generate(url);

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Given that we have the response we really need to simply call a StreamReader to read the response stream. We even have to add a reference to Method.IO to use the StreamReader.

using Method.Web;

using Procedure.IO;

class Application

static void Principal(string args)

string url = “http://www.quack ware.com”;

HttpWebRequest request = (HttpWebRequest)WebRequest.Produce(url);

HttpWebResponse reaction = (HttpWebResponse)request.GetResponse();

StreamReader sr = new StreamReader(reaction.GetResponseStream());

We’re almost finished. Now lets receive the supply code into string structure and shut the StreamReader…

utilizing Procedure.Net;

applying Program.IO;

course System

static void Major(string args)

string url = “http://www.quack ware.com”;

HttpWebRequest ask for = (HttpWebRequest)WebRequest.Generate(url);

HttpWebResponse reaction = (HttpWebResponse)request.GetResponse();

StreamReader sr = new StreamReader(reaction.GetResponseStream());

string soureCode = sr.ReadToEnd();

sr.Shut();

All done, now you may Show the string made up of the sourceCode and manipulate it even so you want!

how to get the source code of a web site working with c# programming language