using System;
using System.IO;
namespace get_all_files
{
class Program
{
static void Main(string[] args)
{
// All files from directory "C:File"
string[] files = Directory.GetFiles(@"C:File");
foreach (var file in files)
{
Console.WriteLine(file);
}
}
}
}
In MS Windows it works like this:
1. Hold the "Shift" key, right-click the folder containing the files and select "Open Command Window Here."
2. Type "dir /b > filenames.txt" (without quotation marks) in the Command Window. Press "Enter."
3. Inside the folder there should now be a file filenames.txt containing names of all the files etc. inside this folder.
4. Copy and paste this file list into your Word document.
import os
path = '/folder1/folder2/'
files = os.listdir(path)
var fs = require('fs');
var files = fs.readdirSync('/assets/photos/');
using System;
using System.IO;
namespace get_all_files
{
class Program
{
static void Main(string[] args)
{
// All files from directory "C:File"
string[] files = Directory.GetFiles(@"C:File");
foreach (var file in files)
{
Console.WriteLine(file);
}
}
}
}
In MS Windows it works like this:
1. Hold the "Shift" key, right-click the folder containing the files and select "Open Command Window Here."
2. Type "dir /b > filenames.txt" (without quotation marks) in the Command Window. Press "Enter."
3. Inside the folder there should now be a file filenames.txt containing names of all the files etc. inside this folder.
4. Copy and paste this file list into your Word document.
import os
path = '/folder1/folder2/'
files = os.listdir(path)
var fs = require('fs');
var files = fs.readdirSync('/assets/photos/');