作者ithinkurdumb (Let's Go YANKEES!)
看板C_Sharp
标题Re: [问题] 请问一个textbox的问题??
时间Sat Dec 4 22:53:30 2004
※ 引述《ccc12011126 (怎麽po文章阿!!)》之铭言:
: : string s = s + text1.Text + text2.Text + text3.Text;
: ~~~
: 会出现s为未指定变数耶!!
改成
string s = null;
s += text1.Text + ...;
: : textAll.Text = s;
: : 这样s就会保留之前的内容。
: 我是想在TxetAll里面,全部秀出我所输入的每笔资料
: 因为我要存成.txt档
你要在textAll里面show出每个资料不需要存成text file啊.
不过如要要存成text file的话...
StreamWriter sw1 = new StreamWriter("text.txt");
sw1.WriteLine(text1.Text);
sw1.WriteLine(text2.Text);
sw1.WriteLine(text3.Text);
sw1.Close();
详细的用法和StreamReader的用法MSDN上都有.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.166.81.140