在WPF中实现多语言切换的四种方式

news2024/9/29 3:59:03

在WPF中有多种方式可以实现多语言,这里提供几种常用的方式。

一、使用XML实现多语言切换

使用XML实现多语言的思路就是使用XML作为绑定的数据源。主要用到XmlDataProvider类.

使用XmlDataProvider.Source属性指定XML文件的路径或通过XmlDataProvider.Document指定XML文档对象,XmlDataProvider.XPath属性指定绑定的路径。

新建一个WPF工程,在debug目录下创建两个StrResource.xml文件,分别置于en-US和zh-CN文件夹

debug\en-US\StrResource.xml

1 <?xml version="1.0" encoding="utf-8"?>
2 <Language>
3     <Main_Title>Login Form</Main_Title>
4     <Main_UserName>UserName</Main_UserName>
5     <Main_Password>Password</Main_Password>
6     <Main_Button>Login</Main_Button>
7     <Window1_Title>Main Form</Window1_Title>
8     <Window1_Label>Welcome</Window1_Label>
9 </Language>

debug\zh-CN\StrResource.xml

1 <?xml version="1.0" encoding="utf-8"?>
2 <Language>
3     <Main_Title>登陆窗体</Main_Title>
4     <Main_UserName>用户名</Main_UserName>
5     <Main_Password>密码</Main_Password>
6     <Main_Button>登陆</Main_Button>
7     <Window1_Title>主界面</Window1_Title>
8     <Window1_Label>欢迎</Window1_Label>
9 </Language>

主窗体XAML

 1  <StackPanel>
 2         <Label Content="{Binding XPath=Main_UserName}"></Label>
 3         <TextBox></TextBox>
 4         <Label Name="Password" Content="{Binding XPath=Main_Password}"></Label>
 5         <TextBox></TextBox>
 6         <Button Height="20" Margin="10,5" Background="LightSkyBlue" Name="Login" Content="{Binding XPath=Main_Button}" Click="Login_Click"></Button>
 7         <ComboBox Name="combox" SelectedIndex="0" SelectionChanged="combox_SelectionChanged">
 8             <ComboBoxItem>中文</ComboBoxItem>
 9             <ComboBoxItem>English</ComboBoxItem>
10         </ComboBox>
11     </StackPanel>

后台代码中,将XmlDataProvider对象绑定到界面即可

1 XmlDocument doc = new XmlDocument();
2 XmlDataProvider xdp = new XmlDataProvider();
3 doc.Load("./zh-CN/language.xml");  //在切换语言时,重新加载xml文档,并重新绑定到界面即可
4 xdp.Document = doc;
5 xdp.XPath = @"/Language";
6 this.DataContext = xdp;

运行效果如下:

二、使用资源字典实现多语言切换

资源字典的实现方式也比较简单,这是最常用的一种方式。

主要实现步骤是:将要显示的字符绑定到资源文件,然后在切换语言时用代码更改当前使用的资源文件即可。

创建一个WPF工程,添加一个language目录,再添加en-US和zh-CN目录。再分别在目录下创建资源字典文件,内容如下:

language\en-US.xaml

 1 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 2                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3                     xmlns:s="clr-namespace:System;assembly=mscorlib">
 4     <s:String x:Key="Main.Title">Main Form</s:String>
 5     <s:String x:Key="Main.RibbonTab.Setting">Setting</s:String>
 6     <s:String x:Key="Main.RibbonGroup.Setting">All Setting</s:String>
 7     <s:String x:Key="Main.RibbonButton.Setting">Setting</s:String>
 8     <s:String x:Key="Main.RibbonButton.Setting.Title">Setting</s:String>
 9     <s:String x:Key="Main.RibbonButton.Setting.Description">All Setting Include Language</s:String>
10     <s:String x:Key="Setting.Title">Setting</s:String>
11     <s:String x:Key="Setting.Tab.Language">Language Setting</s:String>
12     <s:String x:Key="Setting.Tab.Label.ChooseLanguage">Please choose a language</s:String>
13 </ResourceDictionary>

language\zh-CN.xaml

 1 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 2                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3                     xmlns:s="clr-namespace:System;assembly=mscorlib">
 4     <s:String x:Key="Main.Title">主界面</s:String>
 5     <s:String x:Key="Main.RibbonTab.Setting">设置</s:String>
 6     <s:String x:Key="Main.RibbonGroup.Setting">全部设置</s:String>
 7     <s:String x:Key="Main.RibbonButton.Setting">设置</s:String>
 8     <s:String x:Key="Main.RibbonButton.Setting.Title">设置</s:String>
 9     <s:String x:Key="Main.RibbonButton.Setting.Description">包括语言在内的全部设置</s:String>
10     <s:String x:Key="Setting.Title">设置</s:String>
11     <s:String x:Key="Setting.Tab.Language">语言设置</s:String>
12     <s:String x:Key="Setting.Tab.Label.ChooseLanguage">请选择一种语言</s:String>
13 </ResourceDictionary>

主窗体XAML

 1 <TabControl>
 2         <TabItem Header="{DynamicResource Setting.Tab.Language}">
 3             <StackPanel>
 4                 <TextBlock VerticalAlignment="Top" Margin="5,5,5,0" HorizontalAlignment="Left" Text="{DynamicResource Setting.Tab.Label.ChooseLanguage}">
 5                 </TextBlock>
 6                 <ComboBox Height="20"  VerticalAlignment="Top" Margin="5,10" Width="200" HorizontalAlignment="Left" Name="combox_Language" SelectionChanged="combox_Language_SelectionChanged">
 7                     <ComboBoxItem>中文</ComboBoxItem>
 8                     <ComboBoxItem>English</ComboBoxItem>
 9                 </ComboBox>
10             </StackPanel>
11         </TabItem>
12     </TabControl>

后台代码

 private void combox_Language_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ChangeLanguage(this.combox_Language.SelectedIndex);
        }


        /// <summary>
        /// 切换 语言
        /// </summary>
        /// <param name="index"></param>
        public void ChangeLanguage(int index)
        {
            ResourceDictionary rd = new ResourceDictionary();
            switch(index)
            {
                case 0:
                    rd.Source = new Uri("Language/zh-CN.xaml", UriKind.Relative);
                    break;
                case 1:
                    rd.Source = new Uri("Language/en-US.xaml", UriKind.Relative);
                    break;
                default:
                    break;
            }            
            Application.Current.Resources.MergedDictionaries[0] = rd;
        }

运行效果如下:

三、使用资源文件实现多语言切换

这种方式的实现也比较简单,也是将字符绑定到资源文件(.resx)

但需要注意的是,这种方式是静态的,不能实现动态切换。只能在启动时更改。

创建一个WPF工程,添加一个字符资源文件StrResources.resx作为默认的字符资源文件,再添加一个StrResources.zh-CN.resx做为中文字符资源(因为我用于演示的这台电脑系统是英文的)

注意:需要将访问修饰符改为public,否则运行会报错

主界面XAML

 1  <Grid>
 2         <Label HorizontalAlignment="Left" VerticalAlignment="Top" Content="{x:Static local:StrResources.ChangeLanguage}"></Label>
 3         <ComboBox HorizontalAlignment="Left" VerticalAlignment="Top" Margin="120,5,0,0" Width="200" Name="combox_Culture">
 4             <ComboBoxItem Content="{x:Static local:StrResources.zh_CN}"></ComboBoxItem>
 5             <ComboBoxItem Content="{x:Static local:StrResources.en_US}"></ComboBoxItem>
 6         </ComboBox>
 7 
 8         <Button Content="{x:Static local:StrResources.OK}" Width="88" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,120,0"/>
 9         <Button Content="{x:Static local:StrResources.Cancel}" Width="88" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,0"/>
10     </Grid>

主界面后台逻辑

 1  public partial class MainWindow : Window
 2     {
 3         public MainWindow()
 4         {
 5             InitializeComponent();
 6 
 7             LoadCulture();
 8         }
 9 
10         public void LoadCulture()
11         {
12             if(CultureInfo.CurrentCulture.Name== "zh-CN")
13             {
14                 combox_Culture.SelectedIndex = 0;
15             }
16             else
17             {
18                 combox_Culture.SelectedIndex = 1;
19             }
20         }   
21     }

