コード例 #1
0
        private void scriptToolStripMenuItem_Click(object sender, EventArgs e)
        {
            saveFileDialog1.Filter           = "Batch script files (*.bat)|*.bat";
            saveFileDialog1.InitialDirectory = Application.StartupPath;// + "\\ SavedTest\\";

            DialogResult d  = DialogResult.Cancel;
            FileInfo     fi = new FileInfo(Application.StartupPath + "\\SavedTest\\" + "temp");

            // amend the above line to whatever the file name should be
            if (fi.Exists)
            {
                d = DialogResult.OK;
            }
            else
            {
                d = saveFileDialog1.ShowDialog();
            }
            if (d == DialogResult.OK)
            {
                string pathholder = saveFileDialog1.FileName;
                saveFileDialog1.Reset();
                //LogMessage("Saving " + file + "...");
                ExFUNC_C1.Export2File(textBox1.Text, pathholder);

                if (MessageBox.Show("Do you want to execute the windows script command?", "RUN PROMPT", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                {
                    ExFUNC_C1.ExecuteCommand(pathholder);
                }

                //LogMessage("Saved Successfully.");
                Variables.IsData_saved = true;
            }
        }
コード例 #2
0
        private void xMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            saveFileDialog1.Filter           = "XML files (*.xml)|*.xml";
            saveFileDialog1.InitialDirectory = Application.StartupPath;// + "\\ SavedTest\\";

            DialogResult d  = DialogResult.Cancel;
            FileInfo     fi = new FileInfo(Application.StartupPath + "\\SavedTest\\" + "temp");

            // amend the above line to whatever the file name should be
            if (fi.Exists)
            {
                d = DialogResult.OK;
            }
            else
            {
                d = saveFileDialog1.ShowDialog();
            }
            if (d == DialogResult.OK)
            {
                string pathholder = saveFileDialog1.FileName;
                saveFileDialog1.Reset();
                //LogMessage("Saving " + file + "...");
                ExFUNC_C1.Export2File(textBox1.Text, pathholder);
                //XMLFMS.WriteToXmlFile<TextBox>(pathholder, textBox1, false);
                XMLFMS.WriteToXmlFile(pathholder, textBox1.Text);
                //LogMessage("Saved Successfully.");
                Variables.IsData_saved = true;
            }
        }
コード例 #3
0
 private void fTPToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //string input = Microsoft.VisualBasic.Interaction.InputBox("Please enter the ftp address:", "FTPSet", "SET", 0, 0);
     toolStripMenuItem6_Click(this, e);
     ExFUNC_C1.Export2File(textBox1.Text, Variables.TempFilePath);
     FTPSet.ftpTransfer(Variables.TempFilePath, Variables.FTPAdd, Variables.FTPUser, Variables.FTPPass);
 }
コード例 #4
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            saveFileDialog1.Filter           = "TEXT files (*.txt)|*.txt";
            saveFileDialog1.InitialDirectory = Application.StartupPath;// + "\\ SavedTest\\";

            DialogResult d = DialogResult.Cancel;

            d = saveFileDialog1.ShowDialog();
            if (d == DialogResult.OK)
            {
                string pathholder = saveFileDialog1.FileName;
                saveFileDialog1.Reset();
                //LogMessage("Saving " + file + "...");
                ExFUNC_C1.Export2File(textBox1.Text, pathholder);
                //LogMessage("Saved Successfully.");
                Variables.IsData_saved = true;
            }
        }
コード例 #5
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                openFileDialog1.InitialDirectory = Application.StartupPath;// + "\\ SavedTest\\";

                DialogResult d = DialogResult.Cancel;
                d = openFileDialog1.ShowDialog();
                if (d == System.Windows.Forms.DialogResult.OK)
                {
                    textBox1.Text          = (ExFUNC_C1.InputFromFile(openFileDialog1.FileName));
                    Variables.IsData_saved = false;
                    Variables.MEMO_PATH    = openFileDialog1.FileName;
                }
            }
            catch (Exception e2)
            {
                MessageBox.Show(e2.Message);
            }
        }
コード例 #6
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //if (File.Exists(Variables.MEMO_PATH))
            //{
            /// Just clear already present message
            //LogMessage(String.Empty);
            saveFileDialog1.Filter           = "TEXT files (*.txt)|*.txt";
            saveFileDialog1.InitialDirectory = Application.StartupPath;// + "\\ SavedTest\\";

            DialogResult d = DialogResult.Cancel;
            FileInfo     fi;

            if (string.IsNullOrEmpty(Variables.MEMO_PATH.Trim()))
            {
                fi = new FileInfo(Application.StartupPath + "\\SavedTest\\" + "temp");
            }
            else
            {
                fi = new FileInfo(Variables.MEMO_PATH);
            }
            // amend the above line to whatever the file name should be
            if (fi.Exists)
            {
                d = DialogResult.OK;
            }
            else
            {
                d = saveFileDialog1.ShowDialog();
            }
            if (d == DialogResult.OK)
            {
                string pathholder = saveFileDialog1.FileName;
                saveFileDialog1.Reset();
                //LogMessage("Saving " + file + "...");
                ExFUNC_C1.Export2File(textBox1.Text, pathholder);
                //LogMessage("Saved Successfully.");
                Variables.IsData_saved = true;
            }
            //}
        }