-1
Imports system.net
Public Class Form1

    Private Sub cmdsave_Click(sender As Object, e As EventArgs) Handles cmdsave.Click
        SaveFileDialog.Filter = "All files (*.*)|*.*"
        ''"EXE (*.exe) |*.exe |JPEG (*.jpg)|*.jpg | MP3 (*.mp3)|*.mp3 | WAV (*.wav) |*.wav ";
        SaveFileDialog.ShowDialog()
        TextBox2.Text = SaveFileDialog.FileName
    End Sub
    Public WithEvents download As WebClient
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        download = New WebClient
        download.DownloadFileAsync(New Uri(TextBox1.Text), TextBox2.Text)
    End Sub
    Private Sub download_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles download.DownloadProgressChanged
        ProgressBar1.Value = e.ProgressPercentage
    End Sub
End Class

I'm trying to make a downloader but I keep getting an error with the SaveFileDialog area. I am a newbie with VB.Net and I'm wondering what i need to change to make it work and successfully download all type of files.

Visual Vincent
  • 18,045
  • 5
  • 28
  • 75
CholoBoy
  • 159
  • 2
  • 14
  • 1
    You should fix the error in the SaveFileDialog area – Ňɏssa Pøngjǣrdenlarp Oct 04 '16 at 18:29
  • 1
    Telling us the error you're getting is a very good start. – Visual Vincent Oct 04 '16 at 18:36
  • well i add `Dim objSaveFileDialog as New SaveFileDialog()` and now i only get two codes – CholoBoy Oct 05 '16 at 16:55
  • There errors are `Public Overloads Property AllowReadStreamBuffering As Boolean' is obsolete: 'This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.` I clicked on them and it lead me to two `Me.WebClient1.AllowReadStreamBuffering = False` – CholoBoy Oct 05 '16 at 16:56

1 Answers1

0

Unless you have declared SaveFileDialog as a SaveFileDialog then I believe your error is related to a non-shared member. This is not causing your error though.

One suggestion, check this out, says to remove the webclient and readd it to your form.

Also, one quick(dirty?) fix is to target a lower version of the .Net Framework under your Application Properties.

Either of those should do the trick for this issue.

Community
  • 1
  • 1
Jimmy Smith
  • 2,452
  • 1
  • 16
  • 19
  • These are all the errors that I got when I tried to run the program. And will ` "All files (*.*)|*.*" ` work to save all type of files – CholoBoy Oct 05 '16 at 16:24
  • 1
    Error BC30668 'Public Overloads Property AllowReadStreamBuffering As Boolean' is obsolete: 'This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.'. Guillermo's Downloader C:\Users\The Orange Box\Desktop\Not Porn\Guillermo's Downloader\Guillermo's Downloader\Form1.Designer.vb 106 Active – CholoBoy Oct 05 '16 at 16:41
  • Error BC30668 'Public Overloads Property AllowWriteStreamBuffering As Boolean' is obsolete: 'This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.'. Guillermo's Downloader C:\Users\The Orange Box\Desktop\Not Porn\Guillermo's Downloader\Guillermo's Downloader\Form1.Designer.vb 107 Active – CholoBoy Oct 05 '16 at 16:41
  • I have drastically modified my answer as providing the error greatly changes what I assumed was causing the problem. – Jimmy Smith Oct 06 '16 at 14:48