Guys I was just wondering if I could create a simple downloader created using VB 2008. The user will enter the complete address of a file from the internet, click the Download button then the downloading process will start. There should also be a button labeled "Paste" which will paste a valid path (copied into the Clipboard) into a textbox .

I hope you can imagine the scenario.

See if this helps to check the Clipboard data for a valid URL.

If Clipboard.ContainsData(DataFormats.Text) Then '// check if Data in Clipboard is Text.
            Dim sTemp As String = Clipboard.GetData(DataFormats.StringFormat).ToString '// get Data.
            '// check if Data .StartsWith("http://") to make sure it is a URL
            '--- AndAlso check if the last part ends with a ".", common for files that download(.exe,.png, .etc.).
            If sTemp.StartsWith("http://") AndAlso sTemp.Substring(sTemp.LastIndexOf("/")).Contains(".") Then
                TextBox1.Text = sTemp '// add Data to TextBox.
            Else '// if not a valid URL, notify user.
                MsgBox("Invalid URL.")
            End If
        End If

You're welcome.
And you have to thank much more codeorder, it all his codes (:

And also mark as solved this thread too.

This article has been dead for over six months. Start a new discussion instead.