Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9152993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:11:09+00:00 2026-06-17T12:11:09+00:00

My software is designed to encrypt and decrypt files. The user loads the files

  • 0

My software is designed to encrypt and decrypt files. The user loads the files to be processed into a ListView control. In the control, each item is the file path with one subitem, the type of process (ENCRYPT or DECRYPT).

I need to get a list of all ITEMS (the file paths) that have the “ENCRYPT” subitem, preferably with LINQ. Currently, my code looks like this:

Dim enclist As New ArrayList()
For i As Int32 = 0 To (lvwLoad.Items.Count - 1)
    If lvwLoad.Items(i).SubItems(1).Text = "ENCRYPT" Then
        enclist.Add(lvwLoad.Items.Item(i).Text)
        count += 1
    End If
Next

I tried this:

Dim list As IEnumerable(Of String) = From item In lvwLoad.Items 
                                     Where item.SubItems(1).Text = "ENCRYPT"

But this statement can’t access the SubItems() array. I know there’s probably something simple I’m missing, but I can’t figure it out.

EDIT:
I know I can do this:

Dim enclist As New List(Of String)
For Each item As ListViewItem In lvwLoad.Items
    If item.SubItems(1).Text = "ENCRYPT" Then
        enclist.Add(item.Text)
    End If
Next

But I really want to know how to do this with LINQ.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:11:10+00:00Added an answer on June 17, 2026 at 12:11 pm

    Try code below, you need to cast items to ListViewItem so that you can access SubItems

    Dim list  = From item In lvwLoad.Items.Cast(Of ListViewItem) () _ 
                                         Where item.SubItems(1).Text = "ENCRYPT" 
                                         Select item.Text
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A software is producing UTF-8 files, but writing content to the file that isn't
I have designed a user interface for my computational software using swing (Java). I
I have designed a file copy software in python with GUI in Wxpython .
I always designed/developed/released a software or web project myself/independent activity using java/vb.net and php
In early phases of software development projects the conceptual data model is designed. In
In some software company, who should be responsible for the UI design: User Designer
I wrote a bunch of jQuery files to manipulate my software. My software is
I am trying to build a software library cvBlobs which is designed to help
We have just purchased some software that provides an API into our phone system
The Personal Software Process (PSP) is designed to allow software engineers to understand and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.