本文整理汇总了C#中IMessage.Read方法的典型用法代码示例。如果您正苦于以下问题:C# IMessage.Read方法的具体用法?C# IMessage.Read怎么用?C# IMessage.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessage
的用法示例。
在下文中一共展示了IMessage.Read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeResponse
private Object DeserializeResponse(IMessage message, ParameterDefinition result)
{
// Nothing is expected
if (result == null)
{
return null;
}
return message.Read(result.Name, result.Type, result.StreamingFormat);
}
示例2: SaCapturebyVisacom
//in visacom mode
private void SaCapturebyVisacom(IMessage sesnCapture,string name = "",int delay = 5000)
{
StringBuilder filename = new StringBuilder();
if (name != "")
{
filename.Append(name).Append(@".png");
}
else
{
filename.Append(DateTime.Now.ToString("yyyy-MM-dd_HH_mm_ss")).Append(@".png");
}
string cmd = "MMEM:STOR:SCR \"D:\\rttscr.png\"";//;*OPC?
sesnCapture.WriteString(cmd);
sesnCapture.WriteString("MMEM:DATA? \"D:\\rttscr.png\"");
//this.sa_sesn.WriteString("CALCulate:DATA?");
byte[] readbuf;
readbuf = sesnCapture.Read(1000000);
//WriteDebugText(Encoding.ASCII.GetString(readbuf));
//if(delay>5000)
// Thread.Sleep(delay);
//else
// Thread.Sleep(5000);
sesnCapture.WriteString("MMEM:DEL \"D:\\rttscr.png\"");
sesnCapture.WriteString("*CLS");
byte[] size = { readbuf[1] };
byte[] newbuf = readbuf.Skip(2+ int.Parse(Encoding.ASCII.GetString(size))).Take(readbuf.Length-9).ToArray();
File.WriteAllBytes(_snapPath + filename.ToString(), newbuf);
}