SendCEchoRequest Example for VB.NET

'LEADDICOMNet1 is a predefined LEADDicomNet object
'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestSendCEchoRequest ( )
   Const UID_VERIFICATION_CLASS As String = "1.2.840.10008.1.1"
   ' Verification SOP Class
   Dim szUID As String
   Dim nID As Short
   Dim nRet As Short
   Dim hPDU As Integer
   'send an Echo Request Command to the server
   szUID = UID_VERIFICATION_CLASS
   hPDU = LEADDICOMNet1.GetAssociate(LEADDICOMNet1.hNet)
   nID = LEADDICOMNet1.FindPresentationAbstract(hPDU, szUID)
   If (nID = 0) Then
      nRet = LEADDICOM1.FindUID(szUID)
      If (nRet = 0) Then
         MessageBox.Show("Abstract Syntax, " & LEADDICOM1.CurrentUID.Name & ", Not Supported by Association!")
      Else
         MessageBox.Show("Abstract Syntax, " & szUID & ", Not Supported by Association!")
      End If
      Exit Sub
   End If
   'now, use the high-level method to send the command set
   LEADDICOMNet1.SendCEchoRequest(LEADDICOMNet1.hNet, nID, 99, szUID)
End Sub