VB to c++ or c#?
- by hilzmas
I am trying to translate this code but I don't understand how to use the GET / PUT part of the code in another language like c++ or c#.
This is the code :
Private Sub cmd_Click()
Dim i As Integer, a As Integer
a = 10
For i = 1 To a
Dim file As String
Open "txt" For Binary As #1
file = Space(LOF(1))
Get #1, , file
Close #1
Randomize
Open "txtpath" & "\" & i & "txtname" For Binary As #1
Put #1, , file
Put #1, , Rnd
Close #1
Next i
End Sub
The code could have bug because I replaced variables with plain text. What I understand is that the code get a file and then save it with some random data added to make it look different than the original. I don't use vb since years and I don't remember anything about it. Can someone help me porting this snippet to c++ or c#?