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

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: 1 ... 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 [583] 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 ... 1236
5821  Comunicaciones / Redes / Re: [Software] Medir la estabilidad de la conexión a internet en: 7 Febrero 2015, 12:48 pm
¿La "estabilidad"?, me parece una pregunta demasiado abierta a interpretaciones.


Si quieres algo simple, con la aplicación IP Net Checker puedes monitorear la conectividad de tu red:
http://veronisoft.hostei.com/VSIPMonitor.html




Si quieres un kit más completo, entonces quizás te interese la aplicación todo-en-uno NetWorx, que tiene varias herramientas, aunque está orientada a la monitorización del tráfico de datos:
https://www.softperfect.com/products/networx/

Citar
With NetWorx you can:
    Find out and monitor how fast your Internet connection is and how much Internet traffic you consume.
    Verify whether your ISP charges your Internet usage fairly.
    ...
    Perform simple network tests such as ping and trace route.
    ...

Key Features
    ...
    Usage reports, exportable to a variety of file formats, including Excel, MS Word and HTML.
    ...
    Network information and testing tools with advanced netstat that displays applications using your Internet connection.
    Options to notify the user or automatically disconnect from the Internet when the network activity exceeds a certain level.
    Speed meter to accurately time downloads and report the average transfer rates.
    ...

   





Aquí puedes descargar mi instalador personalizado de ambos programas:
https://www.mediafire.com/?1hwvk28ecxkc3ws
https://www.mediafire.com/?x8hea0d262qtbti

Slaudos!
5822  Programación / .NET (C#, VB.NET, ASP) / Re: Utilizar un CheckBox en pantalla de inicio en: 7 Febrero 2015, 12:47 pm
Hay varias soluciones, pero crear y depender de un archivo de texto para el manejo de una única opción de usuario eso es una solución demasiado "basta".

Lo recomendable por Microsoft es almacenar la configuración de usuario en el registro de Windows, pero algo mucho más simple es utilizar la infrastructura de My.Settings para guardar la configuración de usuario.

Puedes crear una propiedad con el nombre "ShowWelcomeScreen" en las propiedades del proyecto (en la pestaña Properties/Propiedades), y una vez la hayas creado así es como la puedes manejar:

VB.Net
If My.Settings.ShowWelcomeScreen Then
  ' Mostrar bienvenida.
End If

C#
if (Properties.Settings.Default.ShowWelcomeScreen) {
   // Mostrar bienvenida.
}

PD: Debes publicar las preguntas sobre .Net en el subforo dedicado a la programación .Net, y especifica el lenguaje que estás utilizando, porfavor.

EDITO: Se me olvidaba comentar, que este tipo de configuración se almacenará dentro de la carpeta Roaming , en un archivo con structura XML, se guardará y se leerá automáticamente por la app (a menos que modifiques su comportamiento en las propiedades del proyecto) evitando tener que hacerlo todo tú creando un archivo de texto intermediario...

Más info en MSDN: https://msdn.microsoft.com/en-us/library/ms379611%28v=vs.80%29.aspx

Saludos!
5823  Programación / Programación General / MOVIDO: Utilizar un CheckBox en pantalla de inicio en: 7 Febrero 2015, 12:36 pm
El tema ha sido movido a .NET.

http://foro.elhacker.net/index.php?topic=429528.0
5824  Programación / Scripting / MOVIDO: ¿Se puede crear un script bajo un ddos? en: 7 Febrero 2015, 12:33 pm
El tema ha sido movido a Desarrollo Web.

http://foro.elhacker.net/index.php?topic=429569.0
5825  Foros Generales / Dudas Generales / Re: soy nuevo en esto :s en: 7 Febrero 2015, 12:06 pm
Una cosa (legal) que puedes hacer con una IP, es un lookup, rastrear la información del ISP.

⇲ ElHacker.net ofrece un servicio gratuito para hacer un geo-lookup
    http://www.elhacker.net/geolocalizacion.html

Saludos!
5826  Programación / .NET (C#, VB.NET, ASP) / Re: [Ayuda] Como hacer para validar una text box para q admita solo numeros en: 6 Febrero 2015, 10:49 am
Eso hoy en día es una leyenda, antes si era cierto, por que el CLR de VB6 ejecutaba mucho código basura, posteriormente se desarrollo (por así decirlo, .NET), y se determino, que un "wrapper" siendo un objeto a diferencia de un dato primitivo te brinda métodos que son de gran utilidad, para el manejo de primitivos.
Por esta razón, es que se utilizan esta y otras funciones en la gran mayoría de los lenguajes, sin considerarlos "deprecated".

No soy una persona de afirmar leyendas, ya que no es ninguna leyenda, es tal y como es;
la razón de que Microsoft decidiese desarrollar ese namespace fue con la finalidad de que a los desarrolladores del antiguo VB6 les fuera más comodo actualizarse a VB.Net, hallando así los mismos métodos que utilizaban en el antiguo VB6 al sentirse familiriazados con éstos, un motivo comprensible, pero eso no significa que lo correcto sea usarlos, ni que deban ser usados.

Obviamente al denominar como "obsoleto" los miembros de ese namespace no lo digo porque esté escrito en VB6, ya que es todo código .Net, y algunas de las llamadas de los métodos del namespace Microsoft.VisualBasic son simplemente wrappers de funcionalidades de otros métodos existentes de la librería de classes de .Net Framework, lo que podemos denominar "puro código .Net", pero otras muchas NO lo son, son "puro código basura".

Ya que para casi todos los métodos/funciones del namespace VisualBasic, existen versiones mucho más robustas en el resto de la librería de classes de .Net Framework.
Un ejemplo de esto sería la función "Val", comparándola con la función "TryParse" de un Datatype específico.

Los métodos/funciones del namespace VisualBasic usan técnicas consideradas deprecadas por el propio Microsoft (bueno, y por "la industria de la programación"), es decir, malas prácticas de programación , como por ejemplo el uso del GOTO y los Labels al proporcionar una estructura insegura al código,
para no dejarme nada en el tintero, esto es solo un ejemplo de dichas malas prácticas, y es algo que obviamente también se utiliza en el namespace System (lo nombro al ser el namespace que usaré para la siguiente comparación de abajo), pero con una menor frecuencia en al relación de veces usada * cantitad de miembros, siendo 155 veces en el namespace VisualBasic en 179 archivos desamblados, es decir, cerca del 87% de las classes utilizan esta mala práctica, y 915 veces en el namespace System en 1.681 archivos desamblados, alrededor de un 54% de las classes, pero vuelvo a recordar que solo era un ejemplo, no nos fijemos solo en este aspecto, ya que hay otras cosas del namespace VisualBasic que son "basura".

Y por esos motivos no es lo más conveniente usar esos wrappers.

Te mostraré algo, haciendo uso de la técnica Reflection, estas son las instrucciones de la función "Val" del namespace Microsoft.VisualBasic,

(omitiendo las instrucciones de varios métodos más como ChrW, etc, para no hacer más largo este post)

Código
  1. Public Shared Function Val(ByVal InputStr As String) As Double
  2.    Dim ch As Char
  3.    Dim num As Integer
  4.    Dim num2 As Integer
  5.    Dim num3 As Integer
  6.    Dim length As Integer
  7.    Dim num8 As Double
  8.    If (InputStr Is Nothing) Then
  9.        length = 0
  10.    Else
  11.        length = InputStr.Length
  12.    End If
  13.    Dim num4 As Integer = 0
  14.    Do While (num4 < length)
  15.        ch = InputStr.Chars(num4)
  16.        Select Case ch
  17.            Case ((ChrW(9) AndAlso ChrW(10)) AndAlso ((ChrW(13) AndAlso " "c) AndAlso ChrW(12288)))
  18.                Exit Select
  19.        End Select
  20.        num4 += 1
  21.    Loop
  22.    If (num4 >= length) Then
  23.        Return 0
  24.    End If
  25.    ch = InputStr.Chars(num4)
  26.    If (ch = "&"c) Then
  27.        Return Conversion.HexOrOctValue(InputStr, (num4 + 1))
  28.    End If
  29.    Dim flag As Boolean = False
  30.    Dim flag2 As Boolean = False
  31.    Dim flag3 As Boolean = False
  32.    Dim y As Double = 0
  33.    ch = InputStr.Chars(num4)
  34.    Select Case ch
  35.        Case "-"c
  36.            flag3 = True
  37.            num4 += 1
  38.            Exit Select
  39.        Case "+"c
  40.            num4 += 1
  41.            Exit Select
  42.    End Select
  43.    Do While (num4 < length)
  44.        ch = InputStr.Chars(num4)
  45.        Dim ch3 As Char = ch
  46.        If (((ch3 = ChrW(9)) OrElse (ch3 = ChrW(10))) OrElse (((ch3 = ChrW(13)) OrElse (ch3 = " "c)) OrElse (ch3 = ChrW(12288)))) Then
  47.            num4 += 1
  48.        Else
  49.            If (ch3 = "0"c) Then
  50.                If ((num <> 0) OrElse flag) Then
  51.                    num8 = (((num8 * 10) + CDbl(ch)) - 48)
  52.                    num4 += 1
  53.                    num += 1
  54.                Else
  55.                    num4 += 1
  56.                End If
  57.                Continue Do
  58.            End If
  59.            If ((ch3 >= "1"c) AndAlso (ch3 <= "9"c)) Then
  60.                num8 = (((num8 * 10) + CDbl(ch)) - 48)
  61.                num4 += 1
  62.                num += 1
  63.            Else
  64.                If (ch3 = "."c) Then
  65.                    num4 += 1
  66.                    If flag Then
  67.                        Exit Do
  68.                    End If
  69.                    flag = True
  70.                    num3 = num
  71.                    Continue Do
  72.                End If
  73.                If (((ch3 = "e"c) OrElse (ch3 = "E"c)) OrElse ((ch3 = "d"c) OrElse (ch3 = "D"c))) Then
  74.                    flag2 = True
  75.                    num4 += 1
  76.                End If
  77.                Exit Do
  78.            End If
  79.        End If
  80.    Loop
  81.    If flag Then
  82.        num2 = (num - num3)
  83.    End If
  84.    If Not flag2 Then
  85.        If (flag AndAlso (num2 <> 0)) Then
  86.            num8 = (num8 / Math.Pow(10, CDbl(num2)))
  87.        End If
  88.    Else
  89.        Dim flag4 As Boolean = False
  90.        Dim flag5 As Boolean = False
  91.        Do While (num4 < length)
  92.            ch = InputStr.Chars(num4)
  93.            Dim ch4 As Char = ch
  94.            If (((ch4 = ChrW(9)) OrElse (ch4 = ChrW(10))) OrElse (((ch4 = ChrW(13)) OrElse (ch4 = " "c)) OrElse (ch4 = ChrW(12288)))) Then
  95.                num4 += 1
  96.            ElseIf ((ch4 >= "0"c) AndAlso (ch4 <= "9"c)) Then
  97.                y = (((y * 10) + CDbl(ch)) - 48)
  98.                num4 += 1
  99.            Else
  100.                If (ch4 = "+"c) Then
  101.                    If flag4 Then
  102.                        Exit Do
  103.                    End If
  104.                    flag4 = True
  105.                    num4 += 1
  106.                    Continue Do
  107.                End If
  108.                If ((ch4 <> "-"c) OrElse flag4) Then
  109.                    Exit Do
  110.                End If
  111.                flag4 = True
  112.                flag5 = True
  113.                num4 += 1
  114.            End If
  115.        Loop
  116.        If flag5 Then
  117.            y = (y + num2)
  118.            num8 = (num8 * Math.Pow(10, -y))
  119.        Else
  120.            y = (y - num2)
  121.            num8 = (num8 * Math.Pow(10, y))
  122.        End If
  123.    End If
  124.    If Double.IsInfinity(num8) Then
  125.        Throw ExceptionUtils.VbMakeException(6)
  126.    End If
  127.    If flag3 Then
  128.        num8 = -num8
  129.    End If
  130.    Select Case ch
  131.        Case "%"c
  132.            If (num2 > 0) Then
  133.                Throw ExceptionUtils.VbMakeException(13)
  134.            End If
  135.            Return CDbl(CShort(Math.Round(num8)))
  136.        Case "&"c
  137.            If (num2 > 0) Then
  138.                Throw ExceptionUtils.VbMakeException(13)
  139.            End If
  140.            Return CDbl(CInt(Math.Round(num8)))
  141.        Case "!"c
  142.            Return CDbl(CSng(num8))
  143.        Case "@"c
  144.            Return Convert.ToDouble(New Decimal(num8))
  145.    End Select
  146.    Return num8
  147. End Function
  148.  

Y estas son las de la función "IsNumeric" del mismo namespace:
Código
  1. Public Shared Function IsNumeric(ByVal expression As Object) As Boolean
  2.    Dim num As Double
  3.    Dim convertible As IConvertible = TryCast(expression,IConvertible)
  4.    If (convertible Is Nothing) Then
  5.        Dim chArray As Char() = TryCast(expression,Char())
  6.        If (chArray Is Nothing) Then
  7.            Return False
  8.        End If
  9.        expression = New String(chArray)
  10.    End If
  11.    Dim typeCode As TypeCode = convertible.GetTypeCode
  12.    If ((typeCode <> TypeCode.String) AndAlso (typeCode <> TypeCode.Char)) Then
  13.        Return Information.IsOldNumericTypeCode(typeCode)
  14.    End If
  15.    Dim str As String = convertible.ToString(Nothing)
  16.    Try
  17.        Dim num2 As Long
  18.        If Utils.IsHexOrOctValue(str, num2) Then
  19.            Return True
  20.        End If
  21.    Catch exception As StackOverflowException
  22.        Throw exception
  23.    Catch exception2 As OutOfMemoryException
  24.        Throw exception2
  25.    Catch exception3 As ThreadAbortException
  26.        Throw exception3
  27.    Catch exception6 As Exception
  28.        Return False
  29.    End Try
  30.    Return DoubleType.TryParse(str, num)
  31. End Function
  32.  
  33. Friend Shared Function IsHexOrOctValue(ByVal Value As String, ByRef i64Value As Long) As Boolean
  34.    Dim num As Integer
  35.    Dim length As Integer = Value.Length
  36.    Do While (num < length)
  37.        Dim ch As Char = Value.Chars(num)
  38.        If ((ch = "&"c) AndAlso ((num + 2) < length)) Then
  39.            ch = Char.ToLower(Value.Chars((num + 1)), CultureInfo.InvariantCulture)
  40.            Dim str As String = Utils.ToHalfwidthNumbers(Value.Substring((num + 2)), Utils.GetCultureInfo)
  41.            Select Case ch
  42.                Case "h"c
  43.                    i64Value = Convert.ToInt64(str, &H10)
  44.                    goto Label_0087
  45.                Case "o"c
  46.                    i64Value = Convert.ToInt64(str, 8)
  47.                    goto Label_0087
  48.            End Select
  49.            Throw New FormatException
  50.        End If
  51.        If ((ch <> " "c) AndAlso (ch <> ChrW(12288))) Then
  52.            Return False
  53.        End If
  54.        num += 1
  55.    Loop
  56.    Return False
  57. Label_0087:
  58.    Return True
  59. End Function
  60.  


Mientras que esto son las instrucciones de la función "Double.TryParse" dentro del namespace System:

Código
  1. <__DynamicallyInvokable> _
  2. Public Shared Function TryParse(ByVal s As String, <Out> ByRef result As Double) As Boolean
  3.    Return Double.TryParse(s, (NumberStyles.Float Or NumberStyles.AllowThousands), NumberFormatInfo.CurrentInfo, result)
  4. End Function
  5.  
  6. Private Shared Function TryParse(ByVal s As String, ByVal style As NumberStyles, ByVal info As NumberFormatInfo, <Out> ByRef result As Double) As Boolean
  7.    If (s Is Nothing) Then
  8.        result = 0
  9.        Return False
  10.    End If
  11.    If Not Number.TryParseDouble(s, style, info, result) Then
  12.        Dim str As String = s.Trim
  13.        If Not str.Equals(info.PositiveInfinitySymbol) Then
  14.            If Not str.Equals(info.NegativeInfinitySymbol) Then
  15.                If Not str.Equals(info.NaNSymbol) Then
  16.                    Return False
  17.                End If
  18.                result = Double.NaN
  19.            Else
  20.                result = Double.NegativeInfinity
  21.            End If
  22.        Else
  23.            result = Double.PositiveInfinity
  24.        End If
  25.    End If
  26.    Return True
  27. End Function
  28.  
  29. <SecuritySafeCritical> _
  30. Friend Shared Function TryParseDouble(ByVal value As String, ByVal options As NumberStyles, ByVal numfmt As NumberFormatInfo, <Out> ByRef result As Double) As Boolean
  31.    Dim stackBuffer As Byte* = stackalloc Byte[DirectCast(NumberBuffer.NumberBufferBytes, IntPtr)]
  32.    Dim number As New NumberBuffer(stackBuffer)
  33.    result = 0
  34.    If Not Number.TryStringToNumber(value, options, number, numfmt, False) Then
  35.        Return False
  36.    End If
  37.    If Not Number.NumberBufferToDouble(number.PackForNative, result) Then
  38.        Return False
  39.    End If
  40.    Return True
  41. End Function
  42.  
  43. <TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")> _
  44. Friend Shared Function TryStringToNumber(ByVal str As String, ByVal options As NumberStyles, ByRef number As NumberBuffer, ByVal numfmt As NumberFormatInfo, ByVal parseDecimal As Boolean) As Boolean
  45.    Return Number.TryStringToNumber(str, options, number, Nothing, numfmt, parseDecimal)
  46. End Function
  47.  
  48. <SecuritySafeCritical, FriendAccessAllowed> _
  49. Friend Shared Function TryStringToNumber(ByVal str As String, ByVal options As NumberStyles, ByRef number As NumberBuffer, ByVal sb As StringBuilder, ByVal numfmt As NumberFormatInfo, ByVal parseDecimal As Boolean) As Boolean
  50.    If (str Is Nothing) Then
  51.        Return False
  52.    End If
  53.    Dim str2 As Char*
  54.    Fixed str2 = DirectCast(str, Char*)
  55.        Dim chPtr As Char* = str2
  56.        Dim chPtr2 As Char* = chPtr
  57.        If (Not Number.ParseNumber(chPtr2, options, number, sb, numfmt, parseDecimal) OrElse ((CLng(((chPtr2 - chPtr) / 2)) < str.Length) AndAlso Not Number.TrailingZeros(str, CInt(CLng(((chPtr2 - chPtr) / 2)))))) Then
  58.            Return False
  59.        End If
  60.    End Fixed
  61.    Return True
  62. End Function
  63.  
  64. <SecurityCritical> _
  65. Private Shared Function ParseNumber(ByRef str As Char*, ByVal options As NumberStyles, ByRef number As NumberBuffer, ByVal sb As StringBuilder, ByVal numfmt As NumberFormatInfo, ByVal parseDecimal As Boolean) As Boolean
  66.    Dim currencyDecimalSeparator As String
  67.    Dim currencyGroupSeparator As String
  68.    Dim chPtr2 As Char*
  69.    number.scale = 0
  70.    number.sign = False
  71.    Dim currencySymbol As String = Nothing
  72.    Dim ansiCurrencySymbol As String = Nothing
  73.    Dim numberDecimalSeparator As String = Nothing
  74.    Dim numberGroupSeparator As String = Nothing
  75.    Dim flag As Boolean = False
  76.    If ((options And NumberStyles.AllowCurrencySymbol) <> NumberStyles.None) Then
  77.        currencySymbol = numfmt.CurrencySymbol
  78.        If (Not numfmt.ansiCurrencySymbol Is Nothing) Then
  79.            ansiCurrencySymbol = numfmt.ansiCurrencySymbol
  80.        End If
  81.        numberDecimalSeparator = numfmt.NumberDecimalSeparator
  82.        numberGroupSeparator = numfmt.NumberGroupSeparator
  83.        currencyDecimalSeparator = numfmt.CurrencyDecimalSeparator
  84.        currencyGroupSeparator = numfmt.CurrencyGroupSeparator
  85.        flag = True
  86.    Else
  87.        currencyDecimalSeparator = numfmt.NumberDecimalSeparator
  88.        currencyGroupSeparator = numfmt.NumberGroupSeparator
  89.    End If
  90.    Dim num As Integer = 0
  91.    Dim flag2 As Boolean = False
  92.    Dim flag3 As Boolean = (Not sb Is Nothing)
  93.    Dim flag4 As Boolean = (flag3 AndAlso ((options And NumberStyles.AllowHexSpecifier) <> NumberStyles.None))
  94.    Dim num2 As Integer = If(flag3, &H7FFFFFFF, 50)
  95.    Dim p As Char* = str
  96.    Dim ch As Char = p(0)
  97.    Do While True
  98.        If ((Not Number.IsWhite(ch) OrElse ((options And NumberStyles.AllowLeadingWhite) = NumberStyles.None)) OrElse (((num And 1) <> 0) AndAlso (((num And 1) = 0) OrElse (((num And &H20) = 0) AndAlso (numfmt.numberNegativePattern <> 2))))) Then
  99.            If (flag2 = (((options And NumberStyles.AllowLeadingSign) <> NumberStyles.None) AndAlso ((num And 1) = 0)) AndAlso (Not chPtr2 = Number.MatchChars(p, numfmt.positiveSign) Is Nothing)) Then
  100.                num = (num Or 1)
  101.                p = (chPtr2 - 1)
  102.            ElseIf (flag2 AndAlso (Not chPtr2 = Number.MatchChars(p, numfmt.negativeSign) Is Nothing)) Then
  103.                num = (num Or 1)
  104.                number.sign = True
  105.                p = (chPtr2 - 1)
  106.            ElseIf (((ch = "("c) AndAlso ((options And NumberStyles.AllowParentheses) <> NumberStyles.None)) AndAlso ((num And 1) = 0)) Then
  107.                num = (num Or 3)
  108.                number.sign = True
  109.            Else
  110.                If (((currencySymbol Is Nothing) OrElse (chPtr2 = Number.MatchChars(p, currencySymbol) Is Nothing)) AndAlso ((ansiCurrencySymbol Is Nothing) OrElse (chPtr2 = Number.MatchChars(p, ansiCurrencySymbol) Is Nothing))) Then
  111.                    Exit Do
  112.                End If
  113.                num = (num Or &H20)
  114.                currencySymbol = Nothing
  115.                ansiCurrencySymbol = Nothing
  116.                p = (chPtr2 - 1)
  117.            End If
  118.        End If
  119.        ch = ++p
  120.    Loop
  121.    Dim num3 As Integer = 0
  122.    Dim index As Integer = 0
  123.    Do While True
  124.        If (((ch >= "0"c) AndAlso (ch <= "9"c)) OrElse (((options And NumberStyles.AllowHexSpecifier) <> NumberStyles.None) AndAlso (((ch >= "a"c) AndAlso (ch <= "f"c)) OrElse ((ch >= "A"c) AndAlso (ch <= "F"c))))) Then
  125.            num = (num Or 4)
  126.            If (((ch <> "0"c) OrElse ((num And 8) <> 0)) OrElse flag4) Then
  127.                If (num3 < num2) Then
  128.                    If flag3 Then
  129.                        sb.Append(ch)
  130.                    Else
  131.                        number.digits(num3++) = ch
  132.                    End If
  133.                    If ((ch <> "0"c) OrElse parseDecimal) Then
  134.                        index = num3
  135.                    End If
  136.                End If
  137.                If ((num And &H10) = 0) Then
  138.                    number.scale += 1
  139.                End If
  140.                num = (num Or 8)
  141.            ElseIf ((num And &H10) <> 0) Then
  142.                number.scale -= 1
  143.            End If
  144.        ElseIf ((((options And NumberStyles.AllowDecimalPoint) <> NumberStyles.None) AndAlso ((num And &H10) = 0)) AndAlso ((Not chPtr2 = Number.MatchChars(p, currencyDecimalSeparator) Is Nothing) OrElse ((flag AndAlso ((num And &H20) = 0)) AndAlso (Not chPtr2 = Number.MatchChars(p, numberDecimalSeparator) Is Nothing)))) Then
  145.            num = (num Or &H10)
  146.            p = (chPtr2 - 1)
  147.        Else
  148.            If (((((options And NumberStyles.AllowThousands) = NumberStyles.None) OrElse ((num And 4) = 0)) OrElse ((num And &H10) <> 0)) OrElse ((chPtr2 = Number.MatchChars(p, currencyGroupSeparator) Is Nothing) AndAlso ((Not flag OrElse ((num And &H20) <> 0)) OrElse (chPtr2 = Number.MatchChars(p, numberGroupSeparator) Is Nothing)))) Then
  149.                Exit Do
  150.            End If
  151.            p = (chPtr2 - 1)
  152.        End If
  153.        ch = ++p
  154.    Loop
  155.    Dim flag5 As Boolean = False
  156.    number.precision = index
  157.    If flag3 Then
  158.        sb.Append(ChrW(0))
  159.    Else
  160.        number.digits(index) = ChrW(0)
  161.    End If
  162.    If ((num And 4) <> 0) Then
  163.        If (((ch = "E"c) OrElse (ch = "e"c)) AndAlso ((options And NumberStyles.AllowExponent) <> NumberStyles.None)) Then
  164.            Dim chPtr3 As Char* = p
  165.            ch = ++p
  166.            chPtr2 = Number.MatchChars(p, numfmt.positiveSign)
  167.            If (Not chPtr2 Is Nothing) Then
  168.                ch = p = chPtr2
  169.            Else
  170.                chPtr2 = Number.MatchChars(p, numfmt.negativeSign)
  171.                If (Not chPtr2 Is Nothing) Then
  172.                    ch = p = chPtr2
  173.                    flag5 = True
  174.                End If
  175.            End If
  176.            If ((ch >= "0"c) AndAlso (ch <= "9"c)) Then
  177.                Dim num5 As Integer = 0
  178.                Do
  179.                    num5 = ((num5 * 10) + (ch - "0"c))
  180.                    ch = ++p
  181.                    If (num5 > &H3E8) Then
  182.                        num5 = &H270F
  183.                        Do While ((ch >= "0"c) AndAlso (ch <= "9"c))
  184.                            ch = ++p
  185.                        Loop
  186.                    End If
  187.                Loop While ((ch >= "0"c) AndAlso (ch <= "9"c))
  188.                If flag5 Then
  189.                    num5 = -num5
  190.                End If
  191.                number.scale = (number.scale + num5)
  192.            Else
  193.                p = chPtr3
  194.                ch = p(0)
  195.            End If
  196.        End If
  197.        Do While True
  198.            If (Not Number.IsWhite(ch) OrElse ((options And NumberStyles.AllowTrailingWhite) = NumberStyles.None)) Then
  199.                If (flag2 = (((options And NumberStyles.AllowTrailingSign) <> NumberStyles.None) AndAlso ((num And 1) = 0)) AndAlso (Not chPtr2 = Number.MatchChars(p, numfmt.positiveSign) Is Nothing)) Then
  200.                    num = (num Or 1)
  201.                    p = (chPtr2 - 1)
  202.                ElseIf (flag2 AndAlso (Not chPtr2 = Number.MatchChars(p, numfmt.negativeSign) Is Nothing)) Then
  203.                    num = (num Or 1)
  204.                    number.sign = True
  205.                    p = (chPtr2 - 1)
  206.                ElseIf ((ch = ")"c) AndAlso ((num And 2) <> 0)) Then
  207.                    num = (num And -3)
  208.                Else
  209.                    If (((currencySymbol Is Nothing) OrElse (chPtr2 = Number.MatchChars(p, currencySymbol) Is Nothing)) AndAlso ((ansiCurrencySymbol Is Nothing) OrElse (chPtr2 = Number.MatchChars(p, ansiCurrencySymbol) Is Nothing))) Then
  210.                        Exit Do
  211.                    End If
  212.                    currencySymbol = Nothing
  213.                    ansiCurrencySymbol = Nothing
  214.                    p = (chPtr2 - 1)
  215.                End If
  216.            End If
  217.            ch = ++p
  218.        Loop
  219.        If ((num And 2) = 0) Then
  220.            If ((num And 8) = 0) Then
  221.                If Not parseDecimal Then
  222.                    number.scale = 0
  223.                End If
  224.                If ((num And &H10) = 0) Then
  225.                    number.sign = False
  226.                End If
  227.            End If
  228.            str = p
  229.            Return True
  230.        End If
  231.    End If
  232.    str = p
  233.    Return False
  234. End Function
  235.  

Espero que se pueda entender la diferencia, y lo que denomino robustez ...aparte de lo que ya he comentado sobre ello.

Doy este debate por finalizado para no desviar todavía más el tema principal.

Saludos!
5827  Programación / Scripting / Re: Copiar directorio y subdirectorios con archivos de fotos y renombrar en: 6 Febrero 2015, 09:28 am
Buenas

Ejemplo:
       ORIGEN                        RENOMBRADAS
20151019_IMAGE01.jpg     20151019-182822.jpg

Explica de donde sale ese "182822", por favor.

De todas formas el foro no está para hacer la tarea de los demás, aquí te podemos ayudar a resolver dudas específicas para que puedas elaborar el código por ti mismo, ¿donde está tu código?, demuestra que lo has intentado por ti solo.

PD: No se si utilizas algún programa de terceros para leer los metadatos, pero en un lenguaje simple como Batch no puedes leer metadatos, para dicha tarea te recomiendo la aplicación exif-tool: http://www.sno.phy.queensu.ca/~phil/exiftool/

Saludos!
5828  Programación / .NET (C#, VB.NET, ASP) / Re: [Ayuda] Como hacer para validar una text box para q admita solo numeros en: 6 Febrero 2015, 07:04 am
Puedes utilizar la Función "IsNumeric", ejemplo:

Lo que sugieres son malas prácticas de programación, al utilizar un wrapper de VB6.

¿Has leido mi post?, arriba puse un ejemplo sencillo de como usar su equivalente en .Net, utilizando el método Char.IsNumber()

Por otor lado, para comrprobar si un String es numérico, el equivalente de "IsNumeric" en .Net sería utilizar el método Parse/TryParse del Datatype específico, por ejemplo:

Código
  1. If Integer.TryParse("123", New Integer) Then
  2. ' Es un número.
  3. End If

...Pero eso es algo innecesario al igual que la función IsNumeric, ya que la pregunta no requiere comprobar un String, sino un único Char.

Este comentario es con la intención de orientar a aquellas personas que sugieren la utilización de la función IsNumeric, al igual que Left, Right, y todas esas cosas obsoletas, Porfavor, eviten su utilización.

Saludos!
5829  Foros Generales / Sugerencias y dudas sobre el Foro / Re: subiri foto o imagenes en: 6 Febrero 2015, 01:23 am
Lee aquí: Insertar imagen

saludos
5830  Foros Generales / Sugerencias y dudas sobre el Foro / Re: (duda sobre este foro) ¿Se puede poner links sobre programación? en: 6 Febrero 2015, 00:57 am
También puedes utilizar tu firma para publicar las urls a tu página o las noticias de tus tutoriales.

Mira dentro de la sección que tienes para personalizar tu perfil de usuario:
http://foro.elhacker.net/profile.html

Saludos
Páginas: 1 ... 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 [583] 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines