机明程序单接收端演示(JmSetupSheetReceiver)
.NET Framework 4.8 控制台程序:接收机明推送的程序单 JSON,还原为强类型 SetupsheetData,并明文 / 分行落盘。
源码文件
| 文件 | 说明 |
|---|---|
Program.cs | HttpListener、命令行交互 |
SetupSheetOps.cs | 反序列化、明文、对象操作 |
Models/SetupsheetModels.cs | 强类型模型 |
程序单提交.txt.example | 机明侧配置样例 |
Samples/sample-setupsheet.json | 联调样例 |
编译与运行
msbuild JmSetupSheetReceiver.csproj /p:Configuration=Release
bin\Release\JmSetupSheetReceiver.exe
默认监听:http://127.0.0.1:1234/
收到 POST 后落盘
Received\*.json— 原文(机明真实推送一般为单行)Received\*.pretty.json— 分行稿(便于阅读)Received\*.txt— 中英对照明文
Body 固定按 UTF-8 解码。
常用参数 / 命令
JmSetupSheetReceiver.exe --fail
控制台:summary / text / tools / tool <名> / images / dump / load / help / quit
自测样例
$body = Get-Content -Raw -Encoding UTF8 Samples\sample-setupsheet.json
Invoke-RestMethod -Uri http://127.0.0.1:1234/ -Method Post -Body $body -ContentType "application/json; charset=utf-8"
仅供联调学习,不含鉴权与生产级持久化。