DownloadStringAsync DownloadStringCompleted issue-VBForums
Results 1 to 2 of 2

Thread: DownloadStringAsync DownloadStringCompleted issue

Hybrid View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    29

    DownloadStringAsync DownloadStringCompleted issue

    I want to download a file in Silverlight. It works in normal VB just fine:
    VB-Download Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim wclient As Net.WebClient = New Net.WebClient()
    3.         AddHandler wclient.DownloadStringCompleted, AddressOf ListDownloaded
    4.         wclient.DownloadStringAsync(New Uri("blablabla.txt"))
    5.     End Sub
    6.     Private Sub ListDownloaded(ByVal sender As Object, ByVal e As Net.DownloadStringCompletedEventArgs)
    7.         MessageBox.Show(e.Result)
    8.     End Sub

    But in Silverlight VB...

    Silverlight-Download Code:
    1. Private Sub ListDownloaded(ByVal sender As Object, ByVal e As Net.DownloadStringCompletedEventArgs)
    2.         MessageBox.Show(e.Result)
    3.     End Sub
    4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
    5.         Dim wclient As Net.WebClient = New Net.WebClient()
    6.         AddHandler wclient.DownloadStringCompleted, AddressOf ListDownloaded
    7.         wclient.DownloadStringAsync(New Uri("blablabla.txt"))
    8.     End Sub

    It utterly fails. At the bottom of Firefox it SAYS the file is downloading, but NOTHING happens other than that...

    HELP!

  2. #2
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: DownloadStringAsync DownloadStringCompleted issue


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.