获取Server中的IFeatureClass

ESRI.ArcGIS.ADF.Web.UI.WebControls.Map mapctrl = (ESRI.ArcGIS.ADF.Web.UI.WebControls.Map) args.Control;
       
        // Get MapFunctionality from the control...
        MapFunctionality mapfunc = (MapFunctionality) mapctrl.GetFunctionality(mapctrl.MapResourceManagerInstance.ResourceItems.Count - 1);
        MapResourceLocal mapres = (MapResourceLocal) mapfunc.MapResource;
        IServerContext sc = mapres.ServerContextInfo.ServerContext;
        IMapServer map = mapres.MapServer;

        IMapServerObjects mapobj = (IMapServerObjects) map;
        IMap fgmap = mapobj.get_Map(map.DefaultMapName);
        IFeatureLayer fl = (IFeatureLayer) fgmap.get_Layer(0);
        IFeatureClass fc = fl.FeatureClass;

你可能感兴趣的:(server)