When I run this and click the button I get an error message "The remote server returned an error: (403) Forbidden."
I can paste that same url in a browser window and it will open the page (it is actually a 256x256px png image)
Using Perl I can use the (LWP-Get/Store) function on that url and it will also get the image.
I would like to get this working in VB.NET (2010)
(The extra namespaces are for other methods)
Imports System
Imports System.Windows.Forms
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub btnDownload_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnDownload.Click
Dim webClient As New System.Net.WebClient
Dim strURL As String
Dim strPath As String
strURL = "http://mt1.google.com/vt/lyrs=m@141&hl= _
en&src=api&x=31095&s=&y=50042&z=17&s=Galileo"
strPath = "C:\___4Tiles\31095_50042_Z17_1x1.png"
webClient.DownloadFile(strURL, strPath)
End Sub
End Class
I can paste that same url in a browser window and it will open the page (it is actually a 256x256px png image)
Using Perl I can use the (LWP-Get/Store) function on that url and it will also get the image.
I would like to get this working in VB.NET (2010)
(The extra namespaces are for other methods)
Imports System
Imports System.Windows.Forms
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub btnDownload_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnDownload.Click
Dim webClient As New System.Net.WebClient
Dim strURL As String
Dim strPath As String
strURL = "http://mt1.google.com/vt/lyrs=m@141&hl= _
en&src=api&x=31095&s=&y=50042&z=17&s=Galileo"
strPath = "C:\___4Tiles\31095_50042_Z17_1x1.png"
webClient.DownloadFile(strURL, strPath)
End Sub
End Class