Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Download a UTF-8 text file, and display the contents.
//Download a UTF-8 text file, and display the contents. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Net; using System.IO; namespace Rextester { public class Program { public static void Main(string[] args) { string in_url = Console.ReadLine(); using (WebClient wc = new WebClient()) { wc.Headers.Add("User-Agent", "desktop"); byte[] data; try { data = wc.DownloadData(in_url); string text = Encoding.UTF8.GetString(data); Console.WriteLine(text); } catch (WebException ex) { if (ex.Response != null) { using (var reader = new StreamReader(ex.Response.GetResponseStream())) { Console.WriteLine(reader.ReadToEnd()); } } else { Console.WriteLine("Network error: " + ex.Status); } } } } } }
run
|
edit
|
history
|
help
2
File_operations
Write a program to filter distinct items from the array
Events
Fórum ➡ Get all combinations for ▶different◀ Id's ♦
olution to problem #2 from projecteuler.net
Intuit // C# // Lecture_4 // Laba_#1
Computing Time Zone Different
Project Euler Problem 10
OddEven
Cs