.Net Framework 4.6.1+版本的Winform程序开启Web服务,支持Http webapi

news2024/9/21 1:32:03

Winform程序开启Web服务

  • 背景
  • 思路
    • 方法1
    • 方法2
    • 方法3(本文使用的方法)
  • 实现
    • 在winform程序中引入几个nuget包
    • 新建一个Startup类(叫什么名字都行)
    • 修改Program文件
    • 创建controller
  • 运行效果(打开浏览器,输入如下地址)
    • 修改地址,调用get方法引起winform变动
  • winform中的message方法
  • 关于配置端口和地址请查看文章
  • 完整代码下载

背景

在很久以前为了满足需求,已经开发了一款winform程序,并且是4.6.1版本的,如今为了和第三方对接,需要在这个winform上提供WebAPI的接口。因为第三方的程序是一份没有源码的程序。

思路

方法1

  • 网上有很多自写web服务的功能,个人觉得过于麻烦,而且还要考虑一些路由规则什么的,太难了

方法2

  • 使用iis或者nginx提供服务,一个web程序和一个winform程序实现通信,需要做两个程序,还要交互,麻烦

方法3(本文使用的方法)

考虑4.6.1 版本刚好支持了netcore,所以可以将kestrel服务集成到winform中,直接提供webapi服务

实现

在winform程序中引入几个nuget包

Microsoft.AspNetCore  Version="2.1.7"
Microsoft.AspNetCore.Mvc  Version="2.1.3"

在使用nuget引入的时候会将关联的全部引入进来,完整的packages.config文件如下

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.AspNetCore" version="2.1.7" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Antiforgery" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Authentication.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Authentication.Core" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Authorization" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Authorization.Policy" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Connections.Abstractions" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Cors" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Cryptography.Internal" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.DataProtection" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.DataProtection.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Diagnostics" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Diagnostics.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.HostFiltering" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Hosting" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Hosting.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Hosting.Server.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Html.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Http" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Http.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Http.Extensions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Http.Features" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.HttpOverrides" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.HttpsPolicy" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.JsonPatch" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Localization" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Abstractions" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.ApiExplorer" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Core" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Cors" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.DataAnnotations" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Formatters.Json" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Localization" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Razor" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.Razor.Extensions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.RazorPages" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.TagHelpers" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Mvc.ViewFeatures" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Razor" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Razor.Design" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Razor.Language" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Razor.Runtime" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.ResponseCaching.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Routing" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Routing.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Server.IISIntegration" version="2.1.7" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Server.Kestrel" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Server.Kestrel.Core" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Server.Kestrel.Https" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" version="2.1.3" targetFramework="net461" />
  <package id="Microsoft.AspNetCore.WebUtilities" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Common" version="2.8.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.CSharp" version="2.8.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Razor" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.CSharp" version="4.5.0" targetFramework="net461" />
  <package id="Microsoft.DiaSymReader.Native" version="1.7.0" targetFramework="net461" />
  <package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="net461" />
  <package id="Microsoft.Extensions.Caching.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Caching.Memory" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.Binder" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.CommandLine" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.EnvironmentVariables" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.FileExtensions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.Json" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Configuration.UserSecrets" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.DependencyInjection" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="net461" />
  <package id="Microsoft.Extensions.FileProviders.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.FileProviders.Composite" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.FileProviders.Physical" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.FileSystemGlobbing" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Hosting.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Localization" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Localization.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Logging" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Logging.Configuration" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Logging.Console" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Logging.Debug" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.ObjectPool" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Options" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.Primitives" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Extensions.WebEncoders" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Net.Http.Headers" version="2.1.1" targetFramework="net461" />
  <package id="Microsoft.Win32.Registry" version="4.5.0" targetFramework="net461" />
  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
  <package id="Newtonsoft.Json.Bson" version="1.0.1" targetFramework="net461" />
  <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
  <package id="System.Buffers" version="4.5.0" targetFramework="net461" />
  <package id="System.Collections" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net461" />
  <package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net461" />
  <package id="System.Console" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.DiagnosticSource" version="4.5.1" targetFramework="net461" />
  <package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
  <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net461" />
  <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.Pipelines" version="4.5.3" targetFramework="net461" />
  <package id="System.Linq" version="4.3.0" targetFramework="net461" />
  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
  <package id="System.Memory" version="4.5.2" targetFramework="net461" />
  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
  <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net461" />
  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
  <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.AccessControl" version="4.5.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Cng" version="4.5.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Xml" version="4.5.0" targetFramework="net461" />
  <package id="System.Security.Permissions" version="4.5.0" targetFramework="net461" />
  <package id="System.Security.Principal.Windows" version="4.5.1" targetFramework="net461" />
  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encoding.CodePages" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encodings.Web" version="4.5.0" targetFramework="net461" />
  <package id="System.Threading" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks.Extensions" version="4.5.1" targetFramework="net461" />
  <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Thread" version="4.3.0" targetFramework="net461" />
  <package id="System.ValueTuple" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XPath" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="net461" />
</packages>

新建一个Startup类(叫什么名字都行)

代码如下

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace 测试一个winform
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseMvc();
        }
    }
}

修改Program文件

增加一个启动web的方法,并且在main函数中将方法启动
为了在后面能够调用form1,所以我还将form1的对象改成了静态的,代码如下

using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 测试一个winform
{
    internal static class Program
    {
    //声明一个静态的
        public static Form1 mainForm;
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
        //启动
            Task.Run(() => { CreateWebHostBuilder(new string[] { }).Build().Run(); }); 
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            mainForm = new Form1();
            Application.Run(mainForm);
        }

//新增加的代码
        public static IWebHostBuilder CreateWebHostBuilder(string[] args)
        {
            return WebHost.CreateDefaultBuilder(args)
                .UseUrls("http://0.0.0.0:7001", "https://0.0.0.0:7002")
                   .UseStartup<Startup>();
        }
    }
}

创建controller

文件结构如下
在这里插入图片描述

代码内容如下

using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using 测试一个winform;

namespace 测试一个winform集成web.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        // GET api/values
        [HttpGet]
        public ActionResult<IEnumerable<string>> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/values/5
        [HttpGet("{id}")]
        public ActionResult<string> Get(int id)
        {

            Program.mainForm.Message(id.ToString());
            return "value";
        } 
    }
}

运行效果(打开浏览器,输入如下地址)

在这里插入图片描述

修改地址,调用get方法引起winform变动

在这里插入图片描述

winform中的message方法


        public void Message(string message)
        {
            //MessageBox.Show(message);
            this.Invoke(new Action(() => { button1.Text = message; }));
         
        }

关于配置端口和地址请查看文章

https://blog.csdn.net/iml6yu/article/details/100692488

https://blog.csdn.net/iml6yu/article/details/100692488

完整代码下载

https://download.csdn.net/download/iml6yu/87726309

