aspx
<asp:TextBox ID="TextBox1" runat="server" Rows="10" style="margin-bottom: 0px"
TextMode="MultiLine">1,2,3,4</asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
cs
protected void Button1_Click(object sender, EventArgs e)
{
//string a = "a,b,c,d";
//string b = "1,2,3,4";
//string[] arr1 = a.split(','); //将字符串转换成数组arr1
//string[] arrtemp = b.split(',');
//int[] arr2 = new int[arrtemp.length]; //用来存放将字符串转换成int[]
//for (int i = 0; i < arrtemp.length; i++)
//{
// arr2[i] = int.parse(arrtemp[i]);
//}
string str = this.TextBox1.Text;
string[] arr = str.Split(',');
for (int i = 0; i < arr.Length; i++) {
Response.Write(arr[i]+"<br>");
}
Response.Write(str);
Response.End();
}