Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Faster way loading lists

Well decided to drop this, since this is a much faster way loading lists into list of strings rather than loading into listbox.

So, after public class form add
Code
Dim list As New List(Of String)

To load items into list,
Code
Using FD As New OpenFileDialog()
FD.Title = "Load a text file"
FD.Filter = "Text Files (*.TXT;)|*.TXT|All files (*.*)|*.*" If FD.ShowDialog = Windows.Forms.DialogResult.OK Then
list.AddRange(IO.File.ReadAllLines(FD.FileName))
End If
End Using

To clear just simply do
Code
list.clear

The other functions work like that too like (add, addrange, etc..).

Well not sure if I'm not missing anything tho, that's mostly for just loading and clearing the list.
(Dec 13, 2014 08:34 PM)Razοr Wrote:  You also might want to multithread the loop for greater speed.
You should get the best results with a multi-threaded streamreader.

it can go even faster lmao ? :D Well this is fast enough for me really, thanks to those C# open source crackers out there.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by TunabishJun 17, 2018 10:20 PM 3 111 Jun 17, 2018 10:20 PM
Last Post: arvustpremium
[.NET] by MoenJul 1, 2011 10:39 AM 10 133 Jul 1, 2011 10:39 AM
Last Post: tflo