Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - Eleкtro

#1661
¿Alguien conoce un tema oscuro parecido al FT DeepDark que sirva para Firefox v57+ ? (dev. edition)

#1662
Windows / Re: Problema con el cmd
13 Octubre 2017, 12:45 PM
Cita de: wicd en  6 Octubre 2017, 01:14 AMque es lo que puede causar la corrupcion del path de los comandos externos del cmd?

Que por algún motivo desconocido ( de forma involuntaria por parte de un usuario, o por parte de un software cualquiera, o de un software de "limpieza del registro" ) se hayan eliminado las entradas del PATH que hacian referencia a las rutas de directorio de esos executables. Pero siempre puedes volver a añadir esas rutas desde el editor de registro de Windows (regedit.exe)...

O también puedes utilizar mi aplicación command-line gratuita para administrar las entradas de la variable de entorno PATH, o para restaurarla a su estado de fábrica por defecto de Windows.

Si prefieres usar una interfáz gráfica entonces te recomiendo la aplicación Rapid Environment Editor:

Saludos
#1663
Cita de: TickTack en 13 Octubre 2017, 11:16 AM1. me gustaria saber como es que estas siempre informado de que esto produce fugas de consume RAM y lo otro envia mensajes de ventana para
redibujarse y que este otro produce esto? Es increible tu conocimiento!!

Te agradezco el reconocimiento pero en realidad en mi opinión no son cosas avanzadas que se merezcan " "admiración" " hacia alguien, o al menos yo creo que deberían ser cosas básicas que se deben aprender estudiando el lenguaje, documentándose sobre como se administran los recursos, o como trabaja el sistema de mensajería, GDI/GDI+, WinForms, etc...

Siempre he sostenido que no hay mejor manera de aprender .NET que leyendo la MSDN (aunque sea un coñazo), por que en los libros suelen explicar los conceptos más "internos" de forma superficial, y luego pasa lo que pasa, que uno aprende a manejar C#/VB.NET pero eso no es suficiente ya que no aprende como funciona el sistema operativo (Windows) ni la tecnología que esté usando (WinForms, WPF, etc).

Te dejo unos enlaces de interés:

Administración de recursos:

Mensajería

Painting

ListBox
Con respecto a lo que te expliqué de usar el método AddRange, en ese último enlace está documentado también:
Cita de: MSDNRemarks
The preferred way to add multiple items to the ListBox is to use the AddRange method of the ListBox.ObjectCollection class (through the Items property of the ListBox). This enables you to add an array of items to the list in a single operation. However, if you want to add items one at a time using the Add method of the ListBox.ObjectCollection class, you can use the BeginUpdate method to prevent the control from repainting the ListBox each time an item is added to the list. Once you have completed the task of adding items to the list, call the EndUpdate method to enable the ListBox to repaint. This way of adding items can prevent flickered drawing of the ListBox when a large number of items are being added to the list.

En fin, si llegas a leer todos los enlaces que voy poniendo a la MSDN y docs.microsoft.com (no me refiero solo a los que he compartido ahora, sino en general), aprenderías mucho sobre .NET a "nivel gurú" o casi xD. :P


Analizar el código fuente de .NET Framework también ayuda mucho a comprender como funciona a nivel "interno":




Cita de: TickTack en 13 Octubre 2017, 11:16 AM
2. tu codigo que mostraste se complica con mi proyecto
porque para empezar me da problemas con public souled class. Me dice que no se puede dejarlo
asi porque hay otra clase que ya esta asi. Ni idea?

Cita de: Eleкtro en 12 Octubre 2017, 13:50 PM
En general todo el código que tienes ahora mismo lo puedes mejorar y simplificar / refactorizar a algo parecido a esto:

Código (csharp,2) [Seleccionar]
public sealed class Form1 : Form {
   // código relevante aquí ...
}

Lo de "public sealed class Form1 : Form" es así por que yo escribí el código en un nuevo proyecto, pero te dije que lo tienes que adaptar, no tienes que copiar los modificadores (sealed) ni tampoco el nombre de la clase (Form1), sino el resto del código (código relevante) que está definido dentro de esa clase.

En tu código imagino que lo tendrás escrito así:
Código (csharp) [Seleccionar]
public partial class Form1
...no necesitas cambiarlo.




Cita de: TickTack en 13 Octubre 2017, 11:16 AM
5. Pero entonces cual me dices que es mas recomendable usar? Tu codigo 1 o tu codigo 2
(posteaste dos codigos tuyos aca).

Porque si me dices codigo 1 entonces vere que puedo hacer
con el problema de public souled class y lo demas. Pero si me dices codigo 2 entonces
podre pegar el codigo en una nueva clase de VB.NET para compilarlo en una dll y
posteriormente usarlo en C#. Finalmente si me dices que investigue los dos codigos lo hare
(por supuesto, solamente si me lo recomiendas).

Son códigos para cosas distintas.

El primer código que puse en C# es una refactorización del primer código que tu compartiste, es un fix por así decirlo que corrige varios malos hábitos de programación en .NET ( los que te estuve explicando y enumerando 1., 2., 3. etc... ) y que en teoría debería servirte para corregir el problema de no poder reproducir la siguiente canción (solo en teoría, ya que como dije no probé lo del WMP).
La idea era que reemplazases (todo) tú código por el que yo te mostré y decir si con esos cambios arreglaste por fin el problema. Pero sin lo de "public sealed class Form1 : Form", eso déjalo como lo tengas escrito en tu clase Form1.

El segundo código en VB.NET es una implementación para administrar listas de reproducción en formato m38 o pls, eso lo puedes usar si quieres o no usarlo xD, puedes hacer basicamente lo mismo con la interfáz COM que te dije de WMP (IWMPPlaylist). Ese código te lo puse por que tú dijiste que "querías ir por ese camino" y pues... con ese código te estaba dando "el camino hecho".

saludos
#1664
Cita de: FJDA en 12 Octubre 2017, 22:44 PM
resulta que éstas carpetas son idénticas en comportamiento a las de 'system information'

La única manera de acceder a éstas carpetas es desde fuera del sistema. Ni en modo seguro se puede. O bien desde Linux, un disco de arranque o algo así.

Para poder acceder al directorio "C:\System Volume Information" y/o cualquier directorio cuyo propietario sea "SYSTEM" y donde el usuario no tenga permisos, simplemente debes tomar posesión y conceder los permisos necesarios al usuario actual. No es necesario "salirse del sistema operativo" y usar una distro de Linux, lo único que hace falta es ser un usuario con permisos de Administrador:



Para que veas lo sencillo que resulta acceder, con las herramientas command-line de Windows se haría de la siguiente manera:
Código (dos) [Seleccionar]
@Echo OFF

Set "dirpath=C:\System Volume Information"

"Takeown.exe" /F "%dirpath%" /R /D S
"Icacls.exe" "%dirpath%" /Grant "%USERNAME%":"F" /T


Y en VB.NET para concederle permisos de control total al usuario actual (suponiendo que este sea Administrador) lo harías de la siguiente manera:

Código (vbnet) [Seleccionar]
Dim user As IdentityReference = WindowsIdentity.GetCurrent(TokenAccessLevels.AllAccess).User
Dim acl As New FileSystemAccessRule(user, FileSystemRights.FullControl, AccessControlType.Allow)

Dim dirpath As String = "C:\System Volume Information"
Dim ds As DirectorySecurity = Directory.GetAccessControl(dirpath)
ds.ResetAccessRule(acl)
' Si deseas modificar el propietario...
' ds.SetOwner(user)
'
' Si deseas modificar el grupo...
' Dim group As New SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, Nothing)
' ds.SetGroup(group)
Directory.SetAccessControl(dirpath, ds)


Nota: es probable que para modificar el propietario por motivos de seguridad primero debas habilitar el privilegio de proceso SE_TAKE_OWNERSHIP_NAME:
( en realidad se requiere mucho más p/invoking, como implementar la estructura LUID_AND_ATTRIBUTES, llamar a la la función OpenProcessToken, LookupPrivilegeValue, etc, pero no quiero colapsarte con más enlaces a la API de Windows. )




Cita de: FJDA en 12 Octubre 2017, 22:44 PMHe conseguido crear carpetas que deniegan el acceso con net y consola pero son fáciles de volver a hacerlas accesibles con simples comandos de consola.

Bueno, arriba ya te he demostrado que siendo usuario Administrador es posible tener acceso a cualquier archivo y directorio del sistema de archivos, por lo tanto creo que lo que intentas hacer no tiene mucho sentido en realidad. No puedes pretender crear un directorio que realmente sea inaccesible para un usuario Administrador (siempre que éste tengo un mínimo de conocimiento para saber como acceder).

saludos
#1665
Cita de: **Aincrad** en 12 Octubre 2017, 20:22 PMSi Tengo un formulario sin bordes y le quiero poner un picture box como border.

No, esa no es la manera indicada de intentar simular un borde. De forma natural un control no puede sobresalir (visiblemente hablando) fuera de los límites (bounds) del contenedor padre de dicho control, es decir, el Form.

Sencillamente puedes recurrir a GDI+ para dibujar un borde alrededor de la ventana del Form. Luego puedes capturar cuando el usuario presiona click para responder al mensaje de ventana WM_NCHITTEST en el que puedes "falsificar" el identificador de la parte de la ventana que corresponde a las coordenadas donde se hizo click, y así simular que se presionó click izquierdo sobre una borde barra de título (titlebar) para iniciar la operación de arrastrar/mover la ventana del Form...

EDITO: O bien si lo prefieres puedes hacer eso mismo siguiendo la misma metodología que he descrito arriba pero para que en vez de mover la ventana lo que haga sea iniciar una operación de redimensionar (resize) el Form al presionar click sobre uno de los "bordes", aunque ello requeriría algo más de trabajo de implementación que lo que escribí en este código de aquí abajo.

...¿Y cómo se hace todo eso?, pues así:

Código (vbnet) [Seleccionar]
Public NotInheritable Class Form1 : Inherits Form

   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       Me.FormBorderStyle = FormBorderStyle.None
   End Sub

   Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
       ' Asegúrate de escribir un valor de longitud que sea número par, para que encaje correctamente en los offsets.
       Using pen As New Pen(Color.LimeGreen, SystemInformation.FrameBorderSize.Width)
           e.Graphics.DrawRectangle(pen, Me.DisplayRectangle)
       End Using
   End Sub

   Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown
       If (e.Button = MouseButtons.Left) Then
           NativeMethods.ReleaseCapture()
           NativeMethods.SendMessage(Me.Handle, NativeMethods.WindowsMessages.WM_NCLBUTTONDOWN,
                                     New IntPtr(NativeMethods.NcHitTestFlags.HT_CAPTION), IntPtr.Zero)
       End If
   End Sub

End Class


Código (vbnet) [Seleccionar]
Friend NotInheritable Class NativeMethods

   Private Sub New()
   End Sub

   ' https://msdn.microsoft.com/en-us/library/windows/desktop/ff381405(v=vs.85).aspx
   Friend Enum WindowsMessages As Integer
       WM_NCLBUTTONDOWN = &HA1
   End Enum

   ' https://msdn.microsoft.com/en-us/library/windows/desktop/ms645618(v=vs.85).aspx
   Friend Enum NcHitTestFlags As Integer
       HT_CAPTION = &H2
   End Enum

   ' https://msdn.microsoft.com/en-us/library/windows/desktop/ms646261(v=vs.85).aspx
   <DllImport("user32.dll")>
   Friend Shared Function ReleaseCapture() As Boolean
   End Function

   ' https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx
   <DllImport("user32.dll", EntryPoint:="SendMessage", SetLastError:=True)>
   Friend Shared Function SendMessage(
             <MarshalAs(UnmanagedType.SysInt)> ByVal hwnd As IntPtr,
                 <MarshalAs(UnmanagedType.U4)> ByVal msg As WindowsMessages,
             <MarshalAs(UnmanagedType.SysInt)> ByVal wParam As IntPtr,
             <MarshalAs(UnmanagedType.SysInt)> ByVal lParam As IntPtr
   ) As Integer
   End Function

End Class





Citarque código le pongo al picturebox para que haga la funcion de borde. ?

La próxima vez no pidas tanto código así como si esto fuese un servicio gratis de entrega de códigos a domicilio con una base de datos de códigos en oferta para cualquier ocasión especial del año...

En general pedir "códigos" está muy mal visto internacionálmente en el mundillo de la programación..

Trata de buscar un poco antes de preguntar, que son cosas sencillas las que pides y podrías investigar por Google o donde sea y acabar hallando una solución. No te lo van a dar todo siempre hecho.


PD: Lo siento pero tenía que decirlo.

Saludos
#1666
Cita de: TickTack en 12 Octubre 2017, 18:31 PM
6. Ya lo probe antes de hacer este post.

7. Ok. Quiero ir por ese camino...

De acuerdo, entonces por si te sirve de algo te muestro un algoritmo que desarrollé hace un par de años para construir listas de reproducción en formato M3U y PLS de forma sencilla. El código es un poco feo, lo escribí hace varios años, se puede refactorizar para perfeccionarlo de muchas formas para representarlo de forma más abstracta y llevar a cabo todas las modificaciones en la memoria sin realizar operaciones de lectura/escritura en el archivo, pero bueno, así lo escribí en su día cuando todavía no dominaba muchas cosas en la progamación .NET, y el caso es que funciona, que es lo importante...

NOTA INFORMATIVA:
--- EL SIGUIENTE CÓDIGO HA SIDO EXTRAIDO Y OFRECIDO DE FORMA GRATUITA A PARTIR DE MI FRAMEWORK COMERCIAL
ELEKTROKIT FRAMEWORK , EL CUAL CONTIENE UNA INFINIDAD DE UTILIDADES ENFOCADAS A UNA AMPLIA VARIEDAD DE TEMÁTICAS Y ESCENARIOS EN LA PROGRAMACIÓN .NET, COMO ÉSTE. SI QUIEREN CONOCER MÁS ACERCA DEL PRODUCTO, MIREN MI FIRMA DE USUARIO EN EL FORO. ---
---
ESTE CÓDIGO SE PUEDE USAR DE FORMA LIBRE COMO DESEEN.


Nota: Debido a que el foro tiene un límite muy reducido de caracteres, me he visto obligado a eliminar gran parte de la documentación XML ( descripciones de parámetros, etc).

Código (vbnet) [Seleccionar]
#Region " Playlist Type "

Namespace ElektroKit.Core.Multimedia.Enums

   ''' <summary>
   ''' Specifies the type of a multimedia playlist.
   ''' </summary>
   Public Enum PlaylistType As Integer

       ''' <summary>
       ''' M3U Playlist.
       ''' <para></para>
       ''' <see href="http://en.wikipedia.org/wiki/M3U"/>
       ''' </summary>
       M3U = 0I

       ''' <summary>
       ''' PLS Playlist.
       ''' <para></para>
       ''' <see href="http://en.wikipedia.org/wiki/PLS_%28file_format%29"/>
       ''' </summary>
       PLS = 1I

   End Enum

End Namespace

#End Region


Código (vbnet) [Seleccionar]
#Region " Playlist TrackInfo "

Namespace ElektroKit.Core.Multimedia.Types

   ''' <summary>
   ''' Represents a track of a multimedia playlist.
   ''' </summary>
   Public Structure PlaylistTrackInfo

#Region " Properties "

       ''' <summary>
       ''' Gets the track index.
       ''' <para></para>
       ''' This value is automatically set by some of the <see cref="PlaylistEditor"/> class members,
       ''' and has none effect if you change it manually.
       ''' </summary>
       Public Property Index As Integer

       ''' <summary>
       ''' Gets or sets the file path.
       ''' </summary>
       Public Property Path As String

       ''' <summary>
       ''' Gets or sets the track title.
       ''' </summary>
       Public Property Title As String

       ''' <summary>
       ''' Gets or sets the track length.
       ''' </summary>
       Public Property Length As TimeSpan

#End Region

   End Structure

End Namespace

#End Region


Código (vbnet) [Seleccionar]
#Region " Imports "

Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Text

Imports ElektroKit.Core.Multimedia.Enums

#End Region

#Region " Playlist Editor "

Namespace ElektroKit.Core.Multimedia.Types

   ''' <summary>
   ''' Contains methods to create and or manage the tracks defined in a multimedia playlist file.
   ''' </summary>
   Public NotInheritable Class PlaylistEditor

#Region " Properties "

       ''' <summary>
       ''' Gets the playlist filepath.
       ''' </summary>
       Public ReadOnly Property FilePath As String
           <DebuggerStepThrough>
           Get
               Return Me.filepathB
           End Get
       End Property
       ''' ----------------------------------------------------------------------------------------------------
       ''' <summary>
       ''' ( Backing field )
       ''' The playlist filepath.
       ''' </summary>
       ''' ----------------------------------------------------------------------------------------------------
       Private ReadOnly filepathB As String

       ''' <summary>
       ''' Gets the playlist type.
       ''' </summary>
       Public ReadOnly Property PlaylistType As PlaylistType
           Get
               Return Me.playlistTypeB
           End Get
       End Property
       Private ReadOnly playlistTypeB As PlaylistType

       ''' <summary>
       ''' Gets the text encoding of the playlist file.
       ''' </summary>
       Public ReadOnly Property FileEncoding As Encoding
           Get
               Return Me.encodingB
           End Get
       End Property
       Private ReadOnly encodingB As Encoding

       ''' <summary>
       ''' Gets a value indicating whether the text will be appended at the bottom of the playlist file.
       ''' </summary>
       Public ReadOnly Property Append As Boolean
           <DebuggerStepThrough>
           Get
               Return Me.appendB
           End Get
       End Property
       Private ReadOnly appendB As Boolean

       ''' <summary>
       ''' Gets a collection that represents the tracks defined (if any) in the playlist.
       ''' </summary>
       Public ReadOnly Property Tracks As ReadOnlyCollection(Of PlaylistTrackInfo)
           <DebuggerStepThrough>
           Get
               Return New ReadOnlyCollection(Of PlaylistTrackInfo)(Me.GetTracks)
           End Get
       End Property

       ''' <summary>
       ''' Gets the amount of tracks defined in the playlist.
       ''' </summary>
       Public ReadOnly Property Count As Integer
           <DebuggerStepThrough>
           Get
               Return Me.GetTracks.Count
           End Get
       End Property

#End Region

#Region " Constructors "

       <DebuggerNonUserCode>
       Private Sub New()
       End Sub

       ''' <summary>
       ''' Initializes a new instance of the <see cref="PlaylistEditor"/> class.
       ''' </summary>
       '''
       ''' <param name="playlistFile">
       ''' The playlist file path.
       ''' </param>
       ''' <param name="playlistType">
       ''' The type of the playlist.
       ''' </param>
       ''' <param name="createNew">
       ''' If set to <see langword="True"/>,
       ''' the <see cref="PlaylistEditor"/> instance will assume that the playlist file already exist,
       ''' and it will append any new track entries to the bottom of the playlist file.
       ''' <para></para>
       ''' If set to <see langword="False"/>,
       ''' the <see cref="PlaylistEditor"/> instance will assume that the playlist file does not exist,
       ''' so then it will create a new playlist file.
       ''' </param>
       ''' <param name="fileEncoding">
       ''' Optionally indicates the file encoding to perform write and read operations to the playlist file.
       ''' <para></para>
       ''' Default value is: <see cref="Encoding.Default"/>
       ''' </param>
       <DebuggerStepThrough>
       Public Sub New(ByVal playlistFile As String,
                      ByVal playlistType As PlaylistType,
                      ByVal createNew As Boolean,
                      Optional ByVal fileEncoding As Encoding = Nothing)

           Me.filepathB = playlistFile
           Me.playlistTypeB = playlistType
           Me.encodingB = If(fileEncoding IsNot Nothing, fileEncoding, Encoding.Default)
           Me.appendB = Not createNew

           If Not (appendB) Then
               Me.AddHeaders()
           End If

       End Sub

#End Region

#Region " Public Methods "

       ''' <summary>
       ''' Adds a new track entry in the playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub Add(ByVal filepath As String,
                      Optional ByVal throwOnDuplicate As Boolean = False)

           If Not (throwOnDuplicate) AndAlso Me.Exist(filepath) Then
               Throw New ArgumentException("The specified file path already exists in the playlist.",
                                           paramName:="filepath")
           End If

           Dim sb As New StringBuilder

           Select Case Me.playlistTypeB

               Case PlaylistType.M3U
                   sb.AppendLine()
                   sb.AppendLine(filepath)
                   File.AppendAllText(Me.filepathB, sb.ToString(), Me.encodingB)

               Case PlaylistType.PLS
                   Dim tacksCount As Integer = Me.GetPlsTrackCount()
                   sb.AppendLine(File.ReadAllText(Me.filepathB, Me.encodingB).
                                   Replace("NumberOfEntries=" & CStr(tacksCount),
                                           "NumberOfEntries=" & CStr(tacksCount + 1)))

                   sb.AppendLine(String.Format("File{0}={1}", CStr(tacksCount + 1), filepath.Replace("\", "/")))
                   File.WriteAllText(Me.filepathB, sb.ToString(), Me.encodingB)

           End Select

           sb.Clear()
       End Sub

       ''' <summary>
       ''' Adds a new track in the playlist, with extended track information.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub Add(ByVal filepath As String, ByVal title As String, ByVal length As TimeSpan,
                      Optional ByVal throwOnDuplicate As Boolean = False)

           If Not (throwOnDuplicate) AndAlso Me.Exist(filepath) Then
               Throw New ArgumentException("The specified file path already exists in the playlist.",
                                           paramName:="filepath")
           End If

           Dim sb As New StringBuilder

           Select Case Me.playlistTypeB

               Case PlaylistType.M3U
                   sb.AppendLine()
                   sb.AppendLine(String.Format("#EXTINF:{0},{1}", CStr(Math.Truncate(length.TotalSeconds)), title))
                   sb.AppendLine(filepath)
                   File.AppendAllText(Me.filepathB, sb.ToString(), Me.encodingB)

               Case PlaylistType.PLS
                   Dim tacksCount As Integer = Me.GetPlsTrackCount()
                   sb.AppendLine(File.ReadAllText(Me.filepathB, Me.encodingB).
                                        Replace("NumberOfEntries=" & CStr(tacksCount),
                                                "NumberOfEntries=" & CStr(tacksCount + 1I)))

                   sb.AppendLine(String.Format("File{0}={1}", CStr(tacksCount + 1I), filepath.Replace("\", "/")))
                   sb.AppendLine(String.Format("Title{0}={1}", CStr(tacksCount + 1I), title))
                   sb.AppendLine(String.Format("Length{0}={1}", CStr(tacksCount + 1I), CStr(Math.Truncate(length.TotalSeconds))))
                   File.WriteAllText(Me.filepathB, sb.ToString(), Me.encodingB)

           End Select

           sb.Clear()
       End Sub

       ''' <summary>
       ''' Adds a new track in the playlist, with extended track information.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub Add(ByVal trackInfo As PlaylistTrackInfo,
                      Optional ByVal throwOnDuplicate As Boolean = False)

           Me.Add(trackInfo.Path, trackInfo.Title, trackInfo.Length, throwOnDuplicate)

       End Sub

       ''' <summary>
       ''' Removes the specified track from the playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub RemoveTrack(ByVal filepath As String)

           If Not Me.Exist(filepath) Then
               Throw New ArgumentException("The specified file path does not exists in the playlist.",
                                           paramName:="filepath")
           End If

           Dim playlistContent As List(Of String) = File.ReadLines(Me.filepathB, Me.encodingB).ToList()

           Select Case Me.playlistTypeB
               Case PlaylistType.M3U
                   Dim entryIndex As Integer =
                       playlistContent.FindIndex(
                       Function(item As String)
                           Return item.Equals(filepath, StringComparison.OrdinalIgnoreCase)
                       End Function)

                   playlistContent.RemoveAt(entryIndex)
                   If playlistContent(entryIndex - 1).StartsWith("#EXTINF", StringComparison.OrdinalIgnoreCase) Then
                       playlistContent.RemoveAt(entryIndex - 1)
                   End If
                   File.WriteAllLines(Me.filepathB, playlistContent, Me.encodingB)

               Case PlaylistType.PLS
                   Dim entryIndex As Integer =
                       playlistContent.FindIndex(
                       Function(item As String)
                           Return item.ToLower Like "file#*" & filepath.Replace("\", "/").ToLower
                       End Function)

                   Dim trackIndexDelimStartIndex As Integer =
                       playlistContent(entryIndex).IndexOf("e", StringComparison.OrdinalIgnoreCase) + 1I

                   Dim trackIndexDelimEndIndex As Integer =
                       playlistContent(entryIndex).IndexOf("=", StringComparison.OrdinalIgnoreCase)

                   Dim trackIndex As Integer =
                       CInt(playlistContent(entryIndex).Substring(trackIndexDelimStartIndex,
                                                             trackIndexDelimEndIndex - trackIndexDelimStartIndex))

                   playlistContent.RemoveAt(entryIndex)

                   Dim titleEntryIndex As Integer =
                       playlistContent.FindIndex(Function(item As String)
                                                     Return item.ToLower Like String.Format("title{0}=*", CStr(trackIndex))
                                                 End Function)

                   If titleEntryIndex <> -1 Then
                       playlistContent.RemoveAt(titleEntryIndex)
                   End If

                   Dim lengthEntryIndex As Integer =
                       playlistContent.FindIndex(Function(item As String)
                                                     Return item.ToLower Like String.Format("length{0}=*", CStr(trackIndex))
                                                 End Function)

                   If lengthEntryIndex <> -1I Then
                       playlistContent.RemoveAt(lengthEntryIndex)
                   End If

                   Dim numberOfEntriesEntryIndex As Integer =
                       playlistContent.FindIndex(Function(item As String)
                                                     Return item.ToLower Like "numberofentries=#*"
                                                 End Function)

                   playlistContent(numberOfEntriesEntryIndex) =
                       String.Format("NumberOfEntries={0}", CStr(Me.GetPlsTrackCount() - 1))

                   File.WriteAllLines(Me.filepathB, playlistContent, Me.encodingB)

                   Me.FixPlsTrackIndices()

           End Select
       End Sub

       ''' <summary>
       ''' Removes the specified track from the playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub RemoveTrack(ByVal trackIndex As Integer)
           Dim track As PlaylistTrackInfo = Me.GetTrackInfo(trackIndex)

           If track IsNot Nothing Then
               Me.RemoveTrack(track.Path)
           Else
               Throw New IndexOutOfRangeException("Track index is out of range") With {.Source = "trackIndex"}
           End If
       End Sub

       ''' <summary>
       ''' Sets the track info of the specified track.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub SetTrackInfo(ByVal filepath As String, ByVal trackInfo As PlaylistTrackInfo)

           If Not Me.Exist(filepath) Then
               Throw New ArgumentException("The specified file path does not exists in the playlist.",
                                           paramName:="filepath")
           End If

           Dim track As PlaylistTrackInfo = Me.GetTrackInfo(filepath)
           With track
               .Path = trackInfo.Path
               .Title = trackInfo.Title
               .Length = trackInfo.Length
           End With

           Dim playlistContent As List(Of String) = File.ReadLines(Me.filepathB, Me.encodingB).ToList()

           Select Case Me.playlistTypeB
               Case PlaylistType.M3U
                   Dim trackIndex As Integer =
                       playlistContent.FindIndex(
                       Function(item As String)
                           Return item.Equals(filepath, StringComparison.OrdinalIgnoreCase)
                       End Function)

                   playlistContent(trackIndex) = String.Format("#EXTINF:{0},{1}",
                                                               CStr(Math.Truncate(track.Length.TotalSeconds)),
                                                               track.Title) & Environment.NewLine & track.Path

                   If playlistContent(trackIndex - 1I).StartsWith("#EXTINF", StringComparison.OrdinalIgnoreCase) Then
                       playlistContent.RemoveAt(trackIndex - 1I)
                   End If

                   File.WriteAllLines(Me.filepathB, playlistContent, Me.encodingB)

               Case PlaylistType.PLS
                   track.Path = track.Path.Replace("\", "/")

                   Dim trackIndex As Integer =
                       playlistContent.FindIndex(
                       Function(item As String)
                           Return item.ToLower Like "file#*" & filepath.Replace("\", "/").ToLower
                       End Function)

                   playlistContent(trackIndex) = String.Format("File{0}={1}", CStr(track.Index), track.Path) & Environment.NewLine &
                                                 String.Format("Title{0}={1}", CStr(track.Index), track.Title) & Environment.NewLine &
                                                 String.Format("Length{0}={1}", CStr(track.Index), CStr(Math.Truncate(track.Length.TotalSeconds)))

                   If playlistContent.Count > (trackIndex + 1) Then
                       If playlistContent(trackIndex + 2).StartsWith("Title", StringComparison.OrdinalIgnoreCase) _
                       OrElse playlistContent(trackIndex + 2).StartsWith("Length", StringComparison.OrdinalIgnoreCase) Then
                           playlistContent.RemoveAt(trackIndex + 2)
                       End If
                   End If

                   If playlistContent.Count > trackIndex Then
                       If playlistContent(trackIndex + 1).StartsWith("Title", StringComparison.OrdinalIgnoreCase) _
                       OrElse playlistContent(trackIndex + 1).StartsWith("Length", StringComparison.OrdinalIgnoreCase) Then
                           playlistContent.RemoveAt(trackIndex + 1)
                       End If
                   End If

                   File.WriteAllLines(Me.filepathB, playlistContent, Me.encodingB)
           End Select

       End Sub

       ''' <summary>
       ''' Sets the track info of the specified track.
       ''' </summary>
       <DebuggerStepThrough>
       Public Sub SetTrackInfo(ByVal trackIndex As Integer, ByVal trackInfo As PlaylistTrackInfo)
           If Not Me.Exist(trackIndex) Then
               Throw New IndexOutOfRangeException("Track index is out of range.") With {.Source = "trackIndex"}
           End If

           Me.SetTrackInfo(Me.GetTrackInfo(trackIndex).Path, trackInfo)
       End Sub

       ''' <summary>
       ''' Finds the specified track in the playlist and returns a
       ''' <see cref="PlaylistTrackInfo"/> instance that represents the track.
       ''' </summary>
       <DebuggerStepThrough>
       Public Function GetTrackInfo(ByVal filepath As String) As PlaylistTrackInfo

           Dim playlistContent As List(Of String) = File.ReadLines(Me.filepathB, Me.encodingB).ToList()
           Dim tInfo As New PlaylistTrackInfo

           Select Case Me.playlistTypeB

               Case PlaylistType.M3U
                   Dim trackIndex As Integer = playlistContent.FindIndex(
                       Function(item As String)
                           Return item.Equals(filepath, StringComparison.OrdinalIgnoreCase)
                       End Function) - 1

                   If playlistContent(trackIndex).StartsWith("#EXTINF", StringComparison.OrdinalIgnoreCase) Then
                       Dim titleDelimIndex As Integer = playlistContent(trackIndex).IndexOf(","c) + 1
                       Dim lengthDelimIndex As Integer = playlistContent(trackIndex).IndexOf(":"c) + 1

                       With tInfo
                           .Index = trackIndex
                           .Path = filepath
                           .Title = playlistContent(trackIndex).Substring(titleDelimIndex)
                           .Length = TimeSpan.FromSeconds(CDbl(playlistContent(trackIndex).Substring(lengthDelimIndex, (titleDelimIndex - lengthDelimIndex))))
                       End With
                   End If

               Case PlaylistType.PLS
                   filepath = filepath.Replace("\", "/")

                   Dim entry As String = (From Item As String In playlistContent
                                          Where Item.ToLower Like String.Format("file#*={0}", filepath.ToLower())).SingleOrDefault

                   If Not String.IsNullOrEmpty(entry) Then

                       Dim indexDelimStartIndex As Integer =
                           entry.IndexOf("e", StringComparison.OrdinalIgnoreCase) + 1I

                       Dim indexDelimEndIndex As Integer =
                           entry.IndexOf("=", StringComparison.OrdinalIgnoreCase)

                       Dim trackIndex As Integer = CInt(entry.Substring(indexDelimStartIndex,
                                                                   indexDelimEndIndex - indexDelimStartIndex))

                       Dim titleEntry As String = (From Item As String In playlistContent
                                                   Where Item.StartsWith(String.Format("Title{0}=", CStr(trackIndex)), StringComparison.OrdinalIgnoreCase)).
                                                   FirstOrDefault

                       Dim lengthEntry As String = (From Item As String In playlistContent
                                                    Where Item.StartsWith(String.Format("Length{0}=", CStr(trackIndex)), StringComparison.OrdinalIgnoreCase)).
                                                    FirstOrDefault

                       With tInfo
                           .Index = trackIndex
                           .Path = filepath
                           .Title = If(Not String.IsNullOrEmpty(titleEntry),
                                       titleEntry.Substring(titleEntry.IndexOf("=") + 1),
                                       Nothing)
                           .Length = If(Not String.IsNullOrEmpty(titleEntry),
                                        TimeSpan.FromSeconds(CDbl(lengthEntry.Split("="c).LastOrDefault)),
                                        Nothing)
                       End With

                   End If

           End Select

           Return tInfo

       End Function

       ''' <summary>
       ''' Finds the specified track in the playlist and returns a
       ''' <see cref="PlaylistTrackInfo"/> instance that represents the track.
       ''' </summary>
       <DebuggerStepThrough>
       Public Function GetTrackInfo(ByVal trackIndex As Integer) As PlaylistTrackInfo

           Dim playlistContent As List(Of String) = File.ReadLines(Me.filepathB, Me.encodingB).ToList()

           Select Case Me.playlistTypeB

               Case PlaylistType.M3U
                   Dim trackCount As Integer = 0

                   For index As Integer = 0 To (playlistContent.Count - 1)
                       If Not String.IsNullOrEmpty(playlistContent(index)) _
                          AndAlso Not playlistContent(index).StartsWith("#EXT", StringComparison.OrdinalIgnoreCase) Then

                           trackCount += 1
                           If (trackCount = trackIndex) Then
                               Dim tInfo As PlaylistTrackInfo = Me.GetTrackInfo(playlistContent(index))
                               With tInfo
                                   .Index = trackIndex
                                   .Path = playlistContent(index)
                               End With
                               Return tInfo
                           End If

                       End If
                   Next index

               Case PlaylistType.PLS
                   For index As Integer = 0 To (playlistContent.Count - 1)
                       If playlistContent(index).StartsWith(String.Format("File{0}=", CStr(trackIndex)),
                                                            StringComparison.OrdinalIgnoreCase) Then
                           Return Me.GetTrackInfo(playlistContent(index).Substring(playlistContent(index).IndexOf("="c) + 1I))
                       End If
                   Next index

           End Select

           Return Nothing
       End Function

       ''' <summary>
       ''' Determines whether the specified track exists in the playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Public Function Exist(ByVal filepath As String) As Boolean
           Dim returnValue As Boolean = False

           Select Case Me.playlistTypeB
               Case PlaylistType.M3U
                   returnValue = (From Item As String In File.ReadLines(Me.filepathB, Me.encodingB)
                                  Where Item.StartsWith(filepath, StringComparison.OrdinalIgnoreCase)).
                                  Any()

               Case PlaylistType.PLS
                   returnValue = (From Item As String In File.ReadLines(Me.filepathB, Me.encodingB)
                                  Where Item.ToLower() Like "file#*" & filepath.Replace("\", "/").ToLower()).
                                  Any()
           End Select

           Return returnValue
       End Function

       ''' <summary>
       ''' Determines whether the specified track exists in the playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Public Function Exist(ByVal trackIndex As Integer) As Boolean
           If (trackIndex <= 0) Then
               Throw New IndexOutOfRangeException("TrackIndex should be greater than 0.") With {.Source = "trackIndex"}
           End If

           Return (Me.Count >= trackIndex)
       End Function

#End Region

#Region " Private Methods "

       ''' <summary>
       ''' Collects all the tracks defined in a playlist file and returns a <see cref="List(Of PlaylistTrackInfo)"/>.
       ''' </summary>
       <DebuggerStepThrough>
       Private Function GetTracks() As List(Of PlaylistTrackInfo)

           Dim playlistContent As List(Of String) = File.ReadLines(Me.filepathB, Me.encodingB).ToList()
           Dim tInfo As New List(Of PlaylistTrackInfo)
           Dim trackCount As Integer = 0

           Select Case Me.playlistTypeB

               Case PlaylistType.M3U
                   For index As Integer = 0 To (playlistContent.Count - 1)
                       If Not String.IsNullOrEmpty(playlistContent(index)) _
                          AndAlso Not playlistContent(index).StartsWith("#EXT", StringComparison.OrdinalIgnoreCase) Then
                           trackCount += 1
                           tInfo.Add(Me.GetTrackInfo(trackCount))
                       End If
                   Next

               Case PlaylistType.PLS
                   For index As Integer = 0 To (playlistContent.Count - 1)
                       If playlistContent(index).StartsWith("File", StringComparison.OrdinalIgnoreCase) Then
                           trackCount += 1
                           tInfo.Add(Me.GetTrackInfo(trackCount))
                       End If
                   Next index

           End Select

           Return tInfo
       End Function

       ''' <summary>
       ''' Adds the playlist headers at the top of the playlist file.
       ''' <para></para>
       ''' This method should always be called before adding the very first entry in a new (empty) playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Private Sub AddHeaders()
           Dim sb As New StringBuilder

           Select Case Me.playlistTypeB
               Case PlaylistType.M3U
                   sb.AppendLine("#EXTM3U")

               Case PlaylistType.PLS
                   With sb
                       .AppendLine("[playlist]")
                       .AppendLine("NumberOfEntries=0")
                       .AppendLine("Version=2")
                   End With
           End Select

           File.WriteAllText(Me.filepathB, sb.ToString(), Me.encodingB)
           sb.Clear()
       End Sub

       ''' <summary>
       ''' Gets the amount of total tracks defined in a PLS playlist file.
       ''' </summary>
       <DebuggerStepThrough>
       Private Function GetPlsTrackCount() As Integer
           Dim playlistContent As String = File.ReadAllText(Me.filepathB, Me.encodingB)

           Dim startIndex As Integer =
               playlistContent.IndexOf("=") + 1I

           Dim endIndex As Integer =
               playlistContent.IndexOf(ControlChars.NewLine, startIndex) - startIndex

           Return CInt(playlistContent.Substring(startIndex, playlistContent.IndexOf(String.Empty, endIndex)))
       End Function

       ''' <summary>
       ''' Fixes the track indices of a PLS playlist file.
       ''' <para></para>
       ''' This method shoould always be called after removing a track from the playlist.
       ''' </summary>
       <DebuggerStepThrough>
       Private Sub FixPlsTrackIndices()

           Dim playlistContent As List(Of String) = File.ReadLines(Me.filepathB, Me.encodingB).ToList()
           Dim trackCount As Integer = 0I

           For index As Integer = 0 To (playlistContent.Count - 1I)

               If playlistContent(index).StartsWith("File", StringComparison.OrdinalIgnoreCase) Then
                   trackCount += 1I
                   playlistContent(index) = String.Format("File{0}={1}",
                                                          CStr(trackCount),
                                                          playlistContent(index).Substring(playlistContent(index).IndexOf("="c) + 1I))

               ElseIf playlistContent(index).StartsWith("Title", StringComparison.OrdinalIgnoreCase) Then
                   playlistContent(index) = String.Format("Title{0}={1}",
                                                          CStr(trackCount),
                                                          playlistContent(index).Substring(playlistContent(index).IndexOf("="c) + 1I))

               ElseIf playlistContent(index).StartsWith("Length", StringComparison.OrdinalIgnoreCase) Then
                   playlistContent(index) = String.Format("Length{0}={1}",
                                                          CStr(trackCount),
                                                          playlistContent(index).Substring(playlistContent(index).IndexOf("="c) + 1I))

               End If
           Next index

           Dim numberOfEntriesEntryIndex As Integer =
               playlistContent.FindIndex(Function(item As String)
                                             Return item.ToLower Like "numberofentries=#*"
                                         End Function)

           playlistContent(numberOfEntriesEntryIndex) =
               String.Format("NumberOfEntries={0}", CStr(trackCount))

           File.WriteAllLines(Me.filepathB, playlistContent, Me.encodingB)
       End Sub

#End Region

   End Class

End Namespace

#End Region





El código de arriba puedes tomarlo como ejemplo y nada más para saber como sería una posible manera de poder hacerlo, o bien puedes copiar y pegarlo en una nueva clase de VB.NET para compilarlo en una dll y usarlo en C#, o también puedes convertir directamente el código a C# por ejemplo usando mi conversor de código gratuito ( todos los créditos y copyright para Telerik xD ):





Modo de empleo:
Código (csharp) [Seleccionar]
PlaylistEditor editor = new PlaylistEditor(@"C:\playlist.m3u", PlaylistType.M3U, createNew: true);
editor.Add("C:\\File 1.mp3");
editor.Add("C:\\File 2.mp3");


O bien:
Código (csharp) [Seleccionar]
PlaylistEditor editor = new PlaylistEditor(@"C:\playlist.m3u", PlaylistType.M3U, createNew: true);

PlaylistTrackInfo trackInfo = new PlaylistTrackInfo();
trackInfo.Path = "C:\\File.mp3";
trackInfo.Title = {Track Title or Display Name};
trackInfo.Length = {Track Duration};

editor.Add(trackInfo);


Saludos
#1667
Cita de: TickTack en 12 Octubre 2017, 18:31 PM1. No es lo mismo OpenFileDialog ofd = new OpenFileDialog(); que System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();?

Si, por supuesto, simplemente borré el nombre del namespace al citar tu código, y lo cité solamente para hacer referencia a la instrucción de tú código a la que me estaba refiriendo, pero a lo que me refería es a que debes utilizar la sentencia using para asegurarte de que el GC (Garbage Collector) libere cualquier recurso administrado y no administrado que haya sido utilizado por "X" instancia IDisposable... y así tener (o al menos intentarlo) una aplicación libre de las indeseadas fugas de consumo RAM.

Es decir:
Código (csharp) [Seleccionar]
using ( OpenFileDialog ofd = new OpenFileDialog() ) {
// ...
}


...o en su defecto puedes usar el método IDisposable.Dispose() ( OpenFileDialog.Dispose() ).




Cita de: TickTack en 12 Octubre 2017, 18:31 PM2. Es necesario que lo que haga de esta manera ya que necesito por un lado mostrar los nombres de las canciones en el listBox y por el otro lado guardar las rutas para reproducir esas canciones. Y aunque los nombres sean partes de las rutas... separarlos, segun yo, lleva mas tiempo que el codigo espagueti.

No, no es necesario ni tampoco lleva más tiempo en términos de esfuerzo. En mi última respuesta te mostré un código en el que utilizo una colección genérica de tipo SortedList para almacenar ambos datos... y cuyos elementos se mantienen ordenados por orden alfabético según el nombre de cada archivo agregado en o eliminado de la colección...

Como ves, es una mejora que simplifica tres funcionalidades del código original, en una sola.




Cita de: TickTack en 12 Octubre 2017, 18:31 PM3. Bueno eso tendre que cambiarlo. Gracias por la informacion. :)

Si sigues la solución que te indiqué (vease el código que compartí en mi última respuesta) entonces no necesitas usar el método Add / AddRange ya que en su lugar se utiliza la colección SortedList como datasource. Pero de todos modos la utilización del método AddRange es una mejora significativa que siempre deberías tener en cuenta cuando necesites agregar elementos manualmente a un control de tipo Lista (ListBox, ListView, DataGridView, etc).




Cita de: TickTack en 12 Octubre 2017, 18:31 PM4. Yo no veo ninguna instruccion de mas. Solamente le asigne una vez una valor a ListBox.Sorted.

Citar
Código (csharp,5) [Seleccionar]
           foreach (var file in ofd.SafeFileNames)
           {
               listBox1.Items.Add(file);
               list1.Add(file);
               listBox1.Sorted = true;
           }

Fíjate bien, le estás reasignando el valor en cada iteración del búcle foreach, es decir, 'listBox1.Sorted = true' por cada elemento en 'ofd.SafeFileNames'.
#1668
Cita de: **Aincrad** en 12 Octubre 2017, 19:40 PMcuando ejecuto el form, empieza a reproducir la música y no aparece el form hasta dentro de unos 4 seg y despues que aparece el form pa musica se detiene?.

como le hago?

El método SoundPlayer.PlaySync, como su propio nombre indica es sincrónico, es lo que se conoce como una llamada bloqueante. En otras palabras: es así por defecto, la cola de mensajes del thread de la UI se bloqueará hasta que se termine de reproducir la canción. Lo mismo te ocurriría si iterases un búcle infinito antes de cargar la UI... o despues, cuando sea.

¿Solución?, prueba a usar el método SoundPlayer.Play a secas (en teoría es asincrónico), o sino, puedes ejecutar la llamada al método SoundPlayer.PlaySync desde un nuevo thread.


Saludos
#1669
Cita de: **Aincrad** en 12 Octubre 2017, 16:09 PMse podría meter una música en la pestaña resources

Si, puedes añadir y embedir cualquier tipo de archivo a la tabla de recursos de tu executable.


Cita de: **Aincrad** en 12 Octubre 2017, 16:09 PMyo pienso que se debería incrustar como los txt en la parte de resources pero no se como poner el mp3

Pues exactamente de la misma manera, ¿cual es el problema que le encuentras?, simplemente seleccionas el archivo que quieres añadir como recurso, o directamente desde el explorador de Windows usas el ratón para arrastrar el archivo a la IDE (teniendo la pestaña de recursos abierta) y así se añade...

En otro post te mostré un enlace a MSDN donde te explican como añadir recursos...

Cita de: **Aincrad** en 12 Octubre 2017, 16:09 PMy después agregar el control de windows media player y el directorio poner esa musica?

Si, siempre y cuando primero extraigas los datos raw del recurso para generar un archivo local en el disco, y que así el host de WMP pueda reproducirlo, puesto que WMP solo acepta un nombre de archivo o una url. En otras palabras: no puedes usar WMP para reproducir un recurso de audio si no lo extraes al disco, lo cual no se si supone una complicación o no para las intenciones que tengas, de todas formas en otro post te mostré un código para extraer recursos y guardarlos en el disco...

Si lo que quieres es cargar diréctamente el stream del recurso de audio para reproducirlo, entonces puedes usar la clase System.Media.SoundPlayer (del set de librerías para la tecnología WPF) de la siguiente manera:

Código (vbnet) [Seleccionar]
Imports System.Media
Código (vbnet) [Seleccionar]
Using waveStream As UnmanagedMemoryStream = My.Resources.ResourceManager.GetStream("Nombre del recurso WAV"),
     player As New SoundPlayer(waveStream)

   player.PlaySync()
End Using


Nota: pero no reproduce archivos MP3, el archivo de recurso tiene que ser en formato WAV.
Nota 2: No te preocupes si programas bajo la tecnología Windows Forms, puedes usar los miembros de WPF igualmente.

Aquí tienes una guía:

Saludos
#1670
Cita de: ivancea96 en 12 Octubre 2017, 15:12 PM¿Por qué cambia la estatua y las imágenes de la estatua, pero no la mente? Por qué casualmente eso.

Buena pregunta... para la cual no hay respuesta. El ser humano no sabe de donde viene, no puede explicar la manifestación y la presencia de El Universo, no sabe exactamente que es, ni que hace ahí, ni que hacemos nosotros dentro de él. La Ciencia a nivel molecular no conoce el cerebro humano, es un rompecabezas indescifrable de energía, ni siquiera nos conocemos nosotros mismos lo suficiente a nivel físico de forma superficial, y ya ni te cuento a nivel filosófico-espiritual... ahí todo humano se encuentra perdido intentando reconocerse asimismo, así que siendo un ser humano con una capacidad de comprensión limitada me parece en vano pensar que toda esa gente, esas millones de personas y yo incluido estemos confundidos, delirando o incluso fingiendo, o pensar que por el contrario no lo estemos haciendo y resulte ser verdad que tengamos razón y la realidad haya cambiado (al menos para nosotros). Es en vano discutir, no se puede demostrar...o al menos por ahora.

El hecho de que haya escenas y diálogos en películas que han cambiado o dejado de existir, o esculturas que han cambiado, son hechos que dan lugar a dejar la puerta abierta para que pueda haber muchas más cosas que hayan cambiado y todavía no hemos descubierto, y que puedan ser cambios que afecten a la humanidad a un nivel global, como por ejemplo el resultado de una guerra mundial, o vete a saber el qué.

Para mi, personálmente hablando, la capacidad de haberme dado cuenta de algunos de esos cambios, es decir, de saber que han cambiado por que al verlo ahora son distinto de como sé que eran antes, eso es algo que me lo tomo como una especie de prueba la cual demuestra que la mente, el tiempo y lo que es real o deja de serlo no tienen una relación tan estrecha entre si, no están...unidos, por que la mente, el yo, y la realidad trabajan de forma extraña, desordenada, desincronizada tal vez, y parece que tiene más prioridad la mente (o el alma) que la propia realidad. No sé como expresarlo, solo puedo decir que algo así te hace reflexionar, te hace pensar en todo y darle vueltas a las "leyes" por las que se rige la mente para no verse afectada por los cambios al ritmo que cambia la realidad, y la mente se da cuenta de que ha cambiado. Es extraño vivir las consecuencias del Efecto Mandela por que uno debe asimilar que la realidad puede cambiar, pero tus recuerdos, aquello que has vivido, aprendido y memorizado a la perfección, eso no cambia, y en fin... intentar asimilar todo eso es bastante desconcertante.

Pero así como al parecer en ciertas circunstancias desconocidas la mente tiene el poder de ser "inmune" al Efecto Mandela, también es muy capaz de olvidar, de borrar recuerdos, y eso hace más complicada la reflexión sobre el Efecto Mandela y el poder y la fragilidad de la mente, como cualquier intento de comprender la realidad, nuestro cuerpo físico y mental y todo lo que le concierne...

No sé si esto se sale mucho del tema, pero os dejo por aquí un video para reflexionar sobre la inestabilidad que a veces tiene la mente para olvidar (cuando no debería olvidar) sucesos que te cambiaron la vida a mejor...

[youtube=640,360]https://www.youtube.com/watch?v=Moidw8sM2ZM[/youtube]

Saludos