Fo-dicom通过C-store方式发送图片

 1 using Dicom.Network;
 2 using System;
 3 using System.Collections.Generic;
 4 using System.Linq;
 5 using System.Text;
 6 using System.Threading.Tasks;
 7 
 8 namespace TestFo_dicom
 9 {
10     class Program
11     {
12 
13         public static string Result { get; set; }
14         //打开工具-nuget包管理器-程序包管理器控制台
15         //Install-Package fo-dicom.Desktop -Version 4.0.5
16 
17         static void Main(string[] args)
18         {
19             Test();
20             Console.WriteLine(Result);
21             Console.ReadLine();
22         }
23 
24 
25         [Obsolete]
26         public static void Test()
27         {
28             try
29             {
30 
31                 var client = new DicomClient();
32                 client.NegotiateAsyncOps();
33                 var request = new DicomCStoreRequest(@"E:\Dicom影像图片\1.2.156.112536.2.560.228111019169037214.1334022818108.1\IMG1.2.156.112536.2.560.228111019169037214.1334022978277.5.dcm");
34 
35                 request.OnResponseReceived += (req, response) =>
36                 {
37                     Result = response.Status.ToString();
38                 };
39 
40                 client.AddRequest(request);
41                 client.Send("192.168.35.185", 9000, false, "local", "ASOM");
42 
43             }
44             catch (Exception ex)
45             {
46                 Console.WriteLine(ex.Message);
47                 Console.ReadLine();
48                 throw ex;
49             }
50         }
51     }
52 }

 

posted @ 2020-07-24 16:08  xiaojianjian  阅读(1322)  评论(0)    收藏  举报