`
hjy273
  • 浏览: 85377 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

获取请求页面里的&g_tk参数(非常有用)

    博客分类:
  • java
阅读更多
/**
* 获取请求页面里的&g_tk参数<br>
*
* @param cookies
* @return
*/
public Integer getGTK(List<Cookie> cookies) {
int gtk = 0;
if (!cookies.isEmpty()) {
for (int i = 0; i < cookies.size(); i++) {
if (cookies.get(i).getName().equalsIgnoreCase("skey")) {
String str = cookies.get(i).getValue();
char[] c = str.toCharArray();
int haha= 32;
for (int a = 0; a < c.length; a++) {
haha+= (haha<< 5) + c[a];
}
gtk = haha& 0x7fffffff;
System.out.println("#haha:" + haha);
}
}
}
System.out.println("##&g_tk=" + gtk);
return gtk;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics