We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你的代码中这个方法没有实现,那么我如何可以读取到字符串呢 public Result ReadString(string address) { throw new NotImplementedException(); }
The text was updated successfully, but these errors were encountered:
通过下面的代码即可实现,很简单 public string ReadString(string deviceName,ushort Length) { Result<byte[]> result1 = new(); if (client.Connected) { result1 = client.Read(deviceName, Length); } //byte[] result2 = new byte[Length]; //result2 result1.Value = result1.Value.TakeWhile((v, index) => result1.Value.Skip(index).Any(w => w != 0x00)).ToArray(); string str = Encoding.Default.GetString(result1.Value); return str; }
Sorry, something went wrong.
No branches or pull requests
你的代码中这个方法没有实现,那么我如何可以读取到字符串呢
public Result ReadString(string address)
{
throw new NotImplementedException();
}
The text was updated successfully, but these errors were encountered: