首页 > 代码库 > AE、AS调用时用代码提供许可(不需要添加LicenseControl控件)

AE、AS调用时用代码提供许可(不需要添加LicenseControl控件)

private void CheckBindLicense()        {            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);            esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable;            licenseStatus = CheckOutLicenses(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);        }        /// <summary>        /// 授权        /// </summary>        /// <param name="productCode"></param>        /// <returns></returns>        private esriLicenseStatus CheckOutLicenses(esriLicenseProductCode productCode)        {            esriLicenseStatus licenseStatus;            IAoInitialize m_AoInitialize = new AoInitializeClass();            //是否产品是可能的            licenseStatus = m_AoInitialize.IsProductCodeAvailable(productCode);            if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)            {                //用相应的许可文件进行初始化                licenseStatus = m_AoInitialize.Initialize(productCode);            }            return licenseStatus;        }