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

 

 


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


  Mostrar Mensajes
Páginas: 1 ... 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 [852] 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 ... 1236
8511  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito que alguien me compile un proyecto de C# en: 20 Julio 2013, 16:03 pm
Gracias por intentarlo omarhack, me voy a conectar ahora, no se si estarás,
ya hablamos...
8512  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito que alguien me compile un proyecto de C# en: 20 Julio 2013, 14:16 pm
voy a intentarlo a veeer :P

a ver a veeeeer  >:D
8513  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito que alguien me compile un proyecto de C# en: 20 Julio 2013, 12:09 pm
Me generas mucho spam xDDD pero sabes que agradezco la intención ;)
8514  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito que alguien me compile un proyecto de C# en: 20 Julio 2013, 11:37 am
se puede ejecutar C++/C en VS2012?

http://msdn.microsoft.com/en-us/library/vstudio/hh409293.aspx

Saludos...
8515  Programación / .NET (C#, VB.NET, ASP) / Re: Necesito que alguien me compile un proyecto de C# en: 20 Julio 2013, 11:31 am
Tu usas el mismo VS2012 que yo, creo... A mi si se me abren ya que se me compilen es otra cosa... :xD

Si usaste mi instalador con las opciones por defecto entonces vas a ser incapaz de abrir un proyecto donde se maneje C/C++ ya que hay que elegir esos paquetes manualmente en el instalador (si se quieren instalar), en cambio los proyectos CSharp puro si que puedes abrirlos y además compilarlos.
8516  Programación / .NET (C#, VB.NET, ASP) / [SOLUCIONADO] Necesito que alguien me compile un proyecto de C# en: 20 Julio 2013, 11:22 am
En mi VisualStudio no tengo instalados los paquetes necesarios para ejecutar algunos proyectos de C

Necesito que una persona bondadosa que use Visual C se apiade de mi alma jeje y me targetee este proyecto a la plataforma x64: http://downloads.sourceforge.net/freeimage/FreeImage3154.zip

...Como bien explican aquí paso a paso como hacerlo funcionar: http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/

Necesito esa librería compilada en "AnyCpu" y "x64"

De verdad que yo no puedo abrir el proyecto ni hacer nada con él, no es cuestión de vagancia, podría instalar una maquina virtual e instalar vs alli pero...requiere mucho tiempo y alguno de ustedes puede hacerlo en 5 minutos.

¿Alguien puede hacerlo?.

Un saludo, y gracias...
8517  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 20 Julio 2013, 10:56 am
Una class de ayuda para manejar lo básico de la librería FreeImage

Convertir entre formatos, convertir a escala de grises, rotar, redimensionar, generar un thumbnail...

http://freeimage.sourceforge.net/download.html

Código
  1. #Region " FreeImage Helper "
  2.  
  3.  
  4. ' [ FreeImage Helper ]
  5. '
  6. ' // By Elektro H@cker
  7. '
  8. '
  9. ' INSTRUCTIONS:
  10. ' 1. ADD A REFERENCE FOR "FreeImageNET.dll" IN THE PROJECT.
  11. ' 2. ADD THE "FREEIMAGE.DLL" IN THE PROJECT.
  12. '
  13. '
  14. ' Examples :
  15. '
  16. ' MsgBox(FreeImageHelper.Is_Avaliable() ' Result: True
  17. ' MsgBox(FreeImageHelper.Get_Version()  ' Result: 3.15.1
  18. ' MsgBox(FreeImageHelper.Get_ImageFormat("C:\Test.png")) ' Result: PNG
  19. '
  20. ' FreeImageHelper.Convert("C:\Test.png", "C:\Test.ico", FreeImageAPI.FREE_IMAGE_FORMAT.FIF_ICO)
  21. ' FreeImageHelper.Convert(New Bitmap("C:\Test.png"), "C:\Test.jpg", FreeImageAPI.FREE_IMAGE_FORMAT.FIF_JPEG, FreeImageAPI.FREE_IMAGE_SAVE_FLAGS.JPEG_SUBSAMPLING_444 Or FreeImageAPI.FREE_IMAGE_SAVE_FLAGS.JPEG_QUALITYSUPERB)
  22. '
  23. ' PictureBox1.BackgroundImage = FreeImageHelper.GrayScale(New Bitmap("C:\Test.bmp"))
  24. ' PictureBox1.BackgroundImage = FreeImageHelper.GrayScale("C:\Test.bmp")
  25. '
  26. ' PictureBox1.BackgroundImage = FreeImageHelper.Resize(New Bitmap("C:\Test.bmp"), 32, 32)
  27. ' PictureBox1.BackgroundImage = FreeImageHelper.Resize("C:\Test.bmp", 64, 128)
  28. '
  29. ' PictureBox1.BackgroundImage = FreeImageHelper.Rotate(New Bitmap("C:\Test.bmp"), 90)
  30. ' PictureBox1.BackgroundImage = FreeImageHelper.Rotate("C:\Test.bmp", -90)
  31. '
  32. ' PictureBox1.BackgroundImage = FreeImageHelper.Thumbnail(New Bitmap("C:\Test.png"), 64, True)
  33. ' PictureBox1.BackgroundImage = FreeImageHelper.Thumbnail("C:\Test.png", 64, True)
  34.  
  35.  
  36.  
  37. Imports FreeImageAPI
  38.  
  39. Public Class FreeImageHelper
  40.  
  41.    ' <summary>
  42.    ' Checks if <i>FreeImage.dll</i> is avaliable on the system.
  43.    ' </summary>
  44.    Public Shared Function Is_Avaliable() As Boolean
  45.        Return FreeImage.IsAvailable
  46.    End Function
  47.  
  48.    ' <summary>
  49.    ' Gets the version of FreeImage.dll.
  50.    ' </summary>
  51.    Shared Function Get_Version() As String
  52.        Return FreeImage.GetVersion
  53.    End Function
  54.  
  55.    ' <summary>
  56.    ' Gets the image format of a image file.
  57.    ' </summary>
  58.    Shared Function Get_ImageFormat(ByVal File As String) As String
  59.        Return FreeImage.GetFileType(File, 0).ToString.Substring(4)
  60.    End Function
  61.  
  62.    ' <summary>
  63.    ' Convert a Bitmap object between image formats and save it to disk.
  64.    ' </summary>
  65.    Shared Sub Convert(ByVal bmp As System.Drawing.Bitmap, _
  66.                       ByVal Output As String, _
  67.                       ByVal NewFormat As FREE_IMAGE_FORMAT, _
  68.                       Optional ByVal SaveFlags As FREE_IMAGE_SAVE_FLAGS = FREE_IMAGE_SAVE_FLAGS.DEFAULT)
  69.  
  70.        Try
  71.            FreeImage.SaveBitmap(bmp, Output, NewFormat, SaveFlags)
  72.        Catch ex As Exception
  73.            ' Throw New Exception(ex.Message)
  74.            MsgBox(ex.Message)
  75.        End Try
  76.  
  77.    End Sub
  78.  
  79.    ' <summary>
  80.    ' Convert a image file between image formats and save it to disk.
  81.    ' </summary>
  82.    Shared Sub Convert(ByVal File As String, _
  83.                       ByVal Output As String, _
  84.                       ByVal NewFormat As FREE_IMAGE_FORMAT, _
  85.                       Optional ByVal SaveFlags As FREE_IMAGE_SAVE_FLAGS = FREE_IMAGE_SAVE_FLAGS.DEFAULT)
  86.  
  87.        Try
  88.            FreeImage.Save(NewFormat, FreeImage.LoadEx(File), Output, SaveFlags)
  89.        Catch ex As Exception
  90.            ' Throw New Exception(ex.Message)
  91.            MsgBox(ex.Message)
  92.        End Try
  93.  
  94.    End Sub
  95.  
  96.    ' <summary>
  97.    ' GrayScales a Bitmap object.
  98.    ' </summary>
  99.    Shared Function GrayScale(ByVal bmp As System.Drawing.Bitmap) As System.Drawing.Bitmap
  100.  
  101.        Try
  102.  
  103.            Dim ImageStream As New System.IO.MemoryStream
  104.            bmp.Save(ImageStream, bmp.RawFormat)
  105.  
  106.            Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream)
  107.            ImageStream.Dispose()
  108.  
  109.            Return FreeImage.GetBitmap(FreeImage.ConvertToGreyscale(Image))
  110.  
  111.        Catch ex As Exception
  112.            ' Throw New Exception(ex.Message)
  113.            MsgBox(ex.Message)
  114.            Return Nothing
  115.        End Try
  116.  
  117.    End Function
  118.  
  119.    ' <summary>
  120.    ' GrayScales a image file.
  121.    ' </summary>
  122.    Shared Function GrayScale(ByVal File As String) As System.Drawing.Bitmap
  123.  
  124.        Try
  125.            Return FreeImage.GetBitmap(FreeImage.ConvertToGreyscale(FreeImage.LoadEx(File)))
  126.        Catch ex As Exception
  127.            ' Throw New Exception(ex.Message)
  128.            MsgBox(ex.Message)
  129.            Return Nothing
  130.        End Try
  131.  
  132.    End Function
  133.  
  134.    ' <summary>
  135.    ' Resizes a Bitmap object.
  136.    ' </summary>
  137.    Shared Function Resize(ByVal bmp As System.Drawing.Bitmap, _
  138.                           ByVal X As Int32, _
  139.                           ByVal Y As Int32, _
  140.                           Optional ByVal Quality As FREE_IMAGE_FILTER = FREE_IMAGE_FILTER.FILTER_BILINEAR) As System.Drawing.Bitmap
  141.  
  142.        Try
  143.  
  144.            Dim ImageStream As New System.IO.MemoryStream
  145.            bmp.Save(ImageStream, bmp.RawFormat)
  146.  
  147.            Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream)
  148.            ImageStream.Dispose()
  149.  
  150.            Return FreeImage.GetBitmap(FreeImage.Rescale(Image, X, Y, Quality))
  151.  
  152.        Catch ex As Exception
  153.            ' Throw New Exception(ex.Message)
  154.            MsgBox(ex.Message)
  155.            Return Nothing
  156.        End Try
  157.  
  158.    End Function
  159.  
  160.    ' <summary>
  161.    ' Resizes a image file.
  162.    ' </summary>
  163.    Shared Function Resize(ByVal File As String, _
  164.                           ByVal X As Int32, _
  165.                           ByVal Y As Int32, _
  166.                           Optional ByVal Quality As FREE_IMAGE_FILTER = FREE_IMAGE_FILTER.FILTER_BILINEAR) As System.Drawing.Bitmap
  167.  
  168.        Try
  169.  
  170.            Return FreeImage.GetBitmap(FreeImage.Rescale(FreeImage.LoadEx(File), X, Y, Quality))
  171.  
  172.        Catch ex As Exception
  173.            ' Throw New Exception(ex.Message)
  174.            MsgBox(ex.Message)
  175.            Return Nothing
  176.        End Try
  177.  
  178.    End Function
  179.  
  180.    ' <summary>
  181.    ' Rotates a Bitmap object.
  182.    ' </summary>
  183.    Shared Function Rotate(ByVal bmp As System.Drawing.Bitmap, _
  184.                           ByVal Angle As Double) As System.Drawing.Bitmap
  185.  
  186.        Try
  187.  
  188.            Dim ImageStream As New System.IO.MemoryStream
  189.            bmp.Save(ImageStream, bmp.RawFormat)
  190.  
  191.            Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream)
  192.            ImageStream.Dispose()
  193.  
  194.            Return FreeImage.GetBitmap(FreeImage.Rotate(Image, Angle))
  195.  
  196.        Catch ex As Exception
  197.            ' Throw New Exception(ex.Message)
  198.            MsgBox(ex.Message)
  199.            Return Nothing
  200.        End Try
  201.  
  202.    End Function
  203.  
  204.    ' <summary>
  205.    ' Rotates a image file.
  206.    ' </summary>
  207.    Shared Function Rotate(ByVal File As String, _
  208.                           ByVal Angle As Double) As System.Drawing.Bitmap
  209.  
  210.        Try
  211.  
  212.            Return FreeImage.GetBitmap(FreeImage.Rotate(FreeImage.LoadEx(File), Angle))
  213.  
  214.        Catch ex As Exception
  215.            ' Throw New Exception(ex.Message)
  216.            MsgBox(ex.Message)
  217.            Return Nothing
  218.        End Try
  219.  
  220.    End Function
  221.  
  222.    ' <summary>
  223.    ' Returns a Thumbnail of a Bitmap object.
  224.    ' </summary>
  225.    Shared Function Thumbnail(ByVal bmp As System.Drawing.Bitmap, _
  226.                                   ByVal size As Int32, _
  227.                                   ByVal convert As Boolean) As System.Drawing.Bitmap
  228.  
  229.        Try
  230.  
  231.            Dim ImageStream As New System.IO.MemoryStream
  232.            bmp.Save(ImageStream, bmp.RawFormat)
  233.  
  234.            Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream)
  235.            ImageStream.Dispose()
  236.  
  237.            Return FreeImage.GetBitmap(FreeImage.MakeThumbnail(Image, size, convert))
  238.  
  239.        Catch ex As Exception
  240.            ' Throw New Exception(ex.Message)
  241.            MsgBox(ex.Message)
  242.            Return Nothing
  243.        End Try
  244.  
  245.    End Function
  246.  
  247.    ' <summary>
  248.    ' Returns a Thumbnail of a image file.
  249.    ' </summary>
  250.    Shared Function Thumbnail(ByVal File As String, _
  251.                                   ByVal size As Int32, _
  252.                                   ByVal convert As Boolean) As System.Drawing.Bitmap
  253.  
  254.        Try
  255.            Return FreeImage.GetBitmap(FreeImage.MakeThumbnail(FreeImage.LoadEx(File), size, convert))
  256.        Catch ex As Exception
  257.            ' Throw New Exception(ex.Message)
  258.            MsgBox(ex.Message)
  259.            Return Nothing
  260.        End Try
  261.  
  262.    End Function
  263.  
  264. End Class
  265.  
  266. #End Region





Informa a Windows de cambios en el sistema para refrescar el sistema.

Código
  1. #Region " System Notifier "
  2.  
  3. ' [ System Notifier ]
  4. '
  5. ' Examples :
  6. '
  7. ' SystemNotifier.Notify(SystemNotifier.EventID.FileAssociation_Changed, SystemNotifier.NotifyFlags.DWORD, IntPtr.Zero, IntPtr.Zero)
  8.  
  9. Public Class SystemNotifier
  10.  
  11.    <System.Runtime.InteropServices.DllImport("shell32.dll")> _
  12.    Shared Sub SHChangeNotify( _
  13.        ByVal wEventID As EventID, _
  14.        ByVal uFlags As NotifyFlags, _
  15.        ByVal dwItem1 As IntPtr, _
  16.        ByVal dwItem2 As IntPtr)
  17.    End Sub
  18.  
  19.    Shared Sub Notify(ByVal wEventID As EventID, ByVal uFlags As NotifyFlags, ByVal dwItem1 As IntPtr, ByVal dwItem2 As IntPtr)
  20.        SHChangeNotify(wEventID, uFlags, dwItem1, dwItem2)
  21.    End Sub
  22.  
  23.    <Flags()> _
  24.    Public Enum NotifyFlags
  25.  
  26.        ' <summary>
  27.        ' The <i>dwItem1</i> and <i>dwItem2</i> parameters are DWORD values.
  28.        ' </summary>
  29.        DWORD = &H3
  30.  
  31.        ' <summary>
  32.        ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of ItemIDList structures,
  33.        ' that represent the item(s) affected by the change.
  34.        ' Each ItemIDList must be relative to the desktop folder.
  35.        ' </summary>
  36.        ItemIDList = &H0
  37.  
  38.        ' <summary>
  39.        ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
  40.        ' of maximum length MAX_PATH that contain the full path names of the items affected by the change.
  41.        ' </summary>
  42.        PathA = &H1
  43.  
  44.        ' <summary>
  45.        ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
  46.        ' of maximum length MAX_PATH that contain the full path names of the items affected by the change.
  47.        ' </summary>
  48.        PathW = &H5
  49.  
  50.        ' <summary>
  51.        ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
  52.        ' that represent the friendly names of the printer(s) affected by the change.
  53.        ' </summary>
  54.        PrinterA = &H2
  55.  
  56.        ' <summary>
  57.        ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
  58.        ' that represent the friendly names of the printer(s) affected by the change.
  59.        ' </summary>
  60.        PrinterW = &H6
  61.  
  62.        ' <summary>
  63.        ' The function should not return until the notification has been delivered to all affected components.
  64.        ' As this flag modifies other data-type flags it cannot by used by itself.
  65.        ' </summary>
  66.        Flush = &H1000
  67.  
  68.        ' <summary>
  69.        ' The function should begin delivering notifications to all affected components,
  70.        ' but should return as soon as the notification process has begun.
  71.        ' As this flag modifies other data-type flags it cannot by used by itself.
  72.        ' </summary>
  73.        FlushNoWait = &H2000
  74.  
  75.    End Enum
  76.  
  77.    <Flags()> _
  78.    Public Enum EventID
  79.  
  80.        ' <summary>
  81.        ' All events have occurred.
  82.        ' </summary>
  83.        All_Events = &H7FFFFFFF
  84.  
  85.        ' <summary>
  86.        ' A folder has been created.
  87.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  88.        ' <i>dwItem1</i> contains the folder that was created.
  89.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  90.        ' </summary>
  91.        Directory_Created = &H8
  92.  
  93.        ' <summary>
  94.        ' A folder has been removed.
  95.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  96.        ' <i>dwItem1</i> contains the folder that was removed.
  97.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  98.        ' </summary>
  99.        Directory_Deleted = &H10
  100.  
  101.        ' <summary>
  102.        ' The name of a folder has changed.
  103.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  104.        ' <i>dwItem1</i> contains the previous pointer to an item identifier list (PIDL) or name of the folder.
  105.        ' <i>dwItem2</i> contains the new PIDL or name of the folder.
  106.        ' </summary>
  107.        Directory_Renamed = &H20000
  108.  
  109.        ' <summary>
  110.        ' A nonfolder item has been created.
  111.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  112.        ' <i>dwItem1</i> contains the item that was created.
  113.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  114.        ' </summary>
  115.        Item_Created = &H2
  116.  
  117.        ' <summary>
  118.        ' A nonfolder item has been deleted.
  119.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  120.        ' <i>dwItem1</i> contains the item that was deleted.
  121.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  122.        ' </summary>
  123.        Item_Deleted = &H4
  124.  
  125.        ' <summary>
  126.        ' The name of a nonfolder item has changed.
  127.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  128.        ' <i>dwItem1</i> contains the previous PIDL or name of the item.
  129.        ' <i>dwItem2</i> contains the new PIDL or name of the item.
  130.        ' </summary>
  131.        Item_Renamed = &H1
  132.  
  133.        ' <summary>
  134.        ' A drive has been added.
  135.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  136.        ' <i>dwItem1</i> contains the root of the drive that was added.
  137.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  138.        ' </summary>
  139.        Drive_Added = &H100
  140.  
  141.        ' <summary>
  142.        ' A drive has been added and the Shell should create a new window for the drive.
  143.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  144.        ' <i>dwItem1</i> contains the root of the drive that was added.
  145.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  146.        ' </summary>
  147.        Drive_Added_Shell = &H10000
  148.  
  149.        ' <summary>
  150.        ' A drive has been removed. <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  151.        ' <i>dwItem1</i> contains the root of the drive that was removed.
  152.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  153.        ' </summary>
  154.        Drive_Removed = &H80
  155.  
  156.        ' <summary>
  157.        ' Storage media has been inserted into a drive.
  158.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  159.        ' <i>dwItem1</i> contains the root of the drive that contains the new media.
  160.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  161.        ' </summary>
  162.        Media_Inserted = &H20
  163.  
  164.        ' <summary>
  165.        ' Storage media has been removed from a drive.
  166.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  167.        ' <i>dwItem1</i> contains the root of the drive from which the media was removed.
  168.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  169.        ' </summary>
  170.        Media_Removed = &H40
  171.  
  172.        ' <summary>
  173.        ' A folder on the local computer is being shared via the network.
  174.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  175.        ' <i>dwItem1</i> contains the folder that is being shared.
  176.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  177.        ' </summary>
  178.        Net_Shared = &H200
  179.  
  180.        ' <summary>
  181.        ' A folder on the local computer is no longer being shared via the network.
  182.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  183.        ' <i>dwItem1</i> contains the folder that is no longer being shared.
  184.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  185.        ' </summary>
  186.        Net_Unshared = &H400
  187.  
  188.        ' <summary>
  189.        ' The computer has disconnected from a server.
  190.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  191.        ' <i>dwItem1</i> contains the server from which the computer was disconnected.
  192.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  193.        ' </summary>
  194.        Server_Disconnected = &H4000
  195.  
  196.        ' <summary>
  197.        ' The attributes of an item or folder have changed.
  198.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  199.        ' <i>dwItem1</i> contains the item or folder that has changed.
  200.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  201.        ' </summary>
  202.        Attributes_Changed = &H800
  203.  
  204.        ' <summary>
  205.        ' A file type association has changed. <see cref="NotifyFlags.ItemIDList"/>
  206.        ' must be specified in the <i>uFlags</i> parameter.
  207.        ' <i>dwItem1</i> and <i>dwItem2</i> are not used and must be <see langword="null"/>.
  208.        ' </summary>
  209.        FileAssociation_Changed = &H8000000
  210.  
  211.        ' <summary>
  212.        ' The amount of free space on a drive has changed.
  213.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  214.        ' <i>dwItem1</i> contains the root of the drive on which the free space changed.
  215.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  216.        ' </summary>
  217.        Freespace_Changed = &H40000
  218.  
  219.        ' <summary>
  220.        ' The contents of an existing folder have changed but the folder still exists and has not been renamed.
  221.        ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
  222.        ' <i>dwItem1</i> contains the folder that has changed.
  223.        ' <i>dwItem2</i> is not used and should be <see langword="null"/>.
  224.        ' If a folder has been created, deleted or renamed use Directory_Created, Directory_Removed or Directory_Renamed respectively instead.
  225.        ' </summary>
  226.        Update_Directory = &H1000
  227.  
  228.        ' <summary>
  229.        ' An image in the system image list has changed.
  230.        ' <see cref="NotifyFlags.DWORD"/> must be specified in <i>uFlags</i>.
  231.        ' </summary>
  232.        Update_Image = &H8000
  233.  
  234.    End Enum
  235.  
  236. End Class
  237.  
  238. #End Region
8518  Programación / .NET (C#, VB.NET, ASP) / Re: [AYUDA] VB.NET BUSCAR EN UN DIRECTORIO Y COMPARAR EL CHEKSUM MD5 en: 20 Julio 2013, 02:17 am
Código
  1. #Region " Get Files "
  2.  
  3.    ' [ Get Files Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' For Each file In Get_Files("C:\Windows", False) : MsgBox(file.Name) : Next
  10.    '
  11.    ' For Each file In Get_Files("C:\Windows", True, "dll")   : MsgBox(file.Name) : Next
  12.    ' For Each file In Get_Files("C:\Windows", True, ".dll")  : MsgBox(file.Name) : Next
  13.    ' For Each file In Get_Files("C:\Windows", True, "*.dll") : MsgBox(file.Name) : Next
  14.    '
  15.    ' For Each file In Get_Files("C:\Windows", False, {"dll", "ini"})     : MsgBox(file.Name) : Next
  16.    ' For Each file In Get_Files("C:\Windows", False, {".dll", ".ini"})   : MsgBox(file.Name) : Next
  17.    ' For Each file In Get_Files("C:\Windows", False, {"*.dll", "*.ini"}) : MsgBox(file.Name) : Next
  18.  
  19.    ' Get Files {directory} {recursive}
  20.    Private Function Get_Files(ByVal directory As String, ByVal recursive As Boolean) As List(Of IO.FileInfo)
  21.        Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly)
  22.        Return IO.Directory.GetFiles(directory, "*", searchOpt).Select(Function(p) New IO.FileInfo(p)).ToList
  23.    End Function
  24.  
  25.    ' Get Files {directory} {recursive} {ext}
  26.    Private Function Get_Files(ByVal directory As String, ByVal recursive As Boolean, ext As String) As List(Of IO.FileInfo)
  27.  
  28.        If ext.StartsWith("*") Then
  29.            ext = ext.Substring(1, ext.Length - 1)
  30.        ElseIf Not ext = "*" AndAlso Not ext.StartsWith(".") Then
  31.            ext = ("." & ext)
  32.        ElseIf ext = "*" Then
  33.            ext = Nothing
  34.        End If
  35.  
  36.        Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly)
  37.        Return IO.Directory.GetFiles(directory, "*" & ext, searchOpt).Select(Function(p) New IO.FileInfo(p)).ToList
  38.  
  39.    End Function
  40.  
  41.    ' Get Files {directory} {recursive} {exts()}
  42.    Private Function Get_Files(ByVal directory As String, ByVal recursive As Boolean, ParamArray exts() As String) As List(Of IO.FileInfo)
  43.  
  44.        Dim FileExts(exts.Count) As String
  45.        Dim ExtCount As Int32 = 0
  46.  
  47.        For Each ext In exts
  48.            If ext.StartsWith("*") Then
  49.                FileExts(ExtCount) = ext.Substring(1, ext.Length - 1)
  50.            ElseIf Not ext = "*" AndAlso Not ext.StartsWith(".") Then
  51.                FileExts(ExtCount) = ("." & ext)
  52.            ElseIf Not ext = "*" AndAlso ext.StartsWith(".") Then
  53.                FileExts(ExtCount) = ext
  54.            ElseIf ext = "*" Then
  55.                FileExts(ExtCount) = Nothing
  56.            End If
  57.            ExtCount += 1
  58.        Next
  59.  
  60.        Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly)
  61.        Dim filenameExtComparer As New FilenameExtensionComparer
  62.        Return IO.Directory.GetFiles(directory, "*", searchOpt).Where(Function(o) FileExts.Contains(IO.Path.GetExtension(o), filenameExtComparer)).Select(Function(p) New IO.FileInfo(p)).ToList
  63.  
  64.    End Function
  65.  
  66.    ' FilenameExtensionComparer (Ignore Case) needed for "Get Files {directory} {recursive} {exts()}" overload.
  67.    Public Class FilenameExtensionComparer : Implements IEqualityComparer(Of String)
  68.  
  69.        Public Function Equals1(s As String, t As String) As Boolean Implements IEqualityComparer(Of String).Equals
  70.            Return String.Compare(s, t, StringComparison.OrdinalIgnoreCase) = 0
  71.        End Function
  72.  
  73.        Public Function GetHashCode1(s As String) As Integer Implements IEqualityComparer(Of String).GetHashCode
  74.            Return s.GetHashCode()
  75.        End Function
  76.  
  77.    End Class
  78.  
  79. #End Region


Código
  1.        #Region " Get MD5 Of File Function "
  2.  
  3.          ' [ Get MD5 Of File Function ]
  4.          '
  5.          ' Examples :
  6.          '
  7.          ' MsgBox(Get_MD5_Of_File("C:\Test.txt"))
  8.  
  9.          Private Function Get_MD5_Of_File(ByVal File As String) As String
  10.              Using MD5_Reader As New System.IO.FileStream(File, IO.FileMode.Open, IO.FileAccess.Read)
  11.                  Using MD5 As New System.Security.Cryptography.MD5CryptoServiceProvider
  12.                      Dim MD5_Byte() As Byte = MD5.ComputeHash(MD5_Reader)
  13.                      Dim MD5_Hex As New System.Text.StringBuilder(MD5.ComputeHash(MD5_Reader).Length * 2)
  14.                      For Number As Integer = 0 To MD5_Byte.Length - 1
  15.                          Application.DoEvents()
  16.                          MD5_Hex.Append(MD5_Byte(Number).ToString("X2"))
  17.                      Next
  18.                      Return MD5_Hex.ToString().ToLower
  19.                  End Using
  20.              End Using
  21.          End Function
  22.  
  23.       #End Region

...Aquí más -> Librería de Snippets !! (Posteen aquí sus snippets)
8519  Programación / .NET (C#, VB.NET, ASP) / Re: Problema al convertir Bitmap a Ico en: 19 Julio 2013, 22:12 pm
Después de hacer un largo research por Google para buscar la mejor manera de este tipo de conversión, me he dado cuenta que el formato ICO en .NET solo son problemas y es casi imposible hablar de ICO + Transparencia en las Classes del framework, y después de pelear mucho con la librería FreeImage, al final he optado por usar un wrapper de esta lib para .NET, y aquí está el code que hice de prueba, funciona:

Código
  1. Imports FreeImageAPI
  2.  
  3. 'Dim img As FreeImageAPI.FIBITMAP = FreeImage.Load(format, file, FREE_IMAGE_LOAD_FLAGS.ICO_MAKEALPHA)
  4.  
  5. Public Class Form1
  6.  
  7. Dim file As String = "C:\Users\Administrador.ELEKTRO-PC\Desktop\auricular 5.png"
  8.  
  9. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Shown
  10.  
  11.    Dim format As FreeImageAPI.FREE_IMAGE_FORMAT = FreeImage.GetFileType(file, 32)
  12.  
  13.    Dim img As FreeImageAPI.FIBITMAP = FreeImage.LoadEx(file)
  14.  
  15.    Dim Transparency As Byte() = New Byte(0) {}
  16.  
  17.    FreeImage.SetTransparencyTable(img, Transparency)
  18.  
  19.    FreeImage.Save(FREE_IMAGE_FORMAT.FIF_ICO, img, "c:\test.ico", FREE_IMAGE_SAVE_FLAGS.DEFAULT)
  20.  
  21. End Sub
  22.  
  23. End Class
8520  Foros Generales / Foro Libre / Re: Cuentanos tu mejor chiste!! en: 19 Julio 2013, 19:38 pm
Páginas: 1 ... 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 [852] 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines