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

 

 


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


  Mostrar Mensajes
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14
11  Programación / Programación Visual Basic / Re: Problema con variable en: 26 Noviembre 2011, 19:04 pm
tienes que usar la funcion Val(),

Código
  1. Variable = val(txtVariable.text)

y no tiene caso que compruebes Variable y txtVariable dos veces. Salu2  :rolleyes:
12  Programación / Programación Visual Basic / Re: Calcular el current time en: 23 Noviembre 2011, 10:10 am
Lo puedes modificar para que se reestablesca

Código
  1. Private Declare Function GetTickCount Lib "kernel32" () As Long
  2.  
  3. Dim acTime  As Long
  4.  
  5. Public Function getTimePassed() As String
  6. Dim timeActual As Long
  7. Dim lngHour As Long
  8. Dim lngMinute As Long
  9. Dim lngSeconds As Long
  10.  
  11. timeActual = GetTickCount - acTime
  12.  
  13. lngHour = Int(timeActual / 1000 / 60 / 60)
  14. lngMinute = Int((timeActual / 1000 / 60)) - lngHour * 60
  15. lngSeconds = Int((timeActual / 1000)) - lngMinute * 60 - lngHour * 3600
  16. getTimePassed = Trim(Str(lngHour) & ":" & sGetWideTimeString(lngMinute) & ":" & sGetWideTimeString(lngSeconds)) & vbNullChar
  17. End Function
  18.  
  19. Public Function sGetWideTimeString(ByVal btInputNumb As Byte) As String
  20. Dim sTemp As String
  21. sTemp = Trim(Str(btInputNumb))
  22. If Len(sTemp) = 1 Then sTemp = "0" & sTemp
  23. sGetWideTimeString = sTemp
  24. End Function
  25.  
  26. Public Function Reset()
  27. acTime = GetTickCount
  28. End Function
  29.  

En un formulario:
Código
  1. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  2.  
  3. Private Sub Form_Load()
  4. MsgBox getTimePassed
  5. Module1.Reset
  6. MsgBox getTimePassed
  7. Sleep 3000
  8. MsgBox getTimePassed
  9. Module1.Reset
  10. MsgBox getTimePassed
  11. End Sub
  12.  
13  Seguridad Informática / Análisis y Diseño de Malware / Re: Funciones del Keylogger Douglas 2.0 en: 18 Noviembre 2011, 07:17 am
contestan un tema del 2010?  :xD
14  Foros Generales / Foro Libre / Re: [Debate] Dios o Bin Bang(¿Qué había antes del antes?) en: 9 Noviembre 2011, 11:40 am
Todos se basan en investigaciones ya hechas, pueden ser realidad o no la mayoría pura teoría, y hasta que no se demuestre algo 100% verdadero todo lo demás serán falacias  :P
15  Programación / Programación Visual Basic / Re: Tiempo sin mover el mouse/teclado en: 29 Octubre 2011, 04:02 am
Perfecto!  ;-), gracias seba123neo   :P
16  Programación / Programación Visual Basic / Tiempo sin mover el mouse/teclado en: 29 Octubre 2011, 03:12 am
Que tal, hace mucho vi una función que te devolvía el tiempo en el que el mouse o el teclado no habia sido utilizado, es decir sin actividad del usuario..., ahora que la busco no la encuentro pero se usaba una api, no recuerdo cual, alguien sabra algo parecido... creo que se podría hacer un hook y crear mi propio contador, pero es algo que con solo una api se puede, un saludo y gracias de antemano !  :P
17  Programación / Programación Visual Basic / Re: como hacer un tiempo de espera en un Modulo Bas en: 26 Octubre 2011, 08:18 am
http://foro.elhacker.net/programacion_visual_basic/pausar_proyecto_en_sub_main-t321304.0.html;msg1588669#msg1588669  :P
18  Programación / Programación Visual Basic / Re: [RETO] Recortar cadena. en: 21 Octubre 2011, 10:44 am
Código
  1. Public Function DeleteString_TV1(ByVal sString As String, ByVal PosComienzo As Long, ByVal Longitud As Long)
  2. DeleteString = Replace$(sString, Mid(sString, PosComienzo, Longitud), vbNullString)
  3. End Function

Salu2
19  Programación / Programación Visual Basic / Re: parametro variable, o cambio xd en: 21 Octubre 2011, 10:09 am
Tu código tiene un error, la función no devuelve nada, revísalo.
Mira qué interesante, voy a hacer un reto de esto.

DoEvents! :P

Lo hize especialmente con sub  :P, de todas formas es un ejemplo...
20  Programación / Programación Visual Basic / Re: parametro variable, o cambio xd en: 21 Octubre 2011, 09:12 am
Algo rápido y eficaz  :xD

Código
  1. Public Sub DeleteString(ByRef Str As String, ByRef Begin As String, ByRef EndS As String)
  2. Dim P           As Long
  3. Dim P2          As Long
  4.  
  5.        P = InStr(1, Str, Begin)
  6.        P2 = InStr(P, Str, EndS)
  7.  
  8.        If (Not (CBool(P)) Or Not (CBool(P2))) Then
  9.            Exit Sub
  10.        End If
  11.  
  12.        Str = Mid(Str, 1, P - 1) & Mid(Str, P2 + Len(EndS), Len(Str))
  13.  
  14. End Sub
  15.  

Uso:
Código
  1. Dim A As String
  2. A = "Este es un 345 aaa 661 ejemplo"
  3. MsgBox A
  4. DeleteString A, "45", "66"
  5. MsgBox A
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines