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

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16
141  Programación / .NET (C#, VB.NET, ASP) / Re: Mouse Recorder en: 26 Mayo 2013, 00:14 am
No sirve ninguno de los links

EDITO:

Código:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.KeyPreview = True
    End Sub

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode.ToString = "F1" Then
            Me.KeyPreview = True
            System.Threading.Thread.Sleep(2000)
            TextBox1.Text = System.Windows.Forms.Cursor.Position.X
            TextBox2.Text = System.Windows.Forms.Cursor.Position.Y

        End If
    End Sub

Tecla F1 Captura la posicion actual del mouse y las anota en los Textbox
142  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 25 Mayo 2013, 22:43 pm
Miren esta manera mucho mas sencilla de usar el cronometro

Public Class Form1
    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        tmrWatch.Start()
    End Sub
    Private Sub btnStop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStop.Click
        tmrWatch.Stop()
    End Sub
    Private Sub tmrWatch_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrWatch.Tick
        txtTenths.Text -= 1
        If txtTenths.Text = -1 Then
            txtTenths.Text = 9
            txtSeconds.Text -= 1
            If txtSeconds.Text = -1 Then
                txtSeconds.Text = 59
                txtMinutes.Text -= 1
                If txtMinutes.Text = -1 Then
                    txtMinutes.Text = 59
                    txtHours.Text -= 1
                    If txtHours.Text = -1 Then
                        txtHours.Text = 23
                        txtDays.Text -= 1
                        If txtDays.Text = -1 Then
                            tmrWatch.Stop()
                            txtTenths.Text = "0"
                            txtSeconds.Text = "0"
                            txtMinutes.Text = "0"
                            txtHours.Text = "0"
                            txtDays.Text = "0"
                        End If
                    End If
                End If
            End If
        End If
    End Sub
143  Programación / .NET (C#, VB.NET, ASP) / Mouse Recorder en: 25 Mayo 2013, 22:32 pm
Hola, estoy en la creacion de un auto mouse que de click en especificas coordenadas...

algo como esto







y para ver la coordenada especifica



Código:
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.KeyPreview = True
    End Sub
    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode.ToString = "F1" Then
            Me.KeyPreview = True
            System.Threading.Thread.Sleep(1000)
            TextBox1.Text = System.Windows.Forms.Cursor.Position.X
            TextBox2.Text = System.Windows.Forms.Cursor.Position.Y
        End If
        If e.KeyCode.ToString = "F2" Then
            Clipboard.SetText(TextBox1.Text & " - " & TextBox2.Text)
            TextBox3.Text = Clipboard.GetText
        End If
    End Sub
End Class
144  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 24 Mayo 2013, 18:02 pm
Veo que el codigo es muy diferente, cabe mencionar que uso VB.NET 2008

Al ver tu codigo, vi cosas que no habia visto antes  :-\

quede algo confundido, pues por lo que XresH me explico de otra manera.... siendo el mismo proceso pero con codigo diferente

pero se agradece tu intencion por ayudarme.. el codigo ahora si funciona, justo ahora mire tu ejemplo y a segun lo que entendi decidi crear uno nuevo y si funciono
145  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 24 Mayo 2013, 17:08 pm
En ningúna parte de tú código veo que hayas usado el código que te he mostrado, tampoco veo que hayas declarado las variables de mi ejemplo.

PD: Aunque tampoco voy a testear un código sin que me des detalles de porque "no funciona"

Saludos!

Detalles: cuando selecciona la funcion de "sonido o proceso" esta automaticamente se inicia sin nisiquiera transcurrir el tiempo


 

Si, lo se lo elimine.. pues no se la forma correcta de como insertarlo

Código:
Public Class Form1
    Dim Hora As Integer
    Dim Segundo As Integer
    Dim Minutos As Integer
    Dim Mx As Integer
    Dim Run_Sound As Boolean = False
    Dim Run_Program As Boolean = False

    Private Sub CalcularyMostrar()
        TextBox1.Text = Hora.ToString.PadLeft(2, "0") 'para rellenar en caso que sea menor que dos digitos
        TextBox2.Text = Minutos.ToString.PadLeft(2, "0")
        TextBox3.Text = Segundo.ToString.PadLeft(2, "0")
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox3.Text = "" Then
            MsgBox("Indica el tiempo para Iniciar")
            Exit Sub
        End If
        Segundo = TextBox3.Text
        Minutos = TextBox2.Text
        Hora = TextBox1.Text
        Timer1.Enabled = True

    End Sub
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Mx = Mx - 1
        If Mx = 0 Or Mx = -1 Then
            Mx = 9
            Segundo = Segundo - 1
            If Segundo = -1 Then
                Segundo = 59
                Minutos = Minutos - 1
                If Minutos = 0 Then
                    Minutos = 59
                    Hora = Hora - 1
                End If
            End If
            If Hora = 0 Then
                If Minutos = 0 Then
                    If Segundo = 0 Then
                        TextBox3.Text = "00"
                        Timer1.Enabled = False

                       If Run_Sound Then
                            ' play wav
                        ElseIf Run_Program Then
                            ' process.start()
                        Else
                            Throw New Exception("Wrong option")
                        End If


                        Exit Sub
                    End If
                End If
            End If
            CalcularyMostrar()
        End If
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Enabled = False
        My.Computer.Audio.Stop()
    End Sub


    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Label1.Text = Date.Now.ToLongTimeString
    End Sub

    Private Sub RadioButtons_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.Click, RadioButton2.Click
        Select Case sender.tag.tolower
            Case "sound" : Run_Sound = True : Run_Program = False
            Case "program" : Run_Program = True : Run_Sound = False
            Case Else : Throw New Exception("Wrong tagname")
        End Select
    End Sub
End Class
146  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 24 Mayo 2013, 16:43 pm
Humm, gracias el codigo que me das Electro.. tal parece no funciona... cuando selecciona la funcion de "sonido o proceso" esta automaticamente se inicia sin nisiquiera transcurrir el tiempo

 mira te paso todo el codigo que llevo hasta ahora


Código:
Public Class Form1
    Dim Hora As Integer
    Dim Segundo As Integer
    Dim Minutos As Integer
    Dim Mx As Integer

    Private Sub CalcularyMostrar()
        TextBox1.Text = Hora.ToString.PadLeft(2, "0") 'para rellenar en caso que sea menor que dos digitos
        TextBox2.Text = Minutos.ToString.PadLeft(2, "0")
        TextBox3.Text = Segundo.ToString.PadLeft(2, "0")
    End Sub

    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox3.Text = "" Then
            MsgBox("Indica el tiempo para Iniciar")
            Exit Sub
        End If
        Segundo = TextBox3.Text
        Minutos = TextBox2.Text
        Hora = TextBox1.Text
        Timer1.Enabled = True
  
    End Sub
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Mx = Mx - 1
        If Mx = 0 Or Mx = -1 Then
            Mx = 9
            Segundo = Segundo - 1
            If Segundo = -1 Then
                Segundo = 59
                Minutos = Minutos - 1
                If Minutos = 0 Then
                    Minutos = 59
                    Hora = Hora - 1
                End If
            End If
            If Hora = 0 Then
                If Minutos = 0 Then
                    If Segundo = 0 Then
                        TextBox3.Text = "00"
                        Timer1.Enabled = False

                        'Aqui es donde termina el tiempo, y es donde tiene que
                        'inicar alguna de las variables "sonido o proceso"

                        Exit Sub
                    End If
                End If
            End If
            CalcularyMostrar()
        End If
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Enabled = False
        My.Computer.Audio.Stop()
    End Sub


    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Label1.Text = Date.Now.ToLongTimeString
    End Sub

End Class


no se que es lo que no comprendo, pero no funciona :/
147  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 24 Mayo 2013, 10:01 am
Gracias al usuario XresH, por explicarme...

logre esto...



Cuando llega a 00:00:00 reproduce un sonido.wav usando este codigo
Código:
Try
                            Dim ruta As String
                            ruta = My.Application.Info.DirectoryPath & "\Sonido.wav"
                            My.Computer.Audio.Play(ruta, AudioPlayMode.BackgroundLoop)
                            My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Asterisk)
                        Catch ex As Exception
                        End Try
hasta ahora todo funciona....




ahora quiero crear dos variables

"Reproducir sonido" y "Ejecutar proceso"



elemplo, selecciono el RadioButton1 y se activa la funcion de "Reproducir sonido"









cuando selecciono el RadioButton2 se ejecuta un "proceso/archivo"

y todo esto ocurre al llegar a 00:00:00
148  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 18 Mayo 2013, 00:13 am
es programacion en visual basic 2008...


voy a probar tu codigo y miro que tal funciona

gracias por ayudar a un novaton en esto del mundo de la programacion :) ;-) ;-)
149  Programación / .NET (C#, VB.NET, ASP) / Cronometro regresivo en: 17 Mayo 2013, 20:00 pm
Hola foreros, me preguntaba si podian ayudar en la programacion de un cronometro regresivo

miren este seria el diseño basico y simple



Perdon, si les pido mucho...

en el RadioButton1 "Ejecutar Programa" quiero que abra un programa, pero este programa estara en la misma ruta de la carpeta, ejemplo..
Al termina el tiempo se ejecutara el AutoIt3

y en el RadioButton2 "Ejecutar Sonido" igual que reproduzca el sonido




en los Botones "Iniciar y Detener" pues es obvio iniciar el timer o detenerlo


y en los TextBox "Horas, Minutos y Segundos" yo pueda aplicar el tiempo que quiero poner en regresiva y al finalizar el tiempo se ejecute alguna de las dos acciones. el sonido o el programa

que en una hora con cinco minutos se ejecute el sonido


que en 24 horas ejecute el sonido etc



Espero y no ser molesto, lo se soy un novato pregunton :(

150  Programación / .NET (C#, VB.NET, ASP) / [Ayuda] Sincronizador Visual Basic en: 7 Mayo 2013, 17:11 pm
Veran, me he guiado por un ejemplo en .Bat de un sincronizador de carpetas simple
Código:
xcopy C:\Users\*****\Music\Musica D:\Musica /d /y /e 
pause

Pero ahora ya quiero pasar a otro nivel Visual Basic, algo simple para los que apenas estamos empezando



Igual esto fue lo que trate de hacer

Código:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Shell("cmd /c xcopy /h/v/s/e/r/y/c/k/m/d " & Chr(34) & "ComboBox1.text" & Chr(34) & " " & Chr(34) & "ComboBox2.text" & Chr(34), vbNormalFocus)
    End Sub

Pero no dio resultado, se que funciona Si, y solo si quito los "ComboBox.text" y pongo la ruta directa..
Creo que me faltara aprender mucho  :-\

> Quiero seleccionar que carpetas sincronizar (En el ComboBox)
> Seleccionar la Ruta a donde sincronizarlas
Páginas: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines