开发者

How to convert XMLSS(XML SpreadSheet) into a byte array?

开发者 https://www.devze.com 2023-03-25 03:48 出处:网络
I was wondering if we ca开发者_JAVA百科n convert into a byte array an XML spreadsheet the same way as a normal XML file in c#?

I was wondering if we ca开发者_JAVA百科n convert into a byte array an XML spreadsheet the same way as a normal XML file in c#?

Thanks.


You can convert any file into a byte array.
Get a handle on the file and turn it into a stream. From there you are just reading the file into a byte array. Although this isn't exactly what you are doing, it gives an example on how to convert the file into a byte array:

Dim fs As Stream = fupDocLibrary.PostedFile.InputStream
Dim br As New BinaryReader(fs)
Dim bytes As Byte() = br.ReadBytes(fs.Length)

Here I am using a file upload control, but it should be just as easy to read a file from the directory and convert it the same way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号