using System;
using System.IO;
using System.Text; namespace 字符串存入记事本
{
class Program
{
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder();
for (int i = ; i < ; i++)
{
sb.AppendLine("简单创建一个有很多文字内容的记事本");
}
string str=sb.ToString(); string filePath = "d:\\截止"+ DateTime.Now.ToString("yyyy-MM-dd") + "7天没有采集到的模块.txt";
FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
fs.SetLength();//首先把文件清空了。
sw.Write(str);//写你的字符串。
sw.Close();
Console.WriteLine("已经结束");
/////////////////////以下是运行这个文件/////////////////////////
//Process p = new Process();
//p.StartInfo.FileName = filePath;
//p.Start();
Console.ReadKey();
}
}
}

最新文章

  1. MySQL:Fabric 安装
  2. PHP自带防SQL攻击函数区别
  3. irc操作小记
  4. Android之源码之模块编译和调试
  5. 在CentOS下利用Eclipse调试FFmpeg
  6. Storm系列之二——Guaranteeing Message Processing
  7. NGUI Tutorial 3
  8. PHP内置函数
  9. C#日期时间格式化
  10. js 中&amp;&amp; 与 ||
  11. The hacker&#39;s sanbox游戏
  12. Python之常用模块(待更新)
  13. [Android学习笔记]LayoutParams的使用
  14. win10下安装python2与python3以及pip共存
  15. 201521044091《Java程序设计》第7周学习总结
  16. github搭建个人网站
  17. python 字符串 切片
  18. 美团codeM预赛A轮 倒水
  19. 【Spark】榨干Spark性能-driver、exector内存突破256M
  20. Zookeeper笔记之quota

热门文章

  1. linux的关机
  2. WindowImplBase::OnSysCommand-------duilib在最大化和还原间切换
  3. stm32 DMA+timer+DAC
  4. 洛谷 P4013 数字梯形问题
  5. PatentTips - Multi-host SATA Controller
  6. [ES7] Convert Any Function into an Asynchronous Function
  7. 【转】request和response的页面跳转
  8. iptables 重启系统生效
  9. 微信小程序从零开始开发步骤(二)
  10. html5常用标签table表格布局