浏览代码

西门子通讯修改

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:
{


正在加载...
取消
保存