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

using Dicom.Network;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestFo_dicom
{
class Program
{

public static string Result { get; set; }
//打开工具-nuget包管理器-程序包管理器控制台
//Install-Package fo-dicom.Desktop -Version 4.0.5

static void Main(string[] args)
{
Test();
Console.WriteLine(Result);
Console.ReadLine();
}


[Obsolete]
public static void Test()
{
try
{

var client = new DicomClient();
client.NegotiateAsyncOps();
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");

request.OnResponseReceived += (req, response) =>
{
Result = response.Status.ToString();
};

client.AddRequest(request);
client.Send("192.168.35.185", 9000, false, "local", "ASOM");

}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
throw ex;
}
}
}
}

猜你喜欢

转载自www.cnblogs.com/wangjian110520/p/13372501.html