Exemplo n.º 1
0
 internal static List <string> READ_File_In_List(string FilePath)
 {
     if (CHECK_File_Encrypted(FilePath) == true)
     {
         Crypto_Operation.UnSecure_File(FilePath);
         List <string> TEMP_Contents = File.ReadAllLines(FilePath).ToList();
         Crypto_Operation.Secure_File(FilePath);
         return(TEMP_Contents);
     }
     else
     {
         return(File.ReadAllLines(FilePath).ToList());
     }
 }
Exemplo n.º 2
0
 internal static string[] READ_File_In_StringArray(string FilePath)
 {
     if (CHECK_if_File_Exists(FilePath))
     {
         Crypto_Operation.UnSecure_File(FilePath);
         string[] Contents = File.ReadAllLines(FilePath);
         Crypto_Operation.Secure_File(FilePath);
         return(Contents);
     }
     else
     {
         Error_Operation.Log_Error("READ_File_In_StringArray()", "File not found " + FilePath, "", Error_Operation.LogSeverity.Informataion);
         return(File.ReadAllLines(FilePath));
     }
 }
Exemplo n.º 3
0
 internal static void APPEND_Data_To_File(string FilePath, string Values)
 {
     if (CHECK_if_File_Exists(FilePath))
     {
         if (CHECK_Data_Encrypted(FilePath))
         {
             Crypto_Operation.UnSecure_File(FilePath);
             File.AppendAllText(FilePath, Values);
             Crypto_Operation.Secure_File(FilePath);
         }
         else
         {
             File.AppendAllText(FilePath, Values);
         }
     }
 }
Exemplo n.º 4
0
        internal static string READ_AllText(string FilePath)
        {
            bool FIleExists = CHECK_if_File_Exists(FilePath);

            if (FIleExists && CHECK_File_Encrypted(FilePath))
            {
                Crypto_Operation.UnSecure_File(FilePath);
                string Contents = File.ReadAllText(FilePath);
                Crypto_Operation.Secure_File(FilePath);
                return(Contents);
            }
            else
            {
                if (FIleExists == false)
                {
                    Error_Operation.Log_Error("READ_AllText()", "File not found " + FilePath, "", Error_Operation.LogSeverity.Informataion);
                    return(null);
                }
                else
                {
                    return(File.ReadAllText(FilePath));
                }
            }
        }