SunQuest
           IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationIIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 7th, 2004, 09:03 AM
diffenc diffenc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 diffenc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How do you schedule a server to download a file hourly?

Probably an easy solution, but I just don't know it.

I need some way to automatically download an XML file from a web site down to my server (Win2k3-IIS) so I can write a script to pull data from the local file and post it.

I want to get an update remote file every hour and save it locally.

What are my options?

Last edited by diffenc : May 7th, 2004 at 09:10 AM.

Reply With Quote
  #2  
Old May 7th, 2004, 10:01 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,703 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 21 h 33 m 53 sec
Reputation Power: 688
You might be able to do something with the server's task scheduler.
__________________
======
Doug G
======
"Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton

Reply With Quote
  #3  
Old October 31st, 2004, 08:38 PM
casaubon casaubon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 casaubon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i'd create an exe to do the download then run it with the taks scheduler

Something like this should work
Public Class saveAs

Public Function saveTheFile()
Dim objWebClient As New WebClient

Dim commandLineArgs As String()
Dim rUrl As String
commandLineArgs = System.Environment.GetCommandLineArgs()
If commandLineArgs.Length > 1 Then
rUrl = commandLineArgs(1)
Else
rUrl = "http://blah.com/xml.xml"
End If

Dim aRequestedHTML() As Byte
aRequestedHTML = objWebClient.DownloadData(rUrl)
Dim objUTF8 As New UTF8Encoding
Dim strRequestedHTML As String
strRequestedHTML = objUTF8.GetString(aRequestedHTML)
writeTofile(strRequestedHTML.ToString)

End Function
Private Sub writeTofile(ByVal sHtml As String)
Dim month As Integer = DateTime.Now.Month
Dim day As Integer = DateTime.Now.Day
Dim year As Integer = DateTime.Now.Year

Dim commandLineArgs As String()
Dim pathRoot As String
commandLineArgs = System.Environment.GetCommandLineArgs()

If commandLineArgs.Length > 2 Then
pathRoot = commandLineArgs(2)
'Console.WriteLine(pathRoot)
Else
pathRoot = "C:\"
End If

Dim filePath As String = pathRoot & month & "-" & day & "-" & year & ".xls"
Try
If sHtml.Length > 1 Then
Dim oFileStream As FileStream = New FileStream(filePath, FileMode.Append, FileAccess.Write)
Dim oStreamWriter As StreamWriter = New StreamWriter(oFileStream)
oStreamWriter.Write(sHtml)
oStreamWriter.Flush()
oStreamWriter.Close()
End If

Catch ex As Exception
'igonore
End Try
End Sub
End Class

Reply With Quote
  #4  
Old October 31st, 2004, 11:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,703 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 21 h 33 m 53 sec
Reputation Power: 688
Use some kind of program and schedule it in the task scheduler. You could write the program in VB, VBScript, or something.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationIIS > How do you schedule a server to download a file houry?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway