vs2019离线安装包制作

vs2009脱机安装 执行layout.cmd,需要网络,如果已经下载localVSlayout,可以跳过这一步 执行cert.cmd,不需要网络. 执行setup.cmd,不需要网络. 脱机安装指引>https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019 可以参考1,3步命令下载安装其他组件 工作负载和组件id官网地址>https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-professional?view=vs-2019 ...

2025年7月24日 · 2 分钟 · 657 字

couchdb

CouchDB是一个开源的面向文档的数据库管理系统,建立于 C++ 之上。 ui http://192.168.200.16:5984/_utils/#/_all_dbs curl http://admin:admin@192.168.200.16:5984/_utils/#/_all_dbs curl -X PUT http://admin:admin@192.168.200.16:5984/test curl -X GET http://admin:admin@192.168.200.16:5984/test curl -X DELETE http://admin:admin@192.168.200.16:5984/test curl -X PUT http://admin:admin@192.168.200.16:5984/test/"002" -d "{\"Name\":\"Raju\",\"age\":\"23\"}" curl -X GET http://admin:admin@192.168.200.16:5984/test/"002" {"_id":"002","_rev":"1-d72ed8577c9b1547dec5052cd503b359","Name":"Raju","age":"23"} curl -X PUT http://admin:admin@192.168.200.16:5984/test/"002" -d "{\"Name\":\"Raju\",\"age\":\"24\",\"_rev\":\"1-d72ed8577c9b1547dec5052cd503b359\"}" curl -X GET http://admin:admin@192.168.200.16:5984/test/"002" {"_id":"002","_rev":"2-f2716b3df54d9bbbc7d9b4eafe965354","Name":"Raju","age":"24"} curl -X GET http://admin:admin@192.168.200.16:5984/test/"003" {"_id":"003","_rev":"1-d72ed8577c9b1547dec5052cd503b359","Name":"Raju","age":"23"} curl -X DELETE http://admin:admin@192.168.200.16:5984/test/"003"?rev=1-d72ed8577c9b1547dec5052cd503b359 curl -X GET http://admin:admin@192.168.200.16:5984/test/"003" {"error":"not_found","reason":"deleted"} 查询 ### ip192d168d129d162 POST http://192.168.200.16:5984/ip192d168d129d162/_find authorization: Basic YWRtaW46YWRtaW4= Content-Type: application/json { "selector": { "datetime": { "$gte": 20220517000000000 } }, "sort":[{"datetime":"desc"}], "bookmark":"", "limit": 1000, "fields": ["dateformat","data"], "execution_stats": true }

2025年7月24日 · 1 分钟 · 114 字

github-actions

GitHub Actions是GitHub平台提供的一种持续集成和持续部署(CI/CD)工具。它允许开发者在GitHub上自动化执行各种任务,如构建、测试、部署等。 使用GitHub Actions,您可以创建一个工作流程(Workflow),该工作流程由一个或多个任务(Job)组成,每个任务可以运行在不同的操作系统和环境中。每个任务又由一个或多个步骤(Step)组成,每个步骤可以运行一条或多条命令。 ...

2025年7月24日 · 2 分钟 · 540 字

jekyll-timezone

Jekyll的时区和时间 2019-12-02 07:00:00 +0800 | 建站 | Jekyll 时区 GitHub Pages 在填写博文Front Matter里的日期时间date变量时如果不带时区字段,一律视为UTC标准时+0000时区,如果要填写其他时区的时间必须指明时区,类似这样2019-12-02 07:00:00 +0800。在_config.yml设置修改timezone变量只关乎日期时间date的显示效果,而不影响真正的时间值。下面详述: ...

2025年7月24日 · 4 分钟 · 1811 字

WaitCallback

WaitCallback 委托一般用于将方法异步执行到线程池线程上。线程池是一组可重用的线程,可以在需要时分配线程来执行工作,而不需要创建新的线程。使用线程池可以避免频繁地创建和销毁线程,从而提高应用程序的性能和可伸缩性。 通常,您可以使用 ThreadPool.QueueUserWorkItem 方法将方法异步执行到线程池线程上,并使用 WaitCallback 委托来表示要执行的方法。在这种情况下,WaitCallback 委托的参数是一个 object 类型的对象,该对象可以包含要传递给方法的数据。 ...

2025年7月24日 · 1 分钟 · 283 字

yield

在 C# 中,yield 關鍵字用於定義一個迭代器方法(Iterator Method), 這個方法可以產生一個可枚舉的序列。當迭代器方法被調用時, 它不會立即執行方法體中的程式碼,而是返回一個 IEnumerator 對象。 當使用者對這個 IEnumerator 對象調用 MoveNext() 方法時,才會執行迭代器方法中的程式碼,並返回序列中的下一個元素。 ...

