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

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Mensajes
Páginas: 1 ... 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 [936] 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 ... 1236
9351  Programación / Scripting / Re: Necesito ayuda para crear un batch para iniciar la rom de este emulador. en: 19 Marzo 2013, 18:16 pm
Desde un principio te comenté que buscases el nombre real del emulador y visitases la página oficial del emulador para encontrar la documentación que necesitas...

Bueno, el emulador es el "Nebula", página oficial: http://nebula.emulatronia.com , esto te lo digo sólo por si alguna otra vez vuelves a tener conflictos.

El problema es que este emulador no acepta comillas dobles en los argumentos (algo extraño), así que debes usarlo de la siguiente manera:

Código:
Emulator.exe daytona

(Tachán!)

Un saludo!
9352  Programación / Scripting / Re: Base de datos desde archivo de texto. en: 19 Marzo 2013, 18:06 pm
No hay problema...

Este script sólamente comprueba el valor de la última línea.



PD: Las explicaciones están en el código.

Código:
@Echo OFF
SETLOCAL ENABLEDELAYEDEXPANSION

Set /A "Max=100"
Set /A "Interval=10"
Set /A "LastFileSize=0"
Set /A "CurrentFileSize=0"

Set "File=C:\Users\Administrador\Desktop\1.txt"

:Loop

REM Comprueba el tamaño actual del archivo LOG
For %%F in ("%File%") Do (Set /A "CurrentFileSize=%%~zF")

REM Si el tamaño actual no es igual al ultimo tamaño registrado [Es decir, si el LOG se ha actualizado...]
If %CurrentFileSize% NEQ %LastFileSize% (
Set /A "LastFileSize=%CurrentFileSize%"

Echo [%TIME:~0,-3%] Comprobando actualización del LOG...
For /F "Usebackq Tokens=1-3* Delims= " %%A in ("%File%") Do (Set /A "Value=%%C")

REM Si el valor es mayor que X...
If !Value! GTR %MAX% (
Echo [%TIME:~0,-3%] Valor: "!Value!" es mayor que "%MAX%".
Echo [%TIME:~0,-3%] Enviando e-mail...
rem Zulc.exe -receivers="tuemail@hot.com" -remarks="Test remark" -subject="Test subject")
) ELSE (
Echo [%TIME:~0,-3%] Valor: "!Value!" Todo Correcto.
)

) ELSE (
REM De lo contrario...
Echo [%TIME:~0,-3%] Nada que comprobar.
)
(Ping -n %INTERVAL% Localhost >NUL) & (GOTO :LOOP)
9353  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 19 Marzo 2013, 17:34 pm
Código:
Minimizar la IDE del VisualStudio cuando la APP está en debug:

[code=vbnet]#Region " Minimize VS IDE when APP is in execution "

    Declare Function ShowWindow Lib "User32.dll" (ByVal hwnd As IntPtr, ByVal nCmdShow As UInteger) As Boolean

    ' Minimize VS IDE when APP is in execution
    Private Sub Minimize_VS_IDE_when_APP_is_in_execution(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
#If DEBUG Then
        Dim Pr() As Process = Process.GetProcesses
        For Each P As Process In Pr
            If P.MainWindowTitle.Contains(My.Application.Info.AssemblyName) Then
                Dim hwnd As IntPtr = P.MainWindowHandle
                ShowWindow(hwnd, 6)
                Exit For
            End If
        Next
#End If
    End Sub

#End Region



Redondear los bordes de cualquier control:

Código
  1. #Region " Round Borders "
  2.  
  3.    ' [ Round Borders ]
  4.    '
  5.    ' Examples :
  6.    ' Round_Border(TextBox1)
  7.    ' Round_Border(PictureBox1, 100)
  8.  
  9.    Private Sub Round_Borders(ByVal vbObject As Object, Optional ByVal RoundSize As Integer = 20)
  10.        Try
  11.            Dim p As New Drawing2D.GraphicsPath()
  12.            p.StartFigure()
  13.            p.AddArc(New Rectangle(0, 0, RoundSize, RoundSize), 180, 90)
  14.            p.AddLine(RoundSize, 0, vbObject.Width - RoundSize, 0)
  15.            p.AddArc(New Rectangle(vbObject.Width - RoundSize, 0, RoundSize, RoundSize), -90, 90)
  16.            p.AddLine(vbObject.Width, RoundSize, vbObject.Width, vbObject.Height - RoundSize)
  17.            p.AddArc(New Rectangle(vbObject.Width - RoundSize, vbObject.Height - RoundSize, RoundSize, RoundSize), 0, 90)
  18.            p.AddLine(vbObject.Width - RoundSize, vbObject.Height, RoundSize, vbObject.Height)
  19.            p.AddArc(New Rectangle(0, vbObject.Height - RoundSize, RoundSize, RoundSize), 90, 90)
  20.            p.CloseFigure()
  21.            vbObject.Region = New Region(p)
  22.        Catch ex As Exception : Throw New Exception(ex.Message)
  23.        End Try
  24.    End Sub
  25.  
  26. #End Region



Decodificar URL:

Código
  1. #Region " URL Decode Function "
  2.  
  3.    ' [ URL Decode Function ]
  4.    '
  5.    ' Examples :
  6.    ' Dim URL As String = URL_Decode("http%3A%2F%2Fwww%2Esomesite%2Ecom%2Fpage%2Easp%3Fid%3D5%26test%3DHello+World")
  7.  
  8.    Public Function URL_Decode(ByVal Source As String) As String
  9.        Dim x As Integer = 0
  10.        Dim CharVal As Byte = 0
  11.        Dim sb As New System.Text.StringBuilder()
  12.        For x = 0 To (Source.Length - 1)
  13.            Dim c As Char = Source(x)
  14.            If (c = "+") Then
  15.                sb.Append(" ")
  16.            ElseIf c <> "%" Then
  17.                sb.Append(c)
  18.            Else
  19.                CharVal = Int("&H" & Source(x + 1) & Source(x + 2))
  20.                sb.Append(Chr(CharVal))
  21.                x += 2
  22.            End If
  23.        Next
  24.        Return sb.ToString()
  25.    End Function
  26.  
  27. #End Region



Codificar URL:

Código
  1. #Region " URL Encode Function "
  2.  
  3.    ' [ URL Encode Function ]
  4.    '
  5.    ' Examples :
  6.    ' Dim URL As String = URL_Encode("http://www.somesite.com/page.asp?id=5&test=Hello World")
  7.  
  8.    Public Function URL_Encode(ByVal Source As String) As String
  9.        Dim chars() As Char = Source.ToCharArray()
  10.        Dim sb As New System.Text.StringBuilder()
  11.        For Each c As Char In chars
  12.            If c Like "[A-Z-a-z-0-9]" Then
  13.                sb.Append(c)
  14.            ElseIf c = " " Then
  15.                sb.Append("+")
  16.            Else
  17.                Dim sHex As String = Hex(Asc(c))
  18.                sHex = "%" & sHex.PadLeft(2, "0")
  19.                sb.Append(sHex)
  20.            End If
  21.        Next
  22.        Erase chars ' Clean Up
  23.        Return sb.ToString()
  24.    End Function
  25.  
  26. #End Region

[/code]
9354  Programación / Desarrollo Web / Re: ¿ Como cambiar el fondo de color ? en: 19 Marzo 2013, 16:02 pm
El color naranja de tu htm es eso, un color sólido.

El gradiante no es un color, es un efecto de varios tonos de colores conjuntos, y los estilos (efectos, gradiantes) se hacen manejando CSS, si usas DreamWeaver los estilos de CSS te los hace en 1 segundo casi sin esfuerzo vaya!

Un saludo!
9355  Programación / Scripting / Re: Base de datos desde archivo de texto. en: 19 Marzo 2013, 15:57 pm
¿Entonces lo de añadir datos a la base desde la consola ya no quieres?

A ver si no he entendido mal:
Ahora sólo sería obtener el valor numérico de la tercera palabra de la primera línea, o sería de cada tercera palabra de cada línea? y en fín si el número es mayor de "X", que te mande un email.

La manera más sencilla desde Windows es Batch, para lo del email puedes usar esta utilidad Commandline (no requiere autentificación de ningún tipo): https://www.zeta-uploader.com/es

Esto comprueba el tercer token de cada línea, si es mayor que "X" envía un email.
He usado como delimitador el caracter del espacio, quizás debas modificarlo a tus necesidades...



Código
  1. @Echo OFF
  2.  
  3. Set "Max=100"
  4. Set "Interval=5"
  5.  
  6. :Loop
  7. Echo [%TIME:~0,-3%] Checkando...
  8. For /F "Usebackq Tokens=1-3* Delims= " %%A in ("Archivo.txt") Do (
  9. If %%C GTR %MAX% (
  10. Echo [%TIME:~0,-3%] Variable: %%C es mayor que %MAX%, enviando email...
  11. Zulc.exe -receivers="tuemail@hot.com" -remarks="Test remark" -subject="Test subject")
  12. )
  13. )
  14. (Ping -n %INTERVAL% Localhost >NUL) & (GOTO :LOOP)

