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


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


  Mostrar Temas
Páginas: 1 ... 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 [86] 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ... 107
851  Programación / .NET (C#, VB.NET, ASP) / (SOLUCIONADO) Como agarrar el error-output de un proceso? en: 27 Noviembre 2012, 09:52 am
Hola,

Necesito agarrar el error output de la CMD en este código, pero no sé como hacerlo, solo me agarra el output standard. ¿Me pueden indicar como se hace?

Muchas gracias!

PD: Ya sé que es una mala práctica usar comandos externos, pero no encuentro ninguna librería que sirva para buscar metadataos Y A LA VEZ convertir videos, eso es dificil, estoy aprendiendo!


Código
  1.                If metadata = True Then
  2.                    Dim ffmpeg_process As New Process()
  3.                    Dim ffmpeg_startinfo As New ProcessStartInfo()
  4.                    ffmpeg_startinfo.FileName = "cmd.exe "
  5.                    ffmpeg_startinfo.UseShellExecute = False
  6.                    ffmpeg_startinfo.CreateNoWindow = False
  7.                    ffmpeg_startinfo.Arguments = "/C ffmpeg.exe -y -i " & ControlChars.Quote & aFile.FullName.ToString() & ControlChars.Quote & " -f ffmetadata " & ControlChars.Quote & "%TEMP%\" & aFile.Name.ToString() & "_metadata.txt" & ControlChars.Quote & " >NUL 2>&1 && Type " & ControlChars.Quote & "%TEMP%\" & aFile.Name.ToString() & "_metadata.txt" & ControlChars.Quote & "| FINDSTR /I " & ControlChars.Quote & "^INAM ^title" & ControlChars.Quote
  8.                    ffmpeg_startinfo.RedirectStandardOutput = True
  9.                    ffmpeg_process.EnableRaisingEvents = True
  10.                    ffmpeg_process.StartInfo = ffmpeg_startinfo
  11.                    ffmpeg_process.Start()
  12.                    Dim readerStdOut As IO.StreamReader = ffmpeg_process.StandardOutput
  13.                    Do While readerStdOut.EndOfStream = False
  14.                        consolebox.AppendText(readerStdOut.ReadLine() + vbNewLine)
  15.                        consolebox.SelectionStart = consolebox.Text.Length
  16.                        consolebox.ScrollToCaret()
  17.                    Loop
  18.                End If
852  Programación / .NET (C#, VB.NET, ASP) / Como puedo crear este thread? en: 26 Noviembre 2012, 12:44 pm
Hola,

A ver, tengo un richtextbox que "printa" información hasta finalizar el búcle FOR

Lo que pasa es que mi form se cuelga, no puedo tocar NADA,
Lo que necesito es poder detener (detener del todo) el proceso o mantenerlo en espera (Pause) mediante un botón, o un evento de teclado, o las dos cosas!, pero preferiblemente un botón que esté destinado a pausar el proceso, y otro botón destinado a detener el proceso por completo.

¿Alguien me puede indicar como hacerlo porfavor? No lo quiero hecho, quiero aprender a hacerlo pero no se por donde buscar!

Muchas gracias.



Código
  1.    Public Sub MediaInfoWorkWithFilesInDir(ByVal aDir As DirectoryInfo)
  2.  
  3.        Dim aFile As FileInfo
  4.        For Each aFile In aDir.GetFiles()
  5.            If accepted_extensions.ToLower.Contains(aFile.Extension.ToLower) Then
  6.  
  7.                MI.Open(aFile.FullName)
  8.  
  9.                Dim Pos As Integer = 0
  10.                To_Display = Nothing
  11.                While Pos < MI.Count_Get(StreamKind.Audio)
  12.                    To_Display += "| " + MI.Get_(StreamKind.Audio, Pos, "Format")
  13.                    System.Math.Max(System.Threading.Interlocked.Increment(Pos), Pos - 1)
  14.                End While
  15.  
  16.                consolebox.AppendText("Processing: " + aFile.ToString() + To_Display.ToString() + vbNewLine)
  17.                consolebox.SelectionStart = consolebox.Text.Length
  18.                consolebox.ScrollToCaret()
  19.  
  20.            End If
  21.        Next
  22.    End Sub
  23.  
853  Programación / .NET (C#, VB.NET, ASP) / (SOLUCIONADO) Se puede mejorar este FOR? en: 26 Noviembre 2012, 10:15 am
Hola,

Mi app trabaja sobre MILES de archivos y quisiera saber si puedo mejorar este for para disminuir el tiempo de procesado:

Código
  1.  
  2. Dim accepted_extensions As String = ".264 .3gp .asf .asx .avi .avc .bsf .bdmv .divx .dv .evo .f4v .flv .hdmov .m1v .m2t .m2ts .m2v .m4v .mkv .mov .mp4 .mpeg .mpg .mpv4 .mts .ogm .ogv .qt .rmvb .swf .ts .vob .webm .wmv"
  3.  
  4.    Public Sub PlaylistsWorkWithFilesInDir(ByVal aDir As DirectoryInfo)
  5.        consolebox.AppendText("Processing: " + aDir.ToString() + vbNewLine)
  6.        consolebox.SelectionStart = consolebox.Text.Length
  7.        consolebox.ScrollToCaret()
  8.        Dim aFile As FileInfo
  9.        For Each aFile In aDir.GetFiles()
  10.            If accepted_extensions.ToLower.Contains(aFile.Extension.ToLower) Then
  11.                Using writer As StreamWriter = New StreamWriter(aFile.DirectoryName.ToString() & "\" & aDir.Name & ".m3u", True, System.Text.Encoding.UTF8)
  12.                    writer.WriteLine(aFile.FullName.ToString())
  13.                End Using
  14.            End If
  15.        Next
  16.    End Sub
  17.  

Me pregunto si existirá algún método en el sistema para comprobar si el archivo es un archivo de video, algo así:
Código:
If IO.FileType(aFile) = "VideoFile" Then...
854  Programación / .NET (C#, VB.NET, ASP) / (SOLUCIONADO) Mostrar el output de la CMD en: 25 Noviembre 2012, 20:05 pm
Hola,

Tengo una pregunta antes de la verdadera pregunta xD

¿Que control es el más adecuado para mostrar el output de la CMD?  (Estoy usando un richtextbox)

Y bueno, el problema es que no consigo que el texto cambie antes d emostrar el output:
Código
  1. Me.consolebox.Text = "Deleting the attributes of the files..."

Todo lo demás funciona bien, pero no consigo mostrar ese string, se queda el richtextbox vacío hasta que finaliza el búcle...

Código
  1.   Private Function attrib() As Boolean
  2.        Me.consolebox.Text = "Deleting the attributes of the files..."
  3.        Dim attrib_process As New Process()
  4.        Dim attrib_startinfo As New ProcessStartInfo()
  5.        Dim attrib_args As String = videofolder
  6.        attrib_startinfo.FileName = "cmd.exe "
  7.        attrib_startinfo.UseShellExecute = False
  8.        attrib_startinfo.CreateNoWindow = True
  9.        attrib_startinfo.Arguments = "/C PUSHD " & ControlChars.Quote & videofolder & ControlChars.Quote & " & Attrib -A -R -S -H -I /S *.* & attrib +H /S *.ico >nul & attrib +H -R /S *.ini >nul"
  10.        attrib_startinfo.RedirectStandardOutput = True
  11.        attrib_process.EnableRaisingEvents = True
  12.        attrib_process.StartInfo = attrib_startinfo
  13.        attrib_process.Start()
  14.        Dim readerStdOut As IO.StreamReader = attrib_process.StandardOutput
  15.        Do While readerStdOut.EndOfStream = False
  16.            output = output + readerStdOut.ReadLine()
  17.        Loop
  18.        Me.consolebox.Text = "This is the result of the command:" + output
  19.    End Function

¿Y si necesito usar un comando de múltiples líneas como le hago?

por ejemplo:
Código
  1. attrib_startinfo.Arguments = "/C
  2. Echo linea 1 &
  3. (Echo linea2
  4. Echo linea 3)
  5. "
855  Sistemas Operativos / Windows / Firefox - Script seamonkey para desmarcar checkbox en una página? en: 25 Noviembre 2012, 11:35 am
MOD: Perdón, tuve un error, juraría que posteé esto en dudas generales, si me lo pudieran mover allá...




Hola,

Como navegador uso Firefox

Y actualmente yo no uso seamonkey, uso una extensión que se llama "customizeyourweb" https://addons.mozilla.org/en-us/firefox/addon/customize-your-web/

Me gustaría saber si en este tipo de extensiones parecidas al seamonkey hay alguna forma de desmarcar una casilla en una página web que siempre aparece la casilla marcada.

Gracias.
856  Programación / .NET (C#, VB.NET, ASP) / Ayuda para corregir error visual redrawing effect en mi form en: 24 Noviembre 2012, 09:41 am
Como reproducir este error?

1. Crear un nuevo winform

2. Seleccionar una imagen de fondo para el form

3. Añadir un panel

4. Cambiar la spropiedades del panel a "Color=Transparent", "AutoScroll=True", y añadr unos cuantos controles dentro del panel.

Ejemplo:




5. Ahora scrollear arriba o abajo y...








¿Como corregir este error?

Yo: He probado todo lo que me han aconsejado expertos, y sigo sin tener idea.

El método de Invalidate o Refresh soamente disimulan el problema real y crean otro problema, porque se "flashea" el panel todo el rato si scrolleamos.

Una solución sería crear una vScrollbar para mi panel, y cambiar el mínimo de scroll-lines al usar la mouse-wheel, por ejemplo scrollear 15 lineas en vez de las 6 por defecto, ya que si scrolleo una página entera no tengo ningún problema visual. Pero esto no se hacerlo por mi mismo, si alguien me pudiera dar un ejemplo se lo agradecería mucho, pues con esto ya podría terminar mi app.





Más información:

(Supuestas soluciones que a mi no me han servido del todo, quizás no he sabido usarlas correctamente)

http://stackoverflow.com/questions/13516557/visual-problems-with-the-form-background-image
http://stackoverflow.com/questions/13535693/change-mouse-wheel-scroll-lines
http://www.daniweb.com/software-development/vbnet/threads/441204/how-to-correct-a-redrawing-background-cutted-effect-inside-a-panel
http://www.vbdotnetforums.com/vb-net-general-discussion/54165-how-correct-redrawing-background-cutted-effect-inside-panel.html#post153014
857  Programación / .NET (C#, VB.NET, ASP) / Una pregunta sobre el autoscroll de un panel en: 23 Noviembre 2012, 19:39 pm
Si por ejemplo mantengo apretado click en el scrollbar y voy bajando el scrollbar con el mouse, ¿Como se hace para que baje progresivamente el panel al ritmo del mouse?

Espero que hayan entendido la pregunta xD
858  Programación / .NET (C#, VB.NET, ASP) / (SOLUCIONADO) Adjuntar DLL dentro del Executable? en: 23 Noviembre 2012, 15:43 pm
Estoy siguiendo estos pasos:


Citar
   Add the desired assembly (stdlib.dll) to the project's resources.
    Go to the Resources tab of the Project Properties and choose Add Resource > Add Existing File...
    Switch to the Application tab and click on the View Application Events button.

    Add this code to the ApplicationEvents.vb code that opens.

Código
  1.    Private Sub AppStart(ByVal sender As Object,
  2.      ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
  3.        AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf ResolveAssemblies
  4.    End Sub
  5.  
  6.    Private Function ResolveAssemblies(sender As Object, e As System.ResolveEventArgs) As Reflection.Assembly
  7.        Dim desiredAssembly = New Reflection.AssemblyName(e.Name)
  8.  
  9.        If desiredAssembly.Name = "the name of your assembly" Then
  10.            Return Reflection.Assembly.Load(My.Resources.STDLIB) 'replace with your assembly's resource name
  11.        Else
  12.            Return Nothing
  13.        End If
  14.    End Function
  15.  
   Now compile your project and you'll have the dependent assembly incorporated into the output as a single file.

El problema es que lo he hecho todo, pero me da error el "applicationEvents.vb"

Código:
Error	1	Statement is not valid in a namespace.	C:\Users\Administrador\Desktop\WindowsApplication19 - copia - copia\ApplicationEvents.vb	1	1	WindowsApplication19


Mi ApplicationEvents estaba vacío al abrirlo, no se si ese puede ser el error, quizás me falta algo, solo tengo esto :

Código
  1. Private Sub AppStart(ByVal sender As Object,
  2.  ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
  3.    AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf ResolveAssemblies
  4. End Sub
  5.  
  6. Private Function ResolveAssemblies(sender As Object, e As System.ResolveEventArgs) As Reflection.Assembly
  7.    Dim desiredAssembly = New Reflection.AssemblyName(e.Name)
  8.  
  9.    If desiredAssembly.Name = "Ookii.Dialogs.dll" Then
  10.        Return Reflection.Assembly.Load(My.Resources.Ookii.Dialogs) 'replace with your assembly's resource name
  11.    Else
  12.        Return Nothing
  13.    End If
  14. End Function
859  Programación / .NET (C#, VB.NET, ASP) / (SOLUCIONADO) Como usar un string en la propiedad ROOTFOLDER de un dialogo? en: 23 Noviembre 2012, 14:37 pm
Hola,

Lo que necesito es usar un string, por ejemplo "C:\Carpeta" en la propiedad .RootFolder del FolderBrowserDialog, que usa una enumeración.

He intentado crear mi propia enumeración, pero no lo consigo... algo estaré haciendo mal:

Código
  1. Enum lastfolder
  2.    last = "C:\carpeta"
  3. End Enum

Código
  1.    Public Sub C1Button3_Click(sender As Object, e As EventArgs) Handles folderbutton.Click
  2.        Dim folderselect As New VistaFolderBrowserDialog
  3.        folderselect.RootFolder = lastfolder.last
  4.        folderselect.ShowNewFolderButton = True
  5. ...
  6.    End Sub
860  Programación / .NET (C#, VB.NET, ASP) / (Solucionado) Problema visual con la imagen de fondo del form... en: 22 Noviembre 2012, 17:05 pm
¿Porque pasa esto?


Este es el diseño de la app:



Y esto es lo que sucede si muevo el scroll hacia abajo (o hacia arriba)



La imagen de fondo la usa el form, el panel tiene un "backcolor" transparente, y en fin yo creo que la mezcla de coloresy transparentes y todo eos lo he configurado bien... si necesitan más información al respecto pidanme...



EDITO: He probado lo siguiente, pero solo da resultado si PINCHO en el scroll para moverlo, es decir, si uso la rueda del ratón el evento no se ejecuta...¿Como puedo reproducir este evento para la rueda dle ratón?...

Código:
    Private Sub Panel1_Scroll(sender As Object, e As ScrollEventArgs) Handles Panel1.Scroll
        Me.BackgroundImage = My.Resources.blue_music_2961____copia
    End Sub
End Class
Páginas: 1 ... 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 [86] 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ... 107
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines