private void btnStartCount_Click(object sender, EventArgs e) { // Generate file name try { String strFileName = strDataDirectory + System.Net.Dns.GetHostName() + "-Count-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ((this.txtWorkID.Text.Length != 0) ? "-" : "") + this.txtWorkID.Text.ToString() + ".csv"; // Open Form 2 using (Form2Count f2count = new Form2Count(strFileName)) { f2count.ShowDialog(); this.loadFileNamesInListBox(); } } catch (Exception ex) { MessageBox.Show("Cannot generate file name and launch app.\n" + ex.Message); } }
private void btnStartCount_Click(object sender, EventArgs e) { // Generate file name try { String strFileName = strDataDirectory + System.Net.Dns.GetHostName() + "-Count-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ((this.txtWorkID.Text.Length != 0) ? "-" : "") + this.txtWorkID.Text.ToString() + ".csv"; // Open Form 2 using (Form2Count f2count = new Form2Count(strFileName)) { f2count.ShowDialog(); this.loadFileNamesInListBox(); } } catch (Exception ex) { MessageBox.Show("Cannot generate file name and launch app.\n" + ex.Message ); } }