import java.util.*;
public class Main
{
static void main(String[] args)
{
CreateHtml(GetImages());
}
private static void CreateHtml(ArrayList listImages)
{
try
{
java.io.FileWriter writer = new java.io.OutputStreamWriter(File.Create("images.html"));
writer.write("" + System.lineSeparator());
writer.write("" + System.lineSeparator());
for (String image : listImages)
{
writer.write("" + image + "" + System.lineSeparator());
}
writer.close();
}
catch (java.lang.Exception e)
{
System.out.println("Error writing html.");
}
}
private static ArrayList GetImages()
{
ArrayList ListImages = new List();
String[] files = (new java.io.File(".")).list(java.io.File::isFile);
for (String file : files)
{
String extension = Path.GetExtension(file);
switch (extension)
{
case ".png":
case ".jpg":
case ".jpge":
ListImages.add(file.substring(2));
break;
}
}
return ListImages;
}
}