- 博客(40)
- 收藏
- 关注
原创 C# 获取IP
string IP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
2021-11-25 16:04:05
1397
原创 C# 文件流获取保存本地
System.IO.FileStream stream = new System.IO.FileStream("D:/file/1.pdf", System.IO.FileMode.Create);byte[] buf = new byte[10240];int count = 0;while ((count = HttpContext.Current.Request.InputStream.Read(buf, 0, 10240)) > 0){ stream.Write(buf, 0, c.
2021-04-21 15:26:29
2254
原创 C# .ashx(一般处理程序) 接收file上传,保存
接收post过来的id参数string id= context.Request["id"];//接收post file 文件HttpPostedFile file = context.Request.Files["file"];//文件类型string fileType = System.IO.Path.GetExtension(file.FileName);//保存文件路径str...
2019-07-17 13:59:30
4773
原创 C# 数据库查询数据转json
DataSet dataSet =DbHelperSQL.Query(sql);//数据表查询数据JsonConvert.SerializeObject(dataSet.table[0],Formatting.Indented);//查询结果转json
2019-07-17 13:47:50
4597
原创 C# DataSet、DataTable 转 Dictionary
DataSet dataSet =DbHelperSQL.Query(sql);//数据表查询DataTable dataTable = dataSet.table[0];//获取DataTablepublic static Dictionary<string, object> DataTableToDictionary(DataTable dataTable) ...
2019-07-17 13:43:38
4573
原创 RSA premaster secret error
本地IDEA请求https没有问题,linux请求报"RSA premaster secret error",把请求地址https改成http就可以
2019-06-06 09:23:37
448
原创 C# 条形码
BarcodeSettings bs = new BarcodeSettings(){ Data = "1234567890", ShowCheckSumChar = false, TopTextColor = Color.Red, ShowTopText = false, ShowTextOnBottom = true}; BarCodeGe...
2019-04-18 11:34:59
497
原创 C# 时间比较
DateTime BeginDate = Convert.ToDateTime("2019/4/20 00:00:00");DateTime NowTime = System.DateTime.Now;if(NowTime>BeginDate){ }else{}
2019-04-18 11:28:54
2317
原创 C# MD5加密
string fullKey = "1234567890";MD5 md5 = MD5.Create();byte[] encryptionBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(fullKey));string EncryptionStr = Convert.ToBase64String(encryptionBytes);
2019-04-18 09:26:43
807
原创 C# http post 接收json
var jsonString = String.Empty;context.Request.InputStream.Position = 0;using (var inputStream = new StreamReader(context.Request.InputStream)){ jsonString = inputStream.ReadToEnd();//jsonStrin...
2019-04-17 10:26:32
2334
转载 1130 - Host XXX is not allowed to connect to this MySQL server
1.在用Navicat配置远程连接Mysql数据库时遇到如下报错信息,这是由于Mysql配置了不支持远程连接引起的。2.在安装Mysql数据库的主机上登录root用户:mysql -u root -p3.依次执行如下命令:use mysq;select host from user where user='root';可以看到当前主机配置信息为localhost....
2019-04-11 14:17:06
211
原创 C#调用api post file
public string FileUpload(string url, string path) { HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; CookieContainer cookieContainer = new CookieCon...
2019-04-03 16:25:34
930
转载 史上最全的Maven Pom文件标签详解
转载:https://blog.youkuaiyun.com/zcl1199/article/details/53096698<span style="padding:0px; margin:0px"><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001...
2019-02-25 13:20:14
164
转载 Mybatis Generator最完整配置详解
转载:https://www.jianshu.com/p/e09d2370b796 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""ht...
2019-02-18 17:08:22
179
原创 web 调用百度地图导航
接口文档:http://lbsyun.baidu.com/index.php?title=uri/api/web window.location.href = "http://api.map.baidu.com/marker?location=" + lat + "," + lng + "&title=" + titleName + "&content=" +content+ ...
2018-11-29 15:14:14
3246
原创 C# .net 二维码生成
string url = "http://xxxxxxxxxxxxxxx"; QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; qrCodeEn...
2018-11-16 10:56:18
1347
转载 Asp.net中DataBinder.Eval用法的总结
<%# Bind("Subject") %> //绑定字段<%# Container.DataItemIndex + 1%> //实现自动编号<%# DataBinder.Eval(Container.DataItem, "[n]") %>通常使用的方法(这三个性能最好)<%# DataBinder.Eval(Container.DataItem, ...
2018-11-13 11:42:10
296
原创 .net c# json反序列化
JObject jsonstr = (JObject)JsonConvert.DeserializeObject(data);string openid = jsonstr["openid"].ToString();引用Newtonsoft.Json;
2018-10-25 17:40:10
351
原创 .net C# json转DataTable
public DataTable JsonToDataTable(string json) { DataTable dataTable = new DataTable(); //实例化 DataTable result; try { JavaScrip...
2018-10-25 17:37:49
2065
原创 .ner C# get post请求
private string HttpGet(string url) { WebRequest wRequest = WebRequest.Create(url); wRequest.Method = "GET"; wRequest.ContentType = "text/html;charset=utf-8...
2018-10-25 17:36:49
153
原创 Highcharts 甘特图
Highcharts.chart('container', { chart: { type: 'xrange' }, title: { text: '生产模拟' }, xAxis: { ...
2018-09-26 14:32:40
2282
1
原创 C# des加密,解密
using System.Security.Cryptography;using System.IO;public static string _KEY = "HQDCKEY1"; //密钥public static string _IV = "HQDCKEY2"; //向量/** * 加密 * data为需要加密的url **/public static string...
2018-09-26 14:22:40
964
原创 Flexbox实现垂直水平居中
首先,创建一个div容器,容器内是需要居中的内容<div class="container"> <!--容器内的元素将会居中--> <img src="fireworks.jpg" alt="fireworks"></div>.container{ display: flex; justify
2018-08-08 16:03:58
262
转载 Apache重写未开启,导致The requested URL /xxxx.html was not found on this server
今天把项目环境从集成换成独立的,全部搭建好后,网站主页www.xxx.com能打开,但一涉及到跳转,带参数,比如 www.xxx.com/xxx/xxx.html 就会报错The requested URL /xxxx.html was not found on this server因为是新搭建的环境,apache的重写未开启,开启重写后,问题解决,方法如下:apache 打开 ht...
2018-06-19 16:27:12
6979
转载 Thinkphp5 引入第三方类库
extend 扩展类库目录vendor 第三方类库目录(Composer依赖库)// 引入 extend/qrcode.phpLoader::import('qrcode', EXTEND_PATH);// 助手函数import('qrcode', EXTEND_PATH);// 引入 extend/wechat-sdk/wech...
2018-06-19 16:25:14
3224
原创 PHP 读取图片流,并保持图片
//保存地址$imgDir = 'uploade/';//要生成的图片名字$filename = md5(time().mt_rand(10, 99)).".png"; //新图片名称$newFilePath = $imgDir.$filename;$data = $res;$newFile = fopen($newFilePath,"w"); //打开文件准备写入fwrite($n...
2018-06-13 20:43:22
2092
原创 二维数组排序
$data[] = array('volume' => 67, 'edition' => 2);$data[] = array('volume' => 86, 'edition' => 1);$data[] = array('volume' => 85, 'edition' => 6);$data[] = array('volume' => 98, ...
2018-06-06 11:40:31
379
原创 bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery
错误:bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery位置:bootstrap.min.js:6 解决:将jquery.min.js放在bootstrap.min.js文件之前引用
2018-05-14 13:07:33
4562
原创 PHP curlPost
protected function curlPost($url, $data) { $ch = curl_init (); $header = array("Accept-Charset: utf-8"); curl_setopt ( $ch, CURLOPT_URL, $url ); curl_setopt ( $ch, CURL...
2018-04-23 16:10:51
346
原创 数组编码转换
iconv — 字符串按要求的字符编码来转换1,string iconv ( string $in_charset , string $out_charset , string $str )2,将字符串 str 从 in_charset 转换编码到 out_charset3,返回转换后的字符串, 或者在失败时返回 FALSEvar_export — 用于将数组转换成字符串eval()—函数把字符串...
2018-04-23 16:09:46
959
原创 Thinkphp5.0 微信企业付款到零钱
转载请添加原出处【微信支付】企业付款到零钱:https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_1注意:1,证书路径一定要写绝对路径,且使用函数getcwd()。function transfer($data){ //支付信息 $wxchat['appid'] = WxPayConfig::$a...
2018-03-06 16:31:00
6140
3
原创 Eclipse(oxygen)上传项目到阿里云Git
转载请添加原出处oxygen版本的Eclipse自带Git插件1,阿里云申请登录账号和密码网址:https://code.aliyun.com2,阿里云Git账号,密码,email阿里云Git账号和密码 不是 https://code.aliyun.com登录账号和密码2.1,阿里云Git账号和email查看Username是Git账号,确保Email已设置...
2018-02-28 13:54:33
2688
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人