Skip to content

Commit 040abd2

Browse files
committed
Change rdp port
1 parent b174950 commit 040abd2

9 files changed

Lines changed: 54 additions & 9 deletions

File tree

Source/NETworkManager/Controls/RemoteDesktopControl.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ private void ReconnectAction()
151151
private void Connect()
152152
{
153153
rdpClient.Server = _rdpSessionInfo.Hostname;
154+
rdpClient.AdvancedSettings9.RDPPort = _rdpSessionInfo.Port;
154155

155156
if (_rdpSessionInfo.CustomCredentials)
156157
{

Source/NETworkManager/Models/RemoteDesktop/RemoteDesktopSessionInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace NETworkManager.Models.RemoteDesktop
55
public class RemoteDesktopSessionInfo
66
{
77
public string Hostname { get; set; }
8+
public int Port { get; set; }
89
public bool CustomCredentials { get; set; }
910
public string Username { get; set; }
1011
public SecureString Password { get; set; }

Source/NETworkManager/Models/Settings/SettingsInfo.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,20 @@ public int RemoteDesktop_ColorDepth
12891289
}
12901290
}
12911291

1292+
private int _remoteDesktop_Port = 3389;
1293+
public int RemoteDesktop_Port
1294+
{
1295+
get { return _remoteDesktop_Port; }
1296+
set
1297+
{
1298+
if (value == _remoteDesktop_Port)
1299+
return;
1300+
1301+
_remoteDesktop_Port = value;
1302+
SettingsChanged = true;
1303+
}
1304+
}
1305+
12921306
private bool _remoteDesktop_EnableCredSspSupport = true;
12931307
public bool RemoteDesktop_EnableCredSspSupport
12941308
{

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<system:String x:Key="String_Header_v1v2c">v1/v2c</system:String>
101101
<system:String x:Key="String_Header_v3">v3</system:String>
102102
<system:String x:Key="String_Header_HTTPHeaders">HTTP-Headers</system:String>
103+
<system:String x:Key="String_Header_Network">Netzwerk</system:String>
103104

104105
<!-- Normal strings -->
105106
<system:String x:Key="String_ProductName">NETworkManager</system:String>
@@ -439,6 +440,7 @@
439440
<system:String x:Key="String_Watermark_ExamplePort7">7</system:String>
440441
<system:String x:Key="String_Watermark_ExamplePort53">53</system:String>
441442
<system:String x:Key="String_Watermark_ExamplePort161">161</system:String>
443+
<system:String x:Key="String_Watermark_ExamplePort3389">3389</system:String>
442444
<system:String x:Key="String_Watermark_ExampleIPv4Address">192.168.178.55</system:String>
443445
<system:String x:Key="String_Watermark_ExampleSubnetmask">255.255.255.0</system:String>
444446
<system:String x:Key="String_Watermark_ExampleHostnameOrIPAddress">fritz.box or 192.168.178.1</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<system:String x:Key="String_Header_v1v2c">v1/v2c</system:String>
101101
<system:String x:Key="String_Header_v3">v3</system:String>
102102
<system:String x:Key="String_Header_HTTPHeaders">HTTP Headers</system:String>
103+
<system:String x:Key="String_Header_Network">Network</system:String>
103104

104105
<!-- Normal strings -->
105106
<system:String x:Key="String_ProductName">NETworkManager</system:String>
@@ -439,6 +440,7 @@
439440
<system:String x:Key="String_Watermark_ExamplePort7">7</system:String>
440441
<system:String x:Key="String_Watermark_ExamplePort53">53</system:String>
441442
<system:String x:Key="String_Watermark_ExamplePort161">161</system:String>
443+
<system:String x:Key="String_Watermark_ExamplePort3389">3389</system:String>
442444
<system:String x:Key="String_Watermark_ExampleIPv4Address">192.168.178.55</system:String>
443445
<system:String x:Key="String_Watermark_ExampleSubnetmask">255.255.255.0</system:String>
444446
<system:String x:Key="String_Watermark_ExampleHostnameOrIPAddress">SERVER-01 or 172.16.0.100</system:String>

Source/NETworkManager/ViewModels/Applications/PingHostViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public PingHostViewModel()
4646
new DragablzPingTabItem(Application.Current.Resources["String_Header_Ping"] as string, new PingView(_tabId, ChangeTabTitleAction), _tabId)
4747
};
4848
}
49-
#endregion
50-
49+
#endregion
50+
5151
#region ICommand & Actions
5252
public ICommand AddPingTabCommand
5353
{

Source/NETworkManager/ViewModels/Applications/RemoteDesktopViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ private void ConnectSession(Models.RemoteDesktop.RemoteDesktopSessionInfo sessio
566566
}
567567

568568
sessionInfo.ColorDepth = SettingsManager.Current.RemoteDesktop_ColorDepth;
569+
sessionInfo.Port = SettingsManager.Current.RemoteDesktop_Port;
569570
sessionInfo.EnableCredSspSupport = SettingsManager.Current.RemoteDesktop_EnableCredSspSupport;
570571
sessionInfo.AuthenticationLevel = SettingsManager.Current.RemoteDesktop_AuthenticationLevel;
571572
sessionInfo.RedirectClipboard = SettingsManager.Current.RemoteDesktop_RedirectClipboard;

Source/NETworkManager/ViewModels/Settings/SettingsApplicationRemoteDesktopViewModel.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using NETworkManager.Helpers;
2-
using NETworkManager.Models.Settings;
3-
using System;
1+
using NETworkManager.Models.Settings;
42
using System.Collections.Generic;
53
using System.Linq;
6-
using System.Windows;
74

85
namespace NETworkManager.ViewModels.Settings
96
{
@@ -189,6 +186,23 @@ public int SelectedColorDepth
189186
}
190187
}
191188

189+
private int _port;
190+
public int Port
191+
{
192+
get { return _port; }
193+
set
194+
{
195+
if (value == _port)
196+
return;
197+
198+
if (!_isLoading)
199+
SettingsManager.Current.RemoteDesktop_Port = value;
200+
201+
_port = value;
202+
OnPropertyChanged();
203+
}
204+
}
205+
192206
private bool _enableCredSspSupport;
193207
public bool EnableCredSspSupport
194208
{
@@ -350,6 +364,7 @@ private void LoadSettings()
350364
CustomScreenWidth = SettingsManager.Current.RemoteDesktop_CustomScreenWidth.ToString();
351365
CustomScreenHeight = SettingsManager.Current.RemoteDesktop_CustomScreenHeight.ToString();
352366
SelectedColorDepth = ColorDepths.FirstOrDefault(x => x == SettingsManager.Current.RemoteDesktop_ColorDepth);
367+
Port = SettingsManager.Current.RemoteDesktop_Port;
353368
EnableCredSspSupport = SettingsManager.Current.RemoteDesktop_EnableCredSspSupport;
354369
AuthenticationLevel = SettingsManager.Current.RemoteDesktop_AuthenticationLevel;
355370
RedirectClipboard = SettingsManager.Current.RemoteDesktop_RedirectClipboard;

Source/NETworkManager/Views/Settings/SettingsApplicationRemoteDesktopView.xaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,20 @@
5858
</TextBox>
5959
</Grid>
6060
</GroupBox>
61-
62-
<!-- <mah:ToggleSwitch Header="{DynamicResource String_AdjustScreenAutomatically}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding AdjustScreenAutomatically}" Margin="0,0,0,10" /> -->
63-
6461
<TextBlock Text="{DynamicResource String_ColorDepthBit}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
6562
<ComboBox ItemsSource="{Binding ColorDepths}" SelectedItem="{Binding SelectedColorDepth}" Width="250" HorizontalAlignment="Left" Margin="0,0,0,20" />
63+
<TextBlock Text="{DynamicResource String_Header_Network}" Style="{StaticResource HeaderTextBlock}" />
64+
<TextBlock Text="{DynamicResource String_Port}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />
65+
<TextBox Width="250" HorizontalAlignment="Left" IsEnabled="{Binding UseCustomDNSServer}" mah:TextBoxHelper.Watermark="{DynamicResource String_Watermark_ExamplePort3389 }" Style="{StaticResource DefaultTextBox}" Margin="0,0,0,20">
66+
<TextBox.Text>
67+
<Binding Path="Port" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
68+
<Binding.ValidationRules>
69+
<Validator:EmptyValidator ValidatesOnTargetUpdated="True" />
70+
<Validator:PortValidator ValidatesOnTargetUpdated="True" />
71+
</Binding.ValidationRules>
72+
</Binding>
73+
</TextBox.Text>
74+
</TextBox>
6675
<TextBlock Text="{DynamicResource String_Header_Authentication}" Style="{StaticResource HeaderTextBlock}" />
6776
<mah:ToggleSwitch Header="{DynamicResource String_CredentialSecuritySupportProvider}" OnLabel="{DynamicResource String_ToggleSwitch_On}" OffLabel="{DynamicResource String_ToggleSwitch_Off}" IsChecked="{Binding EnableCredSspSupport}" Margin="0,0,0,10" />
6877
<TextBlock Text="{DynamicResource String_AuthenticationLevel}" Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" Margin="0,0,0,10" />

0 commit comments

Comments
 (0)