ArcEngine调用GP工具之Erase总是报…

原因:权限不够,AxLicenseControl默认是ArcEngine权限,调用此工具需要ArcInfo或Advanced权限

解决办法:(1)右击AxLicenseControl控件,属性中勾选Advanced;

                     (2)使用代码进行权限设置,下面几行代码写在InitalizeComponent();之前

                               IAoInitialize aoInitialize = new AoInitialize();

                               esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable;

                               licenseStatus =  aoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);

Tip:最好使用代码授权,控件属性有时候不管用,使用代码授权的话AxLicenseControl属性中就不必勾选了

#ae开发

你可能感兴趣的:(ArcEngine调用GP工具之Erase总是报…)