• arcengine C# 读写lyr(转)


    写lyr    

    {

               IFeatureLayer LineLayer = axMapControl1.get_Layer(0) as IFeatureLayer;
                ILayerFile layerFile = new LayerFileClass();
                //create a new layer file
                layerFile.New(saveFileDialog.FileName);
                //attach the layer file with the actual layer
                layerFile.ReplaceContents((ILayer)LineLayer);
                // savee the layer file
                layerFile.Save();
              


            }
            /// <summary>
            /// 读取层文件
            /// </summary>
            public void ReadLyr(string pFileName)
            {
                try
                {
                    IMapControl2 myAddLayerMap = new MapControlClass();
                    myAddLayerMap.AddLayerFromFile(pFileName, 0);
                    this.axMapControl1.AddLayer(myAddLayerMap.get_Layer(0));
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }

  • 相关阅读:
    [luoguU48834][count]
    [ZROJ110][假如战争今天爆发]
    [luogu4860][Roy&October之取石子II]
    [luogu4018][Roy&October之取石子]
    [luoguU48574][藏妹子之处]
    [20181025晚][模拟赛]
    [20181025上午][模拟赛]
    ElasticSearch业务逻辑案例
    ElasticSearch安装及使用
    面试必问:ACID/CAP
  • 原文地址:https://www.cnblogs.com/CSharpLover/p/5846095.html
Copyright © 2020-2023  润新知