troubleshooting Question

VB.Net remove from List

Avatar of Larry Brister
Larry BristerFlag for United States of America asked on
.NET ProgrammingVisual Basic.NETMicrosoft Development
2 Comments1 Solution370 ViewsLast Modified:
In my code below

In the "Else"
For each row if it makes it to the Else
Remove that row from the List

Dim mtList As New List(Of Threading.Thread)

    Private Sub getThreads()
        Dim objThread As System.Threading.Thread
        Dim i As Integer = 1
        For Each objThread In mtList
            If objThread.ThreadState.ToString() <> "Stopped" And Not objThread.Name.Contains("1111111111") Then
                Dim tr As String = objThread.Name.ToString.Replace("]", "").Replace("[", "")
                FileWriteline("C:\temp\threads.txt", "Thread(" + CStr(i) + ") " + "|" + tr.Substring(tr.Length - 10) + "|" + objThread.ThreadState.ToString() + ControlChars.Cr)
                i = i + 1
            Else
                'Remove from List
            End If
        Next
        FileWriteline("C:\temp\threads.txt", "Rows: " & CStr(mtList.Count))
    End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros