| | |
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
Views: 642 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 30minutes 2005 2008 access account application arithmetic array arrays basic binary bing button buttons c# center check checkbox code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy highlighting images inline insert installer intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project save searchbox searchvb.net select serial server soap sorting syntax table tcp text textbox timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





