بسم الله
هذا كود VB

Imports ESRI.ArcGIS.esriSystem


Public Class Form1
Private m_aoInit As IAoInitialize
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load



End Sub

Public Sub New()

' This call is required by the Windows Form Designer.
InitializeComponent()
m_aoInit = New AoInitialize

If m_aoInit Is Nothing Then
MsgBox("Unable to initialize. This application cannot run!")
Me.Close()
Exit Sub
End If

If m_aoInit.IsProductCodeAvailable(esriLicenseProduct Code.esriLicenseProductCodeArcView) = esriLicenseStatus.esriLicenseAvailable Then
If m_aoInit.Initialize(esriLicenseProductCode.esriLic enseProductCodeArcView) <> esriLicenseStatus.esriLicenseCheckedOut Then
MsgBox("Problem with the ArcGIS license. This application cannot run!")
Me.Close()
Exit Sub
End If
Else
MsgBox("You need an ArcGIS product installed to run this application!")
Me.Close()
Exit Sub
End If
' Add any initialization after the InitializeComponent() call.

End Sub
End Class

ماهر عبدالكريم