Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Source/NETworkManager/Helpers/RegexHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ public static class RegexHelper

// Match a IPv4-Address like 192.168.[50-100].1
public const string IPv4AddressSpecialRangeRegex = @"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|" + SpecialRangeRegex + @")\.){3}((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|" + SpecialRangeRegex + @")$";

// Test for http|https uris
public const string httpAndHttpsUriRegex = @"^http(s)?:\/\/([\w-]+.)+[\w-]+(\/[\w- ./?%&=])?$";
}
}
7 changes: 7 additions & 0 deletions Source/NETworkManager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ private async void MetroWindowMain_Closing(object sender, CancelEventArgs e)
RemoteDesktopView remoteDesktopView;
WakeOnLANView wakeOnLANView;
SubnetCalculatorView subnetCalculatorView;
HTTPHeadersView httpHeadersView;
ARPTableView arpTableView;
LookupView lookupView;

Expand Down Expand Up @@ -407,6 +408,12 @@ private void ChangeApplicationView(ApplicationViewManager.Name name)

contentControlApplication.Content = subnetCalculatorView;
break;
case ApplicationViewManager.Name.HTTPHeaders:
if (httpHeadersView == null)
httpHeadersView = new HTTPHeadersView();

contentControlApplication.Content = httpHeadersView;
break;
case ApplicationViewManager.Name.ARPTable:
if (arpTableView == null)
arpTableView = new ARPTableView();
Expand Down
23 changes: 23 additions & 0 deletions Source/NETworkManager/Models/Network/HTTPHeaders.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Net;
using System.Threading.Tasks;

namespace NETworkManager.Models.Network
{
public class HTTPHeaders
{
public static async Task<WebHeaderCollection> GetHeadersAsync(Uri uri)
{
WebHeaderCollection headers;

HttpWebRequest request = WebRequest.CreateHttp(uri);

using (HttpWebResponse response = (HttpWebResponse)(await request.GetResponseAsync().ConfigureAwait(false)))
{
headers = response.Headers;
}

return headers;
}
}
}
30 changes: 30 additions & 0 deletions Source/NETworkManager/Models/Settings/SettingsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,36 @@ public bool RemoteDesktop_ExpandSessionView
}
}
#endregion

#region HTTP Headers
private List<string> _httpHeader_WebsiteUriHistory = new List<string>();
public List<string> HTTPHeader_WebsiteUriHistory
{
get { return _httpHeader_WebsiteUriHistory; }
set
{
if (value == _httpHeader_WebsiteUriHistory)
return;

_httpHeader_WebsiteUriHistory = value;
SettingsChanged = true;
}
}

private bool _httpHeader_ExpandStatistics = true;
public bool HTTPHeader_ExpandStatistics
{
get { return _httpHeader_ExpandStatistics; }
set
{
if (value == _httpHeader_ExpandStatistics)
return;

_httpHeader_ExpandStatistics = value;
SettingsChanged = true;
}
}
#endregion
#endregion

