编写程序,将输入的字符串加密后并在屏幕上将加密的结果显示出来,加密的方法是将输入的字符的unicode码值加4,所得到的unicode码值的代码的字符就是加密后的字符,,
为什么我的结果最后都会带着 @fvB 前面结果是对的,,这这这这这这是乍了啊
<%@Page language="c#"%>
<script language="C#" runat="server">
void WriteInfo(object serder, EventArgs e)
{ string strtemp1,strtemp2;
int i,tmp;
char[] mychar;
strtemp1 = content.Text +"<br>";
mychar=strtemp1.ToCharArray();
strtemp2 = "";
for (i = 0; i < strtemp1.Length; i++)
{
tmp = Convert.ToInt32(mychar[i]) + 4;
mychar[i] = Convert.ToChar(tmp);
strtemp2 += mychar[i];
}
labContent1.Text+= "加密前:" + strtemp1 + "<br>";
labContent1.Text += "加密后:" + "<font color=red>"+ strtemp2+ "</font>"+ "<br/><br/>";
}
</script>
<html>
<body>
<form runat="server">
<asp:TextBox runat="server" ID="content" Columns="20" Rows="4" TextMode="multiline" Wrap="true" /><br />
<input type="reset" runat="server" id="reset" value="重置" /> <br />
<asp:Button runat="server" ID="lnksubmi" Text="提交" OnClick="WriteInfo" /><br /><br />
<asp:label runat="server" id="labContent1" /> </form>
</body>
</html>