【SpringMVC】一行代码完成文件上传JRebel的使用

news2024/10/10 20:20:55

目录

引言

一、JRebel的使用

1.1.安装JReble

1.2.反向代理工具

1.3.离线使用

二、文件上传

2.1.公共文件跳转

2.2.添加依赖

2.3.配置文件上传解析器

 2.4.图片路径配置Tomcat

2.5.前端代码

2.6.文件上传实现

三、文件下载

3.1.Controller层

3.2.前端代码

四、多文件上传

4.1.Controller层

4.2.前端代码


引言

在以往的写代码过程中,我们肯定会遇到客户有文件上传的需求,写过的同志都知道代码量是有的而且比较繁琐,今天这篇博客就来介绍一个Java库commons-fileupload,该库是Apache的一个开源Java库,它提供了一种简单的方式来上传和处理文件。它是Java Servlet API的一部分,可以方便地在Web应用程序中实现文件上传功能。

一、JRebel的使用

在讲解文件上传之前,先向大家推荐一下JRebel的使用,JRebel的主要功能是实现热部署,节省了大量重启时间,提高了个人开发效率。

1.1.安装JReble

我这里以IDEA为例,在Settings里点击Plugins在Marketplace处搜索jrebel,选择第一个安装即可。

安装后重启IDEA即可。

1.2.反向代理工具

这里会使用一个反向代理工具ReverseProxy_windows_amd64,而JRebel是一个Java虚拟机插件,它们之间没有直接的关系。但是,如果您在使用JRebel时遇到了问题,可以尝试先启动ReverseProxy_windows_amd64,然后再使用JRebel。

下载地址
Release v1.4 · ilanyu/ReverseProxy · GitHub

下载完成后打开代理ReverseProxy_windows_amd64.exe再jrebel启动项目

(注意:激活成功前不要关闭反向代理程序)

选择TeamURL激活

第一行输入http://127.0.0.1:8888/GUID

第二行输入电子邮箱即可。

 https://www.guidgen.com/(生成GUID链接)

1.3.离线使用

激活后一定要手动切换到离线模式进行使用,过程如图 如下步骤进行操作:

File ➡Settings➡JRebel ➡Work offline ➡OK

(注意点击Work offline就会变为Work online)

下面就可以进行我们的SpringMVC文件上传讲解了。

二、文件上传

2.1.公共文件跳转

该类是方便我们少写重复跳转页面的代码需要跳什么页面jsp的请求上加上/page即可。

@Controller
@RequestMapping("/page")
public class InputController {

    @RequestMapping("{page}")
    public String to(@PathVariable("page") String page){
        return page;
    }


    @RequestMapping("/{dir}/{page}")
    public String todir(@PathVariable("dir") String dir,
                        @PathVariable("page") String page){
        return dir+"/"+page;
    }

}

2.2.添加依赖

处理文件上传的Java库。

<dependency>
    <groupId>commons-fileupload</groupId>
    <artifactId>commons-fileupload</artifactId>
    <version>1.3.3</version>
</dependency>

2.3.配置文件上传解析器

将配置文件放入Spring-mvc.xml中

 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!-- 必须和用户JSP 的pageEncoding属性一致,以便正确解析表单的内容 -->
        <property name="defaultEncoding" value="UTF-8"></property>
        <!-- 文件最大大小(字节) 1024*1024*50=50M-->
        <property name="maxUploadSize" value="52428800"></property>
        <!--resolveLazily属性启用是为了推迟文件解析,以便捕获文件大小异常-->
        <property name="resolveLazily" value="true"/>
    </bean>

MultipartResolver是用于处理文件上传,当收到请求时DispatcherServlet的checkMultipart()方法会调用MultipartResolver的isMultipart()方法判断请求中是否包含文件,如果请求数据中包含文件,则调用MultipartResolver的resolverMultipart()方法对请求的数据进行解析,然后将文件数据解析MultipartFile并封装在MultipartHTTPServletRequest(继承了HTTPServletRequest)对象中,最后传递给Controller。  

 

 2.4.图片路径配置Tomcat

