using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Fun
{
class Program
{
public static string path = "E:\\e.txt";
public static string image = "E:\\ma.png";
public static void wayA()//存储
{
FileStream name = new FileStream(path, FileMode.OpenOrCreate);
FileStream img = new FileStream(image, FileMode.Open);
byte[] by = new byte[1024];
while (true)
{
int index = img.Read(by, 0, by.Length);
if (index == 0)
{
Console.WriteLine("传输完毕");
break;
}
else
{
name.Write(by, 0, by.Length);
}
}
name.Close();
img.Close();
}
public static void wayB()//读取
{
FileStream te
C#将图片以二进制格式存储到本地/读取本地二进制格式的图片
最新推荐文章于 2023-11-01 15:45:00 发布