用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 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック









ファンクションとは、関数を意味します。これは、特定の関数を備えた再利用可能なコード ブロックです。プログラムの基本コンポーネントの 1 つです。入力パラメータを受け取り、特定の操作を実行し、結果を返すことができます。その目的は、再利用可能なコード ブロックをカプセル化することです。コードの再利用性と保守性を向上させるコード。

この記事では、Python の enumerate() 関数と「enumerate()」関数の目的について学びます。 enumerate() 関数とは何ですか? Python の enumerate() 関数は、データ コレクションをパラメータとして受け取り、列挙オブジェクトを返します。列挙オブジェクトはキーと値のペアとして返されます。キーは各項目に対応するインデックス、値は項目です。構文 enumerate(iterable,start) パラメータ iterable - 渡されたデータ コレクションは、iterablestart と呼ばれる列挙オブジェクトとして返すことができます。 - 名前が示すように、列挙オブジェクトの開始インデックスは start によって定義されます。無視したら

MySQL.proc テーブルの役割と機能の詳細な説明。MySQL は人気のあるリレーショナル データベース管理システムです。開発者が MySQL を使用する場合、多くの場合、ストアド プロシージャ (StoredProcedure) の作成と管理が必要になります。 MySQL.proc テーブルは非常に重要なシステム テーブルであり、ストアド プロシージャの名前、定義、パラメータなど、データベース内のすべてのストアド プロシージャに関連する情報が保存されます。この記事では、MySQL.proc テーブルの役割と機能について詳しく説明します。

Vue の使い方と機能.use Function Vue は、多くの便利な機能を提供する人気のフロントエンド フレームワークです。その 1 つは Vue.use 関数で、これを使用すると Vue アプリケーションでプラグインを使用できるようになります。この記事では、Vue.use 関数の使い方と機能を紹介し、いくつかのコード例を示します。 Vue.use 関数の基本的な使用法は非常に簡単です。Vue がインスタンス化される前に関数を呼び出し、使用するプラグインをパラメータとして渡すだけです。簡単な例を次に示します。 // プラグインの導入と使用

js関数関数の使い方は、1. 関数の宣言、2. 関数の呼び出し、3. 関数のパラメータ、4. 関数の戻り値、5. 無名関数、6. パラメータとしての関数、7. 関数のスコープ、8. 再帰関数です。

file_exists メソッドは、ファイルまたはディレクトリが存在するかどうかを確認します。チェックするファイルまたはディレクトリのパスを引数として受け取ります。これは、ファイルを処理する前に存在するかどうかを知る必要がある場合に役立ちます。これにより、新しいファイルを作成するときに、この関数を使用してファイルがすでに存在するかどうかを確認できます。構文 file_exists($file_path) パラメータ file_path - 存在をチェックするファイルまたはディレクトリのパスを設定します。必須。 return file_exists() メソッドが戻ります。ファイルまたはディレクトリが存在する場合は TrueFalse を返し、ファイルまたはディレクトリが存在しない場合は TrueFalse を返します。 例として、「candidate.txt」ファイルのチェックを見てみましょう。

インターネットの発展に伴い、SOA (サービス指向アーキテクチャ) は、今日のエンタープライズ レベルのシステムにおける重要な技術アーキテクチャになりました。 SOA アーキテクチャのサービスは再利用、再編成、拡張が可能であると同時に、システム開発とメンテナンスのプロセスも簡素化されます。広く使用されている Web プログラミング言語として、PHP は SOA を実装するための関数ライブラリもいくつか提供しています。次に、PHP で SOA 関数を使用する方法を詳しく説明します。 1. 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(
