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

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: 1 ... 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 [909] 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 ... 1236
9081  Programación / .NET (C#, VB.NET, ASP) / Re: [SOURCE] Post-Hardcore.ru Leecher en: 21 Mayo 2013, 16:23 pm
Nueva versión 1.1

Cambios:
- Bug corregido: no se podía modificar el nombre al archivo de salida más de 1 vez.
- Bug corregido: no se comprobaba corréctamente la conexión a internet.
- Añadido información sobre el total de urls obtenidos.
- Cambios en la interface

El enlace de descarga está en el post principal.
9082  Programación / .NET (C#, VB.NET, ASP) / [SOURCE] Post-Hardcore.ru Leecher en: 21 Mayo 2013, 01:11 am


DESCRIPCIÓN:

Una aplicación que descarga todas las urls de los últimos albums de la página Post-Hardcore.ru,
las urls se almacenan en un archivo de texto para copiarlas en Jdownloader (por ejemplo), también se pueden copiar desde el menú contextual de la aplicación.

La aplicación guarda las urls copiadas en un archivo log para no volver a descargarlas en el próximo uso de la aplicación.

PD: El estilo de música es Rock del género Post-Hardcore.

IMÁGENES (última versión):







DESCARGA:

http://ElektroStudios.tk//Post-Hardcore.ru_Leecher.zip

Incluye Source, versión portable y la versión instalable.
9083  Programación / .NET (C#, VB.NET, ASP) / Re: Cronometro regresivo en: 20 Mayo 2013, 16:19 pm
Según lo que estuvimos hablando me parece que SyntaxError404 se ha resignado a intentar hacer el programa por si mismo a pesar de la información que le hemos dado y códigos de ejemplo... pero bueno, a ver si nos sorprendes mostrando algún avanze para poder ayudarte, no es dificil.

Saludos!
9084  Programación / Programación General / Re: [Delphi] MD5 Cracker 0.1 en: 20 Mayo 2013, 15:02 pm
+1 por la interface estilo "Tron"  :xD, me gusta!

9085  Media / Multimedia / Re: Tipo de archivo de Audio en: 19 Mayo 2013, 22:17 pm
eing?

No he entendido muy bien pero por un lado estoy convencido que lo que quieres tomar como referencia son 1024 KB (1 Megabyte).

Pero por otro lado, todo eso es muy relativo Zorronde... puedes codificar con Lame en variable bitrate sin apenas calidad y usando un solo canal (Mono), y el resultado sería de +3 minutos de audio por cada 1024 kb de tamaño.

Mírate la tabla de "Technical details", eso es lo que quieres: http://en.wikipedia.org/wiki/Comparison_of_audio_formats
Para saber cuanta duración de audio para cada formato cabría en 1024 KB debes hacer la fórmula matemática (que no recuerdo como era), entre el samplerate, el bitrate, y 1 byte, si no recuerdo mal, búscala en Google.

Pero no le des muchas vueltas... para mi lo mejor en relación Calidad/Tamaño sigue siendo el MP3, si quiero calidad extrema sin importar el tamaño entonces primero me aseguro que la fuente original es de calidad extrema, y luego uso el codec FLAC.

Saludos
9086  Programación / Programación General / Re: Compilador de .bat en: 19 Mayo 2013, 18:49 pm
Un código de Batch no se puede compilar... lo que quieres es un "convertidor".

Primero crea un proyecto compilando un .exe que será el encargado de lanzar el bat que haya en el directorio de trabajo actual.
Por otro lado crea otro proyecto, el exe del primer proyecto como recurso, y el archivo bat que desees, compilas y listo, ya tienes tu bat "compilado".

Aquí tienes un proyecto en VB.NET, lo he inspeccionado con .NET Reflector y como me imaginaba el recurso embedido "mytemp.exe" hace exáctamente lo que te expliqué, "mytemp.exe" lo único que hace es ejecutar el proceso "CMD.exe" con el archivo bat.
http://tech.reboot.pro/showthread.php?tid=1083

Saludos.
9087  Media / Multimedia / Re: alguien podria ayudarme? en: 19 Mayo 2013, 00:32 am
@marrison
Ya que pides cosas con todo el morro, al menos léete las normas sobre los títulos prohibidos ("¿me ayudan?"), para la próxima vez.

Saludos
9088  Programación / .NET (C#, VB.NET, ASP) / Re: [SOURCE] Splat en: 18 Mayo 2013, 13:17 pm
La versión que compartí tenía un error grave con la transparencia.

En el post principal pueden descargar la nueva versión.

Citar
     
  • Cambios v1.1:
     - Bug correjido: La imagen no se centra en la pantalla después de redimensionarla.
     - Bug correjido: La transparencia de la aplicación afecta a la imagen mostrada (la imagen pierde ciertos colores).
     - Añadida compatibilidad 100% con imágenes PNG/ICO transparentes y con sombras.
     - Añadido los parámetros "/Ontop" y "/Clickable".
     - Añadido un icono a la aplicación.
     - Pequeñas optimizaciones de código para cargar más rápido.
     - Erratas de texto correjidas en la sección de ayuda de la aplicación.

     
  • Cosas por hacer:
     Añadir compatibilidad con los efectos FadeIn/FadeOUT para imágenes PNG/ICO.
     Añadir Más efectos especiales.
9089  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 18 Mayo 2013, 12:48 pm
Un ColorDialog "por defecto" que tiene las propiedades "Title" y "Location",
Además se puede handlear el color que hay seleccionado en cualquier momento en el modo "Full open", para obtener el color sin tener que confirmar el diálogo.

PD: Hay que instanciarlo siempre para handlear el .Currentcolor

Ejemplos de uso:

Código
  1. Public Class Form1
  2.  
  3.     Private WithEvents PicBox As New PictureBox
  4.     Private WithEvents ColorDlg As ColorDialog_RealTime.Colordialog_Realtime = Nothing
  5.  
  6.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  7.         PicBox.BackColor = Color.Blue
  8.         Me.Controls.Add(PicBox)
  9.     End Sub
  10.  
  11.     Private Sub PicBox_Click(sender As Object, e As EventArgs) Handles PicBox.Click
  12.         ColorDlg = New ColorDialog_RealTime.Colordialog_Realtime
  13.         ColorDlg.Title = "Hello!"
  14.         ColorDlg.Location = New Point(Me.Right, Me.Top)
  15.         ColorDlg.Color = sender.backcolor
  16.         If ColorDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
  17.             sender.BackColor = ColorDlg.Color
  18.         End If
  19.         ColorDlg = Nothing
  20.     End Sub
  21.  
  22.     Private Sub ColorDlg_CurrentColor(c As System.Drawing.Color) Handles ColorDlg.CurrentColor
  23.         PicBox.BackColor = c
  24.     End Sub
  25.  
  26. End Class


Código
  1. Public Class Colordialog_Realtime
  2.    Inherits ColorDialog
  3.  
  4.    Public Event CurrentColor(ByVal c As Color)
  5.  
  6.    Private Const GA_ROOT As Integer = 2
  7.    Private Const WM_PAINT As Integer = &HF
  8.    Private Const WM_CTLCOLOREDIT As Integer = &H133
  9.  
  10.    Public Declare Function GetAncestor Lib "user32.dll" _
  11.        (ByVal hWnd As IntPtr, ByVal gaFlags As Integer) As IntPtr
  12.  
  13.    Private EditWindows As List(Of ApiWindow) = Nothing
  14.  
  15.    Public Sub New()
  16.        Me.FullOpen = True
  17.    End Sub
  18.  
  19.    <Runtime.InteropServices.DllImport("user32.dll")> _
  20.    Private Shared Function SetWindowText(hWnd As IntPtr, lpString As String) As Boolean
  21.    End Function
  22.  
  23.    Private Const SWP_NOSIZE As Integer = &H1
  24.    Private Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" _
  25.        (ByVal hwnd As IntPtr, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
  26.  
  27.    Private m_title As String = String.Empty
  28.    Private titleSet As Boolean = False
  29.  
  30.    Public Property Title() As String
  31.        Get
  32.            Return m_title
  33.        End Get
  34.        Set(value As String)
  35.            If value IsNot Nothing AndAlso value <> m_title Then
  36.                m_title = value
  37.                titleSet = False
  38.            End If
  39.        End Set
  40.    End Property
  41.  
  42.    Private m_location As Point = Point.Empty
  43.    Private locationSet As Boolean = False
  44.  
  45.    Public Property Location() As Point
  46.        Get
  47.            Return m_location
  48.        End Get
  49.        Set(value As Point)
  50.            If Not value.Equals(Point.Empty) AndAlso Not value.Equals(m_location) Then
  51.                m_location = value
  52.                locationSet = False
  53.            End If
  54.        End Set
  55.    End Property
  56.  
  57.    <System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
  58.    Protected Overrides Function HookProc(ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
  59.        Select Case msg
  60.            Case WM_PAINT
  61.                If Not titleSet AndAlso Title <> String.Empty Then
  62.                    SetWindowText(GetAncestor(hWnd, GA_ROOT), Title)
  63.                    titleSet = True
  64.                End If
  65.                If Not locationSet AndAlso Not m_location.Equals(Point.Empty) Then
  66.                    SetWindowPos(GetAncestor(hWnd, GA_ROOT), 0, m_location.X, m_location.Y, 0, 0, SWP_NOSIZE)
  67.                    locationSet = True
  68.                End If
  69.  
  70.            Case WM_CTLCOLOREDIT
  71.                If IsNothing(EditWindows) Then
  72.                    Dim mainWindow As IntPtr = GetAncestor(hWnd, GA_ROOT)
  73.                    If Not mainWindow.Equals(IntPtr.Zero) Then
  74.                        EditWindows = New List(Of ApiWindow)((New WindowsEnumerator).GetChildWindows(mainWindow, "Edit"))
  75.                    End If
  76.                End If
  77.  
  78.                If Not IsNothing(EditWindows) AndAlso EditWindows.Count = 6 Then
  79.                    Dim strRed As String = WindowsEnumerator.WindowText(EditWindows(3).hWnd)
  80.                    Dim strGreen As String = WindowsEnumerator.WindowText(EditWindows(4).hWnd)
  81.                    Dim strBlue As String = WindowsEnumerator.WindowText(EditWindows(5).hWnd)
  82.  
  83.                    Dim Red, Green, Blue As Integer
  84.                    If Integer.TryParse(strRed, Red) Then
  85.                        If Integer.TryParse(strGreen, Green) Then
  86.                            If Integer.TryParse(strBlue, Blue) Then
  87.                                RaiseEvent CurrentColor(Color.FromArgb(Red, Green, Blue))
  88.                            End If
  89.                        End If
  90.                    End If
  91.                End If
  92.        End Select
  93.  
  94.        Return MyBase.HookProc(hWnd, msg, wParam, lParam)
  95.    End Function
  96.  
  97. End Class
  98.  
  99. Class ApiWindow
  100.    Public hWnd As IntPtr
  101.    Public ClassName As String
  102.    Public MainWindowTitle As String
  103. End Class
  104.  
  105. Class WindowsEnumerator
  106.  
  107.    Private Delegate Function EnumCallBackDelegate(ByVal hwnd As IntPtr, ByVal lParam As Integer) As Integer
  108.  
  109.    Private Declare Function EnumWindows Lib "user32" _
  110.        (ByVal lpEnumFunc As EnumCallBackDelegate, ByVal lParam As Integer) As Integer
  111.  
  112.    Private Declare Function EnumChildWindows Lib "user32" _
  113.        (ByVal hWndParent As IntPtr, ByVal lpEnumFunc As EnumCallBackDelegate, ByVal lParam As Integer) As Integer
  114.  
  115.    Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
  116.        (ByVal hwnd As IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
  117.  
  118.    Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As IntPtr) As Integer
  119.  
  120.    Private Declare Function GetParent Lib "user32" (ByVal hwnd As IntPtr) As Integer
  121.  
  122.    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
  123.        (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
  124.  
  125.    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
  126.        (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As System.Text.StringBuilder) As Integer
  127.  
  128.    Private _listChildren As New List(Of ApiWindow)
  129.    Private _listTopLevel As New List(Of ApiWindow)
  130.  
  131.    Private _topLevelClass As String = String.Empty
  132.    Private _childClass As String = String.Empty
  133.  
  134.    Public Overloads Function GetTopLevelWindows() As ApiWindow()
  135.        EnumWindows(AddressOf EnumWindowProc, &H0)
  136.        Return _listTopLevel.ToArray
  137.    End Function
  138.  
  139.    Public Overloads Function GetTopLevelWindows(ByVal className As String) As ApiWindow()
  140.        _topLevelClass = className
  141.        Return Me.GetTopLevelWindows()
  142.    End Function
  143.  
  144.    Public Overloads Function GetChildWindows(ByVal hwnd As Int32) As ApiWindow()
  145.        _listChildren.Clear()
  146.        EnumChildWindows(hwnd, AddressOf EnumChildWindowProc, &H0)
  147.        Return _listChildren.ToArray
  148.    End Function
  149.  
  150.    Public Overloads Function GetChildWindows(ByVal hwnd As Int32, ByVal childClass As String) As ApiWindow()
  151.        _childClass = childClass
  152.        Return Me.GetChildWindows(hwnd)
  153.    End Function
  154.  
  155.    Private Function EnumWindowProc(ByVal hwnd As Int32, ByVal lParam As Int32) As Int32
  156.        If GetParent(hwnd) = 0 AndAlso IsWindowVisible(hwnd) Then
  157.            Dim window As ApiWindow = GetWindowIdentification(hwnd)
  158.            If _topLevelClass.Length = 0 OrElse window.ClassName.ToLower() = _topLevelClass.ToLower() Then
  159.                _listTopLevel.Add(window)
  160.            End If
  161.        End If
  162.        Return 1
  163.    End Function
  164.  
  165.    Private Function EnumChildWindowProc(ByVal hwnd As Int32, ByVal lParam As Int32) As Int32
  166.        Dim window As ApiWindow = GetWindowIdentification(hwnd)
  167.        If _childClass.Length = 0 OrElse window.ClassName.ToLower() = _childClass.ToLower() Then
  168.            _listChildren.Add(window)
  169.        End If
  170.        Return 1
  171.    End Function
  172.  
  173.    Private Function GetWindowIdentification(ByVal hwnd As Integer) As ApiWindow
  174.        Dim classBuilder As New System.Text.StringBuilder(64)
  175.        GetClassName(hwnd, classBuilder, 64)
  176.  
  177.        Dim window As New ApiWindow
  178.        window.ClassName = classBuilder.ToString()
  179.        window.MainWindowTitle = WindowText(hwnd)
  180.        window.hWnd = hwnd
  181.        Return window
  182.    End Function
  183.  
  184.    Public Shared Function WindowText(ByVal hwnd As IntPtr) As String
  185.        Const W_GETTEXT As Integer = &HD
  186.        Const W_GETTEXTLENGTH As Integer = &HE
  187.  
  188.        Dim SB As New System.Text.StringBuilder
  189.        Dim length As Integer = SendMessage(hwnd, W_GETTEXTLENGTH, 0, 0)
  190.        If length > 0 Then
  191.            SB = New System.Text.StringBuilder(length + 1)
  192.            SendMessage(hwnd, W_GETTEXT, SB.Capacity, SB)
  193.        End If
  194.        Return SB.ToString
  195.    End Function
  196.  
  197. End Class
9090  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 18 Mayo 2013, 12:28 pm
Reproducir, pausar, detener archivos MP3/WAV/MIDI

Código
  1.    ' PlayFile
  2.    '
  3.    ' Examples:
  4.    ' Dim Audio As New PlayFile("C:\File.mp3")
  5.    ' Audio.Play()
  6.    ' Audio.Pause()
  7.    ' Audio.Resume()
  8.    ' Audio.Stop()
  9.  
  10. #Region " PlayFile Class"
  11.  
  12. ''' <summary>
  13. ''' This class is a wrapper for the Windows API calls to play wave, midi or mp3 files.
  14. ''' </summary>
  15. ''' <remarks>
  16. ''' </remarks>
  17. Public Class PlayFile
  18.    '***********************************************************************************************************
  19.    '        Class:  PlayFile
  20.    '   Written By:  Blake Pell (bpell@indiana.edu)
  21.    ' Initial Date:  03/31/2007
  22.    ' Last Updated:  02/04/2009
  23.    '***********************************************************************************************************
  24.  
  25.    ' Windows API Declarations
  26.    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Int32, ByVal hwndCallback As Int32) As Int32
  27.  
  28.    ''' <summary>
  29.    ''' Constructor:  Location is the filename of the media to play.  Wave files and Mp3 files are the supported formats.
  30.    ''' </summary>
  31.    ''' <param name="Location"></param>
  32.    ''' <remarks></remarks>
  33.    Public Sub New(ByVal location As String)
  34.        Me.Filename = location
  35.    End Sub
  36.  
  37.    ''' <summary>
  38.    ''' Plays the file that is specified as the filename.
  39.    ''' </summary>
  40.    ''' <remarks></remarks>
  41.    Public Sub Play()
  42.  
  43.        If _filename = "" Or Filename.Length <= 4 Then Exit Sub
  44.  
  45.        Select Case Right(Filename, 3).ToLower
  46.            Case "mp3"
  47.                mciSendString("open """ & _filename & """ type mpegvideo alias audiofile", Nothing, 0, IntPtr.Zero)
  48.  
  49.                Dim playCommand As String = "play audiofile from 0"
  50.  
  51.                If _wait = True Then playCommand += " wait"
  52.  
  53.                mciSendString(playCommand, Nothing, 0, IntPtr.Zero)
  54.            Case "wav"
  55.                mciSendString("open """ & _filename & """ type waveaudio alias audiofile", Nothing, 0, IntPtr.Zero)
  56.                mciSendString("play audiofile from 0", Nothing, 0, IntPtr.Zero)
  57.            Case "mid", "idi"
  58.                mciSendString("stop midi", "", 0, 0)
  59.                mciSendString("close midi", "", 0, 0)
  60.                mciSendString("open sequencer!" & _filename & " alias midi", "", 0, 0)
  61.                mciSendString("play midi", "", 0, 0)
  62.            Case Else
  63.                Throw New Exception("File type not supported.")
  64.                Call Close()
  65.        End Select
  66.  
  67.        IsPaused = False
  68.  
  69.    End Sub
  70.  
  71.    ''' <summary>
  72.    ''' Pause the current play back.
  73.    ''' </summary>
  74.    ''' <remarks></remarks>
  75.    Public Sub Pause()
  76.        mciSendString("pause audiofile", Nothing, 0, IntPtr.Zero)
  77.        IsPaused = True
  78.    End Sub
  79.  
  80.    ''' <summary>
  81.    ''' Resume the current play back if it is currently paused.
  82.    ''' </summary>
  83.    ''' <remarks></remarks>
  84.    Public Sub [Resume]()
  85.        mciSendString("resume audiofile", Nothing, 0, IntPtr.Zero)
  86.        IsPaused = False
  87.    End Sub
  88.  
  89.    ''' <summary>
  90.    ''' Stop the current file if it's playing.
  91.    ''' </summary>
  92.    ''' <remarks></remarks>
  93.    Public Sub [Stop]()
  94.        mciSendString("stop audiofile", Nothing, 0, IntPtr.Zero)
  95.    End Sub
  96.  
  97.    ''' <summary>
  98.    ''' Close the file.
  99.    ''' </summary>
  100.    ''' <remarks></remarks>
  101.    Public Sub Close()
  102.        mciSendString("close audiofile", Nothing, 0, IntPtr.Zero)
  103.    End Sub
  104.  
  105.    Private _wait As Boolean = False
  106.    ''' <summary>
  107.    ''' Halt the program until the .wav file is done playing.  Be careful, this will lock the entire program up until the
  108.    ''' file is done playing.  It behaves as if the Windows Sleep API is called while the file is playing (and maybe it is, I don't
  109.    ''' actually know, I'm just theorizing).  :P
  110.    ''' </summary>
  111.    ''' <value></value>
  112.    ''' <returns></returns>
  113.    ''' <remarks></remarks>
  114.    Public Property Wait() As Boolean
  115.        Get
  116.            Return _wait
  117.        End Get
  118.        Set(ByVal value As Boolean)
  119.            _wait = value
  120.        End Set
  121.    End Property
  122.  
  123.    ''' <summary>
  124.    ''' Sets the audio file's time format via the mciSendString API.
  125.    ''' </summary>
  126.    ''' <value></value>
  127.    ''' <returns></returns>
  128.    ''' <remarks></remarks>
  129.    ReadOnly Property Milleseconds() As Integer
  130.        Get
  131.            Dim buf As String = Space(255)
  132.            mciSendString("set audiofile time format milliseconds", Nothing, 0, IntPtr.Zero)
  133.            mciSendString("status audiofile length", buf, 255, IntPtr.Zero)
  134.  
  135.            buf = Replace(buf, Chr(0), "") ' Get rid of the nulls, they muck things up
  136.  
  137.            If buf = "" Then
  138.                Return 0
  139.            Else
  140.                Return CInt(buf)
  141.            End If
  142.        End Get
  143.    End Property
  144.  
  145.    ''' <summary>
  146.    ''' Gets the status of the current playback file via the mciSendString API.
  147.    ''' </summary>
  148.    ''' <value></value>
  149.    ''' <returns></returns>
  150.    ''' <remarks></remarks>
  151.    ReadOnly Property Status() As String
  152.        Get
  153.            Dim buf As String = Space(255)
  154.            mciSendString("status audiofile mode", buf, 255, IntPtr.Zero)
  155.            buf = Replace(buf, Chr(0), "")  ' Get rid of the nulls, they muck things up
  156.            Return buf
  157.        End Get
  158.    End Property
  159.  
  160.    ''' <summary>
  161.    ''' Gets the file size of the current audio file.
  162.    ''' </summary>
  163.    ''' <value></value>
  164.    ''' <returns></returns>
  165.    ''' <remarks></remarks>
  166.    ReadOnly Property FileSize() As Integer
  167.        Get
  168.            Try
  169.                Return My.Computer.FileSystem.GetFileInfo(_filename).Length
  170.            Catch ex As Exception
  171.                Return 0
  172.            End Try
  173.        End Get
  174.    End Property
  175.  
  176.    ''' <summary>
  177.    ''' Gets the channels of the file via the mciSendString API.
  178.    ''' </summary>
  179.    ''' <value></value>
  180.    ''' <returns></returns>
  181.    ''' <remarks></remarks>
  182.    ReadOnly Property Channels() As Integer
  183.        Get
  184.            Dim buf As String = Space(255)
  185.            mciSendString("status audiofile channels", buf, 255, IntPtr.Zero)
  186.  
  187.            If IsNumeric(buf) = True Then
  188.                Return CInt(buf)
  189.            Else
  190.                Return -1
  191.            End If
  192.        End Get
  193.    End Property
  194.  
  195.    ''' <summary>
  196.    ''' Used for debugging purposes.
  197.    ''' </summary>
  198.    ''' <value></value>
  199.    ''' <returns></returns>
  200.    ''' <remarks></remarks>
  201.    ReadOnly Property Debug() As String
  202.        Get
  203.            Dim buf As String = Space(255)
  204.            mciSendString("status audiofile channels", buf, 255, IntPtr.Zero)
  205.  
  206.            Return Str(buf)
  207.        End Get
  208.    End Property
  209.  
  210.    Private _isPaused As Boolean = False
  211.    ''' <summary>
  212.    ''' Whether or not the current playback is paused.
  213.    ''' </summary>
  214.    ''' <value></value>
  215.    ''' <returns></returns>
  216.    ''' <remarks></remarks>
  217.    Public Property IsPaused() As Boolean
  218.        Get
  219.            Return _isPaused
  220.        End Get
  221.        Set(ByVal value As Boolean)
  222.            _isPaused = value
  223.        End Set
  224.    End Property
  225.  
  226.    Private _filename As String
  227.    ''' <summary>
  228.    ''' The current filename of the file that is to be played back.
  229.    ''' </summary>
  230.    ''' <value></value>
  231.    ''' <returns></returns>
  232.    ''' <remarks></remarks>
  233.    Public Property Filename() As String
  234.        Get
  235.            Return _filename
  236.        End Get
  237.        Set(ByVal value As String)
  238.  
  239.            If My.Computer.FileSystem.FileExists(value) = False Then
  240.                Throw New System.IO.FileNotFoundException
  241.                Exit Property
  242.            End If
  243.  
  244.            _filename = value
  245.        End Set
  246.    End Property
  247. End Class
  248.  
  249. #End Region




Ejemplos de uso del Windows Media Player control:

Código
  1. #Region " Windows Media Player "
  2.  
  3.        AxWindowsMediaPlayer1.Visible = False
  4.        AxWindowsMediaPlayer1.URL = "C:\Audio.mp3"
  5.        AxWindowsMediaPlayer1.URL = "C:\Video.avi"
  6.        AxWindowsMediaPlayer1.settings.volume = 50
  7.        AxWindowsMediaPlayer1.settings.setMode("autoRewind", False) ' Mode indicating whether the tracks are rewound to the beginning after playing to the end. Default state is true.
  8.        AxWindowsMediaPlayer1.settings.setMode("loop", False) ' Mode indicating whether the sequence of tracks repeats itself. Default state is false.
  9.        AxWindowsMediaPlayer1.settings.setMode("showFrame", False) ' Mode indicating whether the nearest video key frame is displayed at the current position when not playing. Default state is false. Has no effect on audio tracks.
  10.        AxWindowsMediaPlayer1.settings.setMode("shuffle", False) ' Mode indicating whether the tracks are played in random order. Default state is false.
  11.        AxWindowsMediaPlayer1.Ctlcontrols.play()
  12.        AxWindowsMediaPlayer1.Ctlcontrols.stop()
  13.  
  14. #End Region
Páginas: 1 ... 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 [909] 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines