C#中是否缺少using指令或程序集引用的问题,,,
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
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;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
IMap pMap;
IActiveView pActiveView;
public Form1()
{
InitializeComponent();
}
private void axToolbarControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IToolbarControlEvents_OnMouseDownEvent e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
axTOCControl1.SetBuddyControl(axMapControl1);
axToolbarControl1.SetBuddyControl(axMapControl1);
OpenFileDialog OpenFdlg = new OpenFileDialog();
OpenFdlg.Title = "选择需要加载的地理数据文件";
OpenFdlg.Filter = "shape格式文件(#shape).shape";
OpenFdlg.ShowDialog();
string strFileName = OpenFdlg.FileName;
if (strFileName==string.Empty)
return;
//用户选择了shape文件
string pathName=System.IO.Path.GetDirectoryName(strFileName);
string fileName=System.IO.Path.GetFileNameWithoutExtension(strFileName);//往axmapcontroll中加载地图
axMapControl1.AddShapeFile(pathName,fileName);
//在鹰眼中加载地图
axMapControl2.ClearLayers();
axMapControl2.AddShapeFile(pathName,fileName);
axMapControl2.Extent=axMapControl2.FullExtent;//显示全图作为鸟瞰图
}
private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
pMap = axMapControl1.Map;
pActiveView = pMap as IActiveView;
IEnvelope pEnv;
pEnv = axMapControl1.TrackRectangle();
pActiveView.Extent = pEnv;
pActiveView.Refresh();}}}
里面的
错误 1 未能找到类型或命名空间名称“IMap”(是否缺少 using 指令或程序集引用?)
错误 2 未能找到类型或命名空间名称“IActiveView”(是否缺少 using 指令或程序集引用?)
错误 3 未能找到类型或命名空间名称“IActiveView”(是否缺少 using 指令或程序集引用?)
错误 4 未能找到类型或命名空间名称“IEnvelope”(是否缺少 using 指令或程序集引用?) 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
IMap pMap;
IActiveView pActiveView;
public Form1()
{
InitializeComponent();
}
private void axToolbarControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IToolbarControlEvents_OnMouseDownEvent e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
axTOCControl1.SetBuddyControl(axMapControl1);
axToolbarControl1.SetBuddyControl(axMapControl1);
OpenFileDialog OpenFdlg = new OpenFileDialog();
OpenFdlg.Title = "选择需要加载的地理数据文件";
OpenFdlg.Filter = "shape格式文件(#shape).shape";
OpenFdlg.ShowDialog();
string strFileName = OpenFdlg.FileName;
if (strFileName==string.Empty)
return;
//用户选择了shape文件
string pathName=System.IO.Path.GetDirectoryName(strFileName);
string fileName=System.IO.Path.GetFileNameWithoutExtension(strFileName);//往axmapcontroll中加载地图
axMapControl1.AddShapeFile(pathName,fileName);
//在鹰眼中加载地图
axMapControl2.ClearLayers();
axMapControl2.AddShapeFile(pathName,fileName);
axMapControl2.Extent=axMapControl2.FullExtent;//显示全图作为鸟瞰图
}
private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
pMap = axMapControl1.Map;
pActiveView = pMap as IActiveView;
IEnvelope pEnv;
pEnv = axMapControl1.TrackRectangle();
pActiveView.Extent = pEnv;
pActiveView.Refresh();}}}
里面的
错误 1 未能找到类型或命名空间名称“IMap”(是否缺少 using 指令或程序集引用?)
错误 2 未能找到类型或命名空间名称“IActiveView”(是否缺少 using 指令或程序集引用?)
错误 3 未能找到类型或命名空间名称“IActiveView”(是否缺少 using 指令或程序集引用?)
错误 4 未能找到类型或命名空间名称“IEnvelope”(是否缺少 using 指令或程序集引用?) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询