Structure AuthenticationRecord Dim UserID As String Dim UserPW As String Dim AuthLevel As String Dim TS As Date End Structure Dim AuthenticationDataCache As List(Of AuthenticationRecord) Private Sub Test() Dim AR As AuthenticationRecord AR.UserID = "TestUserName1" AR.UserPW = "TestPW1" AR.AuthLevel = "3" AR.TS = Now.AddMilliseconds(-1000) AuthenticationDataCache.Add(AR) AR.UserID = "TestUserName1" AR.UserPW = "TestPW1" AR.AuthLevel = "-1" AR.TS = Now() AuthenticationDataCache.Add(AR) 'Here is where I get stuck.... 'My need is to retrieve the newest Record in the collection (as defined by TS). In the above 'example, the record with AuthLevel = -1 is most recent (based on TS) 'I either need a LINQ Query to do this, or to sort the contents of the collection 'with the most recent TS record item towards the top, then I would iterate through the collection 'from the beginning to find the first occuring UserID I was looking for. End Sub
|Protecting vb6 & .Net code Obfuscation||18||93|
|Getfiles in vb.net||28||42|
|Duplicating a tab page content to another in TabControl control||11||40|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
23 Experts available now in Live!