using DicomObjects; using DicomObjects.DicomUIDs; /* * If you use: * using (var cn = new DicomAssociation()) * { * ... * } * then the using block will automatically call cn.Dispose() at the end */ var cn = new DicomAssociation(); cn.RequestedContexts.Add(SOPClasses.Verification); cn.Open("localhost", 104, "callingAET", "calledAET"); cn.Echo(); // Dispose() performs Close() internally, so there's no need to call Close() separately cn.Dispose();