Solved need a little help :)

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
so what i want is, i want to run the EXE from a tempfile but it seems not to work
here is the source

C#:
Dim Hey As Integer
C#:
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        If ListBox1.SelectedItem = "program 1" Then
            On Error Resume Next
            Hey = 1000
            Dim TempFile As String = My.Computer.FileSystem.GetTempFileName
            Dim Hey1 As String = TempFile + ("program.exe")
            IO.File.WriteAllBytes(TempFile, My.Resources.program)
            Process.Start(Hey1)
        End If
    End Sub
if you guys could help me with this it would be great thx :)
 

Styx

Coder
Dank Tier Donator
Nobleman
Aug 14, 2012
117
648
3
C#:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If ListBox1.SelectedItem = "program 1" Then
            Hey = 1000
            Dim Path As String = IO.Path.Combine(IO.Path.GetTempPath(), "program.exe")
            IO.File.WriteAllBytes(Path, My.Resources.program)
            Process.Start(Path)
        End If
    End Sub
I still don't know what the integer 'Hey' is for. Anyway, the problem is that you have been trying to use 'GetTempFileName' to get the temp directory's path. 'GetTempFileName' does not return the path to the temp directory, it creates an empty file within the temp directory and then returns the path to that file (e.g. C:\Users\Username\AppData\Local\Temp\randomfile.tmp).
 

TYPEX

Coder
Full Member
Nobleman
Aug 28, 2013
101
573
0
Not sure what error you're getting exactly but I'd say it probably can't find the path to the file or the file itself because you haven't put the backslash, it should be ("\program.exe")
Try to print out Only TempFile variable, and then just add to that string "program.exe", what do you get? Probably something like C:\path_to_file\folderprogram.exe

PS: I don't know VB so i might be wrong.
 

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
Not sure what error you're getting exactly but I'd say it probably can't find the path to the file or the file itself because you haven't put the backslash, it should be ("\program.exe")
Try to print out Only TempFile variable, and then just add to that string "program.exe", what do you get? Probably something like C:\path_to_file\folderprogram.exe

PS: I don't know VB so i might be wrong.
no thats the FileSystem.SpecialDirectories.Temp function

FileSystem.GetTempFileName = Copy file into a Temp file (.tmp)
then i need code to run the exe inside the .tmp file ;)
 

Alex

Sober linux neb
Dank Tier Donator
Nobleman
Nov 26, 2015
150
828
1
okay nice, now how do i make the file download from my webserver?
Myself, I am not so good with VB.net. But after some research i found: My.Computer.Network.DownloadFile(arg, arg) :smile:
 

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
Myself, I am not so good with VB.net. But after some research i found: My.Computer.Network.DownloadFile(arg, arg) :smile:
C#:
Dim Path As String = IO.Path.Combine(IO.Path.GetTempPath(), "File.exe")
            IO.File.WriteAllBytes(Path, My.Computer.Network.DownloadFile("https://Example.com/Filelocation/File.exe"))
            Process.Start(Path)
 

Alex

Sober linux neb
Dank Tier Donator
Nobleman
Nov 26, 2015
150
828
1
C#:
Dim Path As String = IO.Path.Combine(IO.Path.GetTempPath(), "File.exe")
            IO.File.WriteAllBytes(Path, My.Computer.Network.DownloadFile("https://Example.com/Filelocation/File.exe"))
            Process.Start(Path)
And?
//TH1S M3SSAGE iS 2 SH0RT 0mg 1v1 me Fl33p
 

Styx

Coder
Dank Tier Donator
Nobleman
Aug 14, 2012
117
648
3
Doesn't work, i got a overload message
You haven't specified the download location. Please read the documentation, you could have easily figured this out yourself.

C#:
 My.Computer.Network.DownloadFile(address As String, destinationFileName As String)
You cant just leave out required parameters.

C#:
        Dim Path As String = IO.Path.Combine(IO.Path.GetTempPath(), "File.exe")
        My.Computer.Network.DownloadFile("https://Example.com/Filelocation/File.exe", Path)
        Process.Start(Path)
This will download the file to the path located in the 'Path' string. You should really look into using a WebClient or HttpWebRequests instead of My.Computer.Network.DownloadFile() though.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods