c#保存textbox中的字符串到txt文件中
/********************** 保存接收按钮 *****************************/
private void SavetxData_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "(*.txt)|*.txt|(*.*)|*.*";
saveFileDialog.FileName = "文件" + DateTime.Now.ToString("yyyyMMddHHmm") + ".txt";
//将日期时间作为文件名
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
StreamWriter streamWriter = new StreamWriter(saveFileDialog.FileName, true);
streamWriter.Write(this.rxtextBox.Text);
streamWriter.Close();
}
}
“c#保存textbox中的字符串到txt文件中” 的相关文章
UDP"打洞"原理 1. NAT分类根据Stun协议(RFC3489),NAT大致分为下面四类1) Full Cone这种NAT内部的机器...
一、各种旋转、改变大小 注意:先要添加画图相关的using引用。 //向右旋转图像90°代码如下: private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {...
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Drawing; using System.Drawing.Drawing2D; usin...
1.工具类代码 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Windows...
1、委托 两个窗体,窗体很简单,只实现改变颜色功能,一看就会: 代码如下,只贴按钮事件代码: 打开Form2按钮事件 private void button1_Click(object s...
以下代码是程序入口文件 using DDS_Form1; using System; using System.Collections.Generic; using System.IO; //using System.Linq; using System.Windows.Forms;...