在Application类的Startup事件中可以切换语言,但在程序运行后无法再切换

 1    public partial class App : Application
 2     {
 3         private void Application_Startup(object sender, StartupEventArgs e)
 4         {
 5             //在这里可以更改语言
 6             ChangeCulture(0);
 7         }
 8 
 9         public void ChangeCulture(int index)
10         {
11             string cultureName = "";
12 
13             switch (index)
14             {
15                 case 0:
16                     cultureName = "zh-CN";
17                     break;
18                 case 1:
19                     cultureName = "en-US";
20                     break;
21                 default:
22                     cultureName = "en-US";
23                     break;
24             }
25 
26             Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName);
27             Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureName);
28         }
29     }

运行效果:

四、使用json文件实现多语言切换

这种方式实现多语言切换有点麻烦,但可以使用json作为语言文件(其它格式文件其实也可以.txt .xml .csv)。

这种方式的实现原理是使用索引器方法查找每个字段值,然后绑定到界面上。支持动态切换

debug目录下创建

zh-CN.json

1 {
2   "OK": "确定",
3   "Cancel": "取消",
4   "ChangeLanguage": "更改语言",
5   "zh_CN": "中文",
6   "en_US": "English"
7 }

en-US.json

1 {
2   "OK": "OK",
3   "Cancel": "Cancel",
4   "ChangeLanguage": "Change language",
5   "zh_CN": "中文",
6   "en_US": "English"
7 }

封装一个绑定通知类,这个类用于切换语言时,绑定的通知更新。

 1 /// <summary>
 2     /// 绑定通知类
 3     /// </summary>
 4     public class NotifyPropertyChanged : INotifyPropertyChanged
 5     {
 6         public event PropertyChangedEventHandler PropertyChanged;
 7 
 8         protected void RaisePropertyChanged(string PropertyName)
 9         {
10             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(PropertyName));
11         }
12 
13         protected void OnPropertyChanged([CallerMemberName] string PropertyName = null)
14         {
15             RaisePropertyChanged(PropertyName);
16         }
17 
18         protected void RaiseAllChanged()
19         {
20             RaisePropertyChanged("");
21         }
22     }

创建一个语言字段类,这个类用于封装所有的语言字段。这一步确实就比较麻烦了,每个字段都得封装一个属性。

 1  /// <summary>
 2     /// 语言字段类
 3     /// </summary>
 4     public class LanguageFields : NotifyPropertyChanged
 5     {
 6         /// <summary>
 7         /// 需要被重写的方法 用于获取语言字段值
 8         /// </summary>
 9         /// <param name="key"></param>
10         /// <returns></returns>
11         protected virtual string GetValue(string key) => "";
12 
13         protected virtual void SetValue(string Key, string value) { }
14 
15         /// <summary>
16         /// 使用CallerMemberName特性传递当前属性名
17         /// </summary>
18         /// <param name="propertyName"></param>
19         /// <returns></returns>
20         string Get([CallerMemberName] string propertyName = null)
21         {
22             return GetValue(propertyName);
23         }
24 
25         void Set(string value, [CallerMemberName] string propertyName = null)
26         {
27             SetValue(propertyName, value);
28         }
29 
30         public string OK { get => Get(); set => Set(value); }
31         public string Cancel { get => Get(); set => Set(value); }
32         public string ChangeLanguage { get => Get(); set => Set(value); }
33         public string zh_CN { get => Get(); set => Set(value); }
34         public string en_US { get => Get(); set => Set(value); }
35     }

创建一个语言切换帮助类,这个类可以对当前使用的语言以及字段值进行操作

 1  public class LanguageHelper : LanguageFields
 2     {   
 3         private JObject currentLanguage;           //当前语言的JObject对象 
 4         private static readonly string dir = Environment.CurrentDirectory;  //语言文件夹
 5         private CultureInfo currentCulture;   //当前语言
 6 
 7         public static LanguageHelper Instance { get; } = new LanguageHelper();
 8 
 9         LanguageHelper()
10         {
11             CurrentCulture = CultureInfo.CurrentCulture;
12         }
13 
14         /// <summary>
15         /// 当前语言属性 当值更新时,加载语言并更新绑定
16         /// </summary>
17         public CultureInfo CurrentCulture
18         {
19             get => currentCulture;
20             set
21             {
22                 currentCulture = value;
23                 CultureInfo.CurrentUICulture = value;
24                 currentLanguage = LoadLang(value.Name); 
25                 LanguageChanged?.Invoke(value);
26                 RaiseAllChanged();
27             }
28         }
29 
30         /// <summary>
31         /// 加载语言文件 
32         /// </summary>
33         /// <param name="LanguageId"></param>
34         /// <returns></returns>
35         JObject LoadLang(string LanguageId)
36         {
37             try
38             {
39                 var filePath = System.IO.Path.Combine(dir, $"{LanguageId}.json");
40                 return JObject.Parse(File.ReadAllText(filePath));
41             }
42             catch
43             {
44                 return new JObject();
45             }
46         }
47 
48         /// <summary>
49         /// 索引器方法 用于查找语言字段值
50         /// </summary>
51         /// <param name="Key"></param>
52         /// <returns></returns>
53         public string this[string Key]
54         {
55             get
56             {
57                 if (Key == null)
58                     return "";
59 
60                 if (currentLanguage != null && currentLanguage.TryGetValue(Key, out var value) && value.ToString() is string s && !string.IsNullOrWhiteSpace(s))
61                     return s;
62 
63                 return Key;
64             }
65         }
66 
67         /// <summary>
68         /// 重写 GetValue方法,调用索引器方法 
69         /// </summary>
70         /// <param name="PropertyName"></param>
71         /// <returns></returns>
72         protected override string GetValue(string PropertyName) => this[PropertyName];
73 
74         /// <summary>
75         /// 语言更改事件
76         /// </summary>
77         public event Action<CultureInfo> LanguageChanged;
78     }

主窗体XAML

 1  <Grid>
 2         <Label HorizontalAlignment="Left" VerticalAlignment="Top" Content="{Binding ChangeLanguage, Source={StaticResource LangManger}, Mode=OneWay}"></Label>
 3         <ComboBox HorizontalAlignment="Left" VerticalAlignment="Top" Margin="120,5,0,0" Width="200" Name="combox_Culture" SelectionChanged="combox_Culture_SelectionChanged">
 4             <ComboBoxItem Content="{Binding zh_CN, Source={StaticResource LangManger}, Mode=OneWay}"></ComboBoxItem>
 5             <ComboBoxItem Content="{Binding en_US, Source={StaticResource LangManger}, Mode=OneWay}"></ComboBoxItem>
 6         </ComboBox>
 7 
 8         <Button Content="{Binding OK, Source={StaticResource LangManger}, Mode=OneWay}" Width="88" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,120,0"/>
 9         <Button Content="{Binding Cancel, Source={StaticResource LangManger}, Mode=OneWay}" Width="88" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,0"/>
10     </Grid>

主窗体后台逻辑

软件启动时,加载当前语言。当下位框切换时,切换语言。

 1 public partial class MainWindow : Window
 2     {
 3         public MainWindow()
 4         {
 5             InitializeComponent();
 6 
 7             LanguageHelper.Instance.LanguageChanged += Instance_LanguageChanged;
 8             LoadCulture(LanguageHelper.Instance.CurrentCulture);
 9         }
10 
11         private void Instance_LanguageChanged(System.Globalization.CultureInfo obj)
12         {
13             //这里可以对语言更改进行处理
14             switch(obj.Name)
15             {
16                 case "zh-CN":
17                     break;
18                 case "en-US":
19                     break;
20             }
21         }
22 
23         private void LoadCulture(System.Globalization.CultureInfo culture)
24         {
25             switch(culture.Name)
26             {
27                 case "zh-CN":
28                     combox_Culture.SelectedIndex = 0;
29                     break;
30                 case "en-US":
31                     combox_Culture.SelectedIndex = 1;
32                     break;
33             }
34         }
35 
36         private void combox_Culture_SelectionChanged(object sender, SelectionChangedEventArgs e)
37         {
38             var culture = "zh-CN";
39 
40             switch(combox_Culture.SelectedIndex)
41             {
42                 case 0:
43                     culture = "zh-CN";
44                     break;
45                 case 1:
46                     culture = "en-US";
47                     break;
48             }
49 
50             if (culture == null)
51                 return;
52 
53             LanguageHelper.Instance.CurrentCulture = new System.Globalization.CultureInfo(culture.ToString().Replace("_", "-"));   //变量命名不支持 '-' ,所以这里需要替换一下
54         }
55     }

示例代码

https://github.com/zhaotianff/DotNetCoreWPF/tree/master/其它、实现多语言切换的几种方式/MultiLanguageDemo

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

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

相关文章

5G NR 协议规范表(对应3GPP 协议编号)

文章目录 5G NR 协议规范表&#xff08;对应3GPP 协议编号&#xff09;5G 架构相关协议5G 新空口相关协议无线接入网相关协议终端相关协议 5G NR 协议规范表&#xff08;对应3GPP 协议编号&#xff09; 5G 架构相关协议 5G 新空口相关协议 无线接入网相关协议 终端相关协议

怎么将其他内容与表单组合成二维码?扫码查看内容填写数据的制作技巧

怎么将视频、图片、文字等内容和表单组合生成二维码&#xff1f;现在用二维码来制作表单收集用户数据是一种很常见的方式&#xff0c;将问题做成表单生成二维码&#xff0c;其他人只需要扫码就能够根据问题来填写自己的反馈信息&#xff0c;更加的简单方便。 那么需要让扫码者…

通用型pdf合并工具,分享7款简单易学的pdf处理软件,日常电脑必备!

日常学习和工作中&#xff0c;我们难免会遇到需要编辑pdf文件的情况。熟悉pdf格式文档的小伙伴都知道&#xff0c;pdf不易于编辑&#xff0c;需要借助专业的pdf编辑软件才能实现。现在pdf编辑、pdf转word、pdf合并、pdf拆分等功能都可以轻松实现。尽管如此&#xff0c;也有不少…

服装品牌小程序展示承载服务

服装大小品牌众多&#xff0c;还包括多区域的门店商家合作批发、咨询等&#xff0c;品牌或经销商想要获得更多生意&#xff0c;线上渠道往往是必备的&#xff0c;品牌宣传、获客转化及持续的信息干货输出等。 线上渠道多样化&#xff0c;尤其是微信、百度、抖音、快手等平台聚…

获取 Jupyter Notebook IPython kernel 在电脑中的目录位置

获取 Jupyter Notebook IPython kernel 在电脑中的目录位置 正文 正文 在 VS code 的 terminal 中或者 Windows 的命令行中使用如下代码即可。 ipython locate运行后得到如下结果&#xff1a; 如图所示&#xff0c;我们获取到了 ipython 的位置。 如果大家觉得有用&#xf…

Arthas redefine(加载外部的.class文件,redefine到JVM里 )

文章目录 二、命令列表2.2 class/classloader相关命令2.2.3 redefine&#xff08;加载外部的.class文件&#xff0c;redefine到JVM里 &#xff09;举例1&#xff1a;加载新的代码&#xff0c;jad/mc 命令使用举例2&#xff1a;上传 .class 文件到服务器的技巧 二、命令列表 2.…

童装购买系统小程序的设计

管理员账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;用户管理&#xff0c;商家管理&#xff0c;商品分类管理&#xff0c;尺码信息管理&#xff0c;款式信息管理&#xff0c;商品信息管理&#xff0c;在线咨询管理&#xff0c;系统管理 微信端账号功能包…

基于php摄影门户网站

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、Vue项目源码、SSM项目源码 精品专栏&#xff1a;Java精选实战项目…

多输入多输出预测 | NGO-BP北方苍鹰算法优化BP神经网络多输入多输出预测(Matlab)

多输入多输出预测 | NGO-BP北方苍鹰算法优化BP神经网络多输入多输出预测&#xff08;Matlab&#xff09; 目录 多输入多输出预测 | NGO-BP北方苍鹰算法优化BP神经网络多输入多输出预测&#xff08;Matlab&#xff09;预测效果基本介绍程序设计往期精彩参考资料 预测效果 基本介…

Android Glide(一):源码分析,内存缓存和磁盘缓存的分析,实现流程以及生命周期

目录 一、Android Glide是什么&#xff0c;如何使用&#xff1f; Android Glide是一个由Google维护的快速高效的Android图像加载库&#xff0c;它旨在简化在Android应用程序中加载和显示图像的过程&#xff0c;包括内存缓存、磁盘缓存和网络加载&#xff0c;以确保图像加载的快…

算力共享系统中数据平面和控制平面

目录 算力共享系统中数据平面和控制平面 数据平面 控制平面 算力共享系统举例 控制流程和业务流程,在算力共享系统中举例说明 控制流程 业务流程 算力共享系统中数据平面和控制平面 在算力共享系统中,数据平面和控制平面是两个关键组成部分,它们各自承担着不同的角色…

网络层——IP

IP地址 结构&#xff1a; 由32位二进制数组成&#xff0c;通常用点分的形式被分为四个部分&#xff0c;每个部分1byte&#xff0c;最大值为255。 从功能的角度看&#xff0c;ip地址由两部分组成&#xff0c;网络号和主机号。网络号标识了ip所在的网段&#xff0c;主机号标识了…

AI大模型:揭秘AI产品经理与传统产品经理的差别与转型攻略

引言&#xff1a; 随着ChatGPT等革命性产品的流行&#xff0c;人工智能&#xff08;AI&#xff09;在中国的发展势头愈发强劲。众多企业纷纷投身AI领域&#xff0c;希望在激烈的市场竞争中占据有利位置。在这一背景下&#xff0c;AI产品经理成为了一个备受瞩目的职业角色。那么…

智慧环保大数据平台建设方案

1. 智慧环保现状与挑战 随着环境问题日益严重&#xff0c;环境事件频发&#xff0c;如贵州都匀矿渣污染、云南南盘江水污染等&#xff0c;以及癌症高发率的出现&#xff0c;智慧环保建设显得尤为重要。智慧环保旨在通过技术手段提升环境管理和决策的智能化水平。 2. 宏观环境…

ubuntu系统下,c++图形库Matplot++配置

linux下安装c图形库Matplot&#xff0c;使得c可以可视化编程&#xff1b;安装Matplot之前&#xff0c;需要先安装一个gnuplot&#xff0c;因为Matplot是依赖于此库 gnuplot下载链接&#xff1a; http://www.gnuplot.info/ 一、gnuplot下载与安装 step1.进入链接点击Release链…

一文了解ChatGPT的发展浪潮

前言 近一段时间在学Prompt&#xff0c;刚好学到了ChatGPT的一些发展史&#xff0c;因此沉淀一些相关的概念内容。 以下开始本文的讲解~&#x1f468;&#x1f680; 一、AI简述 人工智能发展史上的三次浪潮&#xff1a; 人工智能、机器学习和深度学习的关系&#xff1a; 人…

大碗娱乐发布业务调整说明 取消艺人经纪业务

大碗娱乐今日发布业务调整说明&#xff1a;不再负责艺人业务&#xff0c;而贾玲导演将专注内容创作。据悉&#xff0c;其公司旗下艺人张小斐、许君聪、卜钰、何欢、张泰维、朱天福、曹贺军、刘宏禄的经纪合约均已到期&#xff0c;双方不再续约&#xff0c;但未来会共同寻求以其…

Excel的基本应用__3

九九乘法表 MAX函数:找出最大值 FREQUENCY函数:计算符合区间的数量 语法&#xff1a; FREQUENCY(data_array, bins_array) data_array&#xff1a;要计算频率的数据数组或单元格区域。bins_array&#xff1a;用于定义区间的数组或单元格区域。 如果您不按 Ctrl Shift Ent…

Soar项目中添加一条新的SQL审核规则示例

soar是一个开源的SQL规则审核工具&#xff0c;是一个go语言项目&#xff0c;可以直接编译构建成一个可执行程序&#xff0c;而且是一个命令行工具&#xff0c;我们可以利用archey来调用soar进行sql规则审核以及sql的分析&#xff0c;包括执行计划的查看及sql建议等。 soar中已…

django开发流程3(轮播图)

1.在models中创建一个模板 class Ads(models.Model):title models.CharField(verbose_name"标题", max_length30)image models.ImageField(verbose_name"广告图", upload_to"ads")url models.URLField(verbose_name"链接网址", de…