public static bool IsBase64String(string s)
{
if ((s.Length % 4) != 0)
{
return false;
}
try
{
MemoryStream stream = new MemoryStream(Convert.FromBase64String(s));
return true;
}
catch
{
return false;
}
}
keys: c#, base64, crypto,
public static bool IsBase64String(string s)
{
if ((s.Length % 4) != 0)
{
return false;
}
try
{
MemoryStream stream = new MemoryStream(Convert.FromBase64String(s));
return true;
}
catch
{
return false;
}
}