c# read a webpage data
WebClient client = new WebClient ();
// Add a user agent header in case the
// requested URI contains a query.
client.Headers.Add ("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
Stream data = client.OpenRead (args[0]);
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
Console.WriteLine (s);
data.Close ();
reader.Close ();
Also in C#:
- snake game
- c# check if type implements interface
- how to select time and date in datetimepicker in c#
- c# display float with 2 decimal places
- how to put double quotes in a string c#
- how to goto a website using linklabel c#
- null coalesce ternary c#
- tachyons
- C# resize window without title bar
- internal c#
- c# checksum
- datetitime contrusctor c#
- regex replace all special characters
- blazor onchange event not firing with inputselect
- condition when a animation finishes in unity
- c# null conditional
- web api startup add imemory cache object
- c# type of generic is string
- redirect to https codeigniter
- unity3d get component
- how to find the type of a object c#
- c# new thread
- Unity if object doens't exist
- c# loop string array