Results 1 to 2 of 2
  1. #1
    Trojanman24's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Location
    Finland
    Posts
    190
    Reputation
    23
    Thanks
    18
    My Mood
    Asleep

    Naming a variable

    So, im trying to code this program that'll pull the pictures out of your directory yes? but theres one problem..i need to know the name of the file i want to pull, i have the folder location, but is there a way to dedicate the name of the picture without me actually knowing it? like how in permissions in minecraft where a * is everything, is there an equivalent in vb that i could use, or do i need to make a big loop to get all file names possible
    Quote Originally Posted by Ed View Post

    ... but If I get banned that's 1 less retard for everyone else to deal with on the forums. If I get banned it's no biggie and there's one less retard on the forums. Win win either way.

  2. #2
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,811
    Reputation
    219
    Thanks
    2,896
    My Mood
    Tired
    Quote Originally Posted by Trojanman24 View Post
    So, im trying to code this program that'll pull the pictures out of your directory yes? but theres one problem..i need to know the name of the file i want to pull, i have the folder location, but is there a way to dedicate the name of the picture without me actually knowing it? like how in permissions in minecraft where a * is everything, is there an equivalent in vb that i could use, or do i need to make a big loop to get all file names possible
    Code:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'Resize the Control
            Me.Size = New Size(500, 250)
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
    
    
            'Creates a new listview with the following properties
            Dim lv As New ListView
            With lv
                .Dock = DockStyle.Fill ' -----------------------|
                .View = View.Details ' -------------------------|
                .FullRowSelect = True ' ------------------------|
                .GridLines = True ' ----------------------------|
                ' End of properties
    
    
                Me.Controls.Add(lv)
    
    
                'Creates listview columns
                Dim col1, col2 As New ColumnHeader
                col1.Text = "File Path"
                col2.Text = "File Name"
                .Columns.AddRange(New ColumnHeader() {col1, col2})
                ' and then resizing by half - 5
                For Each col As ColumnHeader In .Columns
                    col.Width = (lv.Width / 2) - 5
                Next
            End With
    
    
            ' Now extracting the files
            Dim path As String = "C:\Users\Aaron\Desktop\Slides" 'File Path
            Dim dirInfo As New IO.DirectoryInfo(path)
            Dim fileInfo As IO.FileInfo() = dirInfo.GetFiles()
    
    
            'list the names of all files in the specified directory
            For Each file As IO.FileInfo In fileInfo ' Goes through each file in this directory provided by "Path"
                Dim item As New ListViewItem(file.FullName) ' [Step 1] Creates a new ListViewItem & Sets the first column (Indexed as 0) as the full file path of the file
                item.SubItems.Add(file.Name) ' [Step 2] Now, creates a sub item of the same item that was intially created of the file name
                lv.Items.Add(item) ' [Step 3] Finally, adding the item into the listview
            Next ' and will now go to the next file and complete step 1 - 3 again until there are no more files to read
        End Sub

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

    Trojanman24 (05-12-2013)

Similar Threads

  1. Leet Names :)
    By EleMentX in forum Spammers Corner
    Replies: 18
    Last Post: 09-20-2010, 10:34 PM
  2. No-name game
    By SadisticGrin in forum Spammers Corner
    Replies: 12
    Last Post: 01-28-2010, 10:58 AM
  3. Post your game name here
    By styx23 in forum WarRock - International Hacks
    Replies: 49
    Last Post: 07-17-2007, 08:47 PM
  4. Name hack!
    By ricardobolder in forum Gunz Hacks
    Replies: 4
    Last Post: 07-27-2006, 11:49 PM
  5. Real Names
    By JTLOBAMHSK in forum General
    Replies: 54
    Last Post: 06-12-2006, 04:10 AM