winform 写入和读取TXT文件
C# winform写入和读取TXT文件
string str;
str=this.textBox1.Text;
StreamWriter sw = new StreamWriter(Application.StartupPath +"\\txtwriter.txt", false);
sw.WriteLine(str);
sw.Close();//写入
string str;
StreamReader sr = new StreamReader(Application.StartupPath +"\\txtreader.txt", false);
str = sr.ReadLine().ToString();
sr.Close();
this.textBox1.Text = str;///读取
winform 写入和读取TXT文件的更多相关文章
- C# winform写入和读取TXT文件
C# winform写入和读取TXT文件 string str; str=this.textBox1.Text; StreamWriter sw = new ...
- java的bio和nio写入及读取txt文件
一.bio的写入及读取 1.采用bio之BufferedWriter 写入文件 public static void main(String[] args) throws IOException { ...
- Javascript写入txt和读取txt文件的方法
文章主要介绍了Javascript写入txt和读取txt文件的方法,需要的朋友可以参考下1. 写入 FileSystemObject可以将文件翻译成文件流. 第一步: 例: 复制代码 代码如下: Va ...
- JAVA读取TXT文件、新建TXT文件、写入TXT文件
1.创建TXT文件 按照正常的逻辑写就好 先定义一个文件给定一个路径——>判断这个路径上这个文件存不存在——>若不存在则建立,try/catch根据程序提示自动生成就好 2.读取TXT文件 ...
- winform 读取TXT文件 放在Label中 分类: WinForm 2014-07-31 09:56 310人阅读 评论(0) 收藏
<span style="font-family: Arial, Helvetica, sans-serif;">#region 读取TXT 文件,放到Label中&l ...
- 用C#读取txt文件的方法
1.使用FileStream读写文件 文件头: using System;using System.Collections.Generic;using System.Text;using System ...
- C#生成PDF文档,读取TXT文件内容
using System.IO;using iTextSharp.text;using iTextSharp.text.pdf; //需要在项目里引用ICSharpCode.SharpZipLib.d ...
- PHP读取txt文件到数组
$file_path = "test.txt"; if(file_exists($file_path)){ $file_arr = file($file_path); for($i ...
- 用C#读取txt文件的方法(转)
.使用FileStream读写文件 文件头: using System; using System.Collections.Generic; using System.Text; using Syst ...
随机推荐
- PyCharm 通过Github和Git上管理代码
1.最近希望通过github来管理代码,记录下pycharm上的设置,以下是针对windows版本.mac版本略有却别 如图所示 file-settings-Version Control-GitHu ...
- Oracle递归查询(start with…connect by prior)
查询基本结构: select … from table_name start with 条件1 connect by 条件2 1.建测试用表 create table test ...
- UGUI Slider的onValueChanged事件
在本文,你将学到如何将UGUI Slider的onValueChanged事件进行统一管理. using System; using UnityEngine; using UnityEngine.UI ...
- linux操作python
Linux安装python3: sudo apt-get install python3.5 安装python库 sudo apt-get install python3-setuptools sud ...
- centos安装postgresql-rpm
rpm -ivh pgdg-centos93-9.3-3.noarch.rpm确认,回车,
- org.elasticsearch.search.sort.SortBuilder使用
org.elasticsearch.search.sort.SortBuilder是一个抽象类,有4个子类 org.elasticsearch.search.sort.FieldSortBuilder ...
- Delphi对话框初始地址InitialDir
我的电脑:SaveDialog1.InitialDir := '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}';// My Computer {20D04FE0-3 ...
- MySQL备份和还原数据
MySQL备份和还原数据 导出整个数据库 mysqldump -uroot -p database_name > db_backup.sql 导入整个数据库 mysql -uroot -p da ...
- axios的兼容性
axios的兼容性处理 一.简介 看看官网的简介: “Promise based HTTP client for the browser and node.js” 译:基于 Promise 的 H ...
- list-iscroll5.2
简介 iScroll是一个高性能,资源占用少,无依赖,多平台的JavaScript滚动插件. 它可以在桌面,移动设备和智能电视平台上工作.它一直在大力优化性能和文件大小以便在新旧设备上提供最顺畅的体验 ...