gpt4 book ai didi

vb.net - 使用带有 MLLP 的 VB.NET 发送 HL7

转载 作者:可可西里 更新时间:2023-11-01 02:48:32 26 4
gpt4 key购买 nike

我正在尝试使用带有 mllp 的 vb.net 发送 hl7,谁能告诉我这是我的代码错误

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

最佳答案

你交换了 endblock 和 returnblock。所以交换它们

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

由于我不熟悉 Visual Basic,我不保证你的 block 的语法定义是正确的,也可以是 &H0D 或类似的。

关于vb.net - 使用带有 MLLP 的 VB.NET 发送 HL7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36555080/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com