posts - 609,  comments - 13,  views - 64万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  .NET

C# SHA1散列算法
摘要:C# SHA1散列算法 /// <summary> /// C# SHA1散列算法 /// </summary> /// <param name="str"></param> /// <returns></returns> public static string EncryptToSHA1(str 阅读全文
posted @ 2016-12-23 10:37 邢帅杰 阅读(1205) 评论(0) 推荐(1) 编辑
微信App支付通知验签
摘要:微信异步通知: 把XML数据转换为SortedDictionary<string, string>集合: 把参数排序后拼接,得到签名字符串: 签名算法文档:https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=4_3 阅读全文
posted @ 2016-12-21 17:40 邢帅杰 阅读(1984) 评论(0) 推荐(0) 编辑
支付宝App支付签名和验签
摘要:代码: 签名类: 文档:https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.9CZS6Q&treeId=193&articleId=105465&docType=1 主要看的有四篇:申请支付请求参数说明、客户端同步返回、支付结 阅读全文
posted @ 2016-12-21 09:48 邢帅杰 阅读(16264) 评论(0) 推荐(0) 编辑
log4net的使用
摘要:第一步:NuGet安装Log4net,配置Web.config: <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> </confi 阅读全文
posted @ 2016-11-21 14:33 邢帅杰 阅读(268) 评论(0) 推荐(0) 编辑
C#获得客户端IP
摘要:代码: 阅读全文
posted @ 2016-09-06 09:33 邢帅杰 阅读(182) 评论(0) 推荐(0) 编辑
C#根据URL生成签名
摘要:代码: 阅读全文
posted @ 2016-07-07 15:11 邢帅杰 阅读(773) 评论(0) 推荐(0) 编辑
C#缓存-依赖 CacheHelper
摘要:缓存依赖文件或文件夹 //创建缓存依赖项 CacheDependency dep = new CacheDependency(fileName);//Server.MapPath(""); //创建缓存 HttpRuntime.Cache.Insert(key, obj, dep); fileNam 阅读全文
posted @ 2016-06-15 13:50 邢帅杰 阅读(690) 评论(0) 推荐(0) 编辑
WebApi上传文件/.Net Core WebApi上传文件
摘要:普通WebApi上传文件 #region 上传文件 /// <summary> /// 通过multipart/form-data方式上传文件 /// </summary> /// <returns></returns> [HttpPost] public async Task<HttpRespon 阅读全文
posted @ 2016-05-27 08:53 邢帅杰 阅读(8989) 评论(1) 推荐(0) 编辑
C#获取IP地址
摘要:获得公网IP private string GetClientIP() { string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (null == result || resul 阅读全文
posted @ 2016-05-19 19:41 邢帅杰 阅读(172) 评论(0) 推荐(0) 编辑
枚举Enum转换为List,获取枚举的描述
摘要:代码: 枚举: 获取描述: 另外一种:http://www.cnblogs.com/wenjian/archive/2009/06/19/1506550.html 阅读全文
posted @ 2016-03-30 20:17 邢帅杰 阅读(2179) 评论(0) 推荐(0) 编辑
导出Word文档
摘要:代码: 阅读全文
posted @ 2016-03-24 14:32 邢帅杰 阅读(331) 评论(0) 推荐(0) 编辑
OAuth2.0 Owin 授权问题
摘要:http://www.cnblogs.com/dudu/p/4569857.html OAuth2.0 一、什么是OAuth OAuth是一个关于授权(Authorization)的开放网络标准,目前的版本是2.2版。 注意是Authorization(授权),而不是Authentication(认 阅读全文
posted @ 2016-03-17 14:48 邢帅杰 阅读(2158) 评论(0) 推荐(1) 编辑
将对象转为json,加入到HttpResponseMessage中
摘要:需要引用程序集: Code: 阅读全文
posted @ 2016-03-16 11:23 邢帅杰 阅读(1325) 评论(0) 推荐(0) 编辑
利用委托机制处理.NET中的异常
摘要:WinForm代码   处理代码:   阅读全文
posted @ 2016-03-15 13:54 邢帅杰 阅读(237) 评论(0) 推荐(0) 编辑
.NET获得上传图片宽高
摘要:代码: 阅读全文
posted @ 2016-03-14 11:49 邢帅杰 阅读(319) 评论(0) 推荐(0) 编辑
委托同步执行与异步执行
摘要:http://www.cnblogs.com/luxiaoxun/p/3280146.html http://developer.51cto.com/art/200908/141587.htm http://www.cnblogs.com/stg609/p/4050483.html http://w 阅读全文
posted @ 2016-03-11 14:07 邢帅杰 阅读(342) 评论(0) 推荐(0) 编辑
C#中发送邮件,包含Html代码 CDO.Message
摘要:C#代码: /// <summary> /// 发送邮件 /// </summary> /// <param name="subject"></param> /// <param name="emails"></param> /// <param name="filePath"></param> p 阅读全文
posted @ 2016-03-08 11:56 邢帅杰 阅读(1302) 评论(0) 推荐(0) 编辑
获取验证码效果和后台代码(js+html+cs)
摘要:客户端js+html代码 服务端代码: 阅读全文
posted @ 2016-03-05 10:04 邢帅杰 阅读(3602) 评论(0) 推荐(0) 编辑
NPOI导入导出Excel数据
摘要:vs上NuGet搜索NPOI.Excel 和 Newtonsoft.Json,安装。https://www.cnblogs.com/mq0036/p/9835975.html /// <summary> /// 导出账单汇总 /// </summary> /// <param name="sende 阅读全文
posted @ 2016-01-19 11:46 邢帅杰 阅读(532) 评论(1) 推荐(0) 编辑
SqlDataHelper
摘要:using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Xml.Linq;using System.Data.SqlClient;/// ///... 阅读全文
posted @ 2016-01-18 15:17 邢帅杰 阅读(390) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示