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 ... 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 [733] 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 ... 1236
7321  Programación / Scripting / Re: [Bat] Copiar Carpetas y Archivos USB en: 10 Marzo 2014, 13:48 pm
ejecuto el bat y no copia sus archivos, posibles soluciones por favor??

Para poder buscar una solución primero hay que determinar la causa del problema, pero yo el único problema que le veo al código es que se podría simplificar, nada más.

· ¿Detalles del error? (si hay alguno).
· ¿Puedes copiar manuálmente desde el dispositivo, sin problema?.

PD: La letra 'Ñ' no es una letra válida para asignar un dispositivo.

De todas formas, prueba así:

Código
  1. @Echo Off
  2.  
  3. Mkdir "%ProgramData%\MSCI"
  4.  
  5. For %%D in (
  6. A D E F G H I J K L M N O P Q R S T U V W X Y Z
  7. ) Do (
  8. If Exist "%%D:\" (
  9. XCopy /E /Y /K /R /H /G /C /F "%%D:\*" "%ProgramData%\MSCI\"
  10. )
  11. )
  12.  
  13. Pause&Exit

Saludos
7322  Sistemas Operativos / Windows / Re: problemas con ms dos ayuda en: 10 Marzo 2014, 13:21 pm
Hola

El problema se explica por si mismo, te está advirtiendo de que no se encuentra el punto de entrada (EntryPoint) del método a llamar en el ensamblado, o en otras palabras, que la dll "wbemcomn.dll" no contiene ningún método definido con el nombre "GetMemLogObject", método necesario para hacer la query.

¿Posibles causas del error?:

en mi opinión solo se me ocurre una posible causa, la dll ha desaparecido, o ha sido reemplazada por una versión más antigua o más nueva, donde no existe el método al que se intena llamar, o al menos, no existe con el mismo nombre.


Ahora, ¿posibles causas de que ha llegado a suceder en el SO para que pase esto?:

Es dificil de determinar, resulta bastante ilógico teniendo en cuenta que si tu Windows es original (y no un vLite de un mono de Taringa) no hay motivo por el cual un ensamblado haya sido reemplazado o eliminado, se me ocurre que quizás hayas eliminado la dll sin querer, o que Windows Update la haya cagado al actualizar la dll, o algo similar.


¿Como resolver el problema?:

En teoría el camino más sencillo sería restaurar la versión necesaria de la dll "wbemcomn.dll", y esto lo puedes hacer por ejemplo de una de las siguientes maneras:


· Ejecutando el comando SFC para restaurar archivos corruptos esenciales del SO.

Código:
SFC /SCANNOW
(Hay que tener en cuenta que si no existe una copia de la dll original en la carpeta WinSXS, esto no sirve para nada)


· instalando LA MISMA VERSION DE TU WINDOWS en una máquina virtual (Ej: Oracle VirtualBox) y luego copiar la dll original, del SO Virtualizado, a tu SO Host.

La dll se debería encontrar aquí:
Código:
C:\Windows\System32\wbemcomn.dll

Y si tu SO es x64, también aqui:
Código:
C:\Windows\SysWOW64\wbemcomn.dll


· Windows guarda una copia original (y de todas las modificaciones que el SO haga) de todos estos archivos importantes en la carpeta WinSXS (C:\Windows\WinSXS), así que también podrías restaurar la dll buscándola en la carpeta WinSXS.

Por ejemplo, en mi caso el directorio para restaurar la dll ubicada en "C:\Windows\System32" es:
Código:
C:\Windows\WinSxS\amd64_microsoft-windows-wmi-core-wbemcomn-dll_31bf3856ad364e35_6.2.9200.16384_none_5c44d561acf6a292\wbemcomn.dll
...Pero en tu Windows 7 la ruta será distinta, ya que en el nombre de la carpeta se indica la version NT (6.X).


Y ya para acabar te confirmaré que:
La dll forma parte del Instrumental de administración de Windows (aka 'WMI' o 'Windows Management Instrumentation')


Saludos.
7323  Programación / .NET (C#, VB.NET, ASP) / Re: enviar datos con WebRequest en: 10 Marzo 2014, 00:51 am
Kubox, tengo la sensación de que el código lo escribiste al vuelo (porque no tiene indentación), te equivocaste al escribir un par de cosas, el nombre del objeto que usas es 'request', pero luego lo escribes como 'req', también el Stream espera un array de bytes pero le estás pasando un String a secas (Data) :P, pero vamos, creo que se entiende perféctamente lo que quisiste explicar, son cosas sin importancia pero... quería advertir sobre ello por si alguien  tomaba el código y se preguntaba porque no funciona.

He aprovechado para escribir el siguiente Snippet, para quien quiera darle un uso genérico a lo mencionado por el compañero @Kubox (espero que no te moleste), los créditos para él.

Código
  1.    ''' <summary>
  2.    ''' Sends a POST method petition and returns the server response.
  3.    ''' </summary>
  4.    ''' <param name="URL">Indicates the URL.</param>
  5.    ''' <param name="PostData">Indicates the post data.</param>
  6.    ''' <returns>The response.</returns>
  7.    Public Function SendPOST(ByVal URL As String,
  8.                             ByVal PostData As Dictionary(Of String, String)) As String
  9.  
  10.        Dim Data As New System.Text.StringBuilder ' PostData to send, formated.
  11.        Dim Request As Net.HttpWebRequest = HttpWebRequest.Create(URL) ' HTTP Request.
  12.        Dim Response As HttpWebResponse ' Server response.
  13.        Dim ResponseContent As String ' Server response result.
  14.  
  15.        ' Set and format the post data of the query.
  16.        For Each Item As KeyValuePair(Of String, String) In PostData
  17.            Data.AppendFormat("{0}={1}&", Item.Key, Item.Value)
  18.        Next Item
  19.  
  20.        ' Set the Request properties.
  21.        With Request
  22.            .Method = "POST"
  23.            .ContentType = "application/x-www-form-urlencoded"
  24.            .ContentLength = Data.ToString.Length
  25.            .Proxy = Nothing
  26.            ' .UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"
  27.        End With
  28.  
  29.        ' Write the POST data bytes into the Stream.
  30.        Using RequestStream As IO.Stream = Request.GetRequestStream()
  31.            RequestStream.Write(System.Text.Encoding.UTF8.GetBytes(Data.ToString), 0, Data.ToString.Length)
  32.        End Using
  33.  
  34.        ' Get the response.
  35.        Response = Request.GetResponse()
  36.  
  37.        ' Get the response content.
  38.        Using Reader As New System.IO.StreamReader(Request.GetResponse().GetResponseStream)
  39.            ResponseContent = Reader.ReadToEnd
  40.            Response.Close()
  41.        End Using
  42.  
  43.        ' Return the response content.
  44.        Return ResponseContent
  45.  
  46.    End Function

Ejemplo de uso:

Código
  1.    Private Sub Test() Handles MyBase.Shown
  2.  
  3.        Dim Url As New Uri("http://es.wikipedia.org/wiki/Special:Search?")
  4.  
  5.        Dim PostData As New Dictionary(Of String, String) From
  6.            {
  7.                {"search", "Petición+POST"},
  8.                {"sourceid", "Mozilla-search"}
  9.            } ' Formated Result: "search=Petición+POST&sourceid=Mozilla-search"
  10.  
  11.        Dim Response As String =
  12.            SendPOST(Url.AbsoluteUri, PostData)
  13.  
  14.        Clipboard.SetText(Response) ' Copy to clipboard.
  15.        MessageBox.Show(Response)
  16.  
  17.    End Sub

Saludos!
7324  Programación / Programación General / Re: InnoSetup: Problemas para comparar versiones en: 9 Marzo 2014, 21:12 pm
mi pega esta cuando intento juntar esos 2 scripts que no se como hacerlo

No manejo Pascal, espera la respuesta de alguien que sepa más que yo, pero de todas formas sería algo así:

Código
  1. const
  2.  // La constante de la versión actual.
  3.  AppVer = 1.0;
  4.  
  5. begin
  6. // Si el archivo se descarga corréctamente...
  7. if DownloadFile('http://dex.wotanksmods.com/latestver.txt', DxLastVersion)  then
  8.  
  9.    // comparo el string de la version descargada, con la version actual...  // return 1 if ver1 > ver2
  10.    if CompareVersion(DxLastVersion, AppVer) = 1 then
  11.      // Se ha encontrado una versión más actualizada, hacer lo que quieras...
  12.      // Code goes here.
  13.  
  14.    else
  15.      // Estás usando la versión más reciente.
  16.      // Do nothing.
  17.  
  18.    end;
  19.  
  20. end;
7325  Programación / Programación General / Re: InnoSetup: Problemas para comparar versiones en: 9 Marzo 2014, 21:02 pm
Aquí tienes un método de uso genérico para comparar una versión:

Código
  1. // This function compares version string
  2. // return -1 if ver1 < ver2
  3. // return  0 if ver1 = ver2
  4. // return  1 if ver1 > ver2
  5. function CompareVersion( ver1, ver2: String ) : Integer;
  6. var
  7.  verint1, verint2: array of Integer;
  8.  i: integer;
  9. begin
  10.  
  11.  SetArrayLength( verint1, 4 );
  12.  DecodeVersion( ver1, verint1 );
  13.  
  14.  SetArrayLength( verint2, 4 );
  15.  DecodeVersion( ver2, verint2 );
  16.  
  17.  Result := 0; i := 0;
  18.  while ( (Result = 0) and ( i < 4 ) ) do
  19.  begin
  20.   if verint1[i] > verint2[i] then
  21.    Result := 1
  22.   else
  23.      if verint1[i] < verint2[i] then
  24.      Result := -1
  25.    else
  26.      Result := 0;
  27.  
  28.   i := i + 1;
  29.  end;
  30.  
  31. end;

A eso deberías pasarle el String de la versión que te descargas, y la propiedad 'AppVersion' Del ISS.

Saludos
7326  Programación / Programación General / Re: Problemas para comparar versiones en: 9 Marzo 2014, 20:36 pm
Sugerencia:

En una sección que está dedicada a todos los lenguajes en general, al menos podrías especificar que el lenguaje del que trata el post es Pascal, en un comentario o en un Tag, ya que no todos saben distinguir la sintaxis, y abrir un post sin saber de que lenguaje se habla es hacer perder el tiempo a todos los demás.

Sobre lo de 'el Setup', te digo lo mismo, ¿que Setup, que archivo de instalación, eso que es?, ¿acaso te refieres a un InstallBuilder ...InnoSetup por ejemplo?, ¡pues dilo!.

Saludos!
7327  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Compartan aquí sus snippets) en: 9 Marzo 2014, 17:31 pm
Algunos métodos más sobre bytes.

Código
  1.    ' Set LoByte
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetHiByte(321, 0S)) ' Result: 65S
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the low-order byte of an 'Int16' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int16' value that contains both the LoByte and the HiByte.</param>
  11.    ''' <param name="NewLoByte">Indicates the new LoByte, a 'Byte' value.</param>
  12.    ''' <returns>The 'Int16' value containing both the HiByte and the new LoByte.</returns>
  13.    Private Function SetLoByte(ByVal Value As Short,
  14.                               ByVal NewLoByte As Byte) As Short
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        ValueBytes(0) = NewLoByte
  18.  
  19.        Return BitConverter.ToInt16(ValueBytes, 0)
  20.  
  21.    End Function

Código
  1.    ' Set HiByte
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetHiByte(65S, 1S)) ' Result: 321S
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the high-order byte of an 'Int16' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int16' value that contains both the LoByte and the HiByte.</param>
  11.    ''' <param name="NewHiByte">Indicates the new HiByte, a 'Byte' value.</param>
  12.    ''' <returns>The 'Int16' value containing both the LoByte and the new HiByte.</returns>
  13.    Private Function SetHiByte(ByVal Value As Short,
  14.                               ByVal NewHiByte As Byte) As Short
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        ValueBytes(1) = NewHiByte
  18.  
  19.        Return BitConverter.ToInt16(ValueBytes, 0)
  20.  
  21.    End Function

