zoukankan      html  css  js  c++  java
  • mysql blob导出文本解密

     blob数据:3132332C31332C302C362C302C312C392C342C352C32302C342C31312C31302C302C

    #include <fstream>
    #include <iostream>
    #include <stdlib.h>
    using namespace std;
    void   main()
    {
     FILE   *pt;
     if((pt=fopen( "d:\\test2.txt ",   "a+ "))==NULL)
     {
      cout << "erro " <<endl;
     }
     char   ch;
     int i=1;
     while((ch=fgetc(pt))!=EOF)
     {
      if(i%2==0)
      {
      if(ch=='C')
      cout<<',';
      else
      cout <<ch;
      }
      i++;
     }
     fclose(pt);
     getchar();
    }

    解密结果

    12,0,0,0,0,0,0,0,0,0,0,0,0,

    #include <fstream>
    #include <iostream>
    #include <stdlib.h>
    using namespace std;
    void   main()
    {
     FILE   *pt;
     if((pt=fopen( "d:\\test2.txt ",   "a+ "))==NULL)
     {
      cout << "erro " <<endl;
     }
     char   ch;
     int i=1;
     bool bRoleData=false;  // 是否是角色数据
     bool bBlob=false;      //是否是blob
     while((ch=fgetc(pt))!=EOF)
     {
      if(bBlob)
      {
       if(i%2==0)
       {
        if(ch=='C')
         cout<<',';
        else
         cout <<ch;
       }
      }
      else if(bRoleData)
      {
       if(ch!='\''&&ch!='X')
       cout <<ch;
      }
      if(ch=='X')
       bBlob=true;
      if(ch==','||ch=='X'||ch=='\'')
       continue;
      else if(ch=='(')
       bRoleData=true;
      else if(ch==')')
      {
       bRoleData=false;
       bBlob=false;
      }
      if(bBlob)
       i++;
      if(ch==';')
       i=1;
     }
     fclose(pt);
     getchar();
    }

  • 相关阅读:
    Dom页面加载
    Redis
    Ubuntu下git的安装与使用
    类Xadmin插件--海豚插件
    Python基础指随笔
    前端必须掌握30个CSS3选择器
    SweetAlert插件示例
    Pylint在项目中的使用
    django Cookie、Session和自定义分页
    django创建超级用户
  • 原文地址:https://www.cnblogs.com/byfei/p/3112301.html
Copyright © 2011-2022 走看看