C#に翻訳してください
Jun 23, 2016 pm 02:11 PM <?php
$key = mysql_escape_string($_GET["msg"]);
$post_data = array (
'requestContent=' . $key
);
$post_data = 爆破 ( '&', $post_data );
$url = 'http://nlp.xiaoi.com/robot/demo/wap/wap-demo.action';
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
ob_start ();
curl_exec ( $ch );
$result = ob_get_contents ();
ob_end_clean ();
$preg = '/</span>(.*)</p>/iUs';
preg_match_all ( $preg, $result, $match );
$response_msg = $match [0] [0];
$preg = "/</?[^>]+>/i";
$response_msg = preg_replace ( $preg, '', $response_msg );
if ("こんにちは、お元気ですか" == $response_msg || "調子はどうですか" == $response_msg) {
$response_msg = "小i机器人欢迎您、作者主页地址:50vip.com。小i机器人不断学习中,欢迎各种调戏.../:,@-D"; // 欢迎语
}
$response_msg = trim ( $response_msg );
echo $response_msg;
?>
回复讨论(解决方案)
c#+curl
c#+curl
httprequest httpresponse 不就可吗 我看不懂php 不知道他在干嘛

人気の記事

人気の記事

ホットな記事タグ

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

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

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

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

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

ホットトピック











LaravelのバックエンドでReactアプリを構築する:パート2、React
