当前位置:编程学习 > JAVA >>

TCPIP监控 看不懂啊。。。。。。

Send: Return Code: 0x00000000
POST /bioffice/vision/RMIServlet HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://139.16.24.7:8888/bioffice/vision/index.jsp
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727)
Host: 139.16.24.7:8888
Content-Length: 113
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: FQPassword=aGJkc3d5eA==; FQSavepassword=true; FQUser=wyx3; FQLogined=true; JSESSIONID=hgqkSnldSd01pGwgMJp4BQ9GZMyQRG1x9fRQyW0LSvPl111jwfdg!-1803517604



Send: Return Code: 0x00000000
className=ClientReportService&methodName=clearSQLResultStore¶ms=%5B%22I0b90988741e1f91e0141e347cbda35d2%22%5D

Receive: Return Code: 0x00000000
HTTP/1.1 200 OK
Date: Wed, 23 Oct 2013 03:07:15 GMT
Content-Length: 33
Content-Type: text/html; charset=GBK
Content-Encoding: gzip
X-Powered-By: Servlet/2.5 JSP/2.1



Receive: Return Code: 0x00000000
00000000  1F 8B 08 00 00 00 00 00 00 00 AB 56 2A 4A 2D 71    ...........V*J-q
00000010  CE 4F 49 55 B2 32 A8 05 00 EF 06 E2 50 0D 00 00    .OIU.2......P...
00000020  00                                 
这些十六进制的东西,是页面响应内容吗? TCPIP --------------------编程问答-------------------- 你可以尝试吧16进制的字符串转成String的形式。。。

我以前做过抓包的工作,不过从来没有研究过这些是为什么

public class Util {
  public Util() {
  }

  /**
   * 将指定byte数组以16进制的形式打印到控制台
   * @param hint String
   * @param b byte[]
   * @return void
   */
  public static void printHexString(String hint, byte[] b) {
    System.out.print(hint);
    for (int i = 0; i < b.length; i++) {
      String hex = Integer.toHexString(b[i] & 0xFF);
      if (hex.length() == 1) {
        hex = ’0′ + hex;
      }
      System.out.print(hex.toUpperCase() + " ");
    }
    System.out.println("");
  }

  /**
   *
   * @param b byte[]
   * @return String
   */
  public static String Bytes2HexString(byte[] b) {
    String ret = "";
    for (int i = 0; i < b.length; i++) {
      String hex = Integer.toHexString(b[i] & 0xFF);
      if (hex.length() == 1) {
        hex = ’0′ + hex;
      }
      ret += hex.toUpperCase();
    }
    return ret;
  }

  /**
   * 将两个ASCII字符合成一个字节;
   * 如:"EF"–> 0xEF
   * @param src0 byte
   * @param src1 byte
   * @return byte
   */
  public static byte uniteBytes(byte src0, byte src1) {
    byte _b0 = Byte.decode("0x" + new String(new byte[]{src0})).byteValue();
    _b0 = (byte)(_b0 << 4);
    byte _b1 = Byte.decode("0x" + new String(new byte[]{src1})).byteValue();
    byte ret = (byte)(_b0 ^ _b1);
    return ret;
  }
--------------------编程问答--------------------
引用 1 楼 AA5279AA 的回复:
你可以尝试吧16进制的字符串转成String的形式。。。

我以前做过抓包的工作,不过从来没有研究过这些是为什么

public class Util {
  public Util() {
  }

  /**
   * 将指定byte数组以16进制的形式打印到控制台
   * @param hint String
   * @param b byte[]
   * @return void
   */
  public static void printHexString(String hint, byte[] b) {
    System.out.print(hint);
    for (int i = 0; i < b.length; i++) {
      String hex = Integer.toHexString(b[i] & 0xFF);
      if (hex.length() == 1) {
        hex = ’0′ + hex;
      }
      System.out.print(hex.toUpperCase() + " ");
    }
    System.out.println("");
  }

  /**
   *
   * @param b byte[]
   * @return String
   */
  public static String Bytes2HexString(byte[] b) {
    String ret = "";
    for (int i = 0; i < b.length; i++) {
      String hex = Integer.toHexString(b[i] & 0xFF);
      if (hex.length() == 1) {
        hex = ’0′ + hex;
      }
      ret += hex.toUpperCase();
    }
    return ret;
  }

  /**
   * 将两个ASCII字符合成一个字节;
   * 如:"EF"–> 0xEF
   * @param src0 byte
   * @param src1 byte
   * @return byte
   */
  public static byte uniteBytes(byte src0, byte src1) {
    byte _b0 = Byte.decode("0x" + new String(new byte[]{src0})).byteValue();
    _b0 = (byte)(_b0 << 4);
    byte _b1 = Byte.decode("0x" + new String(new byte[]{src1})).byteValue();
    byte ret = (byte)(_b0 ^ _b1);
    return ret;
  }

怎么运行啊。

补充:Java ,  Java相关
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,