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 https://0.0.0.0, then it will open the page in a browser outside the client. // The URLs here are allowed to b…

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

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

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

Model Class: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API Interface: [HttpPost("aaa")] public string AAA([FromBody] Test test) { return "11111111111"; } However, Swagger still displays the type as…

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

模型类: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API 接口: [HttpPost("aaa")] public string AAA([FromBody] Test test) { return "11111111111"; } 但是 Swagger 还是显示 int 类型,没有跟着 json 配置而变化。 所以我们需要[......] 继续阅读

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

using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; async Task Main() { Task<int> task = CreateTask(); int result = await task; } Task<int> CreateTask() { // Create an asynchronous task method builder AsyncTaskMethodB…

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

using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; async Task Main() { Task<int> task = CreateTask(); int result = await task; } Task<int> CreateTask() { // 创建一个异步任务方法构建器 AsyncTaskMethodBuilder<int> builder = A…

2023年9月19日 0条评论 1702点热度 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 language. public static void SetWebviewLanguage(string language = "zh-CN") { var cultureInfo = new Cultur…

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

默认 webview2 使用英文语言显示,包括控制台、打印台等地方,都是英文提示,因此可以修改为本地语言。 public static void SetWebviewLanguage(string language = "zh-CN") { var cultureInfo = new CultureInfo(language); // 设置程序使用的语言,可以忽略。 CultureInfo.CurrentCulture = cultureInfo; CultureIn[......]继续阅读

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

Default WebView2 will be installed in the system directory, which may lead to insufficient permissions when the program starts, preventing the use of WebView2, and can also cause storage directory conflicts between multiple versions of the program. Therefore, …

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

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

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

Deploy Apollo and create an application. Then create a namespace, select private to create a private namespace, and choose the json format. Click modify text and fill in the json content. Next, reference the package in the .NET program <PackageReference Inc…

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

部署 Apollo 之后,创建一个应用。 然后创建命名空间,选择 private 创建私有命名空间,选择 json 格式。 点击修改文本,填入 json 内容。 然后在 .NET 程序中引入包 <PackageReference Include="Com.Ctrip.Framework.Apollo.Configuration" Version="2.10.2" /> 在配置文件中定义 apollo 的设置。 { "apollo": { "AppId": "ApolloTest", "MetaServe…

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

First is the middleware, which determines which groups to display when there is time. All APIs can be obtained from the IApiDescriptionGroupCollectionProvider service, and then identified through APIs to check for groups. if (context.HostingEnvironment.IsDevel…

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

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

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

In SignalR, to obtain the client's connection information, you can use IHttpConnectionFeature to retrieve the client's communication IP and port. // Get the service var feature = Context.Features.Get<IHttpConnectionFeature>(); var httpContext = Context.G…

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

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

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

In ABP, by default, only local JSON language handling is available. However, for business purposes, we may have many customization needs. This article introduces how to implement multi-language handling based on Redis, fetching language information from Redis.…

2023年7月27日 0条评论 82点热度 1人点赞 痴者工良 阅读全文

在 ABP 中,默认只有本地 JSON 语言处理,但是在业务上我们可能有好多定制需求。本文介绍如何自己根据 redis 实现一个多语言处理,通过 redis 取得语言信息。 ABP 官方文档:https://docs.abp.io/en/abp/latest/Localization ABP 是这样配置多语言的: services.Configure<AbpLocalizationOptions>(options => { options.Resources .Add<TestResourc…

2023年7月27日 0条评论 2598点热度 1人点赞 痴者工良 阅读全文

Using Chinese characters in .csproj can cause errors during Jenkins CICD. Microsoft.WinFX.targets(439,8): error : Invalid character in the given encoding. The reason is that the encoding used by MSBuild or dotnet publish is UTF-8. When saving the .csproj file,…

2023年7月24日 0条评论 86点热度 0人点赞 痴者工良 阅读全文

在 .csproj 中使用了中文,导致 Jenkins CICD 的时候报错。 Microsoft.WinFX.targets(439,8): error : Invalid character in the given encoding. 原因在于 MSBuild 或者 dotnet publish 使用的编码集合为 utf8。 保存 .csproj 文件时,要使用 utf-8 bom,里面的字符要使用 utf8。 而 powershell 中默认是 GB2312 编码,所以会导致报错。 另一个问题,由于需求,需…

2023年7月24日 0条评论 1921点热度 0人点赞 痴者工良 阅读全文
15678954