#region Constructor
Expand Down
10 changes: 10 additions & 0 deletions Source/NETworkManager/NETworkManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,13 @@
<Compile Include="Converters\ValidateNetworkInterfaceProfileConverter.cs" />
<Compile Include="Converters\ValidateSubnetCalculatorIPv4SplitterConverter.cs" />
<Compile Include="Helpers\SingleInstanceHelper.cs" />
<Compile Include="Models\Network\HTTPHeaders.cs" />
<Compile Include="Models\Network\ARPTableInfo.cs" />
<Compile Include="Models\RemoteDesktop\RemoteDesktopSessionInfo.cs" />
<Compile Include="Models\Settings\RemoteDesktopSessionManager.cs" />
<Compile Include="Models\Settings\RemoteDesktopSessionInfo.cs" />
<Compile Include="Validators\HttpAndHttpsUriValidator.cs" />
<Compile Include="ViewModels\Applications\HTTPHeadersViewModel.cs" />
<Compile Include="ViewModels\Applications\ARPTableViewModel.cs" />
<Compile Include="ViewModels\Dialogs\NetworkInterfaceProfileViewModel.cs" />
<Compile Include="ViewModels\Dialogs\PortScannerProfileViewModel.cs" />
Expand Down Expand Up @@ -224,6 +227,9 @@
<Compile Include="Controls\RemoteDesktopControl.xaml.cs">
<DependentUpon>RemoteDesktopControl.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Applications\HTTPHeadersView.xaml.cs">
<DependentUpon>HTTPHeadersView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Applications\ARPTableView.xaml.cs">
<DependentUpon>ARPTableView.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -354,6 +360,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Applications\HTTPHeadersView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Applications\ARPTableView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
2 changes: 1 addition & 1 deletion Source/NETworkManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyVersion("1.5.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
<system:String x:Key="String_Header_Display">Anzeige</system:String>
<system:String x:Key="String_Header_Filter">Filter</system:String>
<system:String x:Key="String_Header_ARPTable">ARP-Tabelle</system:String>

<system:String x:Key="String_Header_Website">Webseite</system:String>
<system:String x:Key="String_Header_Headers">Headers</system:String>

<!-- Normal strings -->
<system:String x:Key="String_ProductName">NETworkManager</system:String>
<system:String x:Key="String_Slogan">Ein leistungsstarkes Tool zum Verwalten von Netzwerken und zur Behebung von Netzwerkproblemen!</system:String>
Expand Down Expand Up @@ -325,6 +327,7 @@
<system:String x:Key="String_Button_Refresh">Aktualisieren</system:String>
<system:String x:Key="String_Button_Reconnect">Wiederverbinden</system:String>
<system:String x:Key="String_Button_ClearCache">Cache leeren</system:String>
<system:String x:Key="String_Button_Check">Prüfen</system:String>

<!-- ContextMenuItem.Header -->
<system:String x:Key="String_ContextMenu_Cut">Ausschneiden</system:String>
Expand Down Expand Up @@ -360,7 +363,8 @@
<system:String x:Key="String_Watermark_EamplePortPortRangeOrService">22; 80; https; ldaps; 777 - 999; 8080</system:String>
<system:String x:Key="String_Watermark_ExampleSubnet">192.168.178.133/22 oder 192.168.178.133/255.255.252.0</system:String>
<system:String x:Key="String_Watermark_Filter">Filter...</system:String>

<system:String x:Key="String_Watermark_ExampleWebsiteUri">http(s)://example.com/index.html</system:String>

<!-- ShowProgress -->
<system:String x:Key="String_ProgessHeader_ConfigureNetworkInterface">Konfiguriere Netzwerkinterface</system:String>
<system:String x:Key="String_Progress_SetStaticIPAddress">Setze statische IP-Adresse und Gateway...</system:String>
Expand All @@ -385,6 +389,7 @@
<system:String x:Key="String_ValidateError_EnterValidValueBetween10and100">Geben Sie einen gültigen Wert ein zwischen 10 und 100!</system:String>
<system:String x:Key="String_ValidateError_EnterValidIPAddress">Geben Sie eine gültige IP-Adresse ein!</system:String>
<system:String x:Key="String_ValidateError_EnterValidSubnet">Geben Sie ein gültiges Subnetz ein (z.B. 192.168.178.133/26)</system:String>
<system:String x:Key="String_ValidateError_EnterValidWebsiteUri">Geben Sie eine gültige Webseite ein (z.B. https://example.com/index.html)</system:String>

<!-- ApplicationInfo.Name -->
<system:String x:Key="String_ApplicationName_IPScanner">IP-Scanner</system:String>
Expand All @@ -396,6 +401,7 @@
<system:String x:Key="String_ApplicationName_Traceroute">Traceroute</system:String>
<system:String x:Key="String_ApplicationName_DNSLookup">DNS-Lookup</system:String>
<system:String x:Key="String_ApplicationName_RemoteDesktop">Remote Desktop</system:String>
<system:String x:Key="String_ApplicationName_HTTPHeaders">HTTP-Headers</system:String>
<system:String x:Key="String_ApplicationName_ARPTable">ARP-Tabelle</system:String>
<system:String x:Key="String_ApplicationName_Lookup">Lookup</system:String>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
<system:String x:Key="String_Header_Display">Display</system:String>
<system:String x:Key="String_Header_Filter">Filter</system:String>
<system:String x:Key="String_Header_ARPTable">ARP Table</system:String>

<system:String x:Key="String_Header_Website">Website</system:String>
<system:String x:Key="String_Header_Headers">Headers</system:String>

<!-- Normal strings -->
<system:String x:Key="String_ProductName">NETworkManager</system:String>
<system:String x:Key="String_Slogan">A powerful tool for managing networks and troubleshoot network problems!</system:String>
Expand Down Expand Up @@ -325,6 +327,7 @@
<system:String x:Key="String_Button_Refresh">Refresh</system:String>
<system:String x:Key="String_Button_Reconnect">Reconnect</system:String>
<system:String x:Key="String_Button_ClearCache">Clear cache</system:String>
<system:String x:Key="String_Button_Check">Check</system:String>

<!-- ContextMenuItem.Header -->
<system:String x:Key="String_ContextMenu_Cut">Cut</system:String>
Expand Down Expand Up @@ -360,7 +363,8 @@
<system:String x:Key="String_Watermark_EamplePortPortRangeOrService">22; 80; https; ldaps; 777 - 999; 8080</system:String>
<system:String x:Key="String_Watermark_ExampleSubnet">192.168.178.133/22 or 192.168.178.133/255.255.252.0</system:String>
<system:String x:Key="String_Watermark_Filter">Filter...</system:String>

<system:String x:Key="String_Watermark_ExampleWebsiteUri">http(s)://example.com/index.html</system:String>

<!-- ShowProgress -->
<system:String x:Key="String_ProgessHeader_ConfigureNetworkInterface">Configure Network Interface</system:String>
<system:String x:Key="String_Progress_SetStaticIPAddress">Set static IP address and gateway...</system:String>
Expand All @@ -385,6 +389,7 @@
<system:String x:Key="String_ValidateError_EnterValidValueBetween10and100">Enter a valid value between 10 and 100!</system:String>
<system:String x:Key="String_ValidateError_EnterValidIPAddress">Enter a valid IP address!</system:String>
<system:String x:Key="String_ValidateError_EnterValidSubnet">Enter a valid subnet (like 192.168.178.133/26)</system:String>
<system:String x:Key="String_ValidateError_EnterValidWebsiteUri">Enter a valid website (like https://example.com/index.html)</system:String>

<!-- ApplicationView.Name -->
<system:String x:Key="String_ApplicationName_IPScanner">IP Scanner</system:String>
Expand All @@ -396,6 +401,7 @@
<system:String x:Key="String_ApplicationName_Traceroute">Traceroute</system:String>
<system:String x:Key="String_ApplicationName_DNSLookup">DNS Lookup</system:String>
<system:String x:Key="String_ApplicationName_RemoteDesktop">Remote Desktop</system:String>
<system:String x:Key="String_ApplicationName_HTTPHeaders">HTTP Headers</system:String>
<system:String x:Key="String_ApplicationName_ARPTable">ARP Table</system:String>
<system:String x:Key="String_ApplicationName_Lookup">Lookup</system:String>

Expand Down
19 changes: 19 additions & 0 deletions Source/NETworkManager/Validators/HttpAndHttpsUriValidator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using NETworkManager.Helpers;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;

namespace NETworkManager.Validators
{
public class MACAddressValidator : ValidationRule
{
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
if (Regex.IsMatch(value as string, RegexHelper.MACAddressRegex))
return ValidationResult.ValidResult;

return new ValidationResult(false, Application.Current.Resources["String_ValidateError_EnterValidMACAddress"] as string);
}
}
}
6 changes: 3 additions & 3 deletions Source/NETworkManager/Validators/MACAddressValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

namespace NETworkManager.Validators
{
public class MACAddressValidator : ValidationRule
public class HttpAndHttpsUriValidator : ValidationRule
{
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
if (Regex.IsMatch(value as string, RegexHelper.MACAddressRegex))
if (Regex.IsMatch(value as string, RegexHelper.httpAndHttpsUriRegex))
return ValidationResult.ValidResult;

return new ValidationResult(false, Application.Current.Resources["String_ValidateError_EnterValidMACAddress"] as string);
return new ValidationResult(false, Application.Current.Resources["String_ValidateError_EnterValidWebsiteUri"] as string);
}
}
}
Loading