VB.NET编程实现
Public Class Form1
'声明一个包含6个元素的字符串数组Student
Dim Student(5) As String
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'对数组元素赋值
Dim i As Integer
Student(0) = "张三"
Student(1) = "王刚"
Student(2) = "李想"
Student(3) = "李华"
Student(4) = "陈晨" : Student(5) = "钱进"
'在文本框中进行分行显示,每个元素占一行。vbCrLf:回车换行
For i = 0 To 5
TextBox1.Text &= Student(i) & vbCrLf
Next
End Sub
Private Sub btnSort_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSort.Click
'对数组进行排序
Dim a As String
Array.Sort(Student)
'在文本框中显示排序后的元素
For Each a In Student
TextBox2.Text &= a & vbCrLf
Next
End Sub
End Class
排序vb.net教程前

排序后






![战神引擎传奇手游【1.76盛战传奇免授权版[摸摸登陆器]】最新整理Win系复古服务端+安卓苹果双端+GM授权物品后台+详细搭建教程](https://cdn.jxasp.com:9143/image/20251106/1B4E8594B3BEB90E8601D63A8A39CB0B.jpg)













