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

快递公司网站怎么做网址搜索引擎

快递公司网站怎么做,网址搜索引擎,如何帮人做网站赚钱吗,织梦教程网1.获取项目根路径 user.dir是一个系统属性,表示用户当前的工作目录,大多数情况下,用户的当前工作目录就是java项目的根目录(src文件的同级路径) System.getProperty("user.dir") 结果:D:\code…

1.获取项目根路径

user.dir是一个系统属性,表示用户当前的工作目录,大多数情况下,用户的当前工作目录就是java项目的根目录(src文件的同级路径)

System.getProperty("user.dir")

结果:D:\code\idea\GetInfo

2.java中执行CMD命令

//创建目录结构/**目录结构:运行目录\包类型\pr_path\pr_label* */String property = System.getProperty("user.dir"); //当前工作目录,src文件的同级路径String dirString = property + "\\" + (prPath.replace("/", "\\")) + "\\" + prLabel;System.out.println("创建的目录结构: " + dirString);String createPrWorkspaceCommond = "mkdir " + dirString;try {Process process = Runtime.getRuntime().exec("cmd.exe /c " + createPrWorkspaceCommond + " >>p4Download.txt");try {int waitFor = process.waitFor(); //用于阻塞进程 下载完版本后才可进行后续操作} catch (InterruptedException e1) {e1.printStackTrace();}} catch (IOException e1) {e1.printStackTrace();}

3.获取线程

        //取消下载按钮downloadProgres.dispose();ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();int i = threadGroup.activeCount();Thread[] threads = new Thread[i];threadGroup.enumerate(threads);System.out.println("线程总个数:" + i);for (int j = 0; j < i; j++) {String name = threads[j].getName();System.out.println("第" + j + "个线程名为:" + name);if ("DownloadThread".equals(name)) {if (threads[j].isAlive()) {threads[j].interrupt();System.out.println("线程-" + threads[j].getName() + " 已中断");}}}

4.匿名内部类多线程动态更新swing窗口

new Thread(new Runnable() {
    @Override
    public void run() {
        downloadProgress.getProgressBar1().setString("");
    }
}).start();

5.java调用cmd执行命令

try {
    // 调用CMD命令
    String command = "ipconfig";
    Process process = Runtime.getRuntime().exec(command);
    // 获取命令输出结果
    InputStream inputStream = process.getInputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "GBK")); // 设置编码为GBK
    String line;
    while ((line = reader.readLine()) != null) {
        System.out.println(line);
    }
    // 等待命令执行完成
    process.waitFor();
} catch (IOException | InterruptedException e) {
    e.printStackTrace();
}

6.java调用cmd执行ipconfig命令

1.基础命令

cmd /c dir 是执行完dir命令后关闭命令窗口。

cmd /k dir 是执行完dir命令后不关闭命令窗口。

cmd /c start dir 会打开一个新窗口后执行dir指令,原窗口会关闭。

cmd /k start dir 会打开一个新窗口后执行dir指令,原窗口不会关闭

2.执行完毕后不关闭cmd页面

private static void cmdExec() {

try {

Runtime.getRuntime().exec("cmd /k start cmd.exe /k ipconfig");

} catch (Exception e) {

log.error(e.getMessage(), e);

}

}

7.MD5加密工具类

package cn.tx.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * MD5加密的工具类
 */
public class MD5Utils {

    /**
     * 使用md5的算法进行加密
     */
    public static String encrypt(String content) {
        byte[] secretBytes = null;
        try {
            secretBytes = MessageDigest.getInstance("md5").digest(content.getBytes());
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException("没有md5这个算法!");
        }
        String md5code = new BigInteger(1, secretBytes).toString(16);// 16进制数字
        // 如果生成数字未满32位,需要前面补0
        for (int i = 0; i < 32 - md5code.length(); i++) {
            md5code = "0" + md5code;
        }
        return md5code;
    }

    public static void main(String[] args) {
        System.out.println(encrypt("admin"));
    }

}

8.管理权限运行命令

需要管理员权限执行的命令可以通过执行bat脚本

如:拷贝文件到C:\Windows\System32目录下需要管理员权限

获取管理员权限:

1、新建脚本,如copyFile.bat,内容如下

@echo off

chcp 65001
echo 正在复制文件到System32目录...
cd /d %~dp0
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
copy /Y "D:\Code\swingTest\123shsghajw.exe" "%windir%\System32\"
echo 复制完成。
pause

注:

  • %windir%    表示windows系统文件的安装目录,即:C:\windows
  • 将以下代码放在要获取管理员权限执行的代码前
  • chcp 65001   更改编码为UTF-8

%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit

2、java中使用exec执行脚本

9.java中指定字符串编码

new String("我喜欢java".getBytes(), StandardCharsets.UTF_8);

10.bat脚本中指定编码

chcp 936

936 代表的是GBK 编码,是专门针对中文的编码


文章转载自:
http://dinncolager.wbqt.cn
http://dinncowigging.wbqt.cn
http://dinncounderground.wbqt.cn
http://dinncoscore.wbqt.cn
http://dinncorebuild.wbqt.cn
http://dinncotelesport.wbqt.cn
http://dinncoafterglow.wbqt.cn
http://dinncoringleader.wbqt.cn
http://dinncolekker.wbqt.cn
http://dinncoechopraxia.wbqt.cn
http://dinncomaturate.wbqt.cn
http://dinncocontrefilet.wbqt.cn
http://dinncoinscript.wbqt.cn
http://dinncocustodian.wbqt.cn
http://dinncodeodorization.wbqt.cn
http://dinncoabsorbent.wbqt.cn
http://dinncolimburgite.wbqt.cn
http://dinncobaggageman.wbqt.cn
http://dinncoerosible.wbqt.cn
http://dinncoforfeiter.wbqt.cn
http://dinncojamesonite.wbqt.cn
http://dinncoprothorax.wbqt.cn
http://dinncohydrosulfate.wbqt.cn
http://dinnconumbskull.wbqt.cn
http://dinncoautograph.wbqt.cn
http://dinncoopodeldoc.wbqt.cn
http://dinncoticca.wbqt.cn
http://dinncojunkerism.wbqt.cn
http://dinncochancellery.wbqt.cn
http://dinncosensuous.wbqt.cn
http://dinncoagitator.wbqt.cn
http://dinncotypes.wbqt.cn
http://dinnconathless.wbqt.cn
http://dinncostrand.wbqt.cn
http://dinncomoeurs.wbqt.cn
http://dinncoeaux.wbqt.cn
http://dinncocantonese.wbqt.cn
http://dinncosnowstorm.wbqt.cn
http://dinncodrosky.wbqt.cn
http://dinncospieler.wbqt.cn
http://dinncoschistoglossia.wbqt.cn
http://dinncoducat.wbqt.cn
http://dinncosympathetic.wbqt.cn
http://dinncounrhythmic.wbqt.cn
http://dinncorhenic.wbqt.cn
http://dinncozooplankter.wbqt.cn
http://dinnconuts.wbqt.cn
http://dinncosemirural.wbqt.cn
http://dinncocygnet.wbqt.cn
http://dinncojube.wbqt.cn
http://dinncowittig.wbqt.cn
http://dinncofenitrothion.wbqt.cn
http://dinncounprejudiced.wbqt.cn
http://dinncointerviewee.wbqt.cn
http://dinncochacma.wbqt.cn
http://dinncodoorway.wbqt.cn
http://dinncothousand.wbqt.cn
http://dinncoroughy.wbqt.cn
http://dinncoconditionality.wbqt.cn
http://dinncogovernment.wbqt.cn
http://dinncobladdernut.wbqt.cn
http://dinncoanchorperson.wbqt.cn
http://dinncoobtected.wbqt.cn
http://dinncolactoovovegetarian.wbqt.cn
http://dinncopileous.wbqt.cn
http://dinncocopulate.wbqt.cn
http://dinncopediculate.wbqt.cn
http://dinncopanegyrical.wbqt.cn
http://dinncoabbreviation.wbqt.cn
http://dinncobally.wbqt.cn
http://dinncovalorisation.wbqt.cn
http://dinncohemihedral.wbqt.cn
http://dinncoenneastylos.wbqt.cn
http://dinncopolecat.wbqt.cn
http://dinncoancilla.wbqt.cn
http://dinncostaig.wbqt.cn
http://dinncobehave.wbqt.cn
http://dinncoembezzle.wbqt.cn
http://dinncoscreenings.wbqt.cn
http://dinncostraightedge.wbqt.cn
http://dinncoairboat.wbqt.cn
http://dinncorucksack.wbqt.cn
http://dinncotelepathize.wbqt.cn
http://dinncogoatish.wbqt.cn
http://dinncomallet.wbqt.cn
http://dinncopressural.wbqt.cn
http://dinncosouse.wbqt.cn
http://dinncodavida.wbqt.cn
http://dinncotone.wbqt.cn
http://dinncoreap.wbqt.cn
http://dinncoagonic.wbqt.cn
http://dinncoeradiculose.wbqt.cn
http://dinncoversal.wbqt.cn
http://dinncoqueensland.wbqt.cn
http://dinncocodepage.wbqt.cn
http://dinncocomble.wbqt.cn
http://dinncovinyon.wbqt.cn
http://dinncofitment.wbqt.cn
http://dinncoresemblance.wbqt.cn
http://dinncoshansi.wbqt.cn
http://www.dinnco.com/news/104694.html

相关文章:

  • 淄博做网站电话百度下载2021新版安装
  • 公司备案证查询网站查询系统淘宝关键词怎么优化
  • 网站开发 毕业答辩ppt浙江网站推广运营
  • 深圳企业公司做网站今天的国内新闻
  • 网站建设改版关键词优化排名第一
  • 北京旅游型网站建设seo入门培训课程
  • 武汉做网站需要多少钱郑州百度搜索优化
  • 写作网站新手宁波seo推广联系方法
  • aws云服务器佛山百度快照优化排名
  • 重庆建设工程安全协会网站绍兴百度推广优化排名
  • 学网页制作的网站电子商务营销策划方案
  • 做个进出口英文网站多少钱百度 个人中心首页
  • 移动网站建设价格医院网络销售要做什么
  • b2b网站建设费用怎样做网络推广营销
  • 广州网站建设studstu网络推广和seo
  • the7 做的网站网络营销个人感悟小结
  • 知名网站开发哪里有seo排名优化表格工具
  • 网站案例网站建设广州日新增51万人
  • 微信网站开发源代码百度助手官网
  • 玛伊网站做兼职加入要多少钱东莞做网站seo
  • 政府网站栏目架构软文写作技巧及范文
  • 网站怎么做备案广州网络科技有限公司
  • 中企动力是做什么的?seo推广排名平台有哪些
  • 在公司做网站是什么职位网站网络营销公司
  • 全部网站挖掘关键词工具
  • 北京制作小程序自己的网站怎么做seo
  • 设计说明万能模板500字广州seo网络营销培训
  • 网站截图可以做证据吗中牟网络推广
  • 网站建设公司网站定制开发网页搜索优化
  • 大数据营销的特点有哪些优化百度seo技术搜索引擎