System.IO.Compression 是官方发布的一个由于解压缩的工具包,默认使用 utf8 编码解压缩文件。 但是在 Windows 上,编码比较混乱,如果文件或目录是中文名称,那么解压后会出现乱码,即使压缩包都是 UTF8 编码,.NET 解压也会出现乱码问题,所以需要使用 GB2312[......] 继续阅读

2023年10月12日 0条评论 4488点热度 0人点赞 痴者工良 阅读全文

System.IO.Compression is an official release of a decompression toolkit that defaults to using UTF-8 encoding for decompressing files. However, on Win[......] 继续阅读

2023年10月12日 0条评论 3754点热度 0人点赞 痴者工良 阅读全文

C# 编写 SignalR 客户端时需要手动注入客户端方法: connection.On<string, string>("ReceiveMessage", (user, message) => { t[......]继续阅读

2023年9月25日 1条评论 3522点热度 3人点赞 痴者工良 阅读全文

C# Writing a SignalR Client Requires Manual Injection of Client Methods: connection.On<string, string>("ReceiveMessage", ([......]继续阅读

2023年9月25日 1条评论 3192点热度 3人点赞 痴者工良 阅读全文

研究了很久源码,发现了其运行机制。 如果 BlazorWebView 跳转的页面不是 https://0.0.0.0 ,那么就会使用客户端之外的浏览器打开页面。 // 这里的地址允许在浏览器中打开 public static readonly Uri[] URLS = new Uri[......]继续阅读

2023年9月21日 0条评论 5164点热度 0人点赞 痴者工良 阅读全文

The source code has been studied for a long time, and its operating mechanism has been discovered. If the page that BlazorWebView navigates to is not[......] 继续阅读

2023年9月21日 0条评论 1090点热度 0人点赞 痴者工良 阅读全文

Model Class: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API Interface: [HttpPost("aaa")][......]继续阅读

2023年9月19日 0条评论 1196点热度 0人点赞 痴者工良 阅读全文

模型类: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API 接口: [HttpPost("aaa")[......]继续阅读

2023年9月19日 1条评论 3301点热度 0人点赞 痴者工良 阅读全文

using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; async Task Main() { Task<int> task = CreateTask(); int res[......]继续阅读

2023年9月19日 0条评论 1193点热度 0人点赞 痴者工良 阅读全文

using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; async Task Main() { Task<int> task = CreateTask(); i[......]继续阅读

2023年9月19日 0条评论 2650点热度 0人点赞 痴者工良 阅读全文

By default, WebView2 displays in English, including in places like the console and print interface. However, it can be modified to use the local langu[......] 继续阅读

2023年9月14日 0条评论 1252点热度 0人点赞 痴者工良 阅读全文

默认 webview2 使用英文语言显示,包括控制台、打印台等地方,都是英文提示,因此可以修改为本地语言。 public static void SetWebviewLanguage(string language = "zh-CN") { v[......]继续阅读

2023年9月14日 0条评论 3399点热度 0人点赞 痴者工良 阅读全文

Default WebView2 will be installed in the system directory, which may lead to insufficient permissions when the program starts, preventing the use of[......] 继续阅读

2023年9月14日 0条评论 1196点热度 0人点赞 痴者工良 阅读全文

默认 Webview2 会被安装到系统目录,可能会导致程序启动时权限不足,无法使用 Webview2,以及多版本程序之间发生存储目录冲突。 因此需要自定义设置 Webview2 目录,最好就存储在程序安装目录下。 首先修改 App.xaml 文件,添加一行: <Application.[......]继续阅读

2023年9月14日 0条评论 4285点热度 0人点赞 痴者工良 阅读全文

部署 Apollo 之后,创建一个应用。 然后创建命名空间,选择 private 创建私有命名空间,选择 json 格式。 点击修改文本,填入 json 内容。 然后在 .NET 程序中引入包 <PackageReference Include="Com.Ctrip.F[......]继续阅读

2023年9月11日 0条评论 2716点热度 0人点赞 痴者工良 阅读全文

Deploy Apollo and create an application. Then create a namespace, select private to create a private namespace, and choose the json format. Click mo[......] 继续阅读

2023年9月11日 0条评论 1014点热度 0人点赞 痴者工良 阅读全文

首先是中间件,它决定了有时间显示哪些分组。 可以从 IApiDescriptionGroupCollectionProvider 服务中获取所有 API,然后通过 API 进行识别,检查是否有分组。 if (context.HostingEnvironment.I[......]继续阅读

2023年8月15日 0条评论 3640点热度 2人点赞 痴者工良 阅读全文

First is the middleware, which determines which groups to display when there is time. All APIs can be obtained from the IApiDescriptionGroupCollectio[......] 继续阅读

2023年8月15日 0条评论 1356点热度 2人点赞 痴者工良 阅读全文

在 signalR 中如需获取客户端的连接信息,可以使用 IHttpConnectionFeature 获取客户端通讯的 IP 和端口。 // 获取服务 var feature = Context.Features.Get<IHttpConnec[......]继续阅读

2023年8月4日 0条评论 3031点热度 0人点赞 痴者工良 阅读全文

In SignalR, to obtain the client's connection information, you can use IHttpConnectionFeature to retrieve the client's communication IP and port. [......]继续阅读

2023年8月4日 0条评论 1044点热度 0人点赞 痴者工良 阅读全文
13456728