コード例 #1
0
 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);
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: fxlepoutre/InventoryTake
 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 );
     }
 }