Browse Source

Fix depreciation warning about WebClient: Use HttpClient instead.

pull/2650/head
Siegfried Pammer 3 years ago
parent
commit
173759d554
  1. 12
      ILSpy/AboutPage.cs

12
ILSpy/AboutPage.cs

@ -20,7 +20,7 @@ using System;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net.Http;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@ -199,12 +199,10 @@ namespace ICSharpCode.ILSpy
static async Task<AvailableVersionInfo> GetLatestVersionAsync() static async Task<AvailableVersionInfo> GetLatestVersionAsync()
{ {
WebClient wc = new WebClient(); var client = new HttpClient(new HttpClientHandler() {
IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy(); UseProxy = true,
systemWebProxy.Credentials = CredentialCache.DefaultCredentials; });
wc.Proxy = systemWebProxy; string data = await client.GetStringAsync(UpdateUrl);
string data = await wc.DownloadStringTaskAsync(UpdateUrl);
XDocument doc = XDocument.Load(new StringReader(data)); XDocument doc = XDocument.Load(new StringReader(data));
var bands = doc.Root.Elements("band"); var bands = doc.Root.Elements("band");

Loading…
Cancel
Save