Bueno, cree un programa con una variable llamada IP y al inicio hace
OK, el codigo de COBEIN del cual hablo es el edit generic sever o alreves ahora no se x'D bueno y en otro programa pongo:
Dim txtIP As String
Dim txtPort As String
Dim sRuta As String
'---------------------------------------------------------------------------------------
' Module : cEditSvr
' DateTime : 19/09/2008 13:23
' Author : Cobein
' Mail : cobein27@hotmail.com
' WebPage : http://www.advancevb.com.ar
' Purpose : Read Write data at EOF
' Usage : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
'
' History : 19/09/2008 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Private c_pBag As New PropertyBag
Private c_sFile As String
Private c_lEOF As Long
Public c_bHasData As Boolean
'---------------------------------------------------------------------------------------
' Procedure : GetEOF
' Author : E0N
' Purpose : Calculate EOF
'---------------------------------------------------------------------------------------
Private Function GetEOF(sPath As String) As Long
Dim vbData() As Byte
Dim PE As Long, NumberOfSections As Integer
Dim BeginLastSection As Long
Dim RawSize As Long, RawOffset As Long
Open sPath For Binary As #1
ReDim vbData(LOF(1) - 1)
Get #1, , vbData
Close #1
Call CopyMemory(PE, vbData(&H3C), 4)
Call CopyMemory(NumberOfSections, vbData(PE + &H6), 2)
BeginLastSection = PE + &HF8 + ((NumberOfSections - 1) * &H28)
Call CopyMemory(RawSize, vbData(BeginLastSection + 16), 4)
Call CopyMemory(RawOffset, vbData(BeginLastSection + 20), 4)
GetEOF = RawSize + RawOffset
End Function
Public Function ExeFile(sPath As String) As Boolean
c_sFile = sPath
c_lEOF = GetEOF(c_sFile)
If Not FileLen(c_sFile) = c_lEOF Then
c_bHasData = True
Dim vbData() As Byte
Open c_sFile For Binary As #1
ReDim vbData(LOF(1) - c_lEOF - 1)
Seek #1, c_lEOF + 1
Get #1, , vbData
Close #1
'+++++++++++++++++++++++++++++++++++++++++++++++++++++
'At this point you can Decrypt the byte array [vbData]
'+++++++++++++++++++++++++++++++++++++++++++++++++++++
Set c_pBag = New PropertyBag
c_pBag.Contents = vbData
End If
End Function
Public Sub WriteProp(sName As String, vVal As Variant)
c_pBag.WriteProperty sName, vVal
End Sub
Public Function ReadProp(sName As String) As Variant
ReadProp = c_pBag.ReadProperty(sName)
End Function
Public Function WriteData(sDstFile As String) As Boolean
Dim vbData() As Byte
Open c_sFile For Binary Access Read As #1
ReDim vbData(LOF(1) - 1)
Get #1, , vbData
Close #1
Open sDstFile For Binary Access Write As #1
Put #1, , vbData
vbData = c_pBag.Contents
'+++++++++++++++++++++++++++++++++++++++++++++++++++++
'At this point you can Encrypt the byte array [vbData]
'+++++++++++++++++++++++++++++++++++++++++++++++++++++
Put #1, , vbData
Close #1
End Function
Private Sub Command1_Click()
'txtIP = Text1.Text
'txtPort = Text2.Text
'CD.Filter = "Solo *.exe |*.exe"
'CD.ShowOpen
Dim c As New cEditSvr
CD.ShowOpen
sRuta = CD.FileName
c.ExeFile = sRuta
c.WriteProp "IP", "1111"
CD.ShowSave
c.WriteData = CD.FileName
Set c = New cEditSvr
CD.Filter = "Solo *.exe |*.exe"
c.ExeFile = CD.FileName
Debug.Print c.ReadProp("IP")
End Sub
y cuando apreto el command me dice que
No esta definida.
¿Alguien sabe xk?
Grax