예제 #1
0
 private void slaveModeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     IPdialog ipdialog = new IPdialog(ip);
     ipdialog.ShowDialog();
     if (ipdialog.result == true)
     {
         this.ip = ipdialog.ip;
         Thread th = new Thread(SlaveConnect);
         th.Start();
     }
 }
예제 #2
0
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (fileName != null)
     {
         StreamWriter sw = new StreamWriter(fileName);
     }
     else
     {
         IPdialog dialog = new IPdialog("c://new.txt");
         dialog.Text = "Enter file name";
         dialog.setLabelText("Enter file name and patch:");
         dialog.setIPMode(false); //normal string
         dialog.ShowDialog();
         if (dialog.result == true)
         {
             try
             {
                 StreamWriter sw = new StreamWriter(dialog.ip);
                 sw.Write(textBox1.Text);
                 sw.Flush();
                 sw.Close();
                 MessageBox.Show("File saved succesfully!");
             }
             catch (Exception ex)
             {
                 MessageBox.Show("Error while saving file. Internal error: " + ex.Message);
             }
         }
     }
 }