9356  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 19 Marzo 2013, 15:32 pm
@arts
la verdad es que según tengo entendido entre las comprbocaciones de IF y Select Case no hay diferencia así que creo que deben ser igual.




Generador de captchas.





Código
  1. #Region " Captcha Generator Function "
  2.  
  3.    ' [ Captcha Generator Function ]
  4.    '
  5.    ' Instructions:
  6.    ' Copy the Captcha Class into a new Class "Captcha.vb"
  7.    '
  8.    ' Examples :
  9.    ' Dim myCaptcha As New Captcha
  10.    ' PictureBox1.Image = myCaptcha.GenerateCaptcha(5) ' Generate a captcha of 5 letters
  11.    ' MsgBox(myCaptcha.Check(TextBox1.Text, True)) ' Check if the given text is correct
  12.  
  13.  
  14.    ' Captcha.vb
  15. #Region " Captcha Class "
  16.  
  17.    Imports System.Drawing
  18.    Imports System.Drawing.Drawing2D
  19.  
  20.    Public Class Captcha
  21.  
  22.        Dim cap As String
  23.  
  24.        Public ReadOnly Property CaptchaString As String
  25.            Get
  26.                Return cap
  27.            End Get
  28.        End Property
  29.  
  30.        ' Generate Captcha
  31.        Function GenerateCaptcha(ByVal NumberOfCharacters As Integer) As Bitmap
  32.            Dim R As New Random
  33.            Dim VerticalLineSpaceing As Integer = R.Next(5, 10) ' The space between each horizontal line
  34.            Dim HorisontalLineSpaceing As Integer = R.Next(5, 10) ' The space between each Vertical line
  35.            Dim CWidth As Integer = (NumberOfCharacters * 120) 'Generating the width
  36.            Dim CHeight As Integer = 180 ' the height
  37.            Dim CAPTCHA As New Bitmap(CWidth, CHeight)
  38.            Dim allowedCharacters() As Char = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM123456789".ToCharArray 'Guess
  39.            Dim str(NumberOfCharacters - 1) As Char ' The String to turn into a captcha
  40.  
  41.            For i = 0 To NumberOfCharacters - 1
  42.                str(i) = allowedCharacters(R.Next(0, 61)) ' Generating random characters
  43.            Next
  44.  
  45.            Using g As Graphics = Graphics.FromImage(CAPTCHA)
  46.  
  47.                ' the gradient brush for the background
  48.                Dim gradient As New Drawing2D.LinearGradientBrush(New Point(0, CInt(CHeight / 2)), New Point(CWidth, CInt(CHeight / 2)), Drawing.Color.FromArgb(R.Next(&HFF7D7D7D, &HFFFFFFFF)), Drawing.Color.FromArgb(R.Next(&HFF7D7D7D, &HFFFFFFFF)))
  49.  
  50.                g.FillRectangle(gradient, New Rectangle(0, 0, CWidth, CHeight))
  51.                Dim plist As New List(Of Point) ' the list of points the curve goes through
  52.  
  53.                For i = 0 To str.Length - 1
  54.                    Dim FHeight As Integer = R.Next(60, 100) 'Font height in EM
  55.                    Dim Font As New Font("Arial", FHeight)
  56.                    Dim Y As Integer = R.Next(0, (CHeight - FHeight) - 40) 'Generating the Y value of a char: will be between the top  and (bottom - 40) to prevent half characters
  57.                    Dim X As Integer = CInt((((i * CWidth) - 10) / NumberOfCharacters))  'Some formula that made sense At the time that I typed it to generate the X value
  58.                    Dim p As New Point(X, Y)
  59.  
  60.                    g.DrawString(str(i).ToString, Font, Brushes.Black, p)
  61.  
  62.                    plist.Add(New Point(X, R.Next(CInt((CHeight / 2) - 40), CInt((CHeight / 2) + 40)))) ' add the points to the array
  63.                Next
  64.  
  65.                plist.Add(New Point(CWidth, CInt(CHeight / 2))) 'for some reason it doesn't go to the end so we manually add the last point
  66.                Dim ppen As New Pen(Brushes.Black, R.Next(5, 10)) ' the pen used to draw the curve
  67.                g.DrawCurve(ppen, plist.ToArray)
  68.                Dim pen As New Pen(Brushes.SteelBlue, CSng(R.Next(1, 2))) 'the pen that will draw the horisontal and vertical lines.
  69.  
  70.                ' Drawing the vertical lines
  71.                For i = 1 To CWidth
  72.                    Dim ptop As New Point(i * VerticalLineSpaceing, 0)
  73.                    Dim pBottom As New Point(i * VerticalLineSpaceing, CHeight)
  74.                    g.DrawLine(pen, ptop, pBottom)
  75.                Next
  76.  
  77.                ' Drawing the horizontal lines
  78.                For i = 1 To CHeight
  79.                    Dim ptop As New Point(0, i * HorisontalLineSpaceing)
  80.                    Dim pBottom As New Point(CWidth, i * HorisontalLineSpaceing)
  81.                    g.DrawLine(pen, ptop, pBottom)
  82.                Next
  83.  
  84.                ' Drawing the Black noise particles
  85.                Dim numnoise As Integer = CInt(CWidth * CHeight / 25) 'calculating the  number of noise for the block. This will generate 1 Noise per 25X25 block of pixels if im correct
  86.  
  87.                For i = 1 To numnoise / 2
  88.                    Dim X As Integer = R.Next(0, CWidth)
  89.                    Dim Y As Integer = R.Next(0, CHeight)
  90.                    Dim int As Integer = R.Next(1, 2)
  91.                    g.FillEllipse(Brushes.Black, New Rectangle(X, Y, R.Next(2, 5), R.Next(2, 5))) 'Size of the white noise
  92.                Next
  93.  
  94.                ' Drawing the white noise particles
  95.                For i = 1 To numnoise / 2
  96.                    Dim X As Integer = R.Next(0, CWidth)
  97.                    Dim Y As Integer = R.Next(0, CHeight)
  98.                    Dim int As Integer = R.Next(1, 2)
  99.                    g.FillEllipse(Brushes.White, New Rectangle(X, Y, R.Next(2, 5), R.Next(2, 5))) 'Size of the white noise
  100.                Next
  101.  
  102.            End Using
  103.  
  104.            cap = str
  105.            Return CAPTCHA
  106.        End Function
  107.  
  108.        ' Check captcha
  109.        Function Check(ByVal captcha As String, Optional ByVal IgnoreCase As Boolean = False) As Boolean
  110.            If IgnoreCase Then
  111.                If captcha.ToLower = CaptchaString.ToLower Then
  112.                    Return True
  113.                Else
  114.                    Return False
  115.                End If
  116.            Else
  117.                If captcha = CaptchaString Then
  118.                    Return True
  119.                Else
  120.                    Return False
  121.                End If
  122.            End If
  123.        End Function
  124.  
  125.    End Class
  126.  
  127. #End Region
  128.  
  129. #End Region
9357  Sistemas Operativos / Windows / Re: Buscador imvu en: 19 Marzo 2013, 14:37 pm
Esto es lo que te respondí en otro foro (por si no lo llegases a ver):



Cita de: quetzalcoatl67;1042863925
ya he comprobado que no me aparezca en los programas
La solución no es ocultarlo, sinó desinstalarlo. ¿Te refieres a la barra de programas de Firefox, o en la lista de programas instalados de Windows?


De todas formas sigue los pasos oficiales de desinstalación de IMVU:

http://imvuinc.ourtoolbar.com/help/

How do I uninstall the IMVU Inc toolbar?
Citar

Firefox users

    In the Firefox browser menu, select Add-ons > Extensions.
    Select the IMVU Inc Community Toolbar.
    Click Remove.


How do I enable or disable the search page that appears when I open a new tab?

Citar
Firefox users

    Open the toolbar's main menu (by clicking on the arrow immediately to the right of the toolbar's logo).
    Select Toolbar Options and then click the Additional Settings tab.
    Select or clear the check box next to: "Show a search box on new browser tabs."

How do I remove the IMVU Inc toolbar's customized Web Search?

Citar
Firefox users

    Open your browser's Search Engine menu (upper-right corner of your browser) by clicking the arrow.
    Choose Manage Search Engines…
    Select IMVU Inc Customized Web Search.
    Click the Remove button, and then click OK.


