Beruflich Dokumente
Kultur Dokumente
HashFileLibrary;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
namespace Hashish_tester
class Program
while (!done)
switch (commandOrPath.ToLower())
case "exit":
case "quit":
done = true;
break;
case "chars":
getAllChars();
break;
case "read":
ReadDirectories();
break;
case "testread":
ReadDirectoriesTest();
break;
case "sort":
SortFiles();
break;
default:
LogListOfStrings(HashFolderManager<HashFile>.allFoundFilesUnsorted,
"allFoundFilesUnsorted.txt");
LogListOfStrings(HashFolderManager<HashFile>.allFoundFilesSorted,
"allFoundFilesSorted.txt");
LogList(HashFolderManager<HashFile>.filesSortedAfterFilterAndHash,
"filesSortedAfterFilterAndHash.txt");
break;
}
}
//string[] dirs =
Directory.GetFiles("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin");
//Console.WriteLine("Array:");
//Array.Sort(dirs);
//{
// Console.WriteLine(file);
//}
List<string> dirsList =
Directory.GetFiles("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin").ToList();
Console.WriteLine("\nList:");
Console.WriteLine(file);
List<string> dirsList1 =
Directory.GetFiles("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin").ToList();
Console.WriteLine("\nList:");
dirsList1[i] =
dirsList[i].Replace("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin\\", "");
Console.WriteLine(file);
Console.WriteLine("\nfirst letter:");
dirsList1[i] =
dirsList[i].Replace("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin\\", "");
dirsList1[i] = dirsList1[i][0].ToString();
Console.WriteLine(file);
Console.WriteLine("\nfirst 2 letters:");
dirsList1[i] =
dirsList[i].Replace("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin\\", "");
Console.WriteLine(file);
dirsList1[i] =
dirsList[i].Replace("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin\\", "");
Console.WriteLine(file);
dirsList1[i] =
dirsList[i].Replace("C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin\\", "");
Console.WriteLine(file);
List<char> allChars = new List<char> { 'W', 'S', 'N', 'M', 'i', 'I', 'G', 'A', '-', '2', '1', '~', '_', '@' };
{
Console.WriteLine(ch);
List<string> allCharssO = new List<string> { "W", "S", "N", "M", "i", "I", "G", "A", "-", "2", "1",
"~", "_", "@" };
Console.WriteLine(ch);
List<string> allCharss = new List<string> { "W", "S", "N", "M", "i", "I", "G", "A", "-", "2", "1",
"~", "_", "@" };
allCharss[i] =
$"C:\\Users\\Alexandru.Sisu\\Desktop\\Temp\\AcrelecTest\\bin\\{allCharss[i]}";
Console.WriteLine(ch);
{
Console.WriteLine(ch);
List<char> allChars = new List<char> { 'W', 'S', 'N', 'M', 'i', 'I', 'G', 'A', '-', '2', '1', '~', '_', '@' };
Console.WriteLine($"chars: {allChars.Count}");
allChars.Sort();
int index = 0;
int exceptions = 0;
try
charsD.Add(index++, c.ToString());
catch (Exception)
exceptions++;
}
serializer.Serialize(file, charsD);
.ToList();
Console.WriteLine($"chars: {allChars.Count}");
allChars.Sort();
int index = 0;
int exceptions = 0;
try
charsD.Add(index++, c.ToString());
catch (Exception)
exceptions++;
serializer.Serialize(file, charsD);
.ToList();
chars.Sort();
int i1 = 0;
try
Directory.CreateDirectory($"C:\\AcreTEst6 sorted\\{c}-{i1++}");
catch (Exception)
sb.AppendLine(item);
//{
// {
// $"{Path.DirectorySeparatorChar}logs{Path.DirectorySeparatorChar}",
// $"{Path.DirectorySeparatorChar}debug{Path.DirectorySeparatorChar}"
// };
// {
// Path.Combine(appRootDirectory.ToLower(), "core",
"peripherals")+Path.DirectorySeparatorChar,
// Path.Combine(appRootDirectory.ToLower(), "agent",
"downloads")+Path.DirectorySeparatorChar
// };
// };
// string appRoot =
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).
Replace($"file:{Path.DirectorySeparatorChar}", "");
// try
// {
// Array.Sort(allDirectories);
// {
// {
// if (itemToCheck.ToLower().Equals(allowedPath) ||
itemToCheck.ToLower().StartsWith(allowedPath))
// {
// //If atleast one is a match, stop everything
// shouldSkip = false;
// break;
// }
// }
// if (shouldSkip)
// continue;
// {
// if (itemToCheck.ToLower().StartsWith(skippedPath))
// {
// shouldSkip = true;
// break;
// }
// }
// if (shouldSkip)
// continue;
// {
// if (itemToCheck.ToLower().Contains(skippedDirNames))
// {
// shouldSkip = true;
// break;
// }
// }
// if (shouldSkip)
// continue;
// allValidDirectories.Add(item);
// }
// if (allValidDirectories.Count == 0)
// }
// {
// Console.WriteLine($"Error: {ex.Message}");
// }
//}