搜索词>>java10 耗时0.0020
  • JAVA10新特性_JDK 10新特性

    JAVA10 升级后的几个我们值得关注的新特性。尤其是第一个,赶紧看看JDK10的新特性吧。JAVA10新特性_JDK 10新特性
  • windows10如何安装JDK_windows10怎么配置jdk环境变量

    windows10如何安装JDK_windows10怎么配置jdk环境变量,windows XP/7/8/10系统配置java运行开发环境即配置jdk环境变量windows XP/7/8/10系统配置java运行开发环境即配置jdk环境变量<br /> <br /> 1.下载JDK。网址:<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" rel="external nofollow" target="_blank">点击我</a><br /> <img alt="1" class="img-thumbnail" src="/assist/images/blog/18bdeadb-b610-4fc1-b0dd-a9a20742da5b.png" style="height:510px; width:900px" /><br /> 2.安装JDK。(双击安装包:下一步....到安装完成)<br /> <img alt="2" class="img-thumbnail" src="/assist/images/blog/11f81aa6-1305-4dbd-b89d-bdd8c84b20f9.png" style="height:382px; width:504px" /><br /> <strong>【注意】:</strong><strong>安装路径可选择,</strong><strong>推荐默认</strong><br /> <img alt="3" class="img-thumbnail" src="/assist/images/blog/d10942c6-ac40-4319-a1e4-79902cdaed85.png" style="height:382px; width:504px" /><br /> 3.右击计算机,选择属性<br /> <img alt="4" class="img-thumbnail" src="/assist/images/blog/d9d69d9f-aa68-49f2-bbaa-81d4be5ece1a.png" style="height:265px; width:248px" /><br /> 4.选择高级系统设置<br /> <img alt="5" class="img-thumbnail" src="/assist/images/blog/b2e167c8-d6c3-4583-b4dc-8b6f2ff7e431.png" style="height:422px; width:588px" /><br /> 5.选择环境变量<br /> <img alt="5" class="img-thumbnail" src="/assist/images/blog/d8edf88e-b84e-4939-8c52-dc6527179983.png" style="height:442px; width:420px" /><br /> 6.创建JAVA_HOME环境变量:<br /> 点击新建>在变量名输入:JAVA_HOME,变量值:C:\Program Files\Java\jdk1.8.0_20[注意:根据安装时候你的路径而定]<br /> <img alt="6" class="img-thumbnail" src="/assist/images/blog/b614ba4a-3018-4d29-86a6-82a24a35205e.png" style="height:442px; width:420px" /><br /> 7.创建CLASSPATH环境变量:<br /> 点击新建>在变量名输入:CLASSPATH,变量值:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar[注意:最前面有一个英文符号的“.”表示系统当前路径]<br /> <img alt="7" class="img-thumbnail" src="/assist/images/blog/ff32b740-5304-420d-a9e4-5446bb1cebfc.png" style="height:442px; width:420px" /><br /> 8.将JAVA环境变量添加到系统环境变量Path中:<br /> 选择系统变量>Path>编辑<br /> <img alt="8" class="img-thumbnail" src="/assist/images/blog/df00ed2f-f477-4dac-90c2-10eab5c196bb.png" style="height:406px; width:394px" /><br /> 变量末尾如果没有英文符号“;”加上,然后将:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;[加到后面]<br /> <img alt="81" class="img-thumbnail" src="/assist/images/blog/bd0b540c-61a1-4947-95af-2f811dc3a195.png" style="height:442px; width:420px" /><br /> 9.打开CMD命令窗口,输入java -version[温馨提示:快捷键 win+R cmd]<br />  <br /> <img alt="9" class="img-thumbnail" src="/assist/images/blog/32c52462-79cf-491f-9b84-14813878ee05.png" style="height:442px; width:677px" /><br />  
  • Java 10上的Apache CXF

    Java 10上的Apache CXFNginx 启动、停止、重启启动命令:#nginx停止命令:nginx -s stop​​​​​​​代码段 小部件
  • 黑/群晖RAID 10配置图文详解

    一.黑/群晖RAID 10配置准备1.黑群晖/白群晖设备一台;2.群晖系统中空闲未使用的硬盘4快(RAID 10 至少需要4快盘);二.黑/群晖RAID 10操作步骤2.1 打开存储空间管理员套件 ​选择RAID Group​点击新增​下一一.黑/群晖RAID 10配置准备1.黑群晖/白群晖设备一台;2.群晖系统中空闲未使用的硬盘4快(RAID 10 至少需要4快盘);二.黑/群晖RAID 10操作步骤2.1 打开存储空间管理员套件 ​选择RAID Group​点击新增​下一步,选择RAID 10​选择需要组RAID 10的硬盘,并拖到右边​这里选择了4快​​​硬盘检查,如果是新盘就不用检查。老盘看自己心情,硬盘检查很慢。这里就选择否了​点击应用即可完成RAID10创建​可以看到RAID Group2  RAID 10正在初始化...三.使用RAID 10创建存储空间 ​点击新增​点击确定按钮即可创建完成​这里我们就看到了创建的RAID 10的存储空间四.挂载黑/白群晖RAID 10 到目录 点击控制面板,然后选择第一个共享文件夹​点击新增​填写文件夹名称/描述以及选择文件夹的存储空间为刚才创建的RAID10存储空间​点击下一步继续​加密不设置,点击下一步继续​高级设置,默认即可,下一步继续​点击应用完成创建​可以看到共享文件夹中有新创建的raid10共享文件夹了,接下来就是去File Station中愉快的使用了​
  • DbVisualizer pro10.0 激活绿色版下载

    DbVisualizer pro10.0 激活绿色版下载,DbVisualizer 10.0下载,DbVisualizer是一个完全基于JDBC的跨平台数据库管理工具,内置SQL语句编辑器(支持语法高亮),凡是具有JDBC数据库接口的数据库都可以管理,已经在Oracle, Sybase, DB2, Informix, MySQL, InstantDB, Cloudcape, HyperSonic ,Mimer SQL上通过测试.<h2>DbVisualizer pro10.0 激活绿色版下载</h2> <br /> 简介:<br />     DbVisualizer是一个完全基于JDBC的跨平台数据库管理工具,内置SQL语句编辑器(支持语法高亮),凡是具有JDBC数据库接口的数据库都可以管理,已经在Oracle, Sybase, DB2, Informix, MySQL, InstantDB, Cloudcape, HyperSonic ,Mimer SQL上通过测试.<br /> <br /> 绿化说明:<br /> 1.添加jre8运行环境<br /> 2.默认pro版本<br /> 3.快捷键修改<br />     块及注释ctrl+shift+/ <br />     行及注释:ctrl+/<br />     自动补全:alt+/<br /> 4.设置默认字体为宋体<br /> <br /> 使用说明:<br /> 双机绿化安装,等待完成即可<br /> <br /> <span style="color:#16a085"><strong>下载地址:<a href="http://www.leftso.com/resource/1000.html" target="_blank" >点击前往</a></strong></span><br /> 统一解压密码:<strong>leftso.com</strong><br />   <h2>DbVisualizer 10.0.6</h2> <h3>Enhancement</h3> <table cellpadding="2" cellspacing="0" class="table table-bordered table-hover" > <tbody> <tr> <td><strong>DB Support: Oracle</strong></td> <td>Add support for IDENTITY and Virtual columns when generating DDL</td> </tr> </tbody> </table>   <h2>DbVisualizer 10.0.5更新日志</h2> <h3>Enhancement</h3> <table cellpadding="2" cellspacing="0" class="table table-bordered table-hover" > <tbody> <tr> <td><strong>DB Support: Exasol</strong></td> <td>Add database type and driver entry for Exasol</td> </tr> <tr> <td><strong>Export</strong></td> <td>Apply a Style matching the data format specified in DbVisualizer for numeric data</td> </tr> <tr> <td><strong>Grid Component</strong></td> <td>Add quick link to the Data Formats setup in Tool Properties also for BLOB and CLOB in the grids status bar</td> </tr> <tr> <td><strong>SQL Commander</strong></td> <td>Should be possible to disable error markers in the SQL Commander editor</td> </tr> <tr> <td><strong>SQL Editor</strong></td> <td>Add means to add custom keywords for syntax highlighting</td> </tr> <tr> <td><strong>SQL Editor</strong></td> <td>Add key bindings (alt-shift-up, alt-shift-down) to move selected rows up or down <br /> [<a href="http://support.dbvis.com/support/discussions/topics/1000076593" rel="external nofollow" target="_blank" >http://support.dbvis.com/support/discussions/topics/1000076593 </a>]</td> </tr> <tr> <td><strong>SQL Editor</strong></td> <td>Add a Duplicate Current Line editor action with option to set keybinding (is not assigned by default) <br /> [<a href="http://support.dbvis.com/support/discussions/topics/1000076655" rel="external nofollow" target="_blank" >http://support.dbvis.com/support/discussions/topics/1000076655 </a>]</td> </tr> <tr> <td><strong>SQL Log</strong></td> <td>Make it possible set the default column width for Message and SQL/Command multiline columns in the SQL Log</td> </tr> </tbody> </table>   <h2>DbVisualizer 10.0.4更新日志</h2> <h3>Enhancement</h3> <table cellpadding="2" cellspacing="0" class="table table-bordered table-hover" > <tbody> <tr> <td><strong>DB Support: Redshift</strong></td> <td>Add a Vacuum Table action</td> </tr> </tbody> </table> <h2>DbVisualizer 10.0.3更新日志:</h2> <h3>Enhancement</h3> <table cellpadding="2" cellspacing="0" class="table table-bordered table-hover" > <tbody> <tr> <td><strong>DB Support: PostgreSQL</strong></td> <td>XML type not supported in the create table wizard</td> </tr> <tr> <td><strong>Data tab</strong></td> <td>Setting "Max Rows at First Display" or any of the "Max Rows" to 0, should not load any rows</td> </tr> <tr> <td><strong>Export</strong></td> <td>Exporting with "Export Text" disabled should preserve data types not only for numbers but also date, time and timestamp when output is Excel <br /> [<a href="http://support.dbvis.com/support/discussions/topics/1000077122" rel="external nofollow" target="_blank" >http://support.dbvis.com/support/discussions/topics/1000077122 </a>]</td> </tr> <tr> <td><strong>Installation/Update Installation</strong></td> <td>Install4j should remember the last used download folder during updates <br /> [<a href="http://support.dbvis.com/support/discussions/topics/1000076802" rel="external nofollow" target="_blank" >http://support.dbvis.com/support/discussions/topics/1000076802 </a>]</td> </tr> <tr> <td><strong>Installation/Update Installation</strong></td> <td>Installer should request higher privileges when trying to install in a non-writable folder</td> </tr> <tr> <td><strong>Query Builder</strong></td> <td>Make it possible using keyboard to copy grid cells in the query builder</td> </tr> <tr> <td><strong>SQL Commander</strong></td> <td>The @cd command should set the default directory also for @export output files <br /> [<a href="http://support.dbvis.com/support/discussions/topics/1000076777" rel="external nofollow" target="_blank" >http://support.dbvis.com/support/discussions/topics/1000076777 </a>]</td> </tr> <tr> <td><strong>SQL Commander<br /> SQL Log</strong></td> <td>The STARTED log entry should show information about used database connection, database type, database, and schema <br /> [<a href="http://support.dbvis.com/support/discussions/topics/1000076568" rel="external nofollow" target="_blank" >http://support.dbvis.com/support/discussions/topics/1000076568 </a>]</td> </tr> <tr> <td><strong>SQL Formatter</strong></td> <td>Format only selected text and reselect the formatted text</td> </tr> <tr> <td><strong>Table Data Editor</strong></td> <td>The cell editor should allow dropping images, XML, and other file formats we have viewers for</td> </tr> </tbody> </table> <h3>DbVisualizer10.0.2更新日志:</h3> <h3>Enhancement</h3> <table cellpadding="2" cellspacing="0" class="table table-bordered table-hover" > <tbody> <tr> <td><strong>Database Profile: Actions<br /> DB Support: Vertica</strong></td> <td>Add a Purge Table action for a table in Vertica</td> </tr> <tr> <td><strong>Export<br /> Grid Component</strong></td> <td>Add a "Open as Spreadsheet" in grids</td> </tr> <tr> <td><strong>Favorites</strong></td> <td>Add shortcuts for Select Target Object in the Favorites toolbar (Alt+click) and the Favorites tab (Alt+double-click)</td> </tr> <tr> <td><strong>General</strong></td> <td>Allow scaling UI more than 200%</td> </tr> <tr> <td><strong>SQL Commander</strong></td> <td>Add a "Select Target Script File" in the SQL editor status bar filename right-click menu. Used to highlight any corresponding script file in the Scripts tab</td> </tr> </tbody> </table> <h3> </h3> <h2>DbVisualizer10.0.1更新日志:</h2> <h3>Enhancement</h3> <table cellpadding="2" cellspacing="0" class="table table-bordered table-hover" > <tbody> <tr> <td><strong>Database Objects Tree<br /> Filtering/Filter Sets</strong></td> <td>Disabled Filtering state should be restored when restarting DbVisualizer</td> </tr> <tr> <td><strong>Look and Feel: macOS<br /> Performance/Stability</strong></td> <td>DbVisualizer runs Java in discrete graphics mode on macOS potentially draining the battery on laptops</td> </tr> <tr> <td><strong>SQL Log</strong></td> <td>Need to make the summary of success/failed entries for the FINISHED summary log entry in the Message column more readable</td> </tr> </tbody> </table> <h3><br /> <em><strong><span style="color:#ff0000">该软件仅用于提供个人学习和交流使用,切勿商用。本人及本网站不承担任何因此软件发生的纠纷责任</span></strong></em><span style="color:#ff0000"><em><strong>。</strong></em></span></h3>
  • win10开机磁盘检查怎么取消

    win10开机磁盘检查怎么取消?方法一:1.1打开注册表通过快捷键  WIN+R打开运行命令框​输入regedit回车打开注册表​1.2找到对应的注册信息先复制下面内容HKEY_LOCAL_MACHINE\SYSTEM\CurrentConwin10开机磁盘检查怎么取消?方法一:1.1打开注册表通过快捷键  WIN+R打开运行命令框​输入regedit回车打开注册表​1.2找到对应的注册信息先复制下面内容HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager将上面内容粘贴在注册表的URL栏目里面,然后回车键按一下,如下面操作:​从上图可以看到已经定位到了Session Manager注册项目。然后找到栏目下的BootExecute双击以下,如下图:​可以看到值为autocheck autochk *接下来:按delete键,删除值​好了搞定,关闭注册表,重启就不会有开机磁盘检查了
  • spring boot1.5.2整合spring data mongodb10.1

    Java编程中使用spring boot1.5.2框架整合spring data mongodb10.1,来使用mongodb数据库Java编程中使用spring boot1.5.2框架整合spring data mongodb10.1,来使用mongodb数据库<br /> <br /> 项目结构图:<br /> <img alt="项目结构图" class="img-thumbnail" src="/assist/images/blog/e75e36b8-aabe-46f6-88c3-98ee6d3d8fa4.jpg" /><br /> 本项目主要讲解spring整合mongodb后的一些基本操作,如新增数据,修改数据,删除数据,查询数据<br /> <br /> 代码清单:<br /> <strong>定义一个简单的pojo Customer.java:</strong> <pre> <code class="language-java">package com.leftso.entity; /** * 测试用类 * * @author leftso * */ // @Document public class Customer { private String id; private String firstName; private String lastName; public Customer() { } public Customer(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer[id=%s, firstName='%s', lastName='%s']", id, firstName, lastName); } } </code></pre> <br /> <strong>添加数据配置mongo.properties:</strong> <pre> <code>#DB host+port,Multiple host separation with ',' db.host=localhost:27017 #DB name db.name=test1 #DB User Name db.user= #DB User Password db.pwd=</code></pre> <br /> <strong>自定义配置mongodb的数据源<br /> 数据库配置文件MongoProperty.java:</strong> <pre> <code class="language-java">package com.leftso.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; /** * mongodb的配置文件载入 * * @author leftso * */ @Component @ConfigurationProperties(prefix = "db") @PropertySource("classpath:mongo.properties") public class MongoProperty { /** 主机地址IP+端口 **/ private String host; /** 数据库名称 ***/ private String name; /** 数据库用户(非必须) ***/ private String user; /** 数据库密码 **/ private String pwd; public String getHost() { return host; } public void setHost(String host) { this.host = host; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } } </code></pre> <br /> <strong>数据源MongoDBConfig.java:</strong> <pre> <code class="language-java">package com.leftso.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.MongoDbFactory; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.SimpleMongoDbFactory; import org.springframework.util.StringUtils; import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; /** * mongodb 配置类 * * @author leftso * */ @Configuration public class MongoDBConfig { @Autowired MongoProperty mongoProperties; /** * 注入mongodb的工厂类 * * @return */ @Bean public MongoDbFactory mongoDbFactory() { // uri格式mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] String mongoURI = "mongodb://" + mongoProperties.getHost(); if (!StringUtils.isEmpty(mongoProperties.getUser())) { mongoURI = "mongodb://" + mongoProperties.getUser() + ":" + mongoProperties.getPwd() + "@" + mongoProperties.getHost(); } // 为了方便实现mongodb多数据库和数据库的负债均衡这里使用url方式创建工厂 MongoClientURI mongoClientURI = new MongoClientURI(mongoURI); MongoClient mongoClient = new MongoClient(mongoClientURI); MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(mongoClient, mongoProperties.getName()); // 注意:以下构造函数已经弃用: // SimpleMongoDbFactory(com.mongodb.Mongo mongo, String databaseName); // 弃用版本1.7 // SimpleMongoDbFactory(com.mongodb.Mongo mongo, String databaseName, // UserCredentials credentials);弃用版本1.7 // SimpleMongoDbFactory(com.mongodb.Mongo mongo, String databaseName, // UserCredentials credentials, String // authenticationDatabaseName);弃用版本1.7 // SimpleMongoDbFactory(com.mongodb.MongoURI uri);弃用版本1.7 return mongoDbFactory; } /** * 获取操作实例 * * @param mongoDbFactory * @return */ @Bean public MongoTemplate mongoTemplate(MongoDbFactory mongoDbFactory) { return new MongoTemplate(mongoDbFactory); } } </code></pre> <br /> <strong>创建customer的简单存储操作类<br /> 基于spring data框架的方式CustomerMongoRepository.java</strong><br />   <pre> <code class="language-java">package com.leftso.repository; import java.util.List; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.stereotype.Repository; import com.leftso.entity.Customer; /** * spring data提供接口方式实现简单的操作,通常适合简单的或者测试用 * * @author leftso * */ @Repository public interface CustomerMongoRepository extends MongoRepository<Customer, String> { public Customer findByFirstName(String firstName); public List<Customer> findByLastName(String lastName); } </code></pre> <br /> <strong>自定义方式实现CustomizeCustomerMongoRepository.java</strong><br />   <pre> <code class="language-java">package com.leftso.repository; import java.util.List; import java.util.regex.Pattern; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Repository; import com.leftso.entity.Customer; /** * 自定义数据存储方式 * * @author leftso * */ @Repository public class CustomizeCustomerMongoRepository { @Autowired MongoTemplate mongoTemplate; /** * 保存一个对象 * * @return */ public Customer save(Customer customer) { mongoTemplate.save(customer); return customer; } /** * 删除所有 */ public void deleteAll() { mongoTemplate.dropCollection(Customer.class); } /** * 查询所有 * * @return */ public List<Customer> findAll() { return mongoTemplate.findAll(Customer.class); } /** * 精确查询 * * @param firstName * @return */ public List<Customer> findByFirstName(String firstName) { Query query = new Query(); query.addCriteria(Criteria.where("firstName").is(firstName)); return mongoTemplate.find(query, Customer.class); } /** * 模糊查询不区分大小写 * * @param lastName * @return */ public List<Customer> findByLastName(String lastName) { Query query = new Query(); Pattern pattern = Pattern.compile("^.*" + lastName + ".*$", Pattern.CASE_INSENSITIVE);// Pattern.CASE_INSENSITIVE不区分大小写 query.addCriteria(Criteria.where("lastName").regex(pattern)); return mongoTemplate.find(query, Customer.class); } } </code></pre> <br /> 项目源码下载:<br /> <a rel="nofollow" target="_blank" href="https://github.com/leftso/demo-spring-boot-mongodb">https://github.com/leftso/demo-spring-boot-mongodb</a><br />  
  • Windows 10 安装 IIS服务部署应用网站

    Windows 10 安装 IIS服务​IIS安装说明 步骤:1打开控制面板,依次找到:控制面板\程序\程序和功能如下图:​步骤:2将上面图片框的选项勾好,然后点击确定,等待几分钟即可Windows 10 安装 IIS服务​IIS安装说明 步骤:1打开控制面板,依次找到:控制面板\程序\程序和功能如下图:​步骤:2将上面图片框的选项勾好,然后点击确定,等待几分钟即可。步骤:3在浏览器中输入 http://localhost/看到下图内容即表示安装成功​IIS发布网站应用说明:在发布网站前请先将编译后的网站程序放到装有IIS服务的机器上 打开IIS管理器:打开“控制面板”在“管理工具”中打开“Internet Information Services(IIS)管理器”。“管理工具”中可能有两个IIS管理器,其中一个带有数字6.0,另一个不带,要打开不带数字的那个。​创建应用程序池:在IIS左侧树状列表的“应用程序池”上点击右键,然后选择“添加应用程序池”,填写“程序池名称”、“.NET CLR版本”及“托管管理模式”,点击“确定”后,创建应用程序池完成。“.NET CLR版本”请根据所开发网站的支持版本选择,一般用“.NET Framework 4.0”及以上版本开发的网站都要选“v4.0”,“.NET Framework 3.5”及以下的版本选“v2.0”,具体区别请自行百度。“托管管理模式”里面分“集成”和“经典”两种,“经典”模式是之前版本IIS里的,用新版本asp.net开发的网站大都为“集成”,具体区别请自行百度。 ​添加网站1:在IIS左侧树状列表中的“网站”上点击右键,选择“添加网站”。​添加网站2:在添加网站对话框中,输入网站名称,选择应用程序池,选择物理路径,即网站程序存放的位置,填写端口。注:以上信息请自行根据情况更改。​添加网站3:点击确定后即完成网站的发布,可在发布到网站名上右键-管理网站-浏览,查看网站是否可正常打开。
  • java 初学者常见十大潜在错误

    每个Java学习者都会遇到10 + 1个常见错误,java 初学者常见十大潜在错误一.前言Java初学开发者容易犯的错误讲解主要是针对一些因习惯或者初心导致的问题进行汇总讲解。
  • java 图片 无损压缩

    java 图片 无损压缩。随着科技进步,大家手机拍的照片也从之前的几百KB变成几MB或者10MB了,有些情况我们需要压缩一下图片节省网络资源。这里将会讲解如何采用Java语音进行图片的无损压缩前言随着科技进步,大家手机拍的照片也从之前的几百KB变成几MB或者10MB了,有些情况我们需要压缩一下图片节省网络资源。这里将会讲解如何采用Java语音进行图片的无损压缩(有点不明显的)Java无损压缩图片依赖包 <!--图片压缩等操作--> <dependency> <groupId>net.coobird</groupId> <artifactId>thumbnailator</artifactId> <version>0.4.8</version> </dependency>Java 图片无损压缩工具类代码​​​​​​​