随笔分类 - .NET
摘要:搬砖搬砖~ Content Type:application/x www form urlencoded的请求如下 参考资料 "How to POST using HTTPclient content type = application/x www form urlencoded"
阅读全文
摘要:cmd调用phantomjs 官方资料:http://phantomjs.org/quick-start.html 手动执行 从官方下载phantomjs.exe,拷贝它与要执行的js同目录打开cmd,输入命令行(参考官方资料的命令行) 获得结果 使用C#执行 //注意:保证phantomjs.ex
阅读全文
摘要:引用 服务器 自定义Connection public class BarrageConnection : PersistentConnection { protected override Task OnReceived(IRequest request, string connectionId,
阅读全文
摘要:.net framework 在Web.config文件中添加如下配置: <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <remove name="WebDAVModule"/> </modules> .
阅读全文
摘要:/// <summary> /// 获得header信息 /// </summary> /// <param name="response"></param> private void GetHeader(HttpResponseMessage response) { var headers = r
阅读全文
摘要:创建项目 需要选择.net Standard的项目 0 0 设置包信息 1 1 打包 2 2 在bin目录下可以看到生成的.nupkg文件 3 3 发布包 登录https://www.nuget.org ,选择Upload 4 4 上传成功之后,我们可以看到自己在设置里面填写的内容,进行核对 5 5
阅读全文
摘要:IGrouping<TKey, TElement>资料 https://docs.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/bb343251(v=vs.95)?WT.mc_
阅读全文
摘要:.net C#调用python 模拟请求(模拟header/gzip解压/泛型) C#控制台关闭之前做一些操作 C# 元组、匿名对象、ref&out DataTable转换为Entity(反射&&泛型) 异步 异步的几种方法 多线程 多线程Parallel和Task .net core .net c
阅读全文
摘要:public static IEnumerable<T> Parse<T>(IEnumerable<DataRow> rows) where T : class, new() { if (rows == null || Enumerable.FirstOrDefault<DataRow>(rows)
阅读全文
摘要:await&&async 可以返回,返回只有有操作时首选 Task Run/.Factory.StartNew….. 新开一个线程,完成某项工作,不需要返回,没有后续操作首选 回调函数 参考资料:http://blog.csdn.net/friendan/article/details/425863
阅读全文
摘要:不管是Parallel还是Task,最里面都是线程池(里面是线程)当开启多个任务后,系统会根据当前的线程池的资源进行分配,任务则进行等待Parallel可以对系统的CPU进行设置,可以最大程度上榨干系统的资源 参考资料:http://www.cnblogs.com/yunfeifei/p/39934
阅读全文
摘要:元组 private (int number,int newNumber) CaculateByTuple(int number) { return (number: number, newNumber: number * number); } private List<(int number, i
阅读全文
摘要:参考资料:https://stackoverflow.com/questions/4646827/on-exit-for-a-console-application
阅读全文
摘要:WebClient HeaderData是自定义类对象,存储header信息 private static T GetDataCommonMethod<T>(string url, string host, HeaderData headerData) where T : class { //注意H
阅读全文
摘要:参考资料: https://codefying.com/2015/10/02/executing-a-python-script-from-a-c-program/ demo: https://github.com/zLulus/NotePractice/tree/dev3/Console/CSha
阅读全文

浙公网安备 33010602011771号