当前位置: 首页 > news >正文

【Qt之QLocale】使用

描述

QLocale类可以在多种语言之间进行数字和字符串的转换。
QLocale类在构造函数中使用语言/国家对进行初始化,并提供类似于QString中的数字转字符串和字符串转数字的转换函数。
示例:

  QLocale egyptian(QLocale::Arabic, QLocale::Egypt);QString s1 = egyptian.toString(1.571429E+07, 'e');QString s2 = egyptian.toString(10);double d = egyptian.toDouble(s1);int i = egyptian.toInt(s2);

QLocale支持默认语言环境的概念,该语言环境在应用程序启动时根据系统的语言环境设置确定。可以通过调用静态成员函数setDefault()来更改默认语言环境。
设置默认语言环境有以下效果:
如果使用默认构造函数创建QLocale对象,它将使用默认语言环境的设置。
QString::toInt()QString::toDouble()等将根据默认语言环境解释字符串。如果解释失败,则返回"C"语言环境。
在格式字符串的位置说明符中包含’L’时,QString::arg()使用默认语言环境格式化数字,例如"%L1"。
以下示例说明了如何直接使用QLocale

  QLocale::setDefault(QLocale(QLocale::Hebrew, QLocale::Israel));QLocale hebrew; // 构造一个默认的QLocale对象QString s1 = hebrew.toString(15714.3, 'e');bool ok;double d;QLocale::setDefault(QLocale::C);d = QString("1234,56").toDouble(&ok);   // ok == falsed = QString("1234.56").toDouble(&ok);   // ok == true, d == 1234.56QLocale::setDefault(QLocale::German);d = QString("1234,56").toDouble(&ok);   // ok == true, d == 1234.56d = QString("1234.56").toDouble(&ok);   // ok == true, d == 1234.56QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));str = QString("%1 %L2 %L3").arg(12345).arg(12345).arg(12345, 0, 16);// str == "12345 12,345 3039"
  1. 在构造函数中指定语言/国家对时,会出现以下三种情况之一:
  • 如果语言/国家对在数据库中找到,则使用它。
  • 如果找到了语言但没有找到国家,或者国家为AnyCountry,则使用具有最合适的可用国家的语言(例如,对于德语,使用德国)。
  • 如果既没有找到语言也没有找到国家,则QLocale默认使用默认语言环境(参见setDefault())。
    可以使用()和country()来确定实际使用的语言和国家值。
  1. 另一种构造QLocale对象的方法是通过指定区域设置名称。
  QLocale korean("ko");QLocale swiss("de_CH");

该构造函数将区域设置名称转换为语言/国家对;它不使用系统的区域设置数据库。
注意:要获取当前键盘输入语言环境,请查看QInputMethod::locale()

常用函数

枚举
  1. Country { AnyCountry, Afghanistan, Albania, Algeria, …, SintMaarten }:国家/地区枚举类型

  2. CurrencySymbolFormat { CurrencyIsoCode, CurrencySymbol, CurrencyDisplayName }:货币符号格式枚举类型

  3. FloatingPointPrecisionOption { FloatingPointest }:浮点数精度选项枚举类型

  4. FormatType { LongFormat, ShortFormat, NarrowFormat }:格式类型枚举类型

  5. Language { AnyLanguage, C, Abazian, Oromo, …, UncodedLanguages }:语言枚举类型

  6. MeasurementSystem { MetricSystem, ImperialUSSystem, ImperialUKSystem, ImperialSystem }:计量系统枚举类型

  7. NumberOption { DefaultNumberOptions, OmitGroupSeparator, RejectGroupSeparator, OmitLeadingZeroInponent, …, RejectTrailingZeroesAfterDot }:数字选项枚举类型

  8. QuotationStyle { StandardQuotation, AlternateQuotation }:引用样式枚举类型

  9. Script { AnyScript, AdlamScript, AhomScript, AnatolianHieroglyphsScript, YiScript }:脚本枚举类型

公有方法
  • QLocale():默认构造函数。

  • QLocale(const QString &name):通过区域的BCP-47名称来构造QLocale对象。

  • QLocale(Language language, Country country = AnyCountry):通过语言和国家/地区来构造QLocale对象。

  • QLocale(Language language, Script script, Country country):通过语言、脚本和国家/地区来构造QLocale对象。

  • QLocale(const QLocale &other):拷贝构造函数。

  • ~QLocale():析构函数。

  • QString amText() const:获取上午的文本表示。

  • QString bcp47Name() const:获取BCP-47格式的名称。

  • Country country() const:获取国家/地区。

  • QString createSeparatedList(const QStringList &list) const:将列表中的字符串用适当的分隔符连接起来。

  • QString currencySymbol(CurrencySymbolFormat format = CurrencySymbol) const:获取货币符号。

  • QString dateFormatFormatType format = LongFormat) const:获取日期格式。

  • `QString dateTimeFormat(FormatType format = LongFormat) const:获取日期和时间格式。

  • QString dayName(int day, FormatType type = LongFormat) const:获取星期几的名称。

  • QChar decimalPoint() const:获取小数点符号。

  • QChar exponential() const:获取科学计数法表示中的指数符号。

  • Qt::DayOfWeek firstDayOfWeek() const:获取星期的第一天。

  • QChar groupSeparator() const:获取千位分隔符。

  • Language language() const:获取语言。

  • MeasurementSystem measurementSystem() const:获取测量系统。

  • QString monthName(int month, FormatType type = LongFormat) const:获取月份的名称。

  • QString name() const:获取区域的名称。

  • QString nativeCountryName() const:获取本地化的国家/地区名称。

  • QString nativeLanguageName() const:获取本地化的语言名称。

  • QChar negativeSign() const:获取负号符号。

  • NumberOptions numberOptions() const:获取数字显示的选项。

  • QChar percent() const:获取百分号符号。

  • QString pmText() const:获取下午的文本表示。

  • QChar positiveSign() const:获取正号符号。

  • QString quoteString(const QString &str, QuotationStyle style = StandardQuotation) const:将字符串用引号括起来。

  • QString quoteString(const QStringRef &str, QuotationStyle style = StandardQuotation) const:将字符串引用用引号括起来。

  • Script script() const获取脚本。

  • void setNumberOptions(NumberOptions options)设置数字显示的选项。

  • QString standaloneDayName(int day, FormatType type = LongFormat) const获取独立的星期几的名称。

  • QString standaloneMonthName(int month, FormatType type = LongFormat) const获取独立的月份的名称。

  • void swap(QLocale &other)交换两个QLocale对象的内容。

  • Qt::LayoutDirection textDirection() const获取文本的布局方向。

  • QString timeFormat(FormatType format = LongFormat) const获取时间格式。

  • QString toCurrencyString(qlonglong value, const QString &symbol = QString()) const将长整型数值转换为货币字符串。

  • QString toCurrencyString(qulonglong value, const QString &symbol = QString()) const将无符号长整型数值转换为货币字符串。

  • QString toCurrencyString(short value, const QString &symbol = QString()) const将短整型数值转换为货币字符串。

  • QString toCurrencyString(ushort value, const QString &symbol = QString()) const将无符号短整型数值转换为货币字符串。

  • QString toCurrencyString(int value, const QString &symbol = QString()) const将整型数值转换为货币字符串。

  • QString toCurrencyString(uint value, const QString &symbol = QString()) const将无符号整型数值转换为货币字符串。

  • QString toCurrencyString(double value, const QString &symbol = QString()) const将双精度浮点数值转换为货币字符串。

  • QString toCurrencyString(double value, const QString &symbol, int precision) const将双精度浮点数值以指定精度转换为货币字符串。

  • QString toCurrencyString(float value, const QString &symbol = QString()) const将单精度浮点数值转换为货币字符串。

  • QString toCurrencyString(float value, const QString &symbol, int precision) const将单精度浮点数值以指定精度转换为货币字符串。

  • QDate toDate(const QString &string, FormatType format = LongFormat) const将字符串转换为日期。

  • QDate toDate(const QString &string, const QString &format) const将字符串按指定格式转换为日期。

  • QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const将字符串转换为日期和时间。

  • QDateTime toDateTime(const QString &string, const QString &format) const将字符串按指定格式转换为日期和时间。

  • double toDouble(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为双精度浮点数。

  • double toDouble(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为双精度浮点数。

  • float toFloat(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为单精度浮点数。

  • float toFloat(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为单精度浮点数。

  • int toInt(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为整型数。

  • int toInt(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为整型数。

  • qlonglong toLongLong(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为长整型数。

  • qlonglong toLongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为长整型数。

  • QString toLower(const QString &str) const将字符串转换为小写形式。

  • short toShort(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为短整型数。

  • short toShort(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为短整型数。

  • QString toString(qlonglong i) const将长整型数转换为字符串。

  • QString toString(qulonglong i) const将无符号长整型数转换为字符串。

  • QString toString(short i) const将短整型数转换为字符串。

  • QString toString(ushort i) const将无符号短整型数转换为字符串。

  • QString toString(int i) const将整型数转换为字符串。

  • QString toString(uint i) const将无符号整型数转换为字符串。

  • QString toString(double i, char f = 'g', int prec = 6) const将双精度浮点数转换为字符串。

  • QString toString(float i, char f = 'g', int prec = 6) const将单精度浮点数转换为字符串。

  • QString toString(const QDate &date, const QString &format) const将日期按指定格式转换为字符串。

  • QString toString(const QDate &date, FormatType format = LongFormat) const将日期转换为字符串。

  • QString toString(const QTime &time, const QString &format) const将时间按指定格式转换为字符串。

  • QString toString(const QTime &time, FormatType format = LongFormat) const将时间转换为字符串。

  • QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const将日期和时间转换为字符串。

  • QString toString(const QDateTime &dateTime, const QString &format) const将日期和时间按指定格式转换为字符串。

  • QTime toTime(const QString &string, FormatType format = LongFormat) const将字符串转换为时间。

  • QTime toTime(const QString &string, const QString &format) const将字符串按指定格式转换为时间。

  • uint toUInt(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为无符号整型数。

  • uint toUInt(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为无符号整型数。

  • qulonglong toULongLong(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为无符号长整型数。

  • qulonglong toULongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为无符号长整型数。

  • ushort toUShort(const QString &s, bool *ok = Q_NULLPTR) const将字符串转换为无符号短整型数。

  • ushort toUShort(const QStringRef &s, bool *ok = Q_NULLPTR) const将字符串引用转换为无符号短整型数。

  • QString toUpper(const QString &str) const将字符串转换为大写形式。

  • QStringList uiLanguages() const获取支持的UI语言列表。

  • QList<Qt::DayOfWeek weekdays() const获取一周的星期几列表。

  • QChar zeroDigit() const获取零字符。

  • bool operator!=(const QLocale &other) const判断两个QLocale对象是否不相等。

  • QLocale &operator=(QLocale &&other)将一个QLocale对象的内容移动赋值给当前对象。

  • QLocale &operator=(const QLocale &other)将一个QLocale对象的内容复制给当前对象。

  • bool operator==(const QLocale &other) const判断两个QLocale对象是否相等。

示例

    // 获取系统的默认区域设置QLocale locale = QLocale::system();// 将数字转换为字符串int number = 123456;QString numberString = locale.toString(number);qDebug() << "Number:" << numberString; // 输出:"Number: 123,456"(如果系统的默认区域设置是中文或其他使用逗号作为千位分隔符的语言)// 将字符串转换为数字QString numberString2 = "987,654.32";double number2 = locale.toDouble(numberString2);qDebug() << "Number2:" << number2; // 输出:"Number2: 987654.32"// 格式化日期和时间QDateTime dateTime = QDateTime::currentDateTime();QString formattedDateTime = locale.toString(dateTime, "yyyy-MM-dd hh:mm:ss");qDebug() << "Formatted DateTime:" << formattedDateTime; // 输出:"Formatted DateTime: 2023-10-29 11:31:33"// 获取星期几的名称for (int i = Qt::Monday; i <= Qt::Sunday; i++) {Qt::DayOfWeek dayOfWeek = static_cast<Qt::DayOfWeek>(i);QString dayName = locale.standaloneDayName(dayOfWeek, QLocale::ShortFormat);qDebug() << "Day Name:" << dayName; // 输出:星期一、星期二等(根据系统的默认区域设置)}

结果

在这里插入图片描述

使用场景

  1. 数字和字符串的格式化:QLocale可以将数字格式化为带有千位分隔符、小数位数和货币符号的字符串,也可以将字符串转换为数字。

  2. 日期和时间的格式化:QLocale可以将日期和时间格式化为特定的日期格式、时间格式和日期时间格式,以适应不同的地区和语言习惯。

  3. 货币格式化:QLocale支持将货币格式化为带有货币符号、千位分隔符和小数位数的字符串,并可以根据特定国家/地区的习惯进行舍入和舍入规则。

  4. 语言和地区设置:QLocale可以获取当前系统的默认区域设置信息,包括当前所使用的语言、国家/地区、货币和日期时间的格式等。

  5. 语言和地区的切换:QLocale使得应用程序可以根据用户的偏好在不同的语言和地区之间进行切换,以提供本地化的用户界面和内容。

总之,QLocale是一个重要的工具类,用于处理与地区相关的数据和操作,它可以帮助开发人员实现国际化和本地化的功能,使应用程序能够根据用户的语言和地区偏好提供适当的显示和格式。

相关文章:

【Qt之QLocale】使用

描述 QLocale类可以在多种语言之间进行数字和字符串的转换。 QLocale类在构造函数中使用语言/国家对进行初始化&#xff0c;并提供类似于QString中的数字转字符串和字符串转数字的转换函数。 示例&#xff1a; QLocale egyptian(QLocale::Arabic, QLocale::Egypt);QString s1 …...

维修服务预约小程序的效果如何

生活服务中维修项目绝对是需求量很高的&#xff0c;如常见的保洁、管道疏通、数码维修、安装、便民服务等&#xff0c;可以说每天都有生意&#xff0c;而对相关维修店企业来说&#xff0c;如何获得更多生意很重要。 接下来让我们看看通过【雨科】平台制作维修服务预约小程序能…...

前端架构体系调研整理汇总

1.公司研发人数与前端体系 小型创业公司 前端人数&#xff1a; < 3 人 产品类型&#xff1a; 产品不是非常成熟&#xff0c;比较新颖。 项目流程&#xff1a;不完善&#xff0c;快、紧促&#xff0c;没有固定的时间排期。 技术栈&#xff1a; 没有历史包袱&#xff0c;技…...

DrawerLayout的点击事件会穿透到底部,如何拦截?

DrawerLayout实现侧后&#xff0c;发现了一个问题。点击DrawerLayout的画面&#xff0c;会触发覆盖的底层页面的控件。由此说明点击事件穿透到了底部。但是我只需要触发抽屉布局里的控件&#xff0c;不想触发底层被覆盖的看不见的按钮&#xff0c;由此我想到的时让抽屉页面拦截…...

在Spring boot中 使用JWT和过滤器实现登录认证

在Spring boot中 使用JWT和过滤器实现登录认证 一、登录获得JWT 在navicat中运行如下sql,准备一张user表 -- ---------------------------- -- Table structure for t_user -- ---------------------------- DROP TABLE IF EXISTS t_user; CREATE TABLE t_user (id int(11) …...

天堂2如何对版本里面的内容进行修改

天堂2写装备属性的问题 早一点的版本属性都是写在armor文件夹 xml档里&#xff0c;不再写armor里了 armor文件夹里只有防御 HP MP增加量&#xff0c;套装的属性都用一个技能形式写在 skills里了 在配合数据库里一个叫armorsets实现套装属性&#xff0c;拿皇家套做说明。 id 43…...

代码随想录Day33 LeetCode T62不同路径 LeetCode T63 不同路径II

前言 动规五部曲 1.确定dp数组含义 2.确定递推公式 3.初始化数组 4.确定遍历方式 5.打印dp数组查看分析问题 LeetCode T62 不同路径 题目链接:62. 不同路径 - 力扣&#xff08;LeetCode&#xff09; 题目思路: 注:n行m列而不是m行n列 1.确定dp数组含义 代表到达此下标有多少条…...

【计算机网络】分层模型和应用协议

网络分层模型和应用协议 1. 分层模型 1.1 五层网络模型 网络要解决的问题是&#xff1a;两个程序之间如何交换数据。 四层&#xff1f;五层&#xff1f;七层&#xff1f; 2. 应用层协议 2.1 URL URL&#xff08;uniform resource locator&#xff0c;统一资源定位符&#…...

Python框架之Flask入门和视图

一、Flask入门和视图 需要安装Pycharm专业版 1. Flask简介 Python后端的2个主流框架 Flask 轻量级框架Django 重型框架 Flask是一个基于Python实现的web开发微框架 官方文档&#xff1a;https://flask.palletsprojects.com/ 中文文档&#xff1a;https://dormousehole.readthe…...

streamWriter.WriteLine

streamWriter.WriteLine写入文件有回车行 using (System.IO.StreamWriter streamWriter new System.IO.StreamWriter("D:\123.txt", false, System.Text.Encoding.Default)) { streamWriter.Write(str.Replace("…...

一键添加色彩变幻效果,视频剪辑从未如此简单!

在视频制作过程中&#xff0c;给视频添加特效是必不可少的环节。而其中&#xff0c;色彩变幻效果作为一种常用的特效&#xff0c;能够为视频增添独特的氛围和视觉冲击力。然而&#xff0c;对于许多初学者来说&#xff0c;如何批量给视频添加色彩变幻效果特效功能却是一个难题。…...

Linux的简介和环境搭建

简介 Linux是一套免费使用和自由传播的类Unix操作系统&#xff0c;是一个基于POSIX和Unix的多用户、多任务、支持多线程和多CPU的操作系统。它能运行主要的Unix工具软件、应用程序和网络协议。它支持32位和64位硬件。Linux继承了Unix以网络为核心的设计思想&#xff0c;是一个…...

你看现在的程序员,是怎么解bug的

大家好&#xff0c;我是伍六七。 干程序员的都会碰到各种各样的 bug&#xff0c;有的 bug 我们看一眼、或者多看几眼就能看出来问题。 但是&#xff0c;也有很多问题&#xff0c;我们看不出来&#xff0c;这个时候&#xff0c;我们不妨把我们的代码扔给 GPT&#xff0c;看看它…...

CSS3背景样式

在CSS 2.1中&#xff0c;background属性的功能还无法满足设计的需求&#xff0c;为了方便设计师更灵活地设计需要的网页效果&#xff0c;CSS3在原有background基础上新增了一些功能属性&#xff0c;可以在同一个对象内叠加多个背景图像&#xff0c;可以改变背景图像的大小尺寸&…...

JAVA同城服务同城圈子真人躲猫猫系统的玩法流程

在现在科技的发展和互联网的普及&#xff0c;线上社交游戏在人们的生活中占据了越来越重要的地位。JAVA同城服务同城圈子真人躲猫猫系统就是一种结合了线上社交和线下实体位置服务的全新游戏模式。在这个游戏中&#xff0c;玩家们可以在同一城市中寻找隐藏的对手&#xff0c;体…...

C++继承——圆形和圆柱体

C继承 Circular圆形类 /*圆形类*/ class Circular { private:const static double PI;double R 0; public:Circular() default;Circular(double r);double GetArea(); /*圆面积*/double GetGirth(); /*圆周长*/ }; const double Circular::PI 3.14;Circular::Circula…...

致远OA wpsAssistServlet任意文件上传漏洞复现 [附POC]

文章目录 致远OA wpsAssistServlet任意文件上传漏洞复现 [附POC]0x01 前言0x02 漏洞描述0x03 影响版本0x04 漏洞环境0x05 漏洞复现1.访问漏洞环境2.构造POC3.复现 0x06 修复建议 致远OA wpsAssistServlet任意文件上传漏洞复现 [附POC] 0x01 前言 免责声明&#xff1a;请勿利用…...

Java规则引擎2.1.8版本新增功能说明

规则引擎更新功能 新增: 1.决策结束节点新增结果导出excel功能&#xff1b; 在决策流程的结束节点&#xff0c;可以将决策结果导出为Excel文件。这个功能为用户提供了更多的灵活性和便利性&#xff0c;使他们能够轻松地将决策结果数据进行进一步的分析和处理。 2.新增公有变…...

系列四十、请谈一下Spring中事务的传播行为

一、概述 事务的传播行为指的是当一个事务方法被另一个事务方法调用时&#xff0c;这个事务方法应该如何进行。事务的传播行为至少发生在两个事务方法的嵌套调用中才会出现。 二、传播行为分类...

kubectl详解

陈述式资源管理方法&#xff1a; 1.kubernetes 集群管理集群资源的唯一入口是通过相应的方法调用 apiserver 的接口 2.kubectl 是官方的CLI命令行工具&#xff0c;用于与 apiserver 进行通信&#xff0c;将用户在命令行输入的命令&#xff0c;组织并转化为 apiserver 能识别的信…...

shell脚本--常见案例

1、自动备份文件或目录 2、批量重命名文件 3、查找并删除指定名称的文件&#xff1a; 4、批量删除文件 5、查找并替换文件内容 6、批量创建文件 7、创建文件夹并移动文件 8、在文件夹中查找文件...

【CSS position 属性】static、relative、fixed、absolute 、sticky详细介绍,多层嵌套定位示例

文章目录 ★ position 的五种类型及基本用法 ★ 一、position 属性概述 二、position 的五种类型详解(初学者版) 1. static(默认值) 2. relative(相对定位) 3. absolute(绝对定位) 4. fixed(固定定位) 5. sticky(粘性定位) 三、定位元素的层级关系(z-i…...

Neo4j 集群管理:原理、技术与最佳实践深度解析

Neo4j 的集群技术是其企业级高可用性、可扩展性和容错能力的核心。通过深入分析官方文档,本文将系统阐述其集群管理的核心原理、关键技术、实用技巧和行业最佳实践。 Neo4j 的 Causal Clustering 架构提供了一个强大而灵活的基石,用于构建高可用、可扩展且一致的图数据库服务…...

Yolov8 目标检测蒸馏学习记录

yolov8系列模型蒸馏基本流程&#xff0c;代码下载&#xff1a;这里本人提交了一个demo:djdll/Yolov8_Distillation: Yolov8轻量化_蒸馏代码实现 在轻量化模型设计中&#xff0c;**知识蒸馏&#xff08;Knowledge Distillation&#xff09;**被广泛应用&#xff0c;作为提升模型…...

使用LangGraph和LangSmith构建多智能体人工智能系统

现在&#xff0c;通过组合几个较小的子智能体来创建一个强大的人工智能智能体正成为一种趋势。但这也带来了一些挑战&#xff0c;比如减少幻觉、管理对话流程、在测试期间留意智能体的工作方式、允许人工介入以及评估其性能。你需要进行大量的反复试验。 在这篇博客〔原作者&a…...

ubuntu22.04有线网络无法连接,图标也没了

今天突然无法有线网络无法连接任何设备&#xff0c;并且图标都没了 错误案例 往上一顿搜索&#xff0c;试了很多博客都不行&#xff0c;比如 Ubuntu22.04右上角网络图标消失 最后解决的办法 下载网卡驱动&#xff0c;重新安装 操作步骤 查看自己网卡的型号 lspci | gre…...

Matlab实现任意伪彩色图像可视化显示

Matlab实现任意伪彩色图像可视化显示 1、灰度原始图像2、RGB彩色原始图像 在科研研究中&#xff0c;如何展示好看的实验结果图像非常重要&#xff01;&#xff01;&#xff01; 1、灰度原始图像 灰度图像每个像素点只有一个数值&#xff0c;代表该点的​​亮度&#xff08;或…...

Linux安全加固:从攻防视角构建系统免疫

Linux安全加固:从攻防视角构建系统免疫 构建坚不可摧的数字堡垒 引言:攻防对抗的新纪元 在日益复杂的网络威胁环境中,Linux系统安全已从被动防御转向主动免疫。2023年全球网络安全报告显示,高级持续性威胁(APT)攻击同比增长65%,平均入侵停留时间缩短至48小时。本章将从…...

HTML中各种标签的作用

一、HTML文件主要标签结构及说明 1. <&#xff01;DOCTYPE html> 作用&#xff1a;声明文档类型&#xff0c;告知浏览器这是 HTML5 文档。 必须&#xff1a;是。 2. <html lang“zh”>. </html> 作用&#xff1a;包裹整个网页内容&#xff0c;lang"z…...

【Docker 02】Docker 安装

&#x1f308; 一、各版本的平台支持情况 ⭐ 1. Server 版本 Server 版本的 Docker 就只有个命令行&#xff0c;没有界面。 Platformx86_64 / amd64arm64 / aarch64arm(32 - bit)s390xCentOs√√Debian√√√Fedora√√Raspbian√RHEL√SLES√Ubuntu√√√√Binaries√√√ …...