2025年7月24日 · 2 分钟 · 851 字

Tuple

可以通过nuget安装 NetLegacySupport.Tuple。这是从.Net 4.5移植到.Net 2.0和3.5的Tuple类 下面是一个使用 Tuple 的简单示例: using System; class Program { static void Main(string[] args) { // 创建一个包含两个元素的 Tuple var tuple = Tuple.Create("John", 30); // 访问 Tuple 中的元素 Console.WriteLine("Name: " + tuple.Item1); Console.WriteLine("Age: " + tuple.Item2); // 创建一个包含三个元素的 Tuple var tuple2 = Tuple.Create("Mary", 25, "Female"); // 访问 Tuple 中的元素 Console.WriteLine("Name: " + tuple2.Item1); Console.WriteLine("Age: " + tuple2.Item2); Console.WriteLine("Gender: " + tuple2.Item3); } } 在上面的示例中,我们使用 Tuple.Create 方法创建了两个不同元素数量的 Tuple,并访问了其中的元素。Tuple 的元素可以通过 Item1、Item2、Item3 等属性访问,也可以使用解构语法将元素分解成多个变量。 ...

2025年7月24日 · 1 分钟 · 395 字

.NET Framework 自托管详解

.NET Framework 自托管详解 自托管(Self-Hosting)是指不依赖 IIS 等外部 Web 服务器,而是通过应用程序自身创建和管理 Web 服务器实例的方式运行 Web 应用程序。 1. HttpListener 方式 这是最基础的自托管方式,使用 .NET Framework 内置的 HttpListener 类: using System; using System.IO; using System.Net; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { // 创建 HttpListener 实例 HttpListener listener = new HttpListener(); // 添加监听的 URL 前缀 listener.Prefixes.Add("http://localhost:8080/"); // 启动监听 listener.Start(); Console.WriteLine("服务器启动,监听 http://localhost:8080/"); // 处理请求循环 while (true) { // 等待请求 HttpListenerContext context = await listener.GetContextAsync(); // 处理请求 await ProcessRequest(context); } } static async Task ProcessRequest(HttpListenerContext context) { HttpListenerResponse response = context.Response; // 设置响应内容 string responseString = "<html><body><h1>Hello from Self-Hosted Server!</h1></body></html>"; byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); // 设置响应头 response.ContentType = "text/html"; response.ContentLength64 = buffer.Length; // 写入响应 using (Stream output = response.OutputStream) { await output.WriteAsync(buffer, 0, buffer.Length); } // 关闭响应 response.Close(); } } 2. ASP.NET Web API 自托管 使用 Microsoft.AspNet.WebApi.SelfHost 包可以创建更完整的 Web API 服务: ...

2025年7月24日 · 2 分钟 · 951 字

winform程序防止多开

Winform启动的时候,检测是否存在同样的进程名,防止程序多开; static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { string processName = Process.GetCurrentProcess().ProcessName; Process[] processes = Process.GetProcessesByName(processName); //如果该数组长度大于1,说明多次运行 if (processes.Length > 1) { MessageBox.Show("程序已运行,不能再次打开!"); Environment.Exit(1); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } } 利用Mutex互斥对象防止程序多开; static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { bool isAppRunning = false; Mutex mutex = new Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out isAppRunning); if (!isAppRunning) { MessageBox.Show("程序已运行,不能再次打开!"); Environment.Exit(1); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } }

2025年7月24日 · 1 分钟 · 247 字

.NET的版本

.NET Framework 是微软在 2002 年推出的一个软件开发框架,它提供了一组类库和运行时环境,可以用来开发 Windows 应用程序、Web 应用程序、服务端应用程序等。下面是 .NET Framework 的版本列表: .NET Framework 1.0 .NET Framework 1.1 .NET Framework 2.0 .NET Framework 3.0 .NET Framework 3.5 .NET Framework 4.0 .NET Framework 4.5 .NET Framework 4.5.1 .NET Framework 4.5.2 .NET Framework 4.6 .NET Framework 4.6.1 .NET Framework 4.6.2 .NET Framework 4.7 .NET Framework 4.7.1 .NET Framework 4.7.2 .NET Framework 4.8 除了 .NET Framework,微软还推出了 .NET Core 和 .NET 5,它们是跨平台的 .NET 实现,可以在 Windows、Linux 和 macOS 上运行。下面是 .NET Core 和 .NET 5 的版本列表: ...

2025年7月24日 · 1 分钟 · 310 字