ArcGis Engine C# 用户代码未处理COMException 指定的文件名无效

privatevoidaxSymbolSelectorFrm_Load(objectsender,EventArgse){//取得ArcGIS安装路径stringsIns... private void axSymbolSelectorFrm_Load(object sender, EventArgs e)
{
//取得ArcGIS安装路径
string sInstall = ReadRegistry("SOFTWARE\\ESRI\\CoreRuntime");
//载入ESRI.ServerStyle文件到SymbologyControl
this.axSymbologyControl1.LoadStyleFile(sInstall + \\Styles\\ESRI.ServerStyle);——此句出错!!!!
//确定图层的类型(点线面),设置好SymbologyControl的StyleClass,设置好各控件的可见性(visible)
IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)pLayer;
switch (((IFeatureLayer)pLayer).FeatureClass.ShapeType)
{
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassMarkerSymbols);
this.lblAngle.Visible = true;
this.nudAngle.Visible = true;
this.lblSize.Visible = true;
this.nudSize.Visible = true;
this.lblWidth.Visible = false;
this.nudWidth.Visible = false;
this.lblOutlineColor.Visible = false;
this.btnOutlineColor.Visible = false;
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassLineSymbols);
this.lblAngle.Visible = false;
this.nudAngle.Visible = false;
this.lblSize.Visible = false;
this.nudSize.Visible = false;
this.lblWidth.Visible = true;
this.nudWidth.Visible = true;
this.lblOutlineColor.Visible = false;
this.btnOutlineColor.Visible = false;
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassFillSymbols);
this.lblAngle.Visible = false;
this.nudAngle.Visible = false;
this.lblSize.Visible = false;
this.nudSize.Visible = false;
this.lblWidth.Visible = true;
this.nudWidth.Visible = true;
this.lblOutlineColor.Visible = true;
this.btnOutlineColor.Visible = true;
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryMultiPatch:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassFillSymbols);
this.lblAngle.Visible = false;
this.nudAngle.Visible = false;
this.lblSize.Visible = false;
this.nudSize.Visible = false;
this.lblWidth.Visible = true;
this.nudWidth.Visible = true;
this.lblOutlineColor.Visible = true;
this.btnOutlineColor.Visible = true;
break;
default:
this.Close();
break;
}
}
。。。
依然跪求大神指点迷津
展开
 我来答
tanlian0923
推荐于2018-03-22
知道答主
回答量:18
采纳率:100%
帮助的人:4.8万
展开全部
//Get the ArcGIS install location
string sInstall = ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Path;
//Load the ESRI.ServerStyle file into the SymbologyControl
axSymbologyControl1.LoadStyleFile(sInstall + "\\Styles\\ESRI.ServerStyle");
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
xcy10086
2015-04-15 · TA获得超过455个赞
知道小有建树答主
回答量:296
采纳率:0%
帮助的人:73万
展开全部
将LicenseControl控件拖到窗体的任意位置就好了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
pigzrf
2012-10-08 · TA获得超过534个赞
知道小有建树答主
回答量:429
采纳率:50%
帮助的人:438万
展开全部
LoadStyleFile参数你使用绝对路径试试看!
追问
谢谢,换了绝对路径就好了,但下句话又报错了
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式