示例#1
0
        ///
        /// <summary>
        /// Imports IP addresses from file.
        /// </summary>
        private void importFile()
        {
            if (_strTabIndex != "")
            {
                string strTarget = _tabInter.getSelectedIP(_strTabIndex);

                if (strTarget == "")
                {
                    MessageBox.Show("You must select and existing target before proceeding\nThe imported IPs will use these existing settings.",
                                    "No Selected Target", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    string strPath = getImportFilePath();

                    if (strPath != "")
                    {
                        if (_proInter.importIPFile(strPath, strTarget, _strTabIndex) == false)
                        {
                            MessageBox.Show("There was an error during the import procedure." +
                                            "\nThe file may be corrupt of incorrectly formatted.",
                                            "No Selected Target", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }