瀏覽代碼

西门子通讯修改

master
pry 2 年之前
父節點
當前提交
fadbeb99e1
共有 1 個檔案被更改,包括 9 行新增4 行删除
  1. +9
    -4
      BPASmartClient.S7Net/EntityClassResolution.cs

+ 9
- 4
BPASmartClient.S7Net/EntityClassResolution.cs 查看文件

@@ -46,7 +46,7 @@ namespace BPASmartClient.S7Net
break;
case "String":
//numBytes += 256.0;
numBytes += 256.0;
numBytes += 1.0;
break;
default:
numBytes = GetClassSize(Activator.CreateInstance(type), numBytes, isInnerProperty: true);
@@ -190,10 +190,15 @@ namespace BPASmartClient.S7Net
break;
}
case "String":
byte[] sarray = new byte[256];
Array.Copy(bytes, (int)numBytes, sarray, 0, 256);
//byte[] sarray = new byte[256];
//Array.Copy(bytes, (int)numBytes, sarray, 0, 256);
//obj = GetGb2312()?.GetString(sarray).Trim().Replace(" ", "").Replace("\n", "");
//numBytes += 256.0;

byte[] sarray = new byte[1];
Array.Copy(bytes, (int)numBytes, sarray, 0, 1);
obj = GetGb2312()?.GetString(sarray).Trim().Replace(" ", "").Replace("\n", "");
numBytes += 256.0;
numBytes += 1;
break;
default:
{


Loading…
取消
儲存