各路大侠,不才要做毕业设计,用arcgis engine vb.net开发,抄了个代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim openFileDialogl As OpenFileDialog = New OpenFileDialog()
openFileDialogl.Title = "打开Map地图"
openFileDialogl.Filter = "Map Documents(*.shp)|*.shp"
openFileDialogl.ShowDialog()
Dim sFilePath As String
sFilePath = openFileDialogl.FileName
If sFilePath = "" Then Exit Sub
On Error GoTo errorhandler_loadmxfile
AxMapControl1.LoadMxFile(sFilePath)
Exit Sub
errorhandler_loadmxfile:
MsgBox(sFilePath & "不能导入!" + vbCrLf + "错误:" + Err.Description)
End Sub
结果运行出错:在 System.Reflection.TargetInvocationException 中第一次偶然出现的“mscorlib.dll”类型的异常,有人说是版本问题,我的版本是4.0.30319.239