當前位置: 首頁>>代碼示例>>C#>>正文


C# ByteBuffer.ToByteArray方法代碼示例

本文整理匯總了C#中System.ByteBuffer.ToByteArray方法的典型用法代碼示例。如果您正苦於以下問題:C# ByteBuffer.ToByteArray方法的具體用法?C# ByteBuffer.ToByteArray怎麽用?C# ByteBuffer.ToByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.ByteBuffer的用法示例。


在下文中一共展示了ByteBuffer.ToByteArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PutBody

        protected override void PutBody(ByteBuffer buf)
        {
            // 初始密鑰
            buf.PutChar((char)user.QQKey.LoginInfo_Magic_Token.Length);
            buf.Put(user.QQKey.LoginInfo_Magic_Token);
            ByteBuffer DecodedBuf = new ByteBuffer();
            DecodedBuf.PutChar((char)0x010D);
            DecodedBuf.Put(0x00);
            DecodedBuf.Put(new byte[] { 0x01, 0x01 });
            DecodedBuf.Put(VersionData.QQ09_LOCALE);
            DecodedBuf.Put(VersionData.QQ09_VERSION_SPEC);
            DecodedBuf.PutChar((char)Client.QQUser.QQKey.Answer_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.Answer_Token);

            DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Token);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_UnknowData);
            DecodedBuf.Put(Client.ServerTime);

            DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Data_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Data_Token);
            DecodedBuf.PutChar((char)0x0000);
            DecodedBuf.PutInt(0x00000000);
            //Client.QQUser.QQKey.Key = Client.QQUser.QQKey.LoginInfo_Key1;//可能要用到
            byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
            buf.Put(EncodedBuf);
            #if DEBUG
            Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.InitKey));
            Client.LogManager.Log(ToString() + " UnBody: " + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
            #endif
        }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:31,代碼來源:LoginGetInfoPacket.cs

示例2: PutBody

        protected override void PutBody(ByteBuffer buf)
        {
            // 初始密鑰
            //buf.Put(user.QQKey.InitKey);
            buf.PutChar((char)user.QQKey.LoginInfo_Magic_Token.Length);
            buf.Put(user.QQKey.LoginInfo_Magic_Token);
            ByteBuffer DecodedBuf = new ByteBuffer();
            DecodedBuf.PutChar((char)0x0101);
            DecodedBuf.PutChar((char)0x0000);
            DecodedBuf.Put((byte)Client.QQUser.QQKey.LoginInfo_Token.Length);
            DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Token);

            DecodedBuf.Put(new byte[]{0x10,0x03,0xC8,0xEC,0xC8,0x96,
                0x8B,0xF2,0xB3,0x6B,0x4D,0x0C,0x5C,0xE0,0x6A,0x51,0xCE});//unknown data
            //Client.QQUser.QQKey.Key = Client.QQUser.QQKey.LoginInfo_Key1;//可能要用到
            byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
            #if DEBUG
            Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.LoginInfo_Key1));
            Client.LogManager.Log(ToString() + " UnBody:" + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
            #endif
            buf.Put(EncodedBuf);
            #if DEBUG
            Client.LogManager.Log(ToString() + " EnBody:" + Utils.Util.ToHex(buf.ToByteArray()));
            #endif
        }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:25,代碼來源:LoginA4Packet.cs

示例3: Read

 /// <summary>
 /// </summary>
 /// <param name="buf">The buf.</param>
 public void Read(ByteBuffer buf)
 {
     ByteBuffer temp = new ByteBuffer();
     int i = 0;
     while (true)
     {
         byte b = buf.Get();
         if (b != 0x1F)
         {
             if (b != 0x1E)
             {
                 temp.Put(b);
             }
             else
             {
                 if (i == 0)
                 {
                     QQ = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0000);
                 }
                 else if (i == 1)
                     Nick = Utils.Util.GetString(temp.ToByteArray());
                 else if (i == 2)
                     Province = Utils.Util.GetString(temp.ToByteArray());
                 i++;
                 temp.Initialize();
             }
         }
         else
         {
             Face = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0);
             break;
         }
     }
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:37,代碼來源:UserInfo.cs

示例4: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " Decoded Data:" + Utils.Util.ToHex(buf.ToByteArray()));
     Client.LogManager.Log(ToString() + ":No use data until now!You can check this dat! It's said it has a key");
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:7,代碼來源:LoginA4ReplyPacket.cs

示例5: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
     ReplyCode = (ReplyCode)buf.Get();
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:7,代碼來源:UploadGroupFriendReplyPacket.cs

示例6: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     buf.Put(Reply);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:7,代碼來源:ReceiveIMReplyPacket.cs

示例7: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     // 要加的QQ號的字符串形式
     buf.PutInt(To);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:8,代碼來源:AddFriendPacket.cs

示例8: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     byte[] b = buf.ToByteArray();
     QQ = Utils.Util.GetInt(Utils.Util.GetString(b), 0);
     if (QQ == user.QQ)
         Success = true;
     else
         Success = false;
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:9,代碼來源:ModifyInfoReplyPacket.cs

示例9: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
     SubCommand =(AddFriendAuthSubCmd) buf.Get();
     To = buf.GetInt();
     ReplyCode = (ReplyCode)buf.Get();
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:9,代碼來源:AddFriendAuthorizeReplyPacket.cs

示例10: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     buf.Put(0x88);
     buf.PutInt(Client.QQUser.QQ);
     buf.Put(0x00);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:9,代碼來源:GetLevelPacket.cs

示例11: PutBody

 /// <summary>
 /// 初始化包體
 /// </summary>
 /// <param name="buf">The buf.</param>
 protected override void PutBody(ByteBuffer buf)
 {
     buf.Put((byte)0x1F);
     buf.Put((byte)0x01);
     buf.PutInt(BeginFrom);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:13,代碼來源:DownloadGroupFriendPacket.cs

示例12: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     // 初始密鑰
     buf.Put(user.QQKey.InitKey);
     ByteBuffer DecodedBuf = new ByteBuffer();
     DecodedBuf.Put(new byte[] { 0x00, 0x01 });
     DecodedBuf.Put(VersionData.QQ09_LOCALE);
     DecodedBuf.Put(VersionData.QQ09_VERSION_SPEC);
     DecodedBuf.Put((byte)0x00);
     DecodedBuf.Put(Client.ServerInfo.GetBytes());
     //DecodedBuf.Put(zeros);//15字節長度00
     byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.InitKey);
     buf.Put(EncodedBuf);
     #if DEBUG
     Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.InitKey));
     Client.LogManager.Log(ToString() + " Uncrypt Body:" + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:18,代碼來源:LoginTouchPacket.cs

示例13: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     buf.Position += 15;//16個00
     buf.Put(0x00);
     //buf.Put(user.PasswordKey);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:9,代碼來源:LogoutPacket.cs

示例14: PutBody

 protected override void PutBody(ByteBuffer buf)
 {
     // 命令類型
     buf.Put((byte)SubCommand);
     // 內部ID
     buf.PutInt(ClusterId);
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:10,代碼來源:ClusterJoinPacket.cs

示例15: GetBytes

 /// <summary>
 /// 將serverInfo轉成byte[]
 /// </summary>
 /// <returns></returns>
 public byte[] GetBytes()
 {
     ByteBuffer buf = new ByteBuffer();
     buf.Put(CSP_wRedirectCount);
     buf.Put(CSP_cRedirectCount);
     buf.Put(CSP_dwConnIspID);
     buf.Put(CSP_dwServerReserve);
     buf.Put(CSP_dwConnIP);
     return buf.ToByteArray();
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:14,代碼來源:ServerInfo.cs


注:本文中的System.ByteBuffer.ToByteArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。