Gets the client information.
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property ClientAE As AeInfo |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As StoreClient
Dim value As AeInfo
value = instance.ClientAE
|
C# | |
---|
public AeInfo ClientAE {get;} |
Return Value
An
AeInfo object with the client AE information.
Example
Visual Basic | Copy Code |
---|
<Test> _
Public Sub StoreDicom()
Leadtools.Examples.Support.Unlock()
Dim clientInfo As AeInfo = New AeInfo()
clientInfo.Address = Dns.GetHostName()
clientInfo.AETitle = "TEST_CLIENT"
clientInfo.Port = 1000
Dim queryClient As DbQueryClient = New DbQueryClient (clientInfo)
queryClient.EnableLog = True
queryClient.LogFileName = ("c:\DicomLog.txt")
Dim series As ClientQueryDataSet = queryClient.FindSeries (New FindQuery ())
If series.Series.Count > 0 Then
Dim scpInfo As DicomScp = New DicomScp()
scpInfo.AETitle = "LEAD_SERVER"
scpInfo.Port = 104
scpInfo.Timeout = 30
Dim addressFound As Boolean
Dim addresses As IPAddress()
addressFound = False
addresses = Dns.GetHostAddresses (Dns.GetHostName ())
For Each address As IPAddress In addresses
If address.AddressFamily = System.Net.Sockets.AddressFamily.InterNetwork Then
addressFound = True
scpInfo.PeerAddress = address
Exit For
End If
Next address
If (Not addressFound) Then
Throw New ArgumentException("Couldn't resolve a valid host Address. Address must conform to IP version 4")
End If
Dim client As StoreClient = New StoreClient(clientInfo, scpInfo, Compression.Native)
client.EnableLog = True
client.LogFileName = ("c:\DicomLog.txt")
client.StoreSeries (series.Series (0).StudyInstanceUID, series.Series (0).SeriesInstanceUID)
Console.WriteLine ("Series {0} has been stored successfully.", series.Series (0).SeriesInstanceUID)
End If
End Sub |
C# | Copy Code |
---|
public void StoreDicom() { Leadtools.Examples.Support.Unlock(); AeInfo clientInfo = new AeInfo(); clientInfo.Address = Dns.GetHostName(); //local machine clientInfo.AETitle = "TEST_CLIENT"; clientInfo.Port = 1000; //Make sure that the FindAddIn is configured properly before using this class. DbQueryClient queryClient = new DbQueryClient ( clientInfo ) ; queryClient.EnableLog = true; queryClient.LogFileName = ( @"c:\DicomLog.txt" ) ; ClientQueryDataSet series = queryClient.FindSeries ( new FindQuery ( ) ) ; if ( series.Series.Count > 0 ) { DicomScp scpInfo = new DicomScp(); scpInfo.AETitle = "LEAD_SERVER"; scpInfo.Port = 104; scpInfo.Timeout = 30; bool addressFound; IPAddress [] addresses ; addressFound = false; addresses = Dns.GetHostAddresses ( Dns.GetHostName ( ) ) ; foreach (IPAddress address in addresses) { //we need to get an IP V4, won't work with IP V6 if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { addressFound = true; scpInfo.PeerAddress = address; break; } } if (!addressFound) { throw new ArgumentException("Couldn't resolve a valid host Address. Address must conform to IP version 4"); } StoreClient client = new StoreClient(clientInfo, scpInfo, Compression.Native); client.EnableLog = true ; client.LogFileName = ( @"c:\DicomLog.txt" ) ; client.StoreSeries ( series.Series [ 0 ].StudyInstanceUID, series.Series [ 0 ].SeriesInstanceUID ) ; Console.WriteLine ( "Series {0} has been stored successfully.", series.Series [ 0 ].SeriesInstanceUID ) ; } } |
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also