private void btnOpen_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "Shape file(*.shp)|*.shp|DWG file(*.dwg)|*.dwg";
dlg.Title = "打开源数据文档";
//定义存放打开IFeatureClass的字符串数组
string FilePath;
if (dlg.ShowDialog() == DialogResult.OK)
{
FilePath = dlg.FileName;
this.textEdit1.Text = FilePath;
//得到打开文件的坐标系
//string strSpatialReferenct = this.getSpatialReference(FilePath);
//this.textEdit3.Text = strSpatialReferenct;
//得到保存文件的路径及文件名,并设置写入输出路径中
string savePath = this.getSavePath(FilePath);
this.textEdit2.Text = savePath;
}
}
C#.NET 窗口打开shp和dwg格式的文件
最新推荐文章于 2024-04-09 11:08:26 发布