今天碰到一个 list 乱序问题,解决方案如下
Public Function random_shuffle(ByVal org As List(Of global_seedlink)) As List(Of global_seedlink)
Dim newList As New List(Of global_seedlink)
Try
newList = org.OrderBy(Function(x) x.GetHashCode).Take(org.Count).ToList
Catch ex As Exception
Debug.Print(ex.Message)
End Try
Return newList End Function
原文链接:/vb/261317.html