基于VB.NET中的byte()创建文件 [英] Creating a file based on the byte() in VB.NET

查看:29
本文介绍了基于VB.NET中的byte()创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 SQL 数据库中的图像检索到 VB.NET 中的 Byte() 变量中.

I am retrieving an image from the SQL database into Byte() variable in VB.NET.

Dim img as byte() = dr(0)

如何在我的 C:\images\ 目录中从上面的 img 创建一个文件.

How do I create a file in my C:\images\ directory from the above img.

我想读取 img 然后创建一个名为 bimage.gif 的文件.

I want to read the img and then create a file with name bimage.gif.

推荐答案

最简单的方法是使用 File.WriteAllBytes

Dim img as byte()=dr(0)
File.WriteAllBytes("C:/images/whatever.gif", img)

这篇关于基于VB.NET中的byte()创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