[tut]how to get website source using HttpWebRequest in c#
All tutorials created in C# to be posted in here.
3 posts
Page 1 of 1
hello guys 
i am up with a tutorial after a longtime so this is my first tutorial in c# and i am so happy to write this here
so lets start off
you need a button , textbox and a richtextbox
add this namespaces
thanks for reading

i am up with a tutorial after a longtime so this is my first tutorial in c# and i am so happy to write this here
so lets start off
you need a button , textbox and a richtextbox
add this namespaces
Code: Select all
add this to button 1
using System.Net;
using System.IO;
Code: Select all
now your done :P :P
string url = textBox1.Text; //string textbox
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); //make request
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); //new response
StreamReader sr = New StreamReader(response.GetResponseStream()); //stream reader
richTextBox1.Text = sr.ReadToEnd(); //sr.readtoend
sr.Close();
thanks for reading
Find my programs on Softpedia
ok?
question?
what does this do?
and
how can it be used in or with my projects?
question?
what does this do?
and
how can it be used in or with my projects?
Scottie1972 wrote:ok?i am kinda new to c# and this will get the source of website using HttpWebRequest
question?
what does this do?
and
how can it be used in or with my projects?
Find my programs on Softpedia
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023