using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net; namespace AnywhereTS { public partial class frmConfigFreeServices : Form { public frmConfigFreeServices() { InitializeComponent(); } private void chkTFTPnet_CheckedChanged(object sender, EventArgs e) { if (chkTFTPnet.Checked) { cboTFTP.Enabled = true; } else { cboTFTP.Enabled = false; } } private void btnOkDHCP_Click(object sender, EventArgs e) { // DHCP... { // Check valid IP pool start address IPAddress ipValid; if (ATSGlobals.dhcpConfig == 0) // If we are using the internal DHCP server { AtsDhcp.intDHCPon = 5; } else { AtsDhcp.intDHCPon = 1; } if (ATSGlobals.tftpConfig == 0) // If we are using the internal TFTP server { if (chkTFTPnet.Checked) { if (!IPAddress.TryParse(cboTFTP.Text, out ipValid)) { MessageBox.Show("Please Select or enter a valid IP address"); { cboTFTP.Focus(); return; } } else { AtsDhcp.strTftpd32IP = cboTFTP.Text; } } else { AtsDhcp.strTftpd32IP = ""; } AtsDhcp.ConfTFTPD32(ATSGlobals.tftpConfig == 0); { // Terminate this form DialogResult = DialogResult.OK; } } } } private void frmDHCPoptions_Load(object sender, EventArgs e) { helpProvider.HelpNamespace = ATSGlobals.strHelpFilePath; // Initiate helpProvider // Disable controls that should not be used if (ATSGlobals.tftpConfig != 0) { // Other TFTP used, disable controls for internal TFTP. grbTFTP.Enabled = false; } AtsDhcp.OpenTFTP32regKey(); if (AtsDhcp.strTftpd32IP == "") { cboTFTP.Text = ""; chkTFTPnet.Checked = false; } else { cboTFTP.Text = AtsDhcp.strTftpd32IP; chkTFTPnet.Checked = true; } if (chkTFTPnet.Checked) cboTFTP.Enabled = true; else cboTFTP.Enabled = false; ProSupport.ThisComputerIp(cboTFTP,false); cboTFTP.SelectedIndex = 0; } } }