none
How to make auto selection of files without chose it with the mouse RRS feed

  • Question

  • Hello to all users I am very new in the visual studio I make simple stuff and so fare all good but now I want to do something that is more complicated and I need your help. I want to make 2 things the first is when I open the program and press on a button that I will make its open another additional program and in this program as a please the you chose a file and I want that the program will do it itself I will give a YouTube link that will show what I mean. and the second question if I can put stuff files in the resources folder and These files will stay inside the program and will run from the resources and will not be extracted out that nobody will able to copy them 

    this is the example for what I want to do 

    https://www.youtube.com/watch?v=BOsGStRQPAM

    thank you very much for all users that can help me and answer  me  

    Thursday, February 14, 2019 4:07 PM

All replies

  • Hello,

    Running a resource from memory, may be possible but unwise and also may trigger an anti-virus program to see your app as a virus.

    So I have to ask, what are the programs in the project resource you want to run, be specific.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, February 14, 2019 7:10 PM
    Moderator
  • thank you so much for your quick reply the program that I want to run is simple program its call 
    Odin its small program that with this program I can flash Samsung mobile phone in the example that I post in my first post you can see the program. 
    <o:p></o:p>

    this is the 3 files that I will add to the resources <o:p></o:p>

    Odin3.exe<o:p></o:p>

    Odin3.ini<o:p></o:p>

    Semple.tar<o:p></o:p>

    the program is the Odin3.exe for this program will run and work the odin3.ini need to be include in the same folder when the Odin3.exe are located and the file that I want to be load to this program is this Semple.tar I will now upload a small video that show what I really want <o:p></o:p>

    Example  

    https://youtu.be/HAM0HZvws8E

    and this is a link for the 3 files that I show in the video I Upload them for download 

    https://ufile.io/epmfq

    Friday, February 15, 2019 7:38 AM
  • If Odin3 is not a .NET application then what you are after is not possible. To run from memory the executable must be a .NET app.

    Example for embedded .NET app.

    Imports System.IO
    Imports System.Threading
    
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim t As New Thread(New ParameterizedThreadStart(AddressOf ExecuteResourceExe))
    
            'Pass the resource name for example defaultNamespace.foldername.embeddedResource.exe
            t.Start("EmbeddedResource.exe")
        End Sub
    
        Public Shared Sub ExecuteResourceExe(resourceName As Object)
            'Get the resource stream
            Using resourceStream As Stream = Reflection.
                Assembly.GetExecutingAssembly().
                GetManifestResourceStream(resourceName.ToString())
    
                If resourceStream IsNot Nothing Then
                    'Read from resourceStream to byte[]
                    Dim resourceBuffer(CInt(resourceStream.Length) - 1) As Byte
                    resourceStream.Read(resourceBuffer, 0, resourceBuffer.Length)
    
                    'Load byte[] and execute the application from EntryPoint 
                    Reflection.Assembly.Load(resourceBuffer).EntryPoint.Invoke(Nothing, Nothing)
                End If
    
            End Using
        End Sub
    End Class
    

    So you will need to figure out an alternate solution such as extracting to disk, use then delete.



    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, February 15, 2019 10:48 AM
    Moderator