2025年5月9日

用JavaScript来实现下载

摘要: 1、javascript脚本 function downloadFile(data, fileName, type="text/plain") { // 创建不可见的元素 const a = document.createElement("a"); a.style.display = "none"; 阅读全文

posted @ 2025-05-09 16:34 jack_Meng 阅读(147) 评论(0) 推荐(0)

netcore获取客户端IP和端口号

摘要: 在我们的启动类的 Configure方法里加上。 ? 1 app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeader 阅读全文

posted @ 2025-05-09 16:26 jack_Meng 阅读(77) 评论(0) 推荐(0)

c# 批量注册接口和服务,示例代码

摘要: ? 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 5 阅读全文

posted @ 2025-05-09 16:24 jack_Meng 阅读(52) 评论(0) 推荐(0)

netcore自定义中间件实现限流

摘要: netcore限流 using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Ca 阅读全文

posted @ 2025-05-09 16:14 jack_Meng 阅读(26) 评论(0) 推荐(0)

C# 中 WebSocket 与 SignalR:实时通信的两种选择

摘要: 在现代 Web 应用中,实时通信变得越来越重要。无论是聊天应用、在线游戏、股票行情推送还是协作编辑工具,都需要服务器能够主动向客户端推送数据。在 .NET 生态系统中,WebSocket 和 SignalR 是实现这一功能的两个主要方案。 本文将对这两种技术进行比较,分析它们的异同点和使用场景,并提 阅读全文

posted @ 2025-05-09 16:13 jack_Meng 阅读(283) 评论(0) 推荐(0)

不借助第三个变量,交换两个变量的值

摘要: ? 1 2 3 4 5 //方法一: var a=-2,b=-3;a=a+b;b=a-b;a=a-b; // console.log(a+','+b); //方法二: var a=-2,b=-3;a=a^b;b=a^b;a=a^b; // console.log(a+','+b); 2025-05- 阅读全文

posted @ 2025-05-09 15:42 jack_Meng 阅读(17) 评论(0) 推荐(0)

浏览器 Javascript 版本

摘要: IE 1.3 Chrome 1.7 Firefox 1.8 Yours: ? 1 2 3 4 5 6 7 8 9 function javascriptversion(){ for(var i=1;i<10;i++){ var d = document.createElement('script') 阅读全文

posted @ 2025-05-09 15:36 jack_Meng 阅读(8) 评论(0) 推荐(0)

在chrome console中添加jQuery

摘要: 由于现有seajs等封装,以及vue等其他框架,jQuery等已不使用,或不在全局暴露,即使网站中已使用jQuery,在console也使用不了。 所以考虑使用fetch加载jQuery库,fetch是web提供的一个可以获取异步资源的api,目前还没有被所有浏览器支持,它提供的api返回的是Pro 阅读全文

posted @ 2025-05-09 10:41 jack_Meng 阅读(30) 评论(0) 推荐(0)

导航