用php聊QQ_PHP
<font size="2"><font face="Verdana">代码:</font><hr></font> <?php class Query { private $timeout; // = 100; // Max time for stablish the conection private $server; // = '219.133.51.11';//'219.133.51.11'; // IP address private $host; // = 'tqq.tencent.com'; // Domain name private $port; // = 8000; private $postValues; // = array ( 'VER' => '1.1', private $ret; public function go(){ $this->postValues = substr( $this->postValues, 0, -1 ); $request = "POST HTTP/1.1\r\n"; $request .= "Host: $this->host\r\n"; $length = strlen( $this->postValues ); $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; $request .= "Content-Length: $length\r\n"; $request .= "\r\n"; $request .= $this->postValues; $socket = fsockopen( $this->server, $this->port, $errno, $errstr, $this->timeout ); fputs( $socket, $request ); $ret = ''; while ( !feof( $socket ) ) { $ret .= fgets( $socket, 4096 ); } fclose( $socket ); $this->setRetValues( $ret ); } public function clearParams() { $this->postValues = ''; return true; } public function addParams( $var , $value ) { $this->postValues.= urlencode( $var ) . "=" . urlencode( $value ) . '&'; } public function setTimeout( $timeout ) { $this->timeout = $timeout; return true; } public function setServer( $server ) { $this->server = $server; return true; } public function setHost( $host ) { $this->host = $host; return true; } public function setPort( $port ) { $this->port = $port; return true; } public function getRetValues() { parse_str(iconv('UTF-8','GB2312',$this->ret),$arrValues); return $arrValues; //return $this->ret; } private function setRetValues( $ret ) { $this->ret=$ret; return ture; } } ?> <?php class QQ { private $query; private $no; private $pass; public function login() { $this->query->clearParams(); $this->query->addParams('VER','1.1'); $this->query->addParams('CMD','Login'); $this->query->addParams('SEQ',rand(1000,9000)); $this->query->addParams('UIN',$this->no); $this->query->addParams('PS',$this->pass); $this->query->addParams('M5','1'); $this->query->addParams('LC','9326B87B234E7235'); $this->query->go(); return $this->query->getRetValues(); } public function getFriendList() { // VER=1.1&CMD=List&SEQ=&UIN=&TN=160&UN=0 $this->query->clearParams(); $this->query->addParams('VER','1.1'); $this->query->addParams('CMD','List'); $this->query->addParams('SEQ',rand(1000,9000)); $this->query->addParams('UIN',$this->no); $this->query->addParams('TN','160'); $this->query->addParams('UN','0'); //$this->query->addParams('LC','9326B87B234E7235'); $this->query->go(); return $this->query->getRetValues(); } public function changeStat($st) { $this->query->clearParams(); $this->query->addParams('VER','1.1'); $this->query->addParams('CMD','Change_Stat'); $this->query->addParams('SEQ',rand(1000,9000)); $this->query->addParams('UIN',$this->no); $this->query->addParams('ST',$st); $this->query->go(); return $this->query->getRetValues(); //VER=1.1&CMD=Change_Stat&SEQ=&UIN=&ST= //ST为要改变的状态,10为上线,20为离线,30为忙碌。 } public function getMsg() { //VER=1.1&CMD=GetMsgEx&SEQ=&UIN= $this->query->clearParams(); $this->query->addParams('VER','1.1'); $this->query->addParams('CMD','GetMsgEx'); $this->query->addParams('SEQ',rand(1000,9000)); $this->query->addParams('UIN',$this->no); $this->query->go(); return $this->query->getRetValues(); } public function getUserInfo($user_no) { // VER=1.1&CMD=GetInfo&SEQ=&UIN=&LV=2&UN= $this->query->clearParams(); $this->query->addParams('VER','1.1'); $this->query->addParams('CMD','GetInfo'); $this->query->addParams('SEQ',rand(1000,9000)); $this->query->addParams('UIN',$this->no); $this->query->addParams('LV','2'); $this->query->addParams('UN',$user_no); $this->query->go(); echo time().' '.(double)microtime(true).'<br>'; //echo $user_no.'ok'; //print_r( $this->query->getRetValues()); } public function setQQInfo( $no , $pass ) { $this->no = $no; $this->pass = md5($pass); return true; } public function setQuery($query) { $this->query = $query; return true; } } ?>登录后复制

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

function是函数的意思,是一段具有特定功能的可重复使用的代码块,是程序的基本组成单元之一,可以接受输入参数,执行特定的操作,并返回结果,其目的是封装一段可重复使用的代码,提高代码的可重用性和可维护性。

在本文中,我们将了解enumerate()函数以及Python中“enumerate()”函数的用途。什么是enumerate()函数?Python的enumerate()函数接受数据集合作为参数并返回一个枚举对象。枚举对象以键值对的形式返回。key是每个item对应的索引,value是items。语法enumerate(iterable,start)参数iterable-传入的数据集合可以作为枚举对象返回,称为iterablestart-顾名思义,枚举对象的起始索引由start定义。如果我们忽

MySQL.proc表的作用和功能详解MySQL是一种流行的关系型数据库管理系统,开发者在使用MySQL时常常会涉及到存储过程(StoredProcedure)的创建和管理。而MySQL.proc表则是一个非常重要的系统表,它存储了数据库中所有的存储过程的相关信息,包括存储过程的名称、定义、参数等。在本文中,我们将详细解释MySQL.proc表的作用和功能

Vue.use函数的用法和作用Vue是一款流行的前端框架,它提供了许多有用的功能和功能。其中之一就是Vue.use函数,它可以让我们在Vue应用中使用插件。本文将介绍Vue.use函数的用法和作用,并且提供一些代码示例。Vue.use函数的基本用法非常简单,只需在Vue实例化之前调用它,并传入要使用的插件作为参数。下面是一个简单的示例://引入并使用插件

file_exists方法检查文件或目录是否存在。它接受要检查的文件或目录的路径作为参数。以下是它的用途-当您需要在处理之前知道文件是否存在时,它非常有用。这样,在创建新文件时使用此函数即可知道该文件是否已存在。语法file_exists($file_path)参数file_path-设置要检查是否存在的文件或目录的路径。必需。返回file_exists()方法返回。如果文件或目录存在,则返回TrueFalse,如果文件或目录不存在示例让我们看一个检查“candidate.txt”文件和即使文件

js函数function用法有:1、声明函数;2、调用函数;3、函数参数;4、函数返回值;5、匿名函数;6、函数作为参数;7、函数作用域;8、递归函数。

随着互联网的发展,SOA(面向服务的架构)已经成为了当今企业级系统中的一种重要的技术架构。SOA架构中的服务可以被重复使用、重组和扩展,同时还能够简化系统开发和维护的过程。PHP作为一种被广泛使用的Web编程语言,也提供了一些用于实现SOA的函数库。接下来,我们将详细介绍如何在PHP中使用SOA函数。一、SOA的基本概念SOA是一种分布式系统开发的思想和架构

Java8中Function接口的介绍Java8中提供了一个函数式接口Function,这个接口表示对一个参数做一些操作然后返回操作之后的值。这个接口的有一个抽象方法apply,这个方法就是表明对参数做的操作。//JavaFunction接口的定义@FunctionalInterfacepublicinterfaceFunction{Rapply(Tt);defaultFunctioncompose(Function
