﻿<?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>运维部落 &#187; 自动启动网卡</title>
	<atom:link href="http://help.vps12.com/tag/%e8%87%aa%e5%8a%a8%e5%90%af%e5%8a%a8%e7%bd%91%e5%8d%a1/feed" rel="self" type="application/rss+xml" />
	<link>https://help.vps12.com</link>
	<description>分享服务器运维及实践解决方案</description>
	<lastBuildDate>Sat, 25 Jan 2025 07:14:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>制作自动启用网卡软件</title>
		<link>https://help.vps12.com/13.html</link>
		<comments>https://help.vps12.com/13.html#comments</comments>
		<pubDate>Tue, 01 Nov 2011 06:00:15 +0000</pubDate>
		<dc:creator>vps12.com</dc:creator>
				<category><![CDATA[编程实践]]></category>
		<category><![CDATA[自动启动网卡]]></category>

		<guid isPermaLink="false">http://blog.vps12.com/?p=13</guid>
		<description><![CDATA[       在帮助一些客户的服务器做运维期间。有一些小白的客户很喜欢对网卡进行这样那样的操作和设置，其实要我来说这样有一定风险性，再者很多客户都在有网络卡或是有什么问题时重置网卡，比如在对个人电脑感觉卡或是有网络访问问题不重启电脑就直接单方面进行禁用网卡，再启用网卡。好吧，这样我很无语。其实一点用也没有。但是你个人电脑使用这样操作没问题。服务器你试试。禁用网卡。你试试启用？不可能吧。哈哈远程直接断了。小白的操作失误。这时我们就很无语了。真是哭笑不得。好吧。为了减少这种客户的“骚扰”。自己动手吧。 以前在利用一些时间了解学习了一些编程软件。delphi就是这么一个方便的程序编译软件。可以利用很少的一段代码调用一些windows系统的东西。 设计思路及要求： 1.软件建立运行服务，服务器启动时自动启动。 2.每五分钟运行一次启动网卡。  3.建立方便的安装删除服务工具。方便一键化安装删除。 好了，我们开始吧代码其实要实现用delphi很容易。调用现成的一些函数和套件可又很方便的建立服务文件 以下给出关键的几条代码吧。太多了不一一发出来。   ?View Code DELPHI1 2 3 4 5 6 7 8 9 10 11 procedure TAutoNetWork.Timer1Timer&#40;Sender: TObject&#41;; begin if i&#38;gt;2 then begin EnableNetAdapter; //form1.close; timer1.Enabled:=false; end else i:=i+1; end; 建立好服务文件后我们就再要对安装文件进行安装了。delphi建立安装服务很容易两条批处理就好了，如下： 建立安装服务文件：install.bat ?View Code BAT1 2 3 @echo copy AutoNetWork.exe %SystemRoot%\system32\ %SystemRoot%\system32\AutoNetWork.exe /install 建立卸载服务文件：uninstall.bat ?View Code BAT1 2 [...]]]></description>
		<wfw:commentRss>https://help.vps12.com/13.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
