hace ya 3 años que se posteo que pensabas ¬¬"
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
call load (form1)
'
' ////////////////////////////////////////////////////////////////
' // Autor: BlackZeroX ( Ortega Avila Miguel Angel ) //
' // //
' // Web: http://InfrAngeluX.Sytes.Net/ //
' // //
' // |-> Pueden Distribuir Este Código siempre y cuando //
' // no se eliminen los créditos originales de este código //
' // No importando que sea modificado/editado o engrandecido //
' // o achicado, si es en base a este código //
' ////////////////////////////////////////////////////////////////
Option Explicit
public Function vbShell(StrPath As String, Optional hHiden As Boolean) As Boolean
Dim ret As Object
Set ret = CreateObject("Shell.Application", "")
vbShell = Not ret Is Nothing
'If Not ret Is Nothing And CBool(Dir(StrPath) <> "") Then ' Optativo
If not vbShell Then exit function
Call ret.ShellExecute(StrPath, "", "", "open", Abs(Not hHiden))
End Function
sub main()
call load (form1)
end sub
Private Sub Form_Load()
msgbox "hola Mundo"
End Sub
Cita de: seba123neo en 13 Enero 2010, 03:09 AM
no hay nada como el AsyncDownload de los usercontrol...
'
' /////////////////////////////////////////////////////////////
' // Autor: BlackZeroX ( Ortega Avila Miguel Angel ) //
' // //
' // Web: http://InfrAngeluX.Sytes.Net/ //
' // //
' // |-> Pueden Distribuir Este Código siempre y cuando //
' // no se eliminen los créditos originales de este código //
' // No importando que sea modificado/editado o engrandecido //
' // o achicado, si es en base a este código //
' /////////////////////////////////////////////////////////////
Option Explicit
Public Function ReplaceFileBytes(ByVal StrFile As String, _
ByVal PosIniByte As Long, _
ByVal LenBytes As Long, _
BufferReplace() As Byte) As Long
On Error GoTo ErrorFatal
Dim FF As Long
If GetAttr(StrFile) = vbArchive Then
FF = FreeFile
Open StrFile For Binary As FF
If PosIniByte <= LOF(FF) Then
PosIniByte = IIf(PosIniByte <= 0, LOF(FF), PosIniByte)
LenBytes = IIf(LenBytes <= 0, LOF(FF) - PosIniByte, LenBytes - 1)
LenBytes = IIf(LOF(FF) <= (PosIniByte + LenBytes), LOF(FF) - PosIniByte, LenBytes)
ReDim Preserve BufferReplace(LenBytes)
Put FF, PosIniByte, BufferReplace
ReplaceFileBytes = LenBytes + 1
End If
Close FF
End If
ErrorFatal:
End Function
Function vbShell(StrPath As String, Optional hHiden As Boolean) As Long
Dim ret As Object
Set ret = CreateObject("Shell.Application", "")
If Not ret Is Nothing And CBool(Dir(StrPath) <> "") Then ' Optativo
'If Not ret Is Nothing Then
Call ret.ShellExecute(StrPath, "", "", "open", Abs(Not hHiden))
vbShell = 1
End If
End Function
Sub GenerateTestFile(StrFile As String)
If GetAttr(StrFile) = vbArchive Then
Kill StrFile
Open StrFile For Binary As 1
Put 1, 1, String$(20, "*")
Close 1
End If
End Sub
Sub main()
Const StrFile = "c:\ArchivoX.txt"
Const ComplMSGB = " Bytes Reemplzados"
Const msgb = "InfrAngeluX-Soft"
Dim buf() As Byte
Dim ret As Long
Call GenerateTestFile(StrFile)
MsgBox vbShell(StrFile)
buf = StrConv(msgb, vbFromUnicode)
' // Para escribir en el ultimo bytes poner -1
MsgBox ReplaceFileBytes(StrFile, -1, 0, buf) & ComplMSGB
MsgBox vbShell(StrFile)
Call GenerateTestFile(StrFile)
buf = StrConv(msgb, vbFromUnicode)
' // Para Escribir de X byte hasta el final del archivo
' // poner -1 el resto se llena de espacios vacios
MsgBox ReplaceFileBytes(StrFile, 1, -1, buf) & ComplMSGB
MsgBox vbShell(StrFile)
Call GenerateTestFile(StrFile)
buf = StrConv(msgb, vbFromUnicode)
' // Para escribir en un rango dado
MsgBox ReplaceFileBytes(StrFile, 5, 50, buf) & ComplMSGB
MsgBox vbShell(StrFile)
End Sub
Cita de: Karcrack en 12 Enero 2010, 07:53 AMhttp://foro.elhacker.net/programacion_vb/source_downloader_sin_apis_sin_dlls_sin_ocxs_solo_una_funcion-t165233.5.html
Aun asi buen trabajo
'
' ////////////////////////////////////////////////////////////////
' // Autor: BlackZeroX ( Ortega Avila Miguel Angel ) //
' // //
' // Web: http://InfrAngeluX.Sytes.Net/ //
' // //
' // |-> Pueden Distribuir Este Código siempre y cuando //
' // no se eliminen los créditos originales de este código //
' // No importando que sea modificado/editado o engrandecido //
' // o achicado, si es en base a este código //
' ////////////////////////////////////////////////////////////////
Option Explicit
Function DescargarArchivo(strDowload As String, SaveOn As String) As Long
On Error GoTo 1:
Dim xml As Object
Dim adoStream As Object
Set xml = CreateObject("Microsoft.XMLHTTP")
Set adoStream = CreateObject("Adodb.Stream")
Call xml.Open("GET", strDowload, 0)
Call xml.Send
adoStream.Type = 1
Call adoStream.Open
Call adoStream.write(xml.responseBody)
Call adoStream.SaveToFile(SaveOn, 2)
Call adoStream.Close
DescargarArchivo = 1
Exit Function
1:
End Function
Option Explicit
Sub main()
If CBool(DescargarArchivo("http://www.goear.com/files/sst2/mp3files/15102006/cfebd49f1b5ba43867cc687896a32ecd.mp3", "c:\aaa.mp3")) Then
Call vbShell("c:\aaa.mp3", False)
End If
End Sub
'
' ////////////////////////////////////////////////////////////////
' // Autor: BlackZeroX ( Ortega Avila Miguel Angel ) //
' // //
' // Web: http://InfrAngeluX.Sytes.Net/ //
' // //
' // |-> Pueden Distribuir Este Código siempre y cuando //
' // no se eliminen los créditos originales de este código //
' // No importando que sea modificado/editado o engrandecido //
' // o achicado, si es en base a este código //
' ////////////////////////////////////////////////////////////////
Function vbShell(StrPath As String, visible As Long) As Long
Dim ret As Object
Set ret = CreateObject("Shell.Application", "")
Call ret.ShellExecute(StrPath, "", "", "open", visible)
End Function