日期:2014-05-17 浏览次数:20525 次
class AMF_Post_Data
{
public List<byte> message;
/// <summary>
/// 初始化Message
/// </summary>
/// <param name="at"></param>
/// <param name="headers"></param>
/// <param name="bodies"></param>
public AMF_Post_Data(AMFType at, int headers, int bodies)
{
//AMF版本
if (at == AMFType.AMF0)
{
message = new List<byte>(new byte[] { 0x00, 0x00 });
}
else if (at == AMFType.AMF3)
{
message = new List<byte>(new byte[] { 0x00, 0x03 });
}
//header数量
message.Add(BitConverter.GetBytes(headers)[1]);
message.Add(BitConverter.GetBytes(headers)[0]);
//body数量
message.Add(BitConverter.GetBytes(bodies)[1]);
message.Add(BitConverter.GetBytes(bodies)[0]);
}
/// <summary>
/// 添加Target
/// </summary>
/// <param name="target"></param>
/// <param name="Response"></param>
public void AddTargetAndResponse(string target, string Response)
{
//添加Target长度
message.Add(BitConverter.GetBytes(target.Length)[1]);
&nb