MindConqueror
New member
- Joined
- Apr 7, 2021
- Messages
- 4
- Programming Experience
- 1-3
VB.NET:
Public Function writeverify(ByRef gb As Object, ByVal xflname As String)
Try
Dim onefilsize As Int64 = vars.flsize
MessageBox.Show(onefilsize)
Dim dataArray(onefilsize) As Byte
'Dim randomGenerator As String = "1"
Dim students(0) As Integer
students(0) = 5
'students(1) = 2
' randomGenerator.NextBytes(dataArray)
Dim Filename As String = xflname
MessageBox.Show(Filename)
' Dim numbers() = {1}
Dim FileStream As FileStream = New FileStream(Filename, FileMode.Create)
Try
For i As Integer = 0 To dataArray.Length - 1
Try
FileStream.WriteByte(students(0))
Catch ex As Exception
End Try
Next i
FileStream.Seek(0, SeekOrigin.Begin)
For i As Integer = 0 To CType(FileStream.Length, Integer)
RichTextBox1.AppendText(FileStream.ReadByte())
If (students(0)) <> (FileStream.ReadByte()) Then
MessageBox.Show("Error writing data.")
Return ""
End If
Next i
Finally
' FileStream.Seek(SeekOrigin.Begin, SeekOrigin.End)
FileStream.Close()
End Try
Return ""
Catch ex As UnauthorizedAccessException
MessageBox.Show("You dont have write access to wipe the disk.")
End Try
Return ""
End Function
Last edited by a moderator: