Advertisement
Dennisaa

WebClient 001

Jan 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. {
  2.     "version": "0.0.1-*",
  3.     "description": "Quick app to exercise a few .NET things",
  4.     "dependencies": {
  5.     },
  6.     "commands": {
  7.         "run": "run"
  8.     },
  9.     "configurations": {
  10.         "Debug": {
  11.             "compilationOptions": {
  12.                 "define": [
  13.                     "DEBUG"
  14.                 ]
  15.             }
  16.         }
  17.     },
  18.     "frameworks": {
  19.         "dnx451": {
  20.             "frameworkAssemblies": {
  21.                 "System.Xml":"4.0.0.0",
  22.                 "System.Xml.Linq":"4.0.0.0"
  23.             },
  24.             "dependencies": {
  25.                 "System.Runtime": "4.0.0.0",
  26.                   "System.Net.Http": "4.0.0.0",
  27.                   "System.Runtime.Extensions": "4.0.0.0"
  28.             }
  29.         }
  30.     }
  31. }
  32.  
  33. --
  34. using System;
  35. using System.Net;
  36.  
  37. namespace Examples.System.Net
  38. {
  39.     public class Program
  40.     {
  41.       static void Main(string[] args) {
  42.             var URL = "http://yada.co.uk";
  43.             var targetFile = @"c:\scratch\x3.html";
  44.            
  45.             using (WebClient client = new WebClient()) {
  46.                 client.DownloadFile(URL, targetFile);
  47.             }
  48.             Console.ReadLine();
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement