static void GetAllFiles()
{
string path = "filepath";
var allFiles = Directory.GetFiles(path);
string fileName = "file.txt"; using (FileStream fStream = File.Create(fileName))
{ } using (FileStream fStream = File.Create("file.txt"))
{
using (StreamWriter writer = new StreamWriter(fStream, Encoding.UTF8))
{
foreach (var file in allFiles)
{
writer.WriteLine(file);
}
}
}
}

C# get files and write the files full name in txt的更多相关文章

  1. Advanced Installer读取注册表时将Program Files读取为Program Files (x86)的解决办法

    原文:Advanced Installer读取注册表时将Program Files读取为Program Files (x86)的解决办法 今天同事在做安装包的时候,有一个读取注册表路径的需求,需要根据 ...

  2. [TypeScript] Configuring TypeScript Which Files to Compile with "Files" and "OutDir"

    This lesson shows how to configure the .tsconfig so you only compile the .ts files you want. It then ...

  3. high-level operations on files and collections of files

    11.10. shutil — High-level file operations — Python 3.6.5 documentation https://docs.python.org/3/li ...

  4. How do I list the files in a directory?

    原文地址:How do I list the files in a directory? You want a list of all the files, or all the files matc ...

  5. linux文件描述符open file descriptors与open files的区别

    一个文件被打开,也可能没有文件描述符,比如current working diretories,memory mapped files and executable text files ;losf可 ...

  6. How to configure Veritas NetBackup (tm) to write Unified and Legacy log files to a different directory

    Problem DOCUMENTATION: How to configure Veritas NetBackup (tm) to write Unified and Legacy log files ...

  7. Embed dll Files Within an exe (C# WinForms)—Winform 集成零散dll进exe的方法

    A while back I was working on a small C# WinForms application in Visual Studio 2008. For the sake of ...

  8. TN035: Using Multiple Resource Files and Header Files with Visual C++

    TN035: Using Multiple Resource Files and Header Files with Visual C++ This note describes how the Vi ...

  9. Untracked files不想add

    $ git status On branch feature/20160420_complain_630222 Untracked files: (use "git add <file ...

随机推荐

  1. android屏幕监视工具 android screen monitor使用

    android screen monitor是一个非常好用的手机屏幕监视工具,可以将你的手机界面动态的显示出来,可用于项目演示. 这个工具就是其实一个jar文件,不到300KB大小,依赖jdk,并且还 ...

  2. cocoscreator查找节点的方法 (跟jquery find一样)

    var each = function(object, callback) { var type = (function() { switch (object.constructor) { case ...

  3. Map 集合 和 String 字符串相互转换工具类

    package com.skynet.rimp.common.utils.util; import java.util.Arrays; import java.util.HashMap; import ...

  4. PHP ThinkPHP 非常好用的增删改查方法

    获取列表数据(多条) /*** 获取页面列表* @param $params //查询条件 例:['id'=>['in','1,2']] ['status'=>1]* @param arr ...

  5. [CrackMe]160个CrackMe之015

    吾爱破解专题汇总:[反汇编练习]160个CrackME索引目录1~160建议收藏备用 一.破解 该破解比较简单,其是一个静态密码  2G83G35Hs2 ,输入进去即可破解. 1)栈定位法找到用户代码 ...

  6. 本地SQL Server数据库提示网络问题无法连接

    运行程序时发现本地SQLserver数据库无法连接,提示信息为:在与SQL Server 建立连接时出现与网络相关的或特定与实例的错误.未能找到或无法访问服务器.请验证实例名称是否正确并且SQL Se ...

  7. SQLi-LABS Page-1(Basic Challenges) Less11-Less22

    Less-11 GET - Blind - Time based - double quotes http://10.10.202.112/sqli/Less-11/ 尝试登录: username:a ...

  8. 解决Python3.6.5+Django2.0集成xadmin后台点击添加或者内容详情报 list index out of range 的错误

    一 问题说明在创建Model的时候,如果存在类型是DateTimeField的字段,则在xadmin后端管理界面里,对该Model进行添加操作的时候,会报list index out of range ...

  9. Centos7 下安装python3及卸载

    一.安装python3 1.安装依赖包 yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel read ...

  10. MySQL 优化 (四)

    参数优化 innodb_log_buffer_size 此参数确定些日志文件所用的内存大小,以M为单位.缓冲区更大能提高性能,对于较大的事务,可以增大缓存大小. innodb_log_buffer_s ...