Пример #1
0
        private void mnuUsage_Click(object sender, EventArgs e)
        {
            frmSelectIP frmIP = new frmSelectIP();
            string      sIP   = "";

            if (frmIP.ShowDialog() == DialogResult.OK)
            {
                sIP = frmIP.sIP;
            }
            else
            {
                return;
            }

            bAllowGUIupdate = false;

            SaveFileDialog sfd = new SaveFileDialog();

            sfd.CheckPathExists  = true;
            sfd.DefaultExt       = "csv";
            sfd.AddExtension     = true;
            sfd.Filter           = "CSV|*.csv|All|*.*";
            sfd.FilterIndex      = 0;
            sfd.InitialDirectory = Environment.CurrentDirectory;
            sfd.OverwritePrompt  = true;
            sfd.RestoreDirectory = true;
            sfd.ValidateNames    = true;

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                DataAccess da = new DataAccess();
                da.export2CSV2(sfd.FileName, sIP);
            }
            bAllowGUIupdate = true;
        }
Пример #2
0
        private void mnuUsage_Click(object sender, EventArgs e)
        {
            frmSelectIP frmIP = new frmSelectIP();
            string sIP = "";
            if (frmIP.ShowDialog() == DialogResult.OK)
            {
                sIP = frmIP.sIP;
            }
            else
                return;

            bAllowGUIupdate = false;

            SaveFileDialog sfd = new SaveFileDialog();
            sfd.CheckPathExists = true;
            sfd.DefaultExt = "csv";
            sfd.AddExtension = true;
            sfd.Filter = "CSV|*.csv|All|*.*";
            sfd.FilterIndex = 0;
            sfd.InitialDirectory = Environment.CurrentDirectory;
            sfd.OverwritePrompt = true;
            sfd.RestoreDirectory = true;
            sfd.ValidateNames = true;

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                DataAccess da = new DataAccess();
                da.export2CSV2(sfd.FileName, sIP);
            }
            bAllowGUIupdate = true;

        }