为了我们的后期维护,所以将本地图片路径与Tomcat访问路径进行配置文件的保存。

PropertiesUtil.java

public class PropertiesUtil {
	public static String getValue(String key) throws IOException {
		Properties p = new Properties();
		InputStream in = PropertiesUtil.class.getResourceAsStream("/resource.properties");
		p.load(in);
		return p.getProperty(key);
	}
	
}

resource.properties

dir=E:/oa/idea/upload/
server=/upload/

 点击菜单栏上的Tomcat选择Edit Configurations

2.5.前端代码

list.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://jsp.veryedu.cn" prefix="z"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link
            href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.css"
            rel="stylesheet">
    <script
            src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.js"></script>
    <title>学生管理首页</title>
    <style type="text/css">
        .page-item input {
            padding: 0;
            width: 40px;
            height: 100%;
            text-align: center;
            margin: 0 6px;
        }

        .page-item input, .page-item b {
            line-height: 38px;
            float: left;
            font-weight: 400;
        }

        .page-item.go-input {
            margin: 0 10px;
        }
    </style>
</head>
<body>
<form class="form-inline"
      action="${pageContext.request.contextPath }/student/list" method="post">
    <div class="form-group mb-2">
        <input type="text" class="form-control-plaintext" name="sname"
               placeholder="请输入学生名称">
        <!-- 			<input name="rows" value="20" type="hidden"> -->
        <!-- 不想分页 -->
                <%--<input name="pagination" value="false" type="hidden">--%>
    </div>
    <button type="submit" class="btn btn-primary mb-2">查询</button>
    <a class="btn btn-primary mb-2" href="${pageContext.request.contextPath }/student/PreSave">新增</a>
</form>

<table class="table table-striped ">
    <thead>
    <tr>
        <th scope="col">学生ID</th>
        <th scope="col">学生名称</th>
        <th scope="col">学生照片</th>
        <th scope="col">学生性别</th>
        <th scope="col">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach  var="s" items="${slist }">
        <tr>
            <td>${s.sid }</td>
            <td>${s.sname }</td>
            <td>
                <img src="${s.sage }" style="width: 50px;height: 50px;">
            </td>
            <td>${s.ssex }</td>
            <td>
                <a href="${pageContext.request.contextPath }/student/PreSave?sid=${s.sid}">修改</a>
                <a href="${pageContext.request.contextPath }/student/del?sid=${s.sid}">删除</a>
                <a href="${pageContext.request.contextPath }/page/student/upload?sid=${s.sid}">上传照片</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<!-- 这一行代码就相当于前面分页需求前端的几十行了 -->
<z:page pageBean="${pageBean }"></z:page>
<%--${pageBean }
${slist}--%>
</body>
</html>

upload.jsp 


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生照片上传</title>
</head>
<body>
<form action="${pageContext.request.contextPath }/student/upload" method="post" enctype="multipart/form-data">
    <label>学生编号:</label><input type="text" name="sid" readonly="readonly" value="${param.sid}"/><br/>
    <label>学生图片:</label><input type="file" name="simg"/><br/>
    <input type="submit" value="上传图片"/>
</form>
</body>
</html>

2.6.文件上传实现

StudentController.java


@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentBiz stubiz;

//    增
    @RequestMapping("/add")
    public String add(Student student){
        stubiz.insertSelective(student);
        return "redirect:list";
    }

    //    删
    @RequestMapping("/del")
    public String del(Student student){
        stubiz.deleteByPrimaryKey(student.getSid());
        return "redirect:list";
    }


//    查
    @RequestMapping("/list")
    public String list(Student student, HttpServletRequest request){
        PageBean pageBean=new PageBean();
        pageBean.setRequest(request);
        List<Student> students = stubiz.selectBySnamePager(student, pageBean);
        request.setAttribute("slist",students);
        request.setAttribute("pageBean",pageBean);
        return "student/list";
    }
//    改
    @RequestMapping("/edit")
    public String edit(Student student){
        stubiz.updateByPrimaryKeySelective(student);
        return "redirect:list";
    }
//    模糊分页查询
    @RequestMapping("/PreSave")
    public String PreSave(Student student, HttpServletRequest request){
        if(student!=null && student.getSid()!=null){
            Student s = stubiz.selectByPrimaryKey(student.getSid());
            request.setAttribute("s",s);
        }
        return "student/edit";
    }

    //文件上传
    @RequestMapping("/upload")
    public String upload(MultipartFile simg,Student student) throws IOException {
        //将上传图片保存到服务器中的指定位置
        String dir= PropertiesUtil.getValue("dir");
        String server=PropertiesUtil.getValue("server");
        String filename = simg.getOriginalFilename();

        FileUtils.copyInputStreamToFile(simg.getInputStream(),new File(dir+filename));

        //将上传的图片保存到数据库
        student.setSage(server+ filename);
        stubiz.updateByPrimaryKeySelective(student);
    return "redirect:list";
     }


}

效果展示:

这时候查看我们所配置的本地路径中也有图片了。

 

 

三、文件下载

3.1.Controller层

StudentController.java

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentBiz stubiz;

//    增
    @RequestMapping("/add")
    public String add(Student student){
        stubiz.insertSelective(student);
        return "redirect:list";
    }

    //    删
    @RequestMapping("/del")
    public String del(Student student){
        stubiz.deleteByPrimaryKey(student.getSid());
        return "redirect:list";
    }


//    查
    @RequestMapping("/list")
    public String list(Student student, HttpServletRequest request){
        PageBean pageBean=new PageBean();
        pageBean.setRequest(request);
        List<Student> students = stubiz.selectBySnamePager(student, pageBean);
        request.setAttribute("slist",students);
        request.setAttribute("pageBean",pageBean);
        return "student/list";
    }
//    改
    @RequestMapping("/edit")
    public String edit(Student student){
        stubiz.updateByPrimaryKeySelective(student);
        return "redirect:list";
    }
//    模糊分页查询
    @RequestMapping("/PreSave")
    public String PreSave(Student student, HttpServletRequest request){
        if(student!=null && student.getSid()!=null){
            Student s = stubiz.selectByPrimaryKey(student.getSid());
            request.setAttribute("s",s);
        }
        return "student/edit";
    }

    //文件上传
    @RequestMapping("/upload")
    public String upload(MultipartFile simg,Student student) throws IOException {
        //将上传图片保存到服务器中的指定位置
        String dir= PropertiesUtil.getValue("dir");
        String server=PropertiesUtil.getValue("server");
        String filename = simg.getOriginalFilename();

        FileUtils.copyInputStreamToFile(simg.getInputStream(),new File(dir+filename));

        //将上传的图片保存到数据库
        student.setSage(server+ filename);
        stubiz.updateByPrimaryKeySelective(student);
    return "redirect:list";
     }


     //文件下载
     @RequestMapping(value="/download")
     public ResponseEntity<byte[]> download(Student student, HttpServletRequest req){

         try {
             //先根据文件id查询对应图片信息
             Student students = this.stubiz.selectByPrimaryKey(student.getSid());
             String diskPath = PropertiesUtil.getValue("dir");
             String reqPath = PropertiesUtil.getValue("server");
             String realPath = students.getSage().replace(reqPath,diskPath);
             String fileName = realPath.substring(realPath.lastIndexOf("/")+1);
             //下载关键代码
             File file=new File(realPath);
             HttpHeaders headers = new HttpHeaders();//http头信息
             String downloadFileName = new String(fileName.getBytes("UTF-8"),"iso-8859-1");//设置编码
             headers.setContentDispositionFormData("attachment", downloadFileName);
             headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
             //MediaType:互联网媒介类型  contentType:具体请求中的媒体类型信息
             return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.OK);
         }catch (Exception e){
             e.printStackTrace();
         }
         return null;
     }


}

3.2.前端代码

list.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://jsp.veryedu.cn" prefix="z"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link
            href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.css"
            rel="stylesheet">
    <script
            src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.js"></script>
    <title>学生管理首页</title>
    <style type="text/css">
        .page-item input {
            padding: 0;
            width: 40px;
            height: 100%;
            text-align: center;
            margin: 0 6px;
        }

        .page-item input, .page-item b {
            line-height: 38px;
            float: left;
            font-weight: 400;
        }

        .page-item.go-input {
            margin: 0 10px;
        }
    </style>
</head>
<body>
<form class="form-inline"
      action="${pageContext.request.contextPath }/student/list" method="post">
    <div class="form-group mb-2">
        <input type="text" class="form-control-plaintext" name="sname"
               placeholder="请输入学生名称">
        <!-- 			<input name="rows" value="20" type="hidden"> -->
        <!-- 不想分页 -->
                <%--<input name="pagination" value="false" type="hidden">--%>
    </div>
    <button type="submit" class="btn btn-primary mb-2">查询</button>
    <a class="btn btn-primary mb-2" href="${pageContext.request.contextPath }/student/PreSave">新增</a>
</form>

<table class="table table-striped ">
    <thead>
    <tr>
        <th scope="col">学生ID</th>
        <th scope="col">学生名称</th>
        <th scope="col">学生照片</th>
        <th scope="col">学生性别</th>
        <th scope="col">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach  var="s" items="${slist }">
        <tr>
            <td>${s.sid }</td>
            <td>${s.sname }</td>
            <td>
                <img src="${s.sage }" style="width: 50px;height: 50px;">
            </td>
            <td>${s.ssex }</td>
            <td>
                <a href="${pageContext.request.contextPath }/student/PreSave?sid=${s.sid}">修改</a>
                <a href="${pageContext.request.contextPath }/student/del?sid=${s.sid}">删除</a>
                <a href="${pageContext.request.contextPath }/page/student/upload?sid=${s.sid}">上传照片</a>
                <a href="${pageContext.request.contextPath }/student/download?sid=${s.sid}">下载照片</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<!-- 这一行代码就相当于前面分页需求前端的几十行了 -->
<z:page pageBean="${pageBean }"></z:page>
<%--${pageBean }
${slist}--%>
</body>
</html>

效果演示: 

四、多文件上传

由于我的数据库表中没有存储多个图片的字段,就不过数据库演示了。

4.1.Controller层

  //多文件上传
     @RequestMapping("/uploads")
     public String uploads(HttpServletRequest req, Student student, MultipartFile[] files){
         try {
             StringBuffer sb = new StringBuffer();
             for (MultipartFile cfile : files) {
                 //思路:
                 //1) 将上传图片保存到服务器中的指定位置
                 String dir = PropertiesUtil.getValue("dir");
                 String server = PropertiesUtil.getValue("server");
                 String filename = cfile.getOriginalFilename();
                 FileUtils.copyInputStreamToFile(cfile.getInputStream(),new File(dir+filename));
                 sb.append(filename).append(",");
             }
             System.out.println(sb.toString());

         } catch (Exception e) {
             e.printStackTrace();
         }
         return "redirect:list";
     }

4.2.前端代码

 <a href="${pageContext.request.contextPath }/page/student/uploads">多文件上传</a>




<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="${pageContext.request.contextPath }/student/uploads" method="post" enctype="multipart/form-data">
    <input type="file" name="files" multiple>
    <button type="submit">上传</button>
</form>
</body>
</html>

效果演示:

 

到这里我的分享就结束了,欢迎到评论区探讨交流!!

💖如果觉得有用的话还请点个赞吧 💖

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

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

相关文章

Jetsonnano B01 笔记4:UART 通信配置及编程

今日继续我的Jetsonnano学习之路&#xff0c;今日学习使用Jetson硬件驱动之UART串口通信&#xff1a; 目录 简议串口通信&#xff1a; 硬件连接&#xff1a; 串口配置&#xff1a; 安装串口函数库&#xff1a; 设置权限&#xff1a; Python代码配置&#xff1a; 下载测试…

机器学习实战-系列教程5:手撕线性回归4之非线性回归(项目实战、原理解读、源码解读)

11、非线性模型 当得到一个回归方程会&#xff0c;得到一条直线来拟合这个数据的统计规律&#xff0c;但是实际中用这样的简单直线很显然并不能拟合出统计规律&#xff0c;所谓线性回归比如两个变量之间关系就直接用一条直线来拟合&#xff0c;2个变量和一个1个变量的关系就用…

PDF 工具箱

PDF 工具箱 V9.0.0.1 程序&#xff1a;VB.net 运行库&#xff1a;NET Framework 4.5 功能简介&#xff1a; 1、PDF文件多文件合并&#xff0c;可调整顺序。 2、PDF文件拆分&#xff0c;将每页拆分成独立的PDF文件。 3、PDF文件添加水印&#xff0c;文字或图片水印&…

代码随想录 -- day46 --139.单词拆分

139.单词拆分 dp[i] : 字符串长度为i的话&#xff0c;dp[i]为true&#xff0c;表示可以拆分为一个或多个在字典中出现的单词 递推公式是 if([j, i] 这个区间的子串出现在字典里 && dp[j]是true) 那么 dp[i] true。 本题一定是 先遍历 背包&#xff0c;再遍历物品 c…

【LeetCode题目详解】第九章 动态规划part09 198.打家劫舍 213.打家劫舍II 337.打家劫舍III(day48补)

本文章代码以c为例&#xff01; 一、力扣第198题&#xff1a;打家劫舍 题目&#xff1a; 你是一个专业的小偷&#xff0c;计划偷窃沿街的房屋。每间房内都藏有一定的现金&#xff0c;影响你偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统&#xff0c;如果两间相邻…

【再识C进阶2(中)】详细介绍指针的进阶——函数指针数组、回调函数、qsort函数

前言 &#x1f493;作者简介&#xff1a; 加油&#xff0c;旭杏&#xff0c;目前大二&#xff0c;正在学习C&#xff0c;数据结构等&#x1f440; &#x1f493;作者主页&#xff1a;加油&#xff0c;旭杏的主页&#x1f440; ⏩本文收录在&#xff1a;再识C进阶的专栏&#x1…

开开心心带你学习MySQL数据库之第七篇

MySQL提供的约束 1.not null 2.unique 3.default 4.primary key 5.foreign key 表的设计 找到实体确定实体间的关系 一对一一对多多对多 聚合查询 ~~行之间的运算 ~~聚合函数 ~~分组group by 联合查询 ~~多表查询 ~~笛卡尔积: 把两个表放到一起进行排列组合 班级表 cla…

代码随想录 -- day45 -- 70. 爬楼梯 (进阶)、322. 零钱兑换 、279.完全平方数

70. 爬楼梯 &#xff08;进阶&#xff09; 这里要注意&#xff0c;这是一个排列组合的问题&#xff0c;所以要先遍历背包再遍历物品 dp[i]&#xff1a;爬到有i个台阶的楼顶&#xff0c;有dp[i]种方法 递推公式为&#xff1a;dp[i] dp[i - j] class Solution { public:int c…

基于51单片机万年历电压电流检测-proteus仿真-源程序

一、系统方案 本设计采用52单片机作为主控器&#xff0c;液晶1602显示&#xff0c;DS1302时钟检测&#xff0c;电流电压检测、按键设置报警&#xff0c;蜂鸣器报警。 二、硬件设计 原理图如下&#xff1a; 三、单片机软件设计 1、首先是系统初始化 /lcd1602初始化设置*/ vo…

Java中什么是序列化,哪里有所应用

文章目录 一、简介1.1 本文介绍Java中的序列化技术1.2 阐述序列化的应用场景 二、Java序列化概述2.1 序列化定义2.2 序列化特征2.3 序列化机制 三、Java序列化使用3.1 实现Serializable接口3.2 transient关键字3.3 自定义序列化策略 四、Java序列化应用4.1 对象状态持久化4.2 网…

RCP系列-第一章 环境安装

RCP系列文章 第一章 Matlab安装 Matlab安装 RCP系列文章前言一、Matlab 获取二、安装1.解压2.打开解压后的文件夹中的【R2018b_win64】文件夹3.鼠标右击【setup】选择【以管理员身份运行】4.选择【使用文件安装密钥】&#xff0c;点击【下一步】5.选择【是】&#xff0c;点击【…

图像处理算法实战【1】超详细整理 | 新手入门实用指南 | 图像处理基础

1. 什么是图像 & 图像在计算机中如何存储&#xff1f;2. 图像可分为哪些类型&#xff1f; 2.1. 二值(黑白)图像2.2. 灰度图像2.3. RGB彩色图像2.4. RGBA图像 3. 什么是图像通道&#xff1f;4. 图像处理 4.1. 什么是图像处理&#xff1f;4.2. 图像处理流程4.3. 图像处理技术…

王道考研计算机网络

文章目录 计算机网络体系结构计算机网络概述计算机网络的性能指标 计算机网络体系结构与参考模型错题 物理层通信基础基础概念奈奎斯特定理和香农定理编码与调制电路交换、报文交换和分组交换数据报与虚电路 传输介质物理层设备错题 数据链路层数据链路层的功能组帧差错控制检错…

SpringSecurity一日干

前后端登录校验的逻辑 完整流程 本质就是过滤器链 1&#xff0c;提交用户名和密码 2&#xff0c;将提交的信息封装Authentication对象 3&#xff0c;传给下一个&#xff0c;调用2中的authenticate方法进行验证 4&#xff0c;3步骤也验证不了需要调用3的authenticate方法…

概念解析 | 揭秘视觉与语言交叉模型:CLIP和BLIP的介绍

注1:本文系“概念解析”系列之一,致力于简洁清晰地解释、辨析复杂而专业的概念。本次辨析的概念是:CLIP和BLIP模型。 揭秘视觉与语言交叉模型:CLIP和BLIP的介绍 🎯 [LB: 0.45836] ~ BLIP+CLIP | CLIP Interrogator | Kaggle 大纲: 背景介绍原理介绍和推导 CLIP模型BLIP模…

简易yum仓库搭建

目录 一、实验准备 二、获取yum仓库、安装httpd 三、客户机配置yum源 四、测试、验证 一、实验准备 准备两台主机&#xff1a; 192.168.115.148 &#xff1a;安装http 、作为yum仓库、挂载默认光盘 192.168.115.148 &#xff1a;作为客户机使用yum仓库、不挂载光盘 二、…

Dominosa/数邻(1) | C++ | 结构体和类

这里是目录 一、背景介绍二、题目描述三、Dominosa 的技巧&#xff1f;四、编程思路五、完整代码六、补充 一、背景介绍 你玩过骨牌吗&#xff1f;至少你一定听说过或者亲眼见过多米诺骨牌&#xff0c;而多米诺骨牌就发展自骨牌&#xff0c;这是一种古老的游戏&#xff0c;而我…

【Linux】VirtualBox安装Centos7

文章目录 下载并安装VirtualBox下载Centos镜像VirtualBox设置管理->全局设定&#xff1a;设定虚拟机默认安装路径工具->网络管理器&#xff1a;添加NetWork网络配置 VirtualBox安装CentOS7新建虚拟机&#xff0c;指定安装目录及名称&#xff0c;点击下一步指定虚拟机内存…

记录征战Mini开发板从无到有(二)

接上一篇&#xff0c;原理图设计完成后&#xff0c;就要画PCB图了。因为PCB直接影响板子的性能&#xff0c;所以决定花钱找一博科技的资深工程师来布板。布板效果非常好&#xff0c;细节处理得很到位&#xff0c;真的是专业的人干专业的事&#xff0c;话不多说&#xff0c;来欣…

无涯教程-JavaScript - OCT2BIN函数

描述 OCT2BIN函数将八进制数转换为二进制数。 语法 OCT2BIN (number, [places])争论 Argument描述Required/OptionalNumber 您要转换的八进制数。 数字不能超过10个字符。数字的最高有效位是符号位。其余的29位是幅度位。 负数使用二进制补码表示。 RequiredPlaces 要使用的…