Console程序:
string str=Console.ReadLine();
Console.WriteLine(str);
Winfrom:
string str=this.textbox1.Text;
MessageBox.Show(str);
ASP.NET:
昵称:<asp:TextBox ID="txtUsername" runat="server" TextMode="SingleLine"></asp:TextBox><br />
密码:<asp:TextBox ID="txtUserpass" runat="server" TextMode="Password"></asp:TextBox><br />
备注:<asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine"></asp:TextBox><br />
<asp:Button ID="btnSubmit" runat="server" Text="提交" onclick="btnSubmit_Click" /><br />
<hr />
提交结果为:<asp:Label ID="lblState" runat="server"></asp:Label><br />
<asp:Label ID="lblState2" runat="server"></asp:Label>
后台:
//方法一、7a64e4b893e5b19e31333337383865采用字符串拼加"+"
lblState.Text = txtUsername.Text +","+ txtUserpass.Text +","+ txtRemark.Text ;
//方法二、才用制格符
lblState2.Text = string.Format("{0},{1},{2}",txtUsername.Text,txtUserpass.Text,txtRemark.Text);