Results 1 to 5 of 5
  1. #1
    karldeovbnet's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Malabon City
    Posts
    11
    Reputation
    10
    Thanks
    2
    My Mood
    Amazed

    [Code] Filling ComboBox/ListBox with every exe inside the application folder[Solved]

    i want some codes to populate a listbox/comx with all the names of the exe inside the application folder i am going to make.

    i want to make an application that gets the list of exes and put it in the listbox/comx, and when i select the exe it will start,

    the only thing i need now is the codes to populate the said list.

    is it possible, or im just being crazy chooby again?
    VB.Noob

    i'm here to learn and contribute as much as i can to the community

    ~ako si karl deo~

  2. #2
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    [highlight=vb.net]
    Dim exeArray As String() = FileIO.FileSystem.GetFiles(Application.StartupPath , 2, "*.exe").ToArray

    ComboBox1.Items.AddRange(exeArray)
    ListBox1.Items.AddRange(exeArray)
    [/highlight]

    Yeah, you can call the AddRange method on either of the controls and it will parse an array and add each individual item.
    Last edited by Jason; 02-27-2011 at 06:20 PM.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  3. The Following User Says Thank You to Jason For This Useful Post:

    karldeovbnet (02-27-2011)

  4. #3
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    imports system.io

    for each file in dir(directory here)
    combo.box.items.add(file)
    next

    Sub combo.box clicked item BLAH BLAH BLAH...
    if e.name = "name here" then
    do this
    elseif e.name = "other name here" then
    do this
    end if
    end sub



    i dont have visual basic in front of me so i cant tell you exactly...


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  5. The Following User Says Thank You to mnpeepno2 For This Useful Post:

    karldeovbnet (02-27-2011)

  6. #4
    karldeovbnet's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Malabon City
    Posts
    11
    Reputation
    10
    Thanks
    2
    My Mood
    Amazed
    thank you, problem solved
    VB.Noob

    i'm here to learn and contribute as much as i can to the community

    ~ako si karl deo~

  7. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Marked solved. No need to post further.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)