Closed Thread
Results 1 to 4 of 4

Thread: ListView Help?

  1. #1
    MXTECH is offline Learning Programmer
    Join Date
    Jan 2008
    Posts
    46
    Rep Power
    15

    Unhappy ListView Help?

    Hey i'm making a program that i need a listview with 4 collums "Virus name, Virus signature, virus dir, virus risk", i need my program to understand what what each line is and look for the virus in the line that has the virus name and then look at the virus dir and look for it there, i tried to get this working but its a pain in the butt for a beginer like me. so basicly what i'm asking is:
    1.How do you add items to a listview?
    2.How do you get my app to read the listview table and read it line by line?

    Here is the interface i made, this is version 3 Prerelease though,

    Here is how Personal Scanning happens, they choose the DIR to scan aka for network drives or addition usb's

    Now here is where they choose a drive if the user is not that smart,

    Here is the listview i was talking about, i want the app to read the object and know what DIR to look for




    and yes i'm making a light wieght virus remover so far when the user issues a scan it run's this code:
    Code:
      If txt_path.TextLength <= 0 Then
                MsgBox("Please Select a Drive to Scan!", MsgBoxStyle.Exclamation)
            Else
                On Error Resume Next
                'Deff database
                Dim autoprotect As Boolean
                Dim winsurf78 As Boolean
                Dim Genautorun As Boolean
                Dim Genautorun2 As Boolean
                Dim sscvihost2 As Boolean
                Dim blastclnnn As Boolean
                winsurf78 = My.Computer.FileSystem.DirectoryExists(txt_path.Text & "Autorun")
                autoprotect = My.Computer.FileSystem.DirectoryExists(txt_path.Text & "Autoprotect")
                Genautorun = My.Computer.FileSystem.FileExists(txt_path.Text & "Autorun.inf")
                Genautorun2 = My.Computer.FileSystem.FileExists(txt_path.Text & "Autorun.ini")
                sscvihost2 = My.Computer.FileSystem.FileExists(txt_path.Text & "SSCVIHOST.exe")
                blastclnnn = My.Computer.FileSystem.FileExists(txt_path.Text & "blastclnnn.exe")
                'Killing Virus Processes thread
                Dim Virus1() As Process
                Virus1 = Process.GetProcessesByName("DrvMonitor")
                For Each proc As Process In Virus1
                    Virus.threat_table.Items.Add("VIRUS FOUND!, Virus: " & proc.ProcessName)
                    proc.Kill()
                Next
                Dim Virus2() As Process
                Virus2 = Process.GetProcessesByName("sscvihost")
                For Each proc As Process In Virus2
                    Virus.threat_table.Items.Add("VIRUS FOUND!, Virus: " & proc.ProcessName)
                    proc.Kill()
                Next
                Dim Virus3() As Process
                Virus3 = Process.GetProcessesByName("blastclnnn")
                For Each proc As Process In Virus3
                    Virus.threat_table.Items.Add("VIRUS FOUND!, Virus: " & proc.ProcessName)
                    proc.Kill()
                Next
                On Error Resume Next
    
                'General Threat Files NON-Background runners
                If winsurf78 = True Then
                    My.Computer.FileSystem.DeleteDirectory(txt_path.Text & "Autorun", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                    Virus.threat_table.Items.Add("Virus Winsurf78 Client Files Erased! at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("Virus Winsurf78 Located at: " & txt_path.Text & "Autorun")
                End If
    
                If autoprotect = True Then
                    My.Computer.FileSystem.DeleteDirectory(txt_path.Text & "Autoprotect", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                    Virus.threat_table.Items.Add("Virus Winsurf78 Host Files Erased! at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("Virus Winsurf78 Located at: " & txt_path.Text & "Autoprotect")
                End If
    
                If Genautorun = True Then
                    My.Computer.FileSystem.DeleteFile(txt_path.Text & "Autorun.inf", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                    Virus.threat_table.Items.Add("Virus Gen.Autorun.inf Client File Erased! at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("Virus Gen.Autorun.inf Located at: " & txt_path.Text & "Autorun.inf")
                End If
    
                If Genautorun2 = True Then
                    My.Computer.FileSystem.DeleteFile(txt_path.Text & "Autorun.ini", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                    Virus.threat_table.Items.Add("Virus Gen.Autorun.ini Client File Erased! at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("Virus Gen.Autorun.ini Located at: " & txt_path.Text & "Autorun.ini")
                End If
                If sscvihost2 = True Then
                    My.Computer.FileSystem.DeleteFile(txt_path.Text & "SSCVIHOST.exe", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                    Virus.threat_table.Items.Add("Virus W32/Sohana.w Client File Erased! at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("Virus W32/Sohana.w Located at: " & txt_path.Text & "SSCVIHOST.exe")
                End If
                If blastclnnn = True Then
                    My.Computer.FileSystem.DeleteFile(txt_path.Text & "blastclnnn.exe", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
                    Virus.threat_table.Items.Add("Virus W32/blastclnnn.w Client File Erased! at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("Virus W32/blastclnnn.w Located at: " & txt_path.Text & "blastclnnn.exe")
                End If
    
                'end events
                If winsurf78 = False And autoprotect = False And Genautorun = False And sscvihost2 = False And blastclnnn = False Then
                    MsgBox("Scan Finished, No USB Viral Threats were Located. Loading Scan Results..", MsgBoxStyle.Information)
    
                    Virus.threat_table.Items.Add("Scan Run at: " & DateAndTime.Now)
                    Virus.virus_dir.Items.Add("No USB Viruses Were Located On: " & txt_path.Text)
                    Virus.Label1.Text = "No USB Viruses Found."
                    Virus.Text = "No USB Viruses Found."
                    Virus.ShowDialog()
                Else
                    MsgBox("Scan Finished, One or More USB Viral Threats were Located. The Log File Will Be Displayed now.", MsgBoxStyle.Exclamation)
                    Virus.Label1.Text = "One or More USB Viruses Found."
                    Virus.Text = "One or More USB Viruses Found."
                    Virus.ShowDialog()
                End If
    
            End If
    so as you can see i have to enter items for it to kill on a time by time basis and include it in the base code unless i get some listview grid table up so i can just add it like that then send out the program again, Ego easer for me and my employer.

    cheers in advance

    -Jared
    URGAME Hardware Reviews

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: ListView Help?

    The ListView has its items in an object collection - Items(). Therefore, you can use a loop to get each row one by one.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  4. #3
    MXTECH is offline Learning Programmer
    Join Date
    Jan 2008
    Posts
    46
    Rep Power
    15

    Re: ListView Help?

    Could you write an example?

  5. #4
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: ListView Help?

    Code:
    ForEach (item As ListViewItem) In Virus.threat_table.Items
    ...
    Loop
    Something like that?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Listview Help?????
    By jbnonn in forum C# Programming
    Replies: 3
    Last Post: 01-30-2011, 02:17 PM
  2. can fix it about listview
    By kiddies in forum Visual Basic Programming
    Replies: 2
    Last Post: 06-22-2010, 03:57 AM
  3. Help Using Listview
    By edge02 in forum Visual Basic Programming
    Replies: 2
    Last Post: 04-04-2010, 12:58 AM
  4. Selecting Row from Listview
    By Darkco in forum C# Programming
    Replies: 1
    Last Post: 01-12-2010, 12:57 PM
  5. listview
    By Siten0308 in forum C# Programming
    Replies: 13
    Last Post: 12-12-2008, 09:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts