ArcGis 开发注册

Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                if (!Common.AELicense.AoInit(true))
                {
                    MessageBox.Show("注册ArcGIS许可失败,请检查环境!", "提示信息");
                    return;
                }
                //设置应用程序处理异常方式:ThreadException处理
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                //处理UI线程异常
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
                //处理非UI线程异常
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

                if (!ArcGISRuntimeEnvironment.IsInitialized)
                    ArcGISRuntimeEnvironment.InstallPath = Directory.GetCurrentDirectory();
                ArcGISRuntimeEnvironment.Initialize();
                string licenseKey = "runtimeadvanced,1000,rud12345678,none,12345678";
                string[] extensions = { "runtimeanalysis,1000,rud12345678,none,12345678",
                "runtimesmpe,1000,rud12345678,none,12345678",
                "runtimesmpj,1000,rud12345678,none,12345678",
                "runtimesmpla,1000,rud12345678,none,12345678",
                "runtimesmpmea,1000,rud12345678,none,12345678",
                "runtimesmpna,1000,rud12345678,none,12345678"};
                //if (!ArcGISRuntimeEnvironment.IsInitialized)
                //    ArcGISRuntimeEnvironment.InstallPath = Directory.GetCurrentDirectory();
                ArcGISRuntimeEnvironment.SetLicense(licenseKey, extensions);

 

posted @ 2020-05-13 09:31  天要下雨娘要嫁人  阅读(447)  评论(0)    收藏  举报