如果无法下载可以 QQ和我说 (复制下面给内容到浏览器地址栏,按下回车 tencent://message/?uin=646007589&Site=&Menu=yes

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/459474.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

“量子+生成式AI”!IBM联合生物制药公司Moderna进行疫苗研究

​ &#xff08;图片来源&#xff1a;网络&#xff09; 4月20日&#xff0c;以COVID-19疫苗而闻名的生物技术和制药公司Moderna Inc.表示&#xff0c;宣布正在与IBM公司合作&#xff0c;利用量子计算和生成式人AI探索推进研究mRNA技术的方法。 双方签署了一项协议&#xff0c;允…

python 基础系列篇:七、以函数方式编写一个数字华容道

python 基础系列篇&#xff1a;七、以函数方式编写一个数字华容道 数字华容道游戏分析开始编写完整代码代码解说定义方法的规律 小结 数字华容道 嗯&#xff0c;就是一个简单的益智游戏&#xff0c;把数字按照特定规律排列&#xff0c;并比矩阵少一个格&#xff0c;用来进行移…

CRM客户关系管理系统主要有哪些功能?

一、CRM客户管理系统是什么 客户关系管理&#xff08;Customer Relationship Management&#xff0c;简称CRM&#xff09;&#xff0c;是指企业为提高核心竞争力&#xff0c;利用相应的信息技术以及互联网技术协调企业与顾客间在销售、营销和服务上的交互&#xff0c;从而提升…

将CSDN博客内容转为PDF进行下载

打开博客文章页面–F12–控制台–输入以下代码-回车–选择“另存为PDF”–设置样式并预览–打印 回车之后需要等待一些时间 设置之后导出即可 (function(){ use strict;var articleBox $("div.article_content");articleBox.removeAttr("style");…

超低延时交换机助力金融证券极速交易场景应用

一、 极速交易技术的兴起 随着计算机技术和金融科技的快速发展&#xff0c;量化交易和高频交易在全球金融市场中已经被运用到各种交易场景&#xff0c;特别是在股票&#xff0c;期货&#xff0c;期权等衍生品市场&#xff0c;已经逐渐取代人工做市&#xff08;market maker)&am…

Android 动画—补间动画

帧动画是通过连续播放图片来模拟动画效果&#xff0c;而补间动画开发者只需指定动画开始&#xff0c;以及动画结束"关键帧"&#xff0c;而动画变化的"中间帧"则由系统计算并补齐&#xff01; 1.补间动画的分类和Interpolator Andoird所支持的补间动画效果…

【应急响应】挖矿脚本检测指南威胁情报样本定性文件清除入口修复

文章目录 挖矿样本-Win&Linux-危害&定性Linux-Web安全漏洞导致挖矿事件Windows-系统口令爆破导致挖矿事件Linux-个人真实服务器被植入挖矿分析 挖矿样本-Win&Linux-危害&定性 危害&#xff1a;CPU拉满&#xff0c;网络阻塞&#xff0c;服务器卡顿、耗电等 定性…

Opencv+Python笔记(十)灰度直方图、直方图均衡化、掩模的应用

目录 一、灰度直方图二、图像掩模的应用三、直方图均衡化1.直方图均衡化2.自适应的直方图均衡化 一、灰度直方图 概念&#xff1a; 灰度直方图是关于灰度级分布的函数&#xff0c;是对图像中灰度级分布的统计。灰度直方图是将数字图像中的所有像素&#xff0c;按照灰度值的大小…

SAP-重复制造行业为什么推荐定额工艺路线

翻译一篇大佬的文章&#xff1a; Why Rate Routing is (recommended) used in Repetitive Manufacturing? 看多了博客解Routing和Rate routing的区别&#xff0c;看来还是有很多会员不满意或者不清楚&#xff0c;对此类问题的概念或解释。我认为很少有屏幕截图的博客可以帮助…

UML--类图--软件工程系统学习-- idea查看类图-类关系图

文章目录 什么是类图类图的用途类图的组成 类什么是类类符号类关系依赖&#xff08;Dependence&#xff09;idea查看依赖 关联关系&#xff08;association&#xff09;继承/泛化idea查看继承 实现&#xff08;realization&#xff09;聚合组成组合和聚合之间的差异 类图详解id…

无感平滑迁移:海量高并发数据库如何进行国产化改造?

首先&#xff0c;讲一下数据库国产化的大背景。 一、数据库国产化的背景 国家战略方面的&#xff0c;随着外部形势的日益复杂&#xff0c;核心技术急需实现自主可控、安全可靠、高效开放&#xff1b;另一个要求是业务方面的&#xff0c;当业务高速发展后各种问题会接踵而至&a…

Go | 一分钟掌握Go | 4 - 数组

作者&#xff1a;Mars酱 声明&#xff1a;本文章由Mars酱编写&#xff0c;部分内容来源于网络&#xff0c;如有疑问请联系本人。 转载&#xff1a;欢迎转载&#xff0c;转载前先请联系我&#xff01; 说明 特意省去了很多基础章节&#xff0c;比如常量、变量、条件语句、判断语…

GPT应用-使用中文操作数据库

GPT应用-使用中文操作数据库 本次尝试使用langchain来操作数据库&#xff1b; 环境配置 下面是数据库相关的表&#xff0c;使用Mysql5.7 数据库,数据库名students 下面是相关表的介绍 学生表&#xff0c;有名字、分数、和老师的备注 学生父母表&#xff0c;其中有学生的名…

053:cesium显示网格切片标识,展示X、Y、Level 坐标

第053个 点击查看专栏目录 本示例的目的是介绍如何在vue+cesium中加载瓦片网格切分标识地图。,它在切片方案中的每个渲染图块周围绘制一个框,并在其中绘制一个标签,指示图块的 X、Y、Level 坐标。 这主要用于调试地形和图像渲染问题。 直接复制下面的 vue+cesium源代码,操…

【Buildroot】基础知识:目录、根文件系统目录覆盖、编译性能分析(编译时间、目标尺寸、包依赖图)

文章目录 一、Buildroot目录介绍二、Finalizing target2.1 fs overlay2.2 post build2.3 post image 三、编译性能3.1 编译耗时3.2 编译依赖关系3.3 编译结果尺寸分析3.4 其他文件 buildroot官方教程 buildroot使用介绍 Buildroot官网上可以下载发布版 国内的SOC厂商Rockchip就…

第二届SWCTF部分WP

1、misc &#xff08;1&#xff09;Misc1 下载附件&#xff0c;压缩包里面有两张jpg图片 解压后习惯性的放进kali里面分析一下&#xff0c;没有隐藏文件 放到Stegsolve里分析&#xff0c;因为是两张一样的图片&#xff0c;combiner也没啥发现 分别对两张图片单独分析也没有发…

网卡,dma,内存关系

本篇主要讲网卡的工作原理 最近在做一个网卡仿真程序。主要目的是用程序代替网卡去向内存中填充报文。 网卡与内存的交互方式 1. rx阶段 网卡通过DMA向内存中发送数据包。 在内存中主要有三个数据结构 ① DMA环(rx_ring), 其中存储了DMA描述符, DMA描述符指向了实际物理地址…

【Python | 基础语法篇】01、字面量、注释、变量、数据类型及转换

目录 一、字面量 1.1 什么是字面量 1.2 常用的值类型 1.3 字符串 1.4 如何在代码中写它们 1.5 总结 二、注释 2.1 注释的作用 2.2 注释的分类 2.3 注释实战 2.4 总结 2.5 思考 三、变量 3.1 什么是变量 3.2 案例——模拟钱包 3.3 变量的特征 3.4 思考 3.5 …

一篇文章看懂MySQL的多表连接(包含左/右/全外连接)

MySQL的多表查询 这是第二次学习多表查询&#xff0c;关于左右连接还是不是很熟悉&#xff0c;因此重新看一下。小目标&#xff1a;一篇文章看懂多表查询&#xff01;&#xff01; 这篇博客是跟着宋红康老师学习的&#xff0c;点击此处查看视频&#xff0c;关于数据库我放在了…

主动式电容笔是什么?苹果平替电容笔性价比高的推荐

苹果Pencil在市场上有需求吗&#xff1f;苹果的原装电容笔&#xff0c;虽然功能强大&#xff0c;但价格却非常的昂贵。当然&#xff0c;你也可以用这个苹果Pencil&#xff0c;不过&#xff0c;如果你不想花大价钱买它&#xff0c;就可以选一支平替的电容笔。就当前的科技水平而…