Aobodo.Com

May 30, 2007

验证码表现类

Filed under: keyboard's joy — Tags: , — admin @ 7:29 am

近一段时间网上对BLOG恶意评论与引用越来越猖狂,真是太可恶了,提交需要验证码也不能阻止,真是气死我了. 想想原因,还是在验证码上,网上传说那些机器人可以分析验证码图片,真是太牛X了,但是你分析出来了也还是要提交的,对,就从输入框这下手,阻止他们!! 这招还真管用,我的BLOG自从换了验证码输入形式以后,几乎没有了机器人提交的东西,呵呵.下面给大家分享一下,希望为清理网络环境出一点力!

// JavaScript Document===验证码表现类
/*
///////////////////////////////////////////////////////////////////////////////
Jena’s Blog
作 者: 迦楠(Jena.want)
版权所有: IsHere.cn
技术支持: jena.want@gmail.com
单元名称: JENAValidCode
开始时间: 2007-5-30
最后修改:
参 数: instanceName-输入框名称;imgUrl-验证码程序地址;inputAmount-验证码位数.
备 注: 这是一个验证码表现类,支持内嵌各种类型的验证程序(gif,bmp…)
///////////////////////////////////////////////////////////////////////////////
*/
var inputsAmount;
function JENAValidCode(instanceName,imgUrl,inputAmount,inputStyle){
this.InstanceName = instanceName || ‘CheckCode’;
this.ImgUrl = imgUrl || ‘CheckCode.asp’;
this.InputAmount = inputAmount || 4;
this.InputStyle = inputStyle || ‘text’;

inputsAmount=this.InputAmount;
}
JENAValidCode.prototype.Create=function(){
var strs=”";
strs+= “<input name=\”"+ this.InstanceName +”\” type=\”hidden\” id=\”"+ this.InstanceName +”\” />”;
for(var i=1;i<=this.InputAmount;i++){
if(i==1){
strs+= “<input name=\”scode1\” id=\”scode1\” maxlength=\”1\” type=\”text\” class=\”"+ this.InputStyle +”\” onKeyUp=\”javascript:if(this.value!=”&&scode”+ (i+1) +”.value==”){scode”+ (i+1) +”.style.display=”;scode”+ (i+1) +”.focus();this.style.borderRight=’0px’;}”+ this.InstanceName +”.value=MusterValue()\” style=\”text-align:center; width:14px;\” />”;
}else if(i==this.InputAmount){
strs+= “<input name=\”scode”+ i +”\” id=\”scode”+ i +”\” maxlength=\”1\” type=\”text\” class=\”"+ this.InputStyle +”\” style=\”display:none;text-align:center; width:14px; border-width:1px 1px 1px 0px\” onKeyUp=\”javascript:”+ this.InstanceName +”.value=MusterValue()\” />”;
}else{
strs+= “<input name=\”scode”+ i +”\” id=\”scode”+ i +”\” maxlength=\”1\” type=\”text\” class=\”"+ this.InputStyle +”\” style=\”display:none;text-align:center; width:14px; border-width:1px 1px 1px 0px\” onKeyUp=\”javascript:if(this.value!=”&&scode”+ (i+1) +”.value==”){scode”+ (i+1) +”.style.display=”;scode”+ (i+1) +”.focus();this.style.borderRight=’0px’;}”+ this.InstanceName +”.value=MusterValue()\” />”;
}
}
strs+= ” <img src=\”"+ this.ImgUrl +”? + Math.random()\” id=\”secCode\” align=\”absmiddle\” />”;
strs+= “<span style=\”font-family:Verdana;font-size:9px;cursor:pointer;\” onclick=\”javascript:document.getElementById(’secCode’).src=’”+ this.ImgUrl +”?’ + Math.random();scode1.value=”;scode1.focus();”
for(var i=2;i<=this.InputAmount;i++){
strs+=”scode”+ i +”.value=”;”
}
strs+=”\”> Another</span>”;
document.writeln(strs);
//return strs;
}
function MusterValue(){
var mustervalue=”";
for(var i=1;i<=inputsAmount;i++){
mustervalue+=document.getElementById(”scode”+i).value
}
return mustervalue;
}

May 28, 2007

js操作cookies

Filed under: keyboard's joy — Tags: , — admin @ 6:28 am

