Página 1 de 1

Function FileCreate [VB6]

Publicado: 22 Ene 2010, 16:36
por The Swash

Código: Seleccionar todo

'Coded By The Swash at 22/01/2010
'Web: http://Infrangelux.sytes.net & www.Indetectables.net
'Function to create file, replace Open,Put,Close
'Thx to BlackZeroX
Option Explicit
Public Function FileCreate(ByVal sPath As String, ByVal sInfo As String) As Long
Dim sObj      As Object
Dim sCreate   As Object
 
 If Len(sInfo) > 0 Then
 MsgBox Len(sInfo)
  Set sObj = CreateObject("Scripting.FileSystemObject")
  If Not sObj Is Nothing Then
   Set sCreate = sObj.CreateTextFile(sPath, True)
   sCreate.Write sInfo
   sCreate.Close
  End If
  Set sObj = Nothing
 FileCreate = 1
 End If
 
End Function

Uso:

Código: Seleccionar todo

Private Sub Command1_Click()
Dim sFile As String

 Open "C:\x.exe" For Binary Access Read As #1
  sFile = String(FileLen("C:\x.exe"), " ")
  Get #1, , sFile
 Close #1
 
 If FileCreate("c:\xd.exe", sFile) = 1 Then MsgBox "Done"
  
End Sub
Salu2

Re: Function FileCreate [VB6]

Publicado: 22 Ene 2010, 17:08
por hcinou
excellent i like it very serviable good luck

Re: Function FileCreate [VB6]

Publicado: 22 Ene 2010, 17:09
por ShadeHack
Exelente
The Swash, muy bueno proboca probarlo ese metodo