枚举组合类型 ( 积分: 100 )

  • 主题发起人 主题发起人 squarevictory
  • 开始时间 开始时间
。。。AVALON兄 你是实时盯着帖子的?这么快就回复了,我下班了,方便留个联系方式吗,有空吹水
 
这2天闲一些 呵呵
xukehg@yeah.net
 
ok! 解决问题,结贴,并附上C#的代码。
<%@ Page Language=&quot;C#&quot;
AutoEventWireup=&quot;true&quot;
CodeFile=&quot;Default.aspx.cs&quot;
Inherits=&quot;tmp_Default&quot;
%>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
<html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
>
<head runat=&quot;server&quot;>
<title>无标题页</title>
</head>
<body>
<form id=&quot;form1&quot;
runat=&quot;server&quot;>
<div>
<asp:TextBox ID=&quot;TextBox1&quot;
runat=&quot;server&quot;
Width=&quot;528px&quot;>13,5,678,9,01</asp:TextBox>&amp;nbsp;<br />
<asp:TextBox ID=&quot;TextBox2&quot;
runat=&quot;server&quot;
Height=&quot;300px&quot;
TextMode=&quot;MultiLine&quot;
Width=&quot;647px&quot;></asp:TextBox><br />
<asp:Button ID=&quot;Button1&quot;
runat=&quot;server&quot;
OnClick=&quot;Button1_Click&quot;
Text=&quot;Button&quot;
/>
</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, &quot;&quot;);
}
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 += &quot;;&quot;;
}
}
}
}
 
后退
顶部