php curl模拟登陆人人网发表状态

 更新时间:2016年11月25日 17:23  点击:1648
在php中要实现用户登录我们一般都会到curl模拟登陆功能,下面我就基于php的curl来实现登录人人网哦,完整的例子希望对各位有帮助。

 代码如下 复制代码

<?php
$cookie_file = dirname(__FILE__)."/renren.cookie";

$login_url = 'http://passport.renren.com/PLogin.do';

$post_fields['email'] = '';//人人的帐号
$post_fields['password'] = '';//人人密码
$post_fields['origURL'] = 'http%3A%2F%2Fhome.renren.com%2FHome.do';
$post_fields['domain'] = 'renren.com';


$ch = curl_init($login_url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
$content = curl_exec($ch);
curl_close($ch);
//匹配用户的ID
$send_url='http://www.renren.com/home';
$ch = curl_init($send_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
//获取用户id
$tmp = explode('/',$info['redirect_url']);
$uid = array_pop($tmp);
unset($tmp);

//$uid = "305115027";
//获取token和rtk

$send_url='http://www.renren.com/'.$uid;
$ch = curl_init($send_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
$tmp = curl_exec($ch);
curl_close($ch);
preg_match_all("/get_check:'(.*?)',get_check_x:'(.*?)',/is",$tmp,$arr);
$token = $arr[1][0];//1121558104
$rtk = $arr[2][0];//e9a9cb2

//发布信息
$poststr['content'] = "这就是一个测试而已!!!";
$poststr['withInfo'] = '{"wpath":[]}';
$poststr['hostid:'] = $uid;
$poststr['privacyParams'] = '{"sourceControl": 99}';
$poststr['requestToken'] = $token;
$poststr['_rtk'] = $rtk;
$poststr['channel'] = "renren";

$head = array(
   'Referer:http://shell.renren.com/ajaxproxy.htm',
   'X-Requested-With:XMLHttpRequest',
  );
$ch = curl_init("http://shell.renren.com/{$uid}/status");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5');
curl_setopt($ch,CURLOPT_HTTPHEADER,$head);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $poststr);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
$content = curl_exec($ch);
curl_close($ch);
$data = json_decode($content,true);
if($data["code"] == "0"){
 echo "发布成功!";
}else{
 echo "shit !!!";
}

原文来自:http://www.mapenggang.com/

在 php 获取图片尺寸的方法我们可以使用 getimagesize 获取图片尺寸的效率是很低的,首先需要获取整个的图片信息,然后再进行操作,下面的例子更科学算法更好,我们一起来看看吧。

下方法可以用于快速获取图片尺寸信息

1.获取JPEG格式图片的尺寸信息

 代码如下 复制代码

<?php
/*

* 获取JPEG格式图片的尺寸信息,并且不需要下载/读取整个图片。

* 经测试这个函数不是对所有JPEG格式的图片都有效。

* http://www.111cn.net

*/

// Retrieve JPEG width and height without downloading/reading entire image.

function getjpegsize($img_loc) {
    $handle = fopen($img_loc, "rb") or die("Invalid file stream.");
    $new_block = NULL;
    if(!feof($handle)) {
        $new_block = fread($handle, 32);
        $i = 0;
        if($new_block[$i]=="xFF" && $new_block[$i+1]=="xD8" && $new_block[$i+2]=="xFF" && $new_block[$i+3]=="xE0") {
            $i += 4;
            if($new_block[$i+2]=="x4A" && $new_block[$i+3]=="x46" && $new_block[$i+4]=="x49" && $new_block[$i+5]=="x46" && $new_block[$i+6]=="x00") {
                
// Read block size and skip ahead to begin cycling through blocks in search of SOF marker

                $block_size = unpack("H*", $new_block[$i] . $new_block[$i+1]);
                $block_size = hexdec($block_size[1]);
                while(!feof($handle)) {
                    $i += $block_size;
                    $new_block .= fread($handle, $block_size);
                    if($new_block[$i]=="xFF") {
                        
// New block detected, check for SOF marker

                        $sof_marker = array("xC0", "xC1", "xC2", "xC3", "xC5", "xC6", "xC7", "xC8", "xC9", "xCA", "xCB", "xCD", "xCE", "xCF");
                        if(in_array($new_block[$i+1], $sof_marker)) {
                            
// SOF marker detected. Width and height information is contained in bytes 4-7 after this byte.

                            $size_data = $new_block[$i+2] . $new_block[$i+3] . $new_block[$i+4] . $new_block[$i+5] . $new_block[$i+6] . $new_block[$i+7] . $new_block[$i+8];
                            $unpacked = unpack("H*", $size_data);
                            $unpacked = $unpacked[1];
                            $height = hexdec($unpacked[6] . $unpacked[7] . $unpacked[8] . $unpacked[9]);
                            $width = hexdec($unpacked[10] . $unpacked[11] . $unpacked[12] . $unpacked[13]);
                            return array($width, $height);
                        } else {
                            
// Skip block marker and read block size

                            $i += 2;
                            $block_size = unpack("H*", $new_block[$i] . $new_block[$i+1]);
                            $block_size = hexdec($block_size[1]);
                        }
                    } else {
                        return FALSE;
                    }
                }
            }
        }
    }
    return FALSE;
}
?>

2.

 代码如下 复制代码

$url='http://www.111cn.net /images/201203/08/1331189004_28093400.jpg';
$image_content = file_get_contents($url);
$image = imagecreatefromstring($image_content);
$width = imagesx($image);
$height = imagesy($image);
echo $width.'*'.$height."nr";   

重复提交数据我们在应用中经常会碰到了,今天我给各位介绍利用session来防止用户不小心重复提交数据的一个例子


原理非常的简单:就是用session在表单页面记录下,然后提交页面判断,如果相等则视为成功,并清空session

例子

 代码如下 复制代码

<?php
//开启session
session_start();

//如果有提交标识
if(isset($_GET['action']) && $_GET['action'] === 'save'){

 //如果有session且跟传过来的值一样 www.111cn.net 才算提交
 if(isset($_SESSION['__open_auth']) && isset($_POST['auth']) && $_SESSION['__open_auth'] == $_POST['auth']){
  print_r($_POST);
  $_SESSION['__open_auth'] = null;//清空
 } else {

  //走起
  header("location: post.php");
 }
 exit();
}

//授权
$auth = $_SESSION['__open_auth'] = time();

?>
<!doctype html>
<html>
<head>
 <meta charset="UTF-8">
 <title>post</title>
</head>
<body>
 <form action="post.php?action=save" method="post">
  <ul>
   <li>
    <input type="hidden" name="auth" value="1395454119">
    <input type="text" name="userName">
   </li>
   <li>
    <input type="password" name="userpass">
   </li>
   <li>
    <input type="submit" value="走起">
   </li>
   <li>
    1395454119   </li>
  </ul>
 </form>
</body>
</html>

当然还有更多更好的办法在这就不介绍了,文章最下面你感兴趣的文章中有很多相关文章。

在支付宝处理业务中return_url,notify_url是返回些什么状态呢,我们要根据它来做一些处理就必须了解return_url,notify_url的区别,下面我就来给各位介绍介绍。


问题描述:
我在处理支付宝业务中出现过这样的问题,付费完成后,在支付宝跳转到商家指定页面时,订单状态已经更新,通过调试发现是支付宝先通知notify_url,完成了订单状态。
支付宝return_url和notify_url通知顺序问题:
顺序不一定的,请别以先后顺序来做判断。具体如何判断,是根据您当前数据库里的状态和刚从支付宝里获取到的状态做对比来判断是否有做过处理了。
关于支付宝return_url和notify_url的区别:

同步通知页面特性(return_url特性):

(1)   买家在支付成功后会看到一个支付宝提示交易成功的页面,该页面会停留几秒,然后会自动跳转回商户指定的同步通知页面(参数return_url);

(2)   该页面中获得参数的方式,需要使用GET方式获取,如request.QueryString("out_trade_no")、$_GET['out_trade_no'];

(3)   该方式仅仅在买家付款完成以后进行自动跳转,因此只会进行一次;

(4)   该方式不是支付宝主动去调用商户页面,而是支付宝的程序利用页面自动跳转的函数,使用户的当前页面自动跳转;

(5)   基于(4)的原因,可在本机而不是只能在服务器上进行调试;

(6)   返回URL只有一分钟的有效期,超过一分钟该链接地址会失效,验证则会失败;

(7)   设置页面跳转同步通知页面(return_url)的路径时,不要在页面文件的后面再加上自定义参数。例如:

错误的写法:<http://www.alipay.com/alipay/return_url.php?xx=11>

正确的写法:<http://www.alipay.com/alipay/return_url.php>

 

服务器异步通知页面特性(notify_url特性):

(1)   必须保证服务器异步通知页面(notify_url)上无任何字符,如空格、HTML标签、开发系统自带抛出的异常提示信息等;

(2)   支付宝是用POST方式发送通知信息,因此该页面中获取参数的方式,如:

request.Form("out_trade_no")、$_POST['out_trade_no']。

(3)   支付宝主动发起通知,该方式才会被启用;

(4)   只有在支付宝的交易管理中存在该笔交易,且发生了交易状态的改变,支付宝才会通过该方式发起服务器通知(即时到账中交易状态为“等待买家付款”的状态默认是不会发送通知的);

(5)   服务器间的交互,不像页面跳转同步通知可以在页面上显示出来,这种交互方式是不可见的;

(6)   第一次交易状态改变(即时到账中此时交易状态是交易完成)时,不仅页面跳转同步通知页面会启用,而且服务器异步通知页面也会收到支付宝发来的处理结果通知;

(7)   程序执行完后必须打印输出“success”(不包含引号)。如果商户反馈给支付宝的字符不是success这7个字符,支付宝服务器会不断重发通知,直到超过24小时22分钟。

一般情况下,25小时以内完成8次通知(通知的间隔频率一般是:2m,10m,10m,1h,2h,6h,15h);

(8)   程序执行完成后,该页面不能执行页面跳转。如果执行页面跳转,支付宝会收不到success字符,会被支付宝服务器判定为该页面程序运行出现异常,而重发处理结果通知;

(9)   cookies、session等在此页面会失效,即无法获取这些数据;

(10)   该方式的调试与运行必须在服务器上,即互联网上能访问;

(11)   该方式的作用主要防止订单丢失,即页面跳转同步通知没有处理订单更新,它则去处理;

(12)   通知ID(参数notify_id)只有一分钟有效期,超过一分钟该次通知会验证失败。一旦验证成功下次再验证就会失效。

以前我们用过的异常处理函数都是单个的,下面我找到一个非常的不错的异常处理类系统,不但可以控制错误还能给出好的界面哦。
 代码如下 复制代码

<?php

// 自定义异常函数
set_exception_handler('handle_exception');

// 自定义错误函数
set_error_handler('handle_error');

/**
 * 异常处理
 *
 * @param mixed $exception 异常对象
 * @author www.111cn.net
 */
function handle_exception($exception) {
 Error::exceptionError($exception);
}

/**
 * 错误处理
 *
 * @param string $errNo 错误代码
 * @param string $errStr 错误信息
 * @param string $errFile 出错文件
 * @param string $errLine 出错行
 * @author www.111cn.net
 */
function handle_error($errNo, $errStr, $errFile, $errLine) {
 if ($errNo) {
  Error::systemError($errStr, false, true, false);
 }
}

/**
 * 系统错误处理
 *
 * @author www.111cn.net
 */
class Error {

 public static function systemError($message, $show = true, $save = true, $halt = true) {

  list($showTrace, $logTrace) = self::debugBacktrace();

  if ($save) {
   $messageSave = '<b>' . $message . '</b><br /><b>PHP:</b>' . $logTrace;
   self::writeErrorLog($messageSave);
  }

  if ($show) {
   self::showError('system', "<li>$message</li>", $showTrace, 0);
  }

  if ($halt) {
   exit();
  } else {
   return $message;
  }
 }

 /**
  * 代码执行过程回溯信息
  *
  * @static
  * @access public
  */
 public static function debugBacktrace() {
  $skipFunc[] = 'Error->debugBacktrace';

  $show = $log = '';
  $debugBacktrace = debug_backtrace();
  ksort($debugBacktrace);
  foreach ($debugBacktrace as $k => $error) {
   if (!isset($error['file'])) {
    // 利用反射API来获取方法/函数所在的文件和行数
    try {
     if (isset($error['class'])) {
      $reflection = new ReflectionMethod($error['class'], $error['function']);
     } else {
      $reflection = new ReflectionFunction($error['function']);
     }
     $error['file'] = $reflection->getFileName();
     $error['line'] = $reflection->getStartLine();
    } catch (Exception $e) {
     continue;
    }
   }

   $file = str_replace(SITE_PATH, '', $error['file']);
   $func = isset($error['class']) ? $error['class'] : '';
   $func .= isset($error['type']) ? $error['type'] : '';
   $func .= isset($error['function']) ? $error['function'] : '';
   if (in_array($func, $skipFunc)) {
    break;
   }
   $error['line'] = sprintf('%04d', $error['line']);

   $show .= '<li>[Line: ' . $error['line'] . ']' . $file . '(' . $func . ')</li>';
   $log .= !empty($log) ? ' -> ' : '';
   $log .= $file . ':' . $error['line'];
  }
  return array($show, $log);
 }

 /**
  * 异常处理
  *
  * @static
  * @access public
  * @param mixed $exception
  */
 public static function exceptionError($exception) {
  if ($exception instanceof DbException) {
   $type = 'db';
  } else {
   $type = 'system';
  }
  if ($type == 'db') {
   $errorMsg = '(' . $exception->getCode() . ') ';
   $errorMsg .= self::sqlClear($exception->getMessage(), $exception->getDbConfig());
   if ($exception->getSql()) {
    $errorMsg .= '<div class="sql">';
    $errorMsg .= self::sqlClear($exception->getSql(), $exception->getDbConfig());
    $errorMsg .= '</div>';
   }
  } else {
   $errorMsg = $exception->getMessage();
  }
  $trace = $exception->getTrace();
  krsort($trace);
  $trace[] = array('file' => $exception->getFile(), 'line' => $exception->getLine(), 'function' => 'break');
  $phpMsg = array();
  foreach ($trace as $error) {
   if (!empty($error['function'])) {
    $fun = '';
    if (!empty($error['class'])) {
     $fun .= $error['class'] . $error['type'];
    }
    $fun .= $error['function'] . '(';
    if (!empty($error['args'])) {
     $mark = '';
     foreach ($error['args'] as $arg) {
      $fun .= $mark;
      if (is_array($arg)) {
       $fun .= 'Array';
      } elseif (is_bool($arg)) {
       $fun .= $arg ? 'true' : 'false';
      } elseif (is_int($arg)) {
       $fun .= (defined('SITE_DEBUG') && SITE_DEBUG) ? $arg : '%d';
      } elseif (is_float($arg)) {
       $fun .= (defined('SITE_DEBUG') && SITE_DEBUG) ? $arg : '%f';
      } else {
       $fun .= (defined('SITE_DEBUG') && SITE_DEBUG) ? ''' . htmlspecialchars(substr(self::clear($arg), 0, 10)) . (strlen($arg) > 10 ? ' ...' : '') . ''' : '%s';
      }
      $mark = ', ';
     }
    }
    $fun .= ')';
    $error['function'] = $fun;
   }
   if (!isset($error['line'])) {
    continue;
   }
   $phpMsg[] = array('file' => str_replace(array(SITE_PATH, '\'), array('', '/'), $error['file']), 'line' => $error['line'], 'function' => $error['function']);
  }
  self::showError($type, $errorMsg, $phpMsg);
  exit();
 }

 /**
  * 记录错误日志
  *
  * @static
  * @access public
  * @param string $message
  */
 public static function writeErrorLog($message) {

  return false; // 暂时不写入 www.111cn.net

  $message = self::clear($message);
  $time = time();
  $file = LOG_PATH . '/' . date('Y.m.d') . '_errorlog.php';
  $hash = md5($message);

  $userId = 0;
  $ip = get_client_ip();

  $user = '<b>User:</b> userId=' . intval($userId) . '; IP=' . $ip . '; RIP:' . $_SERVER['REMOTE_ADDR'];
  $uri = 'Request: ' . htmlspecialchars(self::clear($_SERVER['REQUEST_URI']));
  $message = "<?php exit;?> {$time} $message $hash $user $uri ";

  // 判断该$message是否在时间间隔$maxtime内已记录过,有,则不用再记录了
  if (is_file($file)) {
   $fp = @fopen($file, 'rb');
   $lastlen = 50000;  // 读取最后的 $lastlen 长度字节内容
   $maxtime = 60 * 10;  // 时间间隔:10分钟
   $offset = filesize($file) - $lastlen;
   if ($offset > 0) {
    fseek($fp, $offset);
   }
   if ($data = fread($fp, $lastlen)) {
    $array = explode(" ", $data);
    if (is_array($array))
     foreach ($array as $key => $val) {
      $row = explode(" ", $val);
      if ($row[0] != '<?php exit;?>') {
       continue;
      }
      if ($row[3] == $hash && ($row[1] > $time - $maxtime)) {
       return;
      }
     }
   }
  }

  error_log($message, 3, $file);
 }

 /**
  * 清除文本部分字符
  *
  * @param string $message
  */
 public static function clear($message) {
  return str_replace(array(" ", " ", " "), " ", $message);
 }

 /**
  * sql语句字符清理
  *
  * @static
  * @access public
  * @param string $message
  * @param string $dbConfig
  */
 public static function sqlClear($message, $dbConfig) {
  $message = self::clear($message);
  if (!(defined('SITE_DEBUG') && SITE_DEBUG)) {
   $message = str_replace($dbConfig['database'], '***', $message);
   //$message = str_replace($dbConfig['prefix'], '***', $message);
   $message = str_replace(C('DB_PREFIX'), '***', $message);
  }
  $message = htmlspecialchars($message);
  return $message;
 }

 /**
  * 显示错误
  *
  * @static
  * @access public
  * @param string $type 错误类型 db,system
  * @param string $errorMsg
  * @param string $phpMsg
  */
 public static function showError($type, $errorMsg, $phpMsg = '') {
  global $_G;

  $errorMsg = str_replace(SITE_PATH, '', $errorMsg);
  ob_end_clean();
  $host = $_SERVER['HTTP_HOST'];
  $title = $type == 'db' ? 'Database' : 'System';
  echo <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
 <title>$host - $title Error</title>
 <meta http-equiv="Content-Type" content="text/html; charset={$_G['config']['output']['charset']}" />
 <meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
 <style type="text/css">
 <!--
 body { background-color: white; color: black; font: 9pt/11pt verdana, arial, sans-serif;}
 #container {margin: 10px;}
 #message {width: 1024px; color: black;}
 .red {color: red;}
 a:link {font: 9pt/11pt verdana, arial, sans-serif; color: red;}
 a:visited {font: 9pt/11pt verdana, arial, sans-serif; color: #4e4e4e;}
 h1 {color: #FF0000; font: 18pt "Verdana"; margin-bottom: 0.5em;}
 .bg1 {background-color: #FFFFCC;}
 .bg2 {background-color: #EEEEEE;}
 .table {background: #AAAAAA; font: 11pt Menlo,Consolas,"Lucida Console"}
 .info {
  background: none repeat scroll 0 0 #F3F3F3;
  border: 0px solid #aaaaaa;
  border-radius: 10px 10px 10px 10px;
  color: #000000;
  font-size: 11pt;
  line-height: 160%;
  margin-bottom: 1em;
  padding: 1em;
 }

 .help {
  background: #F3F3F3;
  border-radius: 10px 10px 10px 10px;
  font: 12px verdana, arial, sans-serif;
  text-align: center;
  line-height: 160%;
  padding: 1em;
 }

 .sql {
  background: none repeat scroll 0 0 #FFFFCC;
  border: 1px solid #aaaaaa;
  color: #000000;
  font: arial, sans-serif;
  font-size: 9pt;
  line-height: 160%;
  margin-top: 1em;
  padding: 4px;
 }
 -->
 </style>
</head>
<body>
<div id="container">
<h1>$title Error</h1>
<div class='info'>$errorMsg</div>
EOT;
  if (!empty($phpMsg)) {
   echo '<div class="info">';
   echo '<p><strong>PHP Debug</strong></p>';
   echo '<table cellpadding="5" cellspacing="1" width="100%" class="table"><tbody>';
   if (is_array($phpMsg)) {
    echo '<tr class="bg2"><td>No.</td><td>File</td><td>Line</td><td>Code</td></tr>';
    foreach ($phpMsg as $k => $msg) {
     $k++;
     echo '<tr class="bg1">';
     echo '<td>' . $k . '</td>';
     echo '<td>' . $msg['file'] . '</td>';
     echo '<td>' . $msg['line'] . '</td>';
     echo '<td>' . $msg['function'] . '</td>';
     echo '</tr>';
    }
   } else {
    echo '<tr><td><ul>' . $phpMsg . '</ul></td></tr>';
   }
   echo '</tbody></table></div>';
  }
  echo <<<EOT
</div>
</body>
</html>
EOT;
  exit();
 }
}

/**
 * DB异常类
 *
 * @author www.111cn.net
 */
class DbException extends Exception {

 protected $sql;
 protected $dbConfig; // 当前数据库配置信息

 public function __construct($message, $code = 0, $sql = '', $dbConfig = array()) {
  $this->sql = $sql;
  $this->dbConfig = $dbConfig;
  parent::__construct($message, $code);
 }

 public function getSql() {
  return $this->sql;
 }

 public function getDbConfig() {
  return $this->dbConfig;
 }
}

效果图:

PHP系统异常处理类程序

 

[!--infotagslink--]

相关文章

  • Android模拟器上模拟来电和短信配置

    如果我们的项目需要做来电及短信的功能,那么我们就得在Android模拟器开发这些功能,本来就来告诉我们如何在Android模拟器上模拟来电及来短信的功能。 在Android模拟...2016-09-20
  • 夜神android模拟器设置代理的方法

    夜神android模拟器如何设置代理呢?对于这个问题其实操作起来是非常的简单,下面小编来为各位详细介绍夜神android模拟器设置代理的方法,希望例子能够帮助到各位。 app...2016-09-20
  • PHP函数分享之curl方式取得数据、模拟登陆、POST数据

    废话不多说直接上代码复制代码 代码如下:/********************** curl 系列 ***********************///直接通过curl方式取得数据(包含POST、HEADER等)/* * $url: 如果非数组,则为http;如是数组,则为https * $header:...2014-06-07
  • C#模拟http 发送post或get请求的简单实例

    下面小编就为大家带来一篇C#模拟http 发送post或get请求的简单实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧...2020-06-25
  • 分享一段php获取linux服务器状态的代码

    简单的php获取linux服务器状态的代码,不多说-直接上函数:复制代码 代码如下:function get_used_status(){ $fp = popen('top -b -n 2 | grep -E "^(Cpu|Mem|Tasks)"',"r");//获取某一时刻系统cpu和内存使用情况 $rs =...2014-05-31
  • 用Intel HAXM给Android模拟器Emulator加速

    Android 模拟器 Emulator 速度真心不给力,, 现在我们来介绍使用 Intel HAXM 技术为 Android 模拟器加速,使模拟器运行度与真机比肩。 周末试玩了一下在Eclipse中使...2016-09-20
  • 教你如何监控 Java 线程池运行状态的操作(必看)

    这篇文章主要介绍了教你如何监控 Java 线程池运行状态的操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-02-27
  • C# 模拟浏览器并自动操作的实例代码

    这篇文章主要介绍了C# 模拟浏览器并自动操作的实例代码,文中讲解非常细致,帮助大家更好的理解和学习,感兴趣的朋友可以了解下...2020-11-03
  • 详解bash中的退出状态机制

    这篇文章主要介绍了详解bash中的退出状态机制,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-07-11
  • 微信小程序如何保证每个页面都已经登陆详解

    前段时间发布了一个微信小程序的简单登录,但遇到一个问题,怎么确保用户每个页面都已经登陆了呢,这篇文章主要给大家介绍了关于微信小程序如何保证每个页面都已经登陆的相关资料,需要的朋友可以参考下...2021-11-05
  • Android开发时在模拟器之间短信的收发详解教程

    本教程的主要内容是运行两个Android模拟器,然后在这两个模拟器如何实现互相收发短信的功能,这个功能可以说是非常实现的,可以应用app短信实例中。 本文通过运行两个A...2016-09-20
  • C#判断本地文件是否处于打开状态的方法

    这篇文章主要介绍了C#判断本地文件是否处于打开状态的方法,涉及C#操作文件的技巧,非常具有实用价值,需要的朋友可以参考下...2020-06-25
  • 帝国CMS灵动标签调用当前父栏目下所有子栏目-支持选中状态/高亮

    帝国CMS实现灵动标签调用当前父栏目下所有子栏目-支持选中状态及当前栏目高亮,支持栏目自定义排序。最适用于内容模板,显示父栏目下的子栏目。 支持静态栏目页与动态栏目页 代...2016-05-19
  • 基于ios中的流状态的定义分析

    本篇文章介绍了,基于ios中的流状态的定义分析。需要的朋友参考下...2020-04-25
  • php中的登陆login实例代码

    这篇文章主要为大家详细介绍了php中的登陆login实例代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2016-06-24
  • Spring Security登陆流程讲解

    本文主要介绍了Spring Security登陆流程讲解,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-11-04
  • PHP CURL模拟POST提交XML数据

    本文章来给大家介绍一个利用PHP CURL模拟POST提交XML数据,因为接受方只接受xml数据所以我就写了一个,下面分享给各位朋友,有需要的朋友可参考。 代码如下 ...2016-11-25
  • php 用户登陆

    keys:php 用户登陆 php多用户商城 php 登录 php 用户注册 php用户手册 php 在线用户 php 多用户 blog php多用户博客系统 php 模拟登录 php多用户商城...2016-11-25
  • AngularJS实现用户登录状态判断的方法(Model添加拦截过滤器,路由增加限制)

    这篇文章主要介绍了AngularJS实现用户登录状态判断的方法,通过Model添加拦截过滤器,路由增加限制实现针对登陆状态的判断功能,需要的朋友可以参考下...2017-01-09
  • Spring Boot 启动、停止、重启、状态脚本

    今天给大家分享Spring Boot 项目脚本(启动、停止、重启、状态),通过示例代码给大家介绍的非常详细,需要的朋友参考下吧...2021-06-26