Permalink
Browse files

consistency fixes.

  • Loading branch information...
1 parent 270e474 commit 46541b8a2fa0e4e41aadf04dc1d6092984ff7e89 @ArcadeRenegade committed Oct 30, 2016
Showing with 6 additions and 4 deletions.
  1. +6 −4 SidebarDiagnostics/Monitoring.cs
@@ -5,8 +5,9 @@
using System.Diagnostics;
using System.Linq;
using System.IO;
-using System.Net.NetworkInformation;
using System.Net;
+using System.Net.Http;
+using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Windows.Threading;
@@ -970,8 +971,6 @@ protected override void Dispose(bool disposing)
public static IEnumerable<HardwareConfig> GetHardware()
{
- Regex _regex = new Regex("^[A-Z]:$");
-
string[] _instances;
try
@@ -985,6 +984,8 @@ public static IEnumerable<HardwareConfig> GetHardware()
App.ShowPerformanceCounterError();
}
+ Regex _regex = new Regex("^[A-Z]:$");
+
return _instances.Where(n => _regex.IsMatch(n)).OrderBy(d => d[0]).Select(h => new HardwareConfig() { ID = h, Name = h, ActualName = h });
}
@@ -1285,7 +1286,8 @@ private static string GetExternalIPAddress()
{
try
{
- HttpWebRequest _request = (HttpWebRequest)WebRequest.Create(Constants.URLs.IPIFY);
+ HttpWebRequest _request = WebRequest.CreateHttp(Constants.URLs.IPIFY);
+ _request.Method = HttpMethod.Get.Method;
_request.Timeout = 5000;
using (HttpWebResponse _response = (HttpWebResponse)_request.GetResponse())

0 comments on commit 46541b8

Please sign in to comment.