Windows automatic update is a feature of the Windows operating system, when the important update for your computer is released, it will prompt you to download and install. By using automatic updates, you can update your operating system in the first place, fix system vulnerabilities, and protect your computer. These are the functions that everyone is familiar with, but you can use the Windows system service to automatically update the website. Do you know this? The answer should be no, today we will explain how to use the Windows system service to automatically update the website.
Principle:
1) Windows Server:
Windows Services uses the .Net Framework 2.0 framework, so you should first install .Net Framework 2.0 when using it,
An xml file stores configuration information, which stores the URLs that need to be accessed. The example structure is as follows:
<?xml version=1.0 encoding=utf-8 ?>
<root>< Br>
<Urls>
<item url=http://www.***.com time=3:59/>
<item url= Http://www.***..com time=11:59/>
<item url=http://www.***..com time=13:59/> ;
<item url=http://www.***.com time=15:59/>
<item url=http://www.** *..com time=16:59/>
</Urls>
</root>
An item representative The second visit, url is the specific URL, set to the url address of the website automatically updated, you can set the number of updates with the query string, time indicates the time of daily access, time can only be accurate to 1 minute, and each item must be guaranteed There is only one url task in the same minute.
The program uses a timer to scan the configuration item for the URL to be accessed every 20 seconds. If there is one, visit the URL once. The relevant code is as follows:
public Job()
{
System.Timers.Timer myTimer = new System.Timers.Timer(20000);
myTimer.Elapsed += new ElapsedEventHandler(myTimer_Elapsed);
myTimer.Enabled = true;
myTimer.AutoReset = true;
XmlDocument xml = new XmlDocument();< Br>
xml.Load(AppDomain.CurrentDomain.BaseDirectory + ConfigurationManager.AppSettings[xmlfile]);
xmllist = xml.SelectNodes(//root/Urls/item);
}
void myTimer_Elapsed(object source, ElapsedEventArgs e)
{
try
<
Log.SaveNote(DateTime.Now .ToString(yyyy-MM-dd HH:mm:ss) + Heart Work!); Previous12Next Total 2 Pages
The TIF file is called the Label Image File Format, which is a file format primaril
Todays printers basically have the function of double-sided printing, but in general, one-sided prin
A friend recently asked Xiaobian that his WinXP system hard disk icon could not be displayed, and al
Computer users should be familiar with everyone. The default is the administrator. But nowadays, man
360 repair blue hole after the repair of the vulnerability
9 solutions for forgetting Windows XP login passwords
What should I do if the "msiexec.exe application error" appears in the XP system installer?
Talking about how computers can resist the invasion of MP3 virus
WinXP can't open the webpage and the prompt is offline. Solution
How to cleverly hide the WinXP taskbar icon
Teach you how to add a security lock to Windows XP system
Win7 "complete dishes" free to burn "big meal"
What backup work does WinXP do before reinstalling?
Answer Quickly view the encrypted files in Windows XP
What should I do if WinXP uses the Ghost backup system to have a "11032" failure?
Take you a comprehensive understanding of WinXP installation disk toolset
Win7 uses the restore function to retrieve lost files
Win8 how to install Win7 version USB3.0 driver
How does Linux use the OOM killer mechanism?
Under IIS7, the IIS7 site page can't display properly. How to do
Upgraded version of Win8 weather application review
MSN can't start or report error under Windows 7
Ballmer will deliver a speech at CES 2012 Bringing Windows 8
Dealing with win7 can not automatically update the problem has a coup
How to delete the shortcut icon in the win10 official version start menu?