Resource type implementation specified in ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Local.config is ignored by .NET Web ADF.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM045843
已提交
June 9, 2009
上次修改时间
April 2, 2025
适用范围
No Product Found
找到的版本
9.3.1
编程语言
C#
修正版本
N/A
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
解决办法
The workaround (see below) is to derive from GISDataSourceLocal and override CreateResource. In the datasource config file, they would have to point to their custom datasource implementation instead of GISDataSourceLocal. public override IGISResource CreateResource(ResourceInfo resourceInfo, string name) { IGISResource resource = null; switch (resourceInfo.Type) { case ResourceType.Map: if (ImageResourceBase.IsImageResourceDefinition(resourceInfo.ResourceDefinition)) { IMapResource mapResource = new ImageResourceLocal(name, this); mapResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = mapResource; } else { IMapResource mapResource = new MyMapResourceLocal(name, this); <== Use custom map resource implementation here mapResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = mapResource; } break; case ResourceType.Geocode: IGeocodeResource gcResource = new GeocodeResourceLocal(name, this); gcResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = gcResource; break; case ResourceType.Geoprocessing: IGeoprocessingResource gpResource = new GeoprocessingResourceLocal(name, this); gpResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = gpResource; break; } return resource; } Then, public class myMapResourceLocal:MapResourceLocal { public myMapResourceLocal() : base() { // create a writer and open the file TextWriter tw = new StreamWriter(@"C:\temp\m_gisresourcelocal\date.txt"); // write a line of text to the file tw.WriteLine(DateTime.Now); // close the stream tw.Close(); } public myMapResourceLocal(string name, GISDataSourceLocal service) : base(name, service) { // create a writer and open the file TextWriter tw = new StreamWriter(@"C:\temp\m_gisresourcelocal\date.txt"); // write a line of text to the file tw.WriteLine(DateTime.Now); // close the stream tw.Close(); } }