旅途

如果想飞得高,就该把地平线忘掉

AoInitailize 权限
[Visual Basic 6.0]
Option Explicit
Private m_pAoInitialize As IAoInitialize

Private Sub Form_Load()
  
  
  
  
  
  Dim licenseStatus As esriLicenseStatus
  
  licenseStatus = CheckOutLicenses(esriLicenseProductCodeEngineGeoDB)
  If (licenseStatus = esriLicenseNotLicensed) Then
    
    licenseStatus = CheckOutLicenses(esriLicenseProductCodeArcEditor)
    
    If ((licenseStatus = esriLicenseNotLicensed) Or (licenseStatus = esriLicenseUnavailable)) Then
      
      licenseStatus = CheckOutLicenses(esriLicenseProductCodeArcInfo)
    End If
  End If
  
  
  
  If (licenseStatus = esriLicenseNotLicensed) Then
    MsgBox "You are not licensed to run this product"
    Unload Form1
  
  ElseIf (licenseStatus = esriLicenseUnavailable) Then
    MsgBox "There are insufient licenses to run"
    Unload Form1
  
  ElseIf (licenseStatus = esriLicenseFailure) Then
    MsgBox "Unexpected license failure please contact you administrator'"
    Unload Form1
  
  ElseIf (licenseStatus = esriLicenseAlreadyInitialized) Then
    MsgBox "You license has already been initialized please check you implementation"
    Unload Form1
  
  ElseIf (licenseStatus = esriLicenseCheckedOut) Then
    MsgBox "Licenses checked out successfully"
  End If
  
End Sub

Private Sub Form_Unload(Cancel As Integer)

  
  m_pAoInitialize.CheckInExtension (esriLicenseExtensionCodeSpatialAnalyst)
  
  m_pAoInitialize.Shutdown

End Sub

Private Function CheckOutLicenses(productCode As esriLicenseProductCode) As esriLicenseStatus
  
  Dim licenseStatus As esriLicenseStatus
  Set m_pAoInitialize = New AoInitialize
  CheckOutLicenses = esriLicenseUnavailable
    
  
  licenseStatus = m_pAoInitialize.IsProductCodeAvailable(productCode)
  If (licenseStatus = esriLicenseAvailable) Then
    
    licenseStatus = m_pAoInitialize.IsExtensionCodeAvailable(productCode, esriLicenseExtensionCodeSpatialAnalyst)
    If (licenseStatus = esriLicenseAvailable) Then
      
      licenseStatus = m_pAoInitialize.Initialize(productCode)
      If (licenseStatus = esriLicenseCheckedOut) Then
          
        licenseStatus = m_pAoInitialize.CheckOutExtension(esriLicenseExtensionCodeSpatialAnalyst)
      End If
    End If
  End If
  
  CheckOutLicenses = licenseStatus
  
End Function
 
阅读更多
个人分类:
想对作者说点什么? 我来说一句

rbac权限.pdf

2017年09月26日 44KB 下载

struts+hibernate权限管理系统

2009年07月10日 12.54MB 下载

VBA ACCESS 权限

2011年01月19日 87KB 下载

权限导入 JAVA 权限导入 JAVA

2010年07月17日 10KB 下载

计算机权限 计算机权限

2009年06月04日 33KB 下载

通用权限系统设计说明书

2008年08月26日 182KB 下载

jqgrid开源权限

2011年10月09日 18KB 下载

没有更多推荐了,返回首页

不良信息举报

AoInitailize 权限

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