1
2
3
4
5
|
string
path =
"D:\\log.txt"
;
using
(StreamWriter sw =
new
StreamWriter(path,
true
))
{
sw.Write(
"xxxxxxxxxx"
);
}
|
1
2
3
4
5
6
7
8
9
10
|
if
(
this
.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
string
path =
this
.folderBrowserDialog1.SelectedPath +
@"\xxx.txt"
;
using
(StreamWriter writer =
new
StreamWriter(path))
{
writer.Write(
this
.textBox1.Text);
}
MessageBox.Show(
"写入成功"
);
}
|