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


Tema destacado: ¿Eres usuario del foro? Ahora tienes un Bot con IA que responde preguntas. Lo puedes activar en tu Perfil


  Mostrar Mensajes
Páginas: 1 ... 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 [821] 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 ... 1258
8201  Sistemas Operativos / Windows / Re: remove vat en: 15 Octubre 2013, 16:14 pm
de donde puedo bajar el remove sin arrastras un montón de programas mas y no tener que dar el teléfono.

@Disalito

¿En serio?,
te he puesto una imagen en grande y un enlace directo de descarga, ¿Que mas quieres que hagamos?.

Olvida los "remove wat" y vuelve a leer lo que cité, no necesitas ningún programa más que ese.

Saludos!
8202  Foros Generales / Dudas Generales / Re: [Ayuda] Pasar de un servidor de descargas a otro en: 15 Octubre 2013, 13:10 pm
Aparte de que segúramente en el 100% de los hostings el soporte de subidas remotas solo sea para premium, según tengo entendido algunos hostings desactivan las subidas remotas de "X" hosting, la razón no la sé.

Pero tienes esta alternativa:
   
1. Te descargas los archivos de forma automatizada con JDownloader/MiPony.

2. Subes los archivos de forma automatizada con z_o_o_m´s File & Image Uploader.
    -> http://z-o-o-m.eu/

Saludos
8203  Sistemas Operativos / Windows / Re: remove vat en: 15 Octubre 2013, 12:14 pm
-> By Elektro H@cker - Ediciones oficiales de Windows 7

Citar
Activador DAZ Loader v2.2.1



Descarga

Saludos
8204  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 15 Octubre 2013, 10:12 am
Las siguientes funciones pueden adaptarlas fácilmente para pasarle el handle de la ventana, yo preferí usar diréctamente el nombre del proceso en cuestión.





Mueve la ventana de un proceso

Código
  1. #Region " Move Process Window "
  2.  
  3.    ' [ Move Process Window ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' Move the notepad window at 10,50 (X,Y)
  10.    ' Move_Process_Window("notepad.exe", 10, 50)
  11.    '
  12.    ' Move the notepad window at 10 (X) and preserving the original (Y) process window position
  13.    ' Move_Process_Window("notepad.exe", 10, Nothing)
  14.  
  15.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  16.    Shared Function GetWindowRect(hWnd As IntPtr, ByRef rc As Rectangle) As Boolean
  17.    End Function
  18.  
  19.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  20.    Shared Function MoveWindow(hWnd As IntPtr, x As Integer, y As Integer, Width As Integer, Height As Integer, repaint As Boolean) As Boolean
  21.    End Function
  22.  
  23.    Private Sub Move_Process_Window(ByVal ProcessName As String, ByVal X As Integer, ByVal Y As Integer)
  24.  
  25.        ProcessName = If(ProcessName.ToLower.EndsWith(".exe"), _
  26.                         ProcessName.Substring(0, ProcessName.LastIndexOf(".")), _
  27.                         ProcessName)
  28.  
  29.        Dim rect As Rectangle = Nothing
  30.        Dim proc As Process = Nothing
  31.  
  32.        Try
  33.            ' Find the process
  34.            proc = Process.GetProcessesByName(ProcessName).First
  35.  
  36.            ' Store the process Main Window positions and sizes into the Rectangle.
  37.            GetWindowRect(proc.MainWindowHandle, rect)
  38.  
  39.            ' Move the Main Window
  40.            MoveWindow(proc.MainWindowHandle, _
  41.                       If(Not X = Nothing, X, rect.Left), _
  42.                       If(Not Y = Nothing, Y, rect.Top), _
  43.                       (rect.Width - rect.Left), _
  44.                       (rect.Height - rect.Top), _
  45.                       True)
  46.  
  47.        Catch ex As InvalidOperationException
  48.            'Throw New Exception("Process not found.")
  49.            MessageBox.Show("Process not found.", Nothing, MessageBoxButtons.OK, MessageBoxIcon.Error)
  50.  
  51.        Finally
  52.            rect = Nothing
  53.            If proc IsNot Nothing Then proc.Dispose()
  54.  
  55.        End Try
  56.  
  57.    End Sub
  58.  
  59. #End Region





Redimensiona la ventana de un proceso

Código
  1. #Region " Resize Process Window "
  2.  
  3.    ' [ Resize Process Window ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '        
  9.    ' Resize the notepad window at 500x250 (Width x Height)
  10.    ' Resize_Process_Window("notepad.exe", 500, 250)
  11.    '
  12.    ' Resize the notepad window at 500 (Width) and preserving the original (Height) process window size.
  13.    ' Resize_Process_Window("notepad.exe", 500, Nothing)
  14.  
  15.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  16.    Shared Function GetWindowRect(hWnd As IntPtr, ByRef rc As Rectangle) As Boolean
  17.    End Function
  18.  
  19.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  20.    Shared Function MoveWindow(hWnd As IntPtr, x As Integer, y As Integer, Width As Integer, Height As Integer, repaint As Boolean) As Boolean
  21.    End Function
  22.  
  23.    Private Sub Resize_Process_Window(ByVal ProcessName As String, _
  24.                                      ByVal Width As Integer, _
  25.                                      ByVal Height As Integer)
  26.  
  27.        ProcessName = If(ProcessName.ToLower.EndsWith(".exe"), _
  28.                         ProcessName.Substring(0, ProcessName.LastIndexOf(".")), _
  29.                         ProcessName)
  30.  
  31.        Dim rect As Rectangle = Nothing
  32.        Dim proc As Process = Nothing
  33.  
  34.        Try
  35.            ' Find the process
  36.            proc = Process.GetProcessesByName(ProcessName).First
  37.  
  38.            ' Store the process Main Window positions and sizes into the Rectangle.
  39.            GetWindowRect(proc.MainWindowHandle, rect)
  40.  
  41.            ' Resize the Main Window
  42.            MoveWindow(proc.MainWindowHandle, _
  43.                       rect.Left, _
  44.                       rect.Top, _
  45.                       If(Not Width = Nothing, Width, (rect.Width - rect.Left)), _
  46.                       If(Not Height = Nothing, Height, (rect.Height - rect.Top)), _
  47.                       True)
  48.  
  49.        Catch ex As InvalidOperationException
  50.            'Throw New Exception("Process not found.")
  51.            MessageBox.Show("Process not found.", Nothing, MessageBoxButtons.OK, MessageBoxIcon.Error)
  52.  
  53.        Finally
  54.            rect = Nothing
  55.            If proc IsNot Nothing Then proc.Dispose()
  56.  
  57.        End Try
  58.  
  59.    End Sub
  60.  
  61. #End Region
  62.  




