本文整理汇总了C#中BinaryReader.ReadStringNative方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadStringNative方法的具体用法?C# BinaryReader.ReadStringNative怎么用?C# BinaryReader.ReadStringNative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryReader
的用法示例。
在下文中一共展示了BinaryReader.ReadStringNative方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read(BinaryReader reader)
{
ID=reader.ReadInt32();
Name=reader.ReadStringNative();
IP = reader.ReadStringNative();
Location = reader.ReadStringNative();
lng=reader.ReadSingle();
lat=reader.ReadSingle();
Connected=reader.ReadBoolean();
Available=reader.ReadBoolean();
}
示例2: _Process
int _Process()
{
if (_client == null)
return -1;
IPEndPoint ep=null;
byte[] data;
try
{
data=_client.Receive (ref ep);
}catch{
return 0;
}
if (data == null || data.Length == 0)
return 0;
var reader = new BinaryReader (new MemoryStream (data));
int msg = reader.ReadInt32 ();
switch (msg) {
case (int)Messages.Presence:
{
RobotInfo ifo=new RobotInfo();
ifo.Read(reader);
if(OnRobotInfoDetected!=null)
OnRobotInfoDetected(ifo);
}break;
case (int)Messages.DepthData:
break;
case (int)Messages.DepthSize:
break;
case (int)Messages.IsStereo:
break;
case (int)Messages.CameraConfig:
if(OnCameraConfig!=null)
OnCameraConfig(reader.ReadStringNative());
break;
case (int)Messages.ReportMessage:
if(OnReportMessage!=null)
{
int code=reader.ReadInt32();
string str=reader.ReadStringNative();
OnReportMessage(code,str);
}
break;
case (int)Messages.BumpSensorMessage:
if(OnBumpSensor!=null)
{
int count=reader.ReadInt32();
float[] values=new float[count];
for(int i=0;i<count;++i)
{
values[i]=reader.ReadSingle();
}
OnBumpSensor(values);
}
break;
case (int)Messages.IRSensorMessage:
if(OnIRSensor!=null)
{
int count=reader.ReadInt32();
float[] values=new float[count];
for(int i=0;i<count;++i)
{
values[i]=reader.ReadSingle();
}
OnIRSensor(values);
}
break;
case (int)Messages.BatteryLevel:
if(OnBatteryLevel!=null)
OnBatteryLevel(reader.ReadInt32());
break;
case (int)Messages.ClockSync:
break;
case (int)Messages.JointValues:
if(OnJointValues!=null)
{
int count=reader.ReadInt32();
float[] values=new float[count];
for(int i=0;i<count;++i)
{
values[i]=reader.ReadSingle();
}
OnJointValues(values);
}
break;
case (int)Messages.RobotStatus:
if(OnRobotStatus!=null)
{
int val=reader.ReadInt32();
OnRobotStatus((ERobotControllerStatus)val);
}
break;
case (int)Messages.NetValue:
if(OnServiceNetValue!=null)
{
string name=reader.ReadStringNative();
int port=reader.ReadInt32();
OnServiceNetValue(name,port);
}
break;
//.........这里部分代码省略.........