May 11, 2010 12:47 PM
(This post was last modified: May 11, 2010 02:17 PM by xSilent.)
I posted the functions, but I didn't show how to use them.
First make a string called TheEOF or whatever under your form name example:
Once you've done that add this read EOF function (We'll be writing it a different way)
I modified my function from VB6 to look more like VB.NET so some of you won't complain about it
Now in your file open dialog, after the file has been opened add this
Now at the end of your sub when the file is crypted add this
That is how you use well any EOF function
This should help any beginner coding a crypter in vb.net or C# (Just convert it)
First make a string called TheEOF or whatever under your form name example:
Code
Public Class Form1
Dim TheEOF As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End SubOnce you've done that add this read EOF function (We'll be writing it a different way)
Code
Public Function ReadEOFData(ByRef FilePath As String) As String
Dim EOFBuf As String
Dim lPos As Integer
If Dir(FilePath) = "" Then
Exit Function
End If
Dim ReadFile As String = IO.File.ReadAllText(FilePath)
lPos = InStr(1, StrReverse(ReadFile), GetNullBytes(30))
EOFBuf = (Mid(StrReverse(ReadFile), 1, lPos - 1))
ReadEOFData = StrReverse(EOFBuf)
If ReadEOFData = "" Then
End If
Exit Function
End Function
Public Function GetNullBytes(ByRef lNum As Object) As String
Dim Buf As String
Dim i As Short
For i = 1 To lNum
Buf = Buf & Chr(0)
Next
GetNullBytes = Buf
End FunctionI modified my function from VB6 to look more like VB.NET so some of you won't complain about it
Now in your file open dialog, after the file has been opened add this
Code
TheEOF = ReadEOFData(OFD.Filename)Now at the end of your sub when the file is crypted add this
Code
If TheEOF = Nothing then
Messagebox.Show("File Crypted!")
Else
IO.File.AppendAllText(OFD.Filename, TheEOF)
MessageBox.Show("File Crypted With EOF!")
End IfThat is how you use well any EOF function
This should help any beginner coding a crypter in vb.net or C# (Just convert it)


