We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,134 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to Download file in Visual Basic

i want to know that how can we download file in visual basic silently without notifying users .... its my application update , also how could we create thread in visual basic so that this thread always check for updates and downloads silently

5
Contributors
7
Replies
18 Hours
Discussion Span
3 Months Ago
Last Updated
22
Views
darkc99
Junior Poster in Training
61 posts since Jan 2012
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

You can't download silently because that would violate computer security although there are probably ways to get around that. The only reason I can think of why you would even want to do that is if you are writing a virus or something like that.

Ancient Dragon
Achieved Level 70
Team Colleague
32,128 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69

I used to do this all the time for corporate apps. It was critical that the users ran the current version of the software so the apps had a front end that would compare the date/time stamps of all installed modules to those on the server. Any new modules were copied to the user's PC before the app was actually loaded. I used a common launcher.exe that took three parameters

  1. local app folder
  2. server app folder
  3. local executable to run after updating
Reverend Jim
Carpe per diem
Moderator
3,600 posts since Aug 2010
Reputation Points: 561
Solved Threads: 447
Skill Endorsements: 32

I'll bet your programs did not do it siently without user knowledge.

Ancient Dragon
Achieved Level 70
Team Colleague
32,128 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69

The browser you are using is siliently downloading stuff all the time. It is a matter of do you trust the program.

I use a third party Firewall to block everything unless I grant it permission. However, once you grant a program access to the internet, there is very little you can do about controlling what it downloads. That is where a good anti-virus program comes in that scans internet traffic for the obvious stuff.

Granted, polite programs ask for permission. i.e. Check for Updates, download updates automatically, etc.

To the OP: see: http://www.daniweb.com/software-development/vbnet/threads/441772/silent-browser-download

Edit: I forgot I was in the VB6 forum not VB.Net. Not used to seeing AD or Jim here and I got confused.

Instead see: http://www.ex-designz.net/apidetail.asp?api_id=498 for using URLDownloadToFile.

TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13

I'll bet your programs did not do it siently without user knowledge.

Actually, it did. And that was at the users' request. They didn't care about updates or being informed about what version they were using. All they cared about was that the software worked. When you are an operator controlling many billions of dollars of equipment and ensuring that power gets delivered reliably to a million local customers and to neighbouring provinces and states you have better things to do than acknowledge message boxes that do nothing more than tell you that everything is working. It's when things aren't working that you need the alerts.

Reverend Jim
Carpe per diem
Moderator
3,600 posts since Aug 2010
Reputation Points: 561
Solved Threads: 447
Skill Endorsements: 32

Am using visual studio 2012 for my vb project i tried above links
current code is but not working

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long)

    Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
        Dim lngRetVal As Long
        lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        If lngRetVal = 0 Then DownloadFile = True
        Label4.Text = lngRetVal
    End Function
    Private Sub Form_Load()
         DownloadFile("http://www.forex-tribe.com/img/final1.png", "c:\\final1.png")
    End Sub
darkc99
Junior Poster in Training
61 posts since Jan 2012
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

I agree with Jim on this. Also making use of silent downloads. Obviously the necesarry approval was obtained when a new installation was made to a client. After that it is our responsibility to see that the app runs 100%.

@TnTinMN, agreed. All the installer has to do is to ensure that your app is cleared through all AV and FW's, then compare the versions and download when needed. It IS nice to see Jim and AD in here as well. :)

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0742 seconds using 2.66MB