首页 文章 精选 留言 我的

精选列表

搜索[源代码漏洞],共10002篇文章
优秀的个人博客,低调大师

java获取网页源代码

public static String getHtmlContent(URL url, String encode) { StringBuffer contentBuffer = new StringBuffer(); int responseCode = -1; HttpURLConnection con = null; try { con = (HttpURLConnection) url.openConnection(); con.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");// IE代理进行下载 con.setConnectTimeout(60000); con.setReadTimeout(60000); // 获得网页返回信息码 responseCode = con.getResponseCode(); if (responseCode == -1) { String re = url.toString() + " : connection is failure..."; con.disconnect(); return re; } if (responseCode >= 400) // 请求失败 { String re = "请求失败:get response code: " + responseCode; con.disconnect(); return re; } InputStream inStr = con.getInputStream(); InputStreamReader istreamReader = new InputStreamReader(inStr, encode); BufferedReader buffStr = new BufferedReader(istreamReader); String str = null; while ((str = buffStr.readLine()) != null) contentBuffer.append(str); inStr.close(); } catch (IOException e) { e.printStackTrace(); contentBuffer = null; System.out.println("error: " + url.toString()); } finally { con.disconnect(); } return contentBuffer.toString(); } public static String getHtmlContent(String url, String encode) { if (!url.toLowerCase().startsWith("http://")) { url = "http://" + url; } try { URL rUrl = new URL(url); return getHtmlContent(rUrl, encode); } catch (Exception e) { e.printStackTrace(); return "网址错误!"; } } //测试 /*public static void main(String argsp[]){ System.out.println(getHtmlContent("www.ilkhome.cn","utf-8")) ; }*/

优秀的个人博客,低调大师

sync.mutex 源代码分析

sync.Mutex是Go标准库中常用的一个排外锁。当一个 goroutine 获得了这个锁的拥有权后, 其它请求锁的 goroutine 就会阻塞在 Lock 方法的调用上,直到锁被释放。sync.Mutex的实现也是经过多次的演化,功能逐步加强,增加了公平的处理和饥饿机制。 初版的 Mutex首先我们来看看Russ Cox在2008提交的第一版的Mutex实现。 1type Mutex struct { 2 key int32; 3 sema int32; 4} 5 6func xadd(val *int32, delta int32) (new int32) { 7 for { 8 v := *val; 9 if cas(val, v, v+delta) { 10

资源下载

更多资源
Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册