![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ASP.NET
菜鸟王小凡
这个作者很懒,什么都没留下…
展开
-
c#多线程 HttpWebRequest 无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接。。
c#文章好找啊,记录一下,参考解决地址:https://www.cnblogs.com/LL-723/p/4268020.html直接贴代码string responseContent = ""; int count = 0; Stream responseStream; string restring; try { System.GC.Collec...原创 2020-10-16 19:20:26 · 4991 阅读 · 0 评论 -
多线程 c# httpWebRequest 请求错误,基础连接已经关闭: 连接被意外关闭
c#资源比较少,记录下来。string responseContent = ""; int count = 0; Stream responseStream; string restring; try { System.GC.Collect(); HttpWebRequest request = (HttpWebReque...原创 2020-10-16 19:06:21 · 1835 阅读 · 0 评论 -
c# RestRequest application/x-www-form-urlencoded 后台接收不到解决方法
var client = new RestClient($"addres"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/x-www-form-urlencoded"); request.AddParameter("application/x-www-form-urlencoded", $"id={304}...转载 2020-09-16 18:31:22 · 3504 阅读 · 0 评论 -
.net c# 修改视频md5
修改视频的md5方法[HttpPost] public dynamic GetData([FromBody]Model model) { try { string fileName = "D:/file/20200220231945.mp4"; File...原创 2020-03-22 12:56:54 · 952 阅读 · 0 评论 -
.net 实现服务器推送消息signalr源码
源码在后面。1、首先在neget 添加signalr.找到Microsoft.AspNet.SignalR。2、添加Startup类3、添加chatHub类 继承Hub.(方法需要和前台js一致)3、html页面源码codehtml@{ViewBag.Title = “Home Page”;} 房间号: 用户名: 加入聊天室...原创 2019-02-22 14:21:29 · 584 阅读 · 0 评论 -
css、js、html所有出现乱码的地方终极解决方法。
一定是编码的问题。1、确认下文件编码格式(源文编码是否一致).2、看下载源文件的时候就是乱码的.原创 2019-02-22 09:59:18 · 536 阅读 · 0 评论 -
asp.net iis 访问json文件和txt文件.
访问json文件访问.txt文件还需要配置下服务器的原创 2019-01-22 09:07:18 · 1112 阅读 · 0 评论 -
.net 特殊符号时候自动编码
一般我们传特殊符号时候自动编码转移System.Web.HttpUtility.UrlDecode(model.selgrade)。原创 2019-01-21 11:03:27 · 426 阅读 · 0 评论 -
.net webapi post/get请求 过滤器参数处理(token)
public class ApiSecurityFilter : ActionFilterAttribute{public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext){ var request = actionContext.Reque...原创 2019-04-23 10:58:11 · 1847 阅读 · 0 评论 -
在多线程里面使用HttpContext.Current,HttpContext.Current是得到null的获取路径方法
原因:20150703 解释下为什么当前请求上下文会为null,因为多线程情况下,当前线程可能并非http请求处理线程,根本没发生请求,所以无法获取到HttpContext就是null.public static string MapPath(string strPath){if (HttpContext.Current != null){return HttpContext.Curre...原创 2019-05-23 22:54:18 · 563 阅读 · 0 评论 -
微信小程序C# 服务通知多个时候慢解决方法
地址是接口地址 https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=优化代码和多线程,我服务器不行。.net 4.0后 用 ParallelLoopResult result = Parallel.For(0, 1000, i =>{Console.WriteLine(“迭代次数:{0}...原创 2019-05-24 09:05:45 · 380 阅读 · 0 评论 -
asp.net C# 微信小程序退款通知代码的坑
设置完回调后req_info解密代码C#官方没提供!string req_info = DecodeReqInfo(notifyData.GetValue(“req_info”).ToString());if (req_info == null){res.SetValue(“return_code”, “FAIL”);res.SetValue(“return_msg”, “解密信息出错...原创 2019-05-24 09:15:30 · 1645 阅读 · 0 评论 -
.net HttpWebRequest get数据乱码解决方法。
转载 https://blog.csdn.net/qq_26422355/article/details/82716824原因是默认转为Unicode 转一下 Unicode2String 即可。/// /// /// 字符串转Unicode/// /// 源字符串/// Unicode编码后的字符串public static string String2Unicode(strin...转载 2019-06-27 09:07:01 · 726 阅读 · 0 评论 -
.net C# 文件下载(所有类型)
后台接收方法下载[HttpGet]public async Task export(string url, string name){try{string path = System.Web.HttpContext.Current.Server.MapPath(url);if (!string.IsNullOrWhiteSpace(path) && File.Exis...原创 2019-07-17 20:42:12 · 591 阅读 · 0 评论 -
关于handler的水印技术
就是 在一张 画板上花上 另一个 图像、 、<%@ WebHandler Language=“C#” Class=“Handler” %>using System;using System.Web;using System.Drawing;using System.Text;using System.IO;using System.Drawing.Im...原创 2019-01-21 10:39:44 · 193 阅读 · 0 评论 -
asp.net 的 handler 实现 验证码
<%@ WebHandler Language=“C#” Class=“Handler” %>using System;using System.Web;using System.Text;using System.Drawing;using System.Drawing.Imaging;using System.Web.SessionState;public class...原创 2019-01-21 10:36:26 · 282 阅读 · 0 评论 -
asp.net导出excel (这是)通过画一个html 实现的
private void GetExcel() {UserLogin ul = (UserLogin)Session[“UserInfo”]; DataSet ds=new DataSet(); &原创 2019-01-21 10:28:58 · 523 阅读 · 0 评论 -
asp.net 获取进程。。杀到进程
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;using System.Diagnostics;using Syst原创 2015-07-09 09:45:16 · 1725 阅读 · 0 评论 -
关于 webservice 的SoapHeader 示例(赋值代码即可。)
SoapHeader是增强 webservice的安全性的。例如(支付、认证)1,写一个web service发布了服务器上。2,通过添加服务引用发布的webservice。3,调用。MyWebService的网站添加一个类继承 System.Web.Services.Protocols.SoapHeader ; 作为传递使用的。using System;usin原创 2015-10-08 18:04:19 · 5466 阅读 · 1 评论 -
动态页面静态化
@TOC1、拆中做法、 、 判断静态文件是否存在、不存在就新建一个(提前编辑好一个静态页模板&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a原创 2019-01-21 10:21:58 · 568 阅读 · 0 评论