我想创建个TXT文件,我想改写这个TXT文件,我想保存为其他后缀的文件 如题,先创建一个TXT文件。再用代码,给这个文件输入内容。最后保存为别的后缀名?这该怎么写?用什么控件?希望详细点,本人某种意义上C#文件方面的小白 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str = "Hello World!";System.IO.File.WriteAllText(@"C:\1.abc",str); public void WriteLog(string val) { string filepath = string.Format(@"{0}Input\log.Dat", AppDomain.CurrentDomain.SetupInformation.ApplicationBase); using (StreamWriter sw = File.AppendText(filepath)) { sw.WriteLine(val); } } 关于.NET中的资源文件 新手请教C#线程问题 c#怎么启动和停止windows服务 在visual studio 2008中有什么快捷的办法可以自动生成无参构造函数? 读取数据问题! 安装visual stadio 2008 失败 一个菜问题! 请求解答 异步socket和序列化的问题 怎样对DataGrid里的复选框进行修改啊? WPF,TextBox为什么无光标 谁有vs 2012 64位的,提供一下下载地址 调用surfer 8.0 有错误
System.IO.File.WriteAllText(@"C:\1.abc",str);
{
string filepath = string.Format(@"{0}Input\log.Dat", AppDomain.CurrentDomain.SetupInformation.ApplicationBase); using (StreamWriter sw = File.AppendText(filepath))
{
sw.WriteLine(val);
}
}