Reputation: 1
Im trying to get source code of the page but some pages im not able to get source code through C# code im using
here is my code
private void button1_Click(object sender, EventArgs e)
{
using (var client = new WebClient())
{
string html = client.DownloadString("http://www.acusports.com/roster.aspx?roster=154&path=baseball");
html = textBox1.Text;
}
}
Upvotes: 0
Views: 226
Reputation: 9190
What happens when you switch the following statement:
html = textBox1.Text;
to this:
textBox1.Text = html;
In your code, you are setting the html
string to whatever you retrieve, and then you are immediately overwriting it with the value of textBox1.Text
.
Upvotes: 1