4/24/11

[VB.NET][SNP] Download And Run File

 Dim url As String = "htpp://codingsource.blogspot.com/example.exe"  
 Dim thefile As String = System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\example.exe"  
 If My.Computer.FileSystem.FileExists(thefile) Then  
  My.Computer.FileSystem.DeleteFile(thefile)  
 End If  
 My.Computer.Network.DownloadFile(url, thefile)  
 Shell(thefile)  

Simple, with no imports.
Change the url to yours and thefile.

No comments: