楼上正解
- Dim stmSave As IO.Stream
- Dim filename As String = "c:\tt.tmp"
- stmSave = IO.File.Create(filename)
- frmSheets.fpsMain.Save(stmSave, False)
- Dim b(stmSave.Length) As Byte
- stmSave.Position = 0
- '或者
- stmSave.Seek(0, IO.SeekOrigin.Begin)
- stmSave.Read(b, 0, stmSave.Length)
- stmSave.Close()
复制代码 因为你对流进行写操作后 流的position被置在末尾,这时候你需要重置position的位置或者seek到流开头位置. |