Skip to content

Commit 199d6db

Browse files
committed
Enable port number directly type in (#18)
1 parent 1f1fa9c commit 199d6db

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

OpenHardwareMonitor/UI/InterfacePortForm.Designer.cs

Lines changed: 2 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenHardwareMonitor/UI/InterfacePortForm.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ private void PortNumericUpDn_ValueChanged(object sender, EventArgs e)
5757

5858
private void PortOKButton_Click(object sender, EventArgs e)
5959
{
60-
_parent.Server.ListenerPort = (int)portNumericUpDn.Value;
60+
var port = (int)portNumericUpDn.Value;
61+
if (port < 1024)
62+
{
63+
MessageBox.Show("Port must be greater than 1024.", Updater.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
64+
return;
65+
}
66+
_parent.Server.ListenerPort = port;
6167
_parent.Server.ListenerIp = _localIP;
6268
Close();
6369
}

0 commit comments

Comments
 (0)