C#到VB.NET的列表排序转换

时间:2019-12-30 18:15:11

标签: c# vb.net

对于C#容易回答的问题,VB.NET语法等效于:

wlanBssEntries.Sort(delegate ( Wlan.WlanBssEntry a, Wlan.WlanBssEntry b ) {
                            return sortModifier * string.Compare(ASCIIEncoding.ASCII.GetString(a.dot11Ssid.SSID),
                                ASCIIEncoding.ASCII.GetString(b.dot11Ssid.SSID), StringComparison.InvariantCultureIgnoreCase);
                        });

非常感谢。

1 个答案:

答案 0 :(得分:1)

工作语法为:

wlanBssEntries.Sort(Function(a As wlan.WlanBssEntry, b As wlan.WlanBssEntry) sortModifier * String.Compare(ASCIIEncoding.ASCII.GetString(a.dot11Ssid.SSID), ASCIIEncoding.ASCII.GetString(b.dot11Ssid.SSID), StringComparison.InvariantCultureIgnoreCase))