﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-哈欠的个人房间</title><link>http://www.cnitblog.com/haqian/</link><description>左，右，到底我要向哪走?</description><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 06:00:19 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 06:00:19 GMT</pubDate><ttl>60</ttl><item><title>注册表终极操作——锁定注册表</title><link>http://www.cnitblog.com/haqian/archive/2005/12/23/5720.html</link><dc:creator>哈欠</dc:creator><author>哈欠</author><pubDate>Fri, 23 Dec 2005 07:08:00 GMT</pubDate><guid>http://www.cnitblog.com/haqian/archive/2005/12/23/5720.html</guid><wfw:comment>http://www.cnitblog.com/haqian/comments/5720.html</wfw:comment><comments>http://www.cnitblog.com/haqian/archive/2005/12/23/5720.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/haqian/comments/commentRss/5720.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/haqian/services/trackbacks/5720.html</trackback:ping><description><![CDATA[<P>你有没有遇到注册表被锁定，无法打开注册表来手工修复呢？很多人都为这个头疼吧，相信你被锁定一次就知道他的操作原理了：</P>
<P>修改[HKEY_CURRENT_USER\Software\Microsoft\Windows\Current<BR>Version\Policies\System]下的DisableRegistryTools值为1</P>
<P>解锁的方法也有几种，比如程序用API函数调用注册表直接删除，做一个REG文件直接导入，写一个脚本…………</P>
<P>今天我就教大家写个程序来实现另类锁定，是不是很好奇了？跟我来。</P>
<P>实验环境：windows2000<BR>实验目的：锁定注册表（本方法利用了Cracker的思路来实现，直接让程序修改程序指令，使调用注册表程序禁止。）<BR>实现方法：C程序</P>
<P>首先我们要按照Cracker的思路反汇编WINNT下的regedit.exe和regedt32.exe找到跳转指令，怎么得到这些信息不是我们今天的目的，这里我就不详细介绍了，以下是我反汇编找到的跳转地址：<BR>1.regedit.exe<BR>偏移地址：0x69CA 将指令：0x74 0x1A 修改成:0x90 0x90</P>
<P>2.regedt32.exe<BR>偏移地址：0x10bf2 将指令：0x74 0x52 修改成:0x90 0x90</P>
<P>现在我们用程序把这2个偏移地址的指令给修改成0x90 0x90 ( 0x90代表nop,就是让程序什么也不做，执行下一条指令)让我们看看程序是如何实现的吧。</P>
<P>#include <BR>#include <BR>bool scanreg(const char *file,long offset, int length,char *the); /*函数说明*/</P>
<P>main()<BR>{ <BR>char the[]={ 0x90,0x90 }; <BR>scanreg("C:\\WINNT\\regedit.exe",0x69CA,0x02,the); /*调用函数修改winnt下的regedit.exe 其中的0x02是修改长度*/<BR>scanreg("C:\\WINNT\\ServicePackFiles\\i386\\regedit.exe",0x69CA,0x02,the); /*调用函数改变补丁下regedit.exe*/<BR>scanreg("C:\\WINNT\\system32\\regedt32.exe",0x10bf2,0x02,the); /*调用函数修改system32下的regedt32.exe */<BR>scanreg("C:\\WINNT\\ServicePackFiles\\i386\\regedt32.exe",0x10bf2,0x02,the); /*调用函数改变补丁下regedt32.exe*/<BR>}<BR>bool scanreg(const char *file,long offset, int length,char *the) <BR>{ <BR>FILE *fp = NULL; <BR>bool result=false; <BR>if((fp=fopen(file,"rb+"))!=NULL) /*打开文件进行读写操作*/<BR>{ <BR>fseek(fp,offset,1); /*把指针指向我们定义的偏移地址*/<BR>fwrite(the,length,1,fp); /*修改程序，把指令替换成0x90*/<BR>fclose(fp); /*关闭文件*/<BR>result=true; <BR>}<BR>return(result); <BR>}</P>
<P>好了，我这里只是一个示范，只适合2000系统，把windows每种系统的注册表调用程序都分析一下，然后在程序开始用API函数GetVersionEx(LPOSVERSIONINFO lpVersionInfo)判断系统，根据判断的系统来调用相应的修改函数。那不是通杀windows了？上面把方法公布出来，以便大家做好防范。</P><img src ="http://www.cnitblog.com/haqian/aggbug/5720.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/haqian/" target="_blank">哈欠</a> 2005-12-23 15:08 <a href="http://www.cnitblog.com/haqian/archive/2005/12/23/5720.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Flash 与 Asp 的结合使用</title><link>http://www.cnitblog.com/haqian/archive/2005/12/14/5363.html</link><dc:creator>哈欠</dc:creator><author>哈欠</author><pubDate>Wed, 14 Dec 2005 04:15:00 GMT</pubDate><guid>http://www.cnitblog.com/haqian/archive/2005/12/14/5363.html</guid><wfw:comment>http://www.cnitblog.com/haqian/comments/5363.html</wfw:comment><comments>http://www.cnitblog.com/haqian/archive/2005/12/14/5363.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/haqian/comments/commentRss/5363.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/haqian/services/trackbacks/5363.html</trackback:ping><description><![CDATA[Flash 的功能已经非常强大，完全可以跟其他的服务器端语言结合起来,做出适合现在的网络应用的网站。一个典型的模式就是Flash 与Asp的结合使用。其架构如图1所示。<BR>
<P align=center><IMG src="http://www.pconline.com.cn/pcedu/sj/wz/flash/10307/pic/030711flashasp01.gif" align=center></P>
<CENTER>图01</CENTER>
<P>可以把上面的结构看成是三层，Flash是一层，Asp是一层，数据库是一层。对Flash和Asp有点了解的人，只要处理好层与层之间的交互，结合使用Flash与Asp就决不是什么难事。<BR><BR>　　<FONT size=4><B>一、下面我们就先来看看Flash与Asp之间的交互</B></FONT><BR><BR>　　Flash与Asp的通讯是用Http协议，其请求格式为http://ip地址?参数1=值1&amp;参数2=值2<BR><BR>　　即是在目的地址后面加上问号，再跟上参数字符串，参数之间用“&amp;”号格开。如：<BR>http://www.pcedu.com.cn/test.asp?userid=guest&amp;pwd=123<BR><BR>　　在上面的请求中，请求的目的文件为：http://www.pcedu.com.cn/test.asp，第一个参数名为userid，值为guest，第二个参数名为pwd，值为123。<BR><BR>　　Flash与Asp之间的交互无非就是构造上面的请求字符串。<BR><BR>　　1、在Flash中，先构造好请求的字符串，然后利用函数LoadVariables()，就可以向服务器端发送请求和参数。我们来详细看看LoadVariables()这个函数。<BR><BR>　　函数的标准格式为loadVariables ("url" ,level/"target" [, variables])<BR><BR>　　在函数的各个参数中，url就是上面说的请求字符串。level/“target”是返回值的“层次”或者“目标”，这两个当中只能指定一个。variables是请求的方式，其值可以是“Get”或者是“Post”，一般Get用于参数值比较短的传送，Post用于参数值比较长的传送，这个参数是可选的。比如loadVariables ("http://www.pcedu.com.cn/guest.asp?userid=guest&amp;pwd=123" ,0, “GET”)就是一个完整的请求。<BR><BR>　　2、在Asp中，先要取得从Flash端传送过来的参数，这跟操作普通的HTML表单是一样的。都是利用Request对象，其语句为：<BR><BR>username = Request(“userid”)<BR>password = Request(“pwd”)<BR><BR>　　userid和pwd就是从Flash端发送过来的参数名，如果是上一步中的请求字符串，username的值为guest，pwd的值为123。<BR>　　3、在服务器端处理完请求，获得所需要的值后，Asp向Flash端发送结果，跟从Asp中操作Html语言一样，都是用Response对象，其语句为：<BR><BR>Response.Write(“login=true&amp;des=success”)<BR><BR>其返回值1的名为login，值为true，返回值2的名为des，值为success。</P>
<P align=left><BR><BR>　　4、在Flash端取得从服务器端返回的值，与操作Flash中普通的变量没什么不同。如：<BR>_root.gotoAndPlay(eval(login))表示的是跳转到login的值的那一帧。但要注意的是在发送请求一段时间之后，才能用返回值，不然取得的是尚未返回的值，错误就在所难免了，而且这一类的错误很难发现，用的时候要多加小心。<BR><BR>　　<FONT size=4><B>二、Asp与数据库之间的交互</B></FONT><BR><BR>　　在Asp与数据库的交互一般是用ADO控件。其读取数据库的语句为：<BR><BR>‘定义一个Connection对象<BR>set conn=Server.CreateObject("ADODB.Connection") <BR>‘用Connection对象打开数据库，这里打开的是sql server，数据库的地址为192.168.1.32<BR>‘数据库的用户名为zengyu，密码为123<BR>conn.open application("Driver={SQL Server};SERVER=192.168.1.32;DATABASE=test;UID=zengyu;PASSWORD=123")<BR>‘创建一个Recordset对象<BR>set rstemp=Server.CreateObject("ADODB.Recordset")<BR>‘构造一个sql语句<BR>sqltemp1="select * from UserInfo where userid='"&amp;strname&amp;"' and password='"&amp;strpassword&amp;"'"<BR>‘查询数据库<BR>rstemp.open sqltemp1,conn, 1, 1 <BR>if not(rstemp.bof and rstemp.eof) then<BR>Response.Write (“login=true”)<BR>end if<BR><BR>　　这里实现的只是简单地查询数据库，要想了解Asp操作数据库更详细的东西，可以找Asp与数据库方面的资料深入学习一下。<BR><BR>　　<FONT size=4><B>三、例子――登陆的实现</B></FONT><BR><BR>　　下面我们来制作一个简单的实例，在Flash端输入用户名和密码，通过Asp查询数据库，如果用户名和密码正确，就跳转到登陆成功界面，否则就跳转到登陆失败界面。<BR><BR>　　1、新建一个Flash，在场景中制作两个文本框和一个Button，如图2所示。其中用户名对应的文本框属性如图3所示，密码对应的文本框属性如图4所示。注意其中的文本类型和变量名。<BR><IMG src="http://www.pconline.com.cn/pcedu/sj/wz/flash/10307/pic/030711flashasp02.gif" align=center><BR><BR>图2<BR><BR></P>
<P align=center><IMG src="http://www.pconline.com.cn/pcedu/sj/wz/flash/10307/pic/030711flashasp03.gif" align=center></P>
<CENTER>图03</CENTER>
<P><BR>&nbsp;</P>
<P align=center><IMG src="http://www.pconline.com.cn/pcedu/sj/wz/flash/10307/pic/030711flashasp04.gif" align=center></P>
<CENTER>图04</CENTER>
<P align=left><BR>　　2、创建另外两个关键帧，分别命名为“true”和“false”，并分别显示“登陆成功”和“登陆失败”字样。<BR><BR>　　3、在Button的ActionScript中增加下面的语句，注意更改其中的ip地址。<BR><BR>on (release) {<BR>loadVariables("http://192.168.1.32/guest.asp?userid=" add eval(_root.userid) add "&amp;pwd=" add eval(_root.pwd),this, "GET");<BR>now = new Date();<BR>begintime = now.getSeconds();<BR>while(true) {<BR>endt = new Date();<BR>endtime = endt.getSeconds();<BR>if (endt - now &gt; 2)<BR>{<BR>_root.gotoAndPlay(eval(login));<BR>}<BR>}<BR>}<BR><BR>　　4、在Sql Server数据库（数据库的类型不重要，改一改连接串就可以的）中，建立一张名为“userinfo”的表，其中有“Userid”和“Password”两个字段。<BR><BR>　　5、建立一个guest.asp文件，文件内容为<BR><BR>&lt;%<BR>username = Request(“userid”)<BR>password = Request(“pwd”)<BR>set conn=Server.CreateObject("ADODB.Connection") <BR>conn.open application("Driver={SQL Server};SERVER=192.168.1.32;DATABASE=test;UID=zengyu;PASSWORD=123")<BR>set rstemp=Server.CreateObject("ADODB.Recordset")<BR>sqltemp1="select * from UserInfo where userid='"&amp;username&amp;"' and password='"&amp;strpassword&amp;"'"<BR>rstemp.open sqltemp1,conn, 1, 1 <BR>if not(rstemp.bof and rstemp.eof) then<BR>Response.Write (“login=true”)<BR>Else <BR>Response.Write (“login=false”)<BR>end if<BR>%&gt;<BR><BR>　　6、将Flash文件和Asp文件部署到IIS服务器中，然后打开Flash文件，输入登陆信息就可以看到实例的效果了。 <BR clear=all><BR clear=all></P>
<P align=center>&nbsp;</P><img src ="http://www.cnitblog.com/haqian/aggbug/5363.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/haqian/" target="_blank">哈欠</a> 2005-12-14 12:15 <a href="http://www.cnitblog.com/haqian/archive/2005/12/14/5363.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asp.net自带的MailMessage其实很好用的,还支持SMTP</title><link>http://www.cnitblog.com/haqian/archive/2005/12/14/5356.html</link><dc:creator>哈欠</dc:creator><author>哈欠</author><pubDate>Wed, 14 Dec 2005 02:23:00 GMT</pubDate><guid>http://www.cnitblog.com/haqian/archive/2005/12/14/5356.html</guid><wfw:comment>http://www.cnitblog.com/haqian/comments/5356.html</wfw:comment><comments>http://www.cnitblog.com/haqian/archive/2005/12/14/5356.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/haqian/comments/commentRss/5356.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/haqian/services/trackbacks/5356.html</trackback:ping><description><![CDATA[代码如下: <BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Web.Mail; <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;SendMail(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;to,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;subject,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;body) <BR><IMG id=Codehighlighter1_118_780_Open_Image onclick="this.style.display='none'; Codehighlighter1_118_780_Open_Text.style.display='none'; Codehighlighter1_118_780_Closed_Image.style.display='inline'; Codehighlighter1_118_780_Closed_Text.style.display='inline';" height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_118_780_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_118_780_Closed_Text.style.display='none'; Codehighlighter1_118_780_Open_Image.style.display='inline'; Codehighlighter1_118_780_Open_Text.style.display='inline';" height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_118_780_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://microtea.cnblogs.com/Images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_118_780_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MailMessage&nbsp;mail&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;MailMessage(); <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.From&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">发送者的名字\</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;&lt;你的邮箱地址&gt;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">设定发件人名字和地址(必须填写)</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.BodyFormat&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;MailFormat.Html;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">用html格式</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.Fields.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://schemas.microsoft.com/cdo/configuration/smtpauthenticate</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">basic&nbsp;authentication</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.Fields.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://schemas.microsoft.com/cdo/configuration/sendusername</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">邮箱用户名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">设定SMTP验证的用户名</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.Fields.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://schemas.microsoft.com/cdo/configuration/sendpassword</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">邮箱密码</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">设定SMTP验证的密码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SmtpMail.SmtpServer&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">smtp服务器</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">设定SMTP服务器地址,如smtp.163.com</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.To&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;to&nbsp;;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">设定收件人地址（必须填写）。</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.Subject&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;subject; <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail.Body&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;body; <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SmtpMail.Send(mail); <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top> <BR><IMG height=16 src="http://microtea.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN> </DIV></DIV><BR>大家注意到mail.From = "\"发送者的名字\" &lt;你的邮箱地址&gt;"; 了吗? <BR>发送者的名字是你想邮件用什么名字发送,用什么名字都行,如: <img src ="http://www.cnitblog.com/haqian/aggbug/5356.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/haqian/" target="_blank">哈欠</a> 2005-12-14 10:23 <a href="http://www.cnitblog.com/haqian/archive/2005/12/14/5356.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javascript 的实例</title><link>http://www.cnitblog.com/haqian/archive/2005/12/14/5355.html</link><dc:creator>哈欠</dc:creator><author>哈欠</author><pubDate>Wed, 14 Dec 2005 02:18:00 GMT</pubDate><guid>http://www.cnitblog.com/haqian/archive/2005/12/14/5355.html</guid><wfw:comment>http://www.cnitblog.com/haqian/comments/5355.html</wfw:comment><comments>http://www.cnitblog.com/haqian/archive/2005/12/14/5355.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/haqian/comments/commentRss/5355.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/haqian/services/trackbacks/5355.html</trackback:ping><description><![CDATA[<P>1．让文字不停地滚动 </P>
<P>　　&lt;MARQUEE&gt;滚动文字&lt;/MARQUEE&gt; </P>
<P>2．记录并显示网页的最后修改时间 </P>
<P>　　&lt;script language=javascript&gt; 　　document．write("最后更新时间: " + document．lastModified + "") 　　&lt;/script&gt; </P>
<P>3．关闭当前窗口 </P>
<P>　　&lt;a href="/"onClick="javascript：window.close();return false;"&gt;关闭窗口&lt;/a&gt; </P>
<P>4．5秒后关闭当前页 </P>
<P>　　&lt;script language="javascript"&gt; 　　&lt;!-- 　　setTimeout(''window.close();'',5000); 　　--&gt; 　　&lt;/script&gt; </P>
<P>5．2秒后载入指定网页 </P>
<P>　　&lt;head&gt; 　　&lt;meta http-equiv="refresh" content="2;URL=http://你的网址"&gt; 　　&lt;/head&gt; </P>
<P>6．添加到收藏夹 </P>
<P>　　&lt;Script Language="javascript"&gt; 　　function bookmarkit() 　　{ 　　window.external.addFavorite(''http://你的网址'',''你的网站名称'') 　　} 　　if (document．all)document．write(''&lt;a href="#" onClick="bookmarkit()"&gt;加入收藏夹&lt;/a&gt;'') 　　&lt;/Script&gt; </P>
<P>7．让超链接不显示下划线 </P>
<P>　　&lt;style type="text/css"&gt; 　　&lt;!- 　　a:link{text-decoration:none} 　　a:hover{text-decoration:none} 　　a:visited{text-decoration:none} 　　-&gt; 　　&lt;/style&gt; </P>
<P>8．禁止鼠标右键的动作 </P>
<P>　　&lt;Script Language = "javascript"&gt; 　　function click() { if (event.button==2||event.button==3) 　　{ 　　alert(''禁止鼠标右键''); 　　} 　　document．onmousedown=click // --&gt; 　　&lt;/Script&gt; </P>
<P>9．设置该页为首页 </P>
<P>　　&lt;body bgcolor="#FFFFFF" text="#000000"&gt; 　　&lt;!-- 网址：http://你的网址--&gt; 　　&lt;a class="chlnk" style="cursor:hand" HREF 　　onClick="this.style.behavior=''url(#default#homepage)''; 　　this.setHomePage(''你的网站名称);"&gt;&lt;font color="000000" size="2" face="宋体"&gt;设为首页&lt;/font&gt;&lt;/a&gt; 　　&lt;/body&gt;</P>
<P>10．节日倒计时 </P>
<P>　　&lt;Script Language="javascript"&gt; 　　var timedate= new Date("December 25,2003"); 　　var times="圣诞节"; 　　var now = new Date(); 　　var date = timedate.getTime() - now.getTime(); 　　var time = Math.floor(date / (1000 * 60 * 60 * 24)); 　　if (time &gt;= 0) 　　document．write("现在离"+times+"还有: "+time +"天")&lt;/Script&gt; </P>
<P>11．单击按钮打印出当前页 </P>
<P>　　&lt;Script Language="javascript"&gt; 　　&lt;!-- Begin 　　if (window.print) { 　　document．write(''&lt;form&gt;'' 　　+ ''&lt;input type=button name=print value="打印本页" '' 　　+ ''onClick="javascript：window.print()"&gt;&lt;/form&gt;''); 　　} 　　// End --&gt; 　　&lt;/Script&gt; </P>
<P>12．单击按钮‘另存为’当前页 </P>
<P>　　&lt;input type="button" name="Button" value="保存本页" 　　onClick="document．all.button.ExecWB(4,1)"&gt; 　　&lt;object id="button" 　　width=0 　　height=0 　　classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"&gt; 　　&lt;embed width="0" height="0"&gt;&lt;/embed&gt; 　　&lt;/object&gt; </P>
<P>13．显示系统当前日期 </P>
<P>　　&lt;script language=javascript&gt; 　　today=new Date(); 　　function date(){ 　　this.length=date.arguments.length 　　for(var i=0;i&lt;this.length;i++) 　　this[i+1]=date.arguments } 　　var d=new date("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); 　　document．write( 　　"&lt;font color=##000000 style=''font-size:9pt;font-family: 宋体''&gt; ", 　　today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日", 　　d[today.getDay()+1],"&lt;/font&gt;" ); 　　&lt;/script&gt; </P>
<P>14．不同时间段显示不同问候语 </P>
<P>　　&lt;Script Language="javascript"&gt; 　　&lt;!-- 　　var text=""; day = new Date( ); time = day.getHours( ); 　　if (( time&gt;=0) &amp;&amp; (time &lt; 7 )) 　　　　text="夜猫子，要注意身体哦！ " 　　if (( time &gt;= 7 ) &amp;&amp; (time &lt; 12)) 　　　　text="今天天气……哈哈哈，不去玩吗？" 　　if (( time &gt;= 12) &amp;&amp; (time &lt; 14)) 　　　　text="午休时间哦，朋友一定是不习惯午睡的吧？！" 　　if (( time &gt;=14) &amp;&amp; (time &lt; 18)) 　　　　text="下午茶的时间到了，休息一下吧！ " 　　if ((time &gt;= 18) &amp;&amp; (time &lt;= 22)) 　　　　text="您又来了，可别和MM聊太久哦！" 　　if ((time &gt;= 22) &amp;&amp; (time &lt; 24)) 　　　　text="很晚了哦，注意休息呀！" 　　document．write(text) 　　//---&gt; 　　&lt;/Script&gt; </P>
<P>15．水中倒影效果 </P>
<P>　　&lt;img id="reflect" src="你自己的图片文件名" width="175" height="59"&gt; 　　&lt;script language="javascript"&gt; 　　function f1() 　　{ 　　　　setInterval("mdiv.filters.wave.phase+=10",100); 　　} 　　if (document．all) 　　{ 　　　　document．write(''&lt;img id=mdiv src="''+document．all.reflect.src+''" 　　　　style="filter:wave(strength=3,freq=3,phase=0,lightstrength=30) blur() flipv()"&gt;'') 　　　　window.onload=f1 　　} 　　&lt;/script&gt; </P>
<P>16．慢慢变大的窗口 </P>
<P>　　&lt;Script Language="javascript"&gt; 　　&lt;!-- 　　var Windowsheight=100 　　var Windowswidth=100 　　var numx=5 　　function openwindow(thelocation){ 　　temploc=thelocation 　　if 　　(!(window.resizeTo&amp;&amp;document．all)&amp;&amp;!(window.resizeTo&amp;&amp;document．getElementById)) 　　{ 　　　　window.open(thelocation) 　　　　return 　　} 　　windowsize=window.open("","","scrollbars") 　　windowsize.moveTo(0,0) 　　windowsize.resizeTo(100,100) 　　tenumxt() 　　} 　　function tenumxt(){ 　　if (Windowsheight&gt;=screen.availHeight-3) 　　　　numx=0 　　windowsize.resizeBy(5,numx) 　　Windowsheight+=5 　　Windowswidth+=5 　　if (Windowswidth&gt;=screen.width-5) 　　{ 　　　　windowsize.location=temploc 　　　　Windowsheight=100 　　　　Windowswidth=100 　　　　numx=5 　　　　return 　　} 　　setTimeout("tenumxt()",50) 　　} 　　//--&gt; 　　&lt;/script&gt; 　　&lt;p&gt;&lt;a href="javascript：openwindow(<A href="http://www.xxx.com/"><FONT color=#1a8bc8>http://www.xxx.com</FONT></A>)"&gt;进入&lt;/a&gt; </P>
<P>17．改变IE地址栏的IE图标 </P>
<P>　　我们要先做一个16*16的icon（图标文件），保存为index.ico。把这个图标文件上传到根目录下并在首页&lt;head&gt;&lt;/head&gt;之间加上如下代码：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link REL = "Shortcut Icon" href="/index.ico"&gt;<BR></P><img src ="http://www.cnitblog.com/haqian/aggbug/5355.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/haqian/" target="_blank">哈欠</a> 2005-12-14 10:18 <a href="http://www.cnitblog.com/haqian/archive/2005/12/14/5355.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ServerVariables 集合环境变量列表 </title><link>http://www.cnitblog.com/haqian/archive/2005/12/14/5353.html</link><dc:creator>哈欠</dc:creator><author>哈欠</author><pubDate>Wed, 14 Dec 2005 01:32:00 GMT</pubDate><guid>http://www.cnitblog.com/haqian/archive/2005/12/14/5353.html</guid><wfw:comment>http://www.cnitblog.com/haqian/comments/5353.html</wfw:comment><comments>http://www.cnitblog.com/haqian/archive/2005/12/14/5353.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/haqian/comments/commentRss/5353.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/haqian/services/trackbacks/5353.html</trackback:ping><description><![CDATA[<P>语法 <BR>Request.ServerVariables(server environment variable) <BR> <BR>参数 <BR>服务器环境变量 <BR>指定要检索的服务器环境变量名。可以使用下面列出的值。 </P>
<P>变量说明 <BR>ALL_HTTP客户端发送的所有HTTP标题文件。 <BR>ALL_RAW检索未处理表格中所有的标题。ALL_RAW和ALL_HTTP不同，ALL_HTTP在标题文件名前面放置HTTP_prefix，并且标题名称总是大写的。使用ALL_RAW时，标题名称和值只在客户端发送时才出现。 <BR>APPL_MD_PATH检索ISAPIDLL的(WAM)Application的元数据库路径。 <BR>APPL_PHYSICAL_PATH检索与元数据库路径相应的物理路径。IIS通过将APPL_MD_PATH转换为物理（目录）路径以返回值。 <BR>AUTH_PASSWORD该值输入到客户端的鉴定对话中。只有使用基本鉴定时，该变量才可用。 <BR>AUTH_TYPE这是用户访问受保护的脚本时，服务器用于检验用户的验证方法。 <BR>AUTH_USER未被鉴定的用户名。 <BR>CERT_COOKIE客户端验证的唯一ID，以字符串方式返回。可作为整个客户端验证的签字。 <BR>CERT_FLAGS如有客户端验证，则bit0为1。 <BR>如果客户端验证的验证人无效（不在服务器承认的CA列表中），bit1被设置为1。 <BR> <BR>CERT_ISSUER用户验证中的颁布者字段（O=MS，OU=IAS，CN=username，C=USA）。 <BR>CERT_KEYSIZE安全套接字层连接关键字的位数，如128。 <BR>CERT_SECRETKEYSIZE服务器验证私人关键字的位数。如1024。 <BR>CERT_SERIALNUMBER用户验证的序列号字段。 <BR>CERT_SERVER_ISSUER服务器验证的颁发者字段。 <BR>CERT_SERVER_SUBJECT服务器验证的主字段。 <BR>CERT_SUBJECT客户端验证的主字段。 <BR>CONTENT_LENGTH客户端发出内容的长度。 <BR>CONTENT_TYPE内容的数据类型。同附加信息的查询一起使用，如HTTP查询GET、POST和PUT。 <BR>GATEWAY_INTERFACE服务器使用的CGI规格的修订。格式为CGI/revision。 <BR>HTTP_HeaderName存储在标题文件中的值。未列入该表的标题文件必须以HTTP_作为前缀，以使ServerVariables集合检索其值。 <BR>注意服务器将HeaderName中的下划线（_）解释为实际标题中的破折号。例如，如果您指定HTTP_MY_HEADER，服务器将搜索以MY-HEADER为名发送的标题文件。 <BR> <BR>HTTPS如果请求穿过安全通道（SSL），则返回ON。如果请求来自非安全通道，则返回OFF。 <BR>HTTPS_KEYSIZE安全套接字层连接关键字的位数，如128。 <BR>HTTPS_SECRETKEYSIZE服务器验证私人关键字的位数。如1024。 <BR>HTTPS_SERVER_ISSUER服务器验证的颁发者字段。 <BR>HTTPS_SERVER_SUBJECT服务器验证的主字段。 <BR>INSTANCE_ID文本格式IIS实例的ID。如果实例ID为1，则以字符形式出现。使用该变量可以检索请求所属的（元数据库中）Web服务器实例的ID。 <BR>INSTANCE_META_PATH响应请求的IIS实例的元数据库路径。 <BR>LOCAL_ADDR返回接受请求的服务器地址。如果在绑定多个IP地址的多宿主机器上查找请求所使用的地址时，这条变量非常重要。 <BR>LOGON_USER用户登录WindowsNT?的帐号。 <BR>PATH_INFO客户端提供的额外路径信息。可以使用这些虚拟路径和PATH_INFO服务器变量访问脚本。如果该信息来自URL，在到达CGI脚本前就已经由服务器解码了。 <BR>PATH_TRANSLATEDPATH_INFO转换后的版本，该变量获取路径并进行必要的由虚拟至物理的映射。 <BR>QUERY_STRING查询HTTP请求中问号（?）后的信息。 <BR>REMOTE_ADDR发出请求的远程主机的IP地址。 <BR>REMOTE_HOST发出请求的主机名称。如果服务器无此信息，它将设置为空的MOTE_ADDR变量。 <BR>REMOTE_USER用户发送的未映射的用户名字符串。该名称是用户实际发送的名称，与服务器上验证过滤器修改过后的名称相对。 <BR>REQUEST_METHOD该方法用于提出请求。相当于用于HTTP的GET、HEAD、POST等等。 <BR>SCRIPT_NAME执行脚本的虚拟路径。用于自引用的URL。 <BR>SERVER_NAME出现在自引用UAL中的服务器主机名、DNS化名或IP地址。 <BR>SERVER_PORT发送请求的端口号。 <BR>SERVER_PORT_SECURE包含0或1的字符串。如果安全端口处理了请求，则为1，否则为0。 <BR>SERVER_PROTOCOL请求信息协议的名称和修订。格式为protocol/revision。 <BR>SERVER_SOFTWARE应答请求并运行网关的服务器软件的名称和版本。格式为name/version。 <BR>URL提供URL的基本部分。 <BR><BR>例子: <BR>Request.ServerVariables["REMOTE_ADDR"] <BR><BR>就是显示访问者的IP</P><img src ="http://www.cnitblog.com/haqian/aggbug/5353.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/haqian/" target="_blank">哈欠</a> 2005-12-14 09:32 <a href="http://www.cnitblog.com/haqian/archive/2005/12/14/5353.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>