1. 程式人生 > 其它 >AE簡單建立專案——初始化license

AE簡單建立專案——初始化license

1.新建好Microsoft visual studio專案後,初始化license,在啟動Program Main設定:

static void Main(){
            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            #region 初始化許可
            IAoInitialize m_AoInitialize = new AoInitializeClass();
            m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);
            m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
            m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);
            m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
            
//esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable; ////licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo); //if (licenseStatus == esriLicenseStatus.esriLicenseNotInitialized) //{ // MessageBox.Show("沒有esriLicenseProductCodeArcInfo許可!");
// Application.Exit(); //} #endregion Application.Run(new Form1()); }