• 大小: 61KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: C#
  • 标签: C#  

资源简介

C# IO操作,从零开始学习,希望大家能都一起学习您上传的资源如果因版权、使用、内容完整度 等原因被举报并通过官方审核,将扣除通过该资源获得的全部积分

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace IOsearchPg
{
    class Program
    {
        static void Main(string[] args)
        {
            //获取当前程序所在的文件路径
            String rootPath = Directory.GetCurrentDirectory();
            string parentPath = Directory.GetParent(rootPath).FullName;//上级目录
            string topPath = Directory.GetParent(parentPath).FullName;//上上级目录
            StreamWriter sw = null;
            try
            {
                //创建输出流,将得到文件名子目录名保存到txt中
                sw = new StreamWriter(new FileStream(“fileList.txt“ FileMode.Append));
                sw.WriteLine(“根目录:“ + topPath);

            }
            catch (IOException e)
            {
                Console.WriteLine(e.Message);
            }
            finally
            {
                if (sw != null)
                {
                    sw.Close();
                    Console.WriteLine(“完成“);
                }
                Console.ReadLine();
            }

        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     20992  2018-11-21 14:18  IOWriteProgram\.vs\IOWriteProgram\v14\.suo

     文件        189  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\App.config

     文件       5632  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\bin\Debug\IOWriteProgram.exe

     文件        189  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\bin\Debug\IOWriteProgram.exe.config

     文件      13824  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\bin\Debug\IOWriteProgram.pdb

     文件      22696  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\bin\Debug\IOWriteProgram.vshost.exe

     文件        189  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\bin\Debug\IOWriteProgram.vshost.exe.config

     文件        490  2018-04-12 07:35  IOWriteProgram\IOWriteProgram\bin\Debug\IOWriteProgram.vshost.exe.manifest

     文件       2688  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\IOWriteProgram.csproj

     文件       6879  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        724  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\obj\Debug\IOWriteProgram.csproj.FileListAbsolute.txt

     文件       1922  2018-11-21 13:48  IOWriteProgram\IOWriteProgram\obj\Debug\IOWriteProgram.csprojResolveAssemblyReference.cache

     文件       5632  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\obj\Debug\IOWriteProgram.exe

     文件      13824  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\obj\Debug\IOWriteProgram.pdb

     文件          0  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       1314  2018-11-21 14:07  IOWriteProgram\IOWriteProgram\Program.cs

     文件       1336  2018-11-21 13:43  IOWriteProgram\IOWriteProgram\Properties\AssemblyInfo.cs

     文件       1009  2018-11-21 13:43  IOWriteProgram\IOWriteProgram.sln

    ..A..H.     34816  2018-11-21 15:36  IOsearchPg\.vs\IOsearchPg\v14\.suo

     文件        189  2018-11-21 14:18  IOsearchPg\IOsearchPg\App.config

     文件       5120  2018-11-21 15:03  IOsearchPg\IOsearchPg\bin\Debug\IOsearchPg.exe

     文件        189  2018-11-21 14:18  IOsearchPg\IOsearchPg\bin\Debug\IOsearchPg.exe.config

     文件      11776  2018-11-21 15:03  IOsearchPg\IOsearchPg\bin\Debug\IOsearchPg.pdb

     文件      22696  2018-11-21 15:03  IOsearchPg\IOsearchPg\bin\Debug\IOsearchPg.vshost.exe

     文件        189  2018-11-21 14:18  IOsearchPg\IOsearchPg\bin\Debug\IOsearchPg.vshost.exe.config

     文件        490  2018-04-12 07:35  IOsearchPg\IOsearchPg\bin\Debug\IOsearchPg.vshost.exe.manifest

     文件       2680  2018-11-21 14:18  IOsearchPg\IOsearchPg\IOsearchPg.csproj

     文件       6854  2018-11-21 14:18  IOsearchPg\IOsearchPg\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

............此处省略34个文件信息

评论

共有 条评论