代码拉取完成,页面将自动刷新
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;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。