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


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: 1 ... 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 [1028] 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 ... 1252
10271  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...
10272  Programación / Scripting / Re: [Perl] FindIcons 0.1 en: 25 Noviembre 2012, 23:44 pm
Hola Doddy, buenisimo code

¿Sabes si hay alguna palabra clave para encontrar TODOS los resultados de la web?, Es decir, para bajar la página ENTERA.

He probado con el asterisco "*" pero dice que la palabra es muy corta jeje, lo mismo si pongo "a", "b", etc...

EDITO: Bueno casi que para bajarla entera mejor sería usar algún "WebDownloader:xD

Gracias por el code!
10273  Programación / .NET (C#, VB.NET, ASP) / Re: Mostrar el output de la CMD en: 25 Noviembre 2012, 22:29 pm
Gracias Keyen,
La verdad es que el comando attrib es solo es el ejemplo con el que estoy practicando para darle uso a esta función más tarde, porque lo que si necesitaré usar son utilidades de terceros como "Mediainfo.exe" y quiero mostrar el output de ese programa en cuestión.

Ya lo he solucionado usando "appendText":

Código
  1.    Private Function attrib() As Boolean
  2.        consolebox.AppendText(vbNewLine + "[+] Deleting the attributes of the files..." + vbNewLine + vbNewLine)
  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 dir /B /AD C:\"
  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.            consolebox.AppendText(readerStdOut.ReadLine() + vbNewLine)
  17.            consolebox.SelectionStart = consolebox.Text.Length
  18.            consolebox.ScrollToCaret()
  19.        Loop
  20.        consolebox.AppendText(vbNewLine + "[OK] attributes deleted!" + vbNewLine + vbNewLine)
  21.    End Function

Saludos
10274  Programación / Scripting / Re: NECESITO AYUDA URGENTE CON SCRIPTS en: 25 Noviembre 2012, 21:54 pm
Si las carpetas tienen MUCHOS archivos y/o pesan demasiado creo que te convendría más comprimir cada carpeta en un solo archivo por carpeta, aquí tienes una manera de hacerlo:

[BATCH] Script para backups incrementales
10275  Programación / Scripting / Re: bath inicio en: 25 Noviembre 2012, 21:50 pm
No podemos adivinarlo, pero tampoco tiene importancia porque la clave que estás trasteando no está relacionada con lo que intentas hacer en este post: http://foro.elhacker.net/scripting/cambiar_pagina_inicio_con_bath-t376847.0.html;msg1804148#msg1804148

Saludos!
10276  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. "
10277  Programación / .NET (C#, VB.NET, ASP) / Re: Como aplicar cambios al registro y refrescar el sistema sin tener que reiniciar? en: 25 Noviembre 2012, 17:54 pm
No me ha funcionado Seba
10278  Programación / .NET (C#, VB.NET, ASP) / Re: [Encuesta] ¿ Que versión de Visual Studio usas ? en: 25 Noviembre 2012, 14:56 pm
Yo usé VS2010, ahora uso VS2012, y puedo asegurar que su interfaz ayuda mucho más a los que estamos aprendiendo, además, me gusta mucho, puedes cambiar el theme por defecto a uno más oscuro para relajar la vista y optimizar tu lugar de trabajo/aprendizaje, y además va muy a juego con el nuevo estilismo de microsoft (Windows 8), sin duda es una IDE exageradamente buena! Y BONITA (Aunque digan lo contrario).

La herramienta que busca posibles optimizaciones para el código
¿Donde encuentro esa opción?

Saludos.
10279  Programación / Scripting / Re: Interpretar una palabra con otra (o remplazarla) en: 25 Noviembre 2012, 12:01 pm
Creo que lo que quieres hacer es esto:



Código
  1. @Echo OFF
  2.  
  3. Set "DETECTOR="
  4. Set /P "VAR=Escribe algo >>"
  5.  
  6. :: Comprobamos si se trata de un número
  7. Echo "%VAR%"|FINDSTR "^\"[0-9]*\"$" >NUL && Set "DETECTOR=Numero"
  8.  
  9. :: Comprobamos si se trata de una letra
  10. Echo "%VAR%"|FINDSTR /I "^\"[A-Z]\"$" >NUL && Set "DETECTOR=Letra"
  11.  
  12. :: Si las comprobaciones anteriores han fallado entonces es una palabra...
  13. IF NOT DEFINED DETECTOR (Set "DETECTOR=Palabra")
  14.  
  15. Echo La variable es un %DETECTOR%
  16. Echo ^<span^>^<div class="%detector%"^>%Var%^</div^>Izquierdar^</span^>
  17.  
  18. Pause&Exit
10280  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.
Páginas: 1 ... 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 [1028] 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 ... 1252
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines