Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub ReplaceText(ByVal filename As String)
- Try
- Dim buffer As Byte() = System.IO.File.ReadAllBytes(filename)
- Dim buffer2 As Byte() = New Byte((buffer.Length + 1) - 1) {}
- Dim num As Integer = 0
- Dim length As Integer = buffer.Length
- If ((length > 1) AndAlso (buffer(0) <> &HFF)) Then
- buffer2(0) = &HFF
- Dim i As Integer
- For i = 0 To buffer.Length - 1
- Dim num4 As Byte = Not buffer(i)
- buffer2((i + 1)) = CByte(num4)
- If (num >= &H180) Then
- num = 0
- End If
- Next i
- Dim directoryName As String = System.IO.Path.GetDirectoryName(filename)
- Dim input As String = System.IO.Path.GetFileName(filename)
- Dim str As String = (System.Text.RegularExpressions.Regex.Replace(input, "", String.Empty))
- Dim stream As New System.IO.FileStream(directoryName & str, IO.FileMode.Create)
- stream.Write(buffer2, 0, buffer2.Length)
- stream.Close()
- MsgBox("Successfuly completed!")
- ElseIf ((length > 1) AndAlso (buffer(0) = &HFF)) Then
- 'MessageBox.Show(.(-1127653267))
- End If
- Catch ex As Exception
- MsgBox(((((((("Something were wrong please try again! =("))))))))
- End Try
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement