﻿<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/css" href="/page/images/rssstyle.css"?><rss version="2.0"><channel><title>网站技术 - 杨云伟个人网站</title><link>http://www.yangyunwei.com/</link><language>zh-cn</language><docs>http://www.yangyunwei.com/sitemaps/index.htm</docs><generator>http://www.yangyunwei.com</generator><ttl>5</ttl><item><title>右键菜单的制作！</title><link>http://www.yangyunwei.com/bbs/web/2005-1-17/12.htm</link><description><![CDATA[特效版权归特效本人所有,未经同意不得转载!<br /> <br /> <br /><br /> &nbsp;<br /> &nbsp;<br /> <br /> &nbsp;<br /> &nbsp; &nbsp; if (document.all) document.body.onmousedown=new Function(&quot;if (event.button==2) menu.Click();&quot;)]]></description><category>在线交流</category><author>Weiven</author><pubdate>2005-1-17 14:10:18</pubdate></item><item><title>admin md5加密后代码</title><link>http://www.yangyunwei.com/bbs/web/2007-2-10/30.htm</link><description><![CDATA[下面是 admin 的加密代码：<br />16位加密（7a57a5a743894a0e）<br />32位加密（21232f297a57a5a743894a0e4a801fc3） <br /><br />下面是 0000 的加密代码：<br />16位加密（14474e4033ac29cc）<br />32位加密（4a7d1ed414474e4033ac29ccb8653d9b） <br /><br />相当有用，在你丢失密码的时候，记下来。]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-10 22:28:57</pubdate></item><item><title>FW： 为什么我进入后台之后一会就自动跳出？</title><link>http://www.yangyunwei.com/bbs/web/2007-2-12/31.htm</link><description><![CDATA[现在经常有人问我“<br />为什么我进入后台之后一会就自动跳出？是不是空间的问题？”<br />答：<br />服务器采用win2003系统~<br />面对win2003 session丢失的问题..<br />就此将将用户判断由session改为使用cookies..]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-12 10:17:46</pubdate></item><item><title>载入页面之LOADING代码</title><link>http://www.yangyunwei.com/bbs/web/2007-2-12/35.htm</link><description><![CDATA[&lt;head&gt;<br />&lt;META name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;&gt; <br />&lt;title&gt;say it as it is&lt;/title&gt; <br />&lt;/head&gt;<br />&lt;div align=&quot;center&quot;&gt; &lt;b&gt;&lt;span <br />class=zilong&gt;&lt;font color=#ffffff size=2&gt; <br />&lt;script&gt; <br />var message=&quot;正 在 载 入杨云伟个人网站&quot; <br />var n=0; <br />if (document.all){ <br />document.write(&#39;&lt;b&gt;&lt;font size=&quot;12px&quot; color=&quot;#0000cc&quot;&gt;&#39;) <br />for (m=0;m&lt;message.length;m++) <br />document.write(&#39;&lt;span id=&quot;neonlight&quot; style=&quot;font-family:Verdana,Arial;font-size:12px&quot;&gt;&#39;+message.charAt(m)+&#39;&lt;/span&gt;&#39;) <br />document.write(&#39;&lt;/font&gt;&lt;/B&gt;&#39;) <br />var tempref=document.all.neonlight <br />} <br />else <br />document.write(message) <br />function neon(){ <br />if (n==0){ <br />for (m=0;m&lt;message.length;m++) <br />tempref[m].style.color=&quot;#ccccCC&quot; <br />} <br />tempref[n].style.color=&quot;#0000cc&quot; <br />if (n&lt;tempref.length-1) <br />n++ <br />else{ <br />n=0 <br />clearInterval(flashing) <br />setTimeout(&quot;beginneon()&quot;,1000) <br />return <br />} <br />} <br />function beginneon(){ <br />if (document.all) <br />flashing=setInterval(&quot;neon()&quot;,15) <br />} <br />beginneon() <br />&lt;/script&gt; <br />&lt;/font&gt;&lt;/span&gt;&lt;/b&gt; <br />&lt;table height=&quot;85&quot;&gt; <br />&lt;tr&gt; <br />&lt;td width=&quot;740&quot; height=&quot;84&quot;&gt; <br />&lt;p align=&quot;center&quot;&gt; <br />&lt;p align=&quot;center&quot;&gt; <br />&lt;form name=&quot;loading&quot;&gt; <br />&lt;div align=&quot;center&quot;&gt; <br />&lt;p&gt; <br />&lt;input type=&quot;text&quot; name=&quot;chart&quot; size=&quot;46&quot; <br />style=&quot;font-family:Arial; font-weight:bolder; color:rgb(124,119,119); background-color:white; font-color:red; padding:0px; border-style:none;&quot;&gt; <br />&lt;br&gt; <br />&lt;input type=&quot;text&quot; name=&quot;percent&quot; size=&quot;46&quot; <br />style=&quot;color:rgb(138,134,134); text-align:center; border-width:medium; border-style:none;&quot;&gt; <br />&lt;script language=&quot;&quot;&gt; <br /><br />var bar = 0 <br />var line = &quot;||&quot; <br />var amount =&quot;||&quot; <br />count() <br />function count(){ <br />bar= bar+2 <br />amount =amount + line <br />document.loading.chart.value=amount <br />document.loading.percent.value=bar+&quot;%&quot; <br />if (bar&lt;99) <br />{setTimeout(&quot;count()&quot;,80);} <br />else <br />{ <br />window.location = <a target="_blank" href="/page/link.asp?url=http://www.yangyunwei.com/index.htm">http://www.yangyunwei.com/index.htm</a>; <br />} <br />} <br />&lt;/script&gt; <br />&lt;/p&gt; <br />&lt;/div&gt;&lt;/form&gt;&lt;/table&gt; <br />&lt;/div&gt;<br /><br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-12 14:18:1</pubdate></item><item><title>在 DW 中插入 Flash 的参数详解</title><link>http://www.yangyunwei.com/bbs/web/2007-2-12/36.htm</link><description><![CDATA[参数和属性<br /><br />下列标记属性和参数描述了由&quot;发布&quot;命令创建的 HTML 代码。在编写自己的用于显示 Flash 内容的 HTML 时，可以参考此列表。除非特别说明，否则所有条目都同时适用于 object 标记和 embed 标记。可选条目也在此列出。Internet Explorer 可以识别用于 object 标记的参数，而 Netscape 则可以识别用于 embed 标记的参数。属性既可用于 object 标记，也可用于 embed 标记。当自定义模板时，可以用此处列出的模板变量替代相应的值。请参阅自定义 HTML 发布模板。<br /><br />注意：此部分中列出的属性和参数特意以小写字母显示，以符合 XHTML 标准。<br /><br />devicefont 属性/参数<br /><br />值: true | false<br />模板变量：$DE<br />说明:<br />（可选）对于未选定&quot;设备字体&quot;选项的静态文本对象，指定是否仍使用设备字体进行绘制（如果操作系统提供了所需字体）。<br /><br />src 属性<br /><br />值: movieName.swf<br />模板变量：$MO<br />说明 : 指定要加载的 SWF 文件的名称。仅适用于 embed。 <br /><br />movie 参数<br /><br />值: movieName.swf<br />模板变量：$MO<br />说明: 指定要加载的 SWF 文件的名称。仅适用于 object。<br /><br />classid 属性<br /><br />值: clsid<img src="/page/image/emot/2.gif"/>27cdb6e-ae6d-11cf-96b8-444553540000<br />说明: 标识浏览器的 ActiveX 控件。输入的值必须与上面的显示完全一致。仅适用于 object。<br /><br />width 属性<br /><br />值: n 或 n%<br />模板变量：$WI<br />说明:以像素值或浏览器窗口的百分比值来指定应用程序的宽度。<br /><br />height 属性<br /><br />值: n 或 n%<br />模板变量：$HE<br />说明: 以像素值或浏览器窗口的百分比值来指定应用程序的高度。 <br /><br />注意：因为 Flash 应用程序是可缩放的，所以只要高宽比保持不变，不论以任何尺寸播放，它们的品质都不会降低。（例如，以下尺寸的高宽比都是 4:3：640 x 480 像素、320 x 240 像素和 240 x 180 像素。）<br /><br />codebase 属性<br /><br />值: active.macromedia.com/flash7/cabs/swflash.cab#version=7,0,0,0<br /><br />说明: 标识 Flash Player ActiveX 控件的位置，以便在尚未安装该控件时，浏览器可以自动下载它。输入的值必须与上面的显示完全一致。仅适用于 object。<br /><br />pluginspage 属性<br /><br />值: <a target="_blank" href="/page/link.asp?url=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash</a><br />说明: 标识 Flash Player 插件的位置，以便在尚未安装该插件时，用户可以下载它。输入的值必须与上面的显示完全一致。仅适用于 embed 。<br /><br />swliveconnect 属性<br /><br />值: true | false<br />说明: （可选）指定第一次加载 Flash Player 时浏览器是否应启动 Java。如果忽略此属性，默认值为 false。如果在同一页面上同时使用 JavaScript 和 Flash，Java 必须处于运行状态，FSCommand() 函数才能起作用。但是，如果您运行 JavaScript 只是为了检测浏览器或用于其他与 fscommand() 动作无关的目的，则可以通过将 SWLIVECONNECT 设置为 false，从而防止 Java 启动。当没有将 JavaScript 和 Flash 一起使用时，也可以通过将 SWLIVECONNECT 属性明确设置为 true，强制 Java 启动。启动 Java 会显著增加启动 SWF 文件所需的时间，因此，只有在必要时才应将此标记设置为 true。仅适用于 embed。<br /><br />使用 fscommand() 动作可从独立的放映文件中启动 Java。<br /><br />play 属性/参数<br /><br />值: true | false<br />模板变量：$PL<br />说明:（可选）指定应用程序是否在浏览器中加载时就开始播放。如果您的 Flash 应用程序是交互式的，则可以让用户通过单击按钮或执行某些其他任务来开始播放。在这种情况下，将 play 属性设置为 false 可禁止应用程序自动开始播放。如果忽略此属性，默认值为 true。<br /><br />loop 属性/参数<br /><br />值: true | false<br />模板变量：$LO<br />说明: （可选）指定 Flash 内容在它到达最后一帧后是无限制重复播放还是停止。如果忽略此属性，默认值为 true。<br /><br />quality 属性/参数<br /><br />值: low | medium | high | autolow | autohigh | best<br />模板变量：$QU<br />说明: （可选）指定在应用程序回放期间使用的消除锯齿级别。因为消除锯齿需要更快的处理器先对 SWF 文件的每一帧进行平滑处理，然后再将它们呈现到观众屏幕上，所以需要根据要优化速度还是优化外观来选择一个值：<br /><br />&quot;Low&quot;使回放速度优先于外观，而且从不使用消除锯齿功能。<br /><br />&quot;Autolow&quot;优先考虑速度，但是也会尽可能改善外观。回放开始时，消除锯齿功能处于关闭状态。如果 Flash Player 检测到处理器可以处理消除锯齿功能，就会打开该功能。<br /><br />&quot;Autohigh&quot;在开始时是回放速度和外观两者并重，但在必要时会牺牲外观来保证回放速度。回放开始时，消除锯齿功能处于打开状态。如果实际帧频降到指定帧频之下，就会关闭消除锯齿功能以提高回放速度。使用此设置可模拟 Flash 中的&quot;消除锯齿&quot;命令（&quot;查看&quot;&gt;&quot;预览模式&quot;&gt;&quot;消除锯齿&quot;）。 <br /><br />&quot;Medium&quot;会应用一些消除锯齿功能，但并不会平滑位图。该设置生成的图像品质要高于&quot;Low&quot;设置生成的图像品质，但低于&quot;High&quot;设置生成的图像品质。 <br /><br />&quot;High&quot;使外观优先于回放速度，它始终应用消除锯齿功能。如果 SWF 文件不包含动画，则会对位图进行平滑处理；如果 SWF 文件包含动画，则不会对位图进行平滑处理。 <br /><br />&quot;Best&quot;提供最佳的显示品质，而不考虑回放速度。对所有输出都进行消除锯齿处理，并且对所有位图都进行平滑处理。<br /><br />如果忽略 quality 属性，其默认值为 high。<br /><br />bgcolor 属性/参数<br /><br />值: #RRGGBB（十六进制 RGB 值）<br />模板变量：$BG<br />说明: （可选）指定应用程序的背景色。使用此属性来覆盖在 Flash SWF 文件中指定的背景色设置。此属性不影响 HTML 页面的背景色。<br /><br />scale 属性/参数<br /><br />值: showall | noborder | exactfit<br />模板变量：$SC<br />说明: （可选）当 width 和 height 值是百分比时，定义应用程序如何放置在浏览器窗口中。<br /><br />&quot;Showall&quot;（默认值）使整个 Flash 内容显示在指定区域中，且不会发生扭曲，同时保持它的原始高宽比。边框可能会出现在应用程序的两侧。<br /><br />&quot;Noborder&quot;对 Flash 内容进行缩放以填充指定区域，不会发生扭曲，它会使应用程序保持原始高宽比，但有可能会进行一些裁剪。 <br /><br />&quot;Exactfit&quot;使整个 Flash 内容显示在指定区域中，但不尝试保持原始高宽比。可能会发生扭曲。<br /><br />如果忽略此属性（而且 width 和 height 值是百分比），则它的默认值是 showall。<br /><br />align 属性<br /><br />值: Default | L | R | T | B <br />模板变量：$HA<br />说明: 指定 object、embed 和 img 标记的 align 值，并确定如何在浏览器窗口内放置 Flash SWF 文件。 <br /><br />&quot;默认&quot;使应用程序在浏览器窗口内居中显示，如果浏览器窗口小于应用程序，则会裁剪边缘。<br /><br />L、R、T 和 B 让应用程序分别沿着浏览器窗口的左、右、上、下边缘对齐，并根据需要裁剪其余三边。 <br /><br />salign 参数<br /><br />值: L | R | T | B | TL | TR | BL | BR <br />模板变量：$SA<br />说明: （可选）指定缩放的 Flash SWF 文件在由 width 和 height 设置定义的区域内的位置。有关这些条件的详细信息，请参阅scale 属性/参数。<br /><br />L、R、T 和 B 让应用程序分别沿着浏览器窗口的左、右、上、下边缘对齐，并根据需要裁剪其余三边。 <br /><br />TL 和 TR 让应用程序分别与浏览器窗口的左上角和右上角对齐，并根据需要裁剪底边和剩余的右侧或左侧边缘。 <br /><br />BL 和 BR 让应用程序分别与浏览器窗口的左下角和右下角对齐，并根据需要裁剪顶边和剩余的右侧或左侧边缘。<br /><br />如果忽略此属性，Flash 内容会在浏览器窗口中居中显示。<br /><br />base 属性<br /><br />值: 基本目录或 URL<br />说明: （可选）指定用于解析 Flash SWF 文件中的所有相对路径语句的基本目录或 URL。如果 SWF 文件保存在与您的其他文件不同的目录下，这个属性是非常有用。<br /><br />menu 属性/参数<br /><br />值: true | false<br />模板变量：$ME<br />说明: （可选）指定当观众在浏览器中右击 (Windows) 或按住 Command 键单击 (Macintosh) 应用程序区域时将显示的菜单类型。 <br /><br />&quot;true&quot; 显示完整的菜单，让用户使用各种选项增强或控制回放。<br /><br />&quot;false&quot; 显示的是一个只包含&quot;关于 Macromedia Flash Player 6&quot;选项和&quot;设置&quot;选项的菜单。<br /><br />如果忽略此属性，默认值为 true。<br /><br />wmode 属性/参数<br /><br />值: Window | Opaque | Transparent<br />模板变量：$WM<br />说明: （可选）使您可以使用 Internet Explorer 4.0 中的透明 Flash 内容、绝对定位和分层显示的功能。此标记/属性仅在带有 Flash Player ActiveX 控件的 Windows 中有效。<br /><br />&quot;Window&quot;在 Web 页上用影片自己的矩形窗口来播放应用程序。&quot;Window&quot;表明 Flash 应用程序与 HTML 层没有任何交互，并且始终位于最顶层。<br /><br />&quot;Opaque&quot; 使应用程序隐藏页面上位于它后面的所有内容。<br /><br />&quot;Transparent&quot;使 HTML 页的背景可以透过应用程序的所有透明部分进行显示，这样可能会降低动画性能。<br /><br />&quot;Opaque windowless&quot;和&quot;Transparent windowless&quot; 都可与 HTML 层交互，并允许 SWF 文件上方的层遮蔽应用程序。这两种选项之间的差异在于&quot;Transparent&quot;允许透明，因此，如果 SWF 文件的某一部分是透明的，则 SWF 文件下方的 HTML 层可以透过该部分显示出来。<br /><br />如果忽略此属性，默认值为 Window。仅适用于 object。<br /><br />allowscriptaccess 属性/参数<br /><br />值: always | never | samedomain<br />说明: 使用 allowscriptaccess 使 Flash 应用程序可与承载它的 HTML 页通信。此参数是必需的，因为 fscommand() 和 getURL() 操作可能导致 JavaScript 使用 HTML 页的权限，而该权限可能与 Flash 应用程序的权限不同。这与跨域安全性有着重要关系。 <br /><br />always 允许随时执行脚本操作。<br /><br />never 禁止所有脚本执行操作。<br /><br />samedomain 只有在 Flash 应用程序来自与 HTML 页相同的域时才允许执行脚本操作。 <br /><br />所有 HTML 发布模板使用的默认值均为 samedomain。 <br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-12 14:33:34</pubdate></item><item><title>HTML教程下载</title><link>http://www.yangyunwei.com/bbs/web/2007-2-12/37.htm</link><description><![CDATA[解压密码是：<a target="_blank" href="/page/link.asp?url=http://www.yangyunwei.com">www.yangyunwei.com</a><br />下载地址：<a target="_blank" href="/page/link.asp?url=http://www.yangyunwei.com/HTML">http://www.yangyunwei.com/HTML</a>教程.rar]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-12 14:44:49</pubdate></item><item><title>SQL Server的空值处理策略</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/39.htm</link><description><![CDATA[数据完整性是任何数据库系统要保证的重点。不管系统计划得有多好，空数据值的问题总是存在。本文探讨了在SQL Server中处理这些值时涉及的3个问题：计数、使用空表值以及外键处理。 <br /><br /><br /><br />用COUNT<img src="/page/image/emot/34.gif"/>处理空值 <br /><br /><br />大多数集合函数都能在计算时消除空值；COUNT函数则属于例外。对包含空值的一个列使用COUNT函数，空值会从计算中消除。但假如COUNT函数使用一个星号，它就计算所有行，而不管是否存在空值。 <br /><br /><br /><br />如果希望COUNT函数对给定列的所有行（包括空值）进行计数，请使用ISNULL函数。ISNULL函数会将空值替换成有效的值。 <br /><br />事实上，对集合函数来说，如果空值可能导致错误结果，ISNULL函数就非常有用。记住在使用一个星号时，COUNT函数会对所有行进行计算。下例演示了空值在AVG和COUNT集合函数中的影响： <br /><br /><br />SET NOCOUNT ON<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;CREATE TABLE xCount<br /> &nbsp; &nbsp;(pkey1 INT IDENTITY NOT NULL<br /> &nbsp; &nbsp; &nbsp; &nbsp;CONSTRAINT pk_xCount PRIMARY KEY,<br /> &nbsp; &nbsp;Col1 int NULL)<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;INSERT xCount (Col1) VALUES (10)<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;INSERT xCount (Col1) VALUES (15)<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;INSERT xCount (Col1) VALUES (20)<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;INSERT xCount (Col1) VALUES (NULL)<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;SELECT AVG(Col1) AvgWithoutIsNullFunctionOnCol1,<br /> &nbsp; &nbsp;AVG(ISNULL(Col1,0)) AvgWithIsNullFunctionOnCol1,<br /> &nbsp; &nbsp;COUNT(Col1) NoIsNullFunctionOnCol1 ,<br /> &nbsp; &nbsp;COUNT(ISNULL(Col1,0)) UsingIsNullFunctionOnCol1,<br /> &nbsp; &nbsp;Count<img src="/page/image/emot/34.gif"/> UsingAsterisk<br /> &nbsp; &nbsp;FROM xCount<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;DROP TABLE xCount<br /> &nbsp; &nbsp;GO<br /> &nbsp; &nbsp;<br /> OUTPUT:<br />AvgWOIsNullFnctnCol1 AvgWIsNullFnctnCol1 WOIsNullFnctnCol1<br />WIsNullFnctnCol1 UsingAsterisk<br /> ---------------- ------------- -------------- ------------ &nbsp;<br /><br />15 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; <br /><br />恰当使用空表值 <br /><br />SQL Server可能出现一种特殊情况：在引用父表的一个表中，因为不允许空值，所以“声明引用完整性”（DRI）可能不会得到强制。即使父表不包含空值，在子表引用了父表主键约束或惟一约束的列中，也可能包含空值。 <br /><br />假如来自父表的值目前未知，就不会有任何问题。例如，父表可能是一个地址表，而子表可能包含联系信息。由于许多原因，可能暂时不知道要传给父表的联系地址。这是一种基于时间的问题，空值在其中或许是合适的。 <br /><br />如下例所示，我们创建父表，并在其中插入两个值。 <br /><br /><br /><br /><br />SET NOCOUNT ON<br /> &nbsp; &nbsp;GOCREATE TABLE Parent(pkey1 INT IDENTITY NOT NULL &nbsp; &nbsp;<br /> &nbsp; &nbsp;CONSTRAINT pkParent PRIMARY KEY,col1 INT NULL)GOINSERT <br /> &nbsp; &nbsp;Parent (col1) VALUES (284)GOINSERT <br /> &nbsp; &nbsp;Parent (col1) VALUES (326)GO &nbsp; <br /><br />以下代码则创建子表，并在引用父表的列中插入一个空值。 <br /><br /><br /><br /><br />CREATE TABLE Child<br /> &nbsp; &nbsp;(pkey1 INT IDENTITYCONSTRAINT pkChild <br /> &nbsp; &nbsp;PRIMARY KEY,Parentpkey1 INT NULLCONSTRAINT fkChildParent <br /> &nbsp; &nbsp;FOREIGN KEYREFERENCES Parent(pkey1),col1 INT NULL)<br /> &nbsp; &nbsp;GOINSERT Child (Parentpkey1, col1) VALUES (null,2)GO &nbsp; <br /><br />但在以下代码中，要同时从父表和子表选择值。虽然父表不包含空值，但在子表引用了父表的那个列中，将允许一个空值。 <br /><br /><br />然后丢弃所有表，清除这个演示所用的数据库对象。 <br /><br /><br /><br /><br />SELECT * FROM ChildGOSELECT * FROM ParentGODROP TABLE Child, ParentGO &nbsp; <br /><br /><br /><br /><br />在可以为空的外键中检查数据的有效性 <br /><br /><br />如果由两个列共同组成主键，而且一个子表将主键作为可为空值的外键来继承，就可能得到错误的数据。可在一个外键列中插入有效的值，但在另一个外键列中插入空值。然后，可添加一个数据表检查约束，在可为空的外键中检查数据的有效性。 <br /><br />任何多列外键都可能遇到同样的问题。所以，你需要添加一个检查约束来检测异常。最初，检查约束将检查构成外键的所有列中可能为空的值。检查约束还要检查这些列中不能为空的值。如两个检查都通过，问题就解决了。 <br /><br />以下示范脚本展示了这样的一个异常，以及如何用检查约束来纠正它。 <br /><br /><br /><br /><br /><br />空值是所有数据库开发者和管理员都要遇到的。所以，要想开发成功的应用程序，必须知道如何处理这些值。本文和你分享了空值处理的一些技巧和技术。 <br /><br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:40:29</pubdate></item><item><title>客户端备份和恢复MSSQL Server数据库</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/40.htm</link><description><![CDATA[摘要:本文以SQL SERVER为例，总结了常用的几种备份和恢复数据库的方法,分析了作业机制的原理，并提出了一种以作业机制实现恢复和备份数据库的方法。用户可以不打开数据库管理器，在应用程序客户端就可以方便地实现数据库的备份和恢复。 <br /><br /><br />关键词: 备份 恢复 作业机制 数据库 <br /><br /><br />1.概述 <br /><br /><br /><br />备份和恢复是数据库管理员维护数据库安全性和完整性的重要操作。备份是恢复数据库最容易和最能防止意外的保证方法。没有备份，所有的数据都可能会丢失。备份可以防止表和数据库遭受破坏、介质失效或用户错误而造成数据灾难。恢复是在意外发生后，利用备份来恢复数据库的操作。任何数据维护无论是基于C/S还是B/S的信息管理系统都必须具有备份和恢复数据库的功能。 <br /><br /><br />作为强大数据库SQL SERVER的管理器ENTERPRISE MANAGER，其本身也提供了几种实现和恢复数据库的方法,但这几种方法实现起来,都需要用户对ENTERPRISE MANAGER相当熟悉，而且处理步骤较繁锁，操作起来容易发生失误。因此我们就需要一种更加简便可行的实现方法。 <br /><br /><br />2.常用的备份和恢复数据库的方法 <br /><br /><br />在SQL SERVER ENTERPRISE MANAGER是一种强大的管理工具，它能完成很多功能，备份和恢复数据库是其中的一项基本功能。归结起来，借助这个管理工具有三种常用的方法实现备份和恢复数据库。 <br /><br /><br />⑴ 完全手工方式。在这种方式下，选择要备份和恢复的数据库，单击鼠标右键，在快捷菜单中的“ALL TASKS”下选择备份或者恢复数据库。这种方式，用户要进行很多步操作，其中要涉及到一些参数，使用起来容易出错，尤其对新手来讲，一旦操作失误可能带来很大的损失。 <br /><br />⑵ 半手工方式。这种方式就是管理员事先建立备份或者恢复数据库的作业，待到备份或者恢复数据库的时候，管理员打开“SQL SERVER ENTEPRISE MANAGER”，在“MANAGER”里找到相应的作业，然后执行之。这种方式，虽然是基于作业方式实现的，但是管理员必须打开数据库管理器，而且要在繁多的作业中进行选择。一旦选择错误并执行之，有可能带来意想不到的损失。 <br /><br />⑶ 全自动方式。在数据库管理器里面，管理员事先建立好恢复或者备份数据库的作业，然后定制一个执行计划，让计算机在特定的条件下自己执行备份和恢复操作。这种方式看起来简单、省事，但是机器在异常情况（如掉电）下，就不能按照计划执行了。 <br /><br />3．作业机制的工作原理 <br /><br />作业是ENTERPRISE MANAGER提供的一种定期处理数据的一种方法，前面提到的半手工方式和全自动方式虽然利用了作业，但它需要在ENTERPRISE MANAGER里启动和关闭作业；我们要讨论的是在应用程序客户端启动和关闭作业的机制。 <br /><br />作业机制的工作原理，由控制体和执行体两大部分构成。 <br /><br />控制体顾名思义就是控制作业执行的实体，靠具体编程实现。实现时，要调用MSDB数据库的系统存储过程SP_START _JOB,SP_END_JOB等等，同时要访问表SYSJOBHITORY，获取作业执行状态。 <br /><br /><br />执行体就是作业执行的整体，应用系统投入使用时建立。应用系统安装时，要建立数据库、备份和恢复设备、备份和恢复作业。 <br /><br />控制体由用户触发，启动相应的作业，交由执行体执行作业，在执行过程中，执行体执行的每一步状态信息都要写入MSDB数据库的SYSJOBHISTORY表里。同时，控制体不断获取执行状态信息，根据这些信息，控制体决定继续执行还是停止该作业。在作业执行完毕或者出错停止后，控制体向用户反馈执行结果。 <br /><br /><br /><br />4．以作业机制实现数据库的备份和恢复 <br /><br /><br /><br />为了便于解释我们以POWER BUILDER实现的一个具体系统为示例，首先看数据库备份的实现步骤。 <br /><br />4.1 执行体的建立 <br /><br />（1）建立应用系统的数据库XCCXXT。 <br /><br /><br /><br />（2）建立备份数据库所使用的设备XCCXXTBAK.DAT。 <br /><br /><br /><br />（3）建立备份作业XCCXXT BACKUP，其中命令行为BACKUP DATABASE XCCXXT TO DISK=“C：\MSSQL7\DATA\BACKUP\XCCXXTBAK.DAT”。 <br /><br />4.2 控制体的实现 <br /><br />在相应对象的“备份”按钮的click事件中写入以下代码： <br /><br /><br />//声明相应的变量<br />string ls_database,ls_pass,ls_date,ls_time<br />integer li_gs,li_gs_o<br />transaction login_trans<br />login_trans = creat transaction<br />IF MessageBox(&quot;提示信息&quot;,&quot;是否真的要进行数据备份操作？&quot;, &<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Exclamation!,OKCancel!,2)&lt;&gt;1 then return<br />//连接MSDB数据库<br />login_trans.database &nbsp; = &quot;msdb&quot;<br />connect using login_trans;<br />if login_trans.sqlcode &lt;&gt; 0 then<br />messagebox(&quot;数据库错误信息&quot;,login_trans.sqlerrtext)<br />return<br />end if<br />//检测上次该执行体执行结果,用以区别本次执行状况<br />select max(instance_id) into :li_gs_o from sysjobhistory using login_trans;<br />if isnull(li_gs_o) then li_gs_o =0<br />login_trans.autocommit = true<br />ls_pass = login_trans.logpass<br />//运行系统存储过程SP_START_JOB,启动执行体<br />prepare sqlsa from &quot;sp_start_job ?&quot; using login_trans;<br />if login_trans.sqlcode &lt;&gt; 0 then<br />messagebox(&quot;数据库错误信息&quot;,login_trans.sqlerrtext)<br />login_trans.autocommit = false<br />disconnect using login_trans;<br />login_trans.database = ls_database <br />return<br />end if<br />EXECUTE sqlsa USING ‘XCCXXT BACKUP’;<br />//检测执行体启动是否正常<br />if login_trans.sqlcode &lt;&gt; 0 then<br />messagebox(&quot;数据库错误信息&quot;,login_trans.sqlerrtext)<br />login_trans.autocommit = false<br />disconnect using login_trans;<br />return<br />end if<br />//检测执行体执行的整个过程<br />DO<br />uf_sleep (1)<br />select max(instance_id) into :li_gs from sysjobhistory using login_trans;<br />if isnull(li_gs) then li_gs =0<br />LOOP WHILE li_gs&lt;=li_gs_o+1<br />//运行系统存储过程SP_END_JOB,关闭执行体<br />prepare sqlsa from &quot;sp_end_job ?&quot; using login_trans;<br />if login_trans.sqlcode &lt;&gt; 0 then<br />messagebox(&quot;数据库错误信息&quot;,login_trans.sqlerrtext)<br />login_trans.autocommit = false<br />disconnect using login_trans;<br />login_trans.database = ls_database <br />return<br />end if<br />EXECUTE sqlsa USING ‘XCCXXT BACKUP’;<br />//返回执行结果<br />li_gs_o=li_gs - 1<br />select run_ <br /><br /><br />----------------------------------------------<br />s,run_date,run_time &nbsp;into :li_gs,:ls_date,<br />:ls_time from sysjobhistory where &nbsp;instance_id =:li_gs_o using login_trans; <br />if li_gs = 1 then <br />st_3.text = left(ls_date,4)+&#39;年&#39;+mid(ls_date,5,2)+&#39;月&#39;<br />+right(ls_date,2)+&#39;日&#39;+&#39; &#39;+&<br /> &nbsp; &nbsp;left(ls_time,2)+&#39;:&#39;+mid(ls_time,3,2)+&#39;:&#39;+right(ls_time,2)<br />messagebox(&#39;提示&#39;,&quot;数据库备份操作成功！&quot;)<br />else<br />messagebox(&#39;提示&#39;,&quot;数据库备份操作失败！&quot;)<br />end if<br />//断开与数据库MSDB的连接<br />login_trans.autocommit = false<br />disconnect using login_trans;<br />if login_trans.sqlcode &lt;&gt; 0 then<br />messagebox(&quot;数据库错误信息&quot;,login_trans.sqlerrtext)<br />end if &nbsp; <br /><br />4.3 备份数据库 <br /><br /><br /><br />用户单击“备份”按钮，系统就会备份XCCXXT数据库。结束时，会有相应成功与否的信息向用户提示。 <br /><br />备份是对数据库的进行读操作，执行体执行之前不需要检查用户对数据库的使用状态。而恢复则是对整个数据库进行写操作，在启动执行体之前一定要检查是否有数据库进行写操作，否则容易导致失败。其他恢复数据库的实现步骤类似与备份，限于篇幅此处从略。 <br /><br /><br />5. 结束语 <br /><br /><br />以作业机制实现数据库的恢复和备份，就是事先在建立备份和恢复数据库的作业，在应用程序客户端用控制体启动相应的执行体来实现之。用这种方式实现数据库的备份和恢复，用户不必打开数据库管理器进行操作，用户可以在任何一个应用程序客户端完成操作。 <br /><br /><br />作业机制打破了我们常规对大型数据库备份和恢复必须在数据库管理器里进行的局限性，利用作业机制解决了在应用程序客户端对数据库备份和恢复的难题，为在应用程序客户端实现复杂的数据库维护提供了一个思路。 <br /><br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:43:14</pubdate></item><item><title>HTML默认的CSS样式</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/41.htm</link><description><![CDATA[这个东西，在你需要还原默认值的时候，比较有用。 <br /><br /><br /><br />开始的时候 *{margin:0;padding:0;}，当需要使用边距的时候，就需要还原HTML默认CSS值了。 <br /><br />以前一直在找这份文档，今天偶然在w3上看到了。除了inline和block的定义，主要是要注意body|h1~h6|blockquote|menu|ul|ol|dd等标签的默认样式（margin和font-size）。 <br /><br /><br />html, address,<br />blockquote,<br />body, dd, div,<br />dl, dt, fieldset, form,<br />frame, frameset,<br />h1, h2, h3, h4,<br />h5, h6, noframes,<br />ol, p, ul, center,<br />dir, hr, menu, pre &nbsp; { display: block }<br />li &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ display: list-item }<br />head &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ display: none }<br />table &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { display: table }<br />tr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ display: table-row }<br />thead &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { display: table-header-group }<br />tbody &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { display: table-row-group }<br />tfoot &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { display: table-footer-group }<br />col &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { display: table-column } <br /><br /><br /><br />colgroup &nbsp; &nbsp; &nbsp; &nbsp;{ display: table-column-group }<br />td, th &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ display: table-cell; }<br />caption &nbsp; &nbsp; &nbsp; &nbsp; { display: table-caption }<br />th &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-weight: bolder; text-align: center }<br />caption &nbsp; &nbsp; &nbsp; &nbsp; { text-align: center }<br />body &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ margin: 8px; line-height: 1.12 }<br />h1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-size: 2em; margin: .67em 0 }<br />h2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-size: 1.5em; margin: .75em 0 }<br />h3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-size: 1.17em; margin: .83em 0 }<br />h4, p,<br />blockquote, ul,<br />fieldset, form,<br />ol, dl, dir,<br />menu &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ margin: 1.12em 0 } <br />h5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-size: .83em; margin: 1.5em 0 }<br />h6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-size: .75em; margin: 1.67em 0 }<br />h1, h2, h3, h4,<br />h5, h6, b,<br />strong &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ font-weight: bolder }<br />blockquote &nbsp; &nbsp; &nbsp;{ margin-left: 40px; margin-right: 40px }<br />i, cite, em,<br />var, address &nbsp; &nbsp;{ font-style: italic }<br />pre, tt, code,<br />kbd, samp &nbsp; &nbsp; &nbsp; { font-family: monospace }<br />pre &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { white-space: pre }<br />button, textarea,<br />input, object, <br />select &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ display:inline-block; }<br />big &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { font-size: 1.17em }<br />small, sub, sup { font-size: .83em }<br />sub &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { vertical-align: sub } <br /><br />sup &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { vertical-align: super }<br />table &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { border-spacing: 2px; }<br />thead, tbody,<br />tfoot &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { vertical-align: middle }<br />td, th &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ vertical-align: inherit }<br />s, strike, del &nbsp;{ text-decoration: line-through }<br />hr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ border: 1px inset }<br />ol, ul, dir,<br />menu, dd &nbsp; &nbsp; &nbsp; &nbsp;{ margin-left: 40px }<br />ol &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ list-style-type: decimal }<br />ol ul, ul ol,<br />ul ul, ol ol &nbsp; &nbsp;{ margin-top: 0; margin-bottom: 0 }<br />u, ins &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ text-decoration: underline }<br />br:before &nbsp; &nbsp; &nbsp; { content: &quot;\A&quot; }<br />:before, :after { white-space: pre-line } <br />center &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ text-align: center }<br />abbr, acronym &nbsp; { font-variant: small-caps; letter-spacing: 0.1em }<br />:link, :visited { text-decoration: underline }<br />:focus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ outline: thin dotted invert }<br /><br />/* Begin bidirectionality settings (do not change) */<br />BDO[DIR=&quot;ltr&quot;] &nbsp;{ direction: ltr; unicode-bidi: bidi-override }<br />BDO[DIR=&quot;rtl&quot;] &nbsp;{ direction: rtl; unicode-bidi: bidi-override }<br /><br />*[DIR=&quot;ltr&quot;] &nbsp; &nbsp;{ direction: ltr; unicode-bidi: embed }<br />*[DIR=&quot;rtl&quot;] &nbsp; &nbsp;{ direction: rtl; unicode-bidi: embed }<br /><br />@media print {<br /> &nbsp;h1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ page-break-before: always }<br /> &nbsp;h1, h2, h3,<br /> &nbsp;h4, h5, h6 &nbsp; &nbsp;{ page-break-after: avoid }<br /> &nbsp;ul, ol, dl &nbsp; &nbsp;{ page-break-before: avoid }]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:44:32</pubdate></item><item><title>Dreamweaver8实用技巧</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/42.htm</link><description><![CDATA[1、从外部文档中粘贴时，如果不想要其格式，只要文字，可以使用“Edit-&gt;paste as text”命令，而不要直接Ctrl+V。 <br /><br />　　2、“Command-&gt;Add/Remove Netscape resize fix”是一个很有用的命令，它可以使在NC4.0中浏览页面时，改变窗口大小的时候页面不会花掉。 <br /><br /><br /><br />　　3、所有的head元素不可成为库组件，所有元素在被insert library时，其head关联属性被去掉，如style、CSS属性。 <br /><br /><br /><br />　　4、library组件和template模板不用上传服务器，就可以正确预览使用了该组件或模板的页面。 <br /><br />　　5、使用“check plugin”behavior来确定访问者浏览器是否安装flash插件，有时候会判断失误，比如明明装了插件却报告没有安装。最好在flash的publish里面设置清楚，而不是简单的输出成.swf文件。 <br /><br />　　6、不要在同一个页面同时使用表格和层来布置，在Netscape中会导致混乱，从属关系除外。 <br /><br /> &nbsp; &nbsp;7、使用层的时候最好定义为div标签而不是layer，因为前者在两种主流浏览器都有很好的 兼容性。 <br /><br /><br />　　8、在用图片制作热区链接时，最好给热区命名，防止有时只能在图片上画出直线。 <br /><br />　　9、当我们将框架结构建立好后，可以将此框架体文件和Site窗体并排放置，然后从Site中选择网页文件拖放到相应的框架中。这适用于框架比较复杂的页面。 <br /><br /><br /><br /> &nbsp; &nbsp;10、如果对一张图片不满意，想更换另一张，最简单的方法双击此图片，直接选择要替换的图片即可。 <br /><br />　　11、在预览网页之前最好先保存一下，有时候在不能正确预览网页，而存一下就可能会解决这个问题。 <br /><br /><br /><br />　　12、如果你的页面中使用了CSS或是Java Applet，最好不要使用“file-&gt;convert-&gt;3.0 browser compatible”命令，因为这一选择会把所有3.0 浏览器不认识的定义都抹去。最可怕的是我们不知道在这个过程中Dreamweaver 到底做了什么，具体发生了那些变化。而且要提醒你，对一批页面执行此操作时，一定要先备份，否则可没地方买后悔药。 <br /><br /><br /> &nbsp; &nbsp;13、没有任何内容的表格单元在NC中不会显示出来，这时可以插入透明的gif来解决这个问题。 <br /><br />　　14、design note只能在本地的dreamweaver中被调用，而网页浏览者下载此页面却看不到这一注释。如果你希望别人也能看到，可使用comment功能。 <br /><br />　　15、使用“hide/show layer”Behavior后，如果在Netscape中有个别的图层无法显示出来，可以在dreamweaver中删掉此图层，再重新定义它，一切就正常了。 <br /><br /> &nbsp; &nbsp;16、表格的特点是只有整个表格的内容全部被浏览器down下来才会一次性显示，所以表格里面东西太多，可能浏览器要花很长时间去下载而屏幕上始终没内容。 如果表格太长，要么嵌套一下，要么分成几个表格以加快显示。最好把表格在在纵向分开，比如原来一个3行3列的表格，将其改为3个1行3列的表格。 <br /><br />　　17、尽量不要在表格单元里面放层，不过在层里面放表格基本没问题。<br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:45:38</pubdate></item><item><title>Html 书签的使用</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/43.htm</link><description><![CDATA[当网页内容太长或要导航到其它页面的一个具体位置时，可以使用 &nbsp;Html 中书签。<br />1.同一个web页面链接 <br />首先设计书签 <br /><br />&lt;a name=”top”&gt;&lt;/a&gt;<br /> &nbsp;<br /><br />在不同位置定义 <br /><br /><br />&lt;a href=”#top”&gt;返回到top位置&lt;/a&gt; <br /><br /><br /><br /><br />2.不同的页面之间转接 <br /><br /><br />如果是在不同的页面之间链接时要在href属性中加上网页名称。 <br /><br /><br />First.html中定义了书签 <br /><br />&lt;a name=”top”&gt;Top的位置&lt;/a&gt; <br /><br /><br />现在要从Second.html中转入First.html并且将位置定到top所在的位置 <br /><br />可以设置 <br /><br /><br /><br />&lt;a href=”first.html#top”&gt;return first Top&lt;/a&gt; <br /><br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:46:59</pubdate></item><item><title>用CSS制作隐藏菜单</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/44.htm</link><description><![CDATA[简洁的隐藏垂直菜单在hover时将内容展开。这样的效果在JS里有很多个版本，但这个可以说是绝无仅有的CSS版本。此菜单可以在IE5.5,IE6,IE7,FF,Opera,NS8以及MacFF1.5和Safari里正常显示，虽然Mac IE5.X里可能会有些问题。 <br />CSS 代码<br />以下是引用片段： /* 共用样式 */ .menu { font-family: verdana, sans-serif; &nbsp;position:relative; &nbsp;font-family: tahoma, geneva, &quot;lucida sans unicode&quot;, &quot;lucida grande&quot;,verdana, sans-serif; margin-bottom:220px; } .menu ul { padding:0; &nbsp;margin:0; list-style-type: none; } .menu ul li { position:relative; float:left; } .menu ul li a, .menu ul li a:visited { display:block; &nbsp;text-decoration:none; &nbsp;width:25px; height:100px; font-weight:bold; background:transparent url(../../updata/tab.gif) top right no-repeat; &nbsp;text-indent:-999px; } .menu ul li ul { visibility:hidden; position:absolute; width:190px; top:0; &nbsp;left:0; border:1px solid #444; } table { margin:0; padding:0; border:0; &nbsp;border-collapse:collapse; font-size:1em; } /* 非IE浏览器专用 */ .menu ul li:hover a { color:#fff; width:215px; } .menu ul li:hover ul { visibility:visible; } .menu ul li:hover ul li a { display:block; &nbsp;background:#eee; border:0; margin:0; text-indent:0; color:#333; font-weight:normal; &nbsp;font-size:0.9em; height:auto; &nbsp;line-height:1em; &nbsp;padding:5px; &nbsp;width:180px; text-align:left; } .menu ul li:hover ul li a:hover { background:#888; &nbsp;color:#fff; } 如果是要支持IE6则要加上: .menu ul li a:hover { width:215px; } .menu ul li a:hover ul { visibility:visible; } .menu ul li a:hover ul li a { display:block; &nbsp;background:#eee; border:0; margin:0; text-indent:0; color:#333; font-weight:normal; &nbsp;font-size:0.9em; height:auto; &nbsp;line-height:1em; &nbsp;padding:5px; &nbsp;width:190px; w\idth:180px; text-align:left; } .menu ul li a:hover ul li a:hover { background:#888; &nbsp;color:#fff; } &nbsp; 生效的XHTML代码<br />以下是引用片段：&lt;div class=&quot;menu&quot;&gt; &lt;ul&gt; &nbsp; &lt;li&gt;&lt;a class=&quot;drop&quot; href=&quot;../menu/index.html&quot;&gt;MENU &nbsp; &lt;!--[if IE 7]&gt;&lt;!--&gt; &nbsp; &lt;/a&gt; &nbsp; &lt;!--&lt;![endif]--&gt; &lt;table&gt;&lt;tr&gt;&lt;td&gt; &nbsp;&lt;ul&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/zero_dollars.html&quot; title=&quot;The zero dollar ads page&quot;&gt;zero dollars advertising page&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/embed.html&quot; title=&quot;Wrapping text around images&quot;&gt;wrapping text around images&lt;/a&gt;&lt;/li&gt; &nbsp;&lt;li&gt;&lt;a href=&quot;../menu/form.html&quot; title=&quot;Styling forms&quot;&gt;styled form&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/nodots.html&quot; title=&quot;Removing active/focus borders&quot;&gt;active focus&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/shadow_boxing.html&quot; title=&quot;Multi-position drop shadow&quot;&gt;shadow boxing&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/old_master.html&quot; title=&quot;Image Map for detailed information&quot;&gt;image map for detailed information&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/bodies.html&quot; title=&quot;fun with background images&quot;&gt;fun with background images&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;li&gt;&lt;a href=&quot;../menu/fade_scroll.html&quot; title=&quot;fade-out scrolling&quot;&gt;fade scrolling&lt;/a&gt;&lt;/li&gt; &nbsp;&lt;li&gt;&lt;a href=&quot;../menu/em_images.html&quot; title=&quot;em size images compared&quot;&gt;em image sizes compared&lt;/a&gt;&lt;/li&gt; &nbsp; &lt;/ul&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;!--[if lte IE 6]&gt; &nbsp; &lt;/a&gt; &nbsp; &lt;![endif]--&gt; &lt;/li&gt; &nbsp; &lt;/ul&gt; &lt;/div&gt;]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:47:38</pubdate></item><item><title>CSS应用实例：水平线变成虚线</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/45.htm</link><description><![CDATA[如何用CSS把水平线变成虚线？<br /><br />答案一： 以下是引用片段：<br />&lt;hr size=&quot;1&quot; noshade=&quot;noshade&quot; style=&quot;border:1px #cccccc dotted&quot;/&gt; <br /><br />答案二： <br /><br /><br />以下是引用片段：<br />&lt;div id=&quot;aaa&quot; style=&quot;border-top:1px dashed #cccccc;height: 1px;overflow:hidden;&quot;&gt;&lt;a href=&quot;<a target="_blank" href="/page/link.asp?url=http://www.yangyunwei.com/&quot">http://www.yangyunwei.com/&quot</a>;&gt;杨云伟个人网站&lt;/a&gt;&lt;/div&gt; <br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:52:0</pubdate></item><item><title>在DIV+CSS排版中新闻列表的制作方法</title><link>http://www.yangyunwei.com/bbs/web/2007-2-13/46.htm</link><description><![CDATA[最终效果:<br /><br />2005年5月30日 新闻标题01 <br />2005年5月30日 新闻标题02 <br />2005年5月30日 新闻标题03 <br />2005年5月30日 新闻标题04 <br />CSS代码: <br /><br /><br /> <br />.list{ <br /> &nbsp; &nbsp;margin: 0px 10px 20px; <br /> &nbsp; &nbsp;text-align: left; &nbsp; &nbsp; <br />} <br /><br />.list ul{ <br /> &nbsp; &nbsp;list-style-type: none; <br /> &nbsp; &nbsp;margin: 0px; <br /> &nbsp; &nbsp;padding: 0px; <br />} <br /><br />.list li{ <br /> &nbsp; &nbsp;background: url(/imagelist/06/31/gu432qq5q695.gif) repeat-x bottom; &nbsp;<br /> &nbsp; &nbsp;/*列表底部的虚线*/ <br /> &nbsp; &nbsp;width: 100%; &nbsp; &nbsp; <br />} <br /><br />.list li a{ <br /> &nbsp; &nbsp;color: #777777; <br /> &nbsp; &nbsp;display: block; <br /> &nbsp; &nbsp;padding: 6px 0px 4px 15px; <br /> &nbsp; &nbsp;background: url(/imagelist/06/31/7ei20115t3sv.gif) no-repeat 0 6px; <br /> &nbsp; &nbsp;/*列表左边的箭头图片*/ <br />} <br /><br />.list li span{ <br /> &nbsp; &nbsp;float: right;/*使span元素浮动到右面*/ <br /> &nbsp; &nbsp;text-align: right;/*日期右对齐*/ <br />} <br /><br />.list li a:hover{ <br /> &nbsp; &nbsp;color: #336699; <br /> &nbsp; &nbsp;background: url(/imagelist/06/31/jq1ysff5b0ac.gif) repeat-x bottom; <br />} <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;注意:span一定要放在前面,反之会产生换行 <br /><br /><br /><br /> <br />&lt;ul class=&quot;list&quot;&gt; <br />&lt;li&gt;&lt;span&gt;2005年5月30日 &lt;/span&gt;&lt;a href=&quot;#&quot;&gt;新闻标题01&lt;/a&gt;&lt;/li&gt; <br />&lt;li&gt;&lt;span&gt;2005年5月30日 &lt;/span&gt;&lt;a href=&quot;#&quot;&gt;新闻标题02&lt;/a&gt;&lt;/li&gt; <br />&lt;li&gt;&lt;span&gt;2005年5月30日 &lt;/span&gt;&lt;a href=&quot;#&quot;&gt;新闻标题03&lt;/a&gt;&lt;/li&gt; <br />&lt;li&gt;&lt;span&gt;2005年5月30日 &lt;/span&gt;&lt;a href=&quot;#&quot;&gt;新闻标题04&lt;/a&gt;&lt;/li&gt; <br />&lt;/ul&gt;]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-13 9:53:43</pubdate></item><item><title>关于Asp中代码与页面的分离</title><link>http://www.yangyunwei.com/bbs/web/2007-2-14/49.htm</link><description><![CDATA[为了避免ASP程序和HTML代码混写造成维护困难的情况，本文介绍了一种方法，利用模板来分离程序和页面，使程序设计更加轻松。<br />在使用ASP制作一个站点的时候，常常会出现一个ASP文件中，程序代码和HTML代码混合的情况。这样子做有许多缺点：<br />1.且不说编程时就要对页面布局进行设计和编排，造成代码混乱难懂，不规范；<br />2.当需要改变页面外观时，你不仅要改变HTML部份，也需要改变ASP代码，不易维护。<br />那么，要如何才能避免这些麻烦呢？<br />答案就是使用模板文件，将ASP代码和HTML页面分开，一切问题就都解决了。使用模板有以下好处：<br />1.在很短的时间内可以替换整个站点的外观；<br />2.使程序员可以抽象编程，而无须接触HTML代码；<br />3.可以重复利用以前的模板。<br /><br />使用过PHP的程序就会知道，PHP有个模板程序(FastTemplate)，现在的问题是如何在ASP中实现类似的功能。<br />Microsoft的ASP带有两种脚本：VBScript和JScript。它们都带有一个正则表达式对象(RegExp)，利用字符串对象和RegExp对象，就可以轻松的实现模板功能。沐枫以此编写了一个Template.JScript.INC文件，此文件的内容附在文章后面。有能力的读者可以根据自己的需要进行改进。<br />下面介绍一下使用方法。由于此文件是使用JScript编写的（当然要转成VBScript也很容易），因此，缺省脚本语言要设为JScript，即ASP程序第一行应为：%@Language=JScript%，然后再包含模板程序文件：!#includefile=Template.JScript.INC。<br />先介绍一下Template类的使用：<br />1.建立Template对象：Template(Path)<br />参数：Path(字符串类型)HTML模板文件的存放路径。<br />使用new操作符建立Template对象。<br />例子：<br />vartpl=newTemplate(c:\\template);<br />在程序中可以用tpl.TplPath来取得模板路径，也可以通过tpl.TplPath来改变模板路径。<br />如：<br />tpl.TplPath=d:\\template;<br />2.装载模板文件：Template.Load(Name,File)<br />参数：Name(字符串类型)是一个模板变量名。<br />File(字符串类型)模板文件名。此文件存放在HTML模板路径下。<br />读取文件File到模板变量Name中。<br />例子：<br />tpl.Load(Main,TEST.HTM);<br />此时，模板变量Main就包含了文件TEST.HTM的内容。<br />你可以用tpl.Main来访问模板变量Main。<br />例子：<br />%=tpl.Main%<br />将显示刚才读进来的TEST.HTM文件内容。<br />3.模板分拆：Template.Split(Name)<br />参数：Name(字符串类型)是一个模板变量名。<br />将Name中的子模板分解。<br />例子：<br />先假设上例中的TEST.HTM内容为：<br />-<br />这是主模板。接下来是：!#TPLDEFSUBSUB子模板，还有<br />!#TPLDEFTHIRDTHIRD模板。!#TPLENDTHIRD<br />!#TPLENDSUB<br />-<br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-14 12:3:46</pubdate></item><item><title>两行代码搞定多级关联搜索</title><link>http://www.yangyunwei.com/bbs/web/2007-2-28/54.htm</link><description><![CDATA[&lt;?php<br />/*<br /> &nbsp; &nbsp; &nbsp; &nbsp;Name: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Search.class.php<br /> &nbsp; &nbsp; &nbsp; &nbsp;Author: &nbsp; &nbsp; &nbsp; &nbsp; Genghonghao<br /> &nbsp; &nbsp; &nbsp; &nbsp;Revisions: &nbsp; &nbsp; &nbsp; &nbsp;2006/12/16<br /> &nbsp; &nbsp; &nbsp; &nbsp;功能 &nbsp; &nbsp; : &nbsp; 多条件关联查寻类<br />*/<br />class Search extends Mysql_Class <br />{<br /> &nbsp; &nbsp; &nbsp; &nbsp;/**<br /> &nbsp; &nbsp; &nbsp; &nbsp; * $dbname:数据库名<br /> &nbsp; &nbsp; &nbsp; &nbsp; * $searchfiled:查询的字段名例如：SELECT username,userage,usersex FROM<br /> &nbsp; &nbsp; &nbsp; &nbsp; * $termfiled查询的条件的字段,where后面的字段名。例如：如WHERE USERID&lt;&gt;25 AND usersex=1<br /> &nbsp; &nbsp; &nbsp; &nbsp; * $termvalue查询条件对应的值和条件符号，例如：=@1@,&lt;&gt;@25@,like &#39;%@com@%&#39;等，最之是条件表达式右侧的东西和$termfiled数组一一对应， <br /><br /> &nbsp; &nbsp; &nbsp; &nbsp; * 且下标必需为数字,通常情况下符号右边可能是变量，所以变量的前后一定要加上&#39;@&#39;符号<br /> &nbsp; &nbsp; &nbsp; &nbsp; * <br /> &nbsp; &nbsp; &nbsp; &nbsp; */<br /> &nbsp; &nbsp; &nbsp; &nbsp;private $dbname; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;private $searchfiled = array(); &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;private $termfiled = array(); &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp;private $termvalue = array();<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp;/**<br /> &nbsp; &nbsp; &nbsp; &nbsp; * 设置所有属性的值,参数为两个属性和其值<br /> &nbsp; &nbsp; &nbsp; &nbsp; */<br /> &nbsp; &nbsp; &nbsp; &nbsp;public function __construct($dbv,$sv,$fiv,$vv)<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$this-&gt;SetPm($dbv,$sv,$fiv,$vv);<br /> &nbsp; &nbsp; &nbsp; &nbsp;} <br /><br /><br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;/**<br /> &nbsp; &nbsp; &nbsp; &nbsp; * 设置所有属性的值<br /> &nbsp; &nbsp; &nbsp; &nbsp; * <br /> &nbsp; &nbsp; &nbsp; &nbsp; */<br /> &nbsp; &nbsp; &nbsp; &nbsp;public function SetPm($v1,$v2,$v3,$v4)<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self::__set(&#39;dbname&#39;,$v1);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self::__set(&#39;searchfiled&#39;,$v2);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self::__set(&#39;termfiled&#39;,$v3);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self::__set(&#39;termvalue&#39;,$v4);<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp;// * 设置属性的值的函数<br /> &nbsp; &nbsp; &nbsp; &nbsp;public function __set($pmname,$value)<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(isset($value)) <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$this-&gt;$pmname = $value;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return null;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;/**<br /> &nbsp; &nbsp; &nbsp; &nbsp; * 参数$id是WHERE 后边跟的第一个字段名用来进行第一次判断<br /> &nbsp; &nbsp; &nbsp; &nbsp; * 参数$value是字段$id的默认值<br /> &nbsp; &nbsp; &nbsp; &nbsp; * 参数$emblem是条件判断的符号，例如&gt;,&lt;,&lt;&gt;等<br /> &nbsp; &nbsp; &nbsp; &nbsp; * 参数$last是SQL语句最部分，可以为空 <br /> &nbsp; &nbsp; &nbsp; &nbsp; * */<br /> &nbsp; &nbsp; &nbsp; &nbsp;public function GetSearch($id,$emblem=&quot;&lt;&gt;&quot;,$emblemvalue=0,$last=&quot;ORDER BY subtime DESC&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$termfiled = $this-&gt;termfiled;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$termvalue = $this-&gt;termvalue;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$filenum = count($this-&gt;termvalue);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(count($this-&gt;termfiled) != count($this-&gt;termvalue))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return null;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$filed = &quot;&quot;;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach($this-&gt;searchfiled as $value)<br /> &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;$filed .= $value.&quot;,&quot;;<br /> &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;$fnum = strlen($filed);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$filed = substr($filed,0,($fnum-1));<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql = &quot;SELECT &quot;; <br /><br /><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql .= $filed;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql .= &quot; FROM &quot;;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql .= $this-&gt;dbname;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql .= &quot; WHERE {$id}{$emblem}{$emblemvalue} &quot;;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for($i=0;$i&lt;$filenum;$i++)<br /> &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;//$termvalue[$i] = str_replace(&quot; &quot;,&quot;&quot;,$termvalue[$i]);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(!strstr($termvalue[$i],&quot;@@&quot;) and !strstr($termvalue[$i],&quot;\&quot;\&quot;&quot;) and !strstr($termvalue[$i],&quot;%%&quot;)) <br /><br /> &nbsp; &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; &nbsp;$termvalue[$i] = str_replace(&quot;@&quot;,&quot;&quot;,$termvalue[$i]);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql.= &quot;AND {$termfiled[$i]}{$termvalue[$i]} &quot;;<br /> &nbsp; &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;}<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(!empty($last))<br /> &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;$sql.=$last;<br /> &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;// * Execute为父类中的数据据库操作方法，返回的值是数组！<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return parent::Execute($sql);<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br />}<br />?&gt;<br />实例:<br />&lt;?php<br />include_once(&#39;include/common.inc.php&#39;);<br />include_once(&#39;include/Search.class.php&#39;); &nbsp;// 调用这个文件<br />$table = &quot;tax_codex&quot;; &nbsp;//查寻的数据库表名<br />$filedd = array(&#39;Title&#39;,&#39;Text&#39;); //要查寻的字段<br />$term &nbsp;= array(&#39;Click&#39;,&#39;City&#39;,&#39;Title&#39;); // 要查寻的条件字段<br />$termv = array(&#39;&gt;@0@&#39;,&#39;=&quot;@上海@&quot;&#39;,&#39; LIKE &quot;%@中国@%&quot;&#39;); // 要查寻的条件 <br />$objsql = new Mysql_Class(); &nbsp;<br />$objsearch = new Search($table,$filedd,$term,$termv); &nbsp;// 实例化这个类<br />$print_arr = $objsearch-&gt;GetSearch(&#39;CodexId&#39;,&quot;&lt;&gt;&quot;,&quot;0&quot;,&quot;ORDER BY SubTime DESC&quot;); // 调用类中方法行到结果数组<br />print_r($print_arr); // 打印出数组中的值.<br />?&gt;<br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-2-28 13:14:4</pubdate></item><item><title>MYSQL5重置root密码</title><link>http://www.yangyunwei.com/bbs/web/2007-3-8/62.htm</link><description><![CDATA[操作系统：DEBIAN Linux 3.1 <br />MYSQL数据库版本：5.0.27 <br /><br />（1）以 系统root权限登陆 <br /><br /><br /><br />（2）停止MYSQL服务器：<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mysql.server stop <br /><br /><br />（3）跳过授权表执行MYSQL服务器：<br /> &nbsp; &nbsp; &nbsp; &nbsp; mysqld_safe --skip-grant-tables --skip-networking &<br /> &nbsp; &nbsp; &nbsp; &nbsp;(注：参数--skip-grant-tables为跳过授权表；--skip-networking为不监听TCP/IP连接) <br /><br />（4）执行MYSQL客户端：<br /> &nbsp; &nbsp; &nbsp; &nbsp; mysql <br /><br />（5）使用mysql数据库<br /> &nbsp; &nbsp; &nbsp; &nbsp; use mysql; <br /><br />（6）更新root密码<br /> &nbsp; &nbsp; &nbsp; &nbsp; update user set password=password(&#39;新密码&#39;) where user=&#39;root&#39;; <br /><br /><br />（7）关闭mysql服务器，用正常方试起动 <br /><br /><br />本文非原创，也不是转贴，一部分是在书上看到的，一部分是在网上找的。如果您用的不是我这个版本，可以在mysql的安装目录中找一个适合您当前版本的mysqld_safe，后面加上--skip-grant-tables来跳过授权表，我书上所用的mysqld_safe版本为&quot;safe_mysqld&quot;(其实写到这里我好像想起来了，在哪看到过说5.0以后把sqfe_mysqld改成mysqld_safe了，这害得我在网上找了半天) <br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-3-8 13:47:50</pubdate></item><item><title>杨大哥帮个忙.JS 的</title><link>http://www.yangyunwei.com/bbs/web/2007-3-11/65.htm</link><description><![CDATA[我要弄个用COOKIES 来控制 &nbsp; &nbsp; 的 让一段代码显示3次然后就不显示了. &nbsp; 一个朋友给了下边一段代码 你给看看有问题没? 没问题的话 给说说这咋用呢.谢谢 了..<br /><br />[quote]cc=getCookie(&quot;ccount&quot;);<br />if(cc&gt;3) return;<br />else{<br /> &nbsp;cc=cc+1;<br /> &nbsp;setCookie(&quot;ccount&quot;,cc);<br />}<br />//你的代码<br /><br /><br />function delCookie(name){<br />var today=new Date()<br />var expires=new Date()<br />expires.setTime(today.getTime()-1000*86400*365)<br />document.cookie=name+&quot;=&quot;+escape(&quot;nop&quot;) &nbsp; &nbsp; &nbsp; &nbsp;+&quot;;expires=&quot;+expires.toGMTString()<br />}<br /><br />function setCookie(name,value){<br />var argv=setCookie.arguments;<br />var argc=setCookie.arguments.length;<br />var days=(argc&gt;2)?argv[2]:365;<br />var expires=new Date();<br />expires.setTime(new Date().getTime()+86400000*days)<br />document.cookie=name+&quot;=&quot;+escape(value) &nbsp; &nbsp; &nbsp; &nbsp;+&quot;;expires=&quot;+expires.toGMTString()<br />}<br /><br /><br /><br />function getCookie(Name){<br />var search=Name+&quot;=&quot;<br />if(document.cookie.length&gt;0){<br />offset=document.cookie.indexOf(search)<br />if(offset!=-1){<br />offset+=search.length<br />end=document.cookie.indexOf(&quot;;&quot;,offset)<br />if(end==-1) end=document.cookie.length<br />return unescape(document.cookie.substring(offset,end))<br />}<br />}<br />return &quot;&quot;<br />} </blockquote><br />帮帮忙 谢谢了.]]></description><category>在线交流</category><author>kain</author><pubdate>2007-3-11 23:22:13</pubdate></item><item><title>sql server 带列名导出至excel</title><link>http://www.yangyunwei.com/bbs/web/2007-4-4/73.htm</link><description><![CDATA[--sql语句就用下面的存储过程 <br />/*--数据导出Excel <br /><br />导出查询中的数据到Excel,包含字段名,文件为真正的Excel文件<br />,如果文件不存在,将自动创建文件<br />,如果表不存在,将自动创建表<br />基于通用性考虑,仅支持导出标准数据类型<br />--邹建 2003.10--*/ <br /><br />/*--调用示例 <br /><br />p_exporttb @sqlstr=&#39;select * from 地区资料&#39;<br />,@path=&#39;c:\&#39;,@fname=&#39;aa.xls&#39;,@sheetname=&#39;地区资料&#39;<br />--*/<br />if exists (select * from dbo.sysobjects where id = object_id(N&#39;[dbo].[p_exporttb]&#39;) and OBJECTPROPERTY(id, N&#39;IsProcedure&#39;) = 1)<br />drop procedure [dbo].[p_exporttb]<br />GO <br />create proc p_exporttb<br />@sqlstr sysname, --查询语句,如果查询语句中使用了order by ,请加上top 100 percent<br />@path nvarchar(1000), --文件存放目录<br />@fname nvarchar(250), --文件名<br />@sheetname varchar(250)=&#39;&#39; --要创建的工作表名,默认为文件名<br />as <br />declare @err int,@src nvarchar(255),@desc nvarchar(255),@out int<br />declare @obj int,@constr nvarchar(1000),@sql varchar(8000),@fdlist varchar(8000) <br />--参数检测<br />if isnull(@fname,&#39;&#39;)=&#39;&#39; set @fname=&#39;temp.xls&#39;<br />if isnull(@sheetname,&#39;&#39;)=&#39;&#39; set @sheetname=replace(@fname,&#39;.&#39;,&#39;#&#39;) <br /><br />--检查文件是否已经存在<br />if right(@path,1)&lt;&gt;&#39;\&#39; set @path=@path+&#39;\&#39;<br />create table #tb(a bit,b bit,c bit)<br />set @sql=@path+@fname<br />insert into #tb exec master..xp_fileexist @sql <br />--数据库创建语句<br />set @sql=@path+@fname<br />if exists(select 1 from #tb where a=1)<br />set @constr=&#39;DRIVER={Microsoft Excel Driver (*.xls)};DSN=&#39;&#39;&#39;&#39;;READONLY=FALSE&#39;<br /> &nbsp; &nbsp;+&#39;;CREATE_DB=&quot;&#39;+@sql+&#39;&quot;;DBQ=&#39;+@sql<br />else<br />set @constr=&#39;Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=&quot;Excel 5.0;HDR=YES&#39;<br />+&#39;;DATABASE=&#39;+@sql+&#39;&quot;&#39; <br /><br />--连接数据库<br />exec @err=sp_oacreate &#39;adodb.connection&#39;,@obj out<br />if @err&lt;&gt;0 goto lberr <br /><br />exec @err=sp_oamethod @obj,&#39;open&#39;,null,@constr<br />if @err&lt;&gt;0 goto lberr <br />--创建表的SQL<br />declare @tbname sysname<br />set @tbname=&#39;##tmp_&#39;+convert(varchar(38),newid())<br />set @sql=&#39;select * into [&#39;+@tbname+&#39;] from(&#39;+@sqlstr+&#39;) a&#39;<br />exec(@sql) <br />select @sql=&#39;&#39;,@fdlist=&#39;&#39;<br />select @fdlist=@fdlist+&#39;,&#39;+a.name<br />,@sql=@sql+&#39;,[&#39;+a.name+&#39;] &#39;<br />+case when b.name in(&#39;char&#39;,&#39;nchar&#39;,&#39;varchar&#39;,&#39;nvarchar&#39;) then<br />&#39;text(&#39;+cast(case when a.length&gt;255 then 255 else a.length end as varchar)+&#39;)&#39;<br />when b.name in(&#39;tynyint&#39;,&#39;int&#39;,&#39;bigint&#39;,&#39;tinyint&#39;) then &#39;int&#39;<br />when b.name in(&#39;smalldatetime&#39;,&#39;datetime&#39;) then &#39;datetime&#39;<br />when b.name in(&#39;money&#39;,&#39;smallmoney&#39;) then &#39;money&#39;<br />else b.name end<br />FROM tempdb..syscolumns a left join tempdb..systypes b on a.xtype=b.xusertype<br />where b.name not in(&#39;image&#39;,&#39;text&#39;,&#39;uniqueidentifier&#39;,&#39;sql_variant&#39;,&#39;ntext&#39;,&#39;varbinary&#39;,&#39;binary&#39;,&#39;timestamp&#39;)<br />and a.id=(select id from tempdb..sysobjects where name=@tbname)<br />select @sql=&#39;create table [&#39;+@sheetname<br />+&#39;](&#39;+substring(@sql,2,8000)+&#39;)&#39;<br />,@fdlist=substring(@fdlist,2,8000) <br /><br />exec @err=sp_oamethod @obj,&#39;execute&#39;,@out out,@sql<br />if @err&lt;&gt;0 goto lberr <br />exec @err=sp_oadestroy @obj <br /><br />--导入数据<br />set @sql=&#39;openrowset(&#39;&#39;MICROSOFT.JET.OLEDB.4.0&#39;&#39;,&#39;&#39;Excel 5.0;HDR=YES<br />;DATABASE=&#39;+@path+@fname+&#39;&#39;&#39;,[&#39;+@sheetname+&#39;$])&#39; <br /><br />exec(&#39;insert into &#39;+@sql+&#39;(&#39;+@fdlist+&#39;) select &#39;+@fdlist+&#39; from [&#39;+@tbname+&#39;]&#39;) <br /><br />set @sql=&#39;drop table [&#39;+@tbname+&#39;]&#39;<br />exec(@sql)<br />return <br />lberr:<br />exec sp_oageterrorinfo 0,@src out,@desc out<br />lbexit:<br />select cast(@err as varbinary(4)) as 错误号<br />,@src as 错误源,@desc as 错误描述<br />select @sql,@constr,@fdlist <br /><br />]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-4-4 9:21:46</pubdate></item><item><title>修改discuz5.5，让广告只显示给游客看，会员免受ad打扰</title><link>http://www.yangyunwei.com/bbs/web/2007-4-7/74.htm</link><description><![CDATA[此修改很简单，只修改模版文件<br /><br />修改的目的：让广告只显示给游客看，会员免受广告的打扰<br />修改以后，只有游客浏览论坛才看到相关的广告，登录以后，将看不到广告<br /><br />此修改尤其适用于在论坛投放google adsense的站长，因为论坛会员长期混迹论坛，对广告有免疫力；而且，一个会员如果有点击ggad的习惯，很容易造成帐号被k<br />因此，游客看广告，会员不看广告，可以提高ggad的点击率和帐号被k的危险<br /><br />如果你一方面想提高会员的浏览体验，一方面又想通过ggad赚点小钱（主要针对来自搜索引擎的游客），不妨进行这个修改。<br /><br />一、帖子页面：模版文件viewthread.htm<br /><br />1、针对页内广告的修改<br /><br />&lt;!--{if !empty($advlist[&#39;text&#39;])}--&gt;<br />修改为<br />&lt;!--{if !empty($advlist[&#39;text&#39;]) && !$discuz_uid}--&gt;<br /><br /><br />2、针对帖内广告（帖子正文上方）<br />&lt;!--{if !empty($advlist[&#39;thread2&#39;][$post[&#39;count&#39;]])}--&gt;<br />修改为<br />&lt;!--{if !empty($advlist[&#39;thread2&#39;][$post[&#39;count&#39;]]) && !$discuz_uid}--&gt;<br /><br />3、针对帖内广告（帖子正文右边）<br />&lt;!--{if !empty($advlist[&#39;thread3&#39;][$post[&#39;count&#39;]])}--&gt;<br />修改为 <br />&lt;!--{if !empty($advlist[&#39;thread3&#39;][$post[&#39;count&#39;]]) && !$discuz_uid}--&gt;<br /><br />4、针对帖内广告（帖子正文下方）<br />&lt;!--{if !empty($advlist[&#39;thread1&#39;][$post[&#39;count&#39;]])}--&gt;<br />修改为<br />&lt;!--{if !empty($advlist[&#39;thread1&#39;][$post[&#39;count&#39;]]) && !$discuz_uid}--&gt;<br /><br />二、帖子列表页面：模版forumdispaly.htm<br /><br />针对页内广告<br />&lt;!--{if !empty($advlist[&#39;text&#39;])}--&gt;<br />修改为<br />&lt;!--{if !empty($advlist[&#39;text&#39;]) && !$discuz_uid}--&gt;<br /><br />三、首页：模版discuz.htm<br />针对页内广告<br />&lt;!--{if !empty($advlist[&#39;text&#39;])}--&gt;<br />修改为<br />&lt;!--{if !empty($advlist[&#39;text&#39;]) && !$discuz_uid}--&gt;<br /><br />四、底部横幅广告：模版footer.htm<br />&lt;!--{if !empty($advlist[&#39;footerbanner1&#39;])}--&gt;<br />&lt;!--{if !empty($advlist[&#39;footerbanner2&#39;])}--&gt;<br />&lt;!--{if !empty($advlist[&#39;footerbanner3&#39;])}--&gt;<br />根据需要分别修改为<br />&lt;!--{if !empty($advlist[&#39;footerbanner1&#39;]) && !$discuz_uid}--&gt;<br />&lt;!--{if !empty($advlist[&#39;footerbanner2&#39;]) && !$discuz_uid}--&gt; <br /><br /><br />&lt;!--{if !empty($advlist[&#39;footerbanner3&#39;]) && !$discuz_uid}--&gt;<br /><br />以上所有修改，其实就是在广告代码的显示判断里面，加上一个 && !$discuz_uid<br />其它广告，参照修改即可]]></description><category>在线交流</category><author>Weiven</author><pubdate>2007-4-7 13:35:57</pubdate></item></channel></rss>