static void begin(string uid, string title, IPAddress address, int port) { MppsServiceSCU mpps = new MppsServiceSCU(); mpps.Syntaxes.Add(Syntax.ExplicitVrLittleEndian); Association association = new Association(); association.AddService(mpps); if (association.Open(title, address, port)) { DataSet dicom = GetDataSet(@"..\..\begin.dcm"); mpps.Begin(uid, dicom); System.Console.WriteLine("begin done!"); } else { System.Console.WriteLine("\ncan't Open."); } //System.Console.WriteLine("before Close!"); association.Close(); //System.Console.WriteLine("after Close!"); }
public static void Begin(string uid, ApplicationEntity host) { MppsServiceSCU mpps = new MppsServiceSCU(); mpps.Syntaxes.Add(Syntax.ExplicitVrLittleEndian); Association association = new Association(); association.AddService(mpps); if (association.Open(host)) { DataSet dicom = DataSetTest.GetDataSet(Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolKit\Test\Data\Mpps\begin.dcm")); mpps.Begin(uid, dicom); //System.Console.WriteLine("begin done!"); } else { //System.Console.WriteLine("\ncan't Open."); } //System.Console.WriteLine("before Close!"); association.Close(); //System.Console.WriteLine("after Close!"); }