2 smallsheeper SmallSheeper 于 2016.04.21 11:29 提问

AE中添加shp文件的问题!

这段代码有问题吗?可以生成解决方案,但是还是不能加载shp文件啊。报错显示

图片说明

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.IO;

namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void addShapeFile()
{
System.Windows.Forms.OpenFileDialog openFileDialog;
openFileDialog = new OpenFileDialog();
openFileDialog.Title = "打开图层文件";
openFileDialog.Filter = "map documents(*.shp)|*.shp";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
FileInfo fileInfo = new FileInfo(openFileDialog.FileName);
String path = fileInfo.Directory.ToString();
String fileName = fileInfo.Name.Substring(0, fileInfo.Name.IndexOf("."));
try
{
axMapControl1.AddShapeFile(path, fileName);
}
catch (Exception e)
{
MessageBox.Show("添加图层失败!!!" + e.ToString());
}
}
}
private void button1_Click(object sender, EventArgs e)
{
addShapeFile();

    }

1个回答

CSDNXIAOD
CSDNXIAOD   2016.04.21 11:42

AE添加CAD文件
AE中shp文件的加载
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!