| | |
how to read this file
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 21
Reputation:
Solved Threads: 0
hiiiiiiiiiiiiiiii
I'm going to store a selected image from fileupload
and save the image in a array of byte in a file
"the code"
Dim _fileName As String = Request.PhysicalApplicationPath & FileUpload1.FileName
Dim _byte() As Byte = FileUpload1.FileBytes()
Dim _file As New IO.FileStream(_fileName, IO.FileMode.Create)
For _i As Integer = 0 To _byte.Length - 1
_file.WriteByte(_byte(_i))
my problem is how to read this file ???
I'm going to store a selected image from fileupload
and save the image in a array of byte in a file
"the code"
Dim _fileName As String = Request.PhysicalApplicationPath & FileUpload1.FileName
Dim _byte() As Byte = FileUpload1.FileBytes()
Dim _file As New IO.FileStream(_fileName, IO.FileMode.Create)
For _i As Integer = 0 To _byte.Length - 1
_file.WriteByte(_byte(_i))
my problem is how to read this file ???
Here's an easier way to do that:
But if you still want to use the FileStream:
VB.NET Syntax (Toggle Plain Text)
' Write byte array My.Computer.FileSystem.WriteAllBytes(_fileName, _byte, False) ' Read byte array _byte = My.Computer.FileSystem.ReadAllBytes(_fileName)
VB.NET Syntax (Toggle Plain Text)
Dim _FileSize As Long _FileSize = _file.Length For _i As Long = 0 To _FileSize - 1 _byte(CInt(_i)) = CByte(_file.ReadByte()) Next _i
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Move file pointer to read next file value (C++)
- read from file help (C++)
- write and read to file (C++)
- how to read a file from client side without browsing (ASP.NET)
- C++ How can read from file.txt & where can save this file(file.txt) to start reading (C++)
- create, write & read file to/from folder (C++)
- Read in a file and store in char array (C)
Other Threads in the VB.NET Forum
- Previous Thread: Help with Visual Studio 2008
- Next Thread: Query and text file
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic eclipse editvb.net employees excel exists forms function html images isnumericfuntioncall lib listview map mobile module msaccess mssqlbackend mysql net number open page pan pdf picturebox picturebox2 port position print printing printpreview problem record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure structures temp textbox timer transparency txttoxmlconverter usercontol vb vb.net vb2008 vba vbnet vista visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winsock wpf wrapingcode xml year





