SendCEchoRequest Example for C#

//LEADDICOMNet1 is a predefined LEADDicomNet object
//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestSendCEchoRequest ( )
{
   const string UID_VERIFICATION_CLASS = "1.2.840.10008.1.1";
   // Verification SOP Class
   string szUID = null;
   short nID = 0;
   short nRet = 0;
   int hPDU = 0;
   //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)
   {
      nRet = LEADDICOM1.FindUID(szUID);
      if (nRet == 0)
         MessageBox.Show("Abstract Syntax, " + LEADDICOM1.get_CurrentUID().Name + ", Not Supported by Association!");
      else
         MessageBox.Show("Abstract Syntax, " + szUID + ", Not Supported by Association!");
      return;
   }
   //now, use the high-level method to send the command set
   LEADDICOMNet1.SendCEchoRequest(LEADDICOMNet1.hNet, nID, 99, szUID);
}