4 Star 25 Fork 10

Yonghe / GeoFlying

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
GridLayerParaDialog.cs 3.43 KB
一键复制 编辑 原始数据 按行查看 历史
Yonghe 提交于 2020-10-02 09:33 . first
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace GeoFly
{
public partial class GridLayerParaDialog : Form
{
public GridLayerParaDialog()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() != DialogResult.OK)
return;
this.textBox_DEM.Text = dlg.FileName;
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() != DialogResult.OK)
return;
this.textBox_LULC.Text = dlg.FileName;
}
private void button3_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() != DialogResult.OK)
return;
this.textBox_SOIL.Text = dlg.FileName;
}
private void button5_Click(object sender, EventArgs e)
{
this.Close();
}
private void button6_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() != DialogResult.OK)
return;
string filename = dlg.FileName;
StreamReader sr = new StreamReader(filename);
//跳过文件表头
sr.ReadLine();
//下面开始读数据
while (!sr.EndOfStream)
{
string[] strs = sr.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
}
}
private void button7_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() != DialogResult.OK)
return;
}
private void button4_Click(object sender, EventArgs e)
{
string s= this.textBox_DEM.Text;
if (s == "")
{
MessageBox.Show("DEM文件路径设置不能为空");
return;
}
HydroSimulate.g_GridLayerPara.DemFileName = s;
s = this.textBox_LULC.Text;
if (s == "")
{
MessageBox.Show("LULC文件路径设置不能为空");
return;
}
HydroSimulate.g_GridLayerPara.LulcFileName = s;
s = this.textBox_SOIL.Text;
if (s == "")
{
MessageBox.Show("SOIL文件路径设置不能为空");
return;
}
HydroSimulate.g_GridLayerPara.SoilFileName = s;
HydroSimulate.g_GridLayerPara.WriteGridIOFile(HydroSimulate.path + "\\SysPara\\GridIO.txt");
}
private void GridLayerParaDialog_Load(object sender, EventArgs e)
{
this.textBox_DEM.Text = HydroSimulate.g_GridLayerPara.DemFileName;
this.textBox_LULC.Text = HydroSimulate.g_GridLayerPara.LulcFileName;
this.textBox_SOIL.Text = HydroSimulate.g_GridLayerPara.SoilFileName;
}
}
}
C#
1
https://gitee.com/sucksis/geo-flying.git
git@gitee.com:sucksis/geo-flying.git
sucksis
geo-flying
GeoFlying
master

搜索帮助