1,105,281 Community Members

How to Download file in Visual Basic

nova37
Deleted Member
 
0
 

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

Member Avatar
Ancient Dragon
Achieved Level 70
27,573 posts since Aug 2005
Reputation Points: 5,231 [?]
Q&As Helped to Solve: 3,028 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
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.

Member Avatar
Reverend Jim
Noli mentula
5,394 posts since Aug 2010
Reputation Points: 746 [?]
Q&As Helped to Solve: 643 [?]
Skill Endorsements: 51 [?]
Moderator
Featured
 
0
 

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
Member Avatar
Ancient Dragon
Achieved Level 70
27,573 posts since Aug 2005
Reputation Points: 5,231 [?]
Q&As Helped to Solve: 3,028 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

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

Member Avatar
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418 [?]
Q&As Helped to Solve: 152 [?]
Skill Endorsements: 16 [?]
 
0
 

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.

Member Avatar
Reverend Jim
Noli mentula
5,394 posts since Aug 2010
Reputation Points: 746 [?]
Q&As Helped to Solve: 643 [?]
Skill Endorsements: 51 [?]
Moderator
Featured
 
0
 

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.

nova37
Deleted Member
 
0
 

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
Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
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. :)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: