txt文档在.net中的操作
来源:互联网 发布:九阴真经最新辅助软件 编辑:程序博客网 时间:2024/04/28 07:00
读取的方法帮在页面的标题
public void bingtitle()
{
string path =Server.MapPath("~//App_Data//title.Txt"); //路径
System.IO.StreamReader reader = new System.IO.StreamReader(path, System.Text.Encoding.Default);
string str= reader.ReadLine();
this.Header.Title = str.ToString();
reader.Close();
}
//修改的方法
protected void bto_Edit_Click(object sender, EventArgs e)
{
string title=txt_title.Text.ToString().Trim();
string path = Server.MapPath("~//App_Data//title.Txt");
System.IO.StreamReader reader = new System.IO.StreamReader(path, System.Text.Encoding.Default);
string str = reader.ReadLine();
reader.Close();
string s = str.Replace(str, title);
System.IO.StreamWriter sw = new System.IO.StreamWriter(path, false, System.Text.Encoding.Default);
sw.WriteLine(s);
sw.Close();
Response.Write("<script>alert('修改成功!')</script>");
}
- txt文档在.net中的操作
- txt文档在.net中的操作
- VC操作txt文档
- C#加载doc文档中的表格与txt文档中的数据然后进行操作
- .Net C# Txt文本文件操作
- 文件操作C语言 在txt文档中写入hello字符
- asp.net 实现txt文档下载功能!
- 编辑 edit box中的文字并保存在txt文档中会有奇怪的现象
- txt文档操作(导出和导入)
- DataGridView在vb.net中的操作技巧
- DataGridView在vb.net中的操作技巧
- DataGridView在vb.net中的操作
- DataGridView在vb.net中的操作技巧
- NPOI在.net中的操作Excel
- DataGridView在vb.net中的操作技巧
- DataGridView在vb.net中的操作技巧
- DataGridView在vb.net中的操作技巧
- 【MongoDB学习-在.NET中的简单操作】
- 查询某段时间内 每一天的最高记录和最低记录
- 类斐波那契问题....
- 如何做网站推广?如何提高网站浏览量?
- ASP.NET抓取其他网页代码
- C#中的多线程编程
- txt文档在.net中的操作
- 使模块可以添加参数
- 通过Url抓取网页内容
- 对线程控制 中 Sleep(0),和 Sleep(1)的 //对相关转帖的理解
- Android 情景模式
- txt文档在.net中的操作
- WinCE5.0 Platform builder 中实现中文手写 [WINCE 学习笔记]
- linux 下的多线程编程
- 取掉Html样式.txt