这几天都在折腾图片这个事,受制于单片机的不稳定性很简单的图片经常花花绿绿的。。。 考虑到自己写传输需要分段还要写校验协议,不但麻烦而且速度慢还浪费数据流量,不如直接用别人的成品库,由于自己有个自用服务器于是直接用request库传送图片。首先是PC端对PC端的收发这是电脑给服务器发送图片的发送端写法import requests import binascii #二进制转字符串一下 url = 'http://192.168.3.190:5000/updata' with open('5.jpg','rb') as f: img=f.read() img=binascii.b2a...
如果是搜索引擎的蜘蛛就记录到spider文本:当前URL + IP<?php $useragent = addslashes(strtolower($_SERVER['HTTP_USER_AGENT'])); if (strpos($useragent, 'googlebot')!== false){$bot = 'Google';} elseif (strpos($useragent,'mediapartners-google') !== false){$bot = 'Google Adsense';} elseif (strpos($useragent,'baidusp...
查询所有数据select * from 表名查指定列select 字段1,字段2 from 表名根据用户名密码查询数据对比;多条件 并关系 查询;两个条件都成立select 字段1,字段2 from 表名 where 字段1='admin' and 字段2='password'多条件 或关系 查询;两个条件成立一个即可select 字段1,字段2 from 表名 where 字段1='admin' or 字段2='password'字段总条数select count(*) from 表名精确查找select * from 表名 where id=1查询某字段总和select sum(...
JQUERY生成二维码:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Jquery生成二维码</title> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src=&...
PHP获取网址301重定向跳转后的网址源码:function get301URL($url){ $header = get_headers($url,1); if (strpos($header[0],'301') || strpos($header[0],'302')) { if(is_array($header['Location'])) { return $header['Location'][count($header['Location'])-1]; }else{ return $h...
URL网址16进制加密源码:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>URL网址16进制加密工具</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;}</style></head>...
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JS加解密</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;} </style></head><body> <p...
JS时间戳转换时间,时间转时间戳源码时间转时间戳源码:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>时间戳格式化</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;} </style></...
JS最简单的BASE64编码解码JS-BASE64编码解码函数源码:<p id="demo"></p> <script> function base64(str,code) { if(code==0){return window.btoa(unescape(encodeURIComponent(str)));}else if(code==1){return decodeURIComponent(escape(window.atob(str)));} } document.getElementById("demo"...
网页禁止右键和F12打开控制台禁止右键: document.oncontextmenu = new Function("return false;"); 禁止F12: document.onkeydown = document.onkeyup = document.onkeypress = function(event) { var e = event || window.event || arguments.callee.caller.arguments[0]; if (e && e.keyCode == 123) { ...