9358  Programación / Scripting / Re: Base de datos desde archivo de texto. en: 19 Marzo 2013, 14:28 pm
Bueno, no somos adivinos, ¿Windows o Linux?

No manejo las bases de datos MySQL así que desconozco como hacerlo, pero podría ser algo así:

AddData.bat
Código
  1. @Echo OFF
  2. For /F "Usebackq Tokens=*" %%X in ("Archivo.txt") Do (... "campo1" "%%X")


Quizás esto te sirva:

Google + "commandline add entry to mysql"

Citar
To insert data into MySQL table you would need to use SQL INSERT INTO command. You can insert data into MySQL table by using mysql> prompt or by using any script like PHP.
Syntax:

Here is generic SQL syntax of INSERT INTO command to insert data into MySQL table:

INSERT INTO table_name ( field1, field2,...fieldN )

www.tutorialspoint.com/mysql/mysql-insert-query.htm

http://www.ntchosting.com/mysql/insert-data-into-table.html

http://www.iis-aid.com/articles/how_to_guides/creating_mysql_database_via_the_command_line

http://dev.mysql.com/doc/refman/5.0/en/
9359  Programación / .NET (C#, VB.NET, ASP) / [SOLUCIONADO] ¿Como se puede cancelar una operación de FileCopy? en: 19 Marzo 2013, 14:28 pm
Si creo una aplicación y uso los metodos de "IO" o por ejemplo "My.Computer.FileSystem.CopyFile" para copiar un archivo de 50 GB, y cierro la aplicación, la operación de copiado reside en segundo plano y no se detiene hasta que el archivo haya sido copiado, así que parece ser que Windows es quien decide esto...

Mi pregunta es: ¿Se puede cancelar una operación de copiado?
y: ¿Se puede hacer de alguna manera segura? (no me gustaría que se corrompieran los datos del disco duro, o algo parecido)

No encuentro info en ningún lado

un saludo!
9360  Programación / Scripting / Re: Acciones sobre archivos de texto. [Batch] en: 19 Marzo 2013, 13:26 pm
@XWatmin

Acciones sobre archivos de texto. [Batch]

¿Que tiene que ver tu pregunta con la temática de este hilo?

La máquina Arcade es la que se llama "Sega model 2", el emulador todavía no sabemos cual es su nombre, hay muchos emuladores que corren roms de la SM2.

Infórmate sobre el nombre real del emulador que estás usando, después ve a la página oficial del emulador y descárgatelo, debe incluir un archivo de documentación y allí te debe indicar las opciones CommandLine del emulador para ejecutar una ROM, si la documentación no está en el emulador entonces debe estar en la página web oficial, así encontrarás lo que necesitas.

De todas formas has puesto mal el slash (la barra vertical), prueba así:
Código:
Emulator.exe ".\roms\daytona.zip" 

Si te quedan dudas no sigas este tema aquí o me veré obligado a eliminarlo, haz el favor de crear un nuevo post para formular preguntas que no estén relacionadas con archivos de texto.

Saludos.
Páginas: 1 ... 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 [936] 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines