For my application I am trying to create a directory for my program, download an executable into the folder and then run it but I am getting two errors,
Error 1 Too many arguments to 'Public Shared Function Exists(path As String) As Boolean'.
Error 2 Value of type 'String' cannot be converted to 'System.Security.AccessControl.DirectorySecurity'.
any Idea what I am doing wrong?
Imports System.DirectoryServices
Imports System.IO
Module Download
Public Sub DownloadExecute(ByVal url As String)
Dim folder As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
If (Not System.IO.Directory.Exists(folder, "TankGame\Installer")) Then
System.IO.Directory.CreateDirectory(folder, "TankGame\Installer")
End If
Dim Downloadedfile = Path.Combine(folder, "TankGame\Installer\installer.exe")
My.Computer.Network.DownloadFile("url", Downloadedfile)
Process.Start(Downloadedfile)
End Sub
End Module