NetReceiveCFindResponse Example for C#

//LEADDICOMNet1 is a predefined LEADDicomNet object
//LEADDICOM1 is a DICOM Dataset defined outside this method
//This example uses the predefined variable "nFileCount" of type "int"
private void LEADDICOMNet1_NetReceiveCFindResponse(int hNet, short nPresentationID, short nMessageID, string pszClass, int nStatus, int hDS)
{
   string strPeerAddress = null;
   string strStatus = null;
   string strMsg = null;
   string strFileName = null;
   strPeerAddress = LEADDICOMNet1.GetPeerAddress(hNet);
   if (nStatus == (int)LTDNCLib.DicomCommandStatusConstants.COMMAND_STATUS_PENDING)
      strStatus = "COMMAND_STATUS_PENDING";
   if (nStatus == (int)LTDNCLib.DicomCommandStatusConstants.COMMAND_STATUS_SUCCESS)
      strStatus = "COMMAND_STATUS_SUCCESS";
   if (nStatus == (int)LTDNCLib.DicomCommandStatusConstants.COMMAND_STATUS_CANCEL)
      strStatus = "COMMAND_STATUS_CANCEL";
   strMsg = "*** OnNetReceiveCFindResponse ***" + System.Environment.NewLine + "Peer[" + strPeerAddress + "]" + System.Environment.NewLine + "nPresentationID[" + System.Convert.ToString(nPresentationID).ToString() + "]" + System.Environment.NewLine + "nMessageID[" + System.Convert.ToString(nMessageID).ToString() + "]" + System.Environment.NewLine + "pszClass[" + pszClass + "]" + System.Environment.NewLine + "strStatus[" + strStatus + "]" + System.Environment.NewLine;
   if (hDS != 0)
   {
      //nFileCount is used to track the current CFindRequest responses count.
      nFileCount = nFileCount + 1;
      strFileName = "d:\\temp\\CFind" + nFileCount.ToString() + ".dic";
      LEADDICOM1.SaveExtDS(hDS, strFileName, 0);
      strMsg = strMsg + "Saving[" + strFileName + "]";
   }
   MessageBox.Show(strMsg);
}