<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; } } ?>

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实例化之前调用它,并传入要使用的插件作为参数。下面是一个简单的示例://引入并使用插件

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

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

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

clearstatcache()函数用于清除文件状态缓存。PHP缓存以下函数返回的信息−stat()lstat()file_exists()is_writable()is_readable()is_executable()is_file()is_dir()filegroup()fileowner()filesize()filetype()fileperms()这样做是为了提供更好的性能。语法voidclearstatecache()参数NA返回值clearstatcache(


热AI工具

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

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

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

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

热门文章

热工具

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

Dreamweaver CS6
视觉化网页开发工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

WebStorm Mac版
好用的JavaScript开发工具

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。