<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[网络天空vista]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[]]></description>
<link>http://hi.baidu.com/vistra</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[[转]netsh ipsec 使用方法]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/81ae9d35df79e694a71e1257.html]]></link>
        <description><![CDATA[
		
		<div><p><span style="font-size: 16px;">netsh 的ipsec（win2003）</span><br /><strong><span style="font-size: 16px;">1、创建策略：</span></strong></p><p><span style="font-size: 16px;">netsh ipsec static add policy name=&quot;阻止访问&quot; description=&quot;阻止用户访问指定的端口&quot;</span></p><p><br /><strong><span style="font-size: 16px;">&nbsp;2、创建过滤器：</span></strong></p><p><span style="font-size: 16px;">netsh ipsec static addfilter filterlist=&quot;阻止访问1433端口&quot; srcaddr=any srcport=0 dstaddr=me dstport=1433 protocol=tcp mirrored=yes</span></p><p><span style="font-size: 16px;">注：filterlist=name 使用哪个过滤器</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp; dstport=1433 目标端口</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp; srcport=0 源端口</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp; mirrored=yes 双向</span></p><p><strong><span style="font-size: 16px;">&nbsp;3、创建过滤动作：</span></strong></p><p><span style="font-size: 16px;">netsh ipsec static add filteraction name=&quot;阻止&quot; action=block</span></p><p><span style="font-size: 16px;">注：这个命令就是创建堵塞数据包动作，并命名为阻止</span></p><p><br /><strong><span style="font-size: 16px;">4、封装策略：</span></strong></p><p><span style="font-size: 16px;">netsh ipsec static add rule name=&quot;阻止1433端口&quot; policy=&quot;阻止访问&quot; filterlist=&quot;阻止访问1433端口&quot; filteraction=&quot;阻止&quot; desc=&quot;阻止来自任何地方的用户访问1433端口&quot;</span></p><p><br /><strong><span style="font-size: 16px;">5、启用和关闭策略：</span></strong></p><p><span style="font-size: 16px;">netsh ipsec static set policy name=&quot;阻止访问&quot; assign=y</span></p><p><span style="font-size: 16px;">注：如果要关闭这条策略，那么将&quot;assign&quot;的值改为&quot;n&quot;即可。</span></p><p><span style="font-size: 16px;">-------------------------------------------------------------------------------------</span></p><p><strong><span style="font-size: 16px;">导出IP策略</span></strong><span style="font-size: 16px;">：</span></p><p><span style="font-size: 16px;">netsh ipsec static exportpolicy file=d:\MyIPSec.ipsec</span></p><p><strong><span style="font-size: 16px;">导入IP策略</span></strong></p><p><span style="font-size: 16px;">netsh ipsec static importpolicy file=d:\MyIPSec.ipsc</span></p><strong><span style="font-size: 16px;"><p>&nbsp;</p></span></strong></div><div><strong><span style="font-size: 16px;">IPsec&nbsp;</span><span>&nbsp;(Internet Protocol security)</span></strong></div><p><span style="font-size: 16px;">在命令行下，通过netsh ipsec static来配置IPSEC安全策略。前提是IPSEC服务已经打开。</span></p><p><span style="font-size: 16px;">一个IPSEC由一个或者多个规则组成；一个规则有一个IP筛选器列表和一个相应的筛选器操作组成；这个筛选器列表和筛选器可以是系统本身所没有的，如果没有则需要自行建立，而一个筛选器又由一个或多个筛选器组成，因此配置IPSEC的时候必须分步进行。规则由筛选器列表和筛选器操作构成。而且存放在策略里，策略器由策略器列表来存储，这样就决定了一个步骤：建立空的安全策略，建立筛选器列表，建立筛选器操作，这三步不需要特定的顺序，建立筛选器需要在空筛选器列表建立成以后；建立规则在上述三步骤完成之后。下面开始配置策略的新增，修改，删除、最重要的是激活；</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">更详细的资料请参考微软的技术资源库：</span></p><p><strong><span style="font-size: 16px;">Netsh Commands for Internet Protocol Security (IPsec)</span></strong></p><p><span style="font-size: 16px;">连接如下：</span><a href="http://technet.microsoft.com/zh-cn/cc725926"><span style="font-size: 16px;">http://technet.microsoft.com/zh-cn/cc725926</span></a></p><p><span style="font-size: 16px;">备注：注意连接里的</span><span><span style="font-size: 16px;">&nbsp;</span><a href="http://technet.microsoft.com/zh-cn/cc771920"><span style="font-size: 16px;">Netsh Commands for Windows Firewall with Advanced Security</span></a><span style="font-size: 16px;">.连接，他给你的帮助会更大；</span></span></p><p><br /></p><p><span style="font-size: 16px;">导出IPsec安全策略：Netsh ipsec static exportpolicy file = d:\ExportSecurity.ipsec</span></p><p><span style="font-size: 16px;">导入IPsec安全策略：Netsh ipsec static importpolicy file = d:\ImportSecurity.ipsec</span><br /></p><p><br /></p><p><span style="font-size: 16px;">1、建立一个新的策略</span></p><p><span style="font-size: 16px;">1.1首先建立一个空的安全策略[Michael’s安全策略]</span></p><p><span style="font-size: 16px;">Netsh ipsec static add policy name = Michael’s安全策略</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">1.2建立一个筛选器操作”阻止”</span></p><p><span style="font-size: 16px;">Netsh ipsec static add filteraction name = 阻止 action =block</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">1.3建立一个筛选器列表“可访问的终端列表”</span></p><p><span style="font-size: 16px;">Netsh ipsec static add filterlist name =可访问的终端列表</span></p><p><span style="font-size: 16px;">Netsh ipsec static add filter filterlist = 可访问的终端列表</span></p><p><span style="font-size: 16px;">srcaddr=203.86.32.248</span></p><p><span style="font-size: 16px;">dstaddr = me dstport = 3389</span></p><p><span style="font-size: 16px;">description = 部门1访问 protocol =TCP mirrored = yes</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">Netsh ipsec static add filter filterlist = 可访问的终端列表</span></p><p><span style="font-size: 16px;">Srcaddr = 203.86.31.0 srcmask=255.255.255.0</span></p><p><span style="font-size: 16px;">dstaddr = 60.190.145.9 dstport = 0</span></p><p><span style="font-size: 16px;">description = 部门2访问 protocol =any mirrored = yes</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">1.4建立策略规则</span></p><p><span style="font-size: 16px;">Netsh ipsec static add rule name =可访问的终端策略规则</span></p><p><span style="font-size: 16px;">Policy = Michael’s安全策略</span></p><p><span style="font-size: 16px;">filterlist&nbsp;=可访问的终端列表</span></p><p><span style="font-size: 16px;">filteraction&nbsp;=&nbsp;阻止</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">2、修改策略</span></p><p><span style="font-size: 16px;">netsh ipsec static set filter filterlist = 可访问的终端列表</span></p><p><span style="font-size: 16px;">srcaddr = 220.207.31.249</span></p><p><span style="font-size: 16px;">dstaddr = Me &nbsp;dstport=3389&nbsp;protocol=TCP&nbsp;</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">3、删除策略</span></p><p><span style="font-size: 16px;">netsh ipsec static delete rule name = 可访问的终端策略规则 policy = Michael’s安全策略</span><br /><span style="font-size: 16px;">netsh ipsec static delete filterlist name = 可访问的终端列表</span></p><p><br /></p><p><span style="font-size: 16px;">4、最最重要的一步是激活；</span></p><p><span style="font-size: 16px;">netsh ipsec static set policy name = Michael’s安全策略 assign = y</span><br /></p><p><br /></p><p><span style="font-size: 16px;">以下提供一个我自己写的实例：</span></p><p></p><div><div><div><b><span style="font-size: 16px;">[css]</span></b><a title="view plain" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">view plain</span></a><a title="copy" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">copy</span></a><a title="print" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">print</span></a><a title="?" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">?</span></a></div></div></div><div><span style="font-size: 16px;">echo 创建安全策略</span></div><div><span style="font-size: 16px;">Netsh IPsec static add policy name = APU安全策略</span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">echo 创建筛选器是阻止的操作 </span></div><div><span style="font-size: 16px;">Netsh IPsec static add filteraction name = 阻止 action = block</span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">echo 创建筛选器是允许的操作 </span></div><div><span style="font-size: 16px;">Netsh IPsec static add filteraction name = 允许 action = permit</span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">echo 建立一个筛选器可以访问的终端列表</span></div><div><span style="font-size: 16px;">Netsh IPsec static add filterlist name = 可访问的终端列表 </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh IPsec static add filter filterlist = 可访问的终端列表 srcaddr = 203.86.32.248 dstaddr = me dstport = 3389 description = 部门1访问 protocol = TCP mirrored = yes </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">echo 建立一个筛选器可以访问的终端列表 </span></div><div><span style="font-size: 16px;">Netsh ipsec static add filter filterlist = 可访问的终端列表 Srcaddr = 203.86.31.0 srcmask=255.255.255.0 dstaddr = 60.190.145.9 dstport = 0 description = 部门2访问 protocol =any mirrored = yes </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">echo 建立策略规则 </span></div><div><span style="font-size: 16px;">Netsh ipsec static add rule name = 可访问的终端策略规则 Policy = APU安全策略 filterlist = 可访问的终端列表 filteraction = 阻止 </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">echo 激活策略</span></div><div><span style="font-size: 16px;">netsh ipsec static set policy name = APU安全策略 assign = y</span></div><div><span style="font-size: 16px;">pause</span></div><p></p><p><br /></p><div><span style="font-size: 16px;">或者</span></div><p></p><div><div><div><b><span style="font-size: 16px;">[plain]</span></b><a title="view plain" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">view plain</span></a><a title="copy" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">copy</span></a><a title="print" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">print</span></a><a title="?" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">?</span></a></div></div></div><div><span style="font-size: 16px;">Netsh ipsec static add policy name = 默认策略名称 </span></div><div><span style="font-size: 16px;">pause</span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add filteraction name = 阻止操作 action = block</span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add filteraction name = 允许操作 action = permit</span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add filterlist name = 访问列表</span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add filterlist name = 阻止列表</span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add filter filterlist = 访问列表1 srcaddr = 203.86.32.248 dstaddr = me dstport = 3389 description = 部门1访问 protocol = TCP mirrored = yes </span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add filter filterlist = 访问列表2 srcaddr = 203.86.31.0 srcmask = 255.255.255.0 dstaddr = 60.190.145.9 dstport = 0 description = 部门2访问 protocol = any mirrored = yes </span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add rule name = 可访问的终端策略规则 Policy = 默认策略名称 filterlist = 访问列表1 filteraction = 阻止操作 </span></div><div><span style="font-size: 16px;">pause </span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">Netsh ipsec static add rule name = 可访问的终端策略规则 Policy = 默认策略名称 filterlist = 访问列表2 filteraction = 阻止操作 </span></div><div><span style="font-size: 16px;">pause</span></div><div><span style="font-size: 16px;"></span>&nbsp;</div><div><span style="font-size: 16px;">netsh ipsec static set policy name = 默认策略名称 assign = y</span></div><div><span style="font-size: 16px;">pause</span><br /></div><p><span style="font-size: 16px;">[以下是转载未经过测试，百度上都可以找的到。]</span></p><p></p><div><div><div><b><span style="font-size: 16px;">[plain]</span></b><a title="view plain" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">view plain</span></a><a title="copy" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">copy</span></a><a title="print" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">print</span></a><a title="?" href="http://blog.csdn.net/lpc_china/article/details/6944432#"><span style="font-size: 16px;">?</span></a></div></div><ol><li><span style="font-size: 16px;">REM&nbsp;=================开始================&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;policy&nbsp;name=bim&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">REM&nbsp;添加2个动作，block和permit&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filteraction&nbsp;name=Permit&nbsp;action=permit&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filteraction&nbsp;name=Block&nbsp;action=block&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">REM&nbsp;首先禁止所有访问&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filterlist&nbsp;name=AllAccess&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=AllAccess&nbsp;srcaddr=Me&nbsp;dstaddr=Any&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;rule&nbsp;name=BlockAllAccess&nbsp;policy=bim&nbsp;filterlist=AllAccess&nbsp;filteraction=Block&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">REM&nbsp;开放某些IP无限制访问&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filterlist&nbsp;name=UnLimitedIP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=UnLimitedIP&nbsp;srcaddr=61.128.128.67&nbsp;dstaddr=Me&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;rule&nbsp;name=AllowUnLimitedIP&nbsp;policy=bim&nbsp;filterlist=UnLimitedIP&nbsp;filteraction=Permit&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">REM&nbsp;开放某些端口&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filterlist&nbsp;name=OpenSomePort&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=OpenSomePort&nbsp;srcaddr=Any&nbsp;dstaddr=Me&nbsp;dstport=20&nbsp;protocol=TCP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=OpenSomePort&nbsp;srcaddr=Any&nbsp;dstaddr=Me&nbsp;dstport=21&nbsp;protocol=TCP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=OpenSomePort&nbsp;srcaddr=Any&nbsp;dstaddr=Me&nbsp;dstport=80&nbsp;protocol=TCP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=OpenSomePort&nbsp;srcaddr=Any&nbsp;dstaddr=Me&nbsp;dstport=3389&nbsp;protocol=TCP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;rule&nbsp;name=AllowOpenSomePort&nbsp;policy=bim&nbsp;filterlist=OpenSomePort&nbsp;filteraction=Permit&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">REM&nbsp;开放某些ip可以访问某些端口&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filterlist&nbsp;name=SomeIPSomePort&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=SomeIPSomePort&nbsp;srcaddr=Me&nbsp;dstaddr=Any&nbsp;dstport=80&nbsp;protocol=TCP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;filter&nbsp;filterlist=SomeIPSomePort&nbsp;srcaddr=61.128.128.68&nbsp;dstaddr=Me&nbsp;dstport=1433&nbsp;protocol=TCP&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">netsh&nbsp;ipsec&nbsp;static&nbsp;^&nbsp;&nbsp;&nbsp;</span></li><li><span style="font-size: 16px;">add&nbsp;rule&nbsp;name=AllowSomeIPSomePort&nbsp;policy=bim&nbsp;filterlist=SomeIPSomePort&nbsp;filteraction=Permit&nbsp;&nbsp;&nbsp;</span></li></ol></div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/Windows">Windows</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/81ae9d35df79e694a71e1257.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月26日  上午 09:56</pubDate>
        <category><![CDATA[Windows]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/81ae9d35df79e694a71e1257.html</guid>
</item>

<item>
        <title><![CDATA[利用ipseccmd封ip2010]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/81a17060c5f712c08cb10d6b.html]]></link>
        <description><![CDATA[
		
		<p><span style="font-size: 16px;">1、ipseccmd是干什么用的？</span><br /><span style="font-size: 16px;">ipseccmd可以理解为ip安全策略的命令行版。可以使用命令参数来设置各种各样的ip安全策略。</span></p><p><span style="font-size: 16px;">2、ipseccmd是否是windows自带的？</span><br /><span style="font-size: 16px;">ipseccmd不是windows装好后就存在的工具。它存在于原版xp光盘的support\tools\support.cab压缩包中！</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><span style="font-size: 16px;">3、ipseccmd到详细命令是什么？英文不好，理解不了~</span><br /><span style="font-size: 16px;">我英文也不好，所以我特意从网上找了很多资料，于是今天决定详细的理顺一下！下面我说下每个命令的用法，后面会给出具体应用的例子！</span></p><p><span style="font-size: 16px;">4、ipseccmd的命令解析。</span></p><p><span style="font-size: 16px;">常用参数</span></p><p><span style="font-size: 16px;">-w reg 表明将配置写入注册表，重启后仍有效。</span><br /><span style="font-size: 16px;">-p 指定策略名称，如果名称存在，则将该规则加入此策略，否则创建一个。</span><br /><span style="font-size: 16px;">-r 指定规则名称。</span><br /><span style="font-size: 16px;">-n 指定操作，可以是block、pass或者inpass，必须大写。</span><br /><span style="font-size: 16px;">-x 激活该策略。</span><br /><span style="font-size: 16px;">-y 使之无效。</span><br /><span style="font-size: 16px;">-o 删除-p指定的策略。</span></p><p><span style="font-size: 16px;">高级参数</span></p><p><span style="font-size: 16px;">-f 设置过滤规则。格式为</span><br /><span style="font-size: 16px;">a.b.c.d/mask:port=a.b.c.d/mask:port:protocol。</span><br /><span style="font-size: 16px;">其中=前面的是源地址，后面是目的地址。如果使用+，则表明此规则是双向的。ip地址中用*代表任何ip地址， 0代表我自己的ip地址。还可以使用通配符，比如144.92.*.* 等效于144.92.0.0/255.255.0.0。</span></p><p><span style="font-size: 16px;">-lan 指定规则应用为局域网。</span><br /><span style="font-size: 16px;">-dialup 指定规则应用为广域网。</span><br /><span style="font-size: 16px;">+&nbsp;&nbsp; 表示双向。</span><br /><span style="font-size: 16px;">*&nbsp;&nbsp; 表示所有ip</span><br /><span style="font-size: 16px;">0&nbsp;&nbsp; 表示自己的ip</span></p><p><span style="font-size: 16px;">还有一些参数，我还理解不太好。同时感觉用到的地方不太多了。所以就不多说。先举例子说明一下以上参数吧！</span></p><p><span style="font-size: 16px;">4.1禁止以任何协议访问某ip的任何端口</span></p><p><span style="font-size: 16px;">copy code to clipboard程序代码</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;clxp safe policy&quot; -r &quot;disable connect ip&quot; -f 0/255.255.255.255=202.108.22.5/255.255.255.255:: -n block -x</span></p><p><span style="font-size: 16px;">此段代码的含义：设置名为“clxp safe policy”的ip安全策略，添加名为&quot;disable connect ip&quot;的规则。</span><br /><span style="font-size: 16px;">筛选对象为：我的ip和202.108.22.5这个ip（255.255.255.255的意思就是单独一个ip。）</span><br /><span style="font-size: 16px;">筛选操作为：禁止访问</span><br /><span style="font-size: 16px;">端口：所有</span><br /><span style="font-size: 16px;">协议：所有</span><br /><span style="font-size: 16px;">测试是否生效：此规则为我以任何ip任何端口都无法访问202.108.22.5这个ip，这个ip是百度的。</span><br /><span style="font-size: 16px;">直接以http访问，应该是访问不到的，用的是tcp协议。目标端口80</span><br /><span style="font-size: 16px;">直接ping 202.108.22.5，应该是ping不通的，用的是icmp协议。</span></p><p><span style="font-size: 16px;">4.2禁止访问某ip的某端口</span></p><p><span style="font-size: 16px;">copy code to clipboard程序代码</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;clxp safe policy&quot; -r &quot;disable connect ip&quot; -f 0/255.255.255.255=202.108.22.5/255.255.255.255:80:tcp -n block -x</span></p><p><span style="font-size: 16px;">此段代码的含义：设置名为“clxp safe policy”的ip安全策略，添加名为&quot;disable connect ip&quot;的规则。</span><br /><span style="font-size: 16px;">筛选对象为：我的ip和202.108.22.5这个ip（255.255.255.255的意思就是单独一个ip。）</span><br /><span style="font-size: 16px;">筛选操作为：禁止访问</span><br /><span style="font-size: 16px;">端口：80</span><br /><span style="font-size: 16px;">协议：tcp(必须指定端口.感谢易拉罐提出错误.)</span><br /><span style="font-size: 16px;">测试是否生效：http无法访问80端口。但是可以访问其他端口。因为协议选的是tcp，ping是可以通的。</span></p><p><span style="font-size: 16px;">4.3禁止使用tcp协议访问某ip的某端口</span></p><p><span style="font-size: 16px;">copy code to clipboard程序代码</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;clxp safe policy&quot; -r &quot;disable connect ip&quot; -f 0/255.255.255.255=202.108.22.5/255.255.255.255:80:tcp -n block -x</span></p><p><span style="font-size: 16px;">此段代码的含义：设置名为“clxp safe policy”的ip安全策略，添加名为&quot;disable connect ip&quot;的规则。</span><br /><span style="font-size: 16px;">筛选对象为：我的ip和202.108.22.5这个ip（255.255.255.255的意思就是单独一个ip。）</span><br /><span style="font-size: 16px;">筛选操作为：禁止访问</span><br /><span style="font-size: 16px;">端口：80</span><br /><span style="font-size: 16px;">协议：tcp</span><br /><span style="font-size: 16px;">测试是否生效：无法使用http访问，但是可以ping通。</span></p><p><span style="font-size: 16px;">4.4双向限制。</span><br /><span style="font-size: 16px;">什么是双向限制呢？就是我不能用tcp协议访问你，你也不能用tcp协议访问我。</span><br /><span style="font-size: 16px;">我不能用访问你的80端口，你也不能访问我的80端口。</span><br /><span style="font-size: 16px;">要实现这个就简单了。只要把上面代码里的“=”等号，换为“+”加号就可以了。</span></p><p><span style="font-size: 16px;">4.5禁止所有人访问我的某的端口。</span></p><p><span style="font-size: 16px;">copy code to clipboard程序代码</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;clxp safe policy&quot; -r &quot;block tcp/135&quot; -f *=0:135:tcp -n block -x</span></p><p><br /><span style="font-size: 16px;">4.6禁止ping。</span></p><p><span style="font-size: 16px;">针对任何网络都禁止ping入和ping出。</span></p><p><span style="font-size: 16px;">copy code to clipboard程序代码</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;clxp safe policy&quot; -r &quot;disable out ping&quot; -f *=0::icmp -n block -x</span></p><p><br /><span style="font-size: 16px;">局域网禁止ping入。</span></p><p><span style="font-size: 16px;">copy code to clipboard程序代码</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;clxp safe policy&quot; -r &quot;disable out ping&quot; -f *=0::icmp -n block -x -lan</span></p><p><br /><span style="font-size: 16px;">来自死性不改，今天正好用了一下</span><br /><span style="font-size: 16px;">在上来一段屏蔽常用端口的bat</span><br /><span style="font-size: 16px;">@echo off</span><br /><span style="font-size: 16px;">gpupdate &gt;nul</span><br /><span style="font-size: 16px;">rem for client only</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -o -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -x &gt;nulipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block udp/137&quot; -f *+0:137:udp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block udp/138&quot; -f *+0:138:udp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/139&quot; -f *+0:139:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/23&quot; -f *+0:23:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block udp/1433&quot; -f *+0:1434:udp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/3389&quot; -f *+0:3389:tcp -n block -x</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/135&quot; -f *+0:135:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block udp/135&quot; -f *+0:135:udp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/445&quot; -f *+0:445:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block udp/445&quot; -f *+0:445:udp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/1025&quot; -f *+0:1025:tcp -n block -x &gt;nul&lt;这条用万象的慎用&gt;</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block udp/139&quot; -f *+0:139:udp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/1068&quot; -f *+0:1068:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/5554&quot; -f *+0:5554:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">ipseccmd -w reg -p &quot;hfut_secu&quot; -r &quot;block tcp/9995&quot; -f *+0:9995:tcp -n block -x &gt;nul</span><br /><span style="font-size: 16px;">exit</span></p><p><br /><span style="font-size: 16px;">------------------</span></p><p><span style="font-size: 16px;">命令行下ip安全策略2006年09月25日 星期一 12:47</span><br /><span style="font-size: 16px;">sql注入后发现是做了安全策略的话，下文可能对你有帮助。别见笑。本文如可得以传播，实在荣幸。by xblue</span></p><p><span style="font-size: 16px;">ip安全策略从win2k到2003都有的，图形界面的没什么好说的，如何在命令行下控制ipsec呢？win2k的方法在do all in cmd shell有介绍。这里就拿win2003做例子吧，毕竟2003十分流行，而且2003下面有一个工具是它本身带有的，十分方便地完成所有任务。这个工具就是netsh。</span></p><p><span style="font-size: 16px;">&quot;netsh&quot;是windows 2000/xp/2003操作系统自身提供的命令行脚本实用工具，它允许用户在本地或远程显示或修改当前正在运行的计算机的网络配置。</span><br /><span style="font-size: 16px;">netsh ipsec，听闻只有windows2003才能运行。我都是在2003下测试的。其他系统就不知道了。我们要学习的就是他了。</span></p><p><span style="font-size: 16px;">ip安全策略，我自身的理解就是：一个安全策略由一条条规则组成，而这些规则是由2部分组成的。首先要建立一个ip筛选器（用来指定那些地址）。然后呢是筛选器操作（用来指定对这些ip的操作，就是动作）</span><br /><span style="font-size: 16px;">一个安全策略编写完成了，首先要激活，才能使用，那就是指派。</span></p><p><span style="font-size: 16px;">下面用实例来说明，然后附带一些常用的。这个例子就是不允许ip为192.168.1.2的机器访问我的3389端口。'后面是注析</span></p><p><span style="font-size: 16px;">'建立一个名字叫xblue的安全策略先</span><br /><span style="font-size: 16px;">netsh ipsec static add policy name=xblue</span></p><p><span style="font-size: 16px;">'建立一个ip筛选器，指定192.168.1.2</span><br /><span style="font-size: 16px;">netsh ipsec static add filterlist name=denyip</span><br /><span style="font-size: 16px;">netsh ipsec static add filter filterlist=denyip srcaddr=192.168.1.2 dstaddr=me dstport=3389 protocol=tcp</span></p><p><span style="font-size: 16px;">'建立一个筛选器操作</span><br /><span style="font-size: 16px;">netsh ipsec static add filteraction name=denyact action=block</span></p><p><span style="font-size: 16px;">'加入规则到安全策略xblue</span><br /><span style="font-size: 16px;">netsh ipsec static add rule name=kill3389 policy=xblue filterlist=denyip filteraction=denyact</span></p><p><span style="font-size: 16px;">'激活这个策略</span><br /><span style="font-size: 16px;">netsh ipsec static set policy name=xblue assign=y</span></p><p><span style="font-size: 16px;">写到这里，好郁闷。别人说我的是老掉牙的东西。再写一些就完结</span></p><p><span style="font-size: 16px;">一些例子，如果各位想认识更多，请看netsh ipsec ?</span></p><p><span style="font-size: 16px;">把安全策略导出</span><br /><span style="font-size: 16px;">netsh ipsec static exportpolicy d:\ip.ipsec</span></p><p><span style="font-size: 16px;">删除所有安全策略</span><br /><span style="font-size: 16px;">netsh ipsec static del all</span></p><p><span style="font-size: 16px;">把安全策略导入</span><br /><span style="font-size: 16px;">netsh ipsec static importpolicy d:\ip.ipsec</span></p><p><span style="font-size: 16px;">激活这个策略</span><br /><span style="font-size: 16px;">netsh ipsec static set policy name=策略名称 assign=y</span></p><p><span style="font-size: 16px;">入侵灵活运用</span><br /><span style="font-size: 16px;">我得到了61.90.227.136的sa权限。不过有策略限制，访问不到他的3389。我想用他的3389。于是这样，我的ip是220.207.31.249。</span></p><p><span style="font-size: 16px;">netsh ipsec static add filterlist name=welcomexblue</span><br /><span style="font-size: 16px;">netsh ipsec static add filter filterlist=welcomexblue srcaddr=220.207.31.249 dstaddr=me dstport=7892 protocol=tcp</span><br /><span style="font-size: 16px;">netsh ipsec static add rule name=letxblue policy=connrest filterlist=welcomexblue filteraction=permit</span></p><p><span style="font-size: 16px;">访问结果</span><br /><span style="font-size: 16px;">ok，可以访问了。</span></p><p><span style="font-size: 16px;">netsh ipsec static del rule name=letxblue policy=connrest</span></p><p><span style="font-size: 16px;">更改</span></p><p><span style="font-size: 16px;">netsh ipsec static set filter filterlist=welcomexblue srcaddr=220.207.31.249 dstaddr=me dstport=3389 protocol=tcp</span></p><p><span style="font-size: 16px;">删除</span><br /><span style="font-size: 16px;">netsh ipsec static del rule name=letxblue policy=connrest</span></p><p><span style="font-size: 16px;"></span>&nbsp;</p><p><span style="font-size: 16px;">以下经过测试正常</span></p><span style="font-size: 16px;"><p>netsh ipsec static add policy name=&quot;阻止访问&quot; description=&quot;阻止用户访问指定的端口&quot;<br />netsh ipsec static add filter filterlist=&quot;阻止访问1433端口&quot;&nbsp; srcaddr=any srcport=0 dstaddr=me dstport=1433 protocol=tcp&nbsp; mirrored=yes</p><p>netsh ipsec static add filteraction name=&quot;阻止&quot; action=block</p><p>netsh ipsec static add rule name=&quot;阻止1433端口&quot; policy=&quot;阻止访问&quot; filterlist=&quot;阻止访问1433端口&quot; filteraction=&quot;阻止&quot; desc=&quot;阻止来自任何地方的用户访问1433端口&quot;</p><p>netsh ipsec static set policy name=&quot;阻止访问&quot; assign=y</p><p>netsh ipsec static delete policy name= &quot;阻止访问&quot;</p><p><br />netsh ipsec static add policy name=&quot;阻止访问&quot; description=&quot;阻止用户访问指定的端口&quot;</p><p>netsh ipsec static add filter filterlist=&quot;阻止访问1433端口&quot;&nbsp; srcaddr=20.0.12.20 dstaddr=me srcport=0 dstport=1433 protocol=tcp&nbsp; mirrored=yes</p><p>netsh ipsec static add filter filterlist=&quot;阻止访问1433端口&quot;&nbsp; srcaddr=20.0.12.25 dstaddr=me srcport=0 dstport=1433 protocol=tcp&nbsp; mirrored=yes</p><p>更改<br />netsh ipsec static add filter filterlist=&quot;阻止访问1433端口&quot; srcaddr=20.0.12.25 dstaddr=me srcport=0 dstport=0 protocol=tcp&nbsp; mirrored=yes</p><p>netsh ipsec static add filteraction name=&quot;阻止&quot; action=block<br />netsh ipsec static add rule name=&quot;阻止1433端口&quot; policy=&quot;阻止访问&quot; filterlist=&quot;阻止访问1433端口&quot; filteraction=&quot;阻止&quot; desc=&quot;阻止来自任何地方的用户访问1433端口&quot;<br />netsh ipsec static set policy name=&quot;阻止访问&quot; assign=y</p><p><br />netsh ipsec static delete policy name= &quot;阻止访问&quot;</p></span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/Windows">Windows</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/81a17060c5f712c08cb10d6b.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月20日  下午 06:46</pubDate>
        <category><![CDATA[Windows]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/81a17060c5f712c08cb10d6b.html</guid>
</item>

<item>
        <title><![CDATA[DEPHI 实现电脑流量监控]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/336437d5862091db51da4b99.html]]></link>
        <description><![CDATA[
		
		<p><span style="font-size: 16px;">最近想弄一个和360流量监控差不多的小程序，没办法单独提取出来，找来找去也没有合适的替代品，突然对其原理产生兴趣 ，从网上找到一个Delphi写的程序，质量不错，仅供大家参考一下吧，监控流量一般可以使用底层NDIS驱动来实现，需要驱动开发技术，比较复杂，所以这个程序使用的是iphelper所提供的api接口来获得流量信息。&nbsp;</span></p><p><span style="font-size: 16px;">interface</span></p><p><span style="font-size: 16px;">uses</span><br /><span style="font-size: 16px;">&nbsp; Windows, Graphics, ExtCtrls, Controls, StdCtrls, Buttons, Tabs,</span><br /><span style="font-size: 16px;">&nbsp; ComCtrls, Classes, SysUtils, Forms, dialogs,</span><br /><span style="font-size: 16px;">&nbsp; TrafficUnit, IPHelper, IPHLPAPI, ShellAPI;</span></p><p><br /><span style="font-size: 16px;">type</span><br /><span style="font-size: 16px;">&nbsp; TMainForm = class(TForm)</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; pnlMain: TPanel;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; pnlBottom: TPanel;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; pc: TPageControl;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; tsAbout: TTabSheet;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; tsTraffic: TTabSheet;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ExitButton: TButton;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; TrafficTabs: TTabSet;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; GroupBox: TGroupBox;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledAdapterDescription: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; UnFreezeButton: TBitBtn;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; FreezeButton: TBitBtn;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ClearCountersButton: TBitBtn;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledMACAddress: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; gbIN: TGroupBox;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledOctInSec: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledAvgINSec: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledPeakINSec: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledTotalIN: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; gbOUT: TGroupBox;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledOctOUTSec: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledAvgOUTSec: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledPeakOUTSec: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledTotalOUT: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; Timer: TTimer;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; gbTime: TGroupBox;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledStartedAt: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledActiveFor: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; RemoveInactiveButton: TBitBtn;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; StatusText: TStaticText;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; cbOnTop: TCheckBox;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; Panel3: TPanel;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ProductName: TLabel;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; lblURL: TLabel;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; Label3: TLabel;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ProgramIcon: TImage;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; StaticText1: TStaticText;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledSpeed: TLabeledEdit;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure TimerTimer(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure ClearCountersButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure cbOnTopClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure FormDestroy(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure TrafficTabsChange(Sender: TObject; NewTab: Integer;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var AllowChange: Boolean);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure ExitButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure FormCreate(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure FreezeButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure UnFreezeButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure RemoveInactiveButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure lblURLClick(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure StaticText1Click(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure pcChange(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure ledAdapterDescriptionChange(Sender: TObject);</span><br /><span style="font-size: 16px;">&nbsp; private</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure HandleNewAdapter(ATraffic : TTraffic);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure HandleFreeze(ATraffic : TTraffic);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure HandleUnFreeze(ATraffic : TTraffic);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; function LocateTraffic(AdapterIndex : DWord) : TTraffic;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure ProcessMIBData;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure ClearDisplay;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; procedure RefreshDisplay;</span><br /><span style="font-size: 16px;">&nbsp; public</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; { Public declarations }</span><br /><span style="font-size: 16px;">&nbsp; end;</span></p><p><br /><span style="font-size: 16px;">var</span><br /><span style="font-size: 16px;">&nbsp; MainForm: TMainForm;</span><br /><span style="font-size: 16px;">&nbsp; ActiveTraffic : TTraffic;</span></p><p><span style="font-size: 16px;">implementation</span><br /><span style="font-size: 16px;">{$R *.dfm}</span></p><p><br /><span style="font-size: 16px;">procedure TMainForm.ClearDisplay;</span><br /><span style="font-size: 16px;">var</span><br /><span style="font-size: 16px;">&nbsp; j:integer;</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; TrafficTabs.Tabs.Clear;</span><br /><span style="font-size: 16px;">&nbsp; StatusText.Caption:='';</span><br /><span style="font-size: 16px;">&nbsp; for j:= 0 to GroupBox.ControlCount-1 do</span><br /><span style="font-size: 16px;">&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; if GroupBox.Controls[j] is TCustomEdit then</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TCustomEdit(GroupBox.Controls[j]).Text := '';</span><br /><span style="font-size: 16px;">&nbsp; end;</span><br /><span style="font-size: 16px;">end; (*ClearDisplay*)</span></p><p><span style="font-size: 16px;">procedure TMainForm.TimerTimer(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; Timer.Enabled := False;</span><br /><span style="font-size: 16px;">&nbsp; ProcessMIBData;</span><br /><span style="font-size: 16px;">&nbsp; Timer.Enabled := True;</span><br /><span style="font-size: 16px;">end; (*TimerTimer*)</span></p><p><span style="font-size: 16px;">&nbsp;</span></p><p><br /><span style="font-size: 16px;">procedure TMainForm.ClearCountersButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; ActiveTraffic.Reset;</span></p><p><span style="font-size: 16px;">&nbsp; RefreshDisplay;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.cbOnTopClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; if cbOnTop.Checked = true then</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp; FormStyle := fsSTAYONTOP</span><br /><span style="font-size: 16px;">&nbsp; else</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp; FormStyle := fsNORMAL;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.FormDestroy(Sender: TObject);</span><br /><span style="font-size: 16px;">var</span><br /><span style="font-size: 16px;">&nbsp; i : integer;</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; Timer.OnTimer := nil;</span><br /><span style="font-size: 16px;">&nbsp; ActiveTraffic := nil;</span></p><p><span style="font-size: 16px;">&nbsp; for i:= 0 to -1 + TrafficTabs.Tabs.Count do</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; TrafficTabs.Tabs.Objects[i].Free;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.TrafficTabsChange(Sender: TObject; NewTab: Integer; var AllowChange: Boolean);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; if NewTab = -1 then</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ActiveTraffic := nil</span><br /><span style="font-size: 16px;">&nbsp; else</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ActiveTraffic := TTraffic(TrafficTabs.Tabs.Objects[NewTab]);</span></p><p><span style="font-size: 16px;">&nbsp; RefreshDisplay;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.ExitButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; Close;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.FormCreate(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; //do NOT change</span><br /><span style="font-size: 16px;">&nbsp; Timer.Interval := 1000; // all calculatoins on 1 sec.</span></p><p><span style="font-size: 16px;">&nbsp; //remove design time testing data</span><br /><span style="font-size: 16px;">&nbsp; ClearDisplay;</span><br /><span style="font-size: 16px;">&nbsp; ActiveTraffic := nil;</span></p><p><span style="font-size: 16px;">&nbsp; pcChange(Sender);</span></p><p><span style="font-size: 16px;">&nbsp; Timer.Enabled := True;</span><br /><span style="font-size: 16px;">end;</span></p><p><br /><span style="font-size: 16px;">procedure TMainForm.RefreshDisplay;</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; if not Assigned(ActiveTraffic) then</span><br /><span style="font-size: 16px;">&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ClearDisplay;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; Exit;</span><br /><span style="font-size: 16px;">&nbsp; end;</span></p><p><span style="font-size: 16px;">&nbsp; with ActiveTraffic do</span><br /><span style="font-size: 16px;">&nbsp; begin</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; FreezeButton.Visible := Connected;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; UnFreezeButton.Visible := Connected;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ClearCountersButton.Visible := Connected;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; RemoveInactiveButton.Visible := not Connected;</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; FreezeButton.Enabled := Running;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; UnFreezeButton.Enabled := not Running;</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledAdapterDescription.Text := Description;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledMACAddress.Text := MAC;</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledSpeed.Text := BitsToFriendlyString(Speed);</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledOctInSec.Text := BytesToFriendlyString(InPerSec);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledPeakInSec.Text := BytesToFriendlyString(PeakInPerSec);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledAvgINSec.Text := BytesToFriendlyString(AverageInPerSec);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledTotalIN.Text := BytesToFriendlyString(InTotal);</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledOctOUTSec.Text := BytesToFriendlyString(OutPerSec);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledPeakOUTSec.Text := BytesToFriendlyString(PeakOutPerSec);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledAvgOUTSec.Text := BytesToFriendlyString(AverageOutPerSec);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ledTotalOUT.Text := BytesToFriendlyString(OutTotal);</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; self.ledStartedAt.Text := DateTimeToStr(StartedAt);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; self.ledActiveFor.Text := FriendlyRunningTime;</span></p><p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; StatusText.Caption := GetStatus;</span><br /><span style="font-size: 16px;">&nbsp; end;//with</span><br /><span style="font-size: 16px;">end; (*RefreshDisplay*)</span></p><p><span style="font-size: 16px;">procedure TMainForm.ProcessMIBData;</span><br /><span style="font-size: 16px;">var</span><br /><span style="font-size: 16px;">&nbsp;MibArr : IpHlpAPI.TMIBIfArray;</span><br /><span style="font-size: 16px;">&nbsp;i : integer;</span><br /><span style="font-size: 16px;">&nbsp;ATraffic : TTraffic;</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; Get_IfTableMIB(MibArr);&nbsp; // get current MIB data</span></p><p><br /><span style="font-size: 16px;">&nbsp; //Mark not Found as NOT Connected</span><br /><span style="font-size: 16px;">&nbsp; for i:= 0 to -1 + TrafficTabs.Tabs.Count do</span><br /><span style="font-size: 16px;">&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ATraffic := TTraffic(TrafficTabs.Tabs.Objects[i]);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; if ATraffic.Connected then ATraffic.Found := False;</span><br /><span style="font-size: 16px;">&nbsp; end;</span><br /><span style="font-size: 16px;">//&nbsp; ATraffic := nil;</span></p><p><span style="font-size: 16px;">&nbsp; //process</span><br /><span style="font-size: 16px;">&nbsp; if Length(MibArr) &gt; 0 then</span><br /><span style="font-size: 16px;">&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; for i := Low(MIBArr) to High(MIBArr) do</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATraffic := LocateTraffic(MIBArr[i].dwIndex);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Assigned(ATraffic) then</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //already connected</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATraffic.NewCycle(MIBArr[i].dwInOctets, MIBArr[i].dwOutOctets, MIBArr[i].dwSpeed);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //New one!</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATraffic := TTraffic.Create(MIBArr[i], HandleNewAdapter);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATraffic.Found := True;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATraffic.OnFreeze := HandleFreeze;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATraffic.OnUnFreeze := HandleUnFreeze;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; end;</span><br /><span style="font-size: 16px;">&nbsp; end;</span></p><p><span style="font-size: 16px;">&nbsp; //Mark not Found as Inactive</span><br /><span style="font-size: 16px;">&nbsp; for i:= 0 to -1 + TrafficTabs.Tabs.Count do</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; if NOT TTraffic(TrafficTabs.Tabs.Objects[i]).Found then</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TTraffic(TrafficTabs.Tabs.Objects[i]).MarkDisconnected;</span></p><p><span style="font-size: 16px;">&nbsp; RefreshDisplay;</span><br /><span style="font-size: 16px;">end; (*ProcessMIBData*)</span></p><p><span style="font-size: 16px;">function TMainForm.LocateTraffic(AdapterIndex : DWord): TTraffic;</span><br /><span style="font-size: 16px;">var</span><br /><span style="font-size: 16px;">&nbsp; j : cardinal;</span><br /><span style="font-size: 16px;">&nbsp; ATraffic : TTraffic;</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; Result := nil;</span><br /><span style="font-size: 16px;">&nbsp; if TrafficTabs.Tabs.Count = 0 then Exit;</span></p><p><span style="font-size: 16px;">&nbsp; for j:= 0 to -1 + TrafficTabs.Tabs.Count do</span><br /><span style="font-size: 16px;">&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ATraffic := TTraffic(TrafficTabs.Tabs.Objects[j]);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; if ATraffic.InterfaceIndex = AdapterIndex then</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result := ATraffic;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result.Found := True;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Break;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; end;</span><br /><span style="font-size: 16px;">&nbsp; end;</span><br /><span style="font-size: 16px;">end; (*LocateAdapter*)</span></p><p><span style="font-size: 16px;">procedure TMainForm.HandleNewAdapter(ATraffic: TTraffic);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; //add adapter</span><br /><span style="font-size: 16px;">&nbsp; TrafficTabs.Tabs.AddObject(ATraffic.IP, ATraffic);</span><br /><span style="font-size: 16px;">&nbsp; //select it</span><br /><span style="font-size: 16px;">&nbsp; TrafficTabs.TabIndex := -1 + TrafficTabs.Tabs.Count;</span><br /><span style="font-size: 16px;">end; (*HandleNewAdapter*)</span></p><p><span style="font-size: 16px;">procedure TMainForm.FreezeButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; ActiveTraffic.Freeze;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.UnFreezeButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; ActiveTraffic.UnFreeze;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.HandleFreeze(ATraffic: TTraffic);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; self.FreezeButton.Enabled := ATraffic.Running;</span><br /><span style="font-size: 16px;">&nbsp; self.UnFreezeButton.Enabled := not ATraffic.Running;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.HandleUnFreeze(ATraffic: TTraffic);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; self.FreezeButton.Enabled := ATraffic.Running;</span><br /><span style="font-size: 16px;">&nbsp; self.UnFreezeButton.Enabled := not ATraffic.Running;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.RemoveInactiveButtonClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; If not ActiveTraffic.Connected then //just checking</span><br /><span style="font-size: 16px;">&nbsp; begin</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ActiveTraffic.Free;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; ActiveTraffic := nil;</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; TrafficTabs.Tabs.Delete(TrafficTabs.TabIndex);</span><br /><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; TrafficTabs.SelectNext(False);</span><br /><span style="font-size: 16px;">&nbsp; end;</span></p><p><span style="font-size: 16px;">&nbsp; RefreshDisplay;</span><br /><span style="font-size: 16px;">end; (*RemoveInactiveButtonClick*)</span></p><p><br /><span style="font-size: 16px;">procedure TMainForm.lblURLClick(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; ShellExecute(Handle, 'open','http://delphi.about.com',nil,nil,SW_SHOWNORMAL);</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.StaticText1Click(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; ShellExecute(Handle, 'open','mailto:delphi.guide@about.com',nil,nil,SW_SHOWNORMAL);</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.pcChange(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; pnlBottom.Visible := pc.ActivePage = tsTraffic;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">procedure TMainForm.ledAdapterDescriptionChange(Sender: TObject);</span><br /><span style="font-size: 16px;">begin</span><br /><span style="font-size: 16px;">&nbsp; //testing - not working since GroupBox is disabled</span><br /><span style="font-size: 16px;">&nbsp; ledAdapterDescription.Hint := ledAdapterDescription.Text;</span><br /><span style="font-size: 16px;">&nbsp; ledAdapterDescription.ShowHint := Canvas.TextWidth(ledAdapterDescription.Text) &gt; ledAdapterDescription.ClientWidth;</span><br /><span style="font-size: 16px;">end;</span></p><p><span style="font-size: 16px;">end.</span></p><p><br /><span style="font-size: 16px;">&nbsp;</span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%C8%ED%BC%FE%28delphi%29">软件(delphi)</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/336437d5862091db51da4b99.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月20日  下午 06:14</pubDate>
        <category><![CDATA[软件(delphi)]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/336437d5862091db51da4b99.html</guid>
</item>

<item>
        <title><![CDATA[这些函数都存在iphlpapi.dll这个文件]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/96f42f4f33bcbb29afc3ab98.html]]></link>
        <description><![CDATA[
		
		<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; 000075DB &nbsp; AddIPAddress <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; 00002F9E &nbsp; AllocateAndGetArpEntTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; 000041B5 &nbsp; AllocateAndGetIfTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; &nbsp; 3 &nbsp; 00008E87 &nbsp; AllocateAndGetIpAddrTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; 00009148 &nbsp; AllocateAndGetIpForwardTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 &nbsp; &nbsp; &nbsp; &nbsp; 5 &nbsp; 0000934D &nbsp; AllocateAndGetIpNetTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 &nbsp; &nbsp; &nbsp; &nbsp; 6 &nbsp; 00008EEC &nbsp; AllocateAndGetTcpTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; 7 &nbsp; 00009054 &nbsp; AllocateAndGetUdpTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9 &nbsp; &nbsp; &nbsp; &nbsp; 8 &nbsp; 0000663E &nbsp; CreateIpForwardEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10 &nbsp; &nbsp; &nbsp; &nbsp; 9 &nbsp; 000067D5 &nbsp; CreateIpNetEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11 &nbsp; &nbsp; &nbsp; &nbsp; A &nbsp; 00006A88 &nbsp; CreateProxyArpEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12 &nbsp; &nbsp; &nbsp; &nbsp; B &nbsp; 000076A7 &nbsp; DeleteIPAddress <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 13 &nbsp; &nbsp; &nbsp; &nbsp; C &nbsp; 000066EA &nbsp; DeleteIpForwardEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 14 &nbsp; &nbsp; &nbsp; &nbsp; D &nbsp; 00006890 &nbsp; DeleteIpNetEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15 &nbsp; &nbsp; &nbsp; &nbsp; E &nbsp; 00006B62 &nbsp; DeleteProxyArpEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 &nbsp; &nbsp; &nbsp; &nbsp; F &nbsp; 00007A00 &nbsp; EnableRouter <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 17 &nbsp; &nbsp; &nbsp; 10 &nbsp; 000068E1 &nbsp; FlushIpNetTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 18 &nbsp; &nbsp; &nbsp; 11 &nbsp; 000096AA &nbsp; FlushIpNetTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 19 &nbsp; &nbsp; &nbsp; 12 &nbsp; 000074F2 &nbsp; GetAdapterIndex <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20 &nbsp; &nbsp; &nbsp; 13 &nbsp; 00001E98 &nbsp; GetAdapterOrderMap <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 21 &nbsp; &nbsp; &nbsp; 14 &nbsp; 00001292 &nbsp; GetAdaptersInfo <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 22 &nbsp; &nbsp; &nbsp; 15 &nbsp; 00006995 &nbsp; GetBestInterface <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23 &nbsp; &nbsp; &nbsp; 16 &nbsp; 000099EE &nbsp; GetBestInterfaceFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24 &nbsp; &nbsp; &nbsp; 17 &nbsp; 00006A3E &nbsp; GetBestRoute <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 25 &nbsp; &nbsp; &nbsp; 18 &nbsp; 00009B09 &nbsp; GetBestRouteFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 26 &nbsp; &nbsp; &nbsp; 19 &nbsp; 00006C3B &nbsp; GetFriendlyIfIndex <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 27 &nbsp; &nbsp; &nbsp; 1A &nbsp; 0000446A &nbsp; GetIcmpStatistics <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 28 &nbsp; &nbsp; &nbsp; 1B &nbsp; 000044BB &nbsp; GetIcmpStatsFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 29 &nbsp; &nbsp; &nbsp; 1C &nbsp; 0000658A &nbsp; GetIfEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 30 &nbsp; &nbsp; &nbsp; 1D &nbsp; 00008AE3 &nbsp; GetIfEntryFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 31 &nbsp; &nbsp; &nbsp; 1E &nbsp; 00003AA3 &nbsp; GetIfTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32 &nbsp; &nbsp; &nbsp; 1F &nbsp; 00003801 &nbsp; GetIfTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 33 &nbsp; &nbsp; &nbsp; 20 &nbsp; 000073EF &nbsp; GetIgmpList <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 34 &nbsp; &nbsp; &nbsp; 21 &nbsp; 00001633 &nbsp; GetInterfaceInfo <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 35 &nbsp; &nbsp; &nbsp; 22 &nbsp; 0000400C &nbsp; GetIpAddrTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 36 &nbsp; &nbsp; &nbsp; 23 &nbsp; 000040EE &nbsp; GetIpAddrTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 37 &nbsp; &nbsp; &nbsp; 24 &nbsp; 000060F2 &nbsp; GetIpForwardTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 38 &nbsp; &nbsp; &nbsp; 25 &nbsp; 000091D3 &nbsp; GetIpForwardTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 39 &nbsp; &nbsp; &nbsp; 26 &nbsp; 00005FB2 &nbsp; GetIpNetTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 40 &nbsp; &nbsp; &nbsp; 27 &nbsp; 000093E3 &nbsp; GetIpNetTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 41 &nbsp; &nbsp; &nbsp; 28 &nbsp; 00003A52 &nbsp; GetIpStatistics <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 42 &nbsp; &nbsp; &nbsp; 29 &nbsp; 000016CD &nbsp; GetIpStatsFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 43 &nbsp; &nbsp; &nbsp; 2A &nbsp; 00007AF3 &nbsp; GetNetworkParams <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 44 &nbsp; &nbsp; &nbsp; 2B &nbsp; 000039DA &nbsp; GetNumberOfInterfaces <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 45 &nbsp; &nbsp; &nbsp; 2C &nbsp; 00003BDE &nbsp; GetPerAdapterInfo <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 46 &nbsp; &nbsp; &nbsp; 2D &nbsp; 000077B9 &nbsp; GetRTTAndHopCount <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 47 &nbsp; &nbsp; &nbsp; 2E &nbsp; 000042F6 &nbsp; GetTcpStatistics <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 48 &nbsp; &nbsp; &nbsp; 2F &nbsp; 00004347 &nbsp; GetTcpStatsFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 49 &nbsp; &nbsp; &nbsp; 30 &nbsp; 00006208 &nbsp; GetTcpTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 50 &nbsp; &nbsp; &nbsp; 31 &nbsp; 00008F49 &nbsp; GetTcpTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 51 &nbsp; &nbsp; &nbsp; 32 &nbsp; 000043B0 &nbsp; GetUdpStatistics <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 52 &nbsp; &nbsp; &nbsp; 33 &nbsp; 00004401 &nbsp; GetUdpStatsFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 53 &nbsp; &nbsp; &nbsp; 34 &nbsp; 00006328 &nbsp; GetUdpTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 54 &nbsp; &nbsp; &nbsp; 35 &nbsp; 000090AE &nbsp; GetUdpTableFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 55 &nbsp; &nbsp; &nbsp; 36 &nbsp; 000073E9 &nbsp; GetUniDirectionalAdapterInfo <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 56 &nbsp; &nbsp; &nbsp; 37 &nbsp; 00007187 &nbsp; InternalCreateIpForwardEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 57 &nbsp; &nbsp; &nbsp; 38 &nbsp; 000072C0 &nbsp; InternalCreateIpNetEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 58 &nbsp; &nbsp; &nbsp; 39 &nbsp; 00007215 &nbsp; InternalDeleteIpForwardEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 59 &nbsp; &nbsp; &nbsp; 3A &nbsp; 00007340 &nbsp; InternalDeleteIpNetEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 60 &nbsp; &nbsp; &nbsp; 3B &nbsp; 00006CFF &nbsp; InternalGetIfTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 61 &nbsp; &nbsp; &nbsp; 3C &nbsp; 00006DE9 &nbsp; InternalGetIpAddrTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 62 &nbsp; &nbsp; &nbsp; 3D &nbsp; 00006F41 &nbsp; InternalGetIpForwardTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 63 &nbsp; &nbsp; &nbsp; 3E &nbsp; 00006E94 &nbsp; InternalGetIpNetTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 64 &nbsp; &nbsp; &nbsp; 3F &nbsp; 00006FF1 &nbsp; InternalGetTcpTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 65 &nbsp; &nbsp; &nbsp; 40 &nbsp; 0000709C &nbsp; InternalGetUdpTable <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 66 &nbsp; &nbsp; &nbsp; 41 &nbsp; 00007144 &nbsp; InternalSetIfEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 67 &nbsp; &nbsp; &nbsp; 42 &nbsp; 000071CE &nbsp; InternalSetIpForwardEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 68 &nbsp; &nbsp; &nbsp; 43 &nbsp; 00007300 &nbsp; InternalSetIpNetEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 69 &nbsp; &nbsp; &nbsp; 44 &nbsp; 00007282 &nbsp; InternalSetIpStats <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 70 &nbsp; &nbsp; &nbsp; 45 &nbsp; 0000739A &nbsp; InternalSetTcpEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 71 &nbsp; &nbsp; &nbsp; 46 &nbsp; 00007B54 &nbsp; IpReleaseAddress <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 72 &nbsp; &nbsp; &nbsp; 47 &nbsp; 00007BA6 &nbsp; IpRenewAddress <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 73 &nbsp; &nbsp; &nbsp; 48 &nbsp; 000078DB &nbsp; IsLocalAddress <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 74 &nbsp; &nbsp; &nbsp; 49 &nbsp; 0000B2F3 &nbsp; NTPTimeToNTFileTime <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 75 &nbsp; &nbsp; &nbsp; 4A &nbsp; 0000B243 &nbsp; NTTimeToNTPTime <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 76 &nbsp; &nbsp; &nbsp; 4B &nbsp; 000085B1 &nbsp; NhGetGuidFromInterfaceName <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 77 &nbsp; &nbsp; &nbsp; 4C &nbsp; 0000855C &nbsp; NhGetInterfaceNameFromGuid <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 78 &nbsp; &nbsp; &nbsp; 4D &nbsp; 00008D49 &nbsp; NhpAllocateAndGetInterfaceInfoFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 79 &nbsp; &nbsp; &nbsp; 4E &nbsp; 00008CA8 &nbsp; NhpGetInterfaceIndexFromStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 80 &nbsp; &nbsp; &nbsp; 4F &nbsp; 00004261 &nbsp; NotifyAddrChange <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 81 &nbsp; &nbsp; &nbsp; 50 &nbsp; 00007956 &nbsp; NotifyRouteChange <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 82 &nbsp; &nbsp; &nbsp; 51 &nbsp; 00007968 &nbsp; NotifyRouteChangeEx <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 99 &nbsp; &nbsp; &nbsp; 52 &nbsp; 00007BF8 &nbsp; SendARP <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 100 &nbsp; &nbsp; &nbsp; 53 &nbsp; 0000BE46 &nbsp; SetAdapterIpAddress <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 101 &nbsp; &nbsp; &nbsp; 54 &nbsp; 00007434 &nbsp; SetBlockRoutes <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 102 &nbsp; &nbsp; &nbsp; 55 &nbsp; 000065CE &nbsp; SetIfEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 103 &nbsp; &nbsp; &nbsp; 56 &nbsp; 00008B83 &nbsp; SetIfEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 104 &nbsp; &nbsp; &nbsp; 57 &nbsp; 00006694 &nbsp; SetIpForwardEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 105 &nbsp; &nbsp; &nbsp; 58 &nbsp; 000098A6 &nbsp; SetIpForwardEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 106 &nbsp; &nbsp; &nbsp; 59 &nbsp; 00009989 &nbsp; SetIpMultihopRouteEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 107 &nbsp; &nbsp; &nbsp; 5A &nbsp; 0000683F &nbsp; SetIpNetEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 108 &nbsp; &nbsp; &nbsp; 5B &nbsp; 000095D2 &nbsp; SetIpNetEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 109 &nbsp; &nbsp; &nbsp; 5C &nbsp; 0000991A &nbsp; SetIpRouteEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 110 &nbsp; &nbsp; &nbsp; 5D &nbsp; 00006784 &nbsp; SetIpStatistics <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 111 &nbsp; &nbsp; &nbsp; 5E &nbsp; 00009545 &nbsp; SetIpStatsToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 112 &nbsp; &nbsp; &nbsp; 5F &nbsp; 00006747 &nbsp; SetIpTTL <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 113 &nbsp; &nbsp; &nbsp; 60 &nbsp; 000096EF &nbsp; SetProxyArpEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 114 &nbsp; &nbsp; &nbsp; 61 &nbsp; 000074A3 &nbsp; SetRouteWithRef <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 115 &nbsp; &nbsp; &nbsp; 62 &nbsp; 00006944 &nbsp; SetTcpEntry <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 116 &nbsp; &nbsp; &nbsp; 63 &nbsp; 00008FE8 &nbsp; SetTcpEntryToStack <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 117 &nbsp; &nbsp; &nbsp; 64 &nbsp; 00007A8A &nbsp; UnenableRouter <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 83 &nbsp; &nbsp; &nbsp; 65 &nbsp; 00009C1A &nbsp; _PfAddFiltersToInterface@24 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 84 &nbsp; &nbsp; &nbsp; 66 &nbsp; 00009CE4 &nbsp; _PfAddGlobalFilterToInterface@8 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 85 &nbsp; &nbsp; &nbsp; 67 &nbsp; 00009E4F &nbsp; _PfBindInterfaceToIPAddress@12 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 86 &nbsp; &nbsp; &nbsp; 68 &nbsp; 00009D8F &nbsp; _PfBindInterfaceToIndex@16 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 87 &nbsp; &nbsp; &nbsp; 69 &nbsp; 00009BE6 &nbsp; _PfCreateInterface@24 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 88 &nbsp; &nbsp; &nbsp; 6A &nbsp; 00009C09 &nbsp; _PfDeleteInterface@4 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 89 &nbsp; &nbsp; &nbsp; 6B &nbsp; 00009FFD &nbsp; _PfDeleteLog@0 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 90 &nbsp; &nbsp; &nbsp; 6C &nbsp; 00009FBD &nbsp; _PfGetInterfaceStatistics@16 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 91 &nbsp; &nbsp; &nbsp; 6D &nbsp; 00009F86 &nbsp; _PfMakeLog@4 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 92 &nbsp; &nbsp; &nbsp; 6E &nbsp; 00009EF6 &nbsp; _PfRebindFilters@8 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 93 &nbsp; &nbsp; &nbsp; 6F &nbsp; 00009CA7 &nbsp; _PfRemoveFilterHandles@12 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 94 &nbsp; &nbsp; &nbsp; 70 &nbsp; 00009C62 &nbsp; _PfRemoveFiltersFromInterface@20 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 95 &nbsp; &nbsp; &nbsp; 71 &nbsp; 00009D1E &nbsp; _PfRemoveGlobalFilterFromInterface@8 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 96 &nbsp; &nbsp; &nbsp; 72 &nbsp; 00009F97 &nbsp; _PfSetLogBuffer@28 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 97 &nbsp; &nbsp; &nbsp; 73 &nbsp; 0000A007 &nbsp; _PfTestPacket@20 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 98 &nbsp; &nbsp; &nbsp; 74 &nbsp; 00009D58 &nbsp; _PfUnBindInterface@4 <br /></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/Windows">Windows</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/96f42f4f33bcbb29afc3ab98.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月20日  下午 06:11</pubDate>
        <category><![CDATA[Windows]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/96f42f4f33bcbb29afc3ab98.html</guid>
</item>

<item>
        <title><![CDATA[WIN2008 无法定位程序输入点 iphlpapi.dll]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/a3bf2b084672532fe924889e.html]]></link>
        <description><![CDATA[
		
		<div><span></span><h3></h3></div><div><span></span>&nbsp;上篇文间中编译后，程序在WIN2008等中运行时，将报无法定位程序输入点AllocateAndGetTcpExTableFromStack无法定位到iphlpapi.dll错误，实际为以前是使用xp下的隐藏函数AllocateAndGetUdpExTableFromStack，AllocateAndGetTcpExTableFromStack来得到这样的功能的。但是现在这个函数在win7下不能正常使用。win7和vista下用InternalGetTcpTable2（）和InternalGetUdpTableWithOwnerPid（）两个函数可以代替AllocateAndGetTcpTableFromStack（）和AllocateAndGetUdpExTableFromStack（），而且这两个函数是没有文档化的~~用法基本一样。</div><div>以下为几个函数的用法，供参考</div><div><span></span>&nbsp;</div><div><p>//Netstat -anb</p><p>#pragma once<br />#pragma once<br />#include &lt;Windows.h&gt;<br />#include &lt;Psapi.h&gt;<br />#include &lt;Iprtrmib.h&gt;<br />#include&nbsp; &lt;iostream&gt;<br />#pragma comment(lib,&quot;Iphlpapi.Lib&quot;)<br />#pragma comment(lib,&quot;Psapi.lib&quot;)<br />#pragma comment(lib,&quot;WS2_32.lib&quot;)</p><p>using namespace&nbsp;&nbsp; std;</p><p><br />typedef struct{<br />&nbsp;DWORD dwState; //连接状态<br />&nbsp;DWORD dwLocalAddr; //本地地址<br />&nbsp;DWORD dwLocalPort; //本地端口<br />&nbsp;DWORD dwRemoteAddr; //远程地址<br />&nbsp;DWORD dwRemotePort; //远程端口<br />&nbsp;DWORD dwProcessId; //进程标识<br />}MIB_TCPEXROW,*PMIB_TCPEXROW;</p><p>typedef struct{<br />&nbsp;DWORD dwLocalAddr; //本地地址<br />&nbsp;DWORD dwLocalPort; //本地端口<br />&nbsp;DWORD dwProcessId; //进程标识<br />}MIB_UDPEXROW,*PMIB_UDPEXROW;</p><p>typedef struct{<br />&nbsp;DWORD dwState; //连接状态<br />&nbsp;DWORD dwLocalAddr; //本地地址<br />&nbsp;DWORD dwLocalPort; //本地端口<br />&nbsp;DWORD dwRemoteAddr; //远程地址<br />&nbsp;DWORD dwRemotePort; //远程端口<br />&nbsp;DWORD dwProcessId; //进程标识<br />&nbsp;DWORD Unknown; //待定标识<br />}MIB_TCPEXROW_VISTA,*PMIB_TCPEXROW_VISTA;</p><p>typedef struct{<br />&nbsp;DWORD dwNumEntries;<br />&nbsp;MIB_TCPEXROW table[ANY_SIZE];<br />}MIB_TCPEXTABLE,*PMIB_TCPEXTABLE;</p><p>typedef struct{<br />&nbsp;DWORD dwNumEntries;<br />&nbsp;MIB_TCPEXROW_VISTA table[ANY_SIZE];<br />}MIB_TCPEXTABLE_VISTA,*PMIB_TCPEXTABLE_VISTA;</p><p>typedef struct{<br />&nbsp;DWORD dwNumEntries;<br />&nbsp;MIB_UDPEXROW table[ANY_SIZE];<br />}MIB_UDPEXTABLE,*PMIB_UDPEXTABLE;</p><p>//enum OSVersion {XP,VISTA,OTHER};</p><p>typedef DWORD (WINAPI *PFNAllocateAndGetTcpExTableFromStack)(<br />&nbsp;PMIB_TCPEXTABLE *pTcpTabel,<br />&nbsp;bool bOrder,<br />&nbsp;HANDLE heap,<br />&nbsp;DWORD zero,<br />&nbsp;DWORD flags<br />&nbsp;);</p><p>typedef DWORD (WINAPI *PFNAllocateAndGetUdpExTableFromStack)(<br />&nbsp;PMIB_UDPEXTABLE *pUdpTable,<br />&nbsp;bool bOrder,<br />&nbsp;HANDLE heap,<br />&nbsp;DWORD zero,<br />&nbsp;DWORD flags<br />&nbsp;);</p><p><br />typedef DWORD (WINAPI *_InternalGetTcpTable2)(<br />&nbsp;PMIB_TCPEXTABLE_VISTA *pTcpTable_Vista,<br />&nbsp;HANDLE heap,<br />&nbsp;DWORD flags<br />&nbsp;);</p><p>typedef DWORD (WINAPI *_InternalGetUdpTableWithOwnerPid)(<br />&nbsp;PMIB_UDPEXTABLE *pUdpTable,<br />&nbsp;HANDLE heap,<br />&nbsp;DWORD flags<br />&nbsp;);</p><p><br />//************************************<br />// Method: GetProcInfo<br />// FullName: GetProcInfo<br />// Access: public <br />// Returns: DWORD if success,return PID;else,return -1 <br />// Qualifier:<br />// Parameter: DWORD type UDP==0 TCP==1<br />// Parameter: DWORD port<br />// Parameter: LPCTSTR lpExeName<br />// Parameter: LPCTSTR lpExePath<br />//************************************<br />DWORD GetProcInfo(BOOL type,DWORD port,LPWSTR lpExeName,LPWSTR lpExePath)<br />{<br />&nbsp;HMODULE hModule = LoadLibrary(L&quot;iphlpapi.dll&quot;);<br />&nbsp;if (hModule == NULL)<br />&nbsp;&nbsp;return -1;</p><p>&nbsp;if (type)<br />&nbsp;{<br />&nbsp;&nbsp;//声明未文档函数<br />&nbsp;&nbsp;PFNAllocateAndGetTcpExTableFromStack pAllcoteAndGetTcpExTableFromStack;<br />&nbsp;&nbsp;pAllcoteAndGetTcpExTableFromStack = (PFNAllocateAndGetTcpExTableFromStack)GetProcAddress(hModule,&quot;AllocateAndGetTcpExTableFromStack&quot;);<br />&nbsp;&nbsp;if (pAllcoteAndGetTcpExTableFromStack != NULL)<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;PMIB_TCPEXTABLE pTcpExTable;<br />&nbsp;&nbsp;&nbsp;if (pAllcoteAndGetTcpExTableFromStack(&amp;pTcpExTable,TRUE,GetProcessHeap(),2,2) != 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;return -1;</p><p>&nbsp;&nbsp;&nbsp;for (UINT i=0;i&lt;pTcpExTable-&gt;dwNumEntries;i++)<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;int temp = ntohs(0x0000FFFF&amp;pTcpExTable-&gt;table[i].dwLocalPort);<br />&nbsp;&nbsp;&nbsp;&nbsp;if (port == temp)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,pTcpExTable-&gt;table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleBaseName(hProcess,NULL,lpExeName,MAX_PATH);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleFileNameEx(hProcess,NULL,lpExePath,MAX_PATH);</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return pTcpExTable-&gt;table[i].dwProcessId;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}</p><p>&nbsp;&nbsp;&nbsp;return -1;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;else<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;PMIB_TCPEXTABLE_VISTA pTcpTable_Vista;<br />&nbsp;&nbsp;&nbsp;_InternalGetTcpTable2 pGetTcpTable = (_InternalGetTcpTable2)GetProcAddress(hModule,&quot;InternalGetTcpTable2&quot;);<br />&nbsp;&nbsp;&nbsp;if (pGetTcpTable == NULL)<br />&nbsp;&nbsp;&nbsp;&nbsp;return -1;</p><p>&nbsp;&nbsp;&nbsp;if (pGetTcpTable(&amp;pTcpTable_Vista,GetProcessHeap(),1))<br />&nbsp;&nbsp;&nbsp;&nbsp;return -1;</p><p>&nbsp;&nbsp;&nbsp;for (UINT i=0;i&lt;pTcpTable_Vista-&gt;dwNumEntries;i++)<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (port == ntohs(0x0000FFFF&amp; pTcpTable_Vista-&gt;table[i] .dwLocalPort))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,pTcpTable_Vista-&gt;table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleBaseName(hProcess,NULL,lpExeName,MAX_PATH);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleFileNameEx(hProcess,NULL,lpExePath,MAX_PATH);</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return pTcpTable_Vista-&gt;table[i].dwProcessId;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}</p><p>&nbsp;&nbsp;&nbsp;return -1; <br />&nbsp;&nbsp;}</p><p>&nbsp;}<br />&nbsp;else<br />&nbsp;{<br />&nbsp;&nbsp;//声明未文档函数<br />&nbsp;&nbsp;//UDP端口信息结构体<br />&nbsp;&nbsp;PMIB_UDPEXTABLE pUdpExTable;<br />&nbsp;&nbsp;PFNAllocateAndGetUdpExTableFromStack pAllcoteAndGetUdpExTableFromStack;<br />&nbsp;&nbsp;pAllcoteAndGetUdpExTableFromStack = (PFNAllocateAndGetUdpExTableFromStack)GetProcAddress(hModule,&quot;AllocateAndGetUdpExTableFromStack&quot;);<br />&nbsp;&nbsp;if (pAllcoteAndGetUdpExTableFromStack != NULL)<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;if (pAllcoteAndGetUdpExTableFromStack(&amp;pUdpExTable,TRUE,GetProcessHeap(),2,2) != 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;return -1;</p><p>&nbsp;&nbsp;&nbsp;for (UINT i=0;i&lt;pUdpExTable-&gt;dwNumEntries;i++)<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (port == ntohs(0x0000FFFF&amp;pUdpExTable-&gt;table[i].dwLocalPort))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,pUdpExTable-&gt;table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleBaseName(hProcess,NULL,lpExeName,MAX_PATH);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleFileNameEx(hProcess,NULL,lpExePath,MAX_PATH);</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return pUdpExTable-&gt;table[i].dwProcessId;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}</p><p>&nbsp;&nbsp;&nbsp;return -1;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;else<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;_InternalGetUdpTableWithOwnerPid pGetUdpTable;<br />&nbsp;&nbsp;&nbsp;pGetUdpTable = (_InternalGetUdpTableWithOwnerPid)GetProcAddress(hModule,&quot;InternalGetUdpTableWithOwnerPid&quot;);<br />&nbsp;&nbsp;&nbsp;if (pGetUdpTable != NULL)<br />&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (pGetUdpTable(&amp;pUdpExTable,GetProcessHeap(),1))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return -1;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;for (UINT i=0;i&lt;pUdpExTable-&gt;dwNumEntries;i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int temp=ntohs(0x0000FFFF&amp;pUdpExTable-&gt;table[i].dwLocalPort);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (temp==8000)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;debuging&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (port == temp&nbsp; )<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,pUdpExTable-&gt;table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleBaseName(hProcess,NULL,lpExeName,MAX_PATH);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetModuleFileNameEx(hProcess,NULL,lpExePath,MAX_PATH);</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return pUdpExTable-&gt;table[i].dwProcessId;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}</p><p>&nbsp;&nbsp;&nbsp;return -1;<br />&nbsp;&nbsp;}<br />&nbsp;}<br />}</p><p><br />int main()<br />{<br />&nbsp;WCHAR szExeName[MAX_PATH] = {0};<br />&nbsp;WCHAR szExePath[MAX_PATH] = {0};<br />&nbsp;int type,port;<br />&nbsp;cout&lt;&lt;&quot;TCP==1 UDP==0&quot;&lt;&lt;endl<br />&nbsp;&nbsp;&lt;&lt;&quot;Protocol:&quot;;<br />&nbsp;cin&gt;&gt;type;<br />&nbsp;cout&lt;&lt;&quot;Port:&quot;;cin&gt;&gt;port;</p><p>&nbsp;DWORD dwPid = GetProcInfo(type,port,szExeName,szExePath);<br />&nbsp;if (dwPid != -1)<br />&nbsp;{<br />&nbsp;&nbsp;wcout&lt;&lt;dwPid&lt;&lt;&quot;/t&quot;&lt;&lt;szExeName&lt;&lt;&quot;/t&quot;&lt;&lt;szExePath&lt;&lt;endl;<br />&nbsp;}<br />&nbsp;else<br />&nbsp;{<br />&nbsp;&nbsp;cout&lt;&lt;&quot;Error!&quot;&lt;&lt;endl;<br />&nbsp;}</p><p>&nbsp;return 0;<br />}</p></div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/c%23">c#</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/a3bf2b084672532fe924889e.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月20日  下午 06:09</pubDate>
        <category><![CDATA[c#]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/a3bf2b084672532fe924889e.html</guid>
</item>

<item>
        <title><![CDATA[delphi 实现端口监控功能 调用iphlpapi.dll 接口]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/465b264668c2f5166a63e5e9.html]]></link>
        <description><![CDATA[
		
		<div>unit Main;</div><div><p><br />interface</p><p>uses<br />&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br />&nbsp; Dialogs, Grids, StdCtrls, ExtCtrls, StrUtils, PsAPI, tlhelp32, WinSock,<br />&nbsp; ComCtrls, SkinCtrls, ImgList;</p><p>type<br />&nbsp; TFrmmain = class(TForm)<br />&nbsp;&nbsp;&nbsp; Panel1: TPanel;<br />&nbsp;&nbsp;&nbsp; Button1: TButton;<br />&nbsp;&nbsp;&nbsp; Label1: TLabel;<br />&nbsp;&nbsp;&nbsp; StringGrid1: TStringGrid;<br />&nbsp;&nbsp;&nbsp; Button2: TButton;<br />&nbsp;&nbsp;&nbsp; Button3: TButton;<br />&nbsp;&nbsp;&nbsp; Button4: TButton;<br />&nbsp;&nbsp;&nbsp; ListView1: TspSkinListView;<br />&nbsp;&nbsp;&nbsp; SaveDialog1: TSaveDialog;<br />&nbsp;&nbsp;&nbsp; procedure FormCreate(Sender: TObject);<br />&nbsp;&nbsp;&nbsp; procedure Button1Click(Sender: TObject);<br />&nbsp;&nbsp;&nbsp; procedure Button2Click(Sender: TObject);<br />&nbsp;&nbsp;&nbsp; procedure Button3Click(Sender: TObject);<br />&nbsp;&nbsp;&nbsp; procedure StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var CanSelect: Boolean);<br />&nbsp;&nbsp;&nbsp; procedure Button4Click(Sender: TObject);<br />&nbsp; private<br />&nbsp;&nbsp;&nbsp; { Private declarations }<br />&nbsp; public<br />&nbsp;&nbsp;&nbsp; { Public declarations }<br />&nbsp; end;</p><p>var<br />&nbsp; Frmmain: TFrmmain;</p><p>&nbsp;</p><p>const<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_CLOSED&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 1;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_LISTEN&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 2;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_SYN_SENT&nbsp;&nbsp; =&nbsp; 3;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_SYN_RCVD&nbsp;&nbsp; =&nbsp; 4;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_ESTAB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 5;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_FIN_WAIT1&nbsp; =&nbsp; 6;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_FIN_WAIT2&nbsp; =&nbsp; 7;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_CLOSE_WAIT =&nbsp; 8;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_CLOSING&nbsp;&nbsp;&nbsp; =&nbsp; 9;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_LAST_ACK&nbsp;&nbsp; = 10;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_TIME_WAIT&nbsp; = 11;<br />&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_DELETE_TCB = 12;</p><p>//相关数据结构的定义<br />const<br />&nbsp;&nbsp;&nbsp; ANY_SIZE=256;</p><p>type<br />&nbsp;&nbsp;&nbsp; MIB_TCPEXROW = record<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwState : DWORD;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //连接状态<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwLocalAddr : DWORD;&nbsp; //本地地址<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwLocalPort : DWORD;&nbsp; //本地端口<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwRemoteAddr : DWORD; //远程地址<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwRemotePort : DWORD; //远程端口<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwProcessId : DWORD;&nbsp; //进程ID号<br />&nbsp;&nbsp;&nbsp; end;</p><p>&nbsp;&nbsp;&nbsp; MIB_TCPEXTABLE = record<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwNumEntries : DWORD; //端口数量<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table : array [0..ANY_SIZE-1] of MIB_TCPEXROW;<br />&nbsp;&nbsp;&nbsp; end;</p><p>&nbsp;&nbsp;&nbsp; PMIB_TCPEXTABLE = ^MIB_TCPEXTABLE;</p><p>&nbsp;&nbsp;&nbsp; MIB_UDPEXROW = record<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwLocalAddr : DWORD; //本地地址<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwLocalPort : DWORD; //本地端口<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwProcessId : DWORD; //进程ID号<br />&nbsp;&nbsp;&nbsp; end;</p><p>&nbsp;&nbsp;&nbsp; MIB_UDPEXTABLE = record<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dwNumEntries : DWORD; //端口数量<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table : array [0..ANY_SIZE-1] of MIB_UDPEXROW;<br />&nbsp;&nbsp;&nbsp; end;</p><p>&nbsp;&nbsp;&nbsp; PMIB_UDPEXTABLE = ^MIB_UDPEXTABLE;</p><p>//获取TCP连接表的IP帮助函数声明<br />function AllocateAndGetTcpExTableFromStack(<br />&nbsp;&nbsp;&nbsp; var pTcpTable;<br />&nbsp;&nbsp;&nbsp; bOrder : Bool;<br />&nbsp;&nbsp;&nbsp; heap : THandle;<br />&nbsp;&nbsp;&nbsp; zero : DWORD;<br />&nbsp;&nbsp;&nbsp; flags : DWORD<br />&nbsp;&nbsp;&nbsp; ): DWORD; stdcall; external 'iphlpapi.dll'<br />&nbsp;&nbsp;&nbsp; name 'AllocateAndGetTcpExTableFromStack';</p><p>//获取UDP连接表的IP帮助函数声明<br />function AllocateAndGetUdpExTableFromStack(<br />&nbsp;&nbsp;&nbsp; var pUdpTable;<br />&nbsp;&nbsp;&nbsp; bOrder : Bool;<br />&nbsp;&nbsp;&nbsp; heap : THandle;<br />&nbsp;&nbsp;&nbsp; zero : DWORD;<br />&nbsp;&nbsp;&nbsp; flags : DWORD<br />&nbsp;&nbsp;&nbsp; ): DWORD; stdcall; external 'iphlpapi.dll'<br />&nbsp;&nbsp;&nbsp; name 'AllocateAndGetUdpExTableFromStack';</p><p><br />implementation</p><p>uses<br />&nbsp; ShellAPI;<br />&nbsp; <br />{$R *.dfm}</p><p>&nbsp;</p><p>procedure TFrmmain.FormCreate(Sender: TObject);<br />begin<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[0,0]:=' 协议';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[1,0]:=' 本地IP地址';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[2,0]:=' 远程IP地址';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[3,0]:=' 连接状态';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[4,0]:=' 进程ID';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[5,0]:=' 可执行文件名';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[6,0]:=' 文件路径';<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[7,0]:=' 文件说明 / 公司名称';<br />&nbsp;&nbsp;&nbsp; self.Button1Click(self);</p><p>&nbsp;</p><p>end;</p><p>//将连接状态转换为说明字符串<br />function StateToString(dwState : DWORD): String;<br />begin<br />&nbsp;&nbsp;&nbsp; result:='';<br />&nbsp;&nbsp;&nbsp; case dwState of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_CLOSED&nbsp;&nbsp;&nbsp;&nbsp; : result:='关闭';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_LISTEN&nbsp;&nbsp;&nbsp;&nbsp; : result:='监听';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_SYN_SENT&nbsp;&nbsp; : result:='同步发送';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_SYN_RCVD&nbsp;&nbsp; : result:='同步接收';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_ESTAB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : result:='已建立';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_FIN_WAIT1&nbsp; : result:='等待完成1';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_FIN_WAIT2&nbsp; : result:='等待完成2';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_CLOSE_WAIT : result:='等待关闭';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_CLOSING&nbsp;&nbsp;&nbsp; : result:='正在关闭';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_LAST_ACK&nbsp;&nbsp; : result:='最后确认';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_TIME_WAIT&nbsp; : result:='等待时间';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIB_TCP_STATE_DELETE_TCB : result:='删除';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else result:=Format('未知状态%d',[dwState]);<br />&nbsp;&nbsp;&nbsp; end;<br />end;</p><p>//根据进程ID查找可执行文件名<br />function IdToExeFile(hSnapshot : THandle; dwProcessId : DWORD): String;<br />var<br />&nbsp;&nbsp;&nbsp; lppe : TProcessEntry32;<br />&nbsp;&nbsp;&nbsp; b : BOOL;<br />begin<br />&nbsp;&nbsp;&nbsp; lppe.dwSize:=SizeOf(lppe);<br />&nbsp;&nbsp;&nbsp; //取第1个进程数据<br />&nbsp;&nbsp;&nbsp; b:=Process32First(hSnapshot,lppe);<br />&nbsp;&nbsp;&nbsp; result:='';<br />&nbsp;&nbsp;&nbsp; while b do<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if lppe.th32ProcessID=dwProcessId then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result:=lppe.szExeFile;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //取下一个进程<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b:=Process32Next(hSnapshot,lppe);<br />&nbsp;&nbsp;&nbsp; end;<br />end;</p><p><br />function GetProcessIcon(): TImageList;<br />var<br />&nbsp;&nbsp;&nbsp; hSnapshot : THandle; //进程快照<br />&nbsp;&nbsp;&nbsp; lppe : TProcessEntry32;<br />&nbsp;&nbsp;&nbsp; imgList : TImageList;<br />&nbsp;&nbsp;&nbsp; iCon : TIcon;<br />&nbsp;&nbsp;&nbsp; b : BOOL;<br />begin<br />&nbsp; imgList := TImageList.Create(nil);<br />&nbsp; imgList.Width := 16;<br />&nbsp; imgList.Height := 16;</p><p>&nbsp; hSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);</p><p>&nbsp; lppe.dwSize:=SizeOf(lppe);<br />&nbsp; //取第1个进程数据<br />&nbsp; b:=Process32First(hSnapshot,lppe);<br />&nbsp; while b do<br />&nbsp; begin<br />&nbsp;&nbsp;&nbsp; iCon := TIcon.Create;<br />&nbsp;&nbsp;&nbsp; iCon.Handle := ExtractIcon(HInstance,lppe.szExeFile,0) ;</p><p>&nbsp;&nbsp;&nbsp; imgList.AddIcon(iCon);<br />&nbsp;&nbsp;&nbsp; b:=Process32Next(hSnapshot,lppe);<br />&nbsp; end;<br />&nbsp; Result := imgList;<br />end;</p><p>//根据进程ID查找可执行文件路径<br />function IdToExeDir(dwProcessId : DWORD): String;<br />var<br />&nbsp;&nbsp;&nbsp; cbNeeded : DWORD;<br />&nbsp;&nbsp;&nbsp; hProcess : THandle;<br />&nbsp;&nbsp;&nbsp; hModules : HMODULE;<br />&nbsp;&nbsp;&nbsp; lpFilename : array [0..1024-1] of Char;<br />begin<br />&nbsp;&nbsp;&nbsp; result:='';<br />&nbsp;&nbsp;&nbsp; hProcess:=OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,false,dwProcessId);<br />&nbsp;&nbsp;&nbsp; if hProcess=0 then exit;<br />&nbsp;&nbsp;&nbsp; EnumProcessModules(hProcess,@hModules,sizeof(hModule),cbNeeded);<br />&nbsp;&nbsp;&nbsp; GetModuleFileNameEx(hProcess,hModules,lpFilename,1024);<br />&nbsp;&nbsp;&nbsp; result:=lpFilename;<br />&nbsp;&nbsp;&nbsp; CloseHandle(hProcess);<br />end;</p><p><br />//根据进程ID查找可执行文件路径<br />function IdToExeIco(dwProcessId : DWORD): hIcon;<br />var<br />&nbsp;&nbsp;&nbsp; cbNeeded : DWORD;<br />&nbsp;&nbsp;&nbsp; hProcess : THandle;<br />&nbsp;&nbsp;&nbsp; hModules : HMODULE;<br />&nbsp;&nbsp;&nbsp; lpFilename : array [0..1024-1] of Char;<br />begin<br />&nbsp;&nbsp;&nbsp; result:=0;<br />&nbsp;&nbsp;&nbsp; hProcess:=OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,false,dwProcessId);<br />&nbsp;&nbsp;&nbsp; if hProcess=0 then exit;<br />&nbsp;&nbsp;&nbsp; EnumProcessModules(hProcess,@hModules,sizeof(hModule),cbNeeded);<br />&nbsp;&nbsp;&nbsp; GetModuleFileNameEx(hProcess,hModules,lpFilename,1024);<br />&nbsp;&nbsp;&nbsp; result:=ExtractIcon(HInstance,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpFilename,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0); ;<br />&nbsp;&nbsp;&nbsp; CloseHandle(hProcess);<br />end;</p><p>//根据文件名查找文件信息<br />function ExeDirToFileInfo(Filename : String): String;<br />var<br />&nbsp;&nbsp;&nbsp; NameLen,BufLen,ValLen : DWORD;<br />&nbsp;&nbsp;&nbsp; pBuf,pVal : Pointer;<br />&nbsp;&nbsp;&nbsp; LangCode : String;<br />begin<br />&nbsp;&nbsp;&nbsp; result:='';<br />&nbsp;&nbsp;&nbsp; NameLen:=Length(Filename);<br />&nbsp;&nbsp;&nbsp; if NameLen=0 then exit;<br />&nbsp;&nbsp;&nbsp; //获取版本信息<br />&nbsp;&nbsp;&nbsp; BufLen:=GetFileVersionInfoSize(PChar(Filename),NameLen);<br />&nbsp;&nbsp;&nbsp; pBuf:=AllocMem(BufLen);<br />&nbsp;&nbsp;&nbsp; if pBuf=nil then exit;<br />&nbsp;&nbsp;&nbsp; if GetFileVersionInfo(PChar(Filename),0,BufLen,pBuf)=false then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FreeMem(pBuf);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; //获取代码页信息<br />&nbsp;&nbsp;&nbsp; if VerQueryValue(pBuf,'\VarFileInfo\Translation',pVal,ValLen)=false then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FreeMem(pBuf);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; LangCode:=Format('%.2x%.2x%.2x%.2x',[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BYTE(PChar(pVal)[1]),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BYTE(PChar(pVal)[0]),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BYTE(PChar(pVal)[3]),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BYTE(PChar(pVal)[2])]);<br />&nbsp;&nbsp;&nbsp; //获取文件说明<br />&nbsp;&nbsp;&nbsp; if VerQueryValue(pBuf,PChar('\StringFileInfo\'+LangCode+'\FileDescription'),pVal,ValLen)=false then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FreeMem(pBuf);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; result:=PChar(pVal);<br />&nbsp;&nbsp;&nbsp; //获取公司名称<br />&nbsp;&nbsp;&nbsp; if VerQueryValue(pBuf,PChar('\StringFileInfo\'+LangCode+'\CompanyName'),pVal,ValLen)=false then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FreeMem(pBuf);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; result:=result+' / '+PChar(pVal);<br />&nbsp;&nbsp;&nbsp; FreeMem(pBuf);<br />end;</p><p>procedure TFrmmain.Button1Click(Sender: TObject);<br />var<br />&nbsp;&nbsp;&nbsp; hSnapshot : THandle; //进程快照<br />&nbsp;&nbsp;&nbsp; pTcpTab : PMIB_TCPEXTABLE; //TCP连接表<br />&nbsp;&nbsp;&nbsp; pUdpTab : PMIB_UDPEXTABLE; //UDP连接表<br />&nbsp;&nbsp;&nbsp; i : Integer;<br />begin<br />&nbsp;&nbsp;&nbsp; self.StringGrid1.RowCount:=2;<br />&nbsp;&nbsp;&nbsp; //创建进程快照<br />&nbsp;&nbsp;&nbsp; hSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />&nbsp;&nbsp;&nbsp; //获取TCP连接表<br />&nbsp;&nbsp;&nbsp; if AllocateAndGetTcpExTableFromStack(pTcpTab,true,GetProcessHeap(),2,2)&lt;&gt;0 then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox(self.Handle,'无法获取TCP连接表','调用失败',MB_ICONEXCLAMATION or MB_OK);<br />&nbsp;&nbsp;&nbsp; end<br />&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //输出TCP连接表<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i:=0 to pTcpTab.dwNumEntries-1 do<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[0,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'TCP';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[1,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet_ntoa(TInAddr(pTcpTab.table[i].dwLocalAddr))+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ':'+IntToStr(ntohs(pTcpTab.table[i].dwLocalPort));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[2,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet_ntoa(TInAddr(pTcpTab.table[i].dwRemoteAddr))+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ':'+IntToStr(ntohs(pTcpTab.table[i].dwRemotePort));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[3,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StateToString(pTcpTab.table[i].dwState);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[4,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IntToStr(pTcpTab.table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[5,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IdToExeFile(hSnapshot,pTcpTab.table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[6,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IdToExeDir(pTcpTab.table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[7,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExeDirToFileInfo(self.StringGrid1.Cells[6,self.StringGrid1.RowCount-1]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.RowCount:=self.StringGrid1.RowCount+1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; //获取UDP连接表<br />&nbsp;&nbsp;&nbsp; if AllocateAndGetUdpExTableFromStack(pUdpTab,true,GetProcessHeap(),2,2)&lt;&gt;0 then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox(self.Handle,'无法获取UDP连接表','调用失败',MB_ICONEXCLAMATION or MB_OK);<br />&nbsp;&nbsp;&nbsp; end<br />&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //输出UDP连接表<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i:=0 to pUdpTab.dwNumEntries-1 do<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[0,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'UDP';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[1,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet_ntoa(TInAddr(pUdpTab.table[i].dwLocalAddr))+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ':'+IntToStr(ntohs(pUdpTab.table[i].dwLocalPort));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[2,self.StringGrid1.RowCount-1]:=<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; self.StringGrid1.Cells[3,self.StringGrid1.RowCount-1]:=<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; self.StringGrid1.Cells[4,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IntToStr(pUdpTab.table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[5,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IdToExeFile(hSnapshot,PUdpTab.table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[6,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IdToExeDir(pUdpTab.table[i].dwProcessId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[7,self.StringGrid1.RowCount-1]:=<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExeDirToFileInfo(self.StringGrid1.Cells[6,self.StringGrid1.RowCount-1]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.RowCount:=self.StringGrid1.RowCount+1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; //关闭句柄<br />&nbsp;&nbsp;&nbsp; CloseHandle(hSnapshot);<br />&nbsp;&nbsp;&nbsp; //<br />&nbsp;&nbsp;&nbsp; if self.StringGrid1.RowCount=2 then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.Label1.Caption:='发现 TCP/UDP 连接端口： 0 个';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[0,1]:='空';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[1,1]:='';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[2,1]:='';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[3,1]:='';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[4,1]:='';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[5,1]:='';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[6,1]:='';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.Cells[7,1]:='';<br />&nbsp;&nbsp;&nbsp; end<br />&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.StringGrid1.RowCount:=self.StringGrid1.RowCount-1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.Label1.Caption:=Format('发现 TCP/UDP 连接端口： %d 个',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [self.StringGrid1.RowCount-1]);<br />&nbsp;&nbsp;&nbsp; end;<br />end;</p><p>procedure TFrmmain.Button2Click(Sender: TObject);<br />var<br />&nbsp;&nbsp;&nbsp; ColLen : array of Integer;<br />&nbsp;&nbsp;&nbsp; c,r,n : Integer;<br />&nbsp;&nbsp;&nbsp; f : TFileStream;<br />&nbsp;&nbsp;&nbsp; s : String;<br />begin<br />&nbsp;&nbsp;&nbsp; if (self.StringGrid1.ColCount=0) or<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (self.StringGrid1.RowCount=0) then exit;<br />&nbsp;&nbsp;&nbsp; if not self.SaveDialog1.Execute then exit;<br />&nbsp;&nbsp;&nbsp; //计算每列字符长度<br />&nbsp;&nbsp;&nbsp; SetLength(ColLen,self.StringGrid1.ColCount);<br />&nbsp;&nbsp;&nbsp; for c:=0 to self.StringGrid1.ColCount-1 do<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ColLen[c]:=0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for r:=0 to self.StringGrid1.RowCount-1 do<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n:=Length(self.StringGrid1.Cells[c,r]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if n&gt;ColLen[c] then ColLen[c]:=n;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ColLen[c]:=ColLen[c]+1;<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; //每列对齐后写入文件<br />&nbsp;&nbsp;&nbsp; f:=TFileStream.Create(self.SaveDialog1.FileName,fmCreate);<br />&nbsp;&nbsp;&nbsp; for r:=0 to self.StringGrid1.RowCount-1 do<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for c:=0 to self.StringGrid1.ColCount-1 do<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s:=self.StringGrid1.Cells[c,r];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n:=Length(s);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s:=s+DupeString(' ',ColLen[c]-n);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.Write(Pointer(s)^,ColLen[c]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s:=#13#10#32;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.Write(Pointer(s)^,3);<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; MessageBox(self.Handle,PChar(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '连接表信息已保存到文件 '+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.SaveDialog1.FileName+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 中。'),'保存完毕',MB_ICONINFORMATION or MB_OK);<br />&nbsp;&nbsp;&nbsp; //<br />&nbsp;&nbsp;&nbsp; SetLength(ColLen,0);<br />&nbsp;&nbsp;&nbsp; f.Free;<br />end;</p><p>procedure TFrmmain.Button3Click(Sender: TObject);<br />begin<br />&nbsp;&nbsp;&nbsp; MessageBox(self.Handle,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '进程连接端口查看器'+#13+#13+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '作者：yeye55'+#13+#13+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '2008年2月25日'+#13+#13+<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '本程序最早在<a href="http://www.programbbs.com/bbs/">http://www.programbbs.com/bbs/</a>上发布',<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '关于',MB_ICONASTERISK or MB_OK);<br />end;</p><p>procedure TFrmmain.StringGrid1SelectCell(Sender: TObject; ACol,<br />&nbsp; ARow: Integer; var CanSelect: Boolean);<br />begin<br />//&nbsp; Self.Image1.Picture.Icon.Handle := IdToExeIco(StrToInt(StringGrid1.cells[4,arow]));<br />end;</p><p>function GetFileIcon(const Filename:String; SmallIcon:Boolean):HICON;<br />var&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //该函数可获得指定文件的图标<br />&nbsp; info: TSHFILEINFO;<br />&nbsp; Flag: Integer;<br />begin<br />&nbsp; if SmallIcon then<br />&nbsp;&nbsp;&nbsp; Flag := (SHGFI_SMALLICON or SHGFI_ICON)<br />&nbsp; else<br />&nbsp;&nbsp;&nbsp; Flag := (SHGFI_LARGEICON or SHGFI_ICON);<br />&nbsp; SHGetFileInfo(Pchar(Filename), 0, info, Sizeof(info), Flag);<br />&nbsp; Result := info.hIcon;<br />end;</p><p>procedure TFrmmain.Button4Click(Sender: TObject);<br />var<br />&nbsp;&nbsp;&nbsp; hSnapshot : THandle; //进程快照<br />&nbsp;&nbsp;&nbsp; lppe : TProcessEntry32;<br />&nbsp;&nbsp;&nbsp; imgList : TImageList;<br />&nbsp;&nbsp;&nbsp; iCon : TIcon;<br />&nbsp;&nbsp;&nbsp; b : BOOL;<br />&nbsp;&nbsp;&nbsp; ListItem : TListItem;<br />&nbsp;&nbsp;&nbsp; iConindex:Word;<br />&nbsp;&nbsp;&nbsp; procFile : array[0..MAX_PATH] of Char;<br />begin<br />&nbsp; imgList := TImageList.Create(nil);</p><p>&nbsp; imgList.Width := 24;<br />&nbsp; imgList.Height := 24;<br />&nbsp; ListView1.LargeImages := imgList;<br />&nbsp; ListView1.SmallImages := imgList;<br />&nbsp; ListView1.ViewStyle := vsReport;<br />//&nbsp; ListView1.ShowColumnHeaders := true;<br />&nbsp;&nbsp; iConindex := 1;<br />&nbsp; hSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);</p><p>&nbsp; lppe.dwSize:=SizeOf(lppe);<br />&nbsp; //取第1个进程数据<br />&nbsp; b:=Process32First(hSnapshot,lppe);<br />&nbsp; while b do<br />&nbsp; begin<br />&nbsp;&nbsp;&nbsp; iCon := TIcon.Create;</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp; iCon.Handle := ExtractIcon(HInstance,PChar(IdToExeDir(lppe.th32ProcessID)),0);<br />&nbsp;&nbsp;&nbsp; if iCon.Handle = 0 then<br />&nbsp;&nbsp;&nbsp; begin<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StrPCopy(procFile,lppe.szExeFile);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iCon.Handle := ExtractAssociatedIcon(HInstance,procFile,iConindex);<br />&nbsp;&nbsp;&nbsp; end;<br />&nbsp;&nbsp;&nbsp; ListItem := ListView1.Items.Add();<br />&nbsp;&nbsp;&nbsp; ListItem.Caption :=lppe.szExeFile;</p><p>&nbsp;&nbsp;&nbsp; ListItem.ImageIndex := imgList.AddIcon(iCon);<br />&nbsp;&nbsp;&nbsp; ListItem.SubItems.Add(IntToStr(lppe.th32ProcessID));<br />&nbsp;&nbsp;&nbsp; ListItem.SubItems.Add(IntToStr(lppe.cntThreads));<br />&nbsp;&nbsp;&nbsp; ListItem.SubItems.Add('');<br />&nbsp;&nbsp;&nbsp; ListItem.SubItems.Add(IdToExeDir(lppe.th32ProcessID));</p><p>&nbsp;&nbsp;&nbsp; b:=Process32Next(hSnapshot,lppe);<br />&nbsp; end;<br />end;</p><p>&nbsp;</p></div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%C8%ED%BC%FE%28delphi%29">软件(delphi)</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/465b264668c2f5166a63e5e9.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月20日  下午 04:20</pubDate>
        <category><![CDATA[软件(delphi)]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/465b264668c2f5166a63e5e9.html</guid>
</item>

<item>
        <title><![CDATA[做 l2tp vpn 报错误781 提示需要证书!!!]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/e0c47a4ed712d116b3de059d.html]]></link>
        <description><![CDATA[
		
		<p><span style="font-size: 16px;">按照以下步骤配置Windows XP 计算机，使其成为L2TP 客户端。</span><br /><span style="font-size: 16px;">1. 配置L2TP 拨号连接：</span><br /><span style="font-size: 16px;">1） 进入Windows XP 的“开始” “设置” “控制面板”，选择“切换到分类视图”。</span><br /><span style="font-size: 16px;">2） 选择“网络和Internet 连接”。</span><br /><span style="font-size: 16px;">3） 选择“建立一个您的工作位置的网络连接”。</span><br /><span style="font-size: 16px;">4） 选择“虚拟专用网络连接”，单击“下一步”。</span><br /><span style="font-size: 16px;">5） 为连接输入一个名字为“l2tp”，单击“下一步”。</span><br /><span style="font-size: 16px;">6） 选择“不拨此初始连接”，单击“下一步”。</span><br /><span style="font-size: 16px;">7） 输入准备连接的L2TP 服务器的IP 地址“202.101.35.218”，单击“下一步”。</span><br /><span style="font-size: 16px;">8） 单击“完成”。</span><br /><span style="font-size: 16px;">9） 双击“l2tp”连接，在l2tp 连接窗口，单击“属性”。</span><br /><span style="font-size: 16px;">10） 选择“安全”属性页，选择“高级（自定义设置）”，单击“设置”。</span><br /><span style="font-size: 16px;">11） 在“数据加密”中选择“可选加密（没有加密也可以连接）”。</span><br /><span style="font-size: 16px;">12） 在“允许这些协议”选中“不加密的密码（PAP）”、“质询握手身份验证协议</span><br /><span style="font-size: 16px;">（CHAP）”、“Microsoft CHAP（MS-CHAP）”，单击“确定”。</span><br /><span style="font-size: 16px;">13） 选择“网络”属性页面，在“VPN 类型”选择“L2TP IPSec VPN”。</span><br /><span style="font-size: 16px;">14） 确认“Internet 协议（TCP/IP）”被选中。</span><br /><span style="font-size: 16px;">15） 确认“NWLink IPX/SPX/NetBIOS Compatible Transport Prococol”、“微软网络文件</span><br /><span style="font-size: 16px;">和打印共享”、“微软网络客户”协议没有被选中。</span><br /><span style="font-size: 16px;">16） 单击“确定”，保存所做的修改。</span><br /><span style="font-size: 16px;">2. 修改注册表</span><br /><span style="font-size: 16px;">缺省的Windows XP L2TP 传输策略不允许L2TP 传输不使用IPSec 加密。可以通过修改</span><br /><span style="font-size: 16px;">Windows XP 注册表来禁用缺省的行为：</span><br /><span style="font-size: 16px;">手工修改：</span><br /><span style="font-size: 16px;">1） 进入Windows XP 的“开始” “运行”里面输入“Regedt32”，打开“注册表编辑</span><br /><span style="font-size: 16px;">器”，定位“HKEY_Local_Machine \ System \ CurrentControl Set \ Services \ RasMan \</span><br /><span style="font-size: 16px;">Parameters ”主键。</span><br /><span style="font-size: 16px;">2） 为该主键添加以下键值：</span><br /><span style="font-size: 16px;">键值：ProhibitIpSec</span><br /><span style="font-size: 16px;">数据类型：reg_dword</span><br /><span style="font-size: 16px;">值：1</span><br /><span style="font-size: 16px;">3）保存所做的修改，重新启动电脑以使改动生效。</span><br /><span style="font-size: 16px;">提示：必须添加“ProhibitIpSec”注册表键值到每个要使用L2TP 的运行Windows XP 操</span><br /><span style="font-size: 16px;">作系统的电脑。</span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/e0c47a4ed712d116b3de059d.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月02日  上午 11:44</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/e0c47a4ed712d116b3de059d.html</guid>
</item>

<item>
        <title><![CDATA[配置防火墙网页登陆]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/044b9afd2c132f0808244d40.html]]></link>
        <description><![CDATA[
		
		<p><span style="font-size: 18px;">1. 配置防火墙缺省允许报文通过。</span><br /><span style="font-size: 18px;">&lt;H3C&gt; system-view</span><br /><span style="font-size: 18px;">[H3C] firewall packet-filter default permit</span></p><p><span style="font-size: 18px;">2. 为防火墙的以太网接口（以GigabitEthernet0/0为例）配置IP地址，并将接口加入到安全区域。</span><br /><span style="font-size: 18px;">[H3C] interface GigabitEthernet0/0</span><br /><span style="font-size: 18px;">[H3C-GigabitEthernet0/0] ip address 192.168.0.1 255.255.255.0</span><br /><span style="font-size: 18px;">[H3C-GigabitEthernet0/0] quit</span><br /><span style="font-size: 18px;">[H3C] firewall zone trust</span><br /><span style="font-size: 18px;">[H3C-zone-trust] add interface GigabitEthernet0/0</span><br /><span style="font-size: 18px;">3. 为PC配置IP地址。</span><br /><span style="font-size: 18px;">假设PC的IP地址为192.168.0.2。</span><br /><span style="font-size: 18px;">4. 使用Ping命令验证网络连接性。</span><br /><span style="font-size: 18px;">&lt;H3C&gt; ping 192.168.0.2</span><br /><span style="font-size: 18px;">Ping命令成功！后</span></p><p><span style="font-size: 18px;">5.添加登录用户</span><br /><span style="font-size: 18px;">为使用户可以通过Web登录，并且有权限对防火墙进行管理，必须为用户添加登录帐户并且赋予其权限。例如：建立一个帐户名和密码都为admin，帐户类型为telnet，权限等级为3的管理员用户。</span><br /><span style="font-size: 18px;">[H3C] local-user admin</span><br /><span style="font-size: 18px;">[H3C-luser-admin] password simple admin</span><br /><span style="font-size: 18px;">[H3C-luser-admin] service-type telnet</span><br /><span style="font-size: 18px;">[H3C-luser-admin] level 3</span></p><p><span style="font-size: 18px;">在PC上启动浏览器（建议使用IE5.0及以上版本），在地址栏中输入IP地址“192.168.0.1”后回车，即可进入防火墙Web登录页面，使用之前创建的admin帐户登录防火墙，单击&lt;Login&gt;按钮即可登录。用户可以通过“Language”下拉框选择界面语言</span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/044b9afd2c132f0808244d40.html#comment">查看评论</a>]]></description>
        <pubDate>2012年02月02日  上午 08:01</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/044b9afd2c132f0808244d40.html</guid>
</item>

<item>
        <title><![CDATA[带GK的VOIP典型配置指导（六）[转]]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/a3c123b3a0e39bbad8335a11.html]]></link>
        <description><![CDATA[
		
		<h3><a name="_Toc139858556"></a><a name="_Toc111967947"></a><a name="_Toc111967946"></a><a name="_Toc111968143"></a><a name="_Toc112060362"></a><span>3.5.4</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">验证结果</span></h3><h5><span>1)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>如果<span>GW&nbsp;</span>在<span>GK</span>上成功注册，在命令行执行<span>display voice gateway</span>命令显示的注册状态信息如下：</h5><p><span>[ar4640-voice-gk]display voice gateway</span></p><p><span>&nbsp; GW_Status = Registered</span></p><p><span>&nbsp; GK_ID&nbsp;&nbsp;&nbsp;&nbsp; = XE-GK</span></p><p><span>&nbsp; Current GW information :</span></p><p><span>&nbsp;&nbsp;&nbsp; H323-ID&nbsp;&nbsp;&nbsp; gw46</span></p><p><span>&nbsp;&nbsp;&nbsp; E164-ID&nbsp;&nbsp;&nbsp; 4600</span></p><p><span>&nbsp;&nbsp;&nbsp; E164-ID&nbsp;&nbsp;&nbsp; 4601</span></p><p><span></span>&nbsp;</p><p><span>&nbsp; Current GK information :</span></p><p><span>&nbsp;&nbsp;&nbsp; H323-ID&nbsp;&nbsp;&nbsp; gw46</span></p><p><span>&nbsp;&nbsp;&nbsp; E164-ID&nbsp;&nbsp;&nbsp; 4600</span></p><p><span>&nbsp;&nbsp;&nbsp; E164-ID &nbsp;&nbsp;&nbsp;4601</span></p><p><span></span>&nbsp;</p><h5><span>2)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>如果<span>GW&nbsp;</span>在<span>GK</span>上注册失败，在命令行执行<span>display voice gateway</span>命令显示的注册状态信息如下：</h5><p><span>[ar4640-voice]dis vo gateway</span></p><p><span>&nbsp; GW_Status = No_Registered</span></p><p><span>&nbsp; GK_ID&nbsp;&nbsp;&nbsp;&nbsp; = NONE</span></p><p><span>&nbsp; Current GW information :</span></p><p><span>&nbsp;&nbsp;&nbsp; H323-ID&nbsp;&nbsp;&nbsp; gw46</span></p><p><span>&nbsp;&nbsp;&nbsp; E164-ID&nbsp;&nbsp;&nbsp; 4600</span></p><p><span>&nbsp;&nbsp;&nbsp; E164-ID&nbsp;&nbsp;&nbsp; 4601</span></p><p><span></span>&nbsp;</p><p><span>&nbsp; Current GK information :</span></p><p><span>&nbsp;&nbsp;&nbsp; NONE</span></p><p><span></span>&nbsp;</p><h5><span>3)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>在<span>GK</span>上成功注册后，<span>AR2809&nbsp;</span>和<span>AR4640</span>之间的电话可以成功建立呼叫。</h5><h3><a name="_Toc139858557"></a><a name="_Toc111967949"></a><a name="_Toc111967948"></a><a name="_Toc111968145"></a><a name="_Toc112060364"></a><span>3.5.5</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">故障排除</span></h3><p><b><span style="font-family: 宋体;">故障之一：</span><span>GW</span></b><b><span style="font-family: 宋体;">不向</span><span>GK Server</span></b><b><span style="font-family: 宋体;">发送注册报文</span></b></p><p><span style="font-family: 宋体;">故障原因：</span><span>GW</span><span style="font-family: 宋体;">语音网关的</span><span>GK Client&nbsp;</span><span style="font-family: 宋体;">功能没有被激活。</span></p><p><span style="font-family: 宋体;">诊断：使用</span><span>display current-configuration</span><span style="font-family: 宋体;">命令查看</span><span>ras-on</span><span style="font-family: 宋体;">命令是否已经配置上，或者在</span><span>gk-client</span><span style="font-family: 宋体;">视图下使用</span><span>display this</span><span style="font-family: 宋体;">命令也可查看</span><span>ras-on</span><span style="font-family: 宋体;">命令是否已经配置上。</span></p><p><span style="font-family: 宋体;">解决方法：参照</span><span>3.2</span><span style="font-family: 宋体;">节检查</span><span>GK Client</span><span style="font-family: 宋体;">的必须配置您是否都已配置上。</span></p><p><b><span style="font-family: 宋体;">故障之二：</span><span> GW</span></b><b><span style="font-family: 宋体;">在</span><span>GK Server</span></b><b><span style="font-family: 宋体;">端登记不成功</span></b></p><p><span style="font-family: 宋体;">会有很多原因导致登记不成功，请依照下列步骤排除：</span></p><p><span>1</span><span style="font-family: 宋体;">、用</span><span>ping</span><span style="font-family: 宋体;">命令查看是否与</span><span>GK Server</span><span style="font-family: 宋体;">能够在网络层互通。</span></p><p><span>2</span><span style="font-family: 宋体;">、查看您的</span><span>GK Server</span><span style="font-family: 宋体;">端</span><span>GK</span><span style="font-family: 宋体;">服务是否已经开启。</span></p><p><span>3</span><span style="font-family: 宋体;">、保证两端路由器没有配置重复的</span><span>E164</span><span style="font-family: 宋体;">电话号码，使用</span><span>display current-configuration</span><span style="font-family: 宋体;">命令查看您所有要在</span><span>GK Server</span><span style="font-family: 宋体;">上登记的语音网关，是否配置了重复的主叫号码，请删除重复的主叫号码后再重新注册。</span></p><p><span>4</span><span style="font-family: 宋体;">、如果使用密码注册，要保证</span><span>GW</span><span style="font-family: 宋体;">和</span><span>GK</span><span style="font-family: 宋体;">上配置的密码要相同。</span></p><p><b><span style="font-family: 宋体;">故障之三：</span></b><b><span style="font-family: 宋体;">已成功注册，但是无法建立呼叫</span></b></p><p><span style="font-family: 宋体;">故障原因：</span><span>voip</span><span style="font-family: 宋体;">实体下没有配置到被叫的路由</span><span style="font-family: 宋体;">。</span></p><p><span style="font-family: 宋体;">诊断：使用</span><span>display current-configuration&nbsp;</span><span style="font-family: 宋体;">查看</span><span>voip</span><span style="font-family: 宋体;">实体下是否配置了</span><span>address ras</span><span style="font-family: 宋体;">。</span></p><p><span style="font-family: 宋体;">解决方法：在</span><span>voip</span><span style="font-family: 宋体;">实体下配置</span><span>address ras</span><span style="font-family: 宋体;">。</span></p><h1><a name="_Toc111967950"></a><a name="_Toc139858558"></a><span>4</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">相关资料</span></h1><h2><a name="_Toc111967951"></a><a name="_Toc139858559"></a><span>4.1</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">相关协议和标准</span></h2><p><span>ITU-T RAS</span><span style="font-family: 宋体;">建议</span></p><h2><a name="_Toc111967952"></a><a name="_Toc139858560"></a><span>4.2</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">其它相关资料</span></h2><p><span style="font-family: 宋体;">《</span><span>14</span><span style="font-family: 宋体;">－</span><span>Comware V3</span><span style="font-family: 宋体;">操作手册－语音》</span></p><p><span style="font-family: 宋体;">《</span><span>14</span><span style="font-family: 宋体;">－</span><span>Comware V3</span><span style="font-family: 宋体;">命令手册－语音》</span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/a3c123b3a0e39bbad8335a11.html#comment">查看评论</a>]]></description>
        <pubDate>2011年12月05日  下午 07:16</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/a3c123b3a0e39bbad8335a11.html</guid>
</item>

<item>
        <title><![CDATA[带GK的VOIP典型配置指导（五）[转]]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/188fb9ca500e7e9bc8176810.html]]></link>
        <description><![CDATA[
		
		<h4><span>4.</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>XE200</span><span style="font-family: 黑体;">的配置</span></h4><p><table cellspacing="0" cellpadding="0" width="86%" border="0"><tbody><tr><td><p><span style="font-family: 黑体;">当前视图</span></p></td><td><p><span style="font-family: 黑体;">配置命令</span></p></td><td><p><span style="font-family: 黑体;">简单说明</span></p></td></tr><tr><td><p><span>[XE200]</span></p></td><td><p><span>interface Ethernet0/0</span></p></td><td><p>进入以太口接口视图</p></td></tr><tr><td><p><span>[XE200-Ethernet0/0]</span></p></td><td><p><span>ip address 172.31.47.11 255.255.0.0</span></p></td><td><p>配置<span>GK Server</span>的<span>IP</span>地址</p></td></tr><tr><td><p><span>[XE200-Ethernet0/0]</span></p></td><td><p><span>quit</span></p></td><td><p>退出以太口视图</p></td></tr><tr><td><p><span>[XE200]</span></p></td><td><p><span>process-server</span></p></td><td><p>进入<span>Process Server</span>视图</p></td></tr><tr><td><p><span>[XE200-ps]</span></p></td><td><p><span>ps-config XE-GK interface Ethernet0/0</span></p></td><td><p>配置<span>GK Server</span>的名称和使用的接口</p></td></tr><tr><td><p><span>[XE200-ps]</span></p></td><td><p><span>heartbeat password 1234</span></p></td><td><p>配置<span>LS</span>和<span>PS</span>的心跳密码</p></td></tr><tr><td><p><span>[XE200-ps]</span></p></td><td><p><span>start</span></p></td><td><p>启动<span>Process Server</span></p></td></tr><tr><td><p><span>[XE200-ps]</span></p></td><td><p><span>gatekeeper</span></p></td><td><p>进入<span>Gatekeeper</span>视图</p></td></tr><tr><td><p><span>[XE200-ps-gk]</span></p></td><td><p><span>start</span></p></td><td><p>启动<span>GK</span>服务</p></td></tr><tr><td><p><span>[XE200-ps]</span></p></td><td><p><span>location-server</span></p></td><td><p>进入<span>Location Server</span>视图</p></td></tr><tr><td><p><span>[XE200-ls]</span></p></td><td><p><span>process-server XE-GK</span></p></td><td><p>关联<span>LS&nbsp;</span>和<span>PS</span></p></td></tr><tr><td><p><span>[XE200-ls-ps-XE-GK]</span></p></td><td><p><span>ip-address 127.0.0.1</span></p></td><td><p>配置<span>PS&nbsp;</span>和<span> LS</span>的组网方式为集中式组网</p></td></tr><tr><td><p><span>[XE200-ls-ps-XE-GK]</span></p></td><td><p><span>heartbeat password 1234</span></p></td><td><p>配置<span>LS</span>和<span>PS</span>的心跳密码</p></td></tr><tr><td><p><span>[XE200-ls]</span></p></td><td><p><span>&nbsp;gate-way gw28</span></p></td><td><p>添加网关并进入其视图</p></td></tr><tr><td><p><span>[XE200-ls-gw-gw28]</span></p></td><td><p><span>dynamic-ip enable</span></p></td><td><p>配置允许网关动态注册</p></td></tr><tr><td><p><span>[XE200-ls-gw-gw28]</span></p></td><td><p><span>device-type h323</span></p></td><td><p>配置网关类型为<span>h323</span>语音网关</p></td></tr><tr><td><p><span>[XE200-ls-gw-gw28]</span></p></td><td><p><span>gate-way gw46</span></p></td><td><p>添加网关并进入其视图</p></td></tr><tr><td><p><span>[XE200-ls-gw-gw46]</span></p></td><td><p><span>dynamic-ip enable</span></p></td><td><p>配置允许网关动态注册</p></td></tr><tr><td><p><span>[XE200-ls-gw-gw46]</span></p></td><td><p><span>device-type h323</span></p></td><td><p>配置网关类型为<span>h323</span>语音网关</p></td></tr><tr><td><p><span>[XE200-ls-gw-gw46]</span></p></td><td><p><span>quit</span></p></td><td><p>退出视图</p></td></tr><tr><td><p><span>[XE200-ls]</span></p></td><td><p><span>start</span></p></td><td><p>启动<span>Location Server</span></p></td></tr></tbody></table></p><p><span></span>&nbsp;</p><p><span>&amp;</span><span>&nbsp;&nbsp;</span><span style="font-family: 黑体;">说明：</span></p><p><span>GK</span><span style="font-family: 楷体_GB2312;">有很多种，如果您</span><span>VOIP</span><span style="font-family: 楷体_GB2312;">网络中使用的是</span><span>H3C XE</span><span style="font-family: 楷体_GB2312;">可参照上面</span><span>XE200</span><span style="font-family: 楷体_GB2312;">的配置，如果不是，请您按照您使用的</span><span>GK</span><span style="font-family: 楷体_GB2312;">的说明手册使用，但需要注意的是：</span></p><p><span>1</span><span style="font-family: 楷体_GB2312;">、在网关</span><span>GW</span><span style="font-family: 楷体_GB2312;">上配置</span><span>GW</span><span style="font-family: 楷体_GB2312;">对应的</span><span>GK Server</span><span style="font-family: 楷体_GB2312;">的名称要和</span><span>GK</span><span style="font-family: 楷体_GB2312;">的实际名称一致。</span></p><p><span>2</span><span style="font-family: 楷体_GB2312;">、</span><span>GK</span><span style="font-family: 楷体_GB2312;">的</span><span>IP</span><span style="font-family: 楷体_GB2312;">地址对于语音网关</span><span>GW</span><span style="font-family: 楷体_GB2312;">应该路由可达。</span></p><p><span>3</span><span style="font-family: 楷体_GB2312;">、如果</span><span>GK</span><span style="font-family: 楷体_GB2312;">的配置需要网关</span><span>GW</span><span style="font-family: 楷体_GB2312;">的</span><span>ID</span><span style="font-family: 楷体_GB2312;">时请和</span><span>GW</span><span style="font-family: 楷体_GB2312;">上配置的</span><span>ID</span><span style="font-family: 楷体_GB2312;">保持一致。</span></p><p><span>4</span><span style="font-family: 楷体_GB2312;">、如果使用密码注册，那么</span><span>GW</span><span style="font-family: 楷体_GB2312;">和</span><span>GK</span><span style="font-family: 楷体_GB2312;">上配置的密码要相同，否则</span><span>GK Server</span><span style="font-family: 楷体_GB2312;">不接受</span><span>GW</span><span style="font-family: 楷体_GB2312;">的注册。</span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/188fb9ca500e7e9bc8176810.html#comment">查看评论</a>]]></description>
        <pubDate>2011年12月05日  下午 07:16</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/188fb9ca500e7e9bc8176810.html</guid>
</item>

<item>
        <title><![CDATA[带GK的VOIP典型配置指导（四）[转]]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/a086d1faf7962ac3b58f3111.html]]></link>
        <description><![CDATA[
		
		<h4><span>3.</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">配置路由器</span><span>AR28-09</span></h4><p><table cellspacing="0" cellpadding="0" width="86%" border="0"><tbody><tr><td><p><span style="font-family: 黑体;">当前视图</span></p></td><td><p><span style="font-family: 黑体;">配置命令</span></p></td><td><p><span style="font-family: 黑体;">简单说明</span></p></td></tr><tr><td><p><span>[ar2809]&nbsp;&nbsp;</span></p></td><td><p><span>interface Ethernet0/0</span></p></td><td><p>进入以太口接口视图</p></td></tr><tr><td><p><span>[ar2809-Ethernet0/0/0]</span></p></td><td><p><span>&nbsp;ip address 172.31.47.2 255.255.0.0</span></p></td><td><p>配置语音网关的<span>ip</span>地址</p></td></tr><tr><td><p><span>[ar2809-Ethernet0/0/0]</span></p></td><td><p><span>quit</span></p></td><td><p>退出以太口接口视图</p></td></tr><tr><td><p><span>[ar2809]</span></p></td><td><p><span>voice-setup</span></p></td><td><p>进入语音视图</p></td></tr><tr><td><p><span>[ar2809-voice]</span></p></td><td><p><span>dial-program</span></p></td><td><p>进入拨号策略视图</p></td></tr><tr><td><p><span>[ar2809-voice-dial]</span></p></td><td><p><span>entity 10 pots</span></p></td><td><p>创建语音<span>pots</span>实体并进入其视图</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity10]</span></p></td><td><p><span>match-template 2800</span></p></td><td><p>配置本地电话号码</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity10]</span></p></td><td><p><span>line 3/0</span></p></td><td><p>关联语音实体和语音口</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity10]</span></p></td><td><p><span>entity 11 pots</span></p></td><td><p>创建语音<span>pots</span>实体并进入其视图</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity11]</span></p></td><td><p><span>match-template 2801</span></p></td><td><p>配置本地电话号码</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity11]</span></p></td><td><p><span>line 3/1</span></p></td><td><p>关联语音实体和语音口</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity11]</span></p></td><td><p><span>entity 20 voip</span></p></td><td><p>创建语音<span>voip</span>实体并进入其视图</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity20]</span></p></td><td><p><span>match-template 46..</span></p></td><td><p>配置被叫号码</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity20]</span></p></td><td><p><span>address ras</span></p></td><td><p>配置被叫电话号码及到被叫的路由策略</p></td></tr><tr><td><p><span>[ar2809-voice-dial-entity20]</span></p></td><td><p><span>gk-client</span></p></td><td><p>进入语音网守视图</p></td></tr><tr><td><p><span>[ar2809-voice-gk]</span></p></td><td><p><span>area-id 1#</span></p></td><td><p>配置语音网关的区域<span>ID</span></p></td></tr><tr><td><p><span>[ar2809-voice-gk]</span></p></td><td><p><span>gk-id XE-GK gk-addr 172.31.47.11 1719</span></p></td><td><p>配置<span> GK Server&nbsp;</span>的名称和<span>IP</span>地址</p></td></tr><tr><td><p><span>[ar2809-voice-gk]</span></p></td><td><p><span>gw-address 172.31.47.2</span></p></td><td><p>配置语音网关的通讯源地址</p></td></tr><tr><td><p><span>[ar2809-voice-gk]</span></p></td><td><p><span>gw-id gw28</span></p></td><td><p>配置语音网关的<span>ID</span></p></td></tr><tr><td><p><span>[ar2809-voice-gk]</span></p></td><td><p><span>ras-on</span></p></td><td><p>激活语音网关的<span>GK Client</span>功能</p></td></tr></tbody></table></p><p><span></span>&nbsp;</p><h4></h4><p></p><h3><a name="_Toc139858556"></a><a name="_Toc111967947"></a><a name="_Toc111967946"></a><a name="_Toc111968143"></a><a name="_Toc112060362"></a><a name="_Toc111967950"></a><a name="_Toc139858558"></a>&nbsp;</h3> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/a086d1faf7962ac3b58f3111.html#comment">查看评论</a>]]></description>
        <pubDate>2011年12月05日  下午 07:15</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/a086d1faf7962ac3b58f3111.html</guid>
</item>

<item>
        <title><![CDATA[带GK的VOIP典型配置指导（三）[转]]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/5f40db03674d79f109fa9315.html]]></link>
        <description><![CDATA[
		
		<h2><a name="_Toc111967942"></a><a name="_Toc139858552"></a><span>3.5</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">举例</span></h2><h3><a name="_Toc111967943"></a><a name="_Toc139858553"></a><span>3.5.1</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">组网需求</span></h3><p><span style="font-family: 宋体;">路由器</span><span>AR46-40</span><span style="font-family: 宋体;">和</span><span>AR2809</span><span style="font-family: 宋体;">上插</span><span>FXS</span><span style="font-family: 宋体;">语音板卡，连接普通电话机，两端电话经由</span><span>IP</span><span style="font-family: 宋体;">网络进行通话，借助</span><span>GK</span><span style="font-family: 宋体;">进行电话号码到</span><span>IP</span><span style="font-family: 宋体;">地址的动态解析。</span></p><p><span style="font-family: 宋体;">路由器</span><span>AR46-40, AR2809&nbsp;</span><span style="font-family: 宋体;">和</span><span>GK</span><span style="font-family: 宋体;">连接在局域网上，</span><span>AR46-40</span><span style="font-family: 宋体;">的</span><span>IP</span><span style="font-family: 宋体;">地址是</span><span>172.31.47.1</span><span style="font-family: 宋体;">，网关别名为</span><span>gw46</span><span style="font-family: 宋体;">，</span><span>RAS</span><span style="font-family: 宋体;">接口号为</span><span>1719</span><span style="font-family: 宋体;">，并指定区域</span><span>ID</span><span style="font-family: 宋体;">为</span><span>1#</span><span style="font-family: 宋体;">。</span><span>AR2809</span><span style="font-family: 宋体;">的</span><span>IP</span><span style="font-family: 宋体;">地址是</span><span>172.31.47.2</span><span style="font-family: 宋体;">，网关别名为</span><span>gw28</span><span style="font-family: 宋体;">，</span><span>RAS</span><span style="font-family: 宋体;">接口号为</span><span>1719</span><span style="font-family: 宋体;">，并指定区域</span><span>ID</span><span style="font-family: 宋体;">为</span><span>1#</span><span style="font-family: 宋体;">。</span><span>GK Server</span><span style="font-family: 宋体;">采用</span><span>H3C XE 200</span><span style="font-family: 宋体;">，</span><span>GK</span><span style="font-family: 宋体;">的名称为</span><span>XE-GK</span><span style="font-family: 宋体;">，</span><span>IP</span><span style="font-family: 宋体;">地址为</span><span>172.31.47.11</span><span style="font-family: 宋体;">。</span></p><h3><a name="_Toc111967944"></a><a name="_Toc139858554"></a><span>3.5.2</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">组网图</span></h3><p><span></span></p><p>图<span> 1&nbsp;</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>示例组网图</p><h3><a name="_Toc111967945"></a><a name="_Toc139858555"></a><span>3.5.3</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">配置</span></h3><h4><span>1.</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">使用的版本</span></h4><h5><span>1)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span>AR46-40</span>的版本</h5><p><span>Comware software, Version 3.40, Release RT-0103</span></p><p><span>Routing Platform Software</span></p><p><span>Version AR46-40 8040V300R003B03D013 (COMWAREV300R002B14D009SP01), RELEASE SOFTWARE</span></p><p><span>Compiled Jun 30 2005 15:35:12 by sunyu</span></p><h5><span>2)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span>AR28-09</span>的版本</h5><p><span>Comware software, Version 3.40, Release RT-0103</span></p><p><span>Routing Platform Software</span></p><p><span>Version AR28-09 8040V300R003B03D013 (COMWAREV300R002B14D009SP01), RELEASE SOFTWARE</span></p><p><span>Compiled Jun 30 2005 15:35:12 by sunyu</span></p><h4><span>2.</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">配置路由器</span><span>AR46-40&nbsp;</span></h4><p><table cellspacing="0" cellpadding="0" width="86%" border="0"><tbody><tr><td><p><span style="font-family: 黑体;">当前视图</span></p></td><td><p><span style="font-family: 黑体;">配置命令</span></p></td><td><p><span style="font-family: 黑体;">简单说明</span></p></td></tr><tr><td><p><span>[ar4640]</span></p></td><td><p><span>interface Ethernet0/0/0</span></p></td><td><p>进入以太口接口视图</p></td></tr><tr><td><p><span>[ar4640-Ethernet0/0/0]</span></p></td><td><p><span>ip address 172.31.47.1 255.255.0.0</span></p></td><td><p>配置语音网关的<span>ip</span>地址</p></td></tr><tr><td><p><span>[ar4640-Ethernet0/0/0]</span></p></td><td><p><span>quit</span></p></td><td><p>退出以太口接口视图</p></td></tr><tr><td><p><span>[ar4640]</span></p></td><td><p><span>voice-setup</span></p></td><td><p>进入语音视图</p></td></tr><tr><td><p><span>[ar4640-voice]</span></p></td><td><p><span>dial-program</span></p></td><td><p>进入拨号策略视图</p></td></tr><tr><td><p><span>[ar4640-voice-dial]</span></p></td><td><p><span>entity 10 pots</span></p></td><td><p>创建语音<span>pots</span>实体并进入其视图</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity10]</span></p></td><td><p><span>match-template 4600</span></p></td><td><p>配置本地电话号码</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity10]</span></p></td><td><p><span>line 1/0/0</span></p></td><td><p>关联语音实体和语音口</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity10]</span></p></td><td><p><span>entity 11 pots</span></p></td><td><p>创建语音<span>pots</span>实体并进入其视图</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity11]</span></p></td><td><p><span>match-template 4601</span></p></td><td><p>配置本地电话号码</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity11]</span></p></td><td><p><span>line 1/0/1</span></p></td><td><p>关联语音实体和语音口</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity11]</span></p></td><td><p><span>entity 20 voip</span></p></td><td><p>创建语音<span>voip</span>实体并进入其视图</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity20]</span></p></td><td><p><span>match-template 28..</span></p></td><td><p>配置被叫号码</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity20]</span></p></td><td><p><span>address ras</span></p></td><td><p>配置被叫电话号码及到被叫的路由策略</p></td></tr><tr><td><p><span>[ar4640-voice-dial-entity20]</span></p></td><td><p><span>gk-client</span></p></td><td><p>进入语音网守视图</p></td></tr><tr><td><p><span>[ar4640-voice-gk]</span></p></td><td><p><span>area-id 1#</span></p></td><td><p>配置语音网关的区域<span>ID</span></p></td></tr><tr><td><p><span>[ar4640-voice-gk]</span></p></td><td><p><span>gk-id XE-GK gk-addr 172.31.47.11 1719</span></p></td><td><p>配置<span> GK Server&nbsp;</span>的名称和<span>IP</span>地址</p></td></tr><tr><td><p><span>[ar4640-voice-gk]</span></p></td><td><p><span>gw-address 172.31.47.1</span></p></td><td><p>配置语音网关的通讯源地址</p></td></tr><tr><td><p><span>[ar4640-voice-gk]</span></p></td><td><p><span>gw-id gw46</span></p></td><td><p>配置语音网关的<span>ID</span></p></td></tr><tr><td><p><span>[ar4640-voice-gk]</span></p></td><td><p><span>ras-on</span></p></td><td><p>激活语音网关的<span>GK Client</span>功能</p></td></tr></tbody></table></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/5f40db03674d79f109fa9315.html#comment">查看评论</a>]]></description>
        <pubDate>2011年12月05日  下午 07:14</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/5f40db03674d79f109fa9315.html</guid>
</item>

<item>
        <title><![CDATA[带GK的VOIP典型配置指导（二）[转]]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/e0547dda200fe0c6b7fd4816.html]]></link>
        <description><![CDATA[
		
		<span style="font-family: 宋体;"><h2><a name="_Toc111967925"></a><a name="_Toc103422260"></a><a name="_Toc139858550"></a><span>3.3</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">配置语音模块</span></h2><p><span>&nbsp;</span><span style="font-family: 宋体;">语音模块的配置包括主叫和被叫，被叫模块的配置包括被叫号码的配置和选路策略的配置。</span></p><p><span style="font-family: 宋体;">组建带</span><span>GK</span><span style="font-family: 宋体;">的</span><span>VOIP</span><span style="font-family: 宋体;">网络时，除了依照</span><span>3.2</span><span style="font-family: 宋体;">节配置路由器语音网关的</span><span>GK Client</span><span style="font-family: 宋体;">功能外，还必须将路由器语音网关的选路策略配置为动态路由，即需要将网关设备到达对端语音网关的选路策略配置为通过</span><span>RAS</span><span style="font-family: 宋体;">信令完成。</span></p><p><span style="font-family: 宋体;">详细配置步骤如下：</span></p><p>表<span>2&nbsp;</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>语音模块配置</p><p><table cellspacing="0" cellpadding="0" width="86%" border="0"><tbody><tr><td><p><span style="font-family: 黑体;">配置步骤</span></p></td><td><p><span style="font-family: 黑体;">命令</span></p></td><td><p><span style="font-family: 黑体;">说明</span></p></td></tr><tr><td><p>进入系统视图</p></td><td><p><b><span>system-view</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>进入语音视图</p></td><td><p><b><span>voice</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>进入拨号策略视图</p></td><td><p><b><span>dial-program</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>配置端口实体</p></td><td><p><b><span>entity&nbsp;</span></b><i><span>entity-number</span></i><span><b>&nbsp;pots</b></span></p></td><td><p>创建并进入端口实体视图</p></td></tr><tr><td><p>配置主叫号码</p></td><td><p><b><span>match-template</span></b><span><i>match-string</i></span></p></td><td><p><span>match-string</span>为主号码</p></td></tr><tr><td><p>配置使用的端口</p></td><td><p><b><span>line</span></b><span><i>line-number</i></span></p></td><td><p><span>line-number</span>为端口索引</p></td></tr><tr><td><p>配置<span>voip</span>实体</p></td><td><p><b><span>entity&nbsp;</span></b><i><span>entity-number</span></i><span><b>voip</b></span></p></td><td><p>创建并进入<span>voip</span>实体视图</p></td></tr><tr><td><p>配置被叫号码</p></td><td><p><b><span>match-template</span></b><span><i>match-string</i></span></p></td><td><p><span>match-string</span>为被叫号码</p></td></tr><tr><td><p>配置<span>VOIP</span>的选路策略</p></td><td><p><b><span>address ras</span></b></p></td><td><p>采用动态选路</p></td></tr></tbody></table></p><h2><a name="_Toc139858551"></a><a name="_Toc111967941"></a><a name="_Toc108328364"></a><a name="_Toc111967926"></a><a name="_Toc111968123"></a><a name="_Toc112060342"></a><a name="_Toc111967927"></a><a name="_Toc111968124"></a><a name="_Toc112060343"></a><a name="_Toc111967928"></a><a name="_Toc111968125"></a><a name="_Toc112060344"></a><a name="_Toc111967929"></a><a name="_Toc111968126"></a><a name="_Toc112060345"></a><a name="_Toc111967930"></a><a name="_Toc111968127"></a><a name="_Toc112060346"></a><a name="_Toc111967940"></a><a name="_Toc111968137"></a><a name="_Toc112060356"></a><span>3.4</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">注意事项</span></h2><p><span style="font-family: 宋体;">绑定的</span><span>GW</span><span style="font-family: 宋体;">通讯源地址与对端</span><span>H.323</span><span style="font-family: 宋体;">实体</span><span>(Gatekeeper, Terminal, MCU</span><span style="font-family: 宋体;">等</span><span>)</span><span style="font-family: 宋体;">地址应保证可互相访问，否则将会导致呼叫失败。</span></p></span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/e0547dda200fe0c6b7fd4816.html#comment">查看评论</a>]]></description>
        <pubDate>2011年12月05日  下午 07:14</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/e0547dda200fe0c6b7fd4816.html</guid>
</item>

<item>
        <title><![CDATA[带GK的VOIP典型配置指导（一）[转]]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/fe5eeffd68be4b58d7887d0f.html]]></link>
        <description><![CDATA[
		
		<p><span style="font-family: 黑体;">带</span><span>GK</span><span style="font-family: 黑体;">的</span><span>VOIP</span><span style="font-family: 黑体;">典型配置指导</span></p><p><span></span></p><p><span>Hangzhou H3C Technologies Co., Ltd.&nbsp;</span></p><p><span style="font-family: 黑体;">杭州华三通信技术有限公司</span></p><p><span>All rights reserved</span></p><p>版权所有<span>&nbsp;&nbsp;</span>侵权必究</p><p>关键词：<span>VOIP</span>、<span>GK</span></p><p>摘<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>要：本文介绍了如何组建一个带<span>GK</span>的<span>VOIP</span>网络，并结合一个组网实例，详细讲解了配置步骤和验证方法，以及常见故障的诊断和排除。</p><p>缩略语：</p><p><table cellspacing="0" cellpadding="0" width="86%" border="0"><tbody><tr><td><p><span style="font-family: 黑体;">缩略语</span></p></td><td><p><span style="font-family: 黑体;">英文全名</span></p></td><td><p><span style="font-family: 黑体;">中文解释</span></p></td></tr><tr><td><p><span>VOIP</span></p></td><td><p><span>Voice over IP</span></p></td><td><p><span>IP</span>语音</p></td></tr><tr><td><p><span>GW</span></p></td><td><p><span>Gateway</span></p></td><td><p>网关</p></td></tr><tr><td><p><span>GK</span></p></td><td><p><span>Gatekeeper</span></p></td><td><p>网守</p></td></tr></tbody></table></p><p><span></span>&nbsp;</p><h1><a name="_Toc22652743"></a><a name="_Toc139858545"></a><a name="_Toc111967920"></a><span>1</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">特性</span><span style="font-family: 黑体;">介绍</span></h1><p><span style="font-family: 宋体;">根据</span><span>ITU-T</span><span style="font-family: 宋体;">规范定义，网守（</span><span>GateKeeper</span><span style="font-family: 宋体;">，简称</span><span>GK</span><span style="font-family: 宋体;">）是一个能够对局域网或广域网的</span><span>H.323</span><span style="font-family: 宋体;">终端、</span><span>GW</span><span style="font-family: 宋体;">或一些多点控制单元（</span><span>MCU</span><span style="font-family: 宋体;">）提供地址翻译、访问许可、带宽控制和管理、区域管理、安全检查、呼叫控制信令以及呼叫管理等功能的</span><span>H.323</span><span style="font-family: 宋体;">实体，有的也提供路由控制和计费等功能。在一个由</span><span>GK</span><span style="font-family: 宋体;">管理的区域内，对所有呼叫来说，</span><span>GK</span><span style="font-family: 宋体;">不仅提供呼叫业务控制并且起到了中心控制点的作用。</span></p><p><span style="font-family: 宋体;">按照实现完整</span><span>GK</span><span style="font-family: 宋体;">功能的实体构成，可以分为</span><span>Client</span><span style="font-family: 宋体;">端和</span><span>Server</span><span style="font-family: 宋体;">端。</span><span>GK Client</span><span style="font-family: 宋体;">实体以路由器作为硬件载体，通过命令行接口完成对路由器</span><span>IP</span><span style="font-family: 宋体;">语音网关功能的配置，通过</span><span>ITU-T H.225.0</span><span style="font-family: 宋体;">建议中的</span><span>RAS</span><span style="font-family: 宋体;">（</span><span>Registration</span><span style="font-family: 宋体;">，</span><span>Admission</span><span style="font-family: 宋体;">，</span><span> and Status</span><span style="font-family: 宋体;">）消息与</span><span>GK Server</span><span style="font-family: 宋体;">进行交互，从而使得</span><span>GK Server</span><span style="font-family: 宋体;">为路由器</span><span>IP</span><span style="font-family: 宋体;">语音网关提供地址翻译、访问许可、带宽管理和路由器</span><span>IP</span><span style="font-family: 宋体;">语音网关的管理等服务。</span></p><p><span style="font-family: 宋体;">组建一个带</span><span>GK</span><span style="font-family: 宋体;">的</span><span>VOIP</span><span style="font-family: 宋体;">网络主要用到的是</span><span>AR</span><span style="font-family: 宋体;">路由器的</span><span>GK Client&nbsp;</span><span style="font-family: 宋体;">功能，该功能是在</span><span>VOIP</span><span style="font-family: 宋体;">网络中，借助</span><span>GK Server</span><span style="font-family: 宋体;">实现电话号码到</span><span>IP</span><span style="font-family: 宋体;">地址的动态解析。</span></p><p><span>GK Server</span><span style="font-family: 宋体;">功能通常在</span><span>SUN</span><span style="font-family: 宋体;">工作站或服务器上提供。出于可靠性考虑，需要</span><span>GK Server</span><span style="font-family: 宋体;">为</span><span>GK Client</span><span style="font-family: 宋体;">提供备份服务功能，即当主用</span><span>GK Server</span><span style="font-family: 宋体;">通讯异常（如超时）或主用</span><span>GK Server</span><span style="font-family: 宋体;">不可用时，</span><span>GK Client</span><span style="font-family: 宋体;">可以向备用</span><span>GK Server</span><span style="font-family: 宋体;">发起注册请求并进行</span><span>RAS</span><span style="font-family: 宋体;">通信。</span></p><h1><a name="_Toc111967921"></a><a name="_Toc22652768"></a><a name="_Toc139858546"></a><span>2</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">特性的优点</span></h1><p><span>GK Client&nbsp;</span><span style="font-family: 宋体;">功能便于</span><span>VOIP</span><span style="font-family: 宋体;">网络的管理、维护和扩容。</span></p><h1><a name="_Toc139858547"></a><a name="_Toc111967922"></a><a name="_Toc50282888"></a><a name="_Toc50354590"></a><a name="_Toc50354711"></a><a name="_Toc50282889"></a><a name="_Toc50354591"></a><a name="_Toc50354712"></a><a name="_Toc50282890"></a><a name="_Toc50354592"></a><a name="_Toc50354713"></a><a name="_Toc50282891"></a><a name="_Toc50354593"></a><a name="_Toc50354714"></a><a name="_Toc50282892"></a><a name="_Toc50354594"></a><a name="_Toc50354715"></a><a name="_Toc50282893"></a><a name="_Toc50354595"></a><a name="_Toc50354716"></a><a name="_Toc50282894"></a><a name="_Toc50354596"></a><a name="_Toc50354717"></a><a name="_Toc50282895"></a><a name="_Toc50354597"></a><a name="_Toc50354718"></a><a name="_Toc50282896"></a><a name="_Toc50354598"></a><a name="_Toc50354719"></a><a name="_Toc50282903"></a><a name="_Toc50354604"></a><a name="_Toc50354724"></a><a name="_Toc50282904"></a><a name="_Toc50354605"></a><a name="_Toc50354725"></a><a name="_Toc50282905"></a><a name="_Toc50354606"></a><a name="_Toc50354726"></a><a name="_Toc50282906"></a><a name="_Toc50354607"></a><a name="_Toc50354727"></a><a name="_Toc50282907"></a><a name="_Toc50354608"></a><a name="_Toc50354728"></a><a name="_Toc50282908"></a><a name="_Toc50354609"></a><a name="_Toc50354729"></a><a name="_Toc50282909"></a><a name="_Toc50354610"></a><a name="_Toc50354730"></a><span>3</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">使用指南</span></h1><h2><a name="_Toc111967923"></a><a name="_Toc139858548"></a><span>3.1</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 黑体;">使用场合</span></h2><p><span style="font-family: 宋体;">适合较大的</span><span>VoIP</span><span style="font-family: 宋体;">网络，用户如使用静态配置，配置和维护的工作量会比较大，此时应该引入</span><span>GK</span><span style="font-family: 宋体;">来动态的集中的管理</span><span>H323</span><span style="font-family: 宋体;">呼叫业务，为</span><span>IP</span><span style="font-family: 宋体;">语音网关提供地址翻译、访问许可、带宽管理和路由器</span><span>IP</span><span style="font-family: 宋体;">语音网关的管理等服务。另外如果使用的</span><span>VoIP</span><span style="font-family: 宋体;">网络中有些终端设备不支持静态配置，那么也可以采用</span><span>GK</span><span style="font-family: 宋体;">来动态管理局域网或广域网中的</span><span>IP</span><span style="font-family: 宋体;">语音网关。</span></p><h2><a name="_Toc37228719"></a><a name="_Toc139858549"></a><a name="_Toc111967924"></a><a name="_Toc103422259"></a><a name="_Toc43549759"></a><span>3.2</span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>GK Client</span><span style="font-family: 黑体;">的配置</span></h2><p><span style="font-family: 宋体;">本章介绍了如何在</span><span>AR</span><span style="font-family: 宋体;">路由器上配置</span><span>GK Client</span><span style="font-family: 宋体;">功能，主要配置如下，其中</span><span>1-4</span><span style="font-family: 宋体;">是必须配置，</span><span>5-8</span><span style="font-family: 宋体;">是可选配置</span></p><h5><span>1)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置网关<span>GW</span>的别名</h5><h5><span>2)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置网关<span>GW</span>的通讯源地址</h5><h5><span>3)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置网关<span>GW</span>对应的主用<span>GK Server</span>的名称和<span>IP</span>地址</h5><h5><span>4)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>激活<span>GK Client</span>功能</h5><h5><span>5)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置网关<span>GW</span>对应的备用<span>GK Server</span>的名称和<span>IP</span>地址</h5><h5><span>6)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置<span>H.323</span>网关区域<span>ID</span></h5><h5><a name="_Toc37228720"></a><a name="_Toc43549760"></a><span>7)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置<span>GK</span>注册密码</h5><h5><span>8)</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>配置安全呼叫</h5><p><span style="font-family: 宋体;">完整配置步骤如下</span><span>:</span></p><p>表<span>1&nbsp;</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span>GK Client</span>模块配置</p><p><table cellspacing="0" cellpadding="0" width="86%" border="0"><tbody><tr><td><p><a name="_Toc44232642"></a><a name="_Toc60313604"></a><span style="font-family: 黑体;">配置步骤</span></p></td><td><p><span style="font-family: 黑体;">命令</span></p></td><td><p><span style="font-family: 黑体;">说明</span></p></td></tr><tr><td><p>进入系统视图</p></td><td><p><b><span>system-view</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>进入语音视图</p></td><td><p><b><span>voice</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>进入语音网守视图</p></td><td><p><b><span>gk-client</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>配置<span>H.323</span>网关区域<span>ID</span></p></td><td><p><b><span>area-id</span></b><span><i>string</i></span></p></td><td><p>便于<span>GK Server</span>对<span>GK Client</span>类型进行识别</p></td></tr><tr><td><p>配置网关别名</p></td><td><p><b><span>gw-id&nbsp;</span></b><i><span>namestring</span></i></p></td><td><p>网关<span>GW&nbsp;</span>的别名用于在<span>GK Server</span>处登记注册和标识网关。一个网关只能有一个别名</p></td></tr><tr><td><p>配置网关<span>GW</span>的通讯源地址</p></td><td><p><b><span>gw-address</span></b><span><i>ip-address</i></span></p></td><td><p>网关的<span>IP</span>地址</p></td></tr><tr><td><p>配置网关对应的主用<span>GK Server</span>名称和<span>IP</span>地址</p></td><td><p><b><span>gk-id&nbsp;</span></b><i><span>gk-name</span></i><span><b>gk-addr </b><i>gk-ipaddress</i> [<i> ras-port </i>]</span></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>配置网关对应的备用<span>GK Server</span>名称和<span>IP</span>地址</p></td><td><p><b><span>gk-2nd-id</span></b><span><i>gk-name </i><b>gk-addr</b><i>gk-ipaddress</i> [<i> ras-port </i>]</span></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>配置<span>GK</span>注册密码</p></td><td><p><b><span>gk-security register-pwd</span></b><span> { <b>cipher</b> | <b>simple</b> } <i>password</i></span></p></td><td><p>注册时<span>RRQ</span>消息中携带的密码</p></td></tr><tr><td><p>允许安全呼叫</p></td><td><p><b><span>gk-security call enable</span></b></p></td><td><p><span></span>&nbsp;</p></td></tr><tr><td><p>激活<span>GK Client</span>功能</p></td><td><p><b><span>ras-on</span></b></p></td><td><p>只有当成功配置了某接口为<span>H.323</span>网关接口的情况下，<span>GK Client</span>功能才能够被激活</p></td></tr></tbody></table></p><p><span></span>&nbsp;</p><h2><a name="_Toc111967925"></a><a name="_Toc103422260"></a><a name="_Toc139858550"></a><h4></h4></h2> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%CD%F8%C2%E7%BC%BC%CA%F5">网络技术</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/fe5eeffd68be4b58d7887d0f.html#comment">查看评论</a>]]></description>
        <pubDate>2011年12月05日  下午 07:11</pubDate>
        <category><![CDATA[网络技术]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/fe5eeffd68be4b58d7887d0f.html</guid>
</item>

<item>
        <title><![CDATA[会议策划书经典之作 （二）]]></title>
        <link><![CDATA[http://hi.baidu.com/vistra/blog/item/1b0775ee57393ee6b3fb9566.html]]></link>
        <description><![CDATA[
		
		<p><span style="font-size: 16px;">■研讨会议</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 研讨型会议通常专业性较强，参与的人数不是很多，除非是行业标准讨论，一般不会超过100人。这类研讨会的关键点是会场及地点选择。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 会场——除一般性的主会场外，通常需要一些小型会所以便分组讨论。主会场的布置除保留主持人外，其他座位应当体现平等精神，发言用的麦克风应该每个座位都有——除非人数小于15人。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 关于地点，通常选择相对封闭、安静、利于保密的地点，最好能在郊区环境优美会所——应当满足夜间娱乐休闲、团队精神训练、场景变换、交通相对方便等要求。</span></p>
<p><span style="font-size: 16px;">■培训会议</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 培训会议也是专业型会议，通常是企业内部或者教育部门举办。除带有研讨性质外，更多的是技能交流及知识传授，所以培训会议对场地的要求相对较高——除了一般的封闭式会场外，应该还有各类拓展训练设施或者场地，可能的话还应该有高品质的休闲放松场地。培训会议的关键点：场地、培训设施及培训师。</span></p>
<p><span style="font-size: 16px;">■社团会议</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 社团会议通常为纯会议，往往需要发布一些宣言或者决议之类的书面信息。所以社团会议经常配合新闻发布会举行。举行此类会议，表决设施、现场会员排序及会场控制是关键。作预算的时候应当考虑新闻传媒成本——包括记者的邀请、交通、住宿及餐饮安排等。</span></p>
<p><span style="font-size: 16px;">■公益性/技术性论坛</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 此类会议多为公开性会议，系列分会将是此类会议的特点，所以会议场所的选择非常重要，基本要求是可以分割或者主会场附带小会场，对会议设施要求也比较高——同声传译、传媒记者招待、多媒体、视频直播以及讨论场地等均有可能要求提供。此外，如果会议主办地的会场不能满足几种分割要求，那么会务交通就成为需要重点考虑的内容。</span></p>
<p><span style="font-size: 16px;">■订货交流会议</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 此类会议实际上兼有展览性质，因此会场的要求相对特别。理想的场地应该是专门的展览馆或者会展中心，带有商务会所或者类似场地则再完美不过。如果是小型订货交流会，可以设立在大型商务型酒店。组织或者代理此类会议的关键点是：场地选择、会场控制、展览布置。</span></p>
<p><span style="font-size: 16px;">■秘书服务</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 所谓秘书服务指向会展主办方提供各类文秘、勤杂、临时采购、临时司乘、向导等服务。这些服务通常是临时或者按时提供的，在预算时通常按类别笼统计算，不在细分——可以按不可预计费用或者按其他类别计算。如果通过代理公司操作，那么告诉代理公司作好随时服务的准备很有必要。代理公司与主办方之间的最后服务费用核算将通过双方指定的联络人互相签单认可，由双方财务或者相关人员核定。</span></p>
<p><span style="font-size: 16px;">■茶歇</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 茶歇对于一般的大型会议而言可能不需要，中、小型会议，特别是公司或者组织高层会议，会间茶歇是很重要的。茶歇的定义就是为会间休息兼气氛调节而设置的小型简易茶话会，当然提供的饮品可能不限于中国茶，点心也不限于是中国点心。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 通常茶歇的准备包括点心要求、饮品要求、摆饰要求、服务及茶歇开放时间要求等等，一般不同时段可以更换不同的饮品、点心组合。大致上茶歇的分类是中式与西式。中式的饮品包括矿泉水、开水、绿茶、花茶、红茶、奶茶、果茶、罐装饮料、微量酒精饮料，点心一般是各类糕点、饼干、袋装食品、时令水果、花式果盘等等。西式茶歇饮品一般包括各式咖啡、矿泉水、低度酒精饮料、罐装饮料、红茶、果茶、牛奶、果汁等等，点心有蛋糕、各类甜品、糕点、水果、花式果盘，有的还有中式糕点。</span></p>
<p><span style="font-size: 16px;">■翻译</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 可能有的人认为翻译只是传声筒，是一个工具，所以会议翻译的安排就如同其他道具那样很简单，只要 “采购”就可以了。其实，翻译是工具不假，但翻译是个特殊的工具，是担负思想传递的具有思维方式的人(有时候还是会谈僵局的润滑剂或者缓冲剂)。所以翻译，特别是临时聘请的翻译值得认真对待。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 很多所谓翻译不是通才(换言之，除翻译者本身已经掌握的知识外，可能对其他领域的连概念都没有)，而会议涉及的专业术语往往很多，而且通常是很生僻的单词或者组合词，因此提前沟通十分必要。再者，应当告诉翻译发言者通常的语速，有条件的可以把以往的映像资料交给翻译，让其熟悉一下，并告诉翻译本次会议大致的研讨或者涉及的内容。当然为了商业秘密不外泻，对翻译必要的约束是应该的——通常以书面形式约定在多长时间内接触机密的翻译不得对外界透露，在此期间内雇用方有权要求翻译保密，并有权要求翻译赔偿由于泄密而带来的损失。</span></p>
<p><span style="font-size: 16px;">■车辆调度</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 重要的国际性会议、行业重要会议、知名公司全球或者大区会议，参与者通常人数较多，身份较高，如果在主办者所在地，车辆调度可能不成问题，如果在异地举办，那么车辆调度就值得好好研究。通常，异地举办会议基本上委托当地专业机构代理，车辆调度涉及到主办者与代理方的沟通，还涉及到会议举办地的车源问题。对于主办方，通常只提出用车要求及安排要求，而代理公司则要考虑时间安排、预定的合理车辆数量、行走时间及线路等等。因此，主办方应该提前告诉代理方相对准确的与会者抵达时间、人数、此时间段内抵达客人的身份及车辆使用标准，并告诉代理方如果出现与预告情形不符时希望采取的弥补措施及愿意为此承担的代价。</span></p>
<p><span style="font-size: 16px;">■健康保障</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一般情形下，健康保障不需要列入会议或者展览企划。但对于特殊会议如有高龄知名学者、身体残疾专家或者政府官员参加的一些会议，那么健康保障就应该纳入会议企划内。主要内容包括举办地医疗信息的收集、特色专科分布、急救车辆呼叫及费用支付办法、常用药品少量采购、无障碍通道及洗浴卫生设备的改造等等。</span></p>
<p><span style="font-size: 16px;">■保险知识</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 组织展览需要办理保险。展览会组织者一般不负责展出者展品的丢失、损坏和人员的伤亡事故，以及在展台内发生的第三者伤亡事故。因此，展出者需要自行安排保险。保险涉及投保险种、投保金额、投保期限等问题。保险不仅涉及展品和运输，还涉及展台人员、参观者等。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 展览涉及的险种比一般人想象的多，包括展览会取消险、展览会推迟险、政治险、雇工责任险、运输险、战争险、火险、盗窃险、破损险、人身伤害险、公众责任险、人身事故险、个人财产丢失险、医疗保险等，名目繁多，比较冷僻的险种有展览会附属研讨会主要发言人未出场险。但是，展出者没有必要投保所有险种，根据规定和需要选择险种投保。基本险包括展品、运输、人身、第三者有关险种。展览会组织者、运输公司、施工管理部门等会规定了一些强制性的保险要求，这些规定应予以执行。此外，展出者可以根据自己的实际需要办理其他险种。对于展出者，主要投保险以及办理投保需要注意事项如下：展品和道具险，保期要包括运输和展览会过程。投保险种有展品的盗窃险、道具的火险等。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 运输险，为安排展品在动输和展览过程中的保险。在展品发运并取得提单后，按清册价办理保险手续。一般办理一切险，并取得保险单。保险期从货物在国内仓库发运至运回国内仓库止。分保业务可交由承保行办理。其他险种根据强制性的保险要求以及实际需要视具体情况决定，比如战争险。在运输途中货物发生破损丢失，应设法向事故责任方取得理赔单证。若无法取得理赔单证，则要求责任方写证明书。受损方填写受损报告书，连同索赔清单交承保公司办理索赔手续。索赔期一般为一年。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 第三者责任险，为防止施工期间施工人员的事故、防止参观期间参观者的意外伤害，比如展架倒塌压伤参观者，应在展览施工和展出期间投保第三者责任险。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 展出人员险，包括医保险、人身事故险、个人财产丢失险等。比如，飞机目前还未能达到百分之百的安全，因此，有些展出者为其展台人员办理乘坐飞机的人身险。这是在飞机票价内的保险之外加办的保险，万一出现事故，事故受损方将获航空公司和保险公司两笔赔偿。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 保险应当是展览业人士所掌握的业务，大部分展览保险是展出者概括成运输、施工等规定条款听取保险公司建议后安排的。展出者一般可以使用有长期关系的保险公司。如果展览会所在地有规定必须使用指定保险公司，在了解清楚后按规定办。展览会组织者通常会推荐可靠的保险公司。有些专业的展览保险公司可以提供一揽子展览保险。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 如果展出者办有长年保险，可以不再专门为展览办理保险。只需要将展览保险纳入长年保险范围之内既可，保险公司可能不会增加保险金。如果是集体展出组织者投保，如果有长业务关系，保险公司也可以提供优惠标准。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 集体展出组织者一般不会承担保险费用，但是往往会统一办理保险。集体办理保险可以省去参展者精力，费用均摊标准也会低一些。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 保险最重要的单证是受保险单。其他可能使用的单证有受损报告书。</span></p>
<p><span style="font-size: 16px;">■礼仪与迎送</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对于会议而言，必要的礼仪显得温馨。礼仪工作一般包括模特召集、程序分解、简单培训、服装道具准备、礼仪执行等。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 值得注意的是礼仪的文化素质及外语基本技能考察，而不能简单看形体决定是否聘请，另外一点就是礼仪的个性是否符合工作要求。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 各种主题的会议对礼仪的要求不一样，学术性会议、政府性质会议要求模特的着装比较素雅，不能抢了专家及政府要员的形象，而销售类会展则需要模特为企业及产品锦上添花，尽量着装鲜艳，与企业或产品的品质形象要求一致。</span></p>
<p><span style="font-size: 16px;">■展览礼仪企划</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 展览会以其独具的专业性、针对性的特点逐渐成为国际、国内企业直接面对客户，展示自己的极好工具。与次同时一种新的礼仪文化随之诞生，既展览礼仪。展览礼仪最早形成于40年代法国巴黎的一次展览会，之后在70年代形成规模，并逐步向专业化、正规化发展，80年代末90年代初，展览礼仪在我国也逐步发展起来。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 礼仪企划既是通过专业策划公司的精心策划，为参加展览会的公司提供最完美的参展活动设计方案。它包括硬件的展位、展台布置，以及与之配合的各种声、光、电效果；软件的宣传促销活动、展览礼仪模特的培训及包装等，使公司的优势最大限度地表现出来。公司参加展览会的主要目的无非是提高公司的知名度，吸引客户，洽谈合作，在客户心目中树立自己良好的品牌形象。但是要达到这些目的的前提条件必须是：先把尽可能多的人吸引过来。参展企业通常把这个任务交给展览礼仪企划公司来做。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 如何进行展览礼仪策划，使企业在万商云集中能一枝独秀呢？</span></p>
<p><span style="font-size: 16px;">1、要了解展览会的类型、企业品牌、产品特点、展台风格、展位的周边环境及竞争对手的情况；</span></p>
<p><span style="font-size: 16px;">2、通过所掌握的资料进行整个礼仪活动的创意策划。例如要达到影视效果、解说效果、配音效果等等；</span></p>
<p><span style="font-size: 16px;">3、根据展示风格，选择礼仪小姐是活泼开朗型、小巧玲珑型还是现代表演型模特；</span></p>
<p><span style="font-size: 16px;">4、根据选择的模特进行服装的设计制作，展览服装要求新奇悦目，可按创意分为稳重型和明快型。总之能充分表现一个企业的特色；</span></p>
<p><span style="font-size: 16px;">5、根据创意将模特进行分工，例如：解说员、演员、展示员、接待员进行人员培训；</span></p>
<p><span style="font-size: 16px;">6、展览期间礼仪企划公司的管理及礼仪小姐的发挥也对展览的成功有着很大影响。 1996年中国国际汽车展中，世界名车云集，盛况空前，取得极大成功。在成功的背后，展览会中的礼仪企划功不可灭。奔驰、宝马、本田、三菱等名车不仅在展台设计、技术专业人员上花了大力气，更在礼仪策划、人员的选择培训，服装的选择等方面下了功夫。当我们走进展览会，本田小姐嗓音清澈的解说，让人赞叹不已；福特小姐的现场表演让人流连忘返，精美的展台、高雅的小姐，更显示出汽车的名牌。这些展览礼仪小姐与汽车的品牌、车型、风格、特点巧妙融合，相得益彰，体现出展览礼仪企划的精细和独具匠心。伴随汽车展的轰动效应，展览礼仪企划更加受到人们的重视。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 提到模特，一般人会想到时装表演，而对展览模特的了解却较为浅淡。人们通常认为，展览模特不就是请几位漂亮的小姐，站在那里发资料吗？这里仅说对了一点，漂亮小姐发资料是为了推广企业形象，但这些还远远不够，单单是漂亮的小姐还不能胜任展览礼仪模特，展览礼仪模特还要具备良好的公关素质。如：应变能力，动听的声音，流利的解说能力，服装模特的表现能力，丰富的礼仪常识等。有的企业认为本公司中的专业技术人员，完全可以应付，就可不需要礼仪企划——不错，技术人员可以应付技术问题，可是技术人员很难在短时间内吸引客户视线，除非技术人员有着模特般的气质与形象。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 关于礼仪小姐及礼仪企划在展览上的运用，可以举个例子：在中国国际展览中心的一次国际制冷展上，美国“TRAE”公司凭着出色的展览设计及礼仪模特企划，获得了极大成功——人们纷纷被“TRAE”独特的展示设计所吸引。在亮丽的背景幕布上，悬挂着一张巨幅风景画，象征着“TRAE”公司为改善人们的生存环境而奋斗的目标。在展台上，两位美丽动人的小姐带着微笑和来宾合影，一位专业摄影师用一次成像的相机把这一幕变成永恒。短短几天，大约4,000人得到了自己与“TRAE”小姐的合影的照片。“TRAE”公司成功的展览礼仪企划，一时被传为佳话。</span></p>
<p><span style="font-size: 16px;">■展台人员训练</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 为了保证良好的展出效率和效果，在配备展台人员之后，必须对他们进行培训。不论是临时雇佣人员还是固定工作人员包括公司高级人员都应当接受培训。培训的目的是使展台人员了解展出目的，掌握展台工作技巧，培养合作及集体精神。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 如果条件许可就安排比较正规的培训，至少要在开幕前进行简单的工作交代和技术指导。培训工作可以在选定展台人员后即着手进行。比较正规的培训形式包括筹备会或培训班，时间可以是半天至两天，但地点要专门安排。要尽量使用教学辅助工具，比如投影仪、讲义等。培训方法要尽量正规，越正规，越显示组织者的重视，培训效果也就越好。若有主要负责人参加展览，也应参加训练，这对提高训练效果有利。</span></p>
<p><span style="font-size: 16px;">培训内容要有系统，培训材料要编印成套。欧美一些国家的展览行业协会、展览研究机构、展览咨询公司安排专门的展览培训，有专门的展台工作培训教材、录像带等，可以购买参考使用。培训教材应该标明秘密程度，培训内容和步骤可以分为三部分：</span></p>
<p><span style="font-size: 16px;">1、情况介绍。包括人员介绍、筹备情况介绍、展出情况介绍等。情况介绍的目的是使展台人员熟悉展出背景、环境和条件。</span></p>
<p><span style="font-size: 16px;">●首先相互自我介绍，培训者和接受培训者自我介绍，不仅要介绍姓名、工作，还要介绍在展览方面的知识和经验。</span></p>
<p><span style="font-size: 16px;">●展出介绍，包括展览会和展台情况。展览会情况，包括名称、地点、展出日期、开馆时间、场地平面、展馆位置、出入口、办公室、餐厅、厕所位置等，展台情况包括展出意图、展出目的、目标观众、展台位置、展台序号、展台布局、展出工作的整体安排等。</span></p>
<p><span style="font-size: 16px;">●展出活动介绍，包括记者招待会、开幕仪式、馆日活动、贵宾接待活动等，并对展台人员提出相应的工作要求。展品介绍，要详细介绍每一项展品，其性能、数据、用法、用途等。市场介绍，包括销售规模、销售渠道、规章制度、特点习惯和销售价格等。</span></p>
<p><span style="font-size: 16px;">2、工作安排。向展台人员布置展台工作，并提出要求和标准，必须使展台上的每一个人知道、理解展出目的；布置展台工作，包括观众接待、贸易洽谈、资料散发、公关工作、新闻工作以及后续工作等，进行分工，提出要求；管理安排，包括工作时间、轮班安排、每日展台会议、记录管理等；行政安排，包括展台人员的宿、膳、行、日程等安排。展出主要是为了成交，展台工作准备就是围绕此开展，包括市场调研、准备货源、准备产品资料、准备贸易条款等。</span></p>
<p><span style="font-size: 16px;">3、技术训练。主要训练展台的接待和推销技巧。展台工作与其他环境下的工作有所不同，即使是有经验的推销人员也应接受展台技巧培训。可以使用模拟方式并应准备完善、系统的培训资料。另外，如果可能，要培养展台人员认真的工作态度、协作精神和集体感。</span></p>
<p><span style="font-size: 16px;">■秩序维护</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对于会议或展览而言，无不希望有良好的秩序。小型会议(特别是企业或者)的会议秩序基本不用控制，但大型会议及展览，秩序的控制就显得很重要。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 大型会议可以采用代表证或者入场券方式控制，如果需要保密，代表证可以特制，印制有代表的数码身份照片，会场入口设立保安；展览的控制比较复杂，因为展览主办者关注的和展商关注的不是同一个目标。展览主办方需要控制的秩序，而展商需要的是信息最大化以及信息获取的便利性。有些展览附带有展中会，还有的带有技术交流或者论坛性质，所以通常会对所有展商或者参展人员进行身份及级别分类，以保证技术交流或者论坛不被外界或者无关的展商干扰。控制的手段有带条形码的参展证(需配备读码机)、或者磁卡式代表证。为同时满足展商信息最大化的需求，现在国外开始引入电子名片管理。</span></p>
<p><span style="font-size: 16px;">■资料快速收集利器——电子名片</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 传统的展会上，少不了的是满天飞的名片，参展商在每天展会结束后总要花上一两个小时整理名片。想取代这些繁琐，可以使用电子名片。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 所谓电子名片，通常用磁卡或带条形码的材料制作——可以说是为参展商和参观者特制的参展证。在签发该证前，组委会会要求参展商或参观者输入个人资料，包括公司名称、联络办法、本人职衔、公司性质和业务范围等，然后把这些资料存入卡中。同时，组委会会购置这类磁卡或条形码的读取设备供出租，参展商可以自由选择租用与否。参展商租用设备后，只需把设备连接到自己的电脑上就可以开始使用。买家需要把名片给参展商时，只需要把存有自己资料的入场证在读取设备上划过，所有资料就会在眨眼间被传输到参展商的电脑里。参展商还可以把双方谈话的要点记录在相应备注栏里，做到十分有条理地管理买家资料。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 尽管这些设备比较昂贵，但可以由展会组委会统一购买、重复使用，参展商只需付出较低的价格向组委会租用，十分实惠和方便。如果每个参展商及买家都使用电子名片，展览会甚至可以像地下铁路入口那样管理而且可以准确的记录入场人数。</span></p>
<p><span style="font-size: 16px;">■会展考察/旅游</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 实际上，会展考察或者旅游大都是为嘉宾特别安排的、具有公关性质的行为，当然不排除部分行为是真正的商务考察(为获取行业或者相关行业信息而举行的市场调研性质的动作)。</span></p>
<p><span style="font-size: 16px;">1、 真正的商务考察：此类商务考察实际上主办者已经作好安排，需要会展中介公司提供的服务只是目的地住宿餐饮预定与安排、交通工具、司乘人员及向导，可能的话需要中介公司协助解决媒介邀请及映像资料摄制。中介公司的职能大体等同于主办者的前导服务及后勤保障部门。</span></p>
<p><span style="font-size: 16px;">2、 会展旅游：一般而言，会展旅游基本安排短线旅行，旅程很少离开会展举办地500公里以上，时间不会超过48小时(大多数为24小时以内)。少数旅程可能超过1000公里以上，时间可以长达一周——甚至可以跨国旅行。此时中介公司的作用就相当于旅行社，将提供线路咨询、线路包价购买、导游、景点票务、车辆、住宿餐饮安排、旅游保险购买、落实异地返程票务等服务。</span></p>
<p><span style="font-size: 16px;">■展览设计</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果说展览是一台戏，展览设计就是戏剧的主题思想。有的时候展商可以自己提出总体要求，而有的时候，展商可能没有提炼，需要展商与中介公司沟通后共同制定。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 现在国内的展览设计基本上还处于抄袭国外展览设计的阶段，可使用的材料及展商愿意承受的成本也与国际相差甚远，所以在设计上一般都要考虑成本，其次再考虑创意。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 设计的基本框架应根据展商的行业属性、展出参观者群体、展览场地背景以及空间设定，露天展览在选材上还要考虑气候及安全因素。</span></p>
<p><span style="font-size: 16px;">展览设计在造型选择上是几乎无限的，以下是一些经验总结：</span></p>
<p><span style="font-size: 16px;">1、造型要考虑展位利用率的最大化；</span></p>
<p><span style="font-size: 16px;">2、造型要考虑人流心理及流向；</span></p>
<p><span style="font-size: 16px;">3、造型应当符合参观对象的审美导向；</span></p>
<p><span style="font-size: 16px;">4、造型要考虑施工难度及成本因素；</span></p>
<p><span style="font-size: 16px;">5、造型还要考虑安全性。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 在展览设计上，材料的使用与选择也是关键。有些展览类别需要沉稳，而有点展览需要活泼，有的需要展现科技，有的需要显示环保，还有的需要表现艺术或者人文或者社会公益，总之，表现的主题对材质的选择是个考验，在这方面，会展中介机构比展商有专业优势。现代科技发展很快，新材料、新光源、新媒体层出不穷，而中介公司除可以敏锐的为展商提供展览设计趋势及对象的审美导向外，更可以为展商提供成本节约方法。</span></p>
<p><span style="font-size: 16px;">■产品展位装潢及展具使用</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 尽管中国产品一向以价廉物美著称，但不可否认在整体形象上仍上不了档次。许多厂家除了在产品的设计和装潢包装上下工夫外，往往忽略了参展时展位的装饰——这也会对产品形象产生影响。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 在一些著名展会里，国内企业的摊位很多仍停留在“三板一桌加两凳”的水平，呆板且毫无新意。据统计，在大型展览里，过半数的参观买家在展场停留的时间不足8小时。而很多国外企业却能有效地吸引这些买家，在短短的时间内令买家对自己的产品留下深刻印象。这除了由于产品质量过硬，设计新颖外，别出心裁的摊位设计和装潢功不可没。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 现在流行的展示用具主要有3大类：一次性使用展具、循环便携式展具及循环租用式展具。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 一次性使用展具一般是由较有实力和较具创意的展览工程公司为客户度身订造，所选材料多为木制品，优点是可因地制宜，通过千变万化甚至超越想象，随心所欲的造型来充分体现企业和产品的形象。但其不足之处是一旦成形就不易改变，而且单次使用价格较高，通常不可多次使用。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 循环租用式展具通常由于材料昂贵，使用者并不必拥有器材的物权，可向专业展览工程公司租用。优点是结构坚固，器材耐用，通过钢制支架拼制造型，在三维视觉上丰富多变而且可随时更改，即使在同一次展会里亦可每日变样，不足之处是价格较高，不易携带。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 最普遍使用的要数循环便携式展具。这种展具一般采用可折叠的支架辅以喷涂精美的宣传图片，既有流畅的整体线条而不必拘于传统的三面围板式结构，能较突出地体现公司形象和传递产品信息。这种展具优点是价格相宜，便于携带，标准的展具拆卸折叠后一人就可以进行搬运，十分适合长途运输。外观上，它还可以在结构允许范围内改变开头也可以通过更新宣传图片以配合新产品。不足之处是变化不及其它两种器材多样化。总的来说，对国内一般厂家参展来说，较适合使用第3种便携式展示用具，只需不多的投入就可打破传统的形象宣传方式，而且可循使用。</span></p>
<p><span style="font-size: 16px;">■展台搭建有什么要注意的？</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 成千上万的观众涌进展览会，看到的是各家厂商各具风格的展台，那多姿多彩的场面常常使人目不暇接。他们几乎不能想象，就在展览会开始之前，这里还是一片“有计划、有组织的”的混乱，运输车辆横七竖八，卡车司机忙着对号入座，参展商等候着自己货物的到来。展览会货运的重头戏首先是按时地搭建和拆除展台，这一任务非行家里手不能胜任。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 多种多样的展览会有各种不同的展品，天上飞的、直升机、地上跑的活动物均可入主展览场地，那么对展览会货运也就有相应不同的要求。参展商应根据货物的内容和数量确定是使用自己的还是租用运输装卸器械，或者干脆委托搬运公司。他们可以在展览专业代理商那里得到很多有用的建议，因为后者负责搭建过程和协调工作，比如在许多供货商同时来到的时候安排先后顺序，他们还出租人力和器械。</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp; 对展览会展台搭建来说一般有两种装卸的可能。首先一种是直接装卸，就是说按照搭建日期把卡车直接开到展厅里，由展览代理商负责卸货和中间储存。由于参展商自己不必操心这一环节，可以节约一些相应的费用。另外那些易破损物品如玻璃或大理石板等只须一次搬运即可。采用这种方式应注意，时间预算要打得宽松一些，要考虑到种种延误的可能性，例如：交通阻塞或事故等等。如果数量较小或是提前送货，则最好集中运输。在开始搭建之前，货物应运抵展览代理商处，由他们暂时储存货物，并按照规定的时间运到展台位置。需要注意的是，笨重的、占地多的物品最好先行运入现场，一般在展馆内可以安排一辆汽车起重机，以便吊卸这些展品，但是如果展台搭建过半，这样的机器就难有用武之地了。</span></p>
<p><span style="font-size: 16px;">■小展位参展如何引人注目</span></p>
<p><span style="font-size: 16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由于参展企业自身规模、资金能力等限制，有时参展只能购买小的展位。通常小展位要想引人注意不是件容易的事。那么小展位如何吸引来观众的目光呢？</span></p>
<p><span style="font-size: 16px;">●使用灯光，尽可能使小展位“耀眼”起来。大部分展览中心提供参展商天花板聚光灯，否则可租用便携式照明系统。根据产业调查，照明可将展览品认识度提高30％—50％。</span></p>
<p><span style="font-size: 16px;">●强调设计，突出视觉效应。大企业通常是采用传统方式展览，并且依赖大规模场地，所以小企业应该以新颖的设计来凸显自己的小展位。</span></p>
<p><span style="font-size: 16px;">●依展位大小选择合适的展示用品及有代表性的产品，避免过度拥挤或稀松。</span></p>
<p><span style="font-size: 16px;">●善于利用组合式展览用具，避免用低廉的展览道具，应该给人“小而精”的感觉，把展位装潢得有品位。</span></p>
<p><span style="font-size: 16px;">●使用少量且较大的图片，创造出强烈的视觉效果——图片一定要精美，构图应该是舒适而不失抢眼，创意而不显凌乱，还有太过密集或太小的图片皆不易读取，同时，限制文字的使用。而且要将图片放在视线以上，图片应在自壁板120cm以上的地方开始放置。</span></p>
<p><span style="font-size: 16px;">●在保证企业VI得到忠实的原则下，展位装饰使用大胆抢眼的颜色。这样从较远距离即可凸显出来，避免易融入背景的中性颜色。</span></p>
<p><span style="font-size: 16px;">●成立完整服务式展览展位，热情接待来到展位的参观者，对他们有问必答。如果仅仅将手册、传单、赠品和样品摆放在桌上任参观者自己索取而不主动询问，不但无法实现商家与观众的互动，也非参展的目的。</span><br /></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/vistra/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/vistra/blog/item/1b0775ee57393ee6b3fb9566.html#comment">查看评论</a>]]></description>
        <pubDate>2011年11月24日  下午 03:37</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[小城太阳]]></author>
		<guid>http://hi.baidu.com/vistra/blog/item/1b0775ee57393ee6b3fb9566.html</guid>
</item>


</channel>
</rss>
