1 |
using System; |
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Data; |
5 |
using System.Drawing; |
6 |
using System.Text; |
7 |
using System.Windows.Forms; |
8 |
using System.Net; |
9 |
|
10 |
namespace AnywhereTS |
11 |
{ |
12 |
public partial class frmConfigFreeServices : Form |
13 |
{ |
14 |
public frmConfigFreeServices() |
15 |
{ |
16 |
InitializeComponent(); |
17 |
} |
18 |
|
19 |
private void chkTFTPnet_CheckedChanged(object sender, EventArgs e) |
20 |
{ |
21 |
if (chkTFTPnet.Checked) |
22 |
{ |
23 |
cboTFTP.Enabled = true; |
24 |
} |
25 |
else |
26 |
{ |
27 |
cboTFTP.Enabled = false; |
28 |
} |
29 |
} |
30 |
|
31 |
private void btnOkDHCP_Click(object sender, EventArgs e) |
32 |
{ |
33 |
// DHCP... |
34 |
{ |
35 |
// Check valid IP pool start address |
36 |
IPAddress ipValid; |
37 |
if (ATSGlobals.dhcpConfig == 0) // If we are using the internal DHCP server |
38 |
{ |
39 |
AtsDhcp.intDHCPon = 5; |
40 |
} |
41 |
else |
42 |
{ |
43 |
AtsDhcp.intDHCPon = 1; |
44 |
} |
45 |
if (ATSGlobals.tftpConfig == 0) // If we are using the internal TFTP server |
46 |
{ |
47 |
if (chkTFTPnet.Checked) |
48 |
{ |
49 |
if (!IPAddress.TryParse(cboTFTP.Text, out ipValid)) |
50 |
{ |
51 |
MessageBox.Show("Please Select or enter a valid IP address"); |
52 |
{ |
53 |
cboTFTP.Focus(); |
54 |
return; |
55 |
} |
56 |
} |
57 |
else |
58 |
{ |
59 |
AtsDhcp.strTftpd32IP = cboTFTP.Text; |
60 |
} |
61 |
} |
62 |
else |
63 |
{ |
64 |
AtsDhcp.strTftpd32IP = ""; |
65 |
} |
66 |
AtsDhcp.ConfTFTPD32(ATSGlobals.tftpConfig == 0); |
67 |
{ // Terminate this form |
68 |
DialogResult = DialogResult.OK; |
69 |
} |
70 |
} |
71 |
} |
72 |
} |
73 |
private void frmDHCPoptions_Load(object sender, EventArgs e) |
74 |
{ |
75 |
helpProvider.HelpNamespace = ATSGlobals.strHelpFilePath; // Initiate helpProvider |
76 |
|
77 |
// Disable controls that should not be used |
78 |
|
79 |
if (ATSGlobals.tftpConfig != 0) |
80 |
{ // Other TFTP used, disable controls for internal TFTP. |
81 |
grbTFTP.Enabled = false; |
82 |
} |
83 |
AtsDhcp.OpenTFTP32regKey(); |
84 |
if (AtsDhcp.strTftpd32IP == "") |
85 |
{ |
86 |
cboTFTP.Text = ""; |
87 |
chkTFTPnet.Checked = false; |
88 |
} |
89 |
else |
90 |
{ |
91 |
cboTFTP.Text = AtsDhcp.strTftpd32IP; |
92 |
chkTFTPnet.Checked = true; |
93 |
} |
94 |
if (chkTFTPnet.Checked) |
95 |
cboTFTP.Enabled = true; |
96 |
else |
97 |
cboTFTP.Enabled = false; |
98 |
ProSupport.ThisComputerIp(cboTFTP,false); |
99 |
cboTFTP.SelectedIndex = 0; |
100 |
} |
101 |
} |
102 |
} |