elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: 1 ... 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ... 55
181  Programación / Programación Visual Basic / Re: numeros grandes en: 4 Septiembre 2005, 01:06 am
Hace un tiempo escribi unas funciones para trabajar con números grandes. Si no me equivoco a la de multiplicar tenía que cambiarle algo :P, pero ahora la probé y funciona. Las demás funcionan bien.

La suma y la resta la hace muy rápido, la multiplicación y división bastante rápido. Los probé con un número de 256KB de extensión ;D y la suma y resta lo hace en 2 o 3 segundos.

Siento que no puse los comentarios, pero es demasiado código como para ponerlos ahora.

Código:
'
'Coded by Slasher-
'
Option Explicit
Option Base 1

Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, lpBuffer As Any, ByVal nSize As Long, Optional lpNumberOfBytesWritten As Long) As Long
Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, lpBuffer As Any, ByVal nSize As Long, Optional lpNumberOfBytesWritten As Long) As Long

Public Const CA1 = 1
Public Const CA2 = 2
Public Const SIGN_MAGN = 3

Public Const NUM_CMP_EQUAL = 1
Public Const NUM_CMP_MAJOR = 2
Public Const NUM_CMP_MINOR = 3

Function AddN(ByVal Number1 As String, ByVal Number2 As String) As String
          Dim btNum1() As Byte, btNum2() As Byte
          Dim btTotal() As Byte, lCnt&
          Dim iByte1%, iByte2%
          Dim iByteTotal%
          Dim lLen1&, lLen2&
          Dim iCarry%, i&, r&
          Dim bSigned As Boolean

  If NumCmp(Number1, 0, NUM_CMP_MINOR) And NumCmp(Number2, 0, NUM_CMP_MAJOR) Then
    AddN = SubN(Number2, Mid$(Number1, 2))
    Exit Function
  ElseIf NumCmp(Number1, 0, NUM_CMP_MAJOR) And NumCmp(Number2, 0, NUM_CMP_MINOR) Then
    AddN = SubN(Number1, Mid$(Number2, 2))
    Exit Function
  ElseIf NumCmp(Number1, 0, NUM_CMP_MINOR) And NumCmp(Number2, 0, NUM_CMP_MINOR) Then
    bSigned = True
  End If
 
  If Left$(Number1, 1) Like "-" Then Number1 = Mid$(Number1, 2)
  If Left$(Number2, 1) Like "-" Then Number2 = Mid$(Number2, 2)
 
  lLen1 = EqualStr(Number1, Number2, "0")
  lLen2 = lLen1
  lCnt = lLen1 + lLen2
 
  ReDim btTotal(lLen1 + lLen2) As Byte
 
  btNum1 = StrToByteVal(Number1)
  btNum2 = StrToByteVal(Number2)

  For i = 1 To lLen1
    iByte1 = btNum1(lLen1 - i)
    iByte2 = btNum2(lLen2 - i)
   
    iByteTotal = iByte1 + iByte2 + iCarry
   
    If iByteTotal >= 10 Then
      btTotal(lCnt) = Val(Mid$(iByteTotal, 2, 1))
      iCarry = 1
    Else
      btTotal(lCnt) = iByteTotal
      iCarry = 0
    End If
   
    lCnt = lCnt - 1
  Next
 
  AddN = ByteToStrVal(btTotal())
 
End Function

Function SubN(ByVal Number1 As String, ByVal Number2 As String) As String
          Dim btNum1() As Byte, btNum2() As Byte
          Dim btTotal() As Byte, lCnt&
          Dim iByte1%, iByte2%
          Dim iByteTotal%, sTotal$
          Dim lLen1&, lLen2&
          Dim iNextByte%, i&
          Dim bSigned As Boolean
          Dim sTemp$, iTempByte$

  'Analiza los dos números antes de realizar la resta, para
  'reemplazar la operación en caso que sea necesario por los
  'signos, y así simplificar la función.
  '
  If NumCmp(Number1, Number2, NUM_CMP_EQUAL) And NumCmp(Number1, 0, NUM_CMP_MAJOR) Then
    'Num1>0 And Num2>0
    SubN = 0
    Exit Function
  ElseIf NumCmp(Number1, Number2, NUM_CMP_EQUAL) And NumCmp(Number1, 0, NUM_CMP_MINOR) Then
    'Num1=Num2 And Num2<0
    SubN = "-" & AddN(Mid$(Number1, 2), Mid$(Number2, 2))
   
    Exit Function
  ElseIf NumCmp(Number1, 0, NUM_CMP_MINOR) And NumCmp(Number2, 0, NUM_CMP_MINOR) Then
    'Num1 < 0 And Num2 < 0
    '
    If Left$(Number1, 1) Like "-" Then Number1 = Mid$(Number1, 2)
    If Left$(Number2, 1) Like "-" Then Number2 = Mid$(Number2, 2)
   
    SubN = "-" & AddN(Number1, Number2)
    Exit Function

  ElseIf NumCmp(Number1, Number2, NUM_CMP_MINOR) Then
    If NumCmp(Number1, 0, NUM_CMP_MAJOR) And NumCmp(Number2, 0, NUM_CMP_MAJOR) Then
      'Num1 > 0 And Num2 > 0
      '
      sTemp = Number2
      Number2 = Number1
      Number1 = sTemp

      bSigned = True
    ElseIf NumCmp(Number1, 0, NUM_CMP_MINOR) And NumCmp(Number2, 0, NUM_CMP_MAJOR) Then
      'Num1 < 0 And Num2 > 0
      '
      bSigned = True
    End If
   
    If Left$(Number1, 1) Like "-" Then Number1 = Mid$(Number1, 2)
    If Left$(Number2, 1) Like "-" Then Number2 = Mid$(Number2, 2)
  End If
 
  lLen1 = EqualStr(Number1, Number2, "0") - 1
  lLen2 = lLen1
 
  btNum1 = StrToByteVal(Number1)
  btNum2 = StrToByteVal(Number2)
 
  ReDim btTotal(lLen1 + lLen2 + 1) As Byte
  lCnt = lLen1 + lLen2 + 1
 
  For i = 0 To lLen1
    iByte1 = btNum1(lLen1 - i)
    iByte2 = btNum2(lLen2 - i)
   
    If (iByte1 < iByte2) And i < lLen1 Then
      iByte1 = iByte1 + 10
     
      iNextByte = btNum1(lLen1 - i - 1)
      btNum1(lLen1 - i - 1) = iNextByte - 1
    End If
   
    iByteTotal = iByte1 - iByte2
   
    btTotal(lCnt) = iByteTotal
    lCnt = lCnt - 1
  Next
 
  If bSigned Then
    SubN = "-" & ByteToStrVal(btTotal)
  Else
    SubN = ByteToStrVal(btTotal)
  End If
End Function

