随笔分类 - C#
摘要:前言 在C#中使用HttpWebRequest发起HTTP请求时,达到最大并发和性能可以从以下几个方面改进: 1、ServicePointManager设置 ServicePointManager 类是一个静态类,它提供了用于管理HTTP连接的属性和方法。为了提升并发性能,你需要调整以下几个关键属性
阅读全文
摘要:方案一 asp.net mvc默认的json序列化ValueProviderFactory使用的是javascriptserializer,可以在配置文件web.config中设置: <add key="aspnet:MaxJsonDeserializerMembers" value="150000
阅读全文
摘要:微信语音都是使用amr音频格式的,这种格式文件放网页端是无法播放的,这时候需要后台转码成mp3格式 使用silk_v3_decoder.exe 和 lame.exe 文件通过cmd命令来转换成mp3格式 工具介绍: https://github.com/kn007/silk-v3-decoder/t
阅读全文
摘要:如 public class Person { public string Name{get;set;} public int Age{get;set;} } public class Student : Person { public string Grade {get;set;} [Newton
阅读全文
摘要:using StackExchange.Redis; using System; using System.Configuration; using System.Linq; using System.Threading; using System.Threading.Tasks; namespac
阅读全文
摘要:备注:常见问题 未能加载文件或程序集“System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个 原因分析:程序所依赖的dll 和实际引用的dll不相符,可以用修改配置文件web.
阅读全文
摘要:有时重新clone代码到本地时,会出现references中引用的包报错,这时可以重新更新下载这些包: 在VS工具栏中,Tools→NuGet Package Manager→Package Manager Console 输入Update-Package -reinstall,回车,等待更新完毕
阅读全文
摘要:默认情况下,读取xml文件是不忽略注释的,这样读取带注释的节点会造成异常,那么怎么屏蔽掉这些注释呢? XmlDocument doc = new XmlDocument(); XmlReaderSettings settings = new XmlReaderSettings(); settings
阅读全文
摘要:当您构建 .NET 应用程序时,它会被编译成 Microsoft 中间语言 (MSIL)。当用户启动应用程序时,其 MSIL 代码由“即时” (JIT) 编译器编译成机器代码。此过程可能会导致明显的延迟。除了您自己的应用程序之外,还可以加载外部 DLL(例如 DevExpress DLL),这意味着
阅读全文
摘要:private bool ExpandAndSelectItem(ItemsControl parentContainer, object itemToSelect) { //检查当前级别的所有项目 foreach (Object item in parentContainer.Items) { T
阅读全文
摘要:C#反编译一般使用Reflector。 此时工程中的资源文件被反编译为二进制的.resources文件,这个文件就是.resx。 需要通过VS SDK中的工具ResGen.exe恢复,命令行是 ResGen ***.resources ***.resx,就可以恢复。 将此文件加到工程中,如有下面一个
阅读全文
摘要://.net 4.0 设置: ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //.net 4.5 设置: ServicePointManager.SecurityProtocol = SecurityProtoc
阅读全文
摘要:using System; using System.Net; using System.Text; using System.Web.Services.Protocols; using System.Web.Services; using Galileo.Web; namespace Galile
阅读全文