Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Net;
- using System.IO;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- string getHtml(string url)
- {
- HttpWebRequest WebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
- WebRequest.Method = "GET";
- HttpWebResponse myWebResponse = (HttpWebResponse)WebRequest.GetResponse();
- StreamReader Source = new StreamReader(myWebResponse.GetResponseStream());
- string resp = string.Empty;
- resp= Source.ReadToEnd();
- myWebResponse.Close();
- return resp;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- textBox1.Text = getHtml("http://google.com.br");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment