String ExtensionTo Base 64 方法
将字符串转换为 Base64
Definition
命名空间: Suresking.Utility
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
Base64 字符串;输入为空时返回 Empty。
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
C#
public static string ToBase64(
this string input,
Encoding? encoding = null
)参数
返回值
StringBase64 字符串;输入为空时返回 Empty。
备注
在 Visual Basic 和 C# 中,这个方法可以当成为类型 String 的实例方法来调用。在采用实例方法语法调用这个方法时,请省略第一个参数。请参考 扩展方法 (Visual Basic) 或 扩展方法 (C# 编程指南) 获取更多信息。备注
Base64 是编码而非加密,不能用于保护敏感数据。