ArcGIS License初始化

            IAoInitialize m_AoInitialize = null;

            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            if (!RuntimeManager.Bind(ProductCode.EngineOrDesktop))
            {
                return;
            }
            m_AoInitialize = new AoInitializeClass();
            esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable;
            licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);
            if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut)
            {
                licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);
                if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut)
                {
                    return;
                }
            }
            //迁出空间分析扩展模块
            if (m_AoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst) != esriLicenseStatus.esriLicenseCheckedOut)
            {
                return;
            }

你可能感兴趣的:(ArcGIS License初始化)