I tried what you suggested to, but i get the same error message.. here is
the code i have wrote for it. it the form and the DLL.
Public Class CWeatherMaps
Private m_strMapType As String
Private Const strhttp As String =
http://image.weather.com
Const str300MileMap As String =
"/looper/archive/us_pdx_ultraradar_large_usen/"
Private Const str600MileMap As String =
"/looper/archive/us_pdx_closeradar_large_usen/"
'*******************************
'* Save path of the map files
'*******************************
Private strSave1 As String = Application.StartupPath & "\maps\1l.jpg"
Private strSave2 As String = Application.StartupPath & "\maps\2l.jpg"
Private strSave3 As String = Application.StartupPath & "\maps\3l.jpg"
Private strSave4 As String = Application.StartupPath & "\maps\4l.jpg"
Private strSave5 As String = Application.StartupPath & "\maps\5l.jpg"
Public Property WeatherMap() As String
Get
End Get
Set(ByVal Value As String)
Try
Select Case Value
Case "300mile"
m_strMapType = str300MileMap
If m_strMapType = Nothing Then Exit Try
Case "600mile"
m_strMapType = str600MileMap
End Select
Catch exc As Exception
'MessageBox.Show("Can not Save Files or Files are locked or File not Found",
"Save File Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Property
Finally
Call MapDownload()
End Try
End Set
End Property
Private Function MapDownload()
Dim milliseconds As Double
Dim date1970 As New Date(1970, 1, 1, 12, 0, 0)
Dim strUniqueTime As String
Dim strDownload As String
Dim wc As New System.Net.WebClient()
milliseconds = CLng(DateTime.Now.Subtract(date1970).TotalMilliseconds())
strUniqueTime = "?" & milliseconds.ToString
Try
strDownload = strhttp & m_strMapType & "1L.jpg" & strUniqueTime
wc.DownloadFile(strDownload, strSave1)
strDownload = strhttp & m_strMapType & "2L.jpg" & strUniqueTime
wc.DownloadFile(strDownload, strSave2)
strDownload = strhttp & m_strMapType & "3L.jpg" & strUniqueTime
wc.DownloadFile(strDownload, strSave3)
strDownload = strhttp & m_strMapType & "4L.jpg" & strUniqueTime
wc.DownloadFile(strDownload, strSave4)
strDownload = strhttp & m_strMapType & "5L.jpg" & strUniqueTime
wc.DownloadFile(strDownload, strSave5)
Catch exc As IO.IOException
End Try
End Function
End Class
Public Class frmWeatherMap
'Create a counting variable for looping purposes...
Dim iCounter As Integer
'*******************************************
'* Collection for the Downloaded Image Files
'*******************************************
Dim imgMapList As New Collection()
'***********************
'* Image files Variables
'***********************
Dim img1l As Image
Dim img2l As Image
Dim img3l As Image
Dim img4l As Image
Dim img5l As Image
'*******************************
'* Save path of the map files
'*******************************
Dim strSave1 As String = Application.StartupPath & "\maps\1l.jpg"
Dim strSave2 As String = Application.StartupPath & "\maps\2l.jpg"
Dim strSave3 As String = Application.StartupPath & "\maps\3l.jpg"
Dim strSave4 As String = Application.StartupPath & "\maps\4l.jpg"
Dim strSave5 As String = Application.StartupPath & "\maps\5l.jpg"
Private Sub frmWeatherMap_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'***************************************************************
'* Calls the collection Load Function and enables tmrImageLooper
'***************************************************************
Call LoadCollection()
tmrImageLooper.Enabled = True
End Sub
Private Sub tmrImageLooper_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tmrImageLooper.Tick
Try
'***************************
'* Hides Default load image
'***************************
picAnimationLoading.Visible = False
'Add 1 to the counting variable...
iCounter = iCounter + 1
'Set the picture of imgAni to the image number
'iCounter(which are stored in the ImageList...
picImageMap.Image = imgMapList.Item(iCounter)
'If iCounter equals 8, set it back to 0 so that
'the animation continues.
'8 is the maximum amount of frames in this animation.
'Change this number to the number of frames to animate...
If iCounter = 5 Then iCounter = 0
Catch exc As Exception
tmrImageLooper.Enabled = False
MessageBox.Show("There are no Image Files Loaded in to the Collection at
this time.", "Animation Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.Close()
Exit Sub
End Try
End Sub
Private Sub mnuClose_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuClose.Click
Me.Close()
End Sub
Function LoadCollection() As Image
'****************************************************
'* Addes the Image files to the Collection(imgMaplist)
'****************************************************
Try
img1l = Image.FromFile(strSave1)
imgMapList.Add(img1l)
img2l = Image.FromFile(strSave2)
imgMapList.Add(img2l)
img3l = Image.FromFile(strSave3)
imgMapList.Add(img3l)
img4l = Image.FromFile(strSave4)
imgMapList.Add(img4l)
img5l = Image.FromFile(strSave5)
imgMapList.Add(img5l)
Catch exc2 As IO.IOException
MessageBox.Show(exc2.Message)
Me.Close()
Exit Function
End Try
End Function
End Class