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. CSV和JSON格式相互转换

    1.为什么要进行CSV与JSON格式之间的转换 CSV格式常用于一二维数据表示和存储,他是一种纯文本形式存储表格数据的表示方式.JSON也可以表示一二维数据.在网络信息传输中,可能需要统一表示方式,因 ...

  2. docker jenkins安装

    https://hub.docker.com/r/jenkins/jenkins jenkins的docker官方镜像地址 https://jenkins.io/ jenkins官方网站 环境: 阿里 ...

  3. Css 设置固定表格头部,内容可滚动

      效果图:

  4. Linux系统:centos7下搭建Nginx和FastDFS文件管理中间件

    本文源码:GitHub·点这里 || GitEE·点这里 一.FastDFS简介 1.基础概念 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件上传 ...

  5. 多线程七 AQS

    一 . 简介AQS AQS简介 在同步组件的实现中,AQS是核心部分,同步组件的实现者,通过使用AQS提供的模板方法 实现同步组件语义 AQS实现了对同步状态的管理以及阻塞线程进行排队,等待通知等等一 ...

  6. 超级简单的数组加单链表实现Map

    /** * 超级简单的数组加单链表实现Map * @author jlj * */ public class MyHashMap { public MyList[] lists; public int ...

  7. 池化HttpClient,拿去就能用

    import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpEntity; import org.apache.http.HttpResp ...

  8. boostrap 学习笔记

    bootstrap : 是全球最受欢迎的前端组件库,用于开发响应式布局.移动设备优先的 WEB 项目. 用于项目样式的快速搭建,真的是..特别快.. 随便找两个cdn引用就能使用了. https:// ...

  9. Windows下Linux虚拟机的配置以及Win10 linux子系统开启

    本文所用资料下载地址为: 链接:链接:https://pan.baidu.com/s/1iiI2ebAnomKrBpvSg05w2A 提取码:7giz 复制这段内容后打开百度网盘手机App,操作更方便 ...

  10. retrying failed action with response code: 403

    0x00 Event [2019-09-24T19:22:31,655][INFO ][logstash.outputs.elasticsearch] retrying failed action w ...