Spring day1

day01_eesy_01jdbc

pom.xml

<packaging>jar</packaging>
<dependencies><!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --><!--依赖--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.43</version></dependency>

JdbcDemo1.java

package com.itheima.jdbc;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
/**        程序的耦合
* 耦合:程序间的依赖关系
*      包括:类之间的依赖
*           方法间的依赖
* 解耦:降低程序间的依赖关系
*      实际开发中应该做到:编译期不依赖,运行才依赖
* 解耦的思路:
*      第一步:使用反射来创建对象,而避免使用new关键字
*      第二步:通过读取配置文件来获取要创建的对象全限定类名
*
*/
public class JdbcDemo1 {public static void main(String[] args) throws Exception{//1、注册驱动   /*DriverManager.registerDriver(new com.mysql.jdbc.Driver());* 一个依赖于具体的驱动类,一个依赖的只是字符串,可以减少他们之间的耦合*/Class.forName("com.mysql.jdbc.Driver");  //2、获取连接Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/eesy","root","root"); //3、获取操作数据库的预处理对象PreparedStatement pstm = conn.prepareStatement("select * from account");  //4、执行sql,的带结果集ResultSet rs = pstm.executeQuery();//5、遍历结果集while(rs.next()){System.out.println(rs.getString("name"));}//6、释放资源rs.close();pstm.close();conn.close();}
}

day01_eesy_02factory

bean.properties

accountService=com.itheima.service.impl.AccountServiceImpl
accountDao=com.itheima.dao.impl.AccountDaoImpl

beanfavtory.java

package com.itheima.factory;import com.itheima.dao.impl.AccountDaoImpl;import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/*** 一个创建Bean对象的工厂* Bean:在计算机英语中,有可重用组件的含义* JavaBean:用java语言编写的可重用组件* JavaBean > 实体类* JavaBean就是创建service和dao对象的** 1、需要一个配置文件来配置我们的service和dao*    配置的内容:唯一标志=全限定类名(key=value)* 2、通过读取配置文件中配置的内容,反射创建对象* 配置文件可以是xml或者properties*/
public class BeanFactory { //定义一个Properties对象//定义一个Map,用于存放我们要创建的对象,我们把它称之为容器private static Map<String,Object> beans;private static Properties props;//使用静态代码块为Properties对象赋值static {try {     //实例化对象props = new Properties(); //获取prpperties文件的流对象InputStream in = BeanFactory.class.getClassLoader().getResourceAsStream("bean.properties");props.load(in);//实例化容器beans = new HashMap<String,Object>(); //取出配置文件中所有的keyEnumeration  keys = props.keys(); //遍历枚举while (keys.hasMoreElements()){  //取出每个keyString key = keys.nextElement().toString(); //根据key获取valueString beanPath = props.getProperty(key); //反射创建对象Object value = Class.forName(beanPath).newInstance(); //把key和value存入容器中beans.put(key,value);}} catch (Exception e) {throw new ExceptionInInitializerError("初始化properties失败!");}} /***根据bean的名称获取对象* @param beanName* @return*/public static Object getBean(String beanName) {return beans.get(beanName);} /*** 根据Bean的名称获取bean对象* @param beanName* @return
public static Object getBean(String beanName) {Object bean = null;try {String beanPath = props.getProperty(beanName);System.out.println(beanPath);  //用反射的方式配置对象bean = Class.forName(beanPath).newInstance();//每次都会调用默认构造函数创建对象}catch (Exception e){e.printStackTrace();}return bean;} */
}

day01_eesy_03spring

pom.xml

<packaging>jar</packaging>
<dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.0.2.RELEASE</version></dependency>
</dependencies>

bean.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--导入约束-->
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd"><!--把对象的创建交给spring来管理--><bean id="accountService" class="com.itheima.service.impl.AccountServiceImpl"></bean><bean id="accountDao" class="com.itheima.dao.impl.AccountDaoImpl"></bean>
</beans>

client.java

package com.itheima.ui;import com.itheima.dao.IAccountDao;
import com.itheima.service.IAccountService;
import com.itheima.service.impl.AccountServiceImpl;
import com.sun.glass.ui.Application;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;/*** 模拟一个表现层,用于调用业务层*/
public class Client {
    /*** 获取spring的Ioc核心容器,并根据id获取对象** AppliationContext的三个常用实现类:*        ClassPathXmlApplicationContext,它可以加载类路径下的配置文件,要求配置文件必须在类路径下,不在的加载不了(更常用)*        FileSystemXmlApplicationContext,它可以加载磁盘任意路径下的配置文件(必须有访问权限)*        AnnotationConfigApplicationContext,它是用于读取注解创建容器的,是第二天的内容** 核心容器的两个接口引发出的问题:* AppliationContext:(单例对象适用)*     它在构建核心容器是,创建对象采取的策略是采用立即加载的方式,也就是说,只要一读取完配置文件马上就创建配置文件中配置的对象。* BeanFactory:(多例对象适用)*     它在构建核心容器时,创建对象采取的策略是延时加载的方式,也就是说,什么时候根据id创建对象了,什么时候才真正的创建对象。* @param args*/public static void main(String[] args) {//1、获取核心容器对象//ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");ApplicationContext ac = new FileSystemXmlApplicationContext("C:\\Users\\16521\\Desktop\\bean.xml");//2、根据id获取bean对象IAccountService as = (IAccountService)ac.getBean("accountService");IAccountDao adao = ac.getBean("accountDao",IAccountDao.class);System.out.println(as);System.out.println(adao);//   as.saveAccount();//--------BeanFactory----------Resource resource = new ClassPathResource("bean.xml");BeanFactory factory = new XmlBeanFactory(resource);IAccountService as = (IAccountService) factory.getBean("accountService");System.out.println(as);}}

day01_eesy_04bean

pom.xml

<packaging>jar</packaging>
<dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.0.2.RELEASE</version></dependency>
</dependencies>

bean.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--导入约束-->
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd"><!--把对象的创建交给spring来管理--><!--spring对bean的管理细节1、创建bean的三种方式2、bean对象的作用范围3、bean对象的声明周期--><!--创建bean对象的三种方式--><!--第一种方式:使用默认构造函数创建在spring的配置文件中使用bean标签,配以id和class属性后,且没有其他属性和标签时,采用的就是默认构造函数创建bean对象,此时如果类中没有默认构造函数,则对象无法创建<bean id="accountService" class="com.itheima.service.impl.AccountServiceImpl"></bean>--><!--第二种方式:使用普通工厂中的方法创建对象(使用某个类中的方法创建对象,并存入spring容器)<bean id="instanceFactory" class="com.itheima.factory.InstanceFactory"></bean><bean id="accountService" factory-bean="instanceFactory" factory-method="getAccountService"></bean>--><!--第三种方式:使用工厂中的静态方法创建对象(使用某个类中的静态方法创建对象,并存入spring容器)<bean id="accountService" class="com.itheima.factory.StaticFactory" factory-method="getAccountService"></bean>--><!--bean的作用范围调整bean标签的scope属性:作用:用于指定bean的作用范围取值:常用的就是单例的和多例的singleton:单例的(默认值)prototype:多例的request:作用于web应用的请求范围session:作用于web应用的会话范围global-session:作用于集群环境的会话范围(全局会话范围),当不是集群环境时,它就是session<bean id="accountService" class="com.itheima.service.impl.AccountServiceImpl" scope="prototype"></bean>--><!--bean对象的生命周期单例对象出生:当容器创建时对象出生活着:只要容器还在,对象一直活着死亡:容器销毁,对象消亡总结:单例对象的生命周期和容器相同多例对象出生:当我们使用对象时spring框架为我们创建活着:对象只要在使用过程中就一直活着死亡:当对象长时间不使用且没有别的对象引用时,由java的垃圾回收器回收--><bean id="accountService" class="com.itheima.service.impl.AccountServiceImpl" scope="prototype" init-method="init" destroy-method="destroy"></bean></beans>
Client.java
package com.itheima.ui;import com.itheima.service.IAccountService;
import com.itheima.service.impl.AccountServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;/*** 模拟一个表现层,用于调用业务层*/
public class Client {public static void main(String[] args) { //1、获取核心容器对象//ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");//单例对象:返回子类,close方法出现,销毁生效ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");  //2、根据id获取bean对象IAccountService as = (IAccountService) ac.getBean("accountService");//IAccountService as2 = (IAccountService) ac.getBean("accountService");//IAccountService accountService = new AccountServiceImpl();as.saveAccount();//System.out.println(as == as2); //手动关闭容器ac.close();}}

day01_eesy_05DI

pom.xml

<packaging>jar</packaging>
<dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.0.2.RELEASE</version></dependency>
</dependencies>

bean.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--导入约束-->
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd">  <!--spring中的依赖注入依赖注入:Dependency InjectionIOC的作用:降低程序间的耦合(依赖关系)依赖关系的管理:以后都交给spring来维护在当前类需要用到其他类的对象,由spring为我们提供,我们只需要在配置文件中说明依赖关系的维护——就称之为依赖注入依赖注入:能注入的数据:有三类基本类型和String其他的bean类型(在配置文件中活着注解配置过的bean)复杂类型/集合类型注入的方式:有三种1、使用构造函数提供2、使用set方法提供(更常用)3、使用注解提供(第二天的内容)--><!--1、构造函数注入使用的标签:constructor-arg标签出现的位置:bean标签内部标签中的属性type:用于指定要注入的数据的数据类型,该数据类型也是构造函数中某个或某些参数的类型index:用于指定要注入的数据给构造函数中指定索引位置的参数赋值,索引的位置是从0开始name:用于指定给构造函数中指定名词的参数赋值   (常用)===================以上三个用于指定给构造函数中哪个参数赋值======================value:用于提供基本类型和String的数据ref:用于指定其他的bean类型数据,它指的就是在Spring的Ioc核心容器中出现过的baan对象优势:在获取bean对象时,注入数据是必须的操作,否则对象无法创建成功弊端:改变了bean对象的实例化方式,使我们在创建对象时,如果用不到这些数据,也必须提供。--><bean id="accountService" class="com.itheima.service.impl.AccountServiceImpl" ><constructor-arg name="name" value="泰斯特"></constructor-arg><constructor-arg name="age" value="18"></constructor-arg><constructor-arg name="birthday" ref="now"></constructor-arg></bean>
<!--配置一个日期对象-->
<bean id="now" class="java.util.Date"></bean><!--2、set方法注入涉及的标签:property出现的位置:bean标签内部标签的属性:name:用于指定注入时所调用的set方法名称   (常用)===================以上三个用于指定给构造函数中哪个参数赋值======================value:用于提供基本类型和String的数据ref:用于指定其他的bean类型数据,它指的就是在Spring的Ioc核心容器中出现过的baan对象优势:创建对象时没有明确的限制,可以直接使用默认构造函数弊端:如果有某个成员必须有值,则获取对象时有可能set方法没有执行--><bean id="accountService2" class="com.itheima.service.impl.AccountServiceImpl2" ><property name="name" value="TEST"></property><property name="age" value="21"></property><property name="birthday" ref="now"></property></bean><!--复杂类型的注入/集合类型的注入用于给List结构集合注入的标签:list  array  set用于给Map结构集合注入的标签:map props总结:结构相同:标签可以互换--><bean id="accountService3" class="com.itheima.service.impl.AccountServiceImpl3" ><property name="myStrs">  <!--使用子标签配置--><array><value>AAA</value><value>BBB</value><value>CCC</value></array></property><property name="myList"><list><value>AAA</value><value>BBB</value><value>CCC</value></list></property><property name="mySet"><set><value>AAA</value><value>BBB</value><value>CCC</value></set></property><property name="myMap"><map><entry key="testA" value="aaa"></entry><entry key="testB"><value>bbb</value></entry></map></property><property name="myProps"><props><prop key="testC">ccc</prop><prop key="testD">ddd</prop></props></property></bean></beans>
AccountServiceImpl.java   构造函数注入
package com.itheima.service.impl;import com.itheima.service.IAccountService;import java.util.Date;/*** 构造函数注入*/
public class AccountServiceImpl implements IAccountService {//如果是经常变化的数据,并不适用于转入的方式private String name;private Integer age;private Date birthday; //有参构造public AccountServiceImpl(String name,Integer age,Date birthday){this.name = name;this.age = age;this.birthday = birthday;}@Overridepublic void saveAccount() {System.out.println("service中的saveAccount方法执行了"+name+","+age+","+birthday);}}

AccountServiceImpl2.java   set方法注入

package com.itheima.service.impl;import com.itheima.service.IAccountService;import java.util.Date;/*** set方法注入*/
public class AccountServiceImpl2 implements IAccountService {private String name;private Integer age;private Date birthday;public void setName(String name) {this.name = name;}public void setAge(Integer age) {this.age = age;}public void setBirthday(Date birthday) {this.birthday = birthday;}@Overridepublic void saveAccount() {System.out.println("service中的saveAccount方法执行了"+name+","+age+","+birthday);}}

AccountServiceImpl3.java  集合方式注入

package com.itheima.service.impl;import com.itheima.service.IAccountService;import java.util.*;/***集合方式注入*/
public class AccountServiceImpl3 implements IAccountService {private  String[] myStrs;private List<String> myList;private Set<String> mySet;private Map<String,String> myMap;private Properties myProps;//set方法public void setMyStrs(String[] myStrs) {this.myStrs = myStrs;}public void setMyList(List<String> myList) {this.myList = myList;}public void setMySet(Set<String> mySet) {this.mySet = mySet;}public void setMyMap(Map<String, String> myMap) {this.myMap = myMap;}public void setMyProps(Properties myProps) {this.myProps = myProps;}@Overridepublic void saveAccount() {System.out.println(Arrays.toString(myStrs));System.out.println(myList);System.out.println(mySet);System.out.println(myMap);System.out.println(myProps);}}
Client.java
package com.itheima.ui;import com.itheima.service.IAccountService;
import com.itheima.service.impl.AccountServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;/*** 模拟一个表现层,用于调用业务层*/
public class Client {/****/public static void main(String[] args) {//1、获取核心容器对象ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");//2、根据id获取bean对象//IAccountService as = (IAccountService) ac.getBean("accountService");//as.saveAccount();//IAccountService as = (IAccountService) ac.getBean("accountService2");//as.saveAccount();IAccountService as = (IAccountService) ac.getBean("accountService3");as.saveAccount();}}

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

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

相关文章

设计模式-接口隔离原则

基本介绍 客户端不应该依赖它不需要的接口&#xff0c;即一个类对另一个类的依赖应该建立在最小的接口上先看一张图: 类A通过接口Interface1 依赖类B&#xff0c;类C通过接口Interface1 依赖类D&#xff0c;如果接口Interface1对于类A和类C来说不是最小接口&#xff0c;那么类…

什么是多路复用器滤波器

本章将更深入地介绍多路复用器滤波器&#xff0c;以及它们如何用于各种应用中。您将了解到多路复用器如何帮助设计人员创造出更复杂的无线产品。 了解多路复用器 多路复用器是一组射频(RF)滤波器&#xff0c;它们组合在一起&#xff0c;但不会彼此加载&#xff0c;可以在输出之…

算法| ss 贪心

134.加油站455.分发饼干860.柠檬水找零2171.拿出最少数目的魔法豆 134.加油站 /*** param {number[]} gas* param {number[]} cost* return {number}*/ // 思路 // 判断: 汽油和 < 消耗和 return -1 // while循环遍历 从0开始, 计算是否有剩余 ,有就继续 没有就从下个点开…

Linux网络名称空间与网络协议栈:区别、联系与理解

在深入探讨Linux网络名称空间和网络协议栈之间的区别和联系之前&#xff0c;重要的是先明确这两个概念的定义。网络名称空间是Linux提供的一种虚拟化技术&#xff0c;允许在同一物理机器上运行的不同进程组拥有独立的网络环境&#x1f3e2;。而网络协议栈是操作系统用于实现网络…

React中的useMemo和useCallback:它们的区别及应用场景

React中的useMemo和useCallback&#xff1a;它们的区别及应用场景 1. useMemo&#xff1a;用于缓存计算结果2. useCallback&#xff1a;用于缓存函数3. 区别4. 应用场景4.1 useMemo的应用场景4.2 useCallback的应用场景 在React的Hooks API中&#xff0c;useMemo和useCallback是…

视频图像的两种表示方式YUV与RGB(3)

上篇文章介绍了YUV的采样格式&#xff0c;本篇重点介绍YUV的存储方式。接下来将用图形式给出常见YUV图像的存储方式&#xff0c;并在存储方式后面附有取样每个像素点YUV的数据方法&#xff0c;图中&#xff0c;Cb、Cr的含义等同于U、V。 YUYV为YUV422采样的存储格式中的一种&a…

探索 2024 年最佳编码自定义 GPT

如何利用GPT技术优化您的软件开发流程&#xff1f; 介绍 在快速发展的技术世界中&#xff0c;人工智能 (AI) 已成为创新的基石&#xff0c;特别是在编码和软件开发领域。 改变这一格局的人工智能工具之一是自定义 GPT。 这些先进的模型不仅彻底改变了我们的编码方式&#xff0c…

linux fixmap分析

本文基于Linux-4.19.125&#xff0c; ARM V7&#xff0c;dual core, MMU采用2级页表&#xff08;未开启LPAE&#xff09;。 1 为什么需要fixmap Linux内核启动过程中&#xff0c;经过汇编阶段后&#xff0c;mmu功能已经开启&#xff0c;后续只能通过虚拟地址来访问DDR&#x…

刷题日记——机试(3)

8.约瑟夫问题的实现 分析 创建一个队列和一个计数器&#xff0c;计数器初值为0&#xff0c;判断队列成员数是否为1&#xff0c;如果不是转3&#xff0c;是转6计数器每次1并且对k取余&#xff0c;然后将队首出队如果计数器值为0&#xff0c;那么回到2继续执行&#xff0c;如果不…

3.3.k8s搭建-rancher RKE2

目录 RKE2介绍 k8s集群搭建 搭建k8s集群 下载离线包 部署rke2-server 部署rke2-agent 部署helm 部署rancher RKE2介绍 RKE2&#xff0c;也称为 RKE Government&#xff0c;是 Rancher 的下一代 Kubernetes 发行版。 官网地址&#xff1a;Introduction | RKE2 k8s集群搭…

2024 年 3 月公链行业研报:比特币创新高、Meme 掀热潮、AI 板块露头角

作者&#xff1a;stellafootprint.network 数据来源&#xff1a;Footprint Analytics 公链研究页面 3 月份&#xff0c;加密市场表现强劲&#xff0c;比特币再创历史新高。以太坊价格稳步攀升&#xff0c;而坎昆升级则显著降低了交易成本。Solana 链上 Meme 热潮席卷而来&am…

【热门话题】 Fiddler:一款强大的Web调试代理工具——安装与使用详解

&#x1f308;个人主页: 鑫宝Code &#x1f525;热门专栏: 闲话杂谈&#xff5c; 炫酷HTML | JavaScript基础 ​&#x1f4ab;个人格言: "如无必要&#xff0c;勿增实体" 文章目录 Fiddler&#xff1a;一款强大的Web调试代理工具——安装与使用详解一、Fiddler的…

水位实时监测系统的工作原理

TH-SW3水位实时监测系统有多种应用场景&#xff0c;包括但不限于防汛、水文地质勘察、水资源管理等领域。例如&#xff0c;雷达水位监测站利用雷达微波技术进行水位测量&#xff0c;适用于河流、湖泊、水库等水域;积水监测站则主要使用在低洼地区&#xff0c;为城市内涝治理提供…

qt5-入门-文件读写

参考&#xff1a; Qt 二进制文件读写_w3cschool https://www.w3cschool.cn/learnroadqt/7nvo1j5k.html C GUI Programming with Qt 4, Second Edition 本地环境&#xff1a; win10专业版&#xff0c;64位&#xff0c;Qt 5.12 代码已经测试通过。其他例子日后更新。 理论知识…

ubuntu系统安装k8s1.28精简步骤

目录 一、规划二、环境准备2.1 配置apt仓库配置系统基本软件仓库配置k8s软件仓库安装常用软件包 2.2 修改静态ip、ntp时间同步、主机名、hosts文件、主机免密2.3 内核配置2.4 关闭防火墙、selinux、swap2.5 安装软件安装docker安装containerd安装k8s软件包 三、安装配置k8s3.1 …

二叉树的前序遍历、中序遍历、后序遍历

二叉树的前序遍历、中序遍历、后序遍历 一、递归算法的三个要素二、144. 二叉树的前序遍历三、94. 二叉树的中序遍历四、145. 二叉树的后序遍历 一、递归算法的三个要素 1、确定递归函数的参数和返回值&#xff1a; 确定哪些参数是递归的过程中需要处理的&#xff0c;那么就在…

宁波宠物展|2024中国(宁波)国际宠物用品博览会

中国(宁波)国际宠物用品博览会 地点&#xff1a;宁波国际会展中心 时间&#xff1a;2024年11月14-16日 主办单位:凤麟展览(宁波)有限公司 协办单位:浙江省宠物产业协会 宁波市跨境电子商务协会 宁波欧德国际商务咨询服务有限公司 宁波扬扬会议展览有限公司 20000方展览…

【FAQ】HarmonyOS SDK 闭源开放能力 —Push Kit(3)

1.问题描述&#xff1a; 调用HarmonyOS API发送通知&#xff0c;能查到状态是送达终端设备&#xff0c;但是终端设备上没收到通知卡片。 解决方案&#xff1a; 通知应用大图标不能超过30kb&#xff0c;通知参数限制&#xff0c;参考如下&#xff1a;https://gitee.com/openh…

免杀对抗Go魔改二开Fscan扫描FRP代理

安全工具-Goland-FRP魔改二开-特征消除 在渗透测试过程中&#xff0c;有后渗透需求时&#xff0c;需要进行反向代理&#xff0c;最早接触的是frp工具&#xff0c;但是在使用过程当中会有配置文件落地&#xff0c;如果忘记删除的情况下容易被溯源C2地址。针对这种情况可以将配置…

手写简易操作系统(二十八)--实现简单shell

前情提要 Shell是计算机操作系统中的一个重要概念&#xff0c;它是用户与操作系统内核之间的接口。Shell接受用户的命令&#xff0c;并将其转换为操作系统能够理解的指令&#xff0c;然后执行这些指令&#xff0c;并将执行结果返回给用户。 Shell可以理解为一个命令解释器&am…