Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

sextonk

@sextonk
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • find names in a directory
    S sextonk

    :^)I am very new to vb. I am trying to write an program which searches through all the word docs. in a directory. I have a list of 20 stirngs I am looking for. I am sure only 1 of the strings is found in each file. I have tried to write this several diferent ways but none works. I think I need two arrays and to loop through both and output the found strings, file names, and dates of the files to a spreadsheet. Any help would be greatly appreciated. Public Class Form1 'Create a list of doctors as an array. 'Create a list of files in the remote folder as an array 'Loop thru the “files array” and look for each doctor 'Write the doctor name, filedate, sysdate, and file name to a spreadsheet Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' For Each strFile As String In My.Computer.FileSystem.Getectories("C:\batch") 'Add the item to the list 'ListBox1.Items.Add(strFile) 'If String.Compare(strDoc) Then Dim doc1 As String = "ledford" Dim list As System.Collections.ObjectModel.ReadOnlyCollection(Of String) list = My.Computer.FileSystem.FindInFiles("C:\batch", doc1, True, FileIO.SearchOption.SearchTopLevelOnly) For Each name As String In list ListBox1.Items.Add(name) Next 'End If ''''''Assign the files found in the list above as a variable and replace for file1.log 'Dim information As System.IO.FileInfo = My.Computer.FileSystem.GetFileInfo("C:\batch\file1.log") 'MsgBox("The file's full name is " & list.FullName & ".") 'MsgBox("Last access time is " & list.LastAccessTime & ".") ' Next End Sub 'Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' Dim arrayDocs (of string) ' arrayDocs(0) = "sexton" ' arrayDocs(1) = "wargo" ' arrayDocs(2) = "ledford" ' arrayDocs(3) = "koepke" ' For Each strDoc As String In arrayDocs ' ListBox2.Items.Add(strDoc) ' Next 'End Sub End Class -Kevin

    Visual Basic data-structures help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups