Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'File the Text File with the Name from the File List
- txtFileName.Text = File1.FileName
- 'Port the Text from the Textbox to a String Variable, so we can access the File
- strHeaderFile = txtFileName.Text
- 'Cut the Extension into another String Variable
- NAMECUT = txtFileName.Text
- EXPORTNAME = Left(NAMECUT, InStrRev(txtFileName.Text, ".") - 1)
- 'Generate Name for the .BIN File
- strSampleFile = EXPORTNAME & ".bin"
- 'Open our Previous generated "Names"
- Open strHeaderFile For Binary As #1
- Open strSampleFile For Binary As #2
- 'Get some Variables
- 'We want to check here if we have valid Files
- Get #1, 1, strCheck
- Get #1, 9, FileLength
- 'Check Header Magic "SM4L"
- If strCheck = "SM4L" Then
- cmdSPLIT.Enabled = True
- Else
- cmdSPLIT.Enabled = False
- lblINFO.Caption = "Header Magic Check Failed!!!"
- Close #1, #2
- Exit Sub
- End If
- 'Check Size given in Header
- If FileLength * 2048 <> FileLen(strSampleFile) Then
- cmdSPLIT.Enabled = False
- lblINFO.Caption = "Size Check Failed!!!"
- Close #1, #2
- Exit Sub
- Else
- cmdSPLIT.Enabled = True
- End If
- 'After we passed the 2 Checks we will read the Filecount
- Get #1, 5, IncludedFiles
- lblINFO.Caption = "Included Files: " & IncludedFiles
- 'Close Files
- Close #1, #2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement