<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>行业技术网</title>
	<atom:link href="http://www.hy12.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hy12.com</link>
	<description>Share AutoIt</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:10:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>USB控制工具</title>
		<link>http://www.hy12.com/works/oftenused/usb%e6%8e%a7%e5%88%b6%e5%b7%a5%e5%85%b7.html</link>
		<comments>http://www.hy12.com/works/oftenused/usb%e6%8e%a7%e5%88%b6%e5%b7%a5%e5%85%b7.html#comments</comments>
		<pubDate>Fri, 03 Sep 2010 12:27:25 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[常用代码]]></category>

		<guid isPermaLink="false">http://www.hy12.com/?p=21</guid>
		<description><![CDATA[原理： 1、首先，关闭USB存储设备的盘符自动分配，打开注册表，找到 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR ，将&#8221;Start&#8221;的值改为4（禁止自动启动），默认为3是自动分配盘符 2、干掉USB存储设备的作用文件：进入WINDOWS系统目录，找到X:\Windows\inf 这里说明一下，USB存储设备的作用文件有两个，分别是usbstor.inf和usbstor.pnf， 因为后续可能需要重新打开USB功能，所以不要删除它，建议拷贝到其他位置，当然你要暴力一点，删除它也没关系，但记得做好备份。   3、然后，禁止将电脑里的资料拷贝到USB存储设备，意思是把USB存储设备设置只读的,打开注册表：定位到 HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Control 在其下新建一个名为“StorageDevicePolicies”的项，选中它，在右边的窗格中新建一个名为 “WriteProtect”的DWORD值，并将其数值数据设置为1 演示图： 代码如下： #include #Include &#160; Opt&#40;&#34;GUIOnEventMode&#34;, 1&#41; ;GUI事件响应模式 &#160; $Reg1 = String&#40;RegRead&#40;&#34;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR&#34;, &#34;Start&#34;&#41;&#41; $Reg2 = String&#40;RegRead&#40;&#34;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies&#34;,&#34;WriteProtect&#34;&#41;&#41; &#160; GUICreate&#40;&#34;USB控制工具&#34;, 200, 150&#41; $Label = GUICtrlCreateLabel&#40;&#34;密 码：&#34;,10,25,50,20&#41; $Input = GUICtrlCreateInput&#40;&#34;&#34;, 60, 20, 120, 20,0x0020&#41; GUICtrlSetState&#40;-1, $GUI_FOCUS&#41; $Button = GUICtrlCreateButton&#40;&#34;确定&#34;, 60, 60, 80, 30, 0&#41; GUICtrlCreateLabel&#40;&#34;E-Mail：&#34;, [...]]]></description>
			<content:encoded><![CDATA[<p>原理：</p>
<p>1、首先，关闭USB存储设备的盘符自动分配，打开注册表，找到<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR<br />
，将&#8221;Start&#8221;的值改为4（禁止自动启动），默认为3是自动分配盘符</p>
<p>2、干掉USB存储设备的作用文件：进入WINDOWS系统目录，找到X:\Windows\inf<br />
这里说明一下，USB存储设备的作用文件有两个，分别是usbstor.inf和usbstor.pnf，<br />
因为后续可能需要重新打开USB功能，所以不要删除它，建议拷贝到其他位置，当然你要暴力一点，删除它也没关系，但记得做好备份。<br />
 <br />
3、然后，禁止将电脑里的资料拷贝到USB存储设备，意思是把USB存储设备设置只读的,打开注册表：定位到<br />
HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Control<br />
在其下新建一个名为“StorageDevicePolicies”的项，选中它，在右边的窗格中新建一个名为<br />
“WriteProtect”的DWORD值，并将其数值数据设置为1</p>
<p>演示图：</p>
<p><a href="http://www.hy12.com/wp-content/uploads/2010/09/100007947029666.gif"><img class="alignnone size-full wp-image-24" title="100007947029666" src="http://www.hy12.com/wp-content/uploads/2010/09/100007947029666.gif" alt="usbcontrol" width="206" height="182" /></a></p>
<p>代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="autoit" style="font-family:monospace;"><span style="color: #F000FF; font-style: italic;">#include</span>
<span style="color: #F000FF; font-style: italic;">#Include</span> 
&nbsp;
<span style="color: #000080; font-style: italic; font-weight: bold;">Opt</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;GUIOnEventMode&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">&#41;</span> <span style="font-style: italic; color: #009933;">;GUI事件响应模式</span>
&nbsp;
<span style="font-weight: bold; color: #AA0000;">$Reg1</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">String</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #000080; font-style: italic; font-weight: bold;">RegRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Start&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Reg2</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">String</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #000080; font-style: italic; font-weight: bold;">RegRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;WriteProtect&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICreate</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;USB控制工具&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">200</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">150</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Label</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateLabel</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;密 码：&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">10</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">25</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">50</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">20</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Input</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateInput</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">60</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">20</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">120</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">20</span><span style="color: #FF0000; font-weight: bold;">,</span>0x0020<span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">-</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_FOCUS</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Button</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateButton</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;确定&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">60</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">60</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">80</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">30</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateLabel</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;E-Mail：&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">24</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">105</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">48</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">17</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Label6</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateLabel</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;bob@hy12.com&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">71</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">105</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">79</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">17</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetColor</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">-</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span>0x0000ff<span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateLabel</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;Web：&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">24</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">125</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">48</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">17</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Label7</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateLabel</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;www.hy12.com&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">71</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">125</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">77</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">17</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetColor</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">-</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span>0x0000ff<span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="font-weight: bold; color: #AA0000;">$Radio1</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateRadio</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;关闭U盘设备&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">24</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">12</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">100</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">20</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">-</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_HIDE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Radio2</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateRadio</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;只禁止U盘拷贝&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">24</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">42</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">100</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">20</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">-</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_HIDE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-weight: bold; color: #AA0000;">$Radio3</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlCreateRadio</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;开启U盘功能&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">24</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">72</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">100</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">20</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">-</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_HIDE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0000FF; font-weight: bold;">Dim</span> <span style="font-weight: bold; color: #AA0000;">$AccelKeys</span><span style="color: #FF0000; font-weight: bold;">&#91;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">&#93;</span><span style="color: #FF0000; font-weight: bold;">&#91;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">2</span><span style="color: #FF0000; font-weight: bold;">&#93;</span><span style="color: #FF0000; font-weight: bold;">=</span><span style="color: #FF0000; font-weight: bold;">&#91;</span><span style="color: #FF0000; font-weight: bold;">&#91;</span><span style="font-weight: bold; color: #008080;">&quot;{Enter}&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$Button</span><span style="color: #FF0000; font-weight: bold;">&#93;</span><span style="color: #FF0000; font-weight: bold;">&#93;</span>
GUISetAccelerators<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$AccelKeys</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000080; font-style: italic; font-weight: bold;">GUISetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@SW_SHOW</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetOnEvent</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Button</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Gui&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetOnEvent</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio1</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Gui&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetOnEvent</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio2</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Gui&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetOnEvent</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio3</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Gui&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">GUISetOnEvent</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$GUI_EVENT_CLOSE</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;gui&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #0000FF; font-weight: bold;">While</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span>
<span style="color: #0000FF; font-weight: bold;">WEnd</span>
&nbsp;
<span style="color: #0000FF; font-weight: bold;">Func</span> Gui<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0000FF; font-weight: bold;">Switch</span> <span style="font-weight: bold; color: #AA0000;">@GUI_CtrlId</span>
    <span style="color: #0000FF; font-weight: bold;">Case</span> <span style="font-weight: bold; color: #AA0000;">$GUI_EVENT_CLOSE</span>
        <span style="color: #0000FF; font-weight: bold;">Exit</span>
    <span style="color: #0000FF; font-weight: bold;">Case</span> <span style="font-weight: bold; color: #AA0000;">$Button</span>
		<span style="font-weight: bold; color: #AA0000;">$Pwd</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Input</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #0000FF; font-weight: bold;">If</span> <span style="font-weight: bold; color: #AA0000;">$Pwd</span> <span style="color: #FF0000; font-weight: bold;">&amp;</span>lt<span style="font-style: italic; color: #009933;">;&amp;gt; &quot;hy12.com&quot; Then</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">MsgBox</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">16</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;密码错误&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">'请重新输入密码'</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetData</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Input</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #0000FF; font-weight: bold;">Else</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Label</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_HIDE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Input</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_HIDE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Button</span> <span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_HIDE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio1</span> <span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_SHOW</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio2</span> <span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_SHOW</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio3</span> <span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_SHOW</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #0000FF; font-weight: bold;">If</span> <span style="font-weight: bold; color: #AA0000;">$Reg1</span><span style="color: #FF0000; font-weight: bold;">=</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">4</span> <span style="color: #0000FF; font-weight: bold;">And</span> <span style="font-weight: bold; color: #AA0000;">$Reg2</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span> <span style="color: #0000FF; font-weight: bold;">Then</span>
					<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio1</span> <span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
				<span style="color: #0000FF; font-weight: bold;">ElseIf</span>  <span style="font-weight: bold; color: #AA0000;">$Reg1</span><span style="color: #FF0000; font-weight: bold;">=</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">3</span> <span style="color: #0000FF; font-weight: bold;">And</span> <span style="font-weight: bold; color: #AA0000;">$Reg2</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span>  <span style="color: #0000FF; font-weight: bold;">Then</span>
					<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio2</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
				<span style="color: #0000FF; font-weight: bold;">Else</span>
					<span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$Radio3</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
			<span style="color: #0000FF; font-weight: bold;">EndIf</span>
		<span style="color: #0000FF; font-weight: bold;">EndIf</span>
	<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="font-weight: bold; color: #AA0000;">$radio1</span>
		<span style="color: #0000FF; font-weight: bold;">If</span> <span style="color: #000080; font-style: italic; font-weight: bold;">BitAND</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$radio1</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span><span style="color: #FF0000; font-weight: bold;">&#41;</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span> <span style="color: #0000FF; font-weight: bold;">Then</span>
		DisableUSB<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #000080; font-style: italic; font-weight: bold;">MsgBox</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">'禁止成功'</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">'请重新插入U盘'</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #0000FF; font-weight: bold;">EndIf</span>
	<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="font-weight: bold; color: #AA0000;">$radio2</span>
		<span style="color: #0000FF; font-weight: bold;">If</span> <span style="color: #000080; font-style: italic; font-weight: bold;">BitAND</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$radio2</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span><span style="color: #FF0000; font-weight: bold;">&#41;</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span>  <span style="color: #0000FF; font-weight: bold;">Then</span>
		LimitUSB<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #000080; font-style: italic; font-weight: bold;">MsgBox</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">'限制成功'</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">'请重新插入U盘'</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #0000FF; font-weight: bold;">EndIf</span>
	<span style="color: #0000FF; font-weight: bold;">Case</span> <span style="font-weight: bold; color: #AA0000;">$radio3</span>
		<span style="color: #0000FF; font-weight: bold;">If</span> <span style="color: #000080; font-style: italic; font-weight: bold;">BitAND</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #000080; font-style: italic; font-weight: bold;">GUICtrlRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$radio3</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span><span style="color: #FF0000; font-weight: bold;">&#41;</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="font-weight: bold; color: #AA0000;">$GUI_CHECKED</span> <span style="color: #0000FF; font-weight: bold;">Then</span>
		EnableUSB<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #000080; font-style: italic; font-weight: bold;">MsgBox</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">'开启成功'</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">'请重新插入U盘'</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
		<span style="color: #0000FF; font-weight: bold;">EndIf</span>
  <span style="color: #0000FF; font-weight: bold;">EndSwitch</span>
<span style="color: #0000FF; font-weight: bold;">EndFunc</span> 
&nbsp;
<span style="color: #0000FF; font-weight: bold;">Func</span> DisableUSB<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
	<span style="font-style: italic; color: #009933;">;关闭USB存储设备的盘符自动分配,默认为3是自动分配盘符,4为禁止自动启动</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">RegWrite</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Start&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;REG_DWORD&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;4&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
	<span style="font-style: italic; color: #009933;">;删除USB存储设备文件(做移动即可，以备还原)</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">FileMove</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@WindowsDir</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>amp<span style="font-style: italic; color: #009933;">;&quot;\inf\usbstor.inf&quot;, @WindowsDir)</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">FileMove</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@WindowsDir</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>amp<span style="font-style: italic; color: #009933;">;&quot;\inf\usbstor.pnf&quot;, @WindowsDir)</span>
	<span style="font-style: italic; color: #009933;">;禁止将电脑里的资料拷贝到USB存储设备，即把USB存储设备设置只读</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">RegWrite</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;WriteProtect&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;REG_DWORD&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;1&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0000FF; font-weight: bold;">EndFunc</span>
&nbsp;
<span style="color: #0000FF; font-weight: bold;">Func</span> LimitUSB<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">RegWrite</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Start&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;REG_DWORD&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;3&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">FileMove</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@WindowsDir</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>amp<span style="font-style: italic; color: #009933;">;&quot;\usbstor.inf&quot;, @WindowsDir&amp;amp;&quot;\inf\&quot;)</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">FileMove</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@WindowsDir</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>amp<span style="font-style: italic; color: #009933;">;&quot;\usbstor.pnf&quot;, @WindowsDir&amp;amp;&quot;\inf\&quot;)</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">RegWrite</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;WriteProtect&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;REG_DWORD&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;1&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0000FF; font-weight: bold;">EndFunc</span>
&nbsp;
<span style="color: #0000FF; font-weight: bold;">Func</span> EnableUSB<span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">RegWrite</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;Start&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;REG_DWORD&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;3&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">FileMove</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@WindowsDir</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>amp<span style="font-style: italic; color: #009933;">;&quot;\usbstor.inf&quot;, @WindowsDir&amp;amp;&quot;\inf\&quot;)</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">FileMove</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">@WindowsDir</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>amp<span style="font-style: italic; color: #009933;">;&quot;\usbstor.pnf&quot;, @WindowsDir&amp;amp;&quot;\inf\&quot;)</span>
	<span style="color: #000080; font-style: italic; font-weight: bold;">RegDelete</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0000FF; font-weight: bold;">EndFunc</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hy12.com/works/oftenused/usb%e6%8e%a7%e5%88%b6%e5%b7%a5%e5%85%b7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>常用Au3代码</title>
		<link>http://www.hy12.com/works/oftenused/usageau3code.html</link>
		<comments>http://www.hy12.com/works/oftenused/usageau3code.html#comments</comments>
		<pubDate>Tue, 27 Jul 2010 01:18:15 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[常用代码]]></category>
		<category><![CDATA[autoit]]></category>

		<guid isPermaLink="false">http://www.hy12.com/?p=9</guid>
		<description><![CDATA[     大家对这些代码可能了如指掌，我只是从一个菜鸟的角度选择了一些我觉得比较实用的代码，供自己和朋友们参考使用。]]></description>
			<content:encoded><![CDATA[<p>        大家对这些代码可能了如指掌，我只是从一个菜鸟的角度选择了一些我觉得比较实用的代码，供自己和朋友们参考使用。</p>

<div class="wp_syntax"><div class="code"><pre class="autoit" style="font-family:monospace;"><span style="font-style: italic; color: #009933;">;读取IE主页</span>
<span style="font-weight: bold; color: #AA0000;">$startpage</span><span style="color: #FF0000; font-weight: bold;">=</span><span style="color: #000080; font-style: italic; font-weight: bold;">RegRead</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;Start Page&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-style: italic; color: #009933;">;设置IE主页为原先的</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">RegWrite</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;Start Page&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;REG_SZ&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #AA0000;">$startpage</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="font-style: italic; color: #009933;">;文件大小验证，验证不符退出安装</span>
<span style="color: #0000FF; font-weight: bold;">If</span> <span style="color: #000080; font-style: italic; font-weight: bold;">FileGetSize</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;setup.exe&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span> <span style="color: #FF0000; font-weight: bold;">&amp;</span>lt<span style="font-style: italic; color: #009933;">;&amp;gt; 10000 Then</span>
    <span style="color: #0000FF; font-weight: bold;">Exit</span>
<span style="color: #0000FF; font-weight: bold;">EndIf</span>
&nbsp;
<span style="font-style: italic; color: #009933;">;判断用户的操作系统.(只支持xp/2003系统</span>
<span style="color: #0000FF; font-weight: bold;">If</span> <span style="font-weight: bold; color: #AA0000;">@OSVersion</span><span style="color: #FF0000; font-weight: bold;">&amp;</span>lt<span style="font-style: italic; color: #009933;">;&amp;gt;&quot;WIN_2003&quot; Or @OSVersion&amp;lt;&amp;gt;&quot;WIN_XP&quot; Then</span>
   <span style="color: #000080; font-style: italic; font-weight: bold;">MsgBox</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">16</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;错误&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;本程序不支持你当前操作系统！&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
   <span style="color: #0000FF; font-weight: bold;">Exit</span>
<span style="color: #0000FF; font-weight: bold;">EndIf</span>
&nbsp;
<span style="color: #000080; font-style: italic; font-weight: bold;">TrayTip</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;提醒您！！!&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;正在进行安装,安装时将锁定键盘鼠标！&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="font-style: italic; color: #009933;">;气泡提示</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">opt</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;RunErrorsFatal&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="font-style: italic; color: #009933;">;在遇到严重错误时是否自动终止</span>
&nbsp;
<span style="color: #000080; font-style: italic; font-weight: bold;">BlockInput</span> <span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="font-style: italic; color: #009933;">;锁定键盘鼠标</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">BlockInput</span> <span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="font-style: italic; color: #009933;">;解锁键盘鼠标</span>
&nbsp;
<span style="font-style: italic; color: #009933;">;打开页面并最大化</span>
<span style="font-weight: bold; color: #AA0000;">$oIE</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #0080FF; font-style: italic; font-weight: bold;">_IECreate</span> <span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;http://www.autoit.net.cn&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #000080; font-style: italic; font-weight: bold;">WinSetState</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="color: #0080FF; font-style: italic; font-weight: bold;">_IEPropertyGet</span> <span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$oIE</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;hwnd&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #AA0000;">@SW_MAXIMIZE</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0080FF; font-style: italic; font-weight: bold;">_IEAction</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$oIE</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="font-weight: bold; color: #008080;">&quot;visible&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="font-style: italic; color: #009933;">;打开页面并全屏显示</span>
<span style="font-weight: bold; color: #AA0000;">$oIE</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #0080FF; font-style: italic; font-weight: bold;">_IECreate</span> <span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;http://www.autoit.net.cn&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">1</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #AC00A9; font-style: italic; font-weight: bold;">0</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
<span style="color: #0080FF; font-style: italic; font-weight: bold;">_IEPropertySet</span> <span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #AA0000;">$oIE</span><span style="color: #FF0000; font-weight: bold;">,</span> <span style="font-weight: bold; color: #008080;">&quot;theatermode&quot;</span><span style="color: #FF0000; font-weight: bold;">,</span><span style="color: #0000FF; font-weight: bold;">True</span><span style="color: #FF0000; font-weight: bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.hy12.com/works/oftenused/usageau3code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.hy12.com/school/hello-world.html</link>
		<comments>http://www.hy12.com/school/hello-world.html#comments</comments>
		<pubDate>Sat, 24 Jul 2010 01:50:01 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[教程资料]]></category>

		<guid isPermaLink="false">http://hy12.com/?p=1</guid>
		<description><![CDATA[$ThunderAgent = ObjCreate&#40;&#34;ThunderAgent.Agent.1&#34;&#41; &#160; ;MsgBox(0,0,$ThunderAgent.ThunderVersion) Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="autoit" style="font-family:monospace;"><span style="font-weight: bold; color: #AA0000;">$ThunderAgent</span> <span style="color: #FF0000; font-weight: bold;">=</span> <span style="color: #000080; font-style: italic; font-weight: bold;">ObjCreate</span><span style="color: #FF0000; font-weight: bold;">&#40;</span><span style="font-weight: bold; color: #008080;">&quot;ThunderAgent.Agent.1&quot;</span><span style="color: #FF0000; font-weight: bold;">&#41;</span>
&nbsp;
<span style="font-style: italic; color: #009933;">;MsgBox(0,0,$ThunderAgent.ThunderVersion)</span></pre></div></div>

<p><code><br />
</code></p>
<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
<p><a href="http://www.hy12.com/wp-content/uploads/2010/07/baidu_logo.gif"><img class="alignnone size-full wp-image-15" title="baidu_logo" src="http://www.hy12.com/wp-content/uploads/2010/07/baidu_logo.gif" alt="" width="270" height="129" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hy12.com/school/hello-world.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
