开发者

Sorting array warning when migrating to .NET 3.5

开发者 https://www.devze.com 2023-03-28 04:43 出处:网络
I\'ve just converted my VB.NET application from .NET 1.1 to 3开发者_开发技巧.5, and I\'m getting the warning message

I've just converted my VB.NET application from .NET 1.1 to 3开发者_开发技巧.5, and I'm getting the warning message

Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

in

Private Function reOrderArray(ByVal arr() As String) As String
   arr.Sort(arr) 'Sort array alphabetically
   'More code...
   return arr
End Function

for the words arr.Sort on the second line.

What is causing this?


Array.Sort is a static/shared method, and should be invoked appropriately:

Array.Sort(arr)
0

精彩评论

暂无评论...
验证码 换一张
取 消