📜  system.text.encoding.utf8.getbytes decode - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:42.340000             🧑  作者: Mango

代码示例1
public static string EncodeServerName(string serverName)
{
    return Convert.ToBase64String(Encoding.UTF8.GetBytes(serverName));
}

public static string DecodeServerName(string encodedServername)
{
    return Encoding.UTF8.GetString(Convert.FromBase64String(encodedServername));
}