2016-04-11 8 views
0

Ich versuche hl7 mit vb.net mit MLLP zu senden, kann mir jemand sagen, dass die falsche meines Codes istsenden HL7 mit VB.NET mit MLLP

Dim StartBlock As String = "0x0b" ' this is start block <SB> 
Dim EndBlock As String = " 0x0d" ' this is end Block <EB> 
Dim ReturnBlock As String = "0x1c" ' this is return <CR> 
Msg = StartBlock & Msg & EndBlock & ReturnBlock 


Dim networkStream As NetworkStream = tcpClient.GetStream() 

If networkStream.CanWrite And networkStream.CanRead Then 
    Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(Msg) 

    networkStream.Write(sendBytes, 0, sendBytes.Length) 
end if 
+1

Ich weiß nicht, was ist los? Haben Sie Fehler? Was erhält der Endpunkt? Sie haben uns keine Informationen gegeben, die uns helfen könnten, ein Problem zu finden. –

Antwort

1

Sie endblock und returnblock ausgetauscht. So sie tauschen

Dim EndBlock As String = "0x1c" ' this is end Block <EB> 
Dim ReturnBlock As String = "0x0d" ' this is return <CR> 

Da ich nicht vertraut bin mit Visual Basic, ich nicht garantieren, dass die Syntax Definition Ihrer Blöcke korrekt ist, könnte auch &H0D oder ähnlich sein.