Private void button#click (Object sender, eventargs E)
{
ESRI. ArcGIS. esrisystem. iaoinitialize aoinitialize = new ESRI. ArcGIS. esrisystem. aoinitializeclass ();
ESRI. ArcGIS. esrisystem. ilicenseinformation licenseinformation = (ESRI. ArcGIS. esrisystem. ilicenseinformation) aoinitialize;
System. String string_licenses = NULL;
Try
{
ESRI. ArcGIS. esrisystem. esrilicenseproductcode licenseproductcode = aoinitialize. initializedproduct ();
System. String string_licenseproductname = licenseinformation. getlicenseproductname (licenseproductcode );
String_licenses = "this application is initialized with the following product license:" + system. environment. newline + string_licenseproductname + system. environment. newline + "This application has the following extension licenses checked out :";
ESRI. ArcGIS. esrisystem. ilicenseinfoenum licenseinfoenum = licenseinformation. getproductextensions (licenseproductcode );
Licenseinfoenum. Reset ();
ESRI. ArcGIS. esrisystem. esrilicenseextensioncode licenseextensioncode = licenseinfoenum. Next ();
While (! (System. Convert. toint32 (licenseextensioncode) =-1 ))
{
If (aoinitialize. isextensioncheckedout (licenseextensioncode) = true)
{
System. String string_licenseextensionname = licenseinformation. getlicenseextensionname (licenseextensioncode );
String_licenses = string_licenses + system. environment. newline + string_licenseextensionname;
}
Licenseextensioncode = licenseinfoenum. Next ();
}
System. Windows. Forms. MessageBox. Show (string_licenses );
}
Catch (system. Exception ex)
{
System. Windows. Forms. MessageBox. Show (ex. tostring ());
}
}