|
8741
|
Programación / .NET (C#, VB.NET, ASP) / Re: Error al capturar texto de pagina web VB.NET 2008
|
en: 14 Julio 2013, 05:20 am
|
Habría sido genial que hubiesen encontrado una solución usando requests.
Aunque no he comentado nada al respecto pero la verdad es que este tema me interesa bastante y estuve probando varias cosas para conseguir resolverlo, desde permitir headers inseguros en la aplicación (activar los unsafeheaders) para corregir el problema de los headers, pero siempre se queda colgado con la url de shoutcast, también estuve indagando en dos sources de dos proyectos de Shoutcast en CodeProject, pero eran streamrippers y no obtenian la información necesaria, es más estan un poco obsoletos, Me llegué a mirar decenas de resultados en todo Google pero parece que nadie en todo el mundo tiene idea de como corregir el problema principal de los headers con la url de shoutcast, siempre se comenta los unsafeheaders, pero los unsafeheaders no sirven para este problema.
...Lo dicho, estaría muy bien que un experto en la materia diese una solución más sutil que usar un webbrowser.
@LuckyLucciano Me alegro de que lo hayas conseguido.
Saludos
|
|
|
8743
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ayuda con almacenar ruta
|
en: 13 Julio 2013, 19:03 pm
|
Un ejemplo: Public Class Form1 ReadOnly DefaultFolder As String = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Screenshots") Public FolderDialog As New FolderBrowserDialog With {.SelectedPath = DefaultFolder} Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Shown MsgBox(FolderDialog.SelectedPath) ' Esta es la ruta que quieres, al iniciar el programa. If FolderDialog.ShowDialog = Windows.Forms.DialogResult.OK Then MsgBox(FolderDialog.SelectedPath) ' Y esta es después, cuando el usuario la elige. End If ' Crear snapshot en {FolderDialog.SelectedPath} ' Sin variables de por medio. End Sub End Class
Saludos
|
|
|
8744
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ayuda con almacenar ruta
|
en: 13 Julio 2013, 18:51 pm
|
Private Sub CheckFolder_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckFolder.CheckedChanged If CheckFolder.Checked = True Then FolderBrowserDialog1.ShowDialog() LabelFolder.Text = FolderBrowserDialog1.SelectedPath() 'Aqui va la ruta de la carpeta que se selecciono Else LabelFolder. Text = Folder 'Si por algun motivo quiero usar nuevamente la carpeta "Screenshots". Pero la elimine por accidente CheckFolder.Checked = False Folder = Path. Combine(Environment. GetFolderPath(Environment. SpecialFolder. Desktop), "Screenshots") If Not Directory. Exists(Folder) Then Directory. CreateDirectory(Folder) End If End If End Sub
El problema es que en ningún caso estás asignando la carpeta seleccionada ( FolderBrowserDialog1.SelectedPath) a la variable Folder, así que la variable Folder siempre es: blablabla.Desktop & "Screenshots"¿Resuelve eso tu duda? Otra cosa (Sin importancia) a tener en cuenta en el código, es esto: CheckFolder.Checked = False
Lo explico con código: If CheckFolder.Checked = True Then bla bla bla Else ' Else, sólo puede haber una condicion contradictoria en un Boolean, y es "False", "CheckFolder.Checked = False" CheckFolder.Checked = False ' Así que esto no hace nada, porque si se procesa esta parte del bloque significa que la propiedad "Checked" ya está en "False". End If
Saludos
|
|
|
8747
|
Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets)
|
en: 13 Julio 2013, 11:41 am
|
Una class para manejar Audios en la librería NAudio. (Es algo corta, lo sé, no he experimentado más cosas que las que necesito de esta librería) #Region " NAudio " Public Class NAudio_Helper ' [ NAudio ] ' ' // By Elektro H@cker ' ' Instructions: ' 1. Add a reference for the "NAudio.dll" file into the project. ' ' Examples: ' ' Dim Stream As NAudio.Wave.WaveFileReader = New NAudio.Wave.WaveFileReader(File) ' ' Set_Volume(Stream, 0.5) ' Play_Sound(Stream, 1) ' Play_Sound(My.Resources.AudioFile) ' Play_Sound("C:\File.wav") ' Play Sound (File) Private Sub Play_Sound (ByVal File As String, _ Optional ByVal Volume As Single = Nothing) Dim Wave As New NAudio.Wave.WaveOut Select Case File. Split("."). Last. ToLower Case "aiff" Wave. Init(New NAudio. Wave. AiffFileReader(File)) Case "mp3" Wave. Init(New NAudio. Wave. Mp3FileReader(File)) Case "wav" Wave. Init(New NAudio. Wave. WaveFileReader(File)) Case Else Wave. Init(New NAudio. Wave. BlockAlignReductionStream(NAudio. Wave. WaveFormatConversionStream. CreatePcmStream(New NAudio. Wave. AudioFileReader(File)))) End Select If Not Volume = Nothing Then Wave.Volume = Volume Wave.Play() End Sub ' Play Sound (MemoryStream) Private Sub Play_Sound(ByVal Stream As IO.MemoryStream, _ Optional ByVal Volume As Single = Nothing) Dim Wave As New NAudio.Wave.WaveOut Wave.Init(New NAudio.Wave.BlockAlignReductionStream(NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(New NAudio.Wave.WaveFileReader(Stream)))) If Not Volume = Nothing Then Wave.Volume = Volume Wave.Play() End Sub ' Play Sound (Unmanaged MemoryStream) Private Sub Play_Sound(ByVal Stream As IO.UnmanagedMemoryStream, _ Optional ByVal Volume As Single = Nothing) Dim Wave As New NAudio.Wave.WaveOut Wave.Init(New NAudio.Wave.BlockAlignReductionStream(NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(New NAudio.Wave.WaveFileReader(Stream)))) If Not Volume = Nothing Then Wave.Volume = Volume Wave.Play() End Sub ' Play Sound (NAudio Stream) Private Sub Play_Sound(ByVal NAudio_Stream As Object, _ Optional ByVal Volume As Single = Nothing) Dim Wave As New NAudio.Wave.WaveOut Wave.Init(NAudio_Stream) If Not Volume = Nothing Then Wave.Volume = Volume Wave.Play() End Sub ' Set Volume (NAudio Stream) Private Function Set_Volume(ByVal NAudio_Stream As Object, ByVal Volume As Single) _ As NAudio.Wave.WaveOut Dim Wave As New NAudio.Wave.WaveOut Wave.Init(NAudio_Stream) Wave.Volume = Volume Return Wave End Function End Class #End Region
|
|
|
8750
|
Programación / Scripting / Re: QPF to Chapter file
|
en: 13 Julio 2013, 08:57 am
|
Set FSO = CreateObject("Scripting.FileSystemObject") For Each File In FSO.GetFolder(".\").Files If LCase(FSO.GetExtensionName(File.Name)) = "qpf" then Wscript.echo(File.Name) end if Next
|
|
|
|
|
|
|