Function ProN(ByVal Number1 As String, ByVal Number2 As String) As String
          Dim btNum1() As Byte, btNum2() As Byte
          Dim btTotal() As Byte, lCnt&
          Dim iByte1%, iByte2%
          Dim iByteTotal%, sTotal$
          Dim lLen1&, lLen2&
          Dim iCarry%, sSum$()
          Dim i&, ind&

  lLen1 = Len(Number1) - 1
  lLen2 = Len(Number2) - 1

  btNum1 = StrToByteVal(Number1)
  btNum2 = StrToByteVal(Number2)
 
  For i = 0 To lLen2
    iByte2 = btNum2(lLen2 - i)
   
    'If i > 9 Then Stop
   
    For ind = 0 To lLen1
      iByte1 = btNum1(lLen1 - ind)
     
      iByteTotal = (iByte1 * iByte2) + iCarry
     
      If iByteTotal >= 10 Then
        If ind < lLen1 Then
          sTotal = Right$(iByteTotal, 1) & sTotal
          iCarry = CInt(Left$(iByteTotal, Len(CStr(iByteTotal)) - 1))
        Else
          sTotal = iByteTotal & sTotal
        End If
      Else
        sTotal = iByteTotal & sTotal
        iCarry = 0
      End If
    Next

    sTotal = sTotal & String$(i, "0")
   
    ReDim Preserve sSum$(i + 1)
   
    sSum(i + 1) = sTotal
    sTotal = vbNullString
   
    iCarry = 0
  Next
 
  sTotal = sSum(1)
 
  For i = 2 To lLen2 + 1
    sTotal = AddN(sTotal, sSum(i))
  Next
 
  ProN = sTotal
End Function

Function DivN(ByVal Number1 As String, ByVal Number2 As String, Optional MaxDec = 30) As String
          Dim btNum1() As Byte, lLen1&
          Dim btTotal() As Byte, lCnt&
          Dim iByte1%
          Dim sCurDiv$, iCurFac%
          Dim iDecCnt%, i&, ind%

  If MaxDec < 0 Then MaxDec = 30
 
  Do While NumCmp(Number1, Number2, NUM_CMP_MINOR)
    'El dividendo debe ser mayor que el divisor.
    '
    Number1 = Number1 & "0"
   
    iDecCnt = iDecCnt + 1
  Loop
 
  lLen1 = Len(Number1) - 1

  btNum1 = StrToByteVal(Number1)
 
  lCnt = 1
  ReDim btTotal(lCnt) As Byte
 
  If iDecCnt > 0 Then
    ReDim Preserve btTotal(3) As Byte
   
    btTotal(1) = vbKey0 'Cero
    btTotal(2) = 44     'Coma
    lCnt = 3
   
    For i = 3 To iDecCnt
      btTotal(i) = vbKey0
     
      lCnt = lCnt + 1
     
      ReDim Preserve btTotal(lCnt) As Byte
    Next
  End If
 
  For i = 0 To lLen1
    iByte1 = btNum1(i)
   
    sCurDiv = sCurDiv & iByte1
   
    If NumCmp(sCurDiv, Number2, NUM_CMP_MAJOR) Or NumCmp(sCurDiv, Number2, NUM_CMP_EQUAL) Then
      Exit For
    End If
  Next
 
  Do
    iCurFac = 1
   
    Do While NumCmp(sCurDiv, ProN(Number2, iCurFac), NUM_CMP_MAJOR)
      iCurFac = iCurFac + 1
    Loop
   
    If CLng(sCurDiv) Mod CLng(Number2) = 0 Then
      btTotal(lCnt) = iCurFac + vbKey0
      sCurDiv = SubN(sCurDiv, ProN(Number2, iCurFac)) & Mid$(Number1, Len(sCurDiv) + 1)
    Else
      btTotal(lCnt) = (iCurFac - 1) + vbKey0
      sCurDiv = SubN(sCurDiv, ProN(Number2, (iCurFac - 1))) & Mid$(Number1, Len(sCurDiv) + 1)
    End If
   
    If NumCmp(sCurDiv, Number2, NUM_CMP_MINOR) Then
      If NumCmp(sCurDiv, "0", NUM_CMP_EQUAL) And Len(sCurDiv) > 1 Then
        lCnt = lCnt + 1
        ReDim Preserve btTotal(lCnt) As Byte
     
        btTotal(lCnt) = vbKey0
       
        Exit Do
      ElseIf NumCmp(sCurDiv, "0", NUM_CMP_EQUAL) Then
        Exit Do
      Else
        If iDecCnt = 0 Then
          lCnt = lCnt + 1
        ReDim Preserve btTotal(lCnt) As Byte
       
          btTotal(lCnt) = 44  'Coma
        End If
       
        iDecCnt = iDecCnt + 1

        sCurDiv = sCurDiv & "0"
       
        If iDecCnt > MaxDec Then Exit Do
      End If
     
    End If
   
    lCnt = lCnt + 1
    ReDim Preserve btTotal(lCnt) As Byte

  Loop
 
  DivN = ByteToStrVal(btTotal)

End Function

Function EqualStr(String1 As String, String2 As String, CharFill As String) As Long
          Dim lLen1&, lLen2&

  lLen1 = Len(String1)
  lLen2 = Len(String2)
 
  If CharFill Like vbNullString Then CharFill = vbNullChar
 
  If lLen1 < lLen2 Then
    String1 = String$(lLen2 - lLen1, CharFill) & String1
    lLen1 = lLen2
  ElseIf lLen2 < lLen1 Then
    String2 = String$(lLen1 - lLen2, CharFill) & String2
    lLen2 = lLen1
  End If

  EqualStr = lLen1
End Function

Function NumCmp(ByVal Number1 As String, ByVal Number2 As String, CmpType As Integer) As Integer
          Dim iByte1%, iByte2%
          Dim lLen1&, lLen2&
          Dim sTempNum$
          Dim i&

  'Realiza la comparación por signo.
  '
  iByte1 = Left$(Number1, 1) Like "-"
  iByte2 = Left$(Number2, 1) Like "-"
 
  Select Case CmpType
    Case NUM_CMP_EQUAL: If iByte1 <> iByte2 Then Exit Function
    Case NUM_CMP_MAJOR
      If (iByte1 <> 0) And (iByte2 = 0) Then
        NumCmp = 0
        Exit Function
      End If
    Case NUM_CMP_MINOR
      If (iByte1 <> 0) And (iByte2 = 0) Then
        NumCmp = 1
        Exit Function
      End If
  End Select
 
  If (iByte1 <> 0) And (iByte2 <> 0) Then
    Number1 = Mid$(Number1, 2)
    Number2 = Mid$(Number2, 2)
   
    sTempNum = Number2
    Number2 = Number1
    Number1 = sTempNum
  End If
 
  'Realiza la comprobación exaustiva-
  '
  lLen1 = EqualStr(Number1, Number2, "0")
  lLen2 = lLen1

  For i = 1 To lLen1
    iByte1 = Val(Mid$(Number1, i, 1))
    iByte2 = Val(Mid$(Number2, i, 1))
   
    Select Case CmpType
      Case NUM_CMP_EQUAL
        If iByte1 <> iByte2 Then
          NumCmp = 0
          Exit For
        Else
          NumCmp = 1
        End If
      Case NUM_CMP_MAJOR
        If iByte1 > iByte2 Then
          NumCmp = 1
          Exit For
        ElseIf iByte1 <> iByte2 Then Exit For
        End If
      Case NUM_CMP_MINOR
        If iByte1 < iByte2 Then
          NumCmp = 1
          Exit For
        ElseIf iByte1 <> iByte2 Then Exit For
        End If
    End Select
  Next
End Function

Function ByteToStrVal(NumSpec() As Byte) As String
  On Error Resume Next
 
        Dim i&, sData$

  sData = StrConv(NumSpec, vbUnicode)
 
  For i = LBound(NumSpec) To UBound(NumSpec)
    If NumSpec(i) <> 0 Then Exit For
  Next
 
  sData = Mid$(sData, i)
 
  For i = 0 To 9
    sData = Replace$(sData, Chr$(i), CStr(i))
  Next
 
  ByteToStrVal = sData
End Function

Function StrToByteVal(Number As String) As Byte()
  On Error Resume Next
 
          Dim i&, lLen&
          Dim btData() As Byte

  lLen = Len(Number)
 
  btData = StrConv(Number, vbFromUnicode)
 
  For i = 0 To lLen - 1
    btData(i) = btData(i) - vbKey0
  Next
 
  StrToByteVal = btData
End Function

Saludos.
182  Programación / Programación Visual Basic / Re: Borrar historial desde VB en: 4 Septiembre 2005, 01:00 am
El historial de direcciones se encuentra en la siguiente clave del registro:

Código:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs

Borras los valores y ya.

Saludos.
183  Programación / Programación Visual Basic / Re: secuencia de instrucciones en VB6 en: 4 Septiembre 2005, 00:56 am
Primero te explico lo que hace. La variable estática sirve para mantener el mismo valor en cada intervalo de tiempo. Si no fuera estática cuando termina el procedimiento (End Sub) se borraría el valor.

Ahora con la cuestión del tiempo, el problema es que el Timer tiene un valor en la propiedad Interval predeterminado. Lo que podés hacer es crear un procedimiento para que espere un determinado tiempo, luego usarlo para esperar cuando el robot tiene que girar.

Por ejemplo:

Código:
Sub WaitSyn(Milliseconds As Long)
      Dim snTimer!

  snTimer = Timer

  'Entra al bucle y lo ejecuta hasta que se cumpla el tiempo especificado.
  '
  Do While (Timer - snTime) < (Milliseconds / 1000)
    DoEvents
  Loop
End Sub

Luego llamas a este procedimiento para que espere un determinado tiempo antes de que el robot gire:

Código:
Private Sub Timer1_Timer()
        Static iState%

  Select Case iState
    Case 0:
      'Haces que el robot realice una acción, en este caso sería que vaya hacia atrás.

    Case 1:
      'El Robot gira.

      'Espera tres segundos antes de hacer que el robot gire.
      '
      Call WaintSyn(3000)
    Case Else
      iState = 0
       Timer1.Enabled = False 'Deshabilita el Timer para que sólo haga la secuencia una vez.
  End Select

  iState = iState + 1
End Sub

Saludos.
184  Programación / Programación Visual Basic / Re: como saco el CommonDialog? en: 4 Septiembre 2005, 00:16 am
Le doy click a F2 ??? :o

Ctrl+T
Microsoft Windows Common Dialog Control 6.0

Saludos.
185  Programación / Programación Visual Basic / Re: Como hago que un formulario MDI cargue un form dentro de el en: 4 Septiembre 2005, 00:12 am
La siguiente función pude usarse para saber si un formulario está cargado o no. Usala con el nombre del formulario que quieras verficar, si está cargado que no cargue el otro de lo contrario que lo cargue.

Código:
Function IsLoaded(FormName As String) As Boolean
  On Error Resume Next
 
      Dim csForm

  For Each csForm In Forms
    If StrComp(csForm.Name, FormName, vbTextCompare) = 0 Then
      IsLoaded = True
     
      Exit For
    End If
  Next
End Function

Saludos.
186  Programación / Programación Visual Basic / Re: secuencia de instrucciones en VB6 en: 4 Septiembre 2005, 00:08 am
Antes que todo, excelente proyecto :), mis felicitaciones.

Ahora con el código, podrías usar un timer y una variable estática. El siguiente ejemplo muestra como hacerlo:

Código:
Private Sub Timer1_Timer()
        Static iState%

  Select Case iState
    Case 0:
      'Haces que el robot realice una acción, en este caso sería que vaya hacia atrás.

    Case 1:
      'El Robot gira.

    Case Else
      iState = 0
       Timer1.Enabled = False 'Deshabilita el Timer para que sólo haga la secuencia una vez.
  End Select

  iState = iState + 1
End Sub

Saludos.
187  Programación / Programación Visual Basic / Re: secuencia de instrucciones en VB6 en: 3 Septiembre 2005, 04:22 am
Deberías saber que el impulso viene de esos sensores, no entiendo cuál es el problema y para qué usas timers. Explicate un poco mejor.

Saludos.
188  Programación / Programación Visual Basic / Re: Pregunta interesante-VB en: 3 Septiembre 2005, 04:20 am
Código:
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Usa la función ShellExecute así se abre el explorador predeterminado.

Saludos.

P.D: ¿No podrías hacer cosas más productivas para aprender?
189  Programación / Programación Visual Basic / Declaraciones de WinInet en: 3 Septiembre 2005, 04:16 am
Ya que estamos con los módulos pongo las declaraciones de la API de WinInet, ya que son muy útiles para el manejo de cookies, historial, opciones de internet, bajar archivos, etc, etc, etc.

Código:
Option Explicit

'Funciones de WININET.DLL
'
Declare Function CommitUrlCacheEntry Lib "wininet" Alias "CommitUrlCacheEntryA" (ByVal lpszUrlName As String, ByVal lpszLocalFileName As String, ExpireTime As FILETIME, LastModifiedTime As FILETIME, ByVal CacheEntryType As Long, ByVal lpHeaderInfo As Byte, ByVal dwHeaderSize As Long, ByVal lpszFileExtension As String, ByVal dwReserved As Long) As Long
Declare Function CreateUrlCacheEntry Lib "wininet" Alias "CreateUrlCacheEntryA" (ByVal lpszUrlName As String, ByVal dwExpectedFileSize As Long, ByVal lpszFileExtension As String, ByVal lpszFileName As String, ByVal dwReserved As Long) As Long
Declare Function CreateUrlCacheGroup Lib "wininet" (ByVal dwFlags As Long, lpReserved As Any) As Long
Declare Function DeleteUrlCacheEntry Lib "wininet" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
Declare Function DeleteUrlCacheGroup Lib "wininet" (ByVal GroupID As Long, ByVal dwFlags As Long, lpReserved As Any) As Long
Declare Function FindCloseUrlCache Lib "wininet" (ByVal hEnumHandle As Long) As Long
Declare Function FindFirstUrlCacheEntry Lib "wininet" Alias "FindFirstUrlCacheEntryA" (ByVal lpszUrlSearchPattern As String, lpFirstCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwFirstCacheEntryInfoBufferSize As Long) As Long
Declare Function FindFirstUrlCacheEntryEx Lib "wininet" Alias "FindFirstUrlCacheEntryExA" (ByVal lpszUrlSearchPattern As String, ByVal dwFlags As Long, ByVal dwFilter As Long, ByVal GroupID As Long, lpFirstCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwFirstCacheEntryInfoBufferSize As Long, lpGroupAttributes As Any, ByVal pcbGroupAttributes As Long, lpReserved As Any) As Long
Declare Function FindNextUrlCacheEntry Lib "wininet" Alias "FindNextUrlCacheEntryA" (ByVal hEnumHandle As Long, lpNextCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwNextCacheEntryInfoBufferSize As Long) As Long
Declare Function FindNextUrlCacheEntryEx Lib "wininet" Alias "FindNextUrlCacheEntryExA" (ByVal hEnumHandle As Long, lpFirstCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwFirstCacheEntryInfoBufferSize As Long, lpGroupAttributes As Any, pcbGroupAttributes As Long, lpReserved As Any) As Long

Declare Function FtpCommand Lib "wininet" Alias "FtpCommandA" (ByVal hFtpConnect As Long, ByVal fExpectResponse As Long, ByVal dwFlag As Long, ByVal lpszCommand As String, ByVal dwContext As Long) As Long
Declare Function FtpCreateDirectory Lib "wininet" Alias "FtpCreateDirectoryA" (ByVal hFTPSession As Long, ByVal lpszDirectory As String) As Long
Declare Function FtpDeleteFile Lib "wininet" Alias "FtpDeleteFileA" (ByVal hFTPSession As Long, ByVal lpszFileName As String) As Long
Declare Function FtpFindFirstFile Lib "wininet" Alias "FtpFindFirstFileA" (ByVal hFTPSession As Long, ByVal lpszSearchFile As String, lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function FtpGetCurrentDirectory Lib "wininet" Alias "FtpGetCurrentDirectoryA" (ByVal hFTPSession As Long, ByVal lpszCurrentDirectory As String, ByVal lpdwCurrentDirectory As Long) As Long
Declare Function FtpGetFile Lib "wininet" Alias "FtpGetFileA" (ByVal hFTPSession As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Long, ByVal dwLocalFlagsAndAttributes As Long, ByVal dwInternetFlags As Long, ByVal dwContext As Long) As Long
Declare Function FtpOpenFile Lib "wininet" Alias "FtpOpenFileA" (ByVal hFTPSession As Long, ByVal lpszFileName As String, ByVal fdwAccess As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function FtpPutFile Lib "wininwt" Alias "FtpPutFileA" (ByVal hFTPSession As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function FtpRemoveDirectory Lib "wininet" Alias "FtpRemoveDirectoryA" (ByVal hFTPSession As Long, ByVal lpszDirectory As String) As Long
Declare Function FtpRenameFile Lib "wininet" Alias "FtpRenameFileA" (ByVal hFTPSession As Long, ByVal lpszExisting As String, ByVal lpszNew As String) As Long
Declare Function FtpSetCurrentDirectory Lib "wininet" Alias "FtpSetCurrentDirectoryA" (ByVal hFTPSession As Long, ByVal lpszDirectory As String) As Long

Declare Function GetUrlCacheEntryInfo Lib "wininet" Alias "GetUrlCacheEntryInfoA" (ByVal lpszUrlName As String, lpCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwCacheEntryInfoBufferSize As Long) As Long
Declare Function GetUrlCacheEntryInfoEx Lib "wininet" Alias "GetUrlCacheEntryInfoExA" (ByVal lpszUrlName As String, lpCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwCacheEntryInfoBufferSize As Long, ByVal lpszReserved As String, ByVal lpdwReserved As Long, lpReserved As Any, ByVal dwFlags As Long) As Long

Declare Function GopherCreateLocator Lib "wininet" Alias "GopherCreateLocatorA" (ByVal lpszHost As String, ByVal nServerPort As Integer, ByVal lpszDisplayString As String, ByVal lpszSelectorString As String, ByVal dwGopherType As Long, ByVal lpszLocator As String, ByVal lpdwBufferLength As Long) As Long
Declare Function GopherFindFirstFile Lib "wininet" Alias "GopherFindFirstFileA" (ByVal hGopherSession As Long, ByVal lpszLocator As String, ByVal lpszSearchString As String, lpFindData As GOPHER_FIND_DATA, ByVal dwFlags As Long, ByVal dwContext As Long)
Declare Function GopherGetAttribute Lib "wininet" Alias "GopherGetAttributeA" (ByVal hGopherSession As Long, ByVal lpszLocator As String, ByVal lpszAttributeName As String, ByVal lpBuffer As Byte, ByVal dwBufferLength As Long, ByVal lpdwCharactersReturned As Long, ByVal lpfnEnumerator As Long, ByVal dwContext As Long) As Long
Declare Function GopherGetLocatorType Lib "wininet" Alias "GopherGetLocatorTypeA" (ByVal lpszLocator As String, ByVal lpdwGopherType As Long) As Long
Declare Function GopherOpenFile Lib "wininet" Alias "GopherOpenFileA" (ByVal hGopherSession As Long, ByVal lpszLocator As String, ByVal lpszView As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Long

Declare Function HttpAddRequestHeaders Lib "wininet" Alias "HttpAddRequestHeadersA" (ByVal hHttpRequest As Long, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwModifiers As Long) As Long
Declare Function HttpEndRequest Lib "wininet" Alias "HttpEndRequestA" (ByVal hRequest As Long, lpBuffersOut As INTERNET_BUFFERS, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function HttpOpenRequest Lib "wininet" Alias "HttpOpenRequestA" (ByVal hHttpSession As Long, ByVal lpszVerb As String, ByVal lpszObjectName As String, ByVal lpszVersion As String, ByVal lpszReferer As String, lpszAcceptTypes() As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function HttpQueryInfo Lib "wininet" Alias "HttpQueryInfoA" (ByVal hHttpRequest As Long, ByVal dwInfoLevel As Long, lpvBuffer As Any, ByVal lpdwBufferLength As Long, ByVal lpdwIndex As Long) As Long
Declare Function HttpSendRequest Lib "wininet" Alias "HttpSendRequestA" (ByVal hHttpRequest As Long, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, lpOptional As Any, ByVal dwOptionalLength As Long) As Long
Declare Function HttpSendRequestEx Lib "wininet" Alias "HttpSendRequestExA" (ByVal hRequest As Long, lpBuffersIn As INTERNET_BUFFERS, lpBuffersOut As INTERNET_BUFFERS, ByVal dwFlags As Long, ByVal dwContext As Long) As Long

Declare Function InternetAttemptConnect Lib "wininet" Alias "" (ByVal dwReserved As Long) As Long
Declare Function InternetAutodial Lib "wininet" Alias "" (ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Declare Function InternetAutodialHangup Lib "wininet" Alias "" (ByVal dwReserved As Long) As Long
Declare Function InternetCanonicalizeUrl Lib "wininet" Alias "InternetCanonicalizeUrlA" (ByVal lpszUrl As String, ByVal lpszBuffer As String, ByVal lpdwBufferLength As Long, ByVal dwFlags As Long) As Long
Declare Function InternetCheckConnection Lib "wininet" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long)
Declare Function InternetCloseHandle Lib "wininet" (ByVal hInet As Long) As Long
Declare Function InternetCombineUrl Lib "wininet" Alias "InternetCombineUrlA" (ByVal lpszBaseUrl As String, ByVal lpszRelativeUrl As String, ByVal lpszBuffer As String, lpdwBufferLength As Long, ByVal dwFlags As Long) As Long
Declare Function InternetConfirmZoneCrossing Lib "wininet" Alias "InternetConfirmZoneCrossingA" (ByVal hWnd As Long, ByVal szUrlPrev As String, ByVal szUrlNew As Long, ByVal bPost As Boolean) As Long
Declare Function InternetConnect Lib "wininet" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal lpszServerName As String, ByVal nServerPort As Long, ByVal lpszUsername As String, ByVal lpszPassword As String, ByVal dwService As Long, ByVal dwFlags As Long, ByVal dwContext As Long)
Declare Function InternetCrackUrl Lib "wininet" Alias "InternetCrackUrlA" (ByVal lpszUrl As String, ByVal dwUrlLength As Long, ByVal dwFlags As Long, lpUrlComponents As URL_COMPONENTS)
Declare Function InternetCreateUrl Lib "wininet" Alias "InternetCreateUrlA" (lpUrlComponents As URL_COMPONENTS, ByVal dwFlags As Long, ByVal lpszUrl As String, ByVal lpdwUrlLength As Long) As Long
Declare Function InternetDial Lib "wininet" Alias "InternetDialA" (ByVal hwndParent As Long, ByVal lpszConnectoid As String, ByVal dwFlags As Long, ByVal lpdwConnection As Long, ByVal dwReserved As Long) As Long
Declare Function InternetErrorDlg Lib "wininet" (ByVal hWnd As Long, ByVal hInternet As Long, ByVal dwError As Long, ByVal dwFlags As Long, lppvData As Any) As Long
Declare Function InternetFindNextFile Lib "wininet" Alias "InternetFindNextFileA" (ByVal hFind As Long, lpvFindData As Any) As Long
Declare Function InternetGetConnectedState Lib "wininet" (ByVal lpdwFlags As Long, ByVal dwReserved As Long) As Long
Declare Function InternetGetCookie Lib "wininet" Alias "InternetGetCookieA" (ByVal lpszUrlName As String, ByVal lpszCookieName As String, ByVal lpszCookieData As String, ByVal lpdwSize As Long) As Long
Declare Function InternetGetLastResponseInfo Lib "wininet" Alias "InternetGetLastResponseInfoA" (ByVal lpdwError As Long, ByVal lpszBuffer As String, ByVal lpdwBufferLength As Long) As Long
Declare Function InternetGoOnline Lib "wininet" Alias "InternetGoOnlineA" (ByVal lpszUrl As String, ByVal hwndParent As Long, ByVal dwReserved As Long) As Long
Declare Function InternetHangUp Lib "wininet" (ByVal dwConnection As Long, ByVal dwReserved As Long) As Long
Declare Function InternetLockRequestFile Lib "wininet" (ByVal hInternet As Long, lphLockReqHandle As Long)
Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA" (ByVal lpszAgent As String, ByVal dwAccessType As Long, ByVal lpszProxyName As String, ByVal lpszProxyBypass As String, ByVal dwFlags As Long) As Long
Declare Function InternetOpenUrl Lib "wininet" Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function InternetQueryDataAvailable Lib "wininet" (ByVal hFile As Long, lpdwNumberOfBytesAvailable As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function InternetQueryOption Lib "wininet" Alias "InternetQueryOptionA" (ByVal hInternet As Long, ByVal dwOption As Long, ByVal lpBuffer As String, ByVal lpdwBufferLength As Long) As Long
Declare Function InternetReadFile Lib "wininet" Alias "InternetReadFileA" (ByVal hFile As Long, lpBuffer As Any, ByVal dwNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long) As Long
Declare Function InternetReadFileEx Lib "wininet" Alias "InternetReadFileExA" (ByVal hFile As Long, lpBuffersOut As INTERNET_BUFFERS, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Declare Function InternetSetCookie Lib "wininet" Alias "InternetSetCookieA" (ByVal lpszUrlName As String, ByVal lpszCookieName As String, ByVal lpszCookieData As Long) As Long
Declare Function InternetSetDialState Lib "wininet" Alias "InternetSetDialStateA" (ByVal lpszConnectoid As String, ByVal dwState As Long, ByVal dwReserved As Long) As Long
Declare Function InternetSetFilePointer Lib "wininet" (ByVal hFile As Long, ByVal lDistanceToMove As Long, pReserved As Any, ByVal dwMoveMethod As Long, ByVal dwContext As Long) As Long
Declare Function InternetSetOption Lib "wininet" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal dwOption As Long, ByVal lpBuffer As Long, ByVal dwBufferLength As Long) As Long
Declare Function InternetSetStatusCallback Lib "wininet" Alias "InternetSetStatusCallbackA" (ByVal hInternet As Long, ByVal lpfnInternetCallback As Long) As Long
Declare Function InternetTimeFromSystemTime Lib "wininet" Alias "InternetTimeFromSystemTimeA" (pst As SystemTime, ByVal dwRFC As Long, ByVal lpszTime As String, ByVal cbTime As Long) As Long
Declare Function InternetUnlockRequestFile Lib "wininet" Alias "" (ByVal hLockHandle As Long) As Long
Declare Function InternetWriteFile Lib "wininet" (ByVal hFile As Long, lpBuffer As Any, ByVal dwNumberOfBytesToWrite As Long, ByVal lpdwNumberOfBytesWritten As Long) As Long

Declare Function ReadUrlCacheEntryStream Lib "wininet" (ByVal hUrlCacheStream As Long, ByVal dwLocation As Long, lpBuffer As Any, lpdwLen As Long, ByVal dwReserved As Long) As Long
Declare Function RetrieveUrlCacheEntryFile Lib "wininet" Alias "RetrieveUrlCacheEntryFileA" (ByVal lpszUrlName As String, lpCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwCacheEntryInfoBufferSize As Long, ByVal dwReserved As Long) As Long
Declare Function RetrieveUrlCacheEntryStream Lib "wininet" Alias "RetrieveUrlCacheEntryStreamA" (ByVal lpszUrlName As String, lpCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal lpdwCacheEntryInfoBufferSize As Long, ByVal fRandomRead As Boolean, ByVal dwReserved As Long) As Long
Declare Function SetUrlCacheEntryGroup Lib "wininet" Alias "SetUrlCacheEntryGroupA" (ByVal lpszUrlName As String, ByVal dwFlags As Long, ByVal GroupID As Long, ByVal pbGroupAttributes As Byte, ByVal cbGroupAttributes As Long, lpReserved As Any) As Long
Declare Function SetUrlCacheEntryInfo Lib "wininet" Alias "SetUrlCacheEntryInfoA" (ByVal lpszUrlName As String, lpCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, ByVal dwFieldControl As Long) As Long
Declare Function UnlockUrlCacheEntryFile Lib "wininet" Alias "UnlockUrlCacheEntryFileA" (ByVal lpszUrlName As String, ByVal dwReserved As Long) As Long
Declare Function UnlockUrlCacheEntryStream Lib "wininet" (ByVal hUrlCacheStream As Long, ByVal dwReserved As Long) As Long


Public Const INTERNET_OPEN_TYPE_PRECONFIG = 0      'indicates to use config info from registry
Public Const INTERNET_OPEN_TYPE_DIRECT = 1         'direct to net
Public Const INTERNET_OPEN_TYPE_PROXY = 3          'via named proxy

Public Const INTERNET_FLAG_EXISITING_CONNECT = &H20000000
Public Const INTERNET_FLAG_RELOAD = &H80000000   ' read from wire even if locally cached

'Opciones adicionales
Public Const INTERNET_FLAG_SECURE = &H800000    'use PCT/SSL if applicable (HTTP)
Public Const INTERNET_FLAG_KEEP_CONNECTION = &H400000   'use keep-alive semantics
Public Const INTERNET_FLAG_NO_AUTO_REDIRECT = &H200000     'don't handle redirections automatically
Public Const INTERNET_FLAG_READ_PREFETCH = &H100000        'do background read prefetch
Public Const INTERNET_FLAG_NO_COOKIES = &H80000    'no automatic cookie handling
Public Const INTERNET_FLAG_NO_AUTH = &H40000    'no automatic authentication handling

'Opciones del cache
Public Const INTERNET_FLAG_MUST_CACHE_REQUEST = &H10    'fails if unable to cache request
Public Const INTERNET_FLAG_RESYNCHRONIZE = &H800        'asking wininet to update an item if it is newer

'Opciones de seguridad
Public Const INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP = &H8000       'ex: https:// to http://
Public Const INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS = &H4000      'ex: http:// to https://
Public Const INTERNET_FLAG_IGNORE_CERT_DATE_INVALID = &H2000      'expired X509 Cert.
Public Const INTERNET_FLAG_IGNORE_CERT_CN_INVALID = &H1000        'bad common name in X509 Cert.

Public Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000   'don't write this item to the cache
Public Const INTERNET_FLAG_DONT_CACHE = INTERNET_FLAG_NO_CACHE_WRITE
Public Const INTERNET_FLAG_MAKE_PERSISTENT = &H2000000      'make this item persistent in cache

'Longitud máxima de campos
Public Const INTERNET_MAX_HOST_NAME_LENGTH = 256
Public Const INTERNET_MAX_USER_NAME_LENGTH = 128
Public Const INTERNET_MAX_PASSWORD_LENGTH = 128
Public Const INTERNET_MAX_PORT_NUMBER_LENGTH = 5    'INTERNET_PORT is unsigned short
Public Const INTERNET_MAX_PORT_NUMBER_VALUE = 65535     'maximum unsigned short value
Public Const INTERNET_MAX_PATH_LENGTH = 2048
Public Const INTERNET_MAX_PROTOCOL_NAME = "gopher"  'longest protocol name
Public Const INTERNET_MAX_URL_LENGTH = (6 - 1 + 3 + INTERNET_MAX_PATH_LENGTH)   '6=Len(INTERNET_MAX_PROTOCOL_NAME); 3=Len("://")

'Para FTP
Public Const FTP_TRANSFER_TYPE_UNKNOWN = &H0
Public Const FTP_TRANSFER_TYPE_ASCII = &H1
Public Const FTP_TRANSFER_TYPE_BINARY = &H2

Public Const INTERNET_FLAG_TRANSFER_ASCII = FTP_TRANSFER_TYPE_ASCII
Public Const INTERNET_FLAG_TRANSFER_BINARY = FTP_TRANSFER_TYPE_BINARY

Public Const FTP_TRANSFER_TYPE_MASK = (FTP_TRANSFER_TYPE_ASCII Or FTP_TRANSFER_TYPE_BINARY)

'Para Gopher
'Tipo de datos
Public Const GOPHER_TYPE_TEXT_FILE = &H1    'Archivo de texto
Public Const GOPHER_TYPE_DIRECTORY = &H2    'Directorio
Public Const GOPHER_TYPE_CSO = &H4          'Servidor de libreta de direcciones CSO
Public Const GOPHER_TYPE_ERROR = &H8        'Indicador de error
Public Const GOPHER_TYPE_MAC_BINHEX = &H10  'Archivo Macintosh en formato BINHEX
Public Const GOPHER_TYPE_DOS_ARCHIVE = &H20     'Archivo de MS-DOS
Public Const GOPHER_TYPE_UNIX_UUENCODED = &H40  'Archivo UUENCODED
Public Const GOPHER_TYPE_INDEX_SERVER = &H80    'Servidor de indices
Public Const GOPHER_TYPE_TELNET = &H100     'Servidor Telnet
Public Const GOPHER_TYPE_BINARY = &H200     'Archivo binario
Public Const GOPHER_TYPE_REDUNDANT = &H400  'Indica que es un duplicado del servidor
Public Const GOPHER_TYPE_TN3270 = &H800     'Servidor TN3270
Public Const GOPHER_TYPE_GIF = &H1000       'Archivo de imagen GIF
Public Const GOPHER_TYPE_IMAGE = &H2000     'Archivo de imagen
Public Const GOPHER_TYPE_BITMAP = &H4000    'Archivo de mapa de bits
Public Const GOPHER_TYPE_MOVIE = &H8000     'Archivo de película
Public Const GOPHER_TYPE_SOUND = &H10000    'Archivo de sonido
Public Const GOPHER_TYPE_HTML = &H20000     'Documento HTML
Public Const GOPHER_TYPE_PDF = &H40000      'Archivo PDF
Public Const GOPHER_TYPE_CALENDAR = &H80000     'Archivo de calendario
Public Const GOPHER_TYPE_INLINE = &H100000      'Archivo Inline
Public Const GOPHER_TYPE_UNKNOWN = &H20000000   'Elemento desconocido
Public Const GOPHER_TYPE_ASK = &H40000000       'Ask+ Item
Public Const GOPHER_TYPE_GOPHER_PLUS = &H80000000   'Gopher+ Item

Public Const MAX_GOPHER_DISPLAY_TEXT = 128
Public Const MAX_GOPHER_SELECTOR_TEXT = 256
Public Const MAX_GOPHER_HOST_NAME = INTERNET_MAX_HOST_NAME_LENGTH
Public Const MAX_GOPHER_LOCATOR_LENGTH = (1 + MAX_GOPHER_DISPLAY_TEXT + 1 + MAX_GOPHER_SELECTOR_TEXT + 1 + MAX_GOPHER_HOST_NAME + 1 + INTERNET_MAX_PORT_NUMBER_LENGTH + 1 + 1 + 2)

'Para HTTP
Public Const HTTP_QUERY_MIME_VERSION = 0
Public Const HTTP_QUERY_CONTENT_TYPE = 1
Public Const HTTP_QUERY_CONTENT_TRANSFER_ENCODING = 2
Public Const HTTP_QUERY_CONTENT_ID = 3
Public Const HTTP_QUERY_CONTENT_DESCRIPTION = 4
Public Const HTTP_QUERY_CONTENT_LENGTH = 5
Public Const HTTP_QUERY_CONTENT_LANGUAGE = 6
Public Const HTTP_QUERY_ALLOW = 7
Public Const HTTP_QUERY_PUBLIC = 8
Public Const HTTP_QUERY_DATE = 9
Public Const HTTP_QUERY_EXPIRES = 10
Public Const HTTP_QUERY_LAST_MODIFIED = 11
Public Const HTTP_QUERY_MESSAGE_ID = 12
Public Const HTTP_QUERY_URI = 13
Public Const HTTP_QUERY_DERIVED_FROM = 14
Public Const HTTP_QUERY_COST = 15
Public Const HTTP_QUERY_LINK = 16
Public Const HTTP_QUERY_PRAGMA = 17
Public Const HTTP_QUERY_VERSION = 18                        'special: part of status line
Public Const HTTP_QUERY_STATUS_CODE = 19                    'special: part of status line
Public Const HTTP_QUERY_STATUS_TEXT = 20                    'special: part of status line
Public Const HTTP_QUERY_RAW_HEADERS = 21                    'special: all headers as ASCIIZ
Public Const HTTP_QUERY_RAW_HEADERS_CRLF = 22               'special: all headers
Public Const HTTP_QUERY_CONNECTION = 23
Public Const HTTP_QUERY_ACCEPT = 24
Public Const HTTP_QUERY_ACCEPT_CHARSET = 25
Public Const HTTP_QUERY_ACCEPT_ENCODING = 26
Public Const HTTP_QUERY_ACCEPT_LANGUAGE = 27
Public Const HTTP_QUERY_AUTHORIZATION = 28
Public Const HTTP_QUERY_CONTENT_ENCODING = 29
Public Const HTTP_QUERY_FORWARDED = 30
Public Const HTTP_QUERY_FROM = 31
Public Const HTTP_QUERY_IF_MODIFIED_SINCE = 32
Public Const HTTP_QUERY_LOCATION = 33
Public Const HTTP_QUERY_ORIG_URI = 34
Public Const HTTP_QUERY_REFERER = 35
Public Const HTTP_QUERY_RETRY_AFTER = 36
Public Const HTTP_QUERY_SERVER = 37
Public Const HTTP_QUERY_TITLE = 38
Public Const HTTP_QUERY_USER_AGENT = 39
Public Const HTTP_QUERY_WWW_AUTHENTICATE = 40
Public Const HTTP_QUERY_PROXY_AUTHENTICATE = 41
Public Const HTTP_QUERY_ACCEPT_RANGES = 42
Public Const HTTP_QUERY_SET_COOKIE = 43
Public Const HTTP_QUERY_COOKIE = 44
Public Const HTTP_QUERY_REQUEST_METHOD = 45                 'special: GET/POST etc.
Public Const HTTP_QUERY_MAX = 45
Public Const HTTP_QUERY_CUSTOM = 65535
Public Const HTTP_QUERY_FLAG_REQUEST_HEADERS = &H80000000
Public Const HTTP_QUERY_FLAG_SYSTEMTIME = &H40000000
Public Const HTTP_QUERY_FLAG_NUMBER = &H20000000
Public Const HTTP_QUERY_FLAG_COALESCE = &H10000000

'Servidores de Internet
Public Const INTERNET_SERVICE_FTP = 1
Public Const INTERNET_SERVICE_GOPHER = 2
Public Const INTERNET_SERVICE_HTTP = 3

'Indicadores para InternetQueryOption e InternetSetOption
Public Const INTERNET_OPTION_CALLBACK = 1
Public Const INTERNET_OPTION_CONNECT_TIMEOUT = 2
Public Const INTERNET_OPTION_CONNECT_RETRIES = 3
Public Const INTERNET_OPTION_CONNECT_BACKOFF = 4
Public Const INTERNET_OPTION_SEND_TIMEOUT = 5
Public Const INTERNET_OPTION_CONTROL_SEND_TIMEOUT = INTERNET_OPTION_SEND_TIMEOUT
Public Const INTERNET_OPTION_RECEIVE_TIMEOUT = 6
Public Const INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT = INTERNET_OPTION_RECEIVE_TIMEOUT
Public Const INTERNET_OPTION_DATA_SEND_TIMEOUT = 7
Public Const INTERNET_OPTION_DATA_RECEIVE_TIMEOUT = 8
Public Const INTERNET_OPTION_HANDLE_TYPE = 9
Public Const INTERNET_OPTION_CONTEXT_VALUE = 10

Public Const INTERNET_OPTION_READ_BUFFER_SIZE = 12
Public Const INTERNET_OPTION_WRITE_BUFFER_SIZE = 13

Public Const INTERNET_OPTION_ASYNC_ID = 15
Public Const INTERNET_OPTION_ASYNC_PRIORITY = 16

Public Const INTERNET_OPTION_PARENT_HANDLE = 21
Public Const INTERNET_OPTION_KEEP_CONNECTION = 22
Public Const INTERNET_OPTION_REQUEST_FLAGS = 23
Public Const INTERNET_OPTION_EXTENDED_ERROR = 24

Public Const INTERNET_OPTION_OFFLINE_MODE = 26
Public Const INTERNET_OPTION_CACHE_STREAM_HANDLE = 27
Public Const INTERNET_OPTION_USERNAME = 28
Public Const INTERNET_OPTION_PASSWORD = 29
Public Const INTERNET_OPTION_ASYNC = 30
Public Const INTERNET_OPTION_SECURITY_FLAGS = 31
Public Const INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT = 32
Public Const INTERNET_OPTION_DATAFILE_NAME = 33
Public Const INTERNET_OPTION_URL = 34
Public Const INTERNET_OPTION_SECURITY_CERTIFICATE = 35
Public Const INTERNET_OPTION_SECURITY_KEY_BITNESS = 36
Public Const INTERNET_OPTION_REFRESH = 37
Public Const INTERNET_OPTION_PROXY = 38
Public Const INTERNET_OPTION_SETTINGS_CHANGED = 39
Public Const INTERNET_OPTION_VERSION = 40

'Estados de la conexión
Public Const INTERNET_STATUS_RESOLVING_NAME = 10
Public Const INTERNET_STATUS_NAME_RESOLVED = 11
Public Const INTERNET_STATUS_CONNECTING_TO_SERVER = 20
Public Const INTERNET_STATUS_CONNECTED_TO_SERVER = 21
Public Const INTERNET_STATUS_SENDING_REQUEST = 30
Public Const INTERNET_STATUS_REQUEST_SENT = 31
Public Const INTERNET_STATUS_RECEIVING_RESPONSE = 40
Public Const INTERNET_STATUS_RESPONSE_RECEIVED = 41
Public Const INTERNET_STATUS_CTL_RESPONSE_RECEIVED = 42
Public Const INTERNET_STATUS_PREFETCH = 43
Public Const INTERNET_STATUS_CLOSING_CONNECTION = 50
Public Const INTERNET_STATUS_CONNECTION_CLOSED = 51
Public Const INTERNET_STATUS_HANDLE_CREATED = 60
Public Const INTERNET_STATUS_HANDLE_CLOSING = 70
Public Const INTERNET_STATUS_REQUEST_COMPLETE = 100
Public Const INTERNET_STATUS_REDIRECT = 110

'Puertos estandard
Public Const INTERNET_DEFAULT_FTP_PORT = 21               'default for FTP servers
Public Const INTERNET_DEFAULT_GOPHER_PORT = 70            '    "     "  gopher "
Public Const INTERNET_DEFAULT_HTTP_PORT = 80              '    "     "  HTTP   "
Public Const INTERNET_DEFAULT_HTTPS_PORT = 443            '    "     "  HTTPS  "
Public Const INTERNET_DEFAULT_SOCKS_PORT = 1080           'default for SOCKS firewall servers.

'Modos de acceso a los archivos
Public Const GENERIC_READ = &H80000000
Public Const GENERIC_WRITE = &H40000000

'Posiciones en el archivo
Public Const FILE_BEGIN = 0
Public Const FILE_CURRENT = 1
Public Const FILE_END = 2

Public Const MAX_PATH = 260

Public Type FILETIME
  dwLowDateTime   As Long
  dwHighDateTime  As Long
End Type

Public Type SystemTime
  wYear         As Integer
  wMonth        As Integer
  wDayOfWeek    As Integer
  wDay          As Integer
  wHour         As Integer
  wMinute       As Integer
  wSecond       As Integer
  wMilliseconds As Integer
End Type

Public Type INTERNET_CACHE_ENTRY_INFO_UNION
  dwReserved    As Long
  dwExemptDelta As Long
End Type

Public Type INTERNET_CACHE_ENTRY_INFO
  dwStructSize      As Long    'Tamaño, en bytes de la estructura
  lpszSourceUrlName As String 'Dirección URL
  lpszLocalFileName As String 'Nombre del archivo local
  CacheEntryType    As Long
  dwUseCount        As Long  'Cuenta del usuario actual de la entrada del cache
  dwHitRate         As Long   'Numero de veces que la entrada del cache fue recuperada
  dwSizeLow         As Long
  dwSizeHigh        As Long
  LastModifiedTime  As FILETIME
  ExpireTime        As FILETIME
  LastAccessTime    As FILETIME
  LastSyncTime      As FILETIME
  lpHeaderInfo      As Byte    'Dirección del búfer que contiene la información del encabezado
  dwHeaderInfoSize  As Long    'Tamaño del búfer de lpHeaderInfo
  lpszFileExtension As String
  Union             As INTERNET_CACHE_ENTRY_INFO_UNION
End Type

Public Type WIN32_FIND_DATA
  dwFileAttributes  As Long
  ftCreationTime    As FILETIME
  ftLastAccessTime  As FILETIME
  ftLastWriteTime   As FILETIME
  nFileSizeHigh     As Long
  nFileSizeLow      As Long
  dwReserved0       As Long
  dwReserved1       As Long
  cFileName         As String * MAX_PATH
  cAlternate        As String * 14
End Type

Public Type GOPHER_FIND_DATA
  DisplayString(MAX_GOPHER_DISPLAY_TEXT + 1) As Byte
  GopherType            As Long
  SizeLow               As Long
  SizeHigh              As Long
  LastModificationTime  As FILETIME
  Locator(MAX_GOPHER_LOCATOR_LENGTH + 1) As Byte
End Type

Public Type GOPHER_ADMIN_ATTRIBUTE_TYPE
  Comment       As String
  EmailAddress  As String
End Type

Public Type GOPHER_SCORE_ATTRIBUTE_TYPE
  Score As Integer
End Type

Public Type GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE
  LowerBound As Integer
  UpperBound As Integer
End Type

Public Type GOPHER_SITE_ATTRIBUTE_TYPE
  Site As String
End Type

Public Type GOPHER_ORGANIZATION_ATTRIBUTE_TYPE
  Organization As String
End Type

Public Type GOPHER_LOCATION_ATTRIBUTE_TYPE
  Location As String
End Type

Public Type GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE
  DegreesNorth  As Integer
  MinutesNorth  As Integer
  SecondsNorth  As Integer
  DegreesEast   As Integer
  MinutesEast   As Integer
  SecondsEast   As Integer
End Type

Public Type GOPHER_TIMEZONE_ATTRIBUTE_TYPE
  Zone As Integer
End Type

Public Type GOPHER_PROVIDER_ATTRIBUTE_TYPE
  Provider As String
End Type

Public Type GOPHER_VERSION_ATTRIBUTE_TYPE
  Version As String
End Type

Public Type GOPHER_ABSTRACT_ATTRIBUTE_TYPE
  ShortAbstract As String
  AbstractFile  As String
End Type

Public Type GOPHER_VIEW_ATTRIBUTE_TYPE
  ContentType As String
  Language    As String
  Size        As Long
End Type

Public Type GOPHER_VERONICA_ATTRIBUTE_TYPE
  TreeWalk As Long
End Type

Public Type GOPHER_ASK_ATTRIBUTE_TYPE
  QuestionType As String
  QuestionText As String
End Type

Public Type GOPHER_UNKNOWN_ATTRIBUTE_TYPE
  Text As String
End Type

Public Type GOPHER_ATTRIBUTE_TYPE_UNION
  Admin                 As GOPHER_ADMIN_ATTRIBUTE_TYPE
  ModDate               As FILETIME
  Score                 As GOPHER_SCORE_ATTRIBUTE_TYPE
  ScoreRange            As GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE
  Site                  As GOPHER_SITE_ATTRIBUTE_TYPE
  Organization          As GOPHER_ORGANIZATION_ATTRIBUTE_TYPE
  Location              As GOPHER_LOCATION_ATTRIBUTE_TYPE
  GeographicalLocation  As GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE
  TimeZone              As GOPHER_TIMEZONE_ATTRIBUTE_TYPE
  Provider              As GOPHER_PROVIDER_ATTRIBUTE_TYPE
  Version               As GOPHER_VERSION_ATTRIBUTE_TYPE
  Abstract              As GOPHER_ABSTRACT_ATTRIBUTE_TYPE
  View                  As GOPHER_VIEW_ATTRIBUTE_TYPE
  Veronica              As GOPHER_VERONICA_ATTRIBUTE_TYPE
  Ask                   As GOPHER_ASK_ATTRIBUTE_TYPE
  Unknown               As GOPHER_UNKNOWN_ATTRIBUTE_TYPE
End Type

Public Type GOPHER_ATTRIBUTE_TYPE
  CategoryId    As Long
  AttributeId   As Long
  AttributeType As GOPHER_ATTRIBUTE_TYPE_UNION
End Type

Public Type INTERNET_BUFFERS
  dwStructSize    As Long
  Next            As Long      'Dirección del siguiente INTERNET_BUFFERS
  lpcszHeader     As String    'Cadena que contiene los encabezados
  dwHeadersLength As Long      'Tamaño de los encabezados si lpcszHeader no es Nulo
  dwHeadersTotal  As Long      'Tamaño total de los encabezados si no hay suficiente memoria en lpcszHeader
  lpvBuffer       As Variant   'Búfer de datos
  dwBufferLength  As Long      'Tamaño de lpvBuffer si lpvBuffer no es Nulo
  dwBufferTotal   As Long
  dwOffsetLow     As Long      'Usado para leer rangos
  dwOffsetHigh    As Long      'Usado para leer rangos
End Type

Public Type URL_COMPONENTS
  dwStructSize      As Long
  lpszScheme        As String
  dwSchemeLength    As Long
  nScheme           As Integer
  lpszHostName      As String
  dwHostNameLength  As Long
  nPort             As Integer
  lpszUsername      As String
  dwUserNameLength  As Long
  lpszPassword      As String
  dwPasswordLength  As Long
  lpszUrlPath       As String
  dwUrlPathLength   As Long
  lpszExtraInfo     As String
  dwExtraInfoLength As Long
End Type

Function InternetStatusCallback(ByVal hInternet As Long, ByVal dwContext As Long, ByVal dwInternetStatus As Long, lpvStatusInformation As Variant, ByVal dwStatusInformationLength As Long)

End Function

Saludos.
190  Programación / Programación Visual Basic / Re: Porqué???!!!!! duda al crear troyano en vb en: 2 Septiembre 2005, 11:37 am
Label1 tiene que ser un control Label.

Saludos.
Páginas: 1 ... 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ... 55
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines