原创 ASP.NET Core中設置跨域

1.添加NuGet包"Microsoft.AspNetCore.Cors" 2.appsettings.json中配置可跨域的站點 { "Logging": { "LogLevel": { "Default":

原创 Docker中安裝MySQL

1. 查看MySQL 鏡像庫地址:https://hub.docker.com/_/mysql?tab=tags  2 拉取 MySQL 鏡像 docker pull mysql:latest  3.查看本地是否拉取已拉取鏡像成功

原创 ASP.NET Core 3.1 中使用Autofac實現屬性注入

1.在項目NuGet程序包中引用:Autofac.Extensions.DependencyInjection 2.Program程序入口類中替換容器 public static IHostBuilder CreateHostBuil

原创 Windows10企業版中安裝Docker

1.下載Docker for Windows 下載地址:https://docs.docker.com/docker-for-windows/install/#download-docker-for-windows            

原创 ASP.NET Core3.1中如何使用Autofac

ASP.NET Core3.1中如何使用Autofac (1)添加Autofac.Extensions.DependencyInjection引用   (2)在Program.cs中添加工廠服務者  public static IHos

原创 ASP.NET Core中使用Filter

 public class  RequestActionAttribute : ActionFilterAttribute     {         /// <summary>         /// 方法執行前         //

原创 提交項目到git

前提條件安裝git和配置,比較簡單這裏就不介紹了。   右擊菜單中"Git Bash Here"輸入如下命令 1.初始化 git init 2. 設置提交地址 git remote add origin https://gitee.c

原创 ASP.NET Core中Hangfire作業設計

原因:Hangfire定時作業時爲了不需要每加一個作業都需要添加一行定時作業代碼。 解決方案:   定義重複作業接口   interface IRecurringJob   {         string CronExpression

原创 c# 三種泛型委託Func、Action、Predicate

Func<T>委託有返回值的泛型委託,封裝了最多可以傳入16個參數,方法返回void的不能使用Func<T>委託。 Action<T>委託返回值爲void,封裝了最多可以傳入16個參數,用法與Func<T>相同。 Predicate<T>

原创 WMWare Player中安裝CentOS8記錄

CentOS8下載地址:http://isoredirect.centos.org/centos/8/isos/x86_64/CentOS-8.1.1911-x86_64-dvd1.iso   Home右鍵新建虛擬機,選擇“i will

原创 c# List分組轉換爲List

var que = GlobalData.QueList.GroupBy(x => new { x.Type }).Distinct().SelectMany(t => new List<string> { t.Key.Type });

原创 VMWare中安裝CentOS8提示The following problem occurred on line 31

問題: The following problem occurred on line 31 of the kickstart file: Section %packages does not end with a %end 解決方法: 1

原创 Git提交本地文件到遠程倉庫

1.初始化當前要提交的項目文件夾,在要提交文件的文件夾中右鍵 "Git Bash Here" git init 2.把文件夾中所有文件添加到版本庫中 git add . 3.把文件提交到倉庫 git commit -m '提交說明'

原创 Windows10家庭版中安裝Docker

1.下載Docker  Docker可以支持在mac、windows、linux上安裝。但是在windows系統中Docker目前僅有win10專業版和企業版的安裝包,win7/win8/win10家庭版需要通過docker toolbo

原创 Winform 使用ComboBox.DataSource綁定數據會觸發SelectedIndexChanged事件解決

1.綁定數據後再添加SelectedIndexChanged事件 2.SelectedIndexChanged事件中判斷是否是選擇項改變觸發事件 if(ComboxBox1.ContainsFocus) { }