Ik ben nu bezig met een programma te schrijven dat een file download van internet en het opslaat op de harde schijf...
Als ik het programma start, dan geeft hij een WebException:
Ik heb al wezen googlen, maar ik kan niks vinden dat het probleem juist beschrijft.
code:
1
2
3
4
5
6
| Public Class frmMain
Dim wc As New System.Net.WebClient()
Private Sub refreshImageCode_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles refreshImageCode.Tick
wc.DownloadFile("http://www.zangai.nl/zx-logo.swf", "c:\button.swf")
End Sub
End Class |
Als ik het programma start, dan geeft hij een WebException:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| System.Net.WebException was unhandled
Message="Kan geen verbinding met de externe server maken"
Source="System"
StackTrace:
bij System.Net.WebClient.DownloadFile(Uri address, String fileName)
bij System.Net.WebClient.DownloadFile(String address, String fileName)
bij WindowsApplication1.frmMain.refreshImageCode_Tick(Object sender, EventArgs e) in C:\Users\Zangai.NET\Documents\Visual Studio 2005\Projects\WoW_ScreenshotOfTheDay\WoW_ScreenshotOfTheDay\frmMain.vb:regel 4
bij System.Windows.Forms.Timer.OnTick(EventArgs e)
bij System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
bij System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bij System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bij System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bij System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bij System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bij System.Windows.Forms.Application.Run(ApplicationContext context)
bij Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bij Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bij Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bij WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:regel 81
bij System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bij System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bij Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bij System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bij System.Threading.ThreadHelper.ThreadStart() |
Ik heb al wezen googlen, maar ik kan niks vinden dat het probleem juist beschrijft.