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
Test
pasar de binario a decimal
Binary Hex Decimal Systems
ingresar datos por teclado
Numerical string to fancy graphical output
JAVA HELLO
Typeing
Метод catch b try в словарях
Chris Kasongo Lazarius Mukengeshayi "Entelect BlackJack 21"
Herencias