C# 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;///读取
C# winform写入和读取TXT文件的更多相关文章
- winform 写入和读取TXT文件
C# winform写入和读取TXT文件 string str; str=this.textBox1.Text; StreamWriter sw = new StreamWriter(Applicat ...
- 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 ...
随机推荐
- 潭州课堂25班:Ph201805201 并发(非阻塞,epoll) 第十课 (课堂笔记)
# -*- coding: utf-8 -*- # 斌彬电脑 # @Time : 2018/7/12 0012 20:29 import socket server = socket.socket() ...
- SpringMVC页面传值
public ModelAndView query(){ ModelAndView modelAndView = new ModelAndView(); List list = new ArrayLi ...
- 我的git笔记
转眼间加入git的阵营已经快两年了,结识git,缘起github,2年前在寻找代码托管网站,当时还是用svn,起初使用google code,可是google的服务虽好,在天朝你懂得,后来发现了git ...
- Hadoop学习博客
http://zy19982004.iteye.com/blog/monthblog_more
- 查询当前Oracle数据库的实例
select name from v$database; select instance_name from v$instance; // 查看实例状态 >select instance_nam ...
- 微软BI 之SSIS 系列 - XML Task 中XSLT 样式表转换错误记录
开篇介绍 此文章专门记录 XSLT 样式表转换过程中的语法问题 错误一 值与属性的倒置 修改了几次样式表,但还是一如既往的报错,报错信息如下: [XML Task] Error: An error o ...
- 常用CTPN、CRNN文本检测识别框架
一.SWT识别: yestinsong/Text-Detection( Text Detection System with MSER , SWT and Text Verification(fft ...
- Certificate Formats | Converting Certificates between different Formats
Different Platforms & Devices requires SSL certificates in different formatseg:- A Windows Serve ...
- IPV4地址分类
IPV4地址的分类 私网地址: 10.0.0.0/8 //A类地址 172.16.0.0/16-172.31.0.0/16 ...
- Visual Studio 统计代码行数
介绍一种简单的统计代码行数的小技巧, 使用正则表达式,用VS强大的查找功能 b[^:b#/]+.$ 最后结果: