admin管理员组

文章数量:1130349

我这里用的是下载的360极速浏览器,因为这款浏览器在关闭最后一个标签页的时候浏览器也会默认自动关闭的(不行的话就自己在设置里设置),

我这里是用Java代码运行CMD命令打开网页的,想要关闭浏览器也可以使用CMD命令

    /**
     * 请求的地址也可以带参数
     * @param caseNo
     * @param clid
     * @param servid
     */
    @ResponseStatus(HttpStatus.OK)
    @RequestMapping(value="/gpy/liangtian",method = RequestMethod.GET)
    public void liangtian(@RequestParam(value="caseNo",required=false) String caseNo,
            @RequestParam(value="clid",required=false)  String clid ,
            @RequestParam(value="servid",required=false)  String servid){
        String url= "10.235.11.135:1037/mas/gpy/gpy?caseNoAndClid="+caseNo+"-"+clid+"-"+servid;
       //360急速浏览器,设置为关闭最后一个标签页关闭浏览器
        String str = "cmd /c start D:/tools/360/360Chrome/Chrome/Application/360chrome.exe --kiosk "+url;
        try {
            Runtime.getRuntime().exec(str);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

这是代码导入的工具包,先放一下吧,防止大家导错包

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.vingsoft.hsi.config.GetPropertiesConfig;

import java.io.IOException;
import java.util.Map;

 

我这里用的是下载的360极速浏览器,因为这款浏览器在关闭最后一个标签页的时候浏览器也会默认自动关闭的(不行的话就自己在设置里设置),

我这里是用Java代码运行CMD命令打开网页的,想要关闭浏览器也可以使用CMD命令

    /**
     * 请求的地址也可以带参数
     * @param caseNo
     * @param clid
     * @param servid
     */
    @ResponseStatus(HttpStatus.OK)
    @RequestMapping(value="/gpy/liangtian",method = RequestMethod.GET)
    public void liangtian(@RequestParam(value="caseNo",required=false) String caseNo,
            @RequestParam(value="clid",required=false)  String clid ,
            @RequestParam(value="servid",required=false)  String servid){
        String url= "10.235.11.135:1037/mas/gpy/gpy?caseNoAndClid="+caseNo+"-"+clid+"-"+servid;
       //360急速浏览器,设置为关闭最后一个标签页关闭浏览器
        String str = "cmd /c start D:/tools/360/360Chrome/Chrome/Application/360chrome.exe --kiosk "+url;
        try {
            Runtime.getRuntime().exec(str);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

这是代码导入的工具包,先放一下吧,防止大家导错包

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.vingsoft.hsi.config.GetPropertiesConfig;

import java.io.IOException;
import java.util.Map;

 

本文标签: 浏览器网址java