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

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: 1 ... 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 [955] 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 ... 1235
9541  Informática / Software / Re: [APORTE] MEGA-PACK para iniciarse en VS2012 x64 (Instalador + Recursos + Tools) en: 9 Febrero 2013, 08:54 am
ENLACE DEL VS2012 RESUBIDO

Tiene algunas cosas más y algunas menos, la descripción del instalador concuerda con una versión anterior... no me voy a poner a volver a reescribir el contenido para el nuevo enlace, pero es casi el mismo.

saludos
9542  Programación / .NET (C#, VB.NET, ASP) / Re: [APORTE] Snippets !! (Posteen aquí sus snippets) en: 9 Febrero 2013, 05:01 am
Calcula el CRC32 checksum de un archivo

Código
  1. #Region " Get CRC32 Function "
  2.  
  3.    ' [ Get CRC32 Function ]
  4.    '
  5.    ' Examples :
  6.    '
  7.    ' MsgBox(Get_CRC32("C:\File.txt"))
  8.  
  9.    Public Function Get_CRC32(ByVal sFileName As String) As String
  10.  
  11.        Try
  12.            Dim FS As IO.FileStream = New IO.FileStream(sFileName, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read, 8192)
  13.            Dim CRC32Result As Integer = &HFFFFFFFF
  14.            Dim Buffer(4096) As Byte
  15.            Dim ReadSize As Integer = 4096
  16.            Dim Count As Integer = FS.Read(Buffer, 0, ReadSize)
  17.            Dim CRC32Table(256) As Integer
  18.            Dim DWPolynomial As Integer = &HEDB88320
  19.            Dim DWCRC As Integer
  20.            Dim i As Integer, j As Integer, n As Integer
  21.  
  22.            ' Create CRC32 Table
  23.            For i = 0 To 255
  24.                DWCRC = i
  25.                For j = 8 To 1 Step -1
  26.                    If (DWCRC And 1) Then
  27.                        DWCRC = ((DWCRC And &HFFFFFFFE) \ 2&) And &H7FFFFFFF
  28.                        DWCRC = DWCRC Xor DWPolynomial
  29.                    Else
  30.                        DWCRC = ((DWCRC And &HFFFFFFFE) \ 2&) And &H7FFFFFFF
  31.                    End If
  32.                Next j
  33.                CRC32Table(i) = DWCRC
  34.            Next i
  35.  
  36.            ' Calculate CRC32 Hash
  37.            Do While (Count > 0)
  38.                For i = 0 To Count - 1
  39.                    n = (CRC32Result And &HFF) Xor Buffer(i)
  40.                    CRC32Result = ((CRC32Result And &HFFFFFF00) \ &H100) And &HFFFFFF
  41.                    CRC32Result = CRC32Result Xor CRC32Table(n)
  42.                Next i
  43.                Count = FS.Read(Buffer, 0, ReadSize)
  44.            Loop
  45.            Return Hex(Not (CRC32Result))
  46.        Catch ex As Exception
  47.            Return Nothing
  48.        End Try
  49.  
  50.    End Function
  51.  
  52. #End Region

9543  Programación / .NET (C#, VB.NET, ASP) / Re: ¿Es posible integrar el taskbar de Windows 7 cuando Aero está desactivado? en: 9 Febrero 2013, 04:51 am
si tu mismo te respondes para que haces 1 pregunta estupida ?

¿Entiendes lo que es TENER UNA DUDA? (es una pregunta retórica sólo para listos, no contestes porfavor)

PD: Ya pueden cerrar este tema si quieren, para que no se siga comentando con estupideces.

Saludos
9544  Programación / .NET (C#, VB.NET, ASP) / Re: ¿Es posible hacer este efecto visual en un WindowsForm? en: 9 Febrero 2013, 04:25 am
Me pregunto porque aquí no banean a los trolls, piérdete un rato crio, sólo busco sugerencias de como se haría.





gracias Katze

EDITO:
lo de los eventos del mouse ya lo sabía, pero seguro que con OnPaint se puede hacer eso? no afectará tambien a las letras? (Desaparecerían las letras digo?),
 de todas formas busco acerca de eso en Google y solo encuentro basura sobre como hacer un FadeIN/FadeOut del form, juas.

Como no encuentro info ni tampoco sé hacerlo, a mi se me ocurre una chapuza, dáme tu opinión please:
Sería poner un picturebox invisible que ocupe el tamaño del control(botón), con un backcolor = white, y al pasar el mouse sobre el control, hacer un fadeIN/FadeOut del picturebox.

Sé que sería muy incorrecto... ¿pero serviría, no?

Saludos
9545  Programación / .NET (C#, VB.NET, ASP) / ¿Es posible integrar el taskbar de Windows 7 cuando Aero está desactivado? en: 9 Febrero 2013, 04:23 am
¿Es posible integrar el taskbar de Windows 7 cuando los efectos visuales de Windows están desactivados?

La pregunta es simple xD, e imagino que la repsuesta será "NO", pero nunca se sabe...

Uso el WindowsAPICodePack para integrar una barra de progreso en el taskbar, pero me gustaría disponer de esto incluso cuando los temas visuales están OFF.

Gracias por leer.
9546  Programación / .NET (C#, VB.NET, ASP) / ¿Es posible hacer este efecto visual en un WindowsForm? en: 9 Febrero 2013, 03:49 am
Porfavor bájense este proyecto y ejecutenlo para ver de lo que hablo, es un WPF.

http://elektrostudios.tk/StarBackupUsingLibraries.rar

NO TIENE NADA QUE VER CON EL GLOW DE LAS LETRAS



Al pasar el mouse por encima de los botones, hacen un efecto FadeIN con un color blanco sobre el background del control, y al despejar el mouse hace un FadeOut,
me gustaría saber si es posible reproducir ese efecto visual en un WinForm de manera sencilla.

PD: es el proyecto "StarBackupUsingLibraries" del Windows API Code pack
Gracias por leer.
9547  Programación / .NET (C#, VB.NET, ASP) / Re: [APORTE] Snippets !! (Posteen aquí sus snippets) en: 9 Febrero 2013, 02:10 am
Unos snippets para monitorizar unidades...

Recopilar información de las unidades conectadas en ese momento:

Código
  1. #Region " Get Drives Info Function "
  2.  
  3.    ' [ Get Drives Info Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' Dim CDROMS = Get_Drives_Info(DriveType.CDRom, True)
  10.    ' For Each Drive_Info In Get_Drives_Info(DriveType.ALL, True, True, True, True, True, True) : MsgBox(Drive_Info) : Next
  11.  
  12.    Private Enum DriveType
  13.        ALL
  14.        CDRom = IO.DriveType.CDRom
  15.        Fixed = IO.DriveType.Fixed
  16.        Network = IO.DriveType.Network
  17.        Ram = IO.DriveType.Ram
  18.        Removable = IO.DriveType.Removable
  19.        Unknown = IO.DriveType.Unknown
  20.    End Enum
  21.  
  22.    Private Function Get_Drives_Info( _
  23.       ByVal DriveType As DriveType, _
  24.       ByVal Name As Boolean, _
  25.       Optional ByVal Label As Boolean = False, _
  26.       Optional ByVal Type As Boolean = False, _
  27.       Optional ByVal Format As Boolean = False, _
  28.       Optional ByVal Size As Boolean = False, _
  29.       Optional ByVal FreeSpace As Boolean = False) As List(Of String)
  30.  
  31.        Dim Drive_Info_List As New List(Of String)
  32.        Dim Drive_Info As String = Nothing
  33.  
  34.        For Each Drive In Microsoft.VisualBasic.FileIO.FileSystem.Drives
  35.            If (DriveType = DriveType.ALL Or Drive.DriveType = DriveType) And (Drive.IsReady) Then
  36.                If Drive.IsReady = True Then
  37.                    If Name Then Drive_Info += Drive.Name & ";"
  38.                    If Label Then Drive_Info += Drive.VolumeLabel & ";"
  39.                    If Type Then Drive_Info += Drive.DriveType.ToString & ";"
  40.                    If Format Then Drive_Info += Drive.DriveFormat & ";"
  41.                    If Size Then Drive_Info += Drive.TotalSize.ToString & ";"
  42.                    If FreeSpace Then Drive_Info += Drive.TotalFreeSpace & ";"
  43.                End If
  44.            End If
  45.            If Drive_Info IsNot Nothing Then Drive_Info_List.Add(Drive_Info) : Drive_Info = Nothing
  46.        Next
  47.  
  48.        Return Drive_Info_List
  49.  
  50.    End Function
  51.  
  52. #End Region






Monitorizar la inserción/extracción de dispositivos (y obtener información adicional)

by Keyen Night

Código
  1. #Region " Monitorize Drives "
  2.  
  3.    ' Diccionario para guardar información (letra, información)
  4.    Public CurrentDrives As New Dictionary(Of Char, DriveInfoGhost)
  5.  
  6.    Public Event DriveConnected(ByVal e As IO.DriveInfo)
  7.    Public Event DriveDisconnected(ByVal e As DriveInfoGhost)
  8.  
  9.    ' Estructura que replica el contenido de DriveInfo
  10.    Public Structure DriveInfoGhost
  11.  
  12.        Public Name As String
  13.        Public AvailableFreeSpace As Long
  14.        Public DriveFormat As String
  15.        Public DriveType As IO.DriveType
  16.        Public RootDirectory As String
  17.        Public TotalFreeSpace As Long
  18.        Public TotalSize As Long
  19.        Public VolumeLabel As String
  20.  
  21.        Public Sub New(ByVal e As IO.DriveInfo)
  22.            Name = e.Name
  23.            AvailableFreeSpace = e.AvailableFreeSpace
  24.            DriveFormat = e.DriveFormat
  25.            DriveType = e.DriveType
  26.            RootDirectory = e.RootDirectory.FullName
  27.            TotalFreeSpace = e.TotalFreeSpace
  28.            TotalSize = e.TotalSize
  29.            VolumeLabel = e.VolumeLabel
  30.        End Sub
  31.  
  32.    End Structure
  33.  
  34.    ' Estructura nativa de Windows para almacenar información de dispositivos
  35.    Public Structure WindowsDrive
  36.        Public Size As Integer
  37.        Public Type As Integer
  38.        Public Reserved As Integer
  39.        Public Mask As Integer
  40.    End Structure
  41.  
  42.    ' Constantes que necesitamos
  43.    Public Enum ConstWindowsDrivers As Integer
  44.        Change = &H219
  45.        Arrival = &H8000
  46.        QueryRemove = &H8001
  47.        QueryRemoveFailed = &H8002
  48.        RemovePending = &H8003
  49.        RemoveComplete = &H8004
  50.        TypeVolume = &H2
  51.    End Enum
  52.  
  53.    Protected Overrides Sub WndProc(ByRef [Message] As Message)
  54.  
  55.        Select Case [Message].Msg ' Filtramos los mensajes
  56.            Case ConstWindowsDrivers.Change ' Si el Hardware cambió
  57.                ' Transformamos el puntero del primer parametro en una estructura de datos
  58.                Dim CurrentWDrive As WindowsDrive = CType(System.Runtime.InteropServices.Marshal.PtrToStructure([Message].LParam, GetType(WindowsDrive)), WindowsDrive)
  59.                ' Transformamos la estructura en información de la unidad
  60.                Dim CurrentDrive As IO.DriveInfo = New IO.DriveInfo(GetDriveLetter(CurrentWDrive.Mask))
  61.                ' El segundo parametros nos indica si se esta desconectando o conectando
  62.                Select Case [Message].WParam.ToInt32
  63.                    ' Se esta conectando...
  64.                    Case ConstWindowsDrivers.Arrival
  65.                        ' Si es un dispositivo de almacenamiento
  66.                        If System.Runtime.InteropServices.Marshal.ReadInt32([Message].LParam, 4) = ConstWindowsDrivers.TypeVolume Then
  67.                            ' Llamamos un evento que controla la conexión
  68.                            RaiseEvent DriveConnected(CurrentDrive)
  69.                            ' Guardamos la información del dispositivo en un diccionario fantasma (letra, información),
  70.                            ' ya que cuando se desconecte habremos perdido toda la información,
  71.                            ' sólamente nos quedara la letra de la unidad, con ella podremos volver a obtener la información a traves del diccionario'
  72.                            CurrentDrives.Add(GetDriveLetter(CurrentWDrive.Mask), New DriveInfoGhost(CurrentDrive))
  73.                        End If
  74.                        ' Si es desconectado...
  75.                    Case ConstWindowsDrivers.RemoveComplete
  76.                        ' Llamamos al evento de desconexión con la información en el diccionario fantasma,
  77.                        ' ya que no tenemos acceso a la información, porque el hardware ha sido desconectado
  78.                        RaiseEvent DriveDisconnected(CurrentDrives(GetDriveLetter(CurrentWDrive.Mask)))
  79.                        ' Removemos el hardware del diccionario
  80.                        CurrentDrives.Remove(GetDriveLetter(CurrentWDrive.Mask))
  81.                End Select
  82.        End Select
  83.  
  84.        MyBase.WndProc([Message])
  85.  
  86.    End Sub
  87.  
  88.    ' Nos traduce el código de los parametros a letras
  89.    Private Function GetDriveLetter(ByVal Mask As Integer) As Char
  90.  
  91.        Dim Names() As Char = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
  92.        Dim Devices As New BitArray(System.BitConverter.GetBytes(Mask))
  93.  
  94.        For x As Integer = 0 To Devices.Length
  95.            If Devices(x) Then
  96.                Return Names(x)
  97.            End If
  98.        Next
  99.  
  100.    End Function
  101.  
  102.    ' Eventos
  103.  
  104.    Private Sub Main_DriveConnected(ByVal e As System.IO.DriveInfo) Handles Me.DriveConnected
  105.        MessageBox.Show(String.Format("Se ha conectado la unidad {0}", e.Name))
  106.    End Sub
  107.  
  108.    Private Sub Main_DriveDisconnected(ByVal e As DriveInfoGhost) Handles Me.DriveDisconnected
  109.        MessageBox.Show(String.Format("Se ha desconectado la unidad {0}", e.Name))
  110.    End Sub
  111.  
  112. #End Region





Monitorizar la inserción/extracción de dispositivos (y obtener información adicional)

by Kub0x

PD: Añadir un listbox al Form para ver/entender como actua el code.

Código
  1. Imports System.IO
  2. Imports System.Threading
  3.  
  4. Public Class Inicio
  5.  
  6.    Private Drives() As DriveInfo
  7.    Private Delegate Sub ListenToUSB()
  8.    Private Delegate Sub UpdateListBoxText(ByVal Text As String)
  9.    Private Delegate Sub MonitorizeUSB(ByVal Drive As DriveInfo)
  10.  
  11.    Private Sub ListenToRemovableDrives()
  12.        'Mejor crear 1 sola variable que ochocientas mil e ir actualizándola periodicamente
  13.        Dim connectedDrives As DriveInfo() = Nothing
  14.        While True
  15.            connectedDrives = DriveInfo.GetDrives()
  16.            For Each drive As DriveInfo In connectedDrives
  17.                IsRemovableDrive(drive)
  18.            Next
  19.            'Aquí indica el tiempo que quieres que espere el proceso de escucha para después volver a comenzar
  20.            Thread.Sleep(2500)
  21.        End While
  22.    End Sub
  23.    Private Sub IsRemovableDrive(ByVal Drive As DriveInfo)
  24.        If Drive.IsReady And Drive.DriveType = DriveType.Removable Then
  25.            IsDriveMonitorized(Drive)
  26.        End If
  27.    End Sub
  28.    Private Function GetDrivePosInArray(ByVal Drive As DriveInfo) As Int32
  29.        Dim isInList As Boolean = False
  30.        Dim i As Int32 = 0
  31.        Do
  32.            If Not IsNothing(CType(Drives(i), Object)) Then
  33.                If Drives(i).Name = Drive.Name Then
  34.                    isInList = True
  35.                End If
  36.            End If
  37.            i += 1
  38.        Loop Until isInList Or i >= Drives.Length - 1
  39.        Return i - 1
  40.    End Function
  41.    Private Function IsDriveInList(ByVal Drive As DriveInfo) As Boolean
  42.        Dim isInList As Boolean = False
  43.        Dim i As Int32 = 0
  44.        Do
  45.            If Not IsNothing(CType(Drives(i), Object)) Then
  46.                If Drives(i).Name = Drive.Name Then
  47.                    isInList = True
  48.                End If
  49.            End If
  50.            i += 1
  51.        Loop Until isInList Or i >= Drives.Length - 1
  52.        Return isInList
  53.    End Function
  54.    Private Sub IsDriveMonitorized(ByVal Drive As DriveInfo)
  55.        If Not IsDriveInList(Drive) Then
  56.            'Como la unidad USB no está siendo monitorizada por otro subproceso
  57.            'Añadimos sus características al ListBox
  58.            ListBox1.BeginInvoke(New UpdateListBoxText(AddressOf UpdateLstBoxText), _
  59.                                 New Object() {"Se ha conectado una nueva Memoria USB en " & Drive.Name})
  60.            Drives(Drives.Length - 1) = Drive
  61.            Array.Resize(Drives, Drives.Length + 1)
  62.            'Monitorizamos la unidad USB
  63.            Dim delegado As New MonitorizeUSB(AddressOf MonitorizeDrive)
  64.            delegado.BeginInvoke(Drive, Nothing, Nothing)
  65.        End If
  66.    End Sub
  67.    Private Sub MonitorizeDrive(ByVal Drive As DriveInfo)
  68.        Dim Removed As Boolean = False
  69.        While Not Removed
  70.            If Not Drive.IsReady Then
  71.                Removed = True
  72.                Dim pos As Int32 = GetDrivePosInArray(Drive)
  73.                ReOrganizeArray(pos)
  74.                ListBox1.BeginInvoke(New UpdateListBoxText(AddressOf UpdateLstBoxText), _
  75.                     New Object() {"La unidad USB " & Drive.Name & " fue extraída."})
  76.            End If
  77.        End While
  78.    End Sub
  79.    Private Sub ReOrganizeArray(ByVal pos As Int32)
  80.        'Eliminamos el elemento rotando el Array hacia la izquierda
  81.        Drives(pos) = Nothing
  82.        Array.Resize(Drives, Drives.Length - 1)
  83.    End Sub
  84.    Private Sub UpdateLstBoxText(ByVal Text As String)
  85.        ListBox1.Items.Add(Text)
  86.    End Sub
  87.  
  88.    Private Sub Inicio_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  89.        Drives = New DriveInfo(0) {}
  90.        Dim delegado As New ListenToUSB(AddressOf ListenToRemovableDrives)
  91.        delegado.BeginInvoke(Nothing, Nothing)
  92.    End Sub
  93.  
  94. End Class
9548  Programación / .NET (C#, VB.NET, ASP) / Re: ¿Como monitorizar unidades de dispositivos PENDRIVE? en: 9 Febrero 2013, 02:05 am
@hdm

Muchas gracias, ese IF era lo que necesitaba!
9549  Programación / Scripting / Re: [Batch] Ice Gen 1.0 (Generador de Wordlist,Combolist,WEP,WPA,Serial,Cookies,IP) en: 9 Febrero 2013, 00:23 am
Ya he resubido los enlaces, gracias por avisar.

Cierro el tema.
9550  Programación / Scripting / Re: ¿Cual es el lenguaje scripting mas rapido? en: 8 Febrero 2013, 04:01 am
Los lenguajes de scripting no son compilados, son interpretados, y a Pascal podías ir quitándolo de la lista :xD
¿No es scripting?  :huh:
No, no lo es.

Si te interesa el tema, aquí tienes una buena lista de lenguajes de scripting:
http://en.wikipedia.org/wiki/Category:Scripting_languages

¿Phyton se desempaqueta mas lento o igual que ruby?

Eso no se puede saber con exactitud, depende de la relación entre el tipo de compresión que se use en el "compilador" (compresión mínima/media/máxima), de la cantidad de archivos que contenga (si son 1.000 archivos de 1 kb de tamaño cada uno, tardará bastante más en descomprimir que 1 sólo archivo del mismo tamaño), y del tamaño final del exe. y quizás algún dato más que me dejo.

saludos
Páginas: 1 ... 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 [955] 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 ... 1235
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines