1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace OTSExtremum
- {
- public partial class DataReadConfigurationForm : Form
- {
- int _loadCount = 0;
- string _filepath = "";
- public int LoadCount
- {
- set { _loadCount = value; }
- get { return _loadCount; }
- }
- public string Filepath
- {
- set { _filepath = value; }
- get { return _filepath; }
- }
- public DataReadConfigurationForm()
- {
- InitializeComponent();
- }
- private void btn_open_Click(object sender, EventArgs e)
- {
- System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
- dialog.Description = "请选择测量结果所在文件夹";
- if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- tB_filepath.Text = dialog.SelectedPath;
- }
- }
- private void DataReadConfigurationForm_Load(object sender, EventArgs e)
- {
- }
- private void btn_load_Click(object sender, EventArgs e)
- {
- if(tB_filepath.Text==null)
- {
- MessageBox.Show("请选择一个测量结果!");
- }
- int count = 0;
- if(!int.TryParse(tB_loadCount.Text,out count))
- {
- MessageBox.Show("请填写正确数据格式!");
- tB_loadCount.Focus();
- return;
- }
- LoadCount = count;
- Filepath = tB_filepath.Text;
- this.DialogResult = DialogResult.OK;
- Close();
- }
- }
- }
|