﻿<?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>博客园-Smīlě︷</title><link>http://www.cnblogs.com/angelfeather/</link><description>VS2005.NET </description><language>zh-cn</language><lastBuildDate>Fri, 05 Sep 2008 15:22:52 GMT</lastBuildDate><pubDate>Fri, 05 Sep 2008 15:22:52 GMT</pubDate><ttl>60</ttl><item><title>[推荐]13款js编辑器大全</title><link>http://www.cnblogs.com/angelfeather/archive/2008/07/09/1238823.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Wed, 09 Jul 2008 05:02:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/07/09/1238823.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1238823.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/07/09/1238823.html#Feedback</comments><slash:comments>29</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1238823.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1238823.html</trackback:ping><description><![CDATA[<OL>
<LI><FONT size=2>非常实用的163邮箱编辑器<BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://bbs.80nian.net/attachments/forumid_2/20080529_4125402608cf245de7a3Lx368DF7dEi2.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0 mce_src="http://bbs.80nian.net/attachments/forumid_2/20080529_4125402608cf245de7a3Lx368DF7dEi2.jpg"> <BR><BR><BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://bbs.80nian.net/images/attachicons/rar.gif" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0 mce_src="http://bbs.80nian.net/images/attachicons/rar.gif"> </FONT><A href="http://bbs.80nian.net/attachment.php?aid=21&amp;k=2b89910b46f7b157e86b635a41a3b3f5&amp;t=1212304753" target=_blank mce_href="http://bbs.80nian.net/attachment.php?aid=21&amp;k=2b89910b46f7b157e86b635a41a3b3f5&amp;t=1212304753"><B><FONT color=#0000ff size=2>new163Editor.rar</FONT></B></A><FONT size=2> (395.12 KB) <BR><BR>2 <FONT color=#810081>soEditor v 2.5 lite</FONT> <BR></LI></OL></FONT>
<P><BR><BR><FONT size=2>官方: </FONT><A href="http://www.siteobjects.com/pages/index.cfm" target=_blank mce_href="http://www.siteobjects.com/pages/index.cfm"><FONT color=#0000ff size=2>http://www.siteobjects.com/pages/index.cfm</FONT></A><BR><FONT size=2>下载: </FONT><A href="http://www.siteobjects.com/pages/order.cfm" target=_blank mce_href="http://www.siteobjects.com/pages/order.cfm"><FONT color=#0000ff size=2>http://www.siteobjects.com/pages/order.cfm</FONT></A><BR><FONT size=2>可以下载的是lite版, 目前还没找到pro版的. 可以支持ASP,Coldfusion,ASP.NET.<BR>界面做的很整洁,但没有文件管理,最大的问题是对于直接从其他处复制来的图片<BR>不会做自动修正.当然这个也仁者见仁了.<BR>soEditor 2.5 is an extremely powerful browser-based WYSIWYG content authoring tool </FONT></P>
<P><FONT size=2>designed specifically for dynamic web applications. This customizable editor allows </FONT></P>
<P><FONT size=2>developers to make it possible for anyone to create, edit and maintain web content </FONT></P>
<P><FONT size=2>without the need for HTML knowledge or programming expertise.<BR><BR><BR><BR>3 <FONT color=#810081>AreaEdit V 0.4.2</FONT> <BR><BR>演示: </FONT><A href="http://www.formvista.com/uploaded_html/demos/areaedit/examples/simple_example.php" target=_blank mce_href="http://www.formvista.com/uploaded_html/demos/areaedit/examples/simple_example.php"><FONT color=#0000ff size=2>http://www.formvista.com/uploaded_html/demos/areaedit/examples/simple_example.php</FONT></A><BR><FONT size=2>下载: </FONT><A href="http://www.formvista.com/goalTracker/stream_download.php/14/areaedit_0.4.3.tar.gz" target=_blank mce_href="http://www.formvista.com/goalTracker/stream_download.php/14/areaedit_0.4.3.tar.gz"><FONT color=#0000ff size=2>http://www.formvista.com/goalTracker/stream_download.php/14/areaedit_0.4.3.tar.gz</FONT></A><BR><FONT size=2>支持: </FONT><A href="http://www.formvista.com/forum" target=_blank mce_href="http://www.formvista.com/forum"><FONT color=#0000ff size=2>http://www.formvista.com/forum</FONT></A><BR><FONT size=2>修改htmlarea的编辑器增加了图片文件管理器 <BR>htmlarea 作为在线编辑器领域的开源作品享有不错的知名度<BR>有很多的支持者和插件开发者,这些都得益于html良好的扩展性.<BR>AreaEdit is a formVista compatible fork of the rapidly developing Xinha project. </FONT></P>
<P><FONT size=2>It is the code that is generated by the formVista FVML &lt;htmleditor&gt; tag during rendering. <BR><BR>Xinha itself is a fork of the original HTMLArea component created by Mihai Bazon and </FONT></P>
<P><FONT size=2>sponsored by Interactivetools. AreaEdit maintains the original HTMLArea (modified BSD) </FONT></P>
<P><FONT size=2>license and is free to use. <BR><BR>While it is designed to work within formVista without modification, AreaEdit does not </FONT></P>
<P><FONT size=2>requre formVista. It is a fully functional editor component supporting a number of </FONT></P>
<P><FONT size=2>plugins and can as easily be used as a standalone editor component for any PHP web </FONT></P>
<P><FONT size=2>application. <BR><BR>The primary difference between AreaEdit and Xinha is one of focus. The Xinha project </FONT></P>
<P><FONT size=2>aims to be a rapidly developing feature-filled editor with many plugins.<BR><BR>By contrast, AreaEdit takes a slower minimalists approach. It aims first and foremost </FONT></P>
<P><FONT size=2>to be functional and maintainable. The feature set we are focusing on is targeted </FONT></P>
<P><FONT size=2>squarely at the serious non-technical business user. Business users don't care </FONT></P>
<P><FONT size=2>about the nuances of HTML &lt;br&gt; and &lt;p&gt; tags, they just want the editor to work as </FONT></P>
<P><FONT size=2>they would expect.<BR><BR>If your audience is primarly composed to developers or those familar with HTML, you</FONT></P>
<P><FONT size=2>&nbsp;should take a look at Xinha.<BR><BR>AreaEdit is known to work with MSIE 5.5 or later and any modern Gecko based </FONT></P>
<P><FONT size=2>browsers. (FireFox, Mozilla). <BR><BR>4 <FONT color=#810081>DevEdit Version 5.0.1 破解版</FONT> <BR><BR>官方网站: </FONT><A href="http://www.interspire.com/" target=_blank mce_href="http://www.interspire.com/"><FONT color=#0000ff size=2>http://www.interspire.com</FONT></A><BR><FONT size=2>演示: </FONT><A href="http://www.interspire.com/devedit/demo.php" target=_blank mce_href="http://www.interspire.com/devedit/demo.php"><FONT color=#0000ff size=2>http://www.interspire.com/devedit/demo.php</FONT></A><BR><FONT size=2>下载: </FONT><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/devedit.rar" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/devedit.rar"><FONT color=#0000ff size=2>http://bbs.80nian.net/thread-259-1-1.html?acdt=/devedit.rar</FONT></A><BR><FONT size=2><FONT color=#a52a2a>警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题本站概不负责</FONT><BR><FONT color=#a52a2a></FONT><BR><FONT color=#a52a2a></FONT><BR><FONT color=#a52a2a>5 <FONT color=#0000ff>Web Wiz Rich Text Editor v3.0</FONT><FONT color=#000000> </FONT></FONT><BR><BR>下载: </FONT><A href="http://www.webwizguide.info/asp/sample_scripts/RTE_application.asp" target=_blank mce_href="http://www.webwizguide.info/asp/sample_scripts/RTE_application.asp"><FONT color=#0000ff size=2>http://www.webwizguide.info/asp/sample_scripts/RTE_application.asp</FONT></A><BR><FONT size=2>演示: </FONT><A href="http://www.richtexteditor.org/demo/" target=_blank mce_href="http://www.richtexteditor.org/demo/"><FONT color=#0000ff size=2>http://www.richtexteditor.org/demo/</FONT></A><BR><FONT size=2>支持在线文件管理,跨浏览器,但对表格编辑功能不强,界面不够精致<BR><BR><BR>6 <FONT color=#810081>KTML.Pro.v3.5.6-SPK100</FONT> <BR><BR>下载: </FONT><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/KTML_PRO-3.5.6.ZIP" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/KTML_PRO-3.5.6.ZIP"><FONT color=#0000ff size=2>http://bbs.80nian.net/thread-259-1-1.html?acdt=/KTML_PRO-3.5.6.ZIP</FONT></A><BR><FONT size=2><FONT color=#a52a2a>警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题概不负责.</FONT><BR>有着类似dw一样的属性栏,这个是pro版,提供了lite版没有的对表格的属性编辑等功能,</FONT></P>
<P><FONT size=2>有兴趣的可以去官方看看lite版.<BR><BR><BR>7 <FONT color=#0000ff>TextArea Rich v3.0</FONT> <BR>下载: </FONT><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/textarea.rich.v3.0.rar" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/textarea.rich.v3.0.rar"><FONT color=#0000ff size=2>http://bbs.80nian.net/thread-259-1-1.html?acdt=/textarea.rich.v3.0.rar</FONT></A><BR><FONT size=2>做的很干净的编辑器,适合于CMS.功能强大.<BR><BR><BR>8 <B>Tabula WYSIWYG HTML editor ver. 2.2</B><BR><BR>演示: </FONT><A href="http://www.tabula.biz/showArticle.asp?articleid=253" target=_blank mce_href="http://www.tabula.biz/showArticle.asp?articleid=253"><FONT color=#0000ff size=2>http://www.tabula.biz/showArticle.asp?articleid=253</FONT></A><BR><FONT size=2>下载: </FONT><A href="http://www.tabula.biz/ShowArticle.asp?MID=5&amp;ArticleID=257" target=_blank mce_href="http://www.tabula.biz/ShowArticle.asp?MID=5&amp;ArticleID=257"><FONT color=#0000ff size=2>http://www.tabula.biz/ShowArticle.asp?MID=5&amp;ArticleID=257</FONT></A><BR><FONT size=2>和ewebsoft很像的编辑器右键功能强悍,界面做的稍稍差了点点：）<BR><BR>9 <B>TinyMCE 2.0RC3</B><BR><BR>官方网站: </FONT><A href="http://tinymce.moxiecode.com/" target=_blank mce_href="http://tinymce.moxiecode.com/"><FONT color=#0000ff size=2>http://tinymce.moxiecode.com/</FONT></A><BR><FONT size=2>官方演示: </FONT><A href="http://tinymce.moxiecode.com/example_full.php?example=true" target=_blank mce_href="http://tinymce.moxiecode.com/example_full.php?example=true"><FONT color=#0000ff size=2>http://tinymce.moxiecode.com/example_full.php?example=true</FONT></A><BR><FONT size=2>下载: </FONT><A href="http://keihanna.dl.sourceforge.net/sourceforge/tinymce/tinymce_2_0RC3.zip" target=_blank mce_href="http://keihanna.dl.sourceforge.net/sourceforge/tinymce/tinymce_2_0RC3.zip"><FONT color=#0000ff size=2>http://keihanna.dl.sourceforge.net/sourceforge/tinymce/tinymce_2_0RC3.zip</FONT></A><BR><FONT size=2>有一个很好的开源编辑器,界面,功能和可扩展性做的都很好<BR><BR><BR>10 <B>网页在线编辑器 mEditor ASP 中文版 v2.0</B><BR><BR>下载: </FONT><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/meditor.zip" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/meditor.zip"><FONT color=#0000ff size=2>http://bbs.80nian.net/thread-259-1-1.html?acdt=/meditor.zip</FONT></A><BR><BR><BR><BR><FONT size=2>运行环境支持:<BR>操作系统支持: Windows 2000 系列 / Window Xp 系列 / Window 2003 系列<BR>网络服务器支持: <BR>Asp 版本要求安装IIS 5.0版本或更高版本<BR><BR>浏览器支持: 正常运行在IE5.5以上版本,部分特殊功能要求IE版本升级到6.0以才能使用<BR><BR>&gt;&gt;&gt; 在网络服务器设置完成后,运行index.asp进行样式管理.<BR>&gt;&gt;&gt; 建议将mEditor放在项目的根目录.<BR><BR>注意事项 有关无组件上传类<BR><BR>v2.0 升级事项<BR>1.修正内核部分字符编码的问题.<BR>2.增强系统运行的健壮性与稳定性.<BR>3.增加了"模式按钮"栏式管理,可随意启用/取消模式按钮.<BR>4.在编辑器的样式上进行了整体的修改.<BR>5.增加了编辑器的缩放功能,仅适用于IE5.5以上版本.<BR>6.增加了"搜索替换"功能(快捷键CTRL+R),仅适用于IE5.5以上版本.<BR>7.将部分功能移植到"代码模式"使用,如:"全选","删除","复制".....<BR>8.增加快捷键CTRL+1(预览模式),CTRL+2(代码模式),CTRL+3(视图模式),CTRL+R(查找替换).<BR><BR>11 </FONT><FONT size=2><B>EWELive JScript Editor 0.4<BR>6</B><BR><BR>下载:&nbsp;&nbsp;</FONT><A href="http://www.ewelive.com/downloads/0_64_JS.zip" target=_blank mce_href="http://www.ewelive.com/downloads/0_64_JS.zip"><FONT color=#0000ff size=2>http://www.ewelive.com/downloads/0_64_JS.zip</FONT></A><BR><BR><FONT size=2>我曾经仔细的去汉化过这个版本的编辑器,加了一些自己的界面设计和按钮.<BR>速度很快,功能简单使用,容易修改. 对于喜欢简单一族的朋友可以下来看看.<BR>官方: </FONT><A href="http://www.ewelive.com/" target=_blank mce_href="http://www.ewelive.com/"><FONT color=#0000ff size=2>http://www.ewelive.com</FONT></A><BR><FONT size=2>演示: </FONT><A href="http://www.ewelive.com/demo_js/sample.php" target=_blank mce_href="http://www.ewelive.com/demo_js/sample.php"><FONT color=#0000ff size=2>http://www.ewelive.com/demo_js/sample.php</FONT></A><BR><BR><BR><FONT size=2>12 <B>InnovaStudio WYSIWYG Editor v2.3</B><BR><BR><FONT color=#a52a2a>警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题概不负责.</FONT><BR>界面做的很是精细, 功能极强大,非常优秀之作,强烈推荐<BR>下载<BR></FONT><A href="http://www225.fixdown.com/code/sp-iwe23.rar" target=_blank mce_href="http://www225.fixdown.com/code/sp-iwe23.rar"><FONT color=#0000ff size=2>http://www225.fixdown.com/code/sp-iwe23.rar</FONT></A><BR><BR><FONT size=2>13 <B>CuteEditor for ASP Enterprise License</B><BR><FONT color=#a52a2a>警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题概不负责.</FONT><BR>Cuteditor 我曾研究过,不亏为成熟的商业作品,各方面做的都很规范,功能强大,也提供简体中文语言包,</FONT></P>
<P><FONT size=2>个人非常喜欢.强烈推荐 <BR><FONT color=#0000ff></FONT><BR></FONT><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar"><FONT color=#0000ff></FONT></A><FONT color=#0000ff size=2>下载: </FONT><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar"><FONT color=#0000ff size=2>http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar</FONT></A><A href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar" target=_blank mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar"><FONT color=#0000ff></FONT></A><BR><FONT color=#0000ff></FONT><BR><BR><FONT size=2>14 </FONT><B><FONT size=2>FCKeditor 2.6 精简版第三版新增表格功能<BR><BR><BR></FONT><A href="http://bbs.80nian.net/viewthread.php?tid=158&amp;highlight=FC" target=_blank mce_href="http://bbs.80nian.net/viewthread.php?tid=158&amp;highlight=FC"><FONT color=#810081 size=2>http://bbs.80nian.net/viewthread.php?tid=158&amp;highlight=FC</FONT></A></B><BR></P><img src ="http://www.cnblogs.com/angelfeather/aggbug/1238823.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42116/" target="_blank">[新闻]消息称MySQL创始人已向Sun提交辞呈</a>]]></description></item><item><title>web标准 CSS Sprites</title><link>http://www.cnblogs.com/angelfeather/archive/2008/07/08/1238121.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Tue, 08 Jul 2008 05:40:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/07/08/1238121.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1238121.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/07/08/1238121.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1238121.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1238121.html</trackback:ping><description><![CDATA[<DIV class=entry>
<P>CSS Sprites技术不新鲜，早在2005年 <A href="http://csszengarden.com/">CSS Zengarden</A> 的园主 <A href="http://www.mezzoblue.com/">Dave Shea</A>就在<A href="http://www.alistapart.com/">ALA</A>发表对该技术的<A href="http://www.alistapart.com/articles/sprites">详细阐述</A>。原先只在CSS玩家之间作为一种制作方法流传，后来出来个<A href="http://stevesouders.com/examples/rules.php">14 Rules for Faster-Loading Web Sites</A>, 技术人员之间竞相传阅，其中第一条规则Make Fewer HTTP Requests就提到CSS Sprites。于是这个小妖精就火了起来，甚至出现了<A href="http://www.csssprites.com/">在线生成工具</A>，势不可挡也。近来国内很多blog都提到CSS Sprites，最著名的例子莫过于 <A href="http://www.google.co.kr/">http://www.google.co.kr/</A> 下方的那几个动画。最新发布的YUI中，也是使用到CSS Sprites，几乎都有的CSS装饰图都被一个<A href="http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png">40×2000的图</A>包办。社交大站Facebook最近也使用了一个<A href="http://static.ak.facebook.com/images/sprite/icons.png?db3">22×1150的图片</A>承担了所有icon. 一时间，CSS Sprites无处不在。</P>
<H2>原理</H2>
<P>我们知道，自CSS革命以降，HTML倾向于语义化，在一般情况下不再在标记里写装饰性的内容而是把呈现的任务交给了CSS。GUI是缤纷多彩的，少不了各种漂亮的图来装点。新时代的生产方式是，在HTML布满各种各样的钩子（hook），然后交由CSS来处理。在需要用到图片的时候，现阶段是通过CSS属性<CODE>background-image</CODE>组合<CODE>background-repeat</CODE>, <CODE>background-position</CODE>等来实现（题外话：为何我提现阶段，因为未来浏览器若支持<CODE>content</CODE>则又新增另外的实现方法）。我们的主角是，你一定猜到了，就是<CODE>background-position</CODE>。通过调整<CODE>background-position</CODE>的数值，背景图片就能以不同的面貌出现在你眼前。其实图片整体面貌没有变，由于图片位置的改变，你看到只该看到的而已。就好比手表上的日期，你今天看到是21，明天看到是22，是因为它的<STRONG>position</STRONG>往上跳了一格。所以你也大概了解到，CSS Sprites一般只能使用到固定大小的盒子（box）里，这样才能够遮挡住不应该看到的部分。</P>
<P>我们使用YUI的sprite.png举个例子，假如我们有这么一段代码，<CODE>max</CODE>代表最大化，<CODE>min</CODE>代表最小化，我们需要给它们配上相应的漂亮图片（这样我们的网站才能够吸引人，才可以卖钱，才可以到佛罗里达晒太阳:D）：</P><PRE><CODE>&lt;div class="max"&gt;最大化&lt;/div&gt;
&lt;div class="min"&gt;最小化&lt;/div&gt;</CODE></PRE>
<P>这两个<CODE>class</CODE>都使用同一个图片：</P><PRE><CODE>.min, .max {
  width:16px;
  height:16px;
  background-image:url(http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png);
  background-repeat: no-repeat; /*我们并不想让它平铺*/
  text-indent:-999em; /*隐藏文本的一种方法*/
}</CODE></PRE>
<P>效果如下：</P>
<DIV style="MARGIN-LEFT: 3em">
<DIV class=max style="BACKGROUND-IMAGE: url(http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png); WIDTH: 16px; TEXT-INDENT: -999em; BACKGROUND-REPEAT: no-repeat; HEIGHT: 16px">最大化</DIV>
<DIV class=min style="BACKGROUND-IMAGE: url(http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png); WIDTH: 16px; TEXT-INDENT: -999em; BACKGROUND-REPEAT: no-repeat; HEIGHT: 16px">最小化</DIV></DIV>
<P>我们看到一团灰，没错，因为我们还没有指定<CODE>background-position</CODE>，默认为 <CODE>0 0</CODE>，可以看下<A href="http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png">sprite.png</A>, 处于这个位置正是灰块。好了，我们要找到代表最大化的加号和代表最小化的减号的位置找出来。经过测量，最大化按钮位于Y轴的350px处，最小化按钮位于Y轴400px处。想一想我们如何才能让它们能够显示出来呢，明显，要向上提升sprite.png，得到代码如下：</P><PRE><CODE>.max {
  background-position: 0 -350px;
}
.min {
  background-position: 0 -400px;
}</CODE></PRE>
<P>耶，我们成功了：</P>
<DIV style="MARGIN-LEFT: 3em">
<DIV class=max style="BACKGROUND-POSITION: 0px -350px; BACKGROUND-IMAGE: url(http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png); WIDTH: 16px; TEXT-INDENT: -999em; BACKGROUND-REPEAT: no-repeat; HEIGHT: 16px">最大化</DIV>
<DIV class=min style="BACKGROUND-POSITION: 0px -400px; BACKGROUND-IMAGE: url(http://developer.yahoo.com/yui/build/assets/skins/sam/sprite.png); WIDTH: 16px; TEXT-INDENT: -999em; BACKGROUND-REPEAT: no-repeat; HEIGHT: 16px">最小化</DIV></DIV>
<P>（注意：为了举例的方便，本例子直接在HTML内置样式，切勿在实践中的非特殊情况使用这种方式）。</P>
<H2>优点</H2>
<P>我们从前面了解到，CSS Sprites为什么突然跑火，跟能够提升网站性能有关。显而易见，这是它的巨大优点之一。普通制作方式下的大量图片，现在合并成一个图片，大大减少了HTTP的连接数。HTTP连接数对网站的加载性能有重要影响。</P>
<H2>缺点</H2>
<P>至于可维护性，这是一般双刃剑。可能有人喜欢，有人不喜欢，因为每次的图片改动都得往这个图片删除或添加内容，显得稍微繁琐。而且算图片的位置（尤其是这种上千px的图）也是一件颇为不爽的事情。当然，在性能的口号下，这些都是可以克服的。</P>
<P>由于图片的位置需要固定为某个绝对数值，这就失去了诸如<CODE>center</CODE>之类的灵活性。</P>
<P>前面我们也提到了，必须限制盒子的大小才能使用CSS Sprites，否则可能会出现出现干扰图片的情况。这就是说，在一些需要非单向的平铺背景和需要网页缩放的情况下，CSS Sprites并不合适。YUI的解决方式是，加大图片之间的距离，这样可以保持有限度的缩放。</P>
<H2>总结</H2>
<P>性能压倒一切。CSS Sprites是值得推广的一种技术。尤其适宜用于<A href="http://www.alistapart.com/articles/fir/">FIR</A>，比如固定大小的icon替换。为保持兼容性，图片中的各个部分保持一定的距离是一种不错的做法。</P>
<H3>推荐阅读：</H3>
<UL>
<LI><A href="http://www.alistapart.com/articles/sprites">CSS Sprites: Image Slicing’s Kiss of Death</A> 
<LI><A href="http://stevesouders.com/examples/rules.php">14 Rules for Faster-Loading Web Sites</A> 
<LI><A href="http://www.oreilly.com/catalog/9780596529307/index.html">High Performance Web Sites</A> </LI></UL>
<P><STRONG>更新：</STRONG>有网友问到IE6不支持png的问题。其实真相是，IE6不支持的是半透明（alpha transparency）的png，对于全透明的png, IE6并不存在问题。因此，在实践中，不涉及到半透明而需要透明背景的图片，其实都可以使用png, 这是很安全的。</P>
<P class="postmetadata alt"><SMALL>You can follow any responses to this entry through the <A href="http://realazy.org/blog/2007/10/08/css-sprites/feed/">RSS 2.0</A> feed. You can <A href="http://www.cnblogs.com/angelfeather/admin/#respond">leave a response</A>, or <A href="http://realazy.org/blog/2007/10/08/css-sprites/trackback/" rel=trackback>trackback</A> from your own site. </SMALL></P></DIV><img src ="http://www.cnblogs.com/angelfeather/aggbug/1238121.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42115/" target="_blank">[新闻]谷歌Chrome浏览器即将更换LOGO颜色？</a>]]></description></item><item><title>用户控件(.ascx)与网页间(.aspx)如何传值的几种方法</title><link>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225951.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:55:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225951.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225951.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225951.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225951.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225951.html</trackback:ping><description><![CDATA[<P>1.aspx文件:<BR>public void SetLabel(string str)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Label1.Text = str; ;<BR>&nbsp;&nbsp;&nbsp; } <BR>ascx文件;<BR>protected void Button1_Click(object sender, EventArgs e)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Web.UI.Page p = this.Page;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type pageType = p.GetType();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MethodInfo mi = pageType.GetMethod("SetLabel");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mi.Invoke(p, new object[] { "test!!!" });</P>
<P>&nbsp;&nbsp;&nbsp; }</P>
<P>2. 在自定义控件中定义这个控件的属性<BR>&nbsp;&nbsp; public Control LabelText<BR>&nbsp;{<BR>&nbsp; get{return this.Label1.Text;}<BR>&nbsp;}</P>
<P>3用FindControl方法寻找<BR>&nbsp;Label lbl = (Label)WebUserControl1.FindControl("Label1");</P><img src ="http://www.cnblogs.com/angelfeather/aggbug/1225951.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title>彩色验证码</title><link>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225934.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:47:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225934.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225934.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225934.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225934.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225934.html</trackback:ping><description><![CDATA[<P>private void CreateImage(string checkCode)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int iwidth = (int)(checkCode.Length * 15);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Drawing.Bitmap image = new System.Drawing.Bitmap(iwidth, 25);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Graphics g = Graphics.FromImage(image);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.Clear(Color.White);<BR>//定义颜色<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Color[] c = {Color.Black,Color.Red,Color.DarkBlue,Color.Green,Color.Orange,Color.Brown,Color.DarkCyan,Color.Purple};<BR>//定义字体&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string[] font = {"Verdana","Microsoft Sans Serif","Comic Sans MS","Arial","宋体"};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Random rand = new Random();<BR>//随机输出噪点<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i=0;i&lt;50;i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int x = rand.Next(image.Width);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int y = rand.Next(image.Height);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawRectangle(new Pen(Color.LightGray, 0),x,y,1,1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>//输出不同字体和颜色的验证码字符<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i=0;i&lt;checkCode.Length;i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int cindex = rand.Next(7);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int findex = rand.Next(5);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Font f = new System.Drawing.Font(font[findex], 10, System.Drawing.FontStyle.Bold);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Brush b = new System.Drawing.SolidBrush(c[cindex]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int ii=4;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if((i+1)%2==0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ii=2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawString(checkCode.Substring(i,1), f, b, 3+(i*12), ii);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>//画一个边框<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawRectangle(new Pen(Color.Black,0),0,0,image.Width-1,image.Height-1);</P>
<P>//输出到浏览器<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IO.MemoryStream ms = new System.IO.MemoryStream();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image.Save(ms,System.Drawing.Imaging.ImageFormat.Jpeg);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.ClearContent();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.ContentType = "image/Jpeg";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.BinaryWrite(ms.ToArray());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.Dispose();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image.Dispose();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>&nbsp;<BR>&nbsp;<img src ="http://www.cnblogs.com/angelfeather/aggbug/1225934.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title>一段常用的Page_Load事件 (如果有更好的希望大家留言)</title><link>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225931.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:46:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225931.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225931.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225931.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225931.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225931.html</trackback:ping><description><![CDATA[protected void Page_Load(object sender, EventArgs e) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;　SqlConnection myConnection = new SqlConnection("server=Localhost;database=pubs;uid=sa;pwd=;");//创建SQL连接 <BR>&nbsp;&nbsp;　SqlCommand myCommand = new SqlCommand("SELECT title, price FROM Titles WHERE price ＞ 0", myConnection);//创建SQL命令 <BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;　try <BR>&nbsp;&nbsp;　{ <BR>&nbsp;&nbsp;　　myConnection.Open();//打开数据库连接 <BR>&nbsp;&nbsp;　　MyGrid.DataSource = myCommand.ExecuteReader();//指定 DataGrid 的数据源 <BR>&nbsp;&nbsp;　　MyGrid.DataBind();//绑定数据到 DataGrid <BR>&nbsp;&nbsp;　　myConnection.Close();//关闭数据连接 <BR>&nbsp;&nbsp;　} <BR>&nbsp;&nbsp;　catch(Exception ex) <BR>&nbsp;&nbsp;　{ <BR>&nbsp;&nbsp;　　//捕获错误 <BR>&nbsp;&nbsp;　　HttpContext.Current.Response.Write(ex.ToString()); <BR>&nbsp;&nbsp;　} <BR>&nbsp;&nbsp;}&nbsp;<img src ="http://www.cnblogs.com/angelfeather/aggbug/1225931.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title> c#.net常用函数和方法集</title><link>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225926.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:44:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225926.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225926.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225926.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225926.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225926.html</trackback:ping><description><![CDATA[<DIV class=postTitle><STRONG>1、DateTime 数字型 </STRONG><BR>System.DateTime currentTime=new System.DateTime(); <BR>1.1 取当前年月日时分秒 <BR>currentTime=System.DateTime.Now; <BR>1.2 取当前年 <BR>int 年=currentTime.Year; <BR>1.3 取当前月 <BR>int 月=currentTime.Month; <BR>1.4 取当前日 <BR>int 日=currentTime.Day; <BR>1.5 取当前时 <BR>int 时=currentTime.Hour; <BR>1.6 取当前分 <BR>int 分=currentTime.Minute; <BR>1.7 取当前秒 <BR>int 秒=currentTime.Second; <BR>1.8 取当前毫秒 <BR>int 毫秒=currentTime.Millisecond; <BR>（变量可用中文） </DIV>
<DIV class=postText>
<P><STRONG>2、Int32.Parse(变量) Int32.Parse("常量") </STRONG><BR>字符型转换 转为32位数字型 </P>
<P><STRONG>3、 变量.ToString() <BR></STRONG>字符型转换 转为字符串 <BR>12345.ToString("n"); //生成 12,345.00 <BR>12345.ToString("C"); //生成 ￥12,345.00 <BR>12345.ToString("e"); //生成 1.234500e+004 <BR>12345.ToString("f4"); //生成 12345.0000 <BR>12345.ToString("x"); //生成 3039 (16进制) <BR>12345.ToString("p"); //生成 1,234,500.00% </P>
<P><BR><STRONG>4、变量.Length 数字型 </STRONG><BR>取字串长度： <BR>如： string str="中国"; <BR>int Len = str.Length ; //Len是自定义变量， str是求测的字串的变量名 </P>
<P><STRONG>5、System.Text.Encoding.Default.GetBytes(变量) <BR></STRONG>字码转换 转为比特码 <BR>如：byte[] bytStr = System.Text.Encoding.Default.GetBytes(str); <BR>然后可得到比特长度： <BR>len = bytStr.Length; </P>
<P><STRONG>6、System.Text.StringBuilder("") </STRONG><BR>字符串相加，（+号是不是也一样？） <BR>如：System.Text.StringBuilder sb = new System.Text.StringBuilder(""); <BR>sb.Append("中华"); <BR>sb.Append("人民"); <BR>sb.Append("共和国"); </P>
<P><STRONG>7、变量.Substring(参数1,参数2); <BR></STRONG>截取字串的一部分，参数1为左起始位数，参数2为截取几位。 <BR>如：string s1 = str.Substring(0,2); </P>
<P><STRONG>8、String user_IP=Request.ServerVariables["REMOTE_ADDR"].ToString(); </STRONG><BR>取远程用户IP地址 </P>
<P><STRONG>9、穿过代理服务器取远程用户真实IP地址： <BR></STRONG>if(Request.ServerVariables["HTTP_VIA"]!=null){ <BR>string user_IP=Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); <BR>}else{ <BR>string user_IP=Request.ServerVariables["REMOTE_ADDR"].ToString(); <BR>} <BR><BR><STRONG>10、 Session["变量"]; </STRONG><BR>存取Session值； <BR>如，赋值： Session["username"]="小布什"; </P>
<P>取值： Object objName=Session["username"]; <BR>String strName=objName.ToString(); <BR>清空： Session.RemoveAll(); </P>
<P><STRONG>11、String str=Request.QueryString["变量"]; </STRONG><BR>用超链接传送变量。 <BR>如在任一页中建超链接:&lt;a href=Edit.aspx?fbid=23&gt;点击&lt;/a&gt; <BR>在Edit.aspx页中取值：String str=Request.QueryString["fdid"]; </P>
<P><STRONG>12、DOC对象.CreateElement("新建节点名"); </STRONG><BR>创建XML文档新节点 </P>
<P><STRONG>13、父节点.AppendChild(子节点)； </STRONG><BR>将新建的子节点加到XML文档父节点下 </P>
<P><STRONG>14、 父节点.RemoveChild(节点); </STRONG><BR>删除节点 </P>
<P><STRONG>15、Response </STRONG><BR>Response.Write("字串")； <BR>Response.Write(变量)； <BR>向页面输出。 </P>
<P>Response.Redirect("URL地址"）； <BR>跳转到URL指定的页面 </P>
<P><STRONG>16、char.IsWhiteSpce(字串变量，位数)——逻辑型 </STRONG><BR>查指定位置是否空字符； <BR>如： <BR>string str="中国 人民"; <BR>Response.Write(char.IsWhiteSpace(str,2)); //结果为：True, 第一个字符是0位，2是第三个字符。 </P>
<P><STRONG>17、char.IsPunctuation('字符') --逻辑型 </STRONG><BR>查字符是否是标点符号 <BR>如：Response.Write(char.IsPunctuation('A')); //返回：False </P>
<P><STRONG>18、(int)'字符' <BR></STRONG>把字符转为数字，查代码点，注意是单引号。 <BR>如： <BR>Response.Write((int)'中'); //结果为中字的代码：20013 </P>
<P><STRONG>19、(char)代码 <BR></STRONG>把数字转为字符，查代码代表的字符。 <BR>如： <BR>Response.Write((char)22269); //返回“国”字。 <BR><BR><STRONG>20、 Trim() <BR></STRONG>清除字串前后空格 </P>
<P><STRONG>21 、字串变量.Replace("子字串","替换为") </STRONG><BR>字串替换 <BR>如： <BR>string str="中国"; <BR>str=str.Replace("国","央"); //将国字换为央字 <BR>Response.Write(str); //输出结果为“中央” </P>
<P>再如：（这个非常实用） </P>
<P>string str="这是&lt;script&gt;脚本"; <BR>str=str.Replace("&lt;","&lt;font&gt;&lt;&lt;/font&gt;"); //将左尖括号替换为&lt;font&gt; 与 &lt; 与 &lt;/font&gt; （或换为&lt;，但估计经XML存诸后，再提出仍会还原） <BR>Response.Write(str); //显示为：“这是&lt;script&gt;脚本” </P>
<P>如果不替换，&lt;script&gt;将不显示，如果是一段脚本，将运行；而替换后，脚本将不运行。 <BR>这段代码的价值在于：你可以让一个文本中的所有HTML标签失效，全部显示出来，保护你的具有交互性的站点。 <BR>具体实现：将你的表单提交按钮脚本加上下面代码： <BR>string strSubmit=label1.Text; //label1是你让用户提交数据的控件ID。 <BR>strSubmit=strSubmit.Replace("&lt;","&lt;font&gt;&lt;&lt;/font&gt;"); <BR>然后保存或输出strSubmit。 <BR>用此方法还可以简单实现UBB代码。 </P>
<P><STRONG>22、Math.Max(i,j) </STRONG><BR>取i与j中的最大值 <BR>如 int x=Math.Max(5,10); // x将取值 10 </P>
<P>加一点吧 23、字串对比...... <BR>加一点吧 </P>
<P><STRONG>23、字串对比一般都用: if(str1==str2){ } , 但还有别的方法: </STRONG></P>
<P>(1)、 <BR>string str1; str2 <BR>//语法: str1.EndsWith(str2); __检测字串str1是否以字串str2结尾,返回布尔值.如: <BR>if(str1.EndsWith(str2)){ Response.Write("字串str1是以"+str2+"结束的"); } </P>
<P>(2)、 <BR>//语法:str1.Equals(str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. </P>
<P>(3)、 <BR>//语法 Equals(str1,str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. </P>
<P><STRONG>24、IndexOf() 、LastIndexOf() </STRONG><BR>查找字串中指定字符或字串首次（最后一次）出现的位置,返回索引值，如： <BR>str1.IndexOf("字")； //查找“字”在str1中的索引值（位置） <BR>str1.IndexOf("字串")；//查找“字串”的第一个字符在str1中的索引值（位置） <BR>str1.IndexOf("字串",3,2)；//从str1第4个字符起，查找2个字符，查找“字串”的第一个字符在str1中的索引值（位置） </P>
<P><STRONG>25、Insert() </STRONG><BR>在字串中指定索引位插入指定字符。如： <BR>str1.Insert(1,"字");在str1的第二个字符处插入“字”，如果str1="中国"，插入后为“中字国”； </P>
<P><STRONG>26、PadLeft()、PadRight() </STRONG><BR>在字串左（或右）加空格或指定char字符，使字串达到指定长度，如： <BR>&lt;% <BR>string str1="中国人"; <BR>str1=str1.PadLeft(10,'1'); //无第二参数为加空格 <BR>Response.Write(str1); //结果为“1111111中国人” ， 字串长为10 <BR>%&gt; </P>
<P><STRONG>27、Remove() </STRONG><BR>从指定位置开始删除指定数的字符 <BR>字串对比一般都用: if(str1==str2){ } , 但还有别的方法: </P>
<P>1、 <BR>string str1; str2 <BR>//语法: str1.EndsWith(str2); __检测字串str1是否以字串str2结尾,返回布尔值.如: <BR>if(str1.EndsWith(str2)){ Response.Write("字串str1是以"+str2+"结束的"); } </P>
<P>2、 <BR>//语法:str1.Equals(str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. </P>
<P>3、 <BR>//语法 Equals(str1,str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. </P>
<P>IndexOf() <BR>查找字串中指定字符或字串首次出现的位置,返首索引值，如： <BR>str1.IndexOf("字")； //查找“字”在str1中的索引值（位置） <BR>str1.IndexOf("字串")；//查找“字串”的第一个字符在str1中的索引值（位置） <BR>str1.IndexOf("字串",3,2)；//从str1第4个字符起，查找2个字符，查找“字串”的第一个字符在str1中的索引值（位置） </P>
<P>1.9 取中文日期显示——年月日时分 <BR>string strY=currentTime.ToString("f"); //不显示秒 </P>
<P>1.10 取中文日期显示_年月 <BR>string strYM=currentTime.ToString("y"); </P>
<P>1.11 取中文日期显示_月日 <BR>string strMD=currentTime.ToString("m"); </P>
<P>1.12 取当前年月日，格式为：2003-9-23 <BR>string strYMD=currentTime.ToString("d"); </P>
<P>1.13 取当前时分，格式为：14：24 <BR>string strT=currentTime.ToString("t"); <BR>更新一下， 上面不能编辑： </P>
<P><STRONG><U>c#.net函数和方法集(大家一起来加啊) </U></STRONG></P>
<P><BR><STRONG>1、DateTime 数字型 </STRONG><BR>System.DateTime currentTime=new System.DateTime(); <BR>1.1 取当前年月日时分秒 <BR>currentTime=System.DateTime.Now; <BR>1.2 取当前年 <BR>int 年=currentTime.Year; <BR>1.3 取当前月 <BR>int 月=currentTime.Month; <BR>1.4 取当前日 <BR>int 日=currentTime.Day; <BR>1.5 取当前时 <BR>int 时=currentTime.Hour; <BR>1.6 取当前分 <BR>int 分=currentTime.Minute; <BR>1.7 取当前秒 <BR>int 秒=currentTime.Second; <BR>1.8 取当前毫秒 <BR>int 毫秒=currentTime.Millisecond; <BR>（变量可用中文） </P>
<P>1.9 取中文日期显示——年月日时分 <BR>string strY=currentTime.ToString("f"); //不显示秒 </P>
<P>1.10 取中文日期显示_年月 <BR>string strYM=currentTime.ToString("y"); </P>
<P>1.11 取中文日期显示_月日 <BR>string strMD=currentTime.ToString("m"); </P>
<P>1.12 取中文年月日 <BR>string strYMD=currentTime.ToString("D"); </P>
<P>1.13 取当前时分，格式为：14：24 <BR>string strT=currentTime.ToString("t"); </P>
<P>1.14 取当前时间，格式为：2003-09-23T14:46:48 <BR>string strT=currentTime.ToString("s"); </P>
<P>1.15 取当前时间，格式为：2003-09-23 14:48:30Z <BR>string strT=currentTime.ToString("u"); </P>
<P>1.16 取当前时间，格式为：2003-09-23 14:48 <BR>string strT=currentTime.ToString("g"); <BR><BR>1.17 取当前时间，格式为：Tue, 23 Sep 2003 14:52:40 GMT <BR>string strT=currentTime.ToString("r"); </P>
<P>1.18获得当前时间 n 天后的日期时间 <BR>DateTime newDay = DateTime.Now.AddDays(100); </P>
<P><STRONG>2、Int32.Parse(变量) Int32.Parse("常量") <BR></STRONG>字符型转换 转为32位数字型 </P>
<P><STRONG>3、 变量.ToString() </STRONG><BR>字符型转换 转为字符串 <BR>12345.ToString("n"); //生成 12,345.00 <BR>12345.ToString("C"); //生成 ￥12,345.00 <BR>12345.ToString("e"); //生成 1.234500e+004 <BR>12345.ToString("f4"); //生成 12345.0000 <BR>12345.ToString("x"); //生成 3039 (16进制) <BR>12345.ToString("p"); //生成 1,234,500.00% </P>
<P><BR><STRONG>4、变量.Length 数字型 </STRONG><BR>取字串长度： <BR>如： string str="中国"; <BR>int Len = str.Length ; //Len是自定义变量， str是求测的字串的变量名 </P>
<P><STRONG>5、System.Text.Encoding.Default.GetBytes(变量) </STRONG><BR>字码转换 转为比特码 <BR>如：byte[] bytStr = System.Text.Encoding.Default.GetBytes(str); <BR>然后可得到比特长度： <BR>len = bytStr.Length; </P>
<P><STRONG>6、System.Text.StringBuilder("") </STRONG><BR>字符串相加，（+号是不是也一样？） <BR>如：System.Text.StringBuilder sb = new System.Text.StringBuilder(""); <BR>sb.Append("中华"); <BR>sb.Append("人民"); <BR>sb.Append("共和国"); </P>
<P><STRONG>7、变量.Substring(参数1,参数2); </STRONG><BR>截取字串的一部分，参数1为左起始位数，参数2为截取几位。 <BR>如：string s1 = str.Substring(0,2); </P>
<P><STRONG>8、String user_IP=Request.ServerVariables["REMOTE_ADDR"].ToString(); </STRONG><BR>取<STRONG>远程用户IP地址 </STRONG></P>
<P><STRONG>9、穿过代理服务器取远程用户真实IP地址： <BR></STRONG>if(Request.ServerVariables["HTTP_VIA"]!=null){ <BR>string user_IP=Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); <BR>}else{ <BR>string user_IP=Request.ServerVariables["REMOTE_ADDR"].ToString(); <BR>} <BR><BR><STRONG>10、 Session["变量"]; </STRONG><BR>存取Session值； <BR>如，赋值： Session["username"]="小布什"; </P>
<P>取值： Object objName=Session["username"]; <BR>String strName=objName.ToString(); <BR>清空： Session.RemoveAll(); </P>
<P><STRONG>11、String str=Request.QueryString["变量"]; <BR></STRONG>用超链接传送变量。 <BR>如在任一页中建超链接:&lt;a href=Edit.aspx?fbid=23&gt;点击&lt;/a&gt; <BR>在Edit.aspx页中取值：String str=Request.QueryString["fdid"]; </P>
<P><STRONG>12、DOC对象.CreateElement("新建节点名"); </STRONG><BR>创建XML文档新节点 </P>
<P><STRONG>13、父节点.AppendChild(子节点)； <BR></STRONG>将新建的子节点加到XML文档父节点下 </P>
<P><STRONG>14、 父节点.RemoveChild(节点); </STRONG><BR>删除节点 </P>
<P><STRONG>15、Response </STRONG><BR>Response.Write("字串")； <BR>Response.Write(变量)； <BR>向页面输出。 </P>
<P>Response.Redirect("URL地址"）； <BR>跳转到URL指定的页面 </P>
<P><STRONG>16、char.IsWhiteSpce(字串变量，位数)——逻辑型 </STRONG><BR>查指定位置是否空字符； <BR>如： <BR>string str="中国 人民"; <BR>Response.Write(char.IsWhiteSpace(str,2)); //结果为：True, 第一个字符是0位，2是第三个字符。 </P>
<P><STRONG>17、char.IsPunctuation('字符') --逻辑型 </STRONG><BR>查字符是否是标点符号 <BR>如：Response.Write(char.IsPunctuation('A')); //返回：False </P>
<P><STRONG>18、(int)'字符' </STRONG><BR>把字符转为数字，查代码点，注意是单引号。 <BR>如： <BR>Response.Write((int)'中'); //结果为中字的代码：20013 </P>
<P><STRONG>19、(char)代码 <BR></STRONG>把数字转为字符，查代码代表的字符。 <BR>如： <BR>Response.Write((char)22269); //返回“国”字。 <BR><BR><STRONG>20、 Trim() <BR></STRONG>清除字串前后空格 </P>
<P><STRONG>21 、字串变量.Replace("子字串","替换为") </STRONG><BR>字串替换 <BR>如： <BR>string str="中国"; <BR>str=str.Replace("国","央"); //将国字换为央字 <BR>Response.Write(str); //输出结果为“中央” </P>
<P>再如：（这个非常实用） </P>
<P>string str="这是&lt;script&gt;脚本"; <BR>str=str.Replace("&lt;","&lt;font&gt;&lt;&lt;/font&gt;"); //将左尖括号替换为&lt;font&gt; 与 &lt; 与 &lt;/font&gt; （或换为&lt;，但估计经XML存诸后，再提出仍会还原） <BR>Response.Write(str); //显示为：“这是&lt;script&gt;脚本” </P>
<P>如果不替换，&lt;script&gt;将不显示，如果是一段脚本，将运行；而替换后，脚本将不运行。 <BR>这段代码的价值在于：你可以让一个文本中的所有HTML标签失效，全部显示出来，保护你的具有交互性的站点。 <BR>具体实现：将你的表单提交按钮脚本加上下面代码： <BR>string strSubmit=label1.Text; //label1是你让用户提交数据的控件ID。 <BR>strSubmit=strSubmit.Replace("&lt;","&lt;font&gt;&lt;&lt;/font&gt;"); <BR>然后保存或输出strSubmit。 <BR>用此方法还可以简单实现UBB代码。 </P>
<P><STRONG>22、Math.Max(i,j) <BR></STRONG>取i与j中的最大值 <BR>如 int x=Math.Max(5,10); // x将取值 10 </P>
<P><STRONG>23、字串对比一般都用: if(str1==str2){ } , 但还有别的方法: </STRONG></P>
<P>(1)、 <BR>string str1; str2 <BR>//语法: str1.EndsWith(str2); __检测字串str1是否以字串str2结尾,返回布尔值.如: <BR>if(str1.EndsWith(str2)){ Response.Write("字串str1是以"+str2+"结束的"); } </P>
<P>(2)、 <BR>//语法:str1.Equals(str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. </P>
<P>(3)、 <BR>//语法 Equals(str1,str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. </P>
<P><STRONG>24、IndexOf() 、LastIndexOf() </STRONG><BR>查找字串中指定字符或字串首次（最后一次）出现的位置,返回索引值，如： <BR>str1.IndexOf("字")； //查找“字”在str1中的索引值（位置） <BR>str1.IndexOf("字串")；//查找“字串”的第一个字符在str1中的索引值（位置） <BR>str1.IndexOf("字串",3,2)；//从str1第4个字符起，查找2个字符，查找“字串”的第一个字符在str1中的索引值（位置） </P>
<P><STRONG>25、Insert() </STRONG><BR>在字串中指定索引位插入指定字符。如： <BR>str1.Insert(1,"字");在str1的第二个字符处插入“字”，如果str1="中国"，插入后为“中字国”； </P>
<P><STRONG>26、PadLeft()、PadRight() <BR></STRONG>在字串左（或右）加空格或指定char字符，使字串达到指定长度，如： <BR>&lt;% <BR>string str1="中国人"; <BR>str1=str1.PadLeft(10,'1'); //无第二参数为加空格 <BR>Response.Write(str1); //结果为“1111111中国人” ， 字串长为10 <BR>%&gt; </P>
<P><STRONG>27、Remove() </STRONG><BR>从指定位置开始删除指定数的字符 <BR>&lt;% <BR>string str1="我是萨达姆的崇拜者之一"; <BR>Response.Write(str1.Remove(5,4)); //结果为“我是萨达姆之一” <BR>%&gt; </P></DIV>&nbsp;<img src ="http://www.cnblogs.com/angelfeather/aggbug/1225926.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title>ASP.NET中$#=的用法</title><link>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225922.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:43:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225922.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225922.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225922.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225922.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225922.html</trackback:ping><description><![CDATA[<P><FONT color=#ff0000>&lt;%$&nbsp;&nbsp;&nbsp;&nbsp; %&gt;</FONT></P>
<P>&nbsp;获取App_GlobalResources中message.resx文件中的B0011对应的字符串&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Button ID="btnExecute" runat="server" CssClass="pressedbutton" Font-Bold="True" Text="<FONT color=#3366ff>&lt;%$ Resources:Message, B0011 %&gt;</FONT>" /&gt;</P>
<P>&nbsp;获取App_LocalResource中***.aspx.resx文件中的ShoriYm对应的字符串&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID="lblShoriYm" runat="server" CssClass="label_02" Text="<FONT color=#3366ff>&lt;%$ Resources:ShoriYm%&gt;</FONT>" &gt;&lt;/asp:Label&gt;&lt;/td&gt;</P>
<P>获取web.config文件中的数据库连接字符串&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">asp:SqlDataSource&nbsp;</SPAN><SPAN style="COLOR: #ff0000">ID</SPAN><SPAN style="COLOR: #0000ff">="SqlDataSource1"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;runat</SPAN><SPAN style="COLOR: #0000ff">="server"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;ConnectionString</SPAN><SPAN style="COLOR: #0000ff">="&lt;%$connectionStrings:Pubs&nbsp;%&gt;"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;SelectCommand</SPAN><SPAN style="COLOR: #0000ff">="select&nbsp;*&nbsp;from&nbsp;catalog"</SPAN><SPAN style="COLOR: #0000ff">&gt;&lt;/</SPAN><SPAN style="COLOR: #800000">asp:SqlDataSource</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><BR></P>
<P><FONT color=#ff0000>&lt;%#&nbsp;&nbsp;&nbsp;&nbsp; %&gt;</FONT></P>
<P>数据绑定&nbsp;</P>
<P>&lt;asp:Label ID="lblId" runat="server" Text='<FONT color=#3366ff>&lt;%#Eval("MenuBig_Id") %&gt;</FONT>' Visible="false"&gt;&lt;/asp:Label&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P><FONT color=#ff0000>&lt;%=&nbsp;&nbsp;&nbsp;&nbsp; %&gt;</FONT></P>
<P>是在客户端获取服务器端的变量,后台往前台传值<BR>&lt;asp:Label ID="Label2" runat="server" CssClass="label"&nbsp; Width="255px<FONT color=#3366ff>"&gt;&lt;%=testStr%&gt;</FONT>&lt;/asp:Label&gt;</P><img src ="http://www.cnblogs.com/angelfeather/aggbug/1225922.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title>利用MD5加密数据库中的密码</title><link>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225919.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:42:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225919.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225919.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/archive/2008/06/19/1225919.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225919.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225919.html</trackback:ping><description><![CDATA[<P>.NET提供了进行数据加密类，下面就用例子进行说明如何使用MD5进行数据加密。 </P>
<P>首先，创建一个UserAccount表，字段两个：UserName和Password，类型分别为varchar(25)和binary(16)，下面的ASP.NET代码就是创建用户时的具体实现： </P><PRE style="BORDER-RIGHT: #ff9801 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #ff9801 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: #ff9801 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #ff9801 1px solid; BACKGROUND-COLOR: #ffd780" align="center">&lt;%@ Import Namespace="System.Security.Cryptography" %&gt;
&lt;%@ Import Namespace="System.Text" %&gt;
&lt;%@ Import Namespace="System.Data" %&gt;
&lt;%@ Import Namespace="System.Data.SqlClient" %&gt;
&lt;script runat="server" language="VB"&gt;
    Sub CreateAccount(sender as Object, e as EventArgs)
      '1. 创建连接
      Const strConnString as String 
      strConnString= "Data Source=.;Initial Catalog=test;User Id=sa;Password=;"
      Dim objConn as New SqlConnection(strConnString)
      
      '2. 创建Command对象
      Dim strSQL as String = _
          "INSERT INTO UserAccount(Username,Password) " &amp; _
          "VALUES(@Username, @Password)"
      Dim objCmd as New SqlCommand(strSQL, objConn)
      
      '3. 创建参数
      Dim paramUsername as SqlParameter
      paramUsername = New SqlParameter("@Username", SqlDbType.VarChar, 25)
      paramUsername.Value = txtUsername.Text
      objCmd.Parameters.Add(paramUsername)
      
  
      '加密密码字段

       <STRONG>Dim md5Hasher as New MD5CryptoServiceProvider()
    
      Dim hashedBytes as Byte()   
      Dim encoder as New UTF8Encoding()

      hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(txtPwd.Text))      

      Dim paramPwd as SqlParameter
      paramPwd = New SqlParameter("@Password", SqlDbType.Binary, 16)
      paramPwd.Value = hashedBytes
      objCmd.Parameters.Add(paramPwd)</STRONG>
      
      
      '插入数据库
      objConn.Open()
      objCmd.ExecuteNonQuery()
      objConn.Close()
      
      'Redirect 其它页面
    End Sub
&lt;/script&gt;

&lt;form runat="server"&gt;
  &lt;h1&gt;创建帐号：&lt;/h1&gt;
  用户名: &lt;asp:TextBox runat="server" id="txtUsername"/&gt;
  &lt;br/&gt;
  密码: &lt;asp:TextBox runat="server" id="txtPwd" TextMode="Password"/&gt;  
  &lt;p&gt;&lt;asp:Button runat="server" Text="创建用户" OnClick="CreateAccount"/&gt;&lt;/p&gt;
&lt;/form&gt;
</PRE>
<P>下面是对用户进行验证的ASP.NET代码： </P>
<P mce_keep="true">&nbsp;</P><PRE style="BORDER-RIGHT: #ff9801 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #ff9801 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: #ff9801 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #ff9801 1px solid; BACKGROUND-COLOR: #ffd780" align="center">&lt;%@ Import Namespace="System.Security.Cryptography" %&gt;
&lt;%@ Import Namespace="System.Text" %&gt;
&lt;%@ Import Namespace="System.Data" %&gt;
&lt;%@ Import Namespace="System.Data.SqlClient" %&gt;
&lt;script runat="server" language="VB"&gt;
    Sub Login(sender as Object, e as EventArgs)
      '1. 创建连接
      Const strConnString as String 
      strConnString= "Data Source=.;Initial Catalog=test;User Id=sa;Password=;"
      Dim objConn as New SqlConnection(strConnString)
      
      '2. 创建Command对象
      Dim strSQL as String = "SELECT COUNT(*) FROM UserAccount " &amp; _
                        "WHERE Username=@Username AND Password=@Password"
      Dim objCmd as New SqlCommand(strSQL, objConn)
      
      '3. 创建参数
      Dim paramUsername as SqlParameter
      paramUsername = New SqlParameter("@Username", SqlDbType.VarChar, 25)
      paramUsername.Value = txtUsername.Text
      objCmd.Parameters.Add(paramUsername)
      
  
      '加密密码
      Dim md5Hasher as New MD5CryptoServiceProvider()
    
      Dim hashedDataBytes as Byte()   
      Dim encoder as New UTF8Encoding()

      hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(txtPwd.Text))      

      Dim paramPwd as SqlParameter
      paramPwd = New SqlParameter("@Password", SqlDbType.Binary, 16)
      paramPwd.Value = hashedDataBytes
      objCmd.Parameters.Add(paramPwd)
      
      
      '执行查询
      objConn.Open()
      Dim iResults as Integer = objCmd.ExecuteScalar()
      objConn.Close()
      
      If iResults = 1 then
        '合法
      Else
        '不合法
      End If
    End Sub
&lt;/script&gt;

&lt;form runat="server"&gt;
  &lt;h1&gt;登录：&lt;/h1&gt;
  用户名:&lt;asp:TextBox runat="server" id="txtUsername"/&gt;&lt;br/&gt; 
  密  码:&lt;asp:TextBox runat="server" id="txtPwd" TextMode="Password"/&gt;  
  &lt;p&gt;&lt;asp:Button runat="server" Text="登录" OnClick="Login"/&gt;
&lt;/form&gt;
</PRE>下面是MD5CryptoServiceProvider直接生成的例子： <PRE style="BORDER-RIGHT: #ff9801 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #ff9801 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: #ff9801 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #ff9801 1px solid; BACKGROUND-COLOR: #ffd780" align="center">&lt;%@ Import Namespace="System.Security.Cryptography" %&gt;
&lt;%@ Import Namespace="System.Text" %&gt;
&lt;script language="VB" runat="server"&gt;
  Sub DisplayEncryptedText(sender as Object, e as EventArgs)
    If Page.IsValid then
      Dim md5Hasher as New MD5CryptoServiceProvider()
    
      Dim hashedDataBytes as Byte()   
      Dim encoder as New UTF8Encoding()

      hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(txtPassword.Text))    
    
      ltlResults.Text = "&lt;b&gt;Encrypted Results&lt;/b&gt;&lt;br /&gt; The results are encrypted into " &amp; _
              "an array of 16 bytes.  These 16 bytes contain the values:&lt;p&gt;&lt;ul&gt;"
    
      Dim b as Byte
      For Each b in hashedDataBytes
	    ltlResults.Text &amp;= "&lt;li&gt;" &amp; b &amp; "&lt;/li&gt;"
      Next b
      
      ltlResults.Text &amp;= "&lt;/ul&gt;"    
    End If
  End Sub  
