Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Get a webpage - the sync way
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Net; using System.Threading.Tasks; using System.Threading; namespace Rextester { public class Program { public static void Main(string[] args) { ThreadPool.QueueUserWorkItem(f => RequestData("http://google.com")); Thread.Sleep(2000); } static void RequestData(string uri) { using (var client = new WebClient()) { Console.WriteLine(System.Threading.Thread.CurrentThread.ManagedThreadId); Console.WriteLine(client.DownloadString(uri)); Console.WriteLine(System.Threading.Thread.CurrentThread.ManagedThreadId); //note - same thread } } } }
run
|
edit
|
history
|
help
0
2.10.4
loop break continue
What is the best way to iterate over a Dictionary in C#?
addr.sin_family == AF_UNSPEC
Uri builder
Sample
Execution flow of static and normal constructor of base and derived class.
Fórum ➡ Get all combinations for ▶different◀ Id's ( GroupBy version ) ♦
xml
a6