随笔分类 - C#
摘要:using JWT; using JWT.Algorithms; using JWT.Serializers; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using RestSharp; using System; using Sy
阅读全文
摘要:链接:https://blog.csdn.net/qq_36445227/article/details/108889448 负载均衡代码: public class ConnString { private static List<string> ReadConnStringList = new
阅读全文
摘要:log4net.config配置文件 <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfig
阅读全文
摘要:MethodInvoker mi = new MethodInvoker(() => { progressBar1.Value += progressBar1.Step; this.lblprass.Text = this.progressBar1.Value.ToString() + "/" +
阅读全文
摘要:1.首先添加一个windows服务程序 2.在 protected override void OnStart(string[] args)中加入我们的业务逻辑代码 3.在我们的GateService中的设计页面,添加安装程序 4.配置安装程序serviceProcessInstaller1和ser
阅读全文
摘要:转成 Base64 形式的 System.String: string a = "base64字符串与普通字符串互转"; byte[] b = System.Text.Encoding.Default.GetBytes(a); //转成 Base64 形式的 System.String a = Co
阅读全文
摘要:两种验证方式 1.客户端post请求 发送代码: var r = WebRequest.Create(param.Url) as HttpWebRequest; //param.AuthorizeCode 验证参数 if (!string.IsNullOrEmpty(param.AuthorizeC
阅读全文
摘要:FileInfo fi = new FileInfo(fileName);//excelFile为文件在服务器上的地址 HttpResponse contextResponse = HttpContext.Current.Response; contextResponse.Clear(); cont
阅读全文
摘要:链接: https://blog.csdn.net/liwan09/article/details/82710950 https://blog.csdn.net/liwan09/article/details/82783070 练习: Html.ActionLink: @Html.ActionLin
阅读全文
摘要:原文链接:https://blog.csdn.net/pan_junbiao/article/details/80718784?depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_rel
阅读全文
摘要:其他资料:https://blog.csdn.net/zgscwxd/article/details/97518190 1)EmptyResult:当用户有误操作或者是图片防盗链的时候,这个EmptyResult就可以派上用场,返回它可以让用户啥也看不到内容,通过访问浏览器端的源代码,发现是一个空内
阅读全文
摘要:1.前台向后台页面传值 (1)ajax方式 $.ajax({ type:'POST', // 规定请求的类型(GET 或 POST) url:uploadV, // 请求的url地址 dataType:'json', //预期的服务器响应的数据类型 data:{},//规定要发送到服务器的数据 be
阅读全文
摘要:/// <summary> /// 根据token过滤 /// </summary> /// <param name="list"></param> /// <returns></returns> private List<train_code_list> GetListByToken(List<t
阅读全文
摘要:自定义特性 [AttributeUsage(AttributeTargets.All)] public class HelpAttribute : System.Attribute { private string topic; public readonly string Url; public
阅读全文
摘要:使用过Webapi的园友应该都知道,Webapi的接口返回值主要有四种类型 void无返回值 IHttpActionResult HttpResponseMessage 自定义类型 此篇就围绕这四块分别来看看它们的使用。 一、void无返回值 void关键字我们都不陌生,它申明方法没有返回值。它的使
阅读全文
摘要:short数据与byte数组互转 public byte[] ShortToByte(short value) { return BitConverter.GetBytes(value); } public short ByteToShort(byte[] arr) { return BitConv
阅读全文
摘要:本文主要是介绍在.Net中System.Diagnostics命名空间下Process类和ProcessStartInfo类的使用 用于启动一个外部程序所使用的类是Process,至于ProcessStartInfo类只是用来传入Process类所需要的参数,个人理解是有点类似于适配器的操作,不知道
阅读全文
摘要:C#双缓冲解释 简单说就是当我们在进行画图操作时,系统并不是直接把内容呈现到屏幕 C#双缓冲 上,而是先在内存中保存,然后一次性把结果输出来,如果没用双缓冲的话,你会发现在画图过程中屏幕会闪的很厉害,因为后台一直在刷新,而如果等用户画完之后再输出就不会出现这种情况,具体的做法,其实也就是先创建一个位
阅读全文
摘要:使用yield关键字,非常的方便 private static IEnumerable<Control> GetChildren(Control frmRootDock) { if (frmRootDock == null) { throw new ArgumentNullException("")
阅读全文
摘要:类 public class A { /// <summary> /// 字段名称 /// </summary> public string Name { get; set; } } 获取值 A model= new A(){Name="ABC"}; string nameOfProperty =
阅读全文

浙公网安备 33010602011771号