Desplaza la posición de la ventana de un proceso

Código
  1. #Region " Shift Process Window Position "
  2.  
  3.    ' [ Shift Process Window Position ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' Shift the notepad window +10,-50 (X,Y)
  10.    ' Shift_Process_Window_Position("notepad.exe", +10, -50)
  11.    '
  12.    ' Shift the notepad window +10 (X) and preserving the original (Y) position
  13.    ' Shift_Process_Window_Position_Position("notepad.exe", +10, Nothing)
  14.  
  15.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  16.    Shared Function GetWindowRect(hWnd As IntPtr, ByRef rc As Rectangle) As Boolean
  17.    End Function
  18.  
  19.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  20.    Shared Function MoveWindow(hWnd As IntPtr, x As Integer, y As Integer, Width As Integer, Height As Integer, repaint As Boolean) As Boolean
  21.    End Function
  22.  
  23.    Private Sub Shift_Process_Window_Position(ByVal ProcessName As String, ByVal X As Integer, ByVal Y As Integer)
  24.  
  25.        ProcessName = If(ProcessName.ToLower.EndsWith(".exe"), _
  26.                         ProcessName.Substring(0, ProcessName.LastIndexOf(".")), _
  27.                         ProcessName)
  28.  
  29.        Dim rect As Rectangle = Nothing
  30.        Dim proc As Process = Nothing
  31.  
  32.        Try
  33.            ' Find the process
  34.            proc = Process.GetProcessesByName(ProcessName).First
  35.  
  36.            ' Store the process Main Window positions and sizes into the Rectangle.
  37.            GetWindowRect(proc.MainWindowHandle, rect)
  38.  
  39.            ' Move the Main Window
  40.            MoveWindow(proc.MainWindowHandle, _
  41.                       If(Not X = Nothing, rect.Left + X, rect.Left), _
  42.                       If(Not Y = Nothing, rect.Top + Y, rect.Top), _
  43.                       (rect.Width - rect.Left), _
  44.                       (rect.Height - rect.Top), _
  45.                       True)
  46.  
  47.        Catch ex As InvalidOperationException
  48.            'Throw New Exception("Process not found.")
  49.            MessageBox.Show("Process not found.", Nothing, MessageBoxButtons.OK, MessageBoxIcon.Error)
  50.  
  51.        Finally
  52.            rect = Nothing
  53.            If proc IsNot Nothing Then proc.Dispose()
  54.  
  55.        End Try
  56.  
  57.    End Sub
  58.  
  59. #End Region





Desplaza el tamaño de la ventana de un proceso

Código
  1. #Region " Shift Process Window Size "
  2.  
  3.    ' [ Shift Process Window Size ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '        
  9.    ' Shift the size of notepad window to +10 Width and -5 Height
  10.    ' Shift_Process_Window_Size("notepad.exe", +10, -5)
  11.    '
  12.    ' Shift the size of notepad window to +10 Width and preserving the original Height process window size.
  13.    ' Shift_Process_Window_Size("notepad.exe", +10, Nothing)
  14.  
  15.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  16.    Shared Function GetWindowRect(hWnd As IntPtr, ByRef rc As Rectangle) As Boolean
  17.    End Function
  18.  
  19.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  20.    Shared Function MoveWindow(hWnd As IntPtr, x As Integer, y As Integer, Width As Integer, Height As Integer, repaint As Boolean) As Boolean
  21.    End Function
  22.  
  23.    Private Sub Shift_Process_Window_Size(ByVal ProcessName As String, _
  24.                                      ByVal Width As Integer, _
  25.                                      ByVal Height As Integer)
  26.  
  27.        ProcessName = If(ProcessName.ToLower.EndsWith(".exe"), _
  28.                         ProcessName.Substring(0, ProcessName.LastIndexOf(".")), _
  29.                         ProcessName)
  30.  
  31.        Dim rect As Rectangle = Nothing
  32.        Dim proc As Process = Nothing
  33.  
  34.        Try
  35.            ' Find the process
  36.            proc = Process.GetProcessesByName(ProcessName).First
  37.  
  38.            ' Store the process Main Window positions and sizes into the Rectangle.
  39.            GetWindowRect(proc.MainWindowHandle, rect)
  40.  
  41.            ' Resize the Main Window
  42.            MoveWindow(proc.MainWindowHandle, _
  43.                       rect.Left, _
  44.                       rect.Top, _
  45.                       If(Not Width = Nothing, (rect.Width - rect.Left) + Width, (rect.Width - rect.Left)), _
  46.                       If(Not Height = Nothing, (rect.Height - rect.Top) + Height, (rect.Height - rect.Top)), _
  47.                       True)
  48.  
  49.        Catch ex As InvalidOperationException
  50.            'Throw New Exception("Process not found.")
  51.            MessageBox.Show("Process not found.", Nothing, MessageBoxButtons.OK, MessageBoxIcon.Error)
  52.  
  53.        Finally
  54.            rect = Nothing
  55.            If proc IsNot Nothing Then proc.Dispose()
  56.  
  57.        End Try
  58.  
  59.    End Sub
  60.  
  61. #End Region
