ok! 解决问题,结贴,并附上C#的代码。
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="tmp_Default"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:TextBox ID="TextBox1"
runat="server"
Width="528px">13,5,678,9,01</asp:TextBox>&nbsp;<br />
<asp:TextBox ID="TextBox2"
runat="server"
Height="300px"
TextMode="MultiLine"
Width="647px"></asp:TextBox><br />
<asp:Button ID="Button1"
runat="server"
OnClick="Button1_Click"
Text="Button"
/>
</div>
</form>
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class tmp_Default : System.Web.UI.Page
{
string[] arrNum;
protected void Button1_Click(object sender, EventArgs e)
{
arrNum = TextBox1.Text.Split(',');
showType(arrNum[0], 0, ""
;
}
private void showType(string Num, int level, string output)
{
int i;
for (i = 0;
i <= Num.Length-1;
i++)
{
if (level < arrNum.Length-1)
{
showType(arrNum[level + 1], level + 1, output + Num
);
}
else
{
TextBox2.Text += output + Num;
TextBox2.Text += ";";
}
}
}
}