Horje
c# read all files in a directory Code Example
asp.net list all files in folder
string[] allfiles = Directory.GetFiles("path/to/dir", "*.*", SearchOption.AllDirectories);
c# read all files in a directory
string mydocpath=Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);     
      StringBuilder sb = new StringBuilder();
      foreach (string txtName in Directory.GetFiles(@"D:\Links","*.txt"))
      {
        using (StreamReader sr = new StreamReader(txtName))
        {
          sb.AppendLine(txtName.ToString());
          sb.AppendLine("= = = = = =");
          sb.Append(sr.ReadToEnd());
          sb.AppendLine();
          sb.AppendLine();   
        }
      }
      using (StreamWriter outfile=new StreamWriter(mydocpath + @"\AllTxtFiles.txt"))
      {    
        outfile.Write(sb.ToString());
      }   




Csharp

Related
c# groupby date Code Example c# groupby date Code Example
Convert string int Linq Code Example Convert string int Linq Code Example
convert int to string in linq query c# Code Example convert int to string in linq query c# Code Example
update models with ef core Code Example update models with ef core Code Example
how to convert string to int in c# Code Example how to convert string to int in c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11