&lt;/script&gt;

&lt;form runat="server"&gt;
  Enter a string:
  &lt;asp:TextBox id="txtPassword" runat="server" /&gt;
  &lt;asp:RequiredFieldValidator runat="server" ControlToValidate="txtPassword"
           Display="Dynamic" ErrorMessage="&lt;i&gt;You must provide a value here...&lt;/i&gt;" /&gt;
  &lt;asp:RegularExpressionValidator runat="server" ControlToValidate="txtPassword"
           Display="Dynamic" ErrorMessage="&lt;i&gt;The string must be 20 characters or less...&lt;/i&gt;"
           ValidationExpression="^.{1,20}___FCKpd___2quot; /&gt;
  &lt;br /&gt;
  &lt;asp:Button runat="server" Text="View the String as Encrypted Text"
	OnClick="DisplayEncryptedText" /&gt;
  &lt;p&gt;
  &lt;asp:Literal runat="server" id="ltlResults" /&gt;
&lt;/form&gt;
</PRE>&nbsp;<img src ="http://www.cnblogs.com/angelfeather/aggbug/1225919.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title>扩展GridView控件（全）——增加10个常用功能</title><link>http://www.cnblogs.com/angelfeather/articles/1225914.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:41:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/articles/1225914.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225914.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/articles/1225914.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225914.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225914.html</trackback:ping><description><![CDATA[作者：<A href="http://webabcd.cnblogs.com/" target=_blank><FONT color=#1d58d1>webabcd</FONT></A><BR><BR><BR>控件开发<BR><A href="http://www.cnblogs.com/webabcd/archive/2006/12/25/602627.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（一）——鼠标经过行时改变行的样式</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/03/610742.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（二）——给字段标题加上排序状态</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/03/610745.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（三）——单击命令按钮弹出确认框</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/08/614510.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（四）——每行复选框的全选与取消全选</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/15/620501.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（五）——固定表头、指定行或指定列</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/22/626484.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（六）——数据行响应鼠标的单击和双击事件</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/25/629810.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（七）——改变通过复选框选中的行的样式</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/01/29/632863.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（八）——导出为Excel</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/02/01/637485.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（九）——给数据行增加右键菜单</FONT></A><BR><BR><A href="http://www.cnblogs.com/webabcd/archive/2007/02/04/639793.html" target=_blank><FONT color=#1d58d1>扩展GridView控件（十）——扩展分页功能</FONT></A><BR><BR><BR>控件截图<BR><IMG height=416 alt="" src="http://www.cnblogs.com/images/cnblogs_com/webabcd/84175/o_SmartGridView.png" width=605 border=0><BR><BR><BR>控件使用<BR>1、鼠标经过行时改变行的样式<BR>CssClassMouseOver - 鼠标经过行时行的样式的CSS类名<BR><BR>2、给字段标题加上排序状态<BR>设置其SortTip下的4个属性即可<BR>SortAscImage - 升序提示图片<BR>SortAscText - 升序提示文本<BR>SortDescImage - 降序提示图片<BR>SortDescText - 降序提示文本<BR><BR>3、单击命令按钮弹出确认框<BR>设置其ConfirmButtons属性<BR>CommandName - 命令按钮的CommandName属性<BR>ConfirmMessage - 弹出的确认框所显示的文字<BR><BR>4、每行复选框的全选与取消全选<BR>在模板列的头模板处添加一个复选框，在模板列的项模板处添加一个复选框，然后设置控件的CheckboxAlls属性<BR>CheckboxAllID - 模板列全选复选框ID<BR>CheckboxItemID - 模板列项复选框ID<BR><BR>5、固定表头、指定行或指定列<BR>设置其FixRowCol下的6个属性<BR>IsFixHeader - 固定表头否？<BR>IsFixPager - 固定分页行否？<BR>FixRowIndices - 需要固定的行的索引（用逗号“,”分隔）<BR>FixColumnIndices - 需要固定的列的索引（用逗号“,”分隔）<BR>TableWidth - 表格的宽度<BR>TableHeight - 表格的高度<BR>EnableScrollState - 是否保持滚动条的状态<BR><BR>6、数据行响应鼠标的单击和双击事件<BR>RowClickButtonID - 行单击事件所对应的按钮的ID<BR>RowDoubleClickButtonID - 行双击事件所对应的按钮的ID<BR><BR>7、改变通过CheckBox选中的行的样式<BR>CheckBoxID - 模板列的项复选框的ID<BR>CssClassRowSelected - 选中行的样式的CSS类名<BR><BR>8、导出为Excel<BR>在GridView内加一个按钮<BR>CommandName属性设置为“ExportToExcel”<BR>CommandArgument属性的值用“;”做分隔符分为两部分，左边的部分为导出Excel的文件名称，右边的部分为需要隐藏的列的索引（列索引用“,”分开）<BR><BR>9、给数据行增加右键菜单<BR>ItemType - 右键菜单的项的类别（Link，Command，Custom，Separator）<BR>Icon - 文字左边的图标的链接<BR>Text - 菜单的文字<BR>CommandButtonId - 所调用的命令按钮的ID<BR>NavigateUrl - 链接的url<BR>Target - 链接的target（Blank，Self，Top）<BR>Key - 自定义属性key<BR>Value - 自定义属性value<BR><BR>10、扩展分页功能<BR>设置PagingStyle属性为Default<BR>设置GridView的原有属性PageButtonCount，FirstPageText，PreviousPageText，NextPageText，LastPageText，FirstPageImageUrl，PreviousPageImageUrl，NextPageImageUrl，LastPageImageUrl<BR><BR><BR>OK<BR><A href="http://www.cnblogs.com/Files/webabcd/YYControls.rar"><FONT color=#1d58d1>[源码下载]</FONT></A>&nbsp;&nbsp;<img src ="http://www.cnblogs.com/angelfeather/aggbug/1225914.html?type=2" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title> js下拉框(select)联动</title><link>http://www.cnblogs.com/angelfeather/articles/1225910.html</link><dc:creator>天使毛毛.</dc:creator><author>天使毛毛.</author><pubDate>Thu, 19 Jun 2008 06:40:00 GMT</pubDate><guid>http://www.cnblogs.com/angelfeather/articles/1225910.html</guid><wfw:comment>http://www.cnblogs.com/angelfeather/comments/1225910.html</wfw:comment><comments>http://www.cnblogs.com/angelfeather/articles/1225910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/angelfeather/comments/commentRss/1225910.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/angelfeather/services/trackbacks/1225910.html</trackback:ping><description><![CDATA[<P>&lt;form name="frm"&gt;<BR>&lt;select name="s1" size="1" onChange="redirec1(document.frm.s1.options.selectedIndex)"&gt;<BR>&nbsp;&lt;option selected &gt;浙江&lt;/option&gt;<BR>&nbsp;&lt;option &gt;江苏&lt;/option&gt;<BR>&lt;/select&gt;</P>
<P>&lt;select name="s2" size="1" onChange="redirec2(document.frm.s1.options.selectedIndex,document.frm.s2.options.selectedIndex)"&gt;<BR>&nbsp;&lt;option selected&gt;杭州&lt;/option&gt;<BR>&lt;option&gt;金华&lt;/option&gt;<BR>&lt;/select&gt;</P>
<P>&lt;select name="s3" size="1"&gt;<BR>&nbsp;&lt;option selected&gt;富阳&lt;/option&gt;<BR>&lt;option&gt;萧山&lt;/option&gt;<BR>&lt;/select&gt;<BR>&lt;/form&gt;<BR>&lt;script language="javascript"&gt;<BR>var select2 = new Array(new Array(new Option("杭州"),new Option("金华")),new Array(new Option("苏州"),new Option("连云港")));<BR>var select3 = new Array(new Array(new Array(new Option("富阳"),new Option("萧山")),new Array(new Option("永康"),new Option("义务"))),new Array(new Array(new Option("aa"),new Option("aaa"),new Option("aaaa"),new Option("aaaaa")),new Array(new Option("bb"),new Option("bbb"))));<BR>function redirec1(x)<BR>{<BR>&nbsp;var temp = document.frm.s2; <BR>temp.length=0<BR>&nbsp;for (i=0;i&lt;select2[x].length;i++)<BR>&nbsp;{<BR>&nbsp; temp.options[i]=new Option(select2[x][i].text);<BR>&nbsp;}<BR>redirec2(document.frm.s1.options.selectedIndex,document.frm.s2.options.selectedIndex)</P>
<P>}</P>
<P>function redirec2(x,y)<BR>{<BR>&nbsp;var temp = document.frm.s3; <BR>temp.length=0<BR>&nbsp;for (i=0;i&lt;select3[x][y].length;i++)<BR>&nbsp;{<BR>&nbsp; temp.options[i]=new Option(select3[x][y][i].text);<BR>&nbsp;}<BR>}<BR>&lt;/script&gt;&nbsp;</P>&nbsp;<img src ="http://www.cnblogs.com/angelfeather/aggbug/1225910.html?type=2" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item></channel></rss>