public static bool IsStringBase64Encoded(string stringData) { try { Convert.FromBase64String(stringData); return true; } catch (FormatException) { return false; } }