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文件的更多相关文章

  1. C# winform写入和读取TXT文件

    C# winform写入和读取TXT文件 string str;            str=this.textBox1.Text;            StreamWriter sw = new ...

  2. java的bio和nio写入及读取txt文件

    一.bio的写入及读取 1.采用bio之BufferedWriter 写入文件 public static void main(String[] args) throws IOException { ...

  3. Javascript写入txt和读取txt文件的方法

    文章主要介绍了Javascript写入txt和读取txt文件的方法,需要的朋友可以参考下1. 写入 FileSystemObject可以将文件翻译成文件流. 第一步: 例: 复制代码 代码如下: Va ...

  4. JAVA读取TXT文件、新建TXT文件、写入TXT文件

    1.创建TXT文件 按照正常的逻辑写就好 先定义一个文件给定一个路径——>判断这个路径上这个文件存不存在——>若不存在则建立,try/catch根据程序提示自动生成就好 2.读取TXT文件 ...

  5. winform 读取TXT文件 放在Label中 分类: WinForm 2014-07-31 09:56 310人阅读 评论(0) 收藏

    <span style="font-family: Arial, Helvetica, sans-serif;">#region 读取TXT 文件,放到Label中&l ...

  6. 用C#读取txt文件的方法

    1.使用FileStream读写文件 文件头: using System;using System.Collections.Generic;using System.Text;using System ...

  7. C#生成PDF文档,读取TXT文件内容

    using System.IO;using iTextSharp.text;using iTextSharp.text.pdf; //需要在项目里引用ICSharpCode.SharpZipLib.d ...

  8. PHP读取txt文件到数组

    $file_path = "test.txt"; if(file_exists($file_path)){ $file_arr = file($file_path); for($i ...

  9. 用C#读取txt文件的方法(转)

    .使用FileStream读写文件 文件头: using System; using System.Collections.Generic; using System.Text; using Syst ...

随机推荐

  1. python定义的一个简单的shell函数的代码

    把写代码过程中经常用到的一些代码段做个记录,如下代码段是关于python定义的一个简单的shell函数的代码. pipe = subprocess.Popen(cmd, stdout=subproce ...

  2. Oracle 行列转换函数pivot、unpivot的使用(二)

    一.行转列pivot 关键函数pivot,其用法如下 pivot(聚合函数 for 列名 in(类型)) select * from table_name pivot(max(column_name) ...

  3. 2.7 Go channel

    channel简单示例 package main import ( "fmt" "time" ) //channel的创建,发送,接收 func channe1 ...

  4. (转)mysql帮助命令使用说明

    https://www.ilanni.com/?p=8157------- 烂泥:mysql帮助命令使用说明

  5. Win7/Vista/Server2008下VS 环境 调试调用 HTTP.SYS 无法启动监听服务及启动后其他机器无法访问端口

    一. VS调试在Win7(vista系列)操作系统下 HttpListener无法绑定多个 指定IP.端口问题 来自:http://www.cnblogs.com/ryhan/p/4195693.ht ...

  6. html锚点(mao dian)--特殊的超链接

    锚点(anchor):其实就是超链接的一种,一种特殊的超链接 普通的超链接,<a href="路径"></a> 是跳转到不同的页面 而锚点,<a hr ...

  7. org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'xxxx' is not present

    org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'xxx ...

  8. 了解下C#异常时的输出

    Sample Code: try { string re = "1.1".Substring(1,4); } catch (Exception ex) { logger.Error ...

  9. 利用canvas制作图片(可缩放和平移)+相框+文字

    前言: 公司一个售前问我能不能用H5做一个手机拍照,给相片添加相框和添加文字上传到服务器的功能,我当时一琢磨觉得可行,就利用空余时间做了一个demo,去掉了拍照和上传,如果以后有机会,会给补上,当然对 ...

  10. Angular4 step by step.3

    1.Routes 路由模块 import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angul ...