8205  Foros Generales / Dudas Generales / Re: pelicula fantasma en: 14 Octubre 2013, 21:27 pm
Hola,
Prueba este procedimiento a seguir para solucionar el problema:


1. Hacer 'click' en un espacio vacío del escritorio.

2. Agarrar el teclado y posarlo sobre una superficie llana.

3. Coger aire para llenar los pulmones con respiraciones cortas pero sin pausa.

4. Tomar un café y descansar 5 minutos, pero durante ese tiempo no mirar fíjamente al teclado (pues no queremos provocar una pelea).

5. Pulsar la tecla 'F5' en el teclado. (F5 = Refrescar sistema)

6. Por último, si te sirvió de ayuda, saber tomarse esta pequeña guía con humor y echarse unas risas!. :P


Saludos!
8206  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 14 Octubre 2013, 20:47 pm
Estuve averiguando y al parecer tengo q usar Visual Studio para utilizar los codigos posteados o me equivoco?

Si, estás en lo cierto, tienes que usar VisualStudio,
existen otras IDES como SharpDevelop, MonoDevelop, e incluso puedes programar/compilar C# online desde la página -> CodeRun,
pero en mi opinión como la IDE de Microsoft no hay ninguna que se pueda comparar, aunque si tienes un PC lento quizás prefieras usar sharpdevelop porque VisualStudio consume bastantes recursos del sistema (no se puede ser el mejor sin tener algún inconveniente).

EDITO:
En -> IDEOne y -> CompileOnline puedes compilar código VBNET.

Un saludo!
8207  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 14 Octubre 2013, 19:09 pm
Una class para manejar bases de clientes,
En principio el código original lo descargué de la página CodeProject, pero lo modifiqué casi por completo y además le añadi +20 funciones genéricas para que las operaciones más comunes no requieran escritura de código adicional.

(La lista de contactos es facil de añadir en un Listview/DataGridView)

Esto es un ejemplo de para que sirve:



EDITO: He añadido un par de funciones más.

Código
  1. #Region " Contact "
  2.  
  3. #Region " Examples (Normal usage)"
  4.  
  5. ' Create a new list of contacts
  6. ' Dim Contacts As List(Of Contact) = New List(Of Contact)
  7. ' Or load ContactList from previous serialized file
  8. ' Dim Contacts As List(Of Contact) = ContactSerializer.Deserialize("C:\Contacts.bin")
  9.  
  10. ' Set a variable to store the current contact position
  11. ' Dim CurrentPosition As Integer = 0
  12.  
  13. ' Create a new contact
  14. ' Dim CurrentContact As Contact = New Contact With { _
  15. '     .Name = "Manolo", _
  16. '     .Surname = "El del Bombo", _
  17. '     .Country = "Spain", _
  18. '     .City = "Valencia", _
  19. '     .Street = "Av. Mestalla", _
  20. '     .ZipCode = "42731", _
  21. '     .Phone = "96.XXX.XX.XX", _
  22. '     .CellPhone = "651.XXX.XXX", _
  23. '     .Email = "ManoloToLoko@Gmail.com"}
  24.  
  25. ' Add a contact to contacts list
  26. ' Contacts.Add(CurrentContact)
  27.  
  28. ' Update the CurrentPosition index value
  29. ' CurrentPosition = Contacts.IndexOf(CurrentContact)
  30.  
  31. #End Region
  32.  
  33. #Region " Examples (Generic functions) "
  34.  
  35.  
  36. ' Examples:
  37. '
  38. ' -----------------
  39. ' Add a new contact
  40. ' -----------------
  41. ' Contact.Add_Contact(ContactList, "Manolo", "El del Bombo", "Spain", "Valencia", "Av. Mestalla", "42731", "96.XXX.XX.XX", "651.XXX.XXX", "ManoloToLoko@Gmail.com")
  42. '
  43. '
  44. ' -----------------------------------------------------------------
  45. ' Load a contact from an existing contacts list into TextBox Fields
  46. ' -----------------------------------------------------------------
  47. ' Contact.Load_Contact(ContactList, 0, TextBox_Name, textbox_surName, TextBox_Country, textbox_City, TextBox_Street, TextBox_ZipCode, TextBox_Phone, TextBox_CellPhone, TextBox_email)
  48. '
  49. '
  50. ' ----------------------------------
  51. ' Load a contact into TextBox Fields
  52. ' ----------------------------------
  53. ' Contact.Load_Contact(Contact, TextBox_Name, textbox_surName, TextBox_Country, textbox_City, TextBox_Street, TextBox_ZipCode, TextBox_Phone, TextBox_CellPhone, TextBox_email)
  54. '
  55. '
  56. ' ---------------------------------
  57. ' Load a contact list into ListView
  58. ' ---------------------------------
  59. ' Contact.Load_ContactList_Into_ListView(ContactList, ListView1)
  60. '
  61. '
  62. ' -------------------------------------
  63. ' Load a contact list into DataGrivView
  64. ' -------------------------------------
  65. ' Contact.Load_ContactList_Into_DataGrivView(ContactList, DataGrivView1)
  66. '
  67. '
  68. ' -------------------------------------------
  69. ' Load a contacts list from a serialized file
  70. ' -------------------------------------------
  71. ' Dim ContactList As List(Of Contact) = Contact.Load_ContactList("C:\Contacts.bin")
  72. '
  73. '
  74. ' -----------------------------------------------------------------------
  75. ' Find the first occurrence of a contact name in a existing contacts list
  76. ' -----------------------------------------------------------------------
  77. ' Dim ContactFound As Contact = Contact.Match_Contact_Name_FirstOccurrence(ContactList, "Manolo")
  78. '
  79. '
  80. ' ----------------------------------------------------------------------
  81. ' Find all the occurrences of a contact name in a existing contacts list
  82. ' ----------------------------------------------------------------------
  83. ' Dim ContactsFound As List(Of Contact) = Contact.Match_Contact_Name(ContactList, "Manolo")
  84. '
  85. '
  86. ' -------------------------------------------------------------
  87. ' Remove a contact from a Contact List giving the contact index
  88. ' -------------------------------------------------------------
  89. ' Remove_Contact(ContactList, 0)
  90. '
  91. '
  92. ' -------------------------------------------------------
  93. ' Remove a contact from a Contact List giving the contact
  94. ' -------------------------------------------------------
  95. ' Remove_Contact(ContactList, MyContact)
  96. '
  97. '
  98. ' -------------------------
  99. ' Save the contacts to file
  100. ' -------------------------
  101. ' Contact.Save_ContactList(ContactList, "C:\Contacts.bin")
  102. '
  103. '
  104. ' -------------------------
  105. ' Sort the contacts by name
  106. ' -------------------------
  107. ' Dim SorteredContacts As List(Of Contact) = Contact.Sort_ContactList_By_Name(ContactList, Contact.ContectSortMode.Ascending)
  108. '
  109. '
  110. ' --------------------------------------------------------------------
  111. ' Get a formatted string containing the details of an existing contact
  112. ' --------------------------------------------------------------------
  113. ' MsgBox(Contact.Get_Contact_Details(ContactList, 0))
  114. ' MsgBox(Contact.Get_Contact_Details(CurrentContact))
  115. '    
  116. '
  117. ' ----------------------------------------------------------------------------------
  118. ' Copy to clipboard a formatted string containing the details of an existing contact
  119. ' ----------------------------------------------------------------------------------
  120. ' Contact.Copy_Contact_Details_To_Clipboard(ContactList, 0)
  121. ' Contact.Copy_Contact_Details_To_Clipboard(CurrentContact)
  122.  
  123.  
  124. #End Region
  125.  
  126. <Serializable()> _
  127. Public Class Contact
  128.  
  129.    Public Enum ContectSortMode As Short
  130.        Ascending = 0
  131.        Descending = 1
  132.    End Enum
  133.  
  134. #Region "Member Variables"
  135.  
  136.    Private mId As System.Guid
  137.    Private mName As String
  138.    Private mSurname As String
  139.    Private mCountry As String
  140.    Private mCity As String
  141.    Private mStreet As String
  142.    Private mZip As String
  143.    Private mPhone As String
  144.    Private mCellPhone As String
  145.    Private mEmail As String
  146.  
  147. #End Region
  148.  
  149. #Region "Constructor"
  150.  
  151.    Public Sub New()
  152.        mId = Guid.NewGuid()
  153.    End Sub
  154.  
  155.  
  156.    Public Sub New(ByVal ID As System.Guid)
  157.        mId = ID
  158.    End Sub
  159.  
  160. #End Region
  161.  
  162. #Region "Properties"
  163.  
  164.    Public Property Name() As String
  165.        Get
  166.            Return mName
  167.        End Get
  168.        Set(ByVal value As String)
  169.            mName = value
  170.        End Set
  171.    End Property
  172.  
  173.    Public Property Surname() As String
  174.        Get
  175.            Return mSurname
  176.        End Get
  177.        Set(ByVal value As String)
  178.            mSurname = value
  179.        End Set
  180.    End Property
  181.  
  182.    Public Property Street() As String
  183.        Get
  184.            Return mStreet
  185.        End Get
  186.        Set(ByVal value As String)
  187.            mStreet = value
  188.        End Set
  189.    End Property
  190.  
  191.    Public Property City() As String
  192.        Get
  193.            Return mCity
  194.        End Get
  195.        Set(ByVal value As String)
  196.            mCity = value
  197.        End Set
  198.    End Property
  199.  
  200.    Public Property Country() As String
  201.        Get
  202.            Return mCountry
  203.        End Get
  204.        Set(ByVal value As String)
  205.            mCountry = value
  206.        End Set
  207.    End Property
  208.  
  209.    Public Property ZipCode() As String
  210.        Get
  211.            Return mZip
  212.        End Get
  213.        Set(ByVal value As String)
  214.            mZip = value
  215.        End Set
  216.    End Property
  217.  
  218.    Public Property Email() As String
  219.        Get
  220.            Return mEmail
  221.        End Get
  222.        Set(ByVal value As String)
  223.            mEmail = value
  224.        End Set
  225.    End Property
  226.  
  227.    Public Property Phone() As String
  228.        Get
  229.            Return mPhone
  230.        End Get
  231.        Set(ByVal value As String)
  232.            mPhone = value
  233.        End Set
  234.    End Property
  235.  
  236.    Public Property CellPhone() As String
  237.        Get
  238.            Return mCellPhone
  239.        End Get
  240.        Set(ByVal value As String)
  241.            mCellPhone = value
  242.        End Set
  243.    End Property
  244.  
  245. #End Region
  246.  
  247. #Region " ContactSerializer "
  248.  
  249.    Public Class ContactSerializer
  250.  
  251.        ''' <summary>
  252.        ''' Serialize a contact list into a contacts file.
  253.        ''' </summary>
  254.        ''' <param name="ContactList"></param>
  255.        ''' <param name="FilePath"></param>
  256.        ''' <remarks></remarks>
  257.        Public Shared Sub Save(ByVal ContactList As List(Of Contact), _
  258.                                    ByVal FilePath As String)
  259.  
  260.            Dim fs As IO.FileStream = Nothing
  261.            Dim formatter As System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
  262.  
  263.            Try
  264.                fs = New IO.FileStream(FilePath, IO.FileMode.OpenOrCreate)
  265.                formatter = New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
  266.                formatter.Serialize(fs, ContactList)
  267.  
  268.            Catch ex As Exception
  269.  
  270.                MessageBox.Show(String.Format("{0}:{1}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace), _
  271.                                "Error", _
  272.                                MessageBoxButtons.OK, _
  273.                                MessageBoxIcon.Error)
  274.  
  275.            Finally
  276.                If fs IsNot Nothing Then fs.Dispose()
  277.  
  278.            End Try
  279.  
  280.        End Sub
  281.  
  282.        ''' <summary>
  283.        ''' Deserialize an existing file into a contact list.
  284.        ''' </summary>
  285.        ''' <param name="FilePath"></param>
  286.        ''' <returns></returns>
  287.        ''' <remarks></remarks>
  288.        Public Shared Function Load(ByVal FilePath As String) As List(Of Contact)
  289.  
  290.            Dim fs As IO.FileStream = Nothing
  291.            Dim formatter As System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
  292.  
  293.            Try
  294.                fs = New IO.FileStream(FilePath, IO.FileMode.Open)
  295.                formatter = New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
  296.                Return formatter.Deserialize(fs)
  297.  
  298.            Catch ex As Exception
  299.  
  300.                MessageBox.Show(String.Format("{0}:{1}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace), _
  301.                                "Error", _
  302.                                MessageBoxButtons.OK, _
  303.                                MessageBoxIcon.Error)
  304.                Return Nothing
  305.  
  306.            Finally
  307.                If fs IsNot Nothing Then fs.Dispose()
  308.  
  309.            End Try
  310.  
  311.        End Function
  312.  
  313.    End Class
  314.  
  315. #End Region
  316.  
  317. #Region " Generic Functions "
  318.  
  319.    ' Formatted String of contact detailed information
  320.    Shared ReadOnly DetailsFormat As String = _
  321.    "Name.....: {1}{0}Surname..: {2}{0}Country..: {3}{0}City.....: {4}{0}Street...: {5}{0}Zipcode..: {6}{0}Phone....: {7}{0}CellPhone: {8}{0}Email....: {9}"
  322.  
  323.    ''' <summary>
  324.    ''' Add a new contact into a existing contacts list.
  325.    ''' </summary>
  326.    Public Shared Sub Add_Contact(ByVal ContactList As List(Of Contact), _
  327.                           ByVal Name As String, _
  328.                           ByVal Surname As String, _
  329.                           ByVal Country As String, _
  330.                           ByVal City As String, _
  331.                           ByVal Street As String, _
  332.                           ByVal ZipCode As String, _
  333.                           ByVal Phone As String, _
  334.                           ByVal CellPhone As String, _
  335.                           ByVal Email As String)
  336.  
  337.        ContactList.Add(New Contact With { _
  338.                        .Name = Name, _
  339.                        .Surname = Surname, _
  340.                        .Country = Country, _
  341.                        .City = City, _
  342.                        .Street = Street, _
  343.                        .ZipCode = ZipCode, _
  344.                        .Phone = Phone, _
  345.                        .CellPhone = CellPhone, _
  346.                        .Email = Email _
  347.                    })
  348.  
  349.    End Sub
  350.  
  351.    ''' <summary>
  352.    ''' Remove a contact from an existing contacts list.
  353.    ''' </summary>
  354.    Public Shared Sub Remove_Contact(ByVal ContactList As List(Of Contact), ByVal ContactIndex As Integer)
  355.        ContactList.RemoveAt(ContactIndex)
  356.    End Sub
  357.  
  358.    ''' <summary>
  359.    ''' Remove a contact from an existing contacts list.
  360.    ''' </summary>
  361.    Public Shared Sub Remove_Contact(ByVal ContactList As List(Of Contact), ByVal Contact As Contact)
  362.        ContactList.Remove(Contact)
  363.    End Sub
  364.  
  365.    ''' <summary>
  366.    ''' Find the first occurrence of a contact name in an existing contacts list.
  367.    ''' </summary>
  368.    Public Shared Function Match_Contact_Name_FirstOccurrence(ByVal ContactList As List(Of Contact), ByVal Name As String) As Contact
  369.  
  370.        Return ContactList.Find(Function(contact) contact.Name.ToLower.StartsWith(Name.ToLower) _
  371.                                OrElse contact.Name.ToLower.Contains(Name.ToLower))
  372.    End Function
  373.  
  374.    ''' <summary>
  375.    ''' Find all the occurrences of a contact name in a existing contacts list.
  376.    ''' </summary>
  377.    Public Shared Function Match_Contact_Name(ByVal ContactList As List(Of Contact), ByVal Name As String) As List(Of Contact)
  378.  
  379.        Return ContactList.FindAll(Function(contact) contact.Name.ToLower.StartsWith(Name.ToLower) _
  380.                                   OrElse contact.Name.ToLower.Contains(Name.ToLower))
  381.  
  382.    End Function
  383.  
  384.    ''' <summary>
  385.    ''' Load a contact from an existing contacts list into textbox fields.
  386.    ''' </summary>
  387.    Public Shared Sub Load_Contact(ByVal ContactList As List(Of Contact), _
  388.                            ByVal ContactIndex As Integer, _
  389.                            ByVal TextBox_Name As TextBox, _
  390.                            ByVal TextBox_Surname As TextBox, _
  391.                            ByVal TextBox_Country As TextBox, _
  392.                            ByVal TextBox_City As TextBox, _
  393.                            ByVal TextBox_Street As TextBox, _
  394.                            ByVal TextBox_Zipcode As TextBox, _
  395.                            ByVal TextBox_Phone As TextBox, _
  396.                            ByVal TextBox_CellPhone As TextBox, _
  397.                            ByVal TextBox_Email As TextBox)
  398.  
  399.        TextBox_Name.Text = ContactList.Item(ContactIndex).Name
  400.        TextBox_Surname.Text = ContactList.Item(ContactIndex).Surname
  401.        TextBox_Country.Text = ContactList.Item(ContactIndex).Country
  402.        TextBox_City.Text = ContactList.Item(ContactIndex).City
  403.        TextBox_Street.Text = ContactList.Item(ContactIndex).Street
  404.        TextBox_Zipcode.Text = ContactList.Item(ContactIndex).ZipCode
  405.        TextBox_Phone.Text = ContactList.Item(ContactIndex).Phone
  406.        TextBox_CellPhone.Text = ContactList.Item(ContactIndex).CellPhone
  407.        TextBox_Email.Text = ContactList.Item(ContactIndex).Email
  408.  
  409.    End Sub
  410.  
  411.    ''' <summary>
  412.    ''' Load a contact into textbox fields.
  413.    ''' </summary>
  414.    Public Shared Sub Load_Contact(ByVal Contact As Contact, _
  415.                            ByVal TextBox_Name As TextBox, _
  416.                            ByVal TextBox_Surname As TextBox, _
  417.                            ByVal TextBox_Country As TextBox, _
  418.                            ByVal TextBox_City As TextBox, _
  419.                            ByVal TextBox_Street As TextBox, _
  420.                            ByVal TextBox_Zipcode As TextBox, _
  421.                            ByVal TextBox_Phone As TextBox, _
  422.                            ByVal TextBox_CellPhone As TextBox, _
  423.                            ByVal TextBox_Email As TextBox)
  424.  
  425.        TextBox_Name.Text = Contact.Name
  426.        TextBox_Surname.Text = Contact.Surname
  427.        TextBox_Country.Text = Contact.Country
  428.        TextBox_City.Text = Contact.City
  429.        TextBox_Street.Text = Contact.Street
  430.        TextBox_Zipcode.Text = Contact.ZipCode
  431.        TextBox_Phone.Text = Contact.Phone
  432.        TextBox_CellPhone.Text = Contact.CellPhone
  433.        TextBox_Email.Text = Contact.Email
  434.  
  435.    End Sub
  436.  
  437.    ''' <summary>
  438.    ''' Seriale a contacts list to a file.
  439.    ''' </summary>
  440.    Public Shared Sub Save_ContactList(ByVal ContactList As List(Of Contact), ByVal FilePath As String)
  441.  
  442.        Contact.ContactSerializer.Save(ContactList, FilePath)
  443.  
  444.    End Sub
  445.  
  446.    ''' <summary>
  447.    ''' Load a contacts list from a serialized file.
  448.    ''' </summary>
  449.    Public Shared Function Load_ContactList(ByVal FilePath As String) As List(Of Contact)
  450.  
  451.        Return Contact.ContactSerializer.Load(FilePath)
  452.  
  453.    End Function
  454.  
  455.    ''' <summary>
  456.    ''' Reorder the contacts of a Contacts List by the Name field.
  457.    ''' </summary>
  458.    Public Shared Function Sort_ContactList_By_Name(ByVal ContactList As List(Of Contact), _
  459.                                              ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  460.  
  461.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  462.                  ContactList.OrderBy(Function(contact) contact.Name).ToList(), _
  463.                  ContactList.OrderByDescending(Function(contact) contact.Name).ToList())
  464.  
  465.    End Function
  466.  
  467.    ''' <summary>
  468.    ''' Reorder the contacts of a Contacts List by the Surname field.
  469.    ''' </summary>
  470.    Public Shared Function Sort_ContactList_By_Surname(ByVal ContactList As List(Of Contact), _
  471.                                                 ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  472.  
  473.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  474.                  ContactList.OrderBy(Function(contact) contact.Surname).ToList(), _
  475.                  ContactList.OrderByDescending(Function(contact) contact.Surname).ToList())
  476.  
  477.    End Function
  478.  
  479.    ''' <summary>
  480.    ''' Reorder the contacts of a Contacts List by the Country field.
  481.    ''' </summary>
  482.    Public Shared Function Sort_ContactList_By_Country(ByVal ContactList As List(Of Contact), _
  483.                                                 ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  484.  
  485.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  486.                  ContactList.OrderBy(Function(contact) contact.Country).ToList(), _
  487.                  ContactList.OrderByDescending(Function(contact) contact.Country).ToList())
  488.  
  489.    End Function
  490.  
  491.    ''' <summary>
  492.    ''' Reorder the contacts of a Contacts List by the City field.
  493.    ''' </summary>
  494.    Public Shared Function Sort_ContactList_By_City(ByVal ContactList As List(Of Contact), _
  495.                                              ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  496.  
  497.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  498.                  ContactList.OrderBy(Function(contact) contact.City).ToList(), _
  499.                  ContactList.OrderByDescending(Function(contact) contact.City).ToList())
  500.  
  501.    End Function
  502.  
  503.    ''' <summary>
  504.    ''' Reorder the contacts of a Contacts List by the Street field.
  505.    ''' </summary>
  506.    Public Shared Function Sort_ContactList_By_Street(ByVal ContactList As List(Of Contact), _
  507.                                                ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  508.  
  509.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  510.                  ContactList.OrderBy(Function(contact) contact.Street).ToList(), _
  511.                  ContactList.OrderByDescending(Function(contact) contact.Street).ToList())
  512.  
  513.    End Function
  514.  
  515.    ''' <summary>
  516.    ''' Reorder the contacts of a Contacts List by the Zipcode field.
  517.    ''' </summary>
  518.    Public Shared Function Sort_ContactList_By_Zipcode(ByVal ContactList As List(Of Contact), _
  519.                                                 ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  520.  
  521.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  522.                  ContactList.OrderBy(Function(contact) contact.ZipCode).ToList(), _
  523.                  ContactList.OrderByDescending(Function(contact) contact.ZipCode).ToList())
  524.  
  525.    End Function
  526.  
  527.    ''' <summary>
  528.    ''' Reorder the contacts of a Contacts List by the Phone field.
  529.    ''' </summary>
  530.    Public Shared Function Sort_ContactList_By_Phone(ByVal ContactList As List(Of Contact), _
  531.                                               ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  532.  
  533.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  534.                  ContactList.OrderBy(Function(contact) contact.Phone).ToList(), _
  535.                  ContactList.OrderByDescending(Function(contact) contact.Phone).ToList())
  536.  
  537.    End Function
  538.  
  539.    ''' <summary>
  540.    ''' Reorder the contacts of a Contacts List by the CellPhone field.
  541.    ''' </summary>
  542.    Public Shared Function Sort_ContactList_By_CellPhone(ByVal ContactList As List(Of Contact), _
  543.                                                   ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  544.  
  545.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  546.                  ContactList.OrderBy(Function(contact) contact.CellPhone).ToList(), _
  547.                  ContactList.OrderByDescending(Function(contact) contact.CellPhone).ToList())
  548.  
  549.    End Function
  550.  
  551.    ''' <summary>
  552.    ''' Reorder the contacts of a Contacts List by the Email field.
  553.    ''' </summary>
  554.    Public Shared Function Sort_ContactList_By_Email(ByVal ContactList As List(Of Contact), _
  555.                                               ByVal ContectSortMode As Contact.ContectSortMode) As List(Of Contact)
  556.  
  557.        Return If(ContectSortMode = Contact.ContectSortMode.Ascending, _
  558.                  ContactList.OrderBy(Function(contact) contact.Email).ToList(), _
  559.                  ContactList.OrderByDescending(Function(contact) contact.Email).ToList())
  560.  
  561.    End Function
  562.  
  563.    ''' <summary>
  564.    ''' Get a formatted string containing the details of an existing contact.
  565.    ''' </summary>
  566.    Public Shared Function Get_Contact_Details(ByVal ContactList As List(Of Contact), ByVal ContactIndex As Integer) As String
  567.  
  568.        Return String.Format(DetailsFormat, _
  569.                             Environment.NewLine, _
  570.                             ContactList.Item(ContactIndex).Name, _
  571.                             ContactList.Item(ContactIndex).Surname, _
  572.                             ContactList.Item(ContactIndex).Country, _
  573.                             ContactList.Item(ContactIndex).City, _
  574.                             ContactList.Item(ContactIndex).Street, _
  575.                             ContactList.Item(ContactIndex).ZipCode, _
  576.                             ContactList.Item(ContactIndex).Phone, _
  577.                             ContactList.Item(ContactIndex).CellPhone, _
  578.                             ContactList.Item(ContactIndex).Email)
  579.  
  580.    End Function
  581.  
  582.    ''' <summary>
  583.    ''' Get a formatted string containing the details of an existing contact.
  584.    ''' </summary>
  585.    Public Shared Function Get_Contact_Details(ByVal Contact As Contact) As String
  586.  
  587.        Return String.Format(DetailsFormat, _
  588.                             Environment.NewLine, _
  589.                             Contact.Name, _
  590.                             Contact.Surname, _
  591.                             Contact.Country, _
  592.                             Contact.City, _
  593.                             Contact.Street, _
  594.                             Contact.ZipCode, _
  595.                             Contact.Phone, _
  596.                             Contact.CellPhone, _
  597.                             Contact.Email)
  598.  
  599.    End Function
  600.  
  601.    ''' <summary>
  602.    ''' Copy to clipboard a formatted string containing the details of an existing contact.
  603.    ''' </summary>
  604.    Public Shared Sub Copy_Contact_Details_To_Clipboard(ByVal ContactList As List(Of Contact), ByVal ContactIndex As Integer)
  605.  
  606.        Clipboard.SetText(String.Format(DetailsFormat, _
  607.                          Environment.NewLine, _
  608.                          ContactList.Item(ContactIndex).Name, _
  609.                          ContactList.Item(ContactIndex).Surname, _
  610.                          ContactList.Item(ContactIndex).Country, _
  611.                          ContactList.Item(ContactIndex).City, _
  612.                          ContactList.Item(ContactIndex).Street, _
  613.                          ContactList.Item(ContactIndex).ZipCode, _
  614.                          ContactList.Item(ContactIndex).Phone, _
  615.                          ContactList.Item(ContactIndex).CellPhone, _
  616.                          ContactList.Item(ContactIndex).Email))
  617.  
  618.    End Sub
  619.  
  620.    ''' <summary>
  621.    ''' Copy to clipboard a formatted string containing the details of an existing contact.
  622.    ''' </summary>
  623.    Public Shared Sub Copy_Contact_Details_To_Clipboard(ByVal Contact As Contact)
  624.  
  625.        Clipboard.SetText(String.Format(DetailsFormat, _
  626.                          Environment.NewLine, _
  627.                          Contact.Name, _
  628.                          Contact.Surname, _
  629.                          Contact.Country, _
  630.                          Contact.City, _
  631.                          Contact.Street, _
  632.                          Contact.ZipCode, _
  633.                          Contact.Phone, _
  634.                          Contact.CellPhone, _
  635.                          Contact.Email))
  636.  
  637.    End Sub
  638.  
  639.    ''' <summary>
  640.    ''' Load an existing contacts list into a ListView.
  641.    ''' </summary>
  642.    Public Shared Sub Load_ContactList_Into_ListView(ByVal ContactList As List(Of Contact), _
  643.                                                     ByVal Listview As ListView)
  644.  
  645.        Listview.Items.AddRange( _
  646.                       ContactList _
  647.                       .Select(Function(Contact) _
  648.                               New ListViewItem(New String() { _
  649.                                                                Contact.Name, _
  650.                                                                Contact.Surname, _
  651.                                                                Contact.Country, _
  652.                                                                Contact.City, _
  653.                                                                Contact.Street, _
  654.                                                                Contact.ZipCode, _
  655.                                                                Contact.Phone, _
  656.                                                                Contact.CellPhone, _
  657.                                                                Contact.Email _
  658.                                                             })).ToArray())
  659.  
  660.    End Sub
  661.  
  662.    ''' <summary>
  663.    ''' Load an existing contacts list into a DataGridView.
  664.    ''' </summary>
  665.    Public Shared Sub Load_ContactList_Into_DataGridView(ByVal ContactList As List(Of Contact), _
  666.                                                         ByVal DataGridView As DataGridView)
  667.  
  668.        DataGridView.DataSource = ContactList
  669.        ' Sortered:
  670.        ' DataGridView.DataSource = (From Contact In ContactList Order By Contact.Name Ascending Select Contact).ToList
  671.  
  672.    End Sub
  673.  
  674.  
  675. #End Region
  676.  
  677. End Class
  678.  
  679. #End Region
8208  Programación / Scripting / Re: Resultado falso o verdadero [AutoIt] en: 14 Octubre 2013, 17:43 pm
Hola.

1. No dupliques posts, puedes reportar el otro mensaje para que el moderador encargado borre el otro mensaje o para pedirle que lo moviese a esta sección.

2. Este post es inmoral, es como esas personas que quieren quitar toda la publicidad de sus servers gratis...porque son así de listos,
   Adfly sólamente se lucra de 5 segundos de tu tiempo para hacer un miserable click,
   Y las normas de AdFly (si es que las hubieras llegado a leer) son muy claras, cualquier intento de manipulación de bypassear su control de seguridad (Ej: Bots) será sancionado dando de baja la cuenta de forma permanente,
   si usas un Bot ellos no se lucran, y los dos vais a salir perdiendo, aunque tu más por lo del baneo.

EDITO: Es más, si no recuerdo mal las normas de Adfly (hace bastante tiempo que las lei ya), creo que solo permitia un click por parte del autor del enlace del adfly (osea, tú), y ese click lo permiten para que el autor del enlace pueda verificar que el enlace ha salido correcto, es decir, que si haces más de un intento de hacer click desde el mismo pc por parte del autor del adfly eso ya es motivo para imponerte la sanción.

De todas formas no creo que puedas hacer nada si no añades funcionalidad de proxies a un Bot, no estoy seguro, pero Adfly no nació ayer.

PD: Esto es muy poco ético, pero no creo que sea ilegal asi que... mantengo abierto el post.

Saludos
8209  Programación / Scripting / Re: Sobre archivos .Bat en: 14 Octubre 2013, 16:28 pm
Añado: Almacenar información en archivos de texto para luego leer esa información no es necesario, es realizar pasos innecesarios, ya que puedes leer/almacenar la información de salida del comando diréctamente usando For.

Saludos
8210  Programación / Scripting / Re: Sobre archivos .Bat en: 14 Octubre 2013, 15:23 pm
For /F

-> http://ss64.com/nt/for_f.html

Código:
For /F %%X in ('Ver') Do ()...

Saludos
Páginas: 1 ... 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 [821] 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 ... 1258
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines