protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string str = "1981年10-10", format = "", result = "";
for (int i=0; i < str.Length; i++)
{
format = str.Substring(i, 1);
result += switchstr(format);
}
Response.Write(result);
}
}
string switchstr(string str)
{
string result = str;
switch (str)
{
case "0":
result = "O"; break;
case "1":
result = "一"; break;
case "2":
result = "二"; break;
case "3":
result = "三"; break;
case "4":
result = "四"; break;
case "5":
result = "五"; break;
case "6":
result = "六"; break;
case "7":
result = "七"; break;
case "8":
result = "八"; break;
case "9":
result = "九"; break;
}
return result;
}
{
if (!IsPostBack)
{
string str = "1981年10-10", format = "", result = "";
for (int i=0; i < str.Length; i++)
{
format = str.Substring(i, 1);
result += switchstr(format);
}
Response.Write(result);
}
}
string switchstr(string str)
{
string result = str;
switch (str)
{
case "0":
result = "O"; break;
case "1":
result = "一"; break;
case "2":
result = "二"; break;
case "3":
result = "三"; break;
case "4":
result = "四"; break;
case "5":
result = "五"; break;
case "6":
result = "六"; break;
case "7":
result = "七"; break;
case "8":
result = "八"; break;
case "9":
result = "九"; break;
}
return result;
}