Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: elpato_zeta en 10 Octubre 2005, 01:32 am



Título: cyber cafe
Publicado por: elpato_zeta en 10 Octubre 2005, 01:32 am
hola, tenemos un problemilla mi equipo y yo somos un tanto estupidos porke no podemos hacer un programa para controlar el tiempo de las maquinas en un cyber no es que no sepamos programar (que tambien puede ser el caso ???) lo que pasa que no tenemos ni idea de como hacer el programilla nos podrian ayudar darnos ideas de como hacerlo
gracias desde ya  ;)


Título: Re: cyber cafe
Publicado por: A2Corp en 10 Octubre 2005, 16:38 pm
Si no sabes como hacerlo pues mejor baja alguno...

Hay muchos programas para eso... Creo haber visto alguno en Softonic.com... no estoy seguro, pero puedes buskar en google!.

Suerte.


Título: Re: cyber cafe
Publicado por: {_The_Alwar_} en 10 Octubre 2005, 17:57 pm
Me se de uno muuuuy bueno, pero es de pago, y ahora mismo no me acuerdo de la web... pero lo e visto en cibers instalado y es la caña, creo q es el mejor cibercontrol q e visto

Saludos


Título: Re: cyber cafe
Publicado por: MaLkAvIaN_NeT en 10 Octubre 2005, 23:23 pm
..Bueno hace tiempo trabaje uno de esos ,, con el cotrol Winsock,, el cual ponía el tiempo para la pc desde una máquina principal, lo que hacía era enviar un texto a la pc y ésta hacía un select case para ver que es lo que hacía, por ejemplo le enviaba la palabra acabatiempo, y la pc se bolqueaba con unas funciones api, se desabilitaba el teclado.
aqui unas funciones que hice:

Citar
Private Hora As String
Private Minuto As String
Private Segundo As String
Private mvarTiempo As String
Public Event TiempoAgotado()

Public Property Let Tiempo(ByVal vData As String)
    mvarTiempo = vData
End Property
Public Property Get Tiempo() As String
    Tiempo = mvarTiempo
End Property

Public Sub DesglosaTiempo(Horex As String)
Hora = ""
Minuto = ""
Segundo = ""
For I = 1 To Len(Horex)

    If Mid$(Horex, I, 1) = ":" Then
        For j = I + 1 To Len(Horex)
           
             If Mid$(Horex, j, 1) = ":" Then
                    For h = j + 1 To Len(Horex)
                        Segundo = Segundo + Mid$(Horex, h, 1)
                        If h = Len(Horex) Then Exit Sub
                    Next
           
                Else
                Minuto = Minuto + Mid$(Horex, j, 1)
             End If
        Next
    Else
    Hora = Hora + Mid$(Horex, I, 1)
    End If
Next
'(Format(Me.DTPicker2, "hh:mm:ss AMPM"))
'Me.CommonDialog1.ShowColor
End Sub

Public Function StarTiempo(Aumento As Boolean) As String
Call DesglosaTiempo(Tiempo)
If Aumento = True Then ' es decir si va en aumento

ElseIf Aumento = False Then 'aca para empezar el reloj del cliente

If Val(Segundo) = 0 Then
Segundo = 59
    If Minuto = 0 Then
        Minuto = 59
            If Hora >= 0 Then
                Hora = Val(Hora) - 1
            End If
    Else
        Minuto = Val(Minuto) - 1
    End If
Else
Segundo = Val(Segundo) - 1
End If
   
    If Val(Hora) = 0 And Val(Minuto) = 0 And Val(Segundo) = 0 Then
        RaiseEvent TiempoAgotado
    End If
 If Len(Hora) = 1 Then Hora = "0" + Trim$(Hora)
 If Len(Minuto) = 1 Then Minuto = "0" + Trim$(Minuto)
 If Len(Segundo) = 1 Then Segundo = "0" + Trim$(Segundo)
        StarTiempo = Trim$(Hora) + ":" + Trim(Minuto) + ":" + Trim(Segundo)
End If
End Function

Ojo que ese fue un módulo de clase

Citar
Private Declare Function inet_ntoa Lib "wsock32.dll" (ByVal addr As Long) As Long
Private Declare Function gethostname Lib "wsock32.dll" (ByVal hostname$, ByVal HostLen As Long) As Long
Private Declare Function gethostbyname Lib "wsock32.dll" (ByVal hostname$) As Long
Private Declare Function WSAStartup Lib "wsock32.dll" (ByVal wVR As Long, lpWSAD As WSADATAType) As Long
Private Declare Function WSACleanup Lib "wsock32.dll" () As Long
Private Declare Function WSAIsBlocking Lib "wsock32.dll" () As Long
Private Declare Function WSACancelBlockingCall Lib "wsock32.dll" () As Long

Public CadenaIp As String, NombreEqu As String

Private Type in_addr
s_addr As Long
End Type

Private Type HostEnt
  h_name As Long
  h_aliases As Long
  h_addrtype As Integer
  h_length As Integer
  h_addr_list As Long
End Type

Private Const WSADescription_Len = 256
Private Const WSASYS_Status_Len = 128

Private Type WSADATAType
  wversion As Integer
  wHighVersion As Integer
  szDescription(0 To WSADescription_Len) As Byte
  szSystemStatus(0 To WSASYS_Status_Len) As Byte
  iMaxSockets As Integer
  iMaxUdpDg As Integer
  lpszVendorInfo As Long
End Type

Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As Long
Private Declare Sub MemCopy Lib "kernel32" Alias "RtlMoveMemory" (Dest As Any, ByVal Src As Long, ByVal cb&)

Public Sub LocalizaIp()
On Error Resume Next
For Each Ip In ObtenerIPLocal()
CadenaIp = Ip
Next
End Sub

Private Function ObtenerIPLocal()
On Error Resume Next

If Not (StartWinsock()) Then Exit Function '//inicialmente llamará a la funcion

Dim hostname As String * 256, hostent_addr As Long
Dim Host As HostEnt, hostip_addr As Long
Dim ad As in_addr, ipl As Long, ips As String
Dim ip_address() As String, x As Integer
ReDim ip_address(0 To 4)

If gethostname(hostname, 256) = -1 Then
Exit Function
Else
hostname = Trim$(hostname)
End If

hostent_addr = gethostbyname(hostname)

If hostent_addr = 0 Then Exit Function

MemCopy Host, hostent_addr, LenB(Host)
MemCopy hostip_addr, Host.h_addr_list, Host.h_length

Do

MemCopy ad.s_addr, hostip_addr, Host.h_length
ipl = inet_ntoa(ad.s_addr)

ips = String$(lstrlen(ipl) + 1, 0)
lstrcpy ips, ipl

ip_address(x) = ips

Host.h_addr_list = Host.h_addr_list + LenB(Host.h_addr_list)
MemCopy hostip_addr, Host.h_addr_list, Host.h_length

x = x + 1
Loop While (hostip_addr <> 0)

ReDim Preserve ip_address(x - 1)

ObtenerIPLocal = ip_address()

NombreEqu = hostname

Call EndWinsock
End Function

Private Function StartWinsock() As Boolean
'//iniciamos el componente
On Error Resume Next
Dim StartupData As WSADATAType
StartWinsock = IIf(WSAStartup(&H101, StartupData) = 0, True, False)
End Function

Private Sub EndWinsock()
On Error Resume Next
If WSAIsBlocking() Then Call WSACancelBlockingCall
Call WSACleanup
End Sub

salu2


Título: Re: cyber cafe
Publicado por: elpato_zeta en 13 Octubre 2005, 00:16 am
ok gracias a todos 8) a y Ado's_Xtreme ese es el problema si no se hacerlo quiero aprender a hacerlo no tiene ninguna dificultad comprarlo y utilizarlo es  mas la satisfaccion saber que tu lo hiciste a que no  ::) bye


Título: Re: cyber cafe
Publicado por: Kpax en 13 Octubre 2005, 01:25 am
Primero tienes q definir en un papel lo k desea tu sistema !!
define! no programes solo ve lo q necesitas
Luego implementas e investigas sobre programacion con sockets
Tienes q tener calma yo tambien estaba desarrollando uno parecido ...pero lo principal es tener lo lineamientos
saludos