function setCookie(name,value) { var Days = 30; var exp = new Date(); //new Date(”December 31, 9998″); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + “=”+ escape (value) + “;expires=” + exp.toGMTString(); } function getCookie(name) { var arr,reg=new RegExp(”(^| )”+name+”=([^;]*)(;|$)”); if(arr=document.cookie.match(reg)) return unescape(arr[2]); else return null; } function delCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + “=”+cval+”;expires=”+exp.toGMTString(); }

May 23, 2007

在JS中实现日期相加

Filed under: keyboard's joy — Tags: — admin @ 8:59 am

function DateAdd(interval,number,date){
/*
*————— DateAdd(interval,number,date) —————–
* DateAdd(interval,number,date)
* 功能:实现VBScript的DateAdd功能.
* 参数:interval,字符串表达式,表示要添加的时间间隔.
* 参数:number,数值表达式,表示要添加的时间间隔的个数.
* 参数:date,时间对象.
* 返回:新的时间对象.
* var now = new Date();
* var newDate = DateAdd(”d”,5,now);
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-28 11:46
* modify:Jean.want(ishere.cn)
* modifydate:2007-5-23 16:57
*————— DateAdd(interval,number,date) —————–
*/
number=parseInt(number);
switch(interval){
case “y” :
{date.setFullYear(date.getFullYear()+number); break; }
case “q” : { date.setMonth(date.getMonth()+number*3); break; }
case “m” : { date.setMonth(date.getMonth()+number); break; }
case “w” : { date.setDate(date.getDate()+number*7); break; }
case “d” : { date.setDate(date.getDate()+number); break; }
case “h” : { date.setHours(date.getHours()+number); break; }
case “m” : { date.setMinutes(date.getMinutes()+number); break; }
case “s” : { date.setSeconds(date.getSeconds()+number); break; }
default : { date.setDate(d.getDate()+number); break; }
}
return date.toLocaleDateString();
}

May 22, 2007

艾薇儿新歌《The Best Damn Thing》好听的很,下载下来听听

Filed under: Uncategorized — admin @ 12:44 am

http://www.ishere.cn//uploads/200705/22_084457_girlfriendthebestdamnthing.mp3

Avril Lavigne - The Best Damn Thing
专辑:The Best Damn Thing
LRC Produced By
Album:The Best Damn Thing
Avril Lavigne-The Best Damn Thing
Let me hear you say hey hey hey
Alright, now let me hear you
say hey hey ho
I hate it when a guy doesn’t get the door
Even though I told him yesterday
and the day before
I hate it when a guy
doesn’t get the tab
And I have to pull my money out
and that looks bad
Where are the hopes,
where are the dreams
My Cinderella story scene
When do you think
they’ll finally see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene
I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Alright Alright yeah
I hate it when a guy doesn’t understand
Why a certain time of month
I don’t want to hold his hand
I hate it when they go out and we stay in
And they come home smelling like
their ex-girlfriend
But I found my hopes
I found my dreams
My Cinderella story scene
Now everybody’s gonna see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Give me an A,
always give me what I want
Give me a V,
be very very good to me
R, are you gonna treat me right
I, I can put up a fight
Give me an L,
let me hear you scream loud
One two three four
Where are the hopes,
where are the dreams
My Cinderella story scene
When do you think
they’ll finally see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Let me hear you say hey hey hey
Alright, now let me hear
you say hey hey ho
I’m the best damn thing
that your eyes have ever seen

May 21, 2007

记住这句话

Filed under: Uncategorized — admin @ 2:42 pm

在 JScript 表达式中,正则表达式后面的全局标志 (’g') 表示该表达式将用来在输入字符串中查找尽可能多的匹配。大小写敏感性由表达式结束处的大小写敏感性标记 (’i') 指定。

May 15, 2007

回忆 味道

Filed under: Uncategorized — admin @ 5:03 am

中午喝了点酒,呵呵.

然后又翻看了以前的照片,去年大跃进的照片,一张张熟悉的笑脸,好亲切!可是现在都不在身边了,为了工作各奔东西,虽然在同一座城市,却难得见上一面. [cry]

在一起的感觉真好,想念我的朋友们!

于是,我决定这个周末邀他们出来玩,夏天到了,喝个散啤,吃个烧烤,应该也是一件快乐的事情!

May 9, 2007

JS判断邮箱格式

Filed under: keyboard's joy — Tags: , , — admin @ 3:31 am

邮箱格式要求是:

  • 必须包含一个并且只有一个符号@
  • 第一个字符不能是’@'或者’.’
  • 不允许出现’@.’或者’.@’或者’-@’或者’@-’
  • 结尾不得是字符’@'或者’.’
  • 字符@后面只能是’A-Za-z0-9′

<script> function checkMail(str){ var strReg=”"; var r; var strText=document.all(str).value; //strReg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/i; strReg=/^\w+((-\w+)|(\.\w+))*\@{1}\w+\.{1}\w{2,4}(\.{0,1}\w{2}){0,1}/ig; r=strText.search(strReg); if(r==-1) { alert(”邮箱格式错误!”); document.all(str).focus(); } } </script>

<input name=”email” type=”text” class=”input” id=”email” onChange=”checkMail(’email’)”>

April 15, 2007

windows2003去掉关机事件跟踪

Filed under: Uncategorized — admin @ 3:41 am

在运行中输入gpedit.msc,打开“组策略编辑器”,选择“本地计算机策略→计算机配置→管理模板→系统”,接着双击右侧窗口中的“显示关闭事件跟踪程序”,最后在“设置”选项卡中“已禁用”即可。
[lol]

April 14, 2007

Vista操作系统,挺可爱的,也挺无奈的!

Filed under: Uncategorized — admin @ 5:23 pm

Windows Vista操作系统出来有一段时间了,一直想尝试一下,前天从同事那里整了个中文的,装上了,感觉就是不一样,那效果,没治了。
可是有些软件不能在这个平台上运行,但又是工作必需的,唉,无奈啊,只能割爱了。真是一口好锅,却不能煮肉!
只能又换回了Windows 2003 server,老伙伴了。
[cool]

April 10, 2007

ASP Session对象的集合以及属性方法事件

Filed under: Uncategorized — admin @ 6:31 am

asdf

Pages: Prev 1 2 3 4 5 6 7 8 ...15 16 17 Next

Powered by WordPress, Design by Jena