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
custom stack Implementation
static
test code
Determine if Two Words Are Anagrams of Each Other
Main4-4
eg
Recursion
Huy kaka
Multidimensional Arrays
diagonal