C# write stream to local file
2021-01-04 04:28
标签:color div stream ring cte ESS filename using ext Write the current to the local file. The encoding way of C# writing and reading Chinese characters is System.Text.Encoding.GetEncoding(936) C# write stream to local file 标签:color div stream ring cte ESS filename using ext 原文地址:https://www.cnblogs.com/Fred1987/p/13195871.html static void CopyStream(Stream stream, string destPath)
{
using (var fileStream = new FileStream(destPath, FileMode.Create, FileAccess.Write))
{
stream.CopyTo(fileStream);
}
}
static void BinaryWriteLocalFile(string fileName, string msg)
{
using(FileStream fs = new FileStream(fileName, FileMode.CreateNew))
{
using (BinaryWriter bw = new BinaryWriter(fs, System.Text.Encoding.GetEncoding(936)))
{
bw.Write(msg);
}
}
}
上一篇:C# 接口
文章标题:C# write stream to local file
文章链接:http://soscw.com/index.php/essay/39969.html