SoftBasicCalculateStreamMD5 方法 (Stream) |
获取数据流的md5码
Get the MD5 code for the data stream
命名空间:
HslCommunication.BasicFramework
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static string CalculateStreamMD5(
Stream stream
)
Public Shared Function CalculateStreamMD5 (
stream As Stream
) As String
public:
static String^ CalculateStreamMD5(
Stream^ stream
)
static member CalculateStreamMD5 :
stream : Stream -> string
参数
- stream
- 类型:System.IOStream
数据流,可以是内存流,也可以是文件流
返回值
类型:
StringMd5字符串
示例
下面举例实现获取一个流的md5码
try
{
Stream stream = File.OpenRead( "D:\\123.txt" );
string md5 = SoftBasic.CalculateStreamMD5( stream );
Console.WriteLine( md5 );
}
catch (Exception ex)
{
Console.WriteLine( "failed : " + ex.Message );
}
参见