有关ServerStyle文件的删除问题
我在做ServerStyle符号删除的时候,出现异常,寻找GIS大侠帮助解决问题。string strPath = @"c:\Graph.ServerStyle";
ServerStyleGalleryClass pStyleGallery = new ServerStyleGalleryClass();
pStyleGallery.AddFile(strPath);
pStyleGallery.TargetFile = strPath;
IEnumStyleGalleryItem pEnumStyleItem = pStyleGallery.get_Items("Line Symbols", strPath, "");
IStyleGalleryItem pStyleItem = pEnumStyleItem.Next();
while (pEnumStyleItem != null)
{
pStyleGallery.RemoveItem(pStyleItem);
pStyleItem = (ServerStyleGalleryItem)pEnumStyleItem.Next();
}
报错:对 COM 组件的调用返回了错误 HRESULT E_FAIL。
ErrorCode : -2147467259 --------------------编程问答-------------------- IStyleGallery pStyleGallery = new ESRI.ArcGIS.Framework.StyleGalleryClass();
IStyleGalleryStorage pStyleGalleryStorage = pStyleGallery as IStyleGalleryStorage;
string strPath = @"c:\Dimension.style";
pStyleGalleryStorage.AddFile(strPath);
pStyleGalleryStorage.TargetFile = strPath;
IEnumStyleGalleryItem pEnumStyle = pStyleGallery.get_Items("Line Symbols", strPath,"");
pEnumStyle.Reset();
IStyleGalleryItem pStyleItem = pEnumStyle.Next();
while (pStyleItem != null)
{
pStyleGallery.RemoveItem(pStyleItem);
pStyleItem = pEnumStyle.Next();
}
这样可以删除Style文件,但是怎么样去删除ServerStyle文件呢,请大侠指点。
补充:.NET技术 , 其他语言