locked
Scan my files ? - How do i do ? RRS feed

  • Question

  • How do i do to scan my files and show in textbox1...

    Example: 
     Scan files which i want : "abc.exe"; "abc.dll"; "abc.ogx"; "abc.txt"; etc...
    If you find those files, show in textbox1 .
    And we create a new button with name "delete" because i want to delete files in textbox1 (delete files form textbox1 and computer) ???

    Please post the code ?
    Sunday, September 17, 2006 10:18 PM

Answers

  • ok, thats clearer.

    Dim theFiles() as string = System.IO.Directory.GetFiles("Path", ".jpg") 'gets all jpg extensions

    for each currentItem as String in theFiles

       MessageBox.Show(currentItem)

    next

    Wednesday, September 20, 2006 10:18 PM
  • modify the code as neccessary - mine was just an example :-)

    instead of MessageBox.Show() try:

    Me.theTextBox.Text = Me.theTextBox.Text & currentItem

    Thursday, September 21, 2006 2:19 PM

All replies

  •  

    Consider a listview instead of a textbox and people are here to learn how to develop code not have others write it for them

    Sunday, September 17, 2006 11:19 PM
  • well it will be hard to do. you pretty much need some algorithm to scan for viruses and what not which is not easily done. There is no "set" algorithm to do this, you will have to create one. Do some research about how to detect files which could be infected. It's something that's not easy to learn and not easily told.

     

    Monday, September 18, 2006 4:03 AM
  • I dont want to create VirusScan or ScanViruses but i want to search my files understant...
    my photo and so my files ...
    Wednesday, September 20, 2006 10:09 PM
  • ok, thats clearer.

    Dim theFiles() as string = System.IO.Directory.GetFiles("Path", ".jpg") 'gets all jpg extensions

    for each currentItem as String in theFiles

       MessageBox.Show(currentItem)

    next

    Wednesday, September 20, 2006 10:18 PM
  • Its just for picture or anyfiles ???
    .dll .exe .jpg .gif .bpm
    Wednesday, September 20, 2006 10:24 PM
  • the code I supplied only gets you the jpg files, you will have to modify it to get the files you like, such as .exe, or .bmp or whatever the extension of files you would like to get
    Wednesday, September 20, 2006 10:26 PM
  • ok, messagebox.show but i want to show textbox no messagebox ?
    Thursday, September 21, 2006 1:09 PM
  • modify the code as neccessary - mine was just an example :-)

    instead of MessageBox.Show() try:

    Me.theTextBox.Text = Me.theTextBox.Text & currentItem

    Thursday, September 21, 2006 2:19 PM
  • thank you .
    Thursday, September 21, 2006 9:25 PM