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.
精彩评论