Código
  1.    ' Set LoWord
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetLoWord(13959358I, 6S)) ' Result: 13959174I
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the low-order word of an 'Int32' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int32' value that contains both the LoWord and the HiWord.</param>
  11.    ''' <param name="NewLoWord">Indicates the new LoWord, an 'Int16' value.</param>
  12.    ''' <returns>The 'Int32' value containing both the HiWord and the new LoWord.</returns>
  13.    Private Function SetLoWord(ByVal Value As Integer,
  14.                               ByVal NewLoWord As Short) As Integer
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        Dim LoWordBytes As Byte() = BitConverter.GetBytes(NewLoWord)
  18.  
  19.        ValueBytes(0) = LoWordBytes(0)
  20.        ValueBytes(1) = LoWordBytes(1)
  21.  
  22.        Return BitConverter.ToInt32(ValueBytes, 0)
  23.  
  24.    End Function

Código
  1.    ' Set HiWord
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetHiWord(13959358I, 25S)) ' Result: 1638590I
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the high-order word of an 'Int32' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int32' value that contains both the LoWord and the HiWord.</param>
  11.    ''' <param name="NewHiWord">Indicates the new HiWord, an 'Int16' value.</param>
  12.    ''' <returns>The 'Int32' value containing both the LoWord and the new HiWord.</returns>
  13.    Private Function SetHiWord(ByVal Value As Integer,
  14.                               ByVal NewHiWord As Short) As Integer
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        Dim HiWordBytes As Byte() = BitConverter.GetBytes(NewHiWord)
  18.  
  19.        ValueBytes(2) = HiWordBytes(0)
  20.        ValueBytes(3) = HiWordBytes(1)
  21.  
  22.        Return BitConverter.ToInt32(ValueBytes, 0)
  23.  
  24.    End Function

Código
  1.    ' Set LoDword (From a Signed Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetLoDword(328576329396160L, -1553649828I)) ' Result: 328576329396060L
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the low-order double word of an 'Int64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <param name="NewLoDword">Indicates the new LoDword, an 'Int32' value.</param>
  12.    ''' <returns>The 'Int64' value containing both the HiDword and the new LoDword.</returns>
  13.    Private Function SetLoDword(ByVal Value As Long,
  14.                                ByVal NewLoDword As Integer) As Long
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        Dim LoDwordBytes As Byte() = BitConverter.GetBytes(NewLoDword)
  18.  
  19.        ValueBytes(0) = LoDwordBytes(0)
  20.        ValueBytes(1) = LoDwordBytes(1)
  21.        ValueBytes(2) = LoDwordBytes(2)
  22.        ValueBytes(3) = LoDwordBytes(3)
  23.  
  24.        Return BitConverter.ToInt64(ValueBytes, 0)
  25.  
  26.    End Function

Código
  1.    ' Set HiDword (From a Signed Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetHiDword(328576329396160L, 987654321I)) ' Result: 4241943011189403584L
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the high-order double word of an 'Int64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <param name="NewHiDword">Indicates the new HiDword, an 'Int32' value.</param>
  12.    ''' <returns>The 'Int64' value containing both the LoDword and the new HiDword.</returns>
  13.    Private Function SetHiDword(ByVal Value As Long,
  14.                                ByVal NewHiDword As Integer) As Long
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        Dim HiDwordBytes As Byte() = BitConverter.GetBytes(NewHiDword)
  18.  
  19.        ValueBytes(4) = HiDwordBytes(0)
  20.        ValueBytes(5) = HiDwordBytes(1)
  21.        ValueBytes(6) = HiDwordBytes(2)
  22.        ValueBytes(7) = HiDwordBytes(3)
  23.  
  24.        Return BitConverter.ToInt64(ValueBytes, 0)
  25.  
  26.    End Function

Código
  1.    ' Set LoDword (From an Unsigned Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetLoDword(328576329396160L, 123456789UI)) ' Result: 328573711535381L
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the low-order double word of an 'Int64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <param name="NewLoDword">Indicates the new LoDword, an 'UInt32' value.</param>
  12.    ''' <returns>The 'Int64' value containing both the HiDword and the new LoDword.</returns>
  13.    Private Function SetLoDword(ByVal Value As Long,
  14.                                ByVal NewLoDword As UInteger) As Long
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        Dim LoDwordBytes As Byte() = BitConverter.GetBytes(NewLoDword)
  18.  
  19.        ValueBytes(0) = LoDwordBytes(0)
  20.        ValueBytes(1) = LoDwordBytes(1)
  21.        ValueBytes(2) = LoDwordBytes(2)
  22.        ValueBytes(3) = LoDwordBytes(3)
  23.  
  24.        Return BitConverter.ToInt64(ValueBytes, 0)
  25.  
  26.    End Function

Código
  1.    ' Set HiDword (From an Unsigned Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(SetHiDword(328576329396160L, 987654321UI)) ' Result: 4241943011189403584L
  6.    '
  7.    ''' <summary>
  8.    ''' Sets the high-order double word of an 'Int64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <param name="NewHiDword">Indicates the new HiDword, an 'UInt32' value.</param>
  12.    ''' <returns>The 'Int64' value containing both the LoDword and the new HiDword.</returns>
  13.    Private Function SetHiDword(ByVal Value As Long,
  14.                                ByVal NewHiDword As UInteger) As Long
  15.  
  16.        Dim ValueBytes As Byte() = BitConverter.GetBytes(Value)
  17.        Dim HiDwordBytes As Byte() = BitConverter.GetBytes(NewHiDword)
  18.  
  19.        ValueBytes(4) = HiDwordBytes(0)
  20.        ValueBytes(5) = HiDwordBytes(1)
  21.        ValueBytes(6) = HiDwordBytes(2)
  22.        ValueBytes(7) = HiDwordBytes(3)
  23.  
  24.        Return BitConverter.ToInt64(ValueBytes, 0)
  25.  
  26.    End Function
7328  Programación / Scripting / Re: Suma de variables dentro de bucle for en .bat en: 9 Marzo 2014, 16:50 pm
· How can I stop Windows/WMP from messing with my MP3 metadata?

Citar
7329  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Compartan aquí sus snippets) en: 9 Marzo 2014, 16:27 pm
Unos snippets para imitar las macros "LoByte", "LoWord", "LoDword", etc, usando la Class BitConverter, la cual, aunque necesita hacer más trabajo, me parece una solución mucho mas elegante que las que se pueden encontrar por ahí, e igual de efectiva.


Código
  1.    ' Get LoByte
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetLoByte(1587S)) ' Result: 51
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the low-order byte of an 'Int16' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int16' value that contains both the LoByte and the HiByte.</param>
  11.    ''' <returns>The return value is the low-order byte.</returns>
  12.    Public Shared Function GetLoByte(ByVal value As Short) As Byte
  13.  
  14.        Return BitConverter.GetBytes(value).First
  15.  
  16.    End Function

Código
  1.    ' Get HiByte
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetHiByte(1587S)) ' Result: 6
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the high-order byte of an 'Int16' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int16' value that contains both the LoByte and the HiByte.</param>
  11.    ''' <returns>The return value is the high-order byte.</returns>
  12.    Public Shared Function GetHiByte(ByVal value As Short) As Byte
  13.  
  14.        Return BitConverter.GetBytes(value).Last
  15.  
  16.    End Function

Código
  1.    ' Get LoWord
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetLoWord(13959358I)) ' Result: 190S
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the low-order word of an 'Int32' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int32' value that contains both the LoWord and the HiWord.</param>
  11.    ''' <returns>The return value is the low-order word.</returns>
  12.    Public Shared Function GetLoWord(ByVal value As Integer) As Short
  13.  
  14.        Return BitConverter.ToInt16(BitConverter.GetBytes(value), 0)
  15.  
  16.    End Function

Código
  1.    ' Get HiWord
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetHiWord(13959358I)) ' Result: 213S
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the high-order word of an 'Int32' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int32' value that contains both the LoWord and the HiWord.</param>
  11.    ''' <returns>The return value is the high-order word.</returns>
  12.    Public Shared Function GetHiWord(ByVal value As Integer) As Short
  13.  
  14.        Return BitConverter.ToInt16(BitConverter.GetBytes(value), 2)
  15.  
  16.    End Function

Código
  1.    ' Get LoDword (As Unsigned Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetLoDword(328576329396160UL)) ' Result: 2741317568UI
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the low-order double word of an 'UInt64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'UInt64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <returns>The return value is the low-order double word.</returns>
  12.    Public Shared Function GetLoDword(ByVal value As ULong) As UInteger
  13.  
  14.        Return BitConverter.ToUInt32(BitConverter.GetBytes(value), 0)
  15.  
  16.    End Function

Código
  1.    ' Get HiDword (As Unsigned Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetHiDword(328576329396160UL)) ' Result: 76502UI
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the high-order double word of an 'UInt64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'UInt64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <returns>The return value is the high-order double word.</returns>
  12.    Public Shared Function GetHiDword(ByVal value As ULong) As UInteger
  13.  
  14.        Return BitConverter.ToUInt32(BitConverter.GetBytes(value), 4)
  15.  
  16.    End Function

Código
  1.    ' Get LoDword (As Signed Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetLoDword(328576329396160L)) ' Result: -1553649728I
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the low-order double word of an 'Int64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <returns>The return value is the low-order double word.</returns>
  12.    Public Shared Function GetLoDword(ByVal value As Long) As Integer
  13.  
  14.        Return BitConverter.ToInt32(BitConverter.GetBytes(value), 0)
  15.  
  16.    End Function

Código
  1.    ' Get HiDword (As Signed Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetHiDword(328576329396160L)) ' Result: 76502I
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the high-order double word of an 'Int64' value.
  9.    ''' </summary>
  10.    ''' <param name="Value">Indicates the 'Int64' value that contains both the LoDword and the HiDword.</param>
  11.    ''' <returns>The return value is the high-order double word.</returns>
  12.    Public Shared Function GetHiDword(ByVal value As Long) As Integer
  13.  
  14.        Return BitConverter.ToInt32(BitConverter.GetBytes(value), 4)
  15.  
  16.    End Function

Código
  1.    ' Make Word
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(MakeWord(51S, 6S)) ' Result: 1587S
  6.    '
  7.    ''' <summary>
  8.    ''' Makes an 'Int16' value from two bytes.
  9.    ''' </summary>
  10.    ''' <param name="LoByte">Indicates the low-order byte.</param>
  11.    ''' <param name="HiByte">Indicates the high-order byte.</param>
  12.    ''' <returns>The 'Int16' value.</returns>
  13.    Public Shared Function MakeWord(ByVal LoByte As Byte,
  14.                                    ByVal HiByte As Byte) As Short
  15.  
  16.        Return BitConverter.ToInt16(New Byte() {LoByte, HiByte}, 0)
  17.  
  18.    End Function

Código
  1.    ' Make Dword
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(MakedWord(190S, 213S)) ' Result: 13959358I
  6.    '
  7.    ''' <summary>
  8.    ''' Makes an 'Int32' value from two 'Int16' values.
  9.    ''' </summary>
  10.    ''' <param name="LoWord">Indicates the low-order word.</param>
  11.    ''' <param name="HiWord">Indicates the high-order word.</param>
  12.    ''' <returns>The 'Int32' value.</returns>
  13.    Public Shared Function MakeDword(ByVal LoWord As Short,
  14.                                     ByVal HiWord As Short) As Integer
  15.  
  16.        Dim LoBytes As Byte() = BitConverter.GetBytes(LoWord)
  17.        Dim HiBytes As Byte() = BitConverter.GetBytes(HiWord)
  18.        Dim Combined As Byte() = LoBytes.Concat(HiBytes).ToArray
  19.  
  20.        Return BitConverter.ToInt32(Combined, 0)
  21.  
  22.    End Function

Código
  1.    ' Make Long (From An Unsigned Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(MakeLong(2741317568UI, 76502UI)) ' Result: 328576329396160UL
  6.    '
  7.    ''' <summary>
  8.    ''' Makes an 'UInt64' value from two 'UInt32' values.
  9.    ''' </summary>
  10.    ''' <param name="LoDword">Indicates the low-order Dword.</param>
  11.    ''' <param name="HiDword">Indicates the high-order Dword.</param>
  12.    ''' <returns>The 'UInt64' value.</returns>
  13.    Public Shared Function MakeLong(ByVal LoDword As UInteger,
  14.                                    ByVal HiDword As UInteger) As ULong
  15.  
  16.        Dim LoBytes As Byte() = BitConverter.GetBytes(LoDword)
  17.        Dim HiBytes As Byte() = BitConverter.GetBytes(HiDword)
  18.        Dim Combined As Byte() = LoBytes.Concat(HiBytes).ToArray
  19.  
  20.        Return BitConverter.ToUInt64(Combined, 0)
  21.  
  22.    End Function

Código
  1.    ' Make Long (From a Signed Integer)
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(MakeLong(-1553649728I, 76502I)) ' Result: 328576329396160L
  6.    '
  7.    ''' <summary>
  8.    ''' Makes an 'Int64' value from two 'Int32' values.
  9.    ''' </summary>
  10.    ''' <param name="LoDword">Indicates the low-order Dword.</param>
  11.    ''' <param name="HiDword">Indicates the high-order Dword.</param>
  12.    ''' <returns>The 'Int64' value.</returns>
  13.    Public Shared Function MakeLong(ByVal LoDword As Integer,
  14.                                    ByVal HiDword As Integer) As Long
  15.  
  16.        Dim LoBytes As Byte() = BitConverter.GetBytes(LoDword)
  17.        Dim HiBytes As Byte() = BitConverter.GetBytes(HiDword)
  18.        Dim Combined As Byte() = LoBytes.Concat(HiBytes).ToArray
  19.  
  20.        Return BitConverter.ToInt64(Combined, 0)
  21.  
  22.    End Function
7330  Programación / Scripting / Re: Suma de variables dentro de bucle for en .bat en: 9 Marzo 2014, 04:09 am
Hombre, los metadatos no cambian por si solos, y algo leí hace mucho tiempo sobre que Windows Media Player modifica los metadatos de los audios sin previo aviso ...cuando este considera necesario actualizarlos (otra de las grandes ideas desagradables por parte de Microsoft).

¿ Probaste con otro reproductor, por ejemplo ...Winamp ?

Las dos lineas de código que muestras hacen exáctamente lo mismo, y me apostaría todo lo que tengo a que el problema es este (solo es una suposición):

En la primera linea, osea en el For, le das como título a las canciones un número seguido de un punto y más números "5.XX",
los (pesados) algoritmos de Windows Media Player segúramente escanearán el título de la canción y determinarán que ese tipo de título (número seguido de un punto) se trata de un título sin formatear, a continuación, se enciende una bombillita que dice: "he, vamos a cambiarle el título a esto sin avisarle al usuario, seguro que nos lo agradecerá :D!"

En cambio, esto no te sucede en la segunda linea que muestras porque el título de la canción que le estás asignando al archivo ("hola") es normal, WMP lo considera un título formateado corréctamente, y entonces no hay motivo para que WMP quiera actualizar los tags.

Como no estoy muy seguro de si ese será el problema, puedes hacer la prueba asignando manualmente ese tipo de título a una canción, y abrirla en el WMP para salir de dudas:
Código:
id3 -1 -2 -t "5.1" "36_PISTA.mp3"

En resumen, y suponiendo que ese sea el problema: O le asignas títulos normales a las canciones (que no empiecen por un número seguido de un punto), o desactivas la maravillosa opción de actualizar los metadatos en el WMP.

Saludos
Páginas: 1 ... 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 [733] 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines