private void 옵션ToolStripMenuItem_Click(object sender, EventArgs e) { FormOption dlgForOption = new FormOption(); dlgForOption.SetDBINI(diManager); diManager.SetFormOption(dlgForOption); dlgForOption.ShowDialog(); }
public void Initialize() { StreamReader sr = new StreamReader(new FileStream(DbIni, FileMode.OpenOrCreate)); long fileSize = sr.BaseStream.Length; sr.Close(); if (0 == fileSize) { FormOption dlgForOption = new FormOption(); dlgForOption.SetDBINI(this); DialogResult dr = new DialogResult(); dr = dlgForOption.ShowDialog(); if (dr == DialogResult.OK) { // MessageBox.Show("User clicked OK button"); StreamWriter sw = new StreamWriter(new FileStream(DbIni, FileMode.OpenOrCreate)); IpAddress = dlgForOption.GetTextBoxIpAddress(); DbName = dlgForOption.GetTextBoxDBName(); CollectionName = dlgForOption.GetTextBoxCollectionName(); Id = dlgForOption.GetTextBoxId(); Pw = dlgForOption.GetTextBoxPw(); sw.WriteLine(IpAddress + "|" + DbName + "|" + CollectionName + "|" + Id + "|" + Pw); sw.Close(); } else if (dr == DialogResult.Cancel) { // MessageBox.Show("User clicked Cancel button"); } } else { } }