JAVA创建桌面快捷方式

来源:互联网 发布:电脑绘画软件有哪些 编辑:程序博客网 时间:2024/06/01 07:58
@RequestMapping(value = "/desktop_icons")    public void desktopIcons(ModelMap model, HttpServletRequest request,            HttpServletResponse response) throws IOException {        String templateContent = "[InternetShortcut]" + "\r\n" + "URL= http://www.xxxx.com" + "\r\n" + "IconIndex=1" + "\r\n" + "IconFile=http://www.xxxx.com/favicon.ico\r\n";               PrintWriter outa =response.getWriter();        String file = java.net.URLEncoder.encode("百度.url","UTF-8");         response.addHeader("Content-Disposition","attachment;filename="+file);        StringBuffer bf=new StringBuffer();          bf.append(templateContent);            bf.append("IDList=\r\n");        bf.append("[{000214A0-0000-0000-C000-000000000046}]\r\n");        bf.append("Prop3=19,2\r\n");        outa.write(bf.toString());          outa.flush();          outa.close();     }
0 0
原创粉丝点击