diff --git a/Desktop/C-Store SCP/Program.cs b/Desktop/C-Store SCP/Program.cs index a86e6b7..220f61b 100644 --- a/Desktop/C-Store SCP/Program.cs +++ b/Desktop/C-Store SCP/Program.cs @@ -20,8 +20,12 @@ private static void Main(string[] args) var dict = DicomDictionary.Default; - // start DICOM server on port 11112 - var server = DicomServer.Create(11112); + // start DICOM server on port from command line argument or 11112 + int tmp; + var port = args != null && args.Length > 0 && int.TryParse(args[0], out tmp) ? tmp : 11112; + Console.WriteLine($"Starting C-Store SCP server on port {port}"); + + var server = DicomServer.Create(port); // end process diff --git a/Desktop/Print SCP/Program.cs b/Desktop/Print SCP/Program.cs index 0e5c6ae..2b41386 100644 --- a/Desktop/Print SCP/Program.cs +++ b/Desktop/Print SCP/Program.cs @@ -5,8 +5,6 @@ namespace Print_SCP { using System; - using Dicom; - using Dicom.Imaging; using Dicom.Log; using Dicom.Printing; @@ -19,14 +17,17 @@ private static void Main(string[] args) //This is a simple DICOM Print SCP implementation with Print Job and Send Event Report Support //This sample depends on the Microsoft XPS Document Writer Printer to be installed on the system - //You are free to use what ever printer you like by modifieing the PrintJob DoPrint method hard coded + //You are free to use what ever printer you like by modifying the PrintJob DoPrint method hard coded //printer name - //All print jobs willbe created to the exe folder under a folder named PrintJobs + //All print jobs will be created to the exe folder under a folder named PrintJobs - Console.WriteLine("Starting print SCP server with AET: PRINTSCP on port 8000"); + int tmp; + var port = args != null && args.Length > 0 && int.TryParse(args[0], out tmp) ? tmp : 8000; - PrintService.Start(8000, "PRINTSCP"); + Console.WriteLine($"Starting print SCP server with AET: PRINTSCP on port {port}"); + + PrintService.Start(port, "PRINTSCP"); Console.WriteLine("Press any key to stop the service");