Private Declare Function GetVolumeInformation& Lib "kernel32" Alias
"GetVolumeInformationA" (ByVal lpRootPathName As String,
ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String,
ByVal nFileSystemNameSize As Long)
Private Sub cmdParche_Click()
Dim cad1 As String * 255
Dim cad2 As String * 255
Dim numSerie As Long
Dim longitud As Long
Dim flag As Long
unidad = "C:\"
Call GetVolumeInformation(unidad, cad1, 255, numSerie, longitud,flag, cad2,255)
numSerie = Trim(Replace(numSerie, Chr(0), ""))
Open "Programa.Exe" For Binary As #1
sId = Space(2)
Get #1, LOF(1)-2, sId
If sId <> "id" Then
numSerie = Trim(numserie)
sBuffer$ = numSerie + Chr(Len(numSerie)) + "id"
Put #1, LOF(1) + 1, sBuffer$
Else
MsgBox "La aplicacion ya fue parchada"
Endif
Close #1
End Sub