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


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 ... 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 [825] 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 ... 1258
8241  Programación / Scripting / Re: ayuda a simplificar bat en: 11 Octubre 2013, 20:49 pm
En lugar de copiar los ejemplos de los demás sin entender su funcionamiento deberías procurar buscar lo que significa cada cosa y para que sirven.

El ejemplo de @Segadorfelix contiene dos errores de sintaxis, aquí estás dejando un espacio entre la variable del FOR y la comilla doble \" %%r,
pero además de eso, la variable de FOR contiene una letra, un solo caracter, ¿entonces no crees que aquí faltaría algo más?:
Código:
\" %%r\Hide\start.vbs\"

Hazle un Echo a la cadena para darte cuenta de lo que falta.

Saludos
8242  Programación / Scripting / Re: Batch script --> Informacion SETLOCAL & ENDLOCAL en: 11 Octubre 2013, 17:58 pm
¿Ninguna idea?

Si quieres que el script A reciba una variable del script B entonces tienes que hacer global dicha variable.

Una vez hayas terminado de manejar tus variables locales en el script B, al desactivar ENDLOCAL, podrías setearlas para hacerlas globales, de esta manera:

script A
Código
  1. @Echo OFF & SETLOCAL
  2. Call ScriptB.bat
  3. Echo %var% & REM Result: 123
  4. Pause&Exit

Script B
Código
  1. @Echo OFF & SETLOCAL
  2. Set "var=123"
  3. Set "var=%var%"
  4. )
  5. Exit /B 0

Saludos
8243  Programación / Scripting / Re: [Batch] Ayuda con código en: 11 Octubre 2013, 17:28 pm
Hola

Aquí se ve un fallo a simple vista, te comiste una comilla doble:
Citar
Código:
Set /P "SelectFiles=

Luego aquí no estás redireccionando absolútamente nada:
Citar
Código:
	--------->Activados.txt

No ibas mal encaminado en esta parte, pero esto no es un For, el keyword "Do" solo pertenece a un For, en su lugar usa los operadores lógicos y de comparación "&" "|" "&&"  "||".
Citar
Código:
Type "%Directory%\activados.txt" | Findstr /V /I "!File%%X!" do (set info=Activado)

Aquí no estás expandiendo la variable info, por lo tanto tus checkeos no iban a funcionar corréctamente.
Citar
Código:
Echo %%X. !File%%X! %info% | MORE

Prueba así:
Código:
@Echo OFF & Color 70 & MODE con cols=75
Title Animefiles 1.3.2

REM CD Plugins
if not exist ".\Plugins\Activados.txt" (
REM --------->Activados.txt
Echo. --------->".\Plugins\Activados.txt"
)

:ACTIVAR
cls
SETLOCAL EnableDelayedExpansion
Set "Directory=%CD%\plugins"

For %%# in (
"%Directory%\*.bat"
) Do (
Set /A "FileCount+=1"
Set "File!FileCount!=%%~nx#"
)
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ |MORE
For /L %%X in (1, 1, !FileCount!) Do (
REM Type "%Directory%\activados.txt" | Findstr /V /I "!File%%X!" do (set info=Activado)
Type "%Directory%\activados.txt" | Findstr /I "!File%%X!" 1>NUL 2>&1 && (
set "info=Activado"
) || (
set "info=Desactivado"
)
REM if not defined info (set info=Desactivado)
REM Echo %%X. !File%%X! %info% | MORE
Echo %%X. !File%%X! !info! | MORE
)
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ|MORE
echo Seleccione el plugin que desea activar:
echo.
Set /P "SelectFiles="
Set "SelectFiles=%SelectFiles: =%"
REM For %%# in (%SelectFiles%) Do (
REM Echo "!File%%#!" >> Activados.txt
REM )
(For %%# in (%SelectFiles%) Do (Echo "!File%%#!"))>> ".\Plugins\Activados.txt"
pause
exit
8244  Programación / Scripting / Re: (Solucionado) [Batch] Randomizar lineas en un txt? en: 11 Octubre 2013, 17:05 pm
No puedo ayudarte mucho más porque no entiendo porque intentas usar las Pipes del For con el programa Clever, no tengo estas utilidades de Winamp y tampoco comentas lo que se supone que debería suceder al redireccionar a este programa, entonces solo puedo aconsejarte que mejores la sintaxis/integridad del código y poco más.

Prueba algo así:
Código
  1. IF %ERRORLEVEL% EQU 0 (cd "%UserProfile%\Desktop\clever pause") | (clever.exe pause 1>nul & Goto :Comprobar)

Código
  1. IF %ERRORLEVEL% EQU 0 (FOR /R %%_ in ("*clever.exe") do (start /B "" "%%_")) | clever.exe pause 1>nul | (Taskkill /F /IM TxtTick.exe >nul & Goto :Esperar)

Saludos
8245  Programación / Scripting / Re: (Solucionado) [Batch] Randomizar lineas en un txt? en: 11 Octubre 2013, 02:56 am
Mientras sigas escribiendo código de la manera en la que lo estás haciendo, los errores no van a cesar.

1. Usa los operadores de agrupación para agrupar los comandos ().

2. Encierra todos los argumentos "" (sobretodo el de la ruta de directorio...).

3. Comprueba si el error se solucionó.

Saludos
8246  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 10 Octubre 2013, 23:57 pm
Un ayudante para manejar la aplicación dBpoweramp Music Converter, es el mejor conversor archivos de música a cualquier formato.

http://www.dbpoweramp.com/dmc.htm

Le agregué lo necesario para convertir a MP3, WAV, y WMA, se puede extender para agregar todos los demás codecs, pero es muy tedioso...

Tambiñen le agregué un par de eventos para capturar el progreso de conversión y mensajes de errores, el modo de empleo está explicado en los primeros comentarios.

PD: También existe una librería llamada dMcscriptinglib.dll, pero los autores de dbPowerAmp me dijeron que no es posible capturar el progreso de una conversión usando la librería, por ese motivo uso el executable CLI.

EDITO: Corregido un bug en las Enumeraciones del SampleRate de los Codecs, y he simplificado parte del código.

Código
  1. #Region " CoreConverter Helper "
  2.  
  3.  
  4.  
  5. ' [ CoreConverter Helper ]
  6. '
  7. ' // By Elektro H@cker
  8. '
  9. '
  10. ' Instructions:
  11. '
  12. ' 1. Add the "CoreConverter.exe" into the project,
  13. '    together with the dbPoweramp Effects and Codec folders.
  14. '
  15. ' Examples :
  16. '
  17. ' -------------------
  18. ' CONVERT FILE TO MP3
  19. ' -------------------
  20. ' CoreConverter.Convert_To_MP3("C:\Input.wav", "C:\Output.mp3", _
  21. '                              CoreConverter.Lame_Bitrate.kbps_320, _
  22. '                              CoreConverter.Lame_Bitrate_Mode.cbr, _
  23. '                              CoreConverter.Lame_Profile.SLOW, _
  24. '                              CoreConverter.Lame_Quality.Q0_Maximum, _
  25. '                              CoreConverter.Lame_Khz.Same_As_Source, _
  26. '                              CoreConverter.Lame_Channels.auto, _
  27. '                              { _
  28. '                                CoreConverter.DSP_Effects.Delete_Output_File_on_Error, _
  29. '                                CoreConverter.DSP_Effects.Recycle_Source_File_After_Conversion _
  30. '                              }, _
  31. '                              False, _
  32. '                              CoreConverter.Priority.normal)
  33. '
  34. ' -------------------
  35. ' CONVERT FILE TO WAV
  36. ' -------------------
  37. ' CoreConverter.Convert_To_WAV_Uncompressed("C:\Input.mp3", "C:\Output.wav", _
  38. '                                           CoreConverter.WAV_Uncompressed_Bitrate.Same_As_Source, _
  39. '                                           CoreConverter.WAV_Uncompressed_Khz.Same_As_Source, _
  40. '                                           CoreConverter.WAV_Uncompressed_Channels.Same_As_Source, , False)
  41. '
  42. ' -------------------
  43. ' CONVERT FILE TO WMA
  44. ' -------------------
  45. ' CoreConverter.Convert_To_WMA("C:\Input.mp3", "C:\Output.wma", _
  46. '                              CoreConverter.WMA_9_2_BitRates.Kbps_128, _
  47. '                              CoreConverter.WMA_9_2_Khz.Khz_44100, _
  48. '                              CoreConverter.WMA_9_2_Channels.stereo, , False)
  49. '
  50. ' ------
  51. ' EVENTS
  52. ' ------
  53. ' Public WithEvents Converter As New CoreConverter()
  54. '
  55. ' Sub Converter_Progress(Progress As Integer, e As EventArgs) Handles Converter.PercentDone
  56. '     ProgressBar1.Maximum = 59
  57. '     ProgressBar1.Step = 1
  58. '     ProgressBar1.PerformStep()
  59. ' End Sub
  60. '
  61. ' Sub Converter_Message(Message As String, e As EventArgs) Handles Converter.Exited
  62. '     ProgressBar1.Value = 0
  63. '     MessageBox.Show(Message)
  64. ' End Sub
  65.  
  66.  
  67.  
  68. Public Class CoreConverter : Implements IDisposable
  69.  
  70. #Region " Variables "
  71.  
  72.    ' <summary>
  73.    ' Gets or sets CoreConverter.exe executable path.
  74.    ' </summary>
  75.    Public Shared CoreConverter_Location As String = ".\CoreConverter.exe"
  76.  
  77.    ' Stores the CoreConverter process progress
  78.    Private Shared CurrentProgress As Integer = 0
  79.  
  80.    ' Stores the CoreConverter process StandarOutput
  81.    Private Shared StandardOutput As String = String.Empty
  82.  
  83.    ' Stores the CoreConverter process ErrorOutput
  84.    Private Shared ErrorOutput As String = String.Empty
  85.  
  86.    ' Stores the next output character
  87.    Private Shared OutputCharacter As Char = Nothing
  88.  
  89.    ' Stores the DSP Effects formatted string
  90.    Private Shared Effects As String = String.Empty
  91.  
  92. #End Region
  93.  
  94. #Region " Events "
  95.  
  96.    ' <summary>
  97.    ' Event raised when conversion progress changes.
  98.    ' </summary>
  99.    Public Shared Event PercentDone As EventHandler(Of PercentDoneEventArgs)
  100.    Public Class PercentDoneEventArgs : Inherits EventArgs
  101.        Public Property Progress As Integer
  102.    End Class
  103.  
  104.    ' <summary>
  105.    ' Event raised when CoreConverter process has exited.
  106.    ' </summary>
  107.    Public Shared Event Exited As EventHandler(Of ExitedEventArgs)
  108.    Public Class ExitedEventArgs : Inherits EventArgs
  109.        Public Property Message As String
  110.    End Class
  111.  
  112. #End Region
  113.  
  114. #Region " Process Info "
  115.  
  116.    ' CoreConverter Process Information.
  117.    Private Shared CoreConverter As New Process() With { _
  118.        .StartInfo = New ProcessStartInfo With { _
  119.        .CreateNoWindow = True, _
  120.        .UseShellExecute = False, _
  121.        .RedirectStandardError = True, _
  122.        .RedirectStandardOutput = True, _
  123.        .StandardErrorEncoding = System.Text.Encoding.Unicode, _
  124.        .StandardOutputEncoding = System.Text.Encoding.Unicode}}
  125.  
  126. #End Region
  127.  
  128. #Region " CoreConverter Enumerations "
  129.  
  130.    ' Priority level of CoreConverter.exe
  131.    Enum Priority
  132.        idle
  133.        low
  134.        normal
  135.        high
  136.    End Enum
  137.  
  138.    ' DSP Effects
  139.    Public Enum DSP_Effects
  140.        Delete_Output_File_on_Error ' Delete failed conversion (not deletes source file).
  141.        Delete_Source_File_After_Conversion ' Delete source file after conversion.
  142.        Recycle_Source_File_After_Conversion ' Send source file to recycle bin after conversion.
  143.        Karaoke_Remove_Voice ' Remove voice from file.
  144.        Karaoke_Remove_Instrument ' Remove instruments from file.
  145.        Reverse ' Reverse complete audio file.
  146.        Write_Silence ' Write silence at start of file.
  147.    End Enum
  148.  
  149. #End Region
  150.  
  151. #Region " Codec Enumerations "
  152.  
  153. #Region " MP3 Lame "
  154.  
  155.    Enum Lame_Bitrate
  156.        kbps_8 = 8
  157.        kbps_16 = 16
  158.        kbps_24 = 24
  159.        kbps_32 = 32
  160.        kbps_40 = 40
  161.        kbps_48 = 48
  162.        kbps_56 = 56
  163.        kbps_64 = 64
  164.        kbps_80 = 80
  165.        kbps_96 = 96
  166.        kbps_112 = 112
  167.        kbps_128 = 128
  168.        kbps_144 = 144
  169.        kbps_160 = 160
  170.        kbps_192 = 192
  171.        kbps_224 = 224
  172.        kbps_256 = 256
  173.        kbps_320 = 320
  174.    End Enum
  175.  
  176.    Enum Lame_Bitrate_Mode
  177.        cbr
  178.        abr
  179.    End Enum
  180.  
  181.    Enum Lame_Profile
  182.        NORMAL
  183.        FAST
  184.        SLOW
  185.    End Enum
  186.  
  187.    Enum Lame_Quality
  188.        Q0_Maximum = 0
  189.        Q1 = 1
  190.        Q2 = 2
  191.        Q3 = 3
  192.        Q4 = 4
  193.        Q5 = 5
  194.        Q6 = 6
  195.        Q7 = 7
  196.        Q8 = 8
  197.        Q9_Minimum = 9
  198.    End Enum
  199.  
  200.    Enum Lame_Khz
  201.        Same_As_Source
  202.        khz_8000 = 8000
  203.        khz_11025 = 11025
  204.        khz_12000 = 12000
  205.        khz_16000 = 16000
  206.        khz_22050 = 22050
  207.        khz_24000 = 24000
  208.        khz_32000 = 32000
  209.        khz_44100 = 44100
  210.        khz_48000 = 48000
  211.    End Enum
  212.  
  213.    Enum Lame_Channels
  214.        auto
  215.        mono
  216.        stereo
  217.        joint_stereo
  218.        forced_joint_stereo
  219.        forced_stereo
  220.        dual_channels
  221.    End Enum
  222.  
  223.  
  224. #End Region
  225.  
  226. #Region " WAV Uncompressed "
  227.  
  228.    Enum WAV_Uncompressed_Bitrate
  229.        Same_As_Source
  230.        bits_8 = 8
  231.        bits_16 = 16
  232.        bits_24 = 24
  233.        bits_32 = 32
  234.    End Enum
  235.  
  236.    Enum WAV_Uncompressed_Khz
  237.        Same_As_Source
  238.        khz_8000 = 8000
  239.        khz_11025 = 11025
  240.        khz_12000 = 12000
  241.        khz_16000 = 16000
  242.        khz_22050 = 22050
  243.        khz_24000 = 24000
  244.        khz_32000 = 32000
  245.        khz_44100 = 44100
  246.        khz_48000 = 48000
  247.        khz_96000 = 96000
  248.        khz_192000 = 192000
  249.    End Enum
  250.  
  251.    Enum WAV_Uncompressed_Channels
  252.        Same_As_Source
  253.        Channels_1_Mono = 1
  254.        Channels_2_Stereo = 2
  255.        Channels_3 = 3
  256.        Channels_4_Quadraphonic = 4
  257.        Channels_5_Surround = 5
  258.        Channels_6_Surround_DVD = 6
  259.        Channels_7 = 7
  260.        Channels_8_Theater = 8
  261.    End Enum
  262.  
  263. #End Region
  264.  
  265. #Region " WMA 9.2 "
  266.  
  267.    Enum WMA_9_2_BitRates
  268.        Kbps_12 = 12
  269.        Kbps_16 = 16
  270.        Kbps_20 = 20
  271.        Kbps_22 = 22
  272.        Kbps_24 = 24
  273.        Kbps_32 = 32
  274.        Kbps_40 = 40
  275.        Kbps_48 = 48
  276.        Kbps_64 = 64
  277.        Kbps_80 = 80
  278.        Kbps_96 = 96
  279.        Kbps_128 = 128
  280.        Kbps_160 = 160
  281.        Kbps_192 = 192
  282.        Kbps_256 = 256
  283.        Kbps_320 = 320
  284.    End Enum
  285.  
  286.    Enum WMA_9_2_Khz
  287.        Khz_8000 = 8
  288.        Khz_16000 = 16
  289.        Khz_22050 = 22
  290.        Khz_32000 = 32
  291.        Khz_44100 = 44
  292.        Khz_48000 = 48
  293.    End Enum
  294.  
  295.    Enum WMA_9_2_Channels
  296.        mono
  297.        stereo
  298.    End Enum
  299.  
  300. #End Region
  301.  
  302. #End Region
  303.  
  304. #Region " Codec Procedures "
  305.  
  306. #Region " MP3 Lame "
  307.  
  308.    ' <summary>
  309.    ' Converts a file to MP3 using Lame codec.
  310.    ' </summary>
  311.    Public Shared Sub Convert_To_MP3(ByVal In_File As String, _
  312.                             ByVal Out_File As String, _
  313.                             ByVal Bitrate As Lame_Bitrate, _
  314.                             ByVal Bitrate_Mode As Lame_Bitrate_Mode, _
  315.                             ByVal Encoding_Profile As Lame_Profile, _
  316.                             ByVal Quality As Lame_Quality, _
  317.                             ByVal Khz As Lame_Khz, _
  318.                             ByVal Channels As Lame_Channels, _
  319.                             Optional ByVal DSP_Effects() As DSP_Effects = Nothing, _
  320.                             Optional ByVal Update_Tag As Boolean = True, _
  321.                             Optional ByVal Priority As Priority = Priority.normal, _
  322.                             Optional ByVal Processor As Short = 1)
  323.  
  324.        Get_Effects(DSP_Effects)
  325.  
  326.        Set_Main_Parametters("mp3 (Lame)", In_File, Out_File, If(Not Update_Tag, "-noidtag", ""), Effects, Priority.ToString, Processor.ToString)
  327.  
  328.        CoreConverter.StartInfo.Arguments &= _
  329.        String.Format("-b {0} --{1} -encoding=""{2}"" -freq=""{3}"" -channels=""{4}"" --noreplaygain --extracli=""-q {5}""", _
  330.                      CInt(Bitrate), _
  331.                      Bitrate_Mode.ToString, _
  332.                      Encoding_Profile.ToString, _
  333.                      If(Khz = Lame_Khz.Same_As_Source, "", CInt(Khz)), _
  334.                      If(Channels = Lame_Channels.auto, "", Channels), _
  335.                      CInt(Quality))
  336.  
  337.        Run_CoreConverter()
  338.  
  339.    End Sub
  340.  
  341. #End Region
  342.  
  343. #Region " WAV Uncompressed "
  344.  
  345.    ' <summary>
  346.    ' Converts a file to WAV
  347.    ' </summary>
  348.    Public Shared Sub Convert_To_WAV_Uncompressed(ByVal In_File As String, _
  349.                                 ByVal Out_File As String, _
  350.                                 ByVal Bitrate As WAV_Uncompressed_Bitrate, _
  351.                                 ByVal Khz As WAV_Uncompressed_Khz, _
  352.                                 ByVal Channels As WAV_Uncompressed_Channels, _
  353.                                 Optional ByVal DSP_Effects() As DSP_Effects = Nothing, _
  354.                                 Optional ByVal Update_Tag As Boolean = True, _
  355.                                 Optional ByVal Priority As Priority = Priority.normal, _
  356.                                 Optional ByVal Processor As Short = 1)
  357.  
  358.        Get_Effects(DSP_Effects)
  359.  
  360.        Set_Main_Parametters("Wave", In_File, Out_File, If(Not Update_Tag, "-noidtag", ""), Effects, Priority.ToString, Processor.ToString)
  361.  
  362.        CoreConverter.StartInfo.Arguments &= _
  363.        String.Format("-compression=""PCM"" -bits=""{0}"" -freq=""{1}"" -channels=""{2}""", _
  364.                      If(Bitrate = WAV_Uncompressed_Bitrate.Same_As_Source, "", CInt(Bitrate)), _
  365.                      If(Khz = WAV_Uncompressed_Khz.Same_As_Source, "", CInt(Khz)), _
  366.                      If(Channels = WAV_Uncompressed_Channels.Same_As_Source, "", CInt(Channels)))
  367.  
  368.        Run_CoreConverter()
  369.  
  370.    End Sub
  371.  
  372. #End Region
  373.  
  374. #Region " WMA 9.2 "
  375.  
  376.    ' <summary>
  377.    ' Converts a file to WMA 9.2
  378.    ' </summary>
  379.    Public Shared Sub Convert_To_WMA(ByVal In_File As String, _
  380.                                 ByVal Out_File As String, _
  381.                                 ByVal Bitrate As WMA_9_2_BitRates, _
  382.                                 ByVal Khz As WMA_9_2_Khz, _
  383.                                 ByVal Channels As WMA_9_2_Channels, _
  384.                                 Optional ByVal DSP_Effects() As DSP_Effects = Nothing, _
  385.                                 Optional ByVal Update_Tag As Boolean = True, _
  386.                                 Optional ByVal Priority As Priority = Priority.normal, _
  387.                                 Optional ByVal Processor As Short = 1)
  388.  
  389.        Get_Effects(DSP_Effects)
  390.  
  391.        Set_Main_Parametters("Windows Media Audio 10", In_File, Out_File, If(Not Update_Tag, "-noidtag", ""), Effects, Priority.ToString, Processor.ToString)
  392.  
  393.        CoreConverter.StartInfo.Arguments &= _
  394.        String.Format("-codec=""Windows Media Audio 9.2"" -settings=""{0} kbps, {1} kHz, {2} CBR""",
  395.                      CInt(Bitrate), _
  396.                      CInt(Khz), _
  397.                      Channels.ToString)
  398.  
  399.        Run_CoreConverter()
  400.  
  401.    End Sub
  402.  
  403. #End Region
  404.  
  405. #End Region
  406.  
  407. #Region " Run Converter Procedure "
  408.  
  409.    Private Shared Sub Run_CoreConverter()
  410.  
  411.        CoreConverter.StartInfo.FileName = CoreConverter_Location
  412.        CoreConverter.Start()
  413.  
  414.        While Not CoreConverter.HasExited
  415.  
  416.            OutputCharacter = ChrW(CoreConverter.StandardOutput.Read)
  417.  
  418.            If OutputCharacter = "*" Then
  419.                CurrentProgress += 1 ' Maximum value is 59, so a ProgressBar Maximum property value would be 59.
  420.                RaiseEvent PercentDone(CurrentProgress, Nothing)
  421.            End If
  422.  
  423.            If CurrentProgress = 59 Then
  424.                ' I store the last line(s) 'cause it has interesting information:
  425.                ' Example message: Conversion completed in 30 seconds x44 realtime encoding
  426.                StandardOutput = CoreConverter.StandardOutput.ReadToEnd.Trim
  427.            End If
  428.  
  429.        End While
  430.  
  431.        ' Stores the Error Message (If any)
  432.        ErrorOutput = CoreConverter.StandardError.ReadToEnd
  433.  
  434.        Select Case CoreConverter.ExitCode
  435.  
  436.            Case 0 : RaiseEvent Exited(StandardOutput, Nothing) ' Return StandardOutput
  437.            Case Else : RaiseEvent Exited(ErrorOutput, Nothing) ' Return ErrordOutput
  438.  
  439.        End Select
  440.  
  441.        CurrentProgress = Nothing
  442.        OutputCharacter = Nothing
  443.        StandardOutput = Nothing
  444.        ErrorOutput = Nothing
  445.        Effects = Nothing
  446.        CoreConverter.Close()
  447.  
  448.    End Sub
  449.  
  450. #End Region
  451.  
  452. #Region " Miscellaneous functions "
  453.  
  454.    ' <summary>
  455.    ' Checks if CoreConverter process is avaliable.
  456.    ' </summary>
  457.    Public Shared Function Is_Avaliable() As Boolean
  458.        Return IO.File.Exists(CoreConverter_Location)
  459.    End Function
  460.  
  461.    ' Set the constant parametters of CoreConverter process
  462.    Private Shared Sub Set_Main_Parametters(ByVal Codec_Name As String, _
  463.                                            ByVal In_File As String, _
  464.                                            ByVal Out_File As String, _
  465.                                            ByVal Update_Tag As String, _
  466.                                            ByVal Effects As String, _
  467.                                            ByVal Priority As String, _
  468.                                            ByVal Processor As String)
  469.  
  470.        CoreConverter.StartInfo.Arguments = _
  471.        String.Format("-infile=""{0}"" -outfile=""{1}"" -convert_to=""{2}"" {3} {4} -priority=""{5}"" -processor=""{6}"" ", _
  472.                      In_File, Out_File, Codec_Name, Update_Tag, Effects, Priority, Processor)
  473.  
  474.    End Sub
  475.  
  476.    ' Returns all joined DSP Effects formatted string
  477.    Private Shared Function Get_Effects(ByVal DSP_Effects() As DSP_Effects) As String
  478.  
  479.        If DSP_Effects Is Nothing Then Return Nothing
  480.  
  481.        For Effect As Integer = 0 To DSP_Effects.Length - 1
  482.            Effects &= String.Format(" -dspeffect{0}={1}", _
  483.                                     Effect + 1, _
  484.                                     Format_DSP_Effect(DSP_Effects(Effect).ToString))
  485.        Next Effect
  486.  
  487.        Return Effects
  488.  
  489.    End Function
  490.  
  491.    ' Returns a DSP Effect formatted string
  492.    Private Shared Function Format_DSP_Effect(ByVal Effect As String)
  493.  
  494.        Select Case Effect
  495.            Case "Reverse" : Return """Reverse"""
  496.            Case "Delete_Output_File_on_Error" : Return """Delete Destination File on Error="""
  497.            Case "Recycle_Source_File_After_Conversion" : Return """Delete Source File=-recycle"""
  498.            Case "Delete_Source_File_After_Conversion" : Return """Delete Source File="""
  499.            Case "Karaoke_Remove_Voice" : Return """Karaoke (Voice_ Instrument Removal)="""
  500.            Case "Karaoke_Remove_Instrument" : Return """Karaoke (Voice_ Instrument Removal)=-i"""
  501.            Case "Write_Silence" : Return """Write Silence=-lengthms={qt}2000{qt}""" ' 2 seconds
  502.            Case Else : Return String.Empty
  503.        End Select
  504.  
  505.    End Function
  506.  
  507. #End Region
  508.  
  509. #Region " Dispose Objects "
  510.  
  511.    Public Sub Dispose() Implements IDisposable.Dispose
  512.        ' CoreConverter_Location = Nothing ' Do not change if want to preserve a custom location.
  513.        OutputCharacter = Nothing
  514.        StandardOutput = Nothing
  515.        ErrorOutput = Nothing
  516.        CurrentProgress = Nothing
  517.        Effects = Nothing
  518.        CoreConverter.Close()
  519.        GC.SuppressFinalize(Me)
  520.    End Sub
  521.  
  522. #End Region
  523.  
  524. End Class
  525.  
  526. #End Region
8247  Programación / Scripting / Re: [batch] error con findstr en: 10 Octubre 2013, 21:20 pm
En consola:

Código:
PUSDH /?
Código:
POPD /?

+ http://ss64.com/nt/syntax-redirection.html + http://ss64.com/nt/syntax-args.html

Saludos
8248  Sistemas Operativos / Windows / Re: Problema, mi pc se queda congelado. en: 10 Octubre 2013, 03:13 am
Por supuesto cada persona tiene su opinión y Songoku es una persona muy respetable,
aunque yo esté totálmente en contra de la relación entre rendimiento/calidad que ofrece nVidia contra la de ATI y yo haya investigado en su dia las diferencias entre cada una, esto se puede ver también en cualquier mercadillo/tienda online, en los comentarios que dejan los consumidores respecto a tarjetas nVidia contra las de ATI, solo hay que investigar y comparar opiniones antes de adquirir un producto, vaya, no es que yo me lo inventé lo que he llegado a ver sobre nVidia ni tampoco los problemas que me han dado las tarjetas que he llegado a adquirir de esta marca.

Mi intención no es desmentir la opinión de Songoku, porque ante todo es una opinión y hay que respetarla, solo digo que yo a pesar de mi escasez de experiencia en Hardware tengo motivos para dar por hecho que opino con toda sensatez,
para ser sinceros en el subforo de Hardware nunca me han aconsejado una nVidia, siempre ATI, y eso me anima influye todavía más a pensar lo que pienso descalificar a nVidia como una buena marca (además de por todas las malas pasadas que me ha hecho sufrir nVidia), y que sus productos sean buenos... los hay buenos y los hay con problemas.

Lo suyo también es saber elegir una buena tarjeta en relacion rendimiento/calidad/precio, y tener un poco de suerte y que ya sea nVidia o ATI no te toquen tarjetas defectuosas, asi que... suerte!

Saludos!
8249  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 10 Octubre 2013, 02:34 am
Un custom MessageBox que se puede alinear en el centro del formulario y además se puede personalizar la fuente de texto usada.

Modo de empleo:
Código
  1.        Using New CustomMessageBox(Me, New Font(New FontFamily("Lucida Console"), Font.SizeInPoints, FontStyle.Bold))
  2.            MessageBox.Show("Test Text", "Test Title", MessageBoxButtons.OK)
  3.        End Using


Código
  1. Imports System.Drawing
  2. Imports System.Runtime.InteropServices
  3. Imports System.Text
  4. Imports System.Windows.Forms
  5.  
  6. Class CustomMessageBox : Implements IDisposable
  7.  
  8.    Private mTries As Integer = 0
  9.    Private mOwner As Form
  10.    Private mFont As Font
  11.  
  12.    ' P/Invoke declarations
  13.    Private Const WM_SETFONT As Integer = &H30
  14.    Private Const WM_GETFONT As Integer = &H31
  15.  
  16.    Private Delegate Function EnumThreadWndProc(hWnd As IntPtr, lp As IntPtr) As Boolean
  17.  
  18.    <DllImport("user32.dll")> _
  19.    Private Shared Function EnumThreadWindows(tid As Integer, callback As EnumThreadWndProc, lp As IntPtr) As Boolean
  20.    End Function
  21.  
  22.    <DllImport("kernel32.dll")> _
  23.    Private Shared Function GetCurrentThreadId() As Integer
  24.    End Function
  25.  
  26.    <DllImport("user32.dll")> _
  27.    Private Shared Function GetClassName(hWnd As IntPtr, buffer As StringBuilder, buflen As Integer) As Integer
  28.    End Function
  29.  
  30.    <DllImport("user32.dll")> _
  31.    Private Shared Function GetDlgItem(hWnd As IntPtr, item As Integer) As IntPtr
  32.    End Function
  33.  
  34.    <DllImport("user32.dll")> _
  35.    Private Shared Function SendMessage(hWnd As IntPtr, msg As Integer, wp As IntPtr, lp As IntPtr) As IntPtr
  36.    End Function
  37.  
  38.    <DllImport("user32.dll")> _
  39.    Shared Function GetWindowRect(hWnd As IntPtr, ByRef rc As RECT) As Boolean
  40.    End Function
  41.  
  42.    <DllImport("user32.dll")> _
  43.    Shared Function MoveWindow(hWnd As IntPtr, x As Integer, y As Integer, w As Integer, h As Integer, repaint As Boolean) As Boolean
  44.    End Function
  45.  
  46.    Structure RECT
  47.        Public Left As Integer
  48.        Public Top As Integer
  49.        Public Right As Integer
  50.        Public Bottom As Integer
  51.    End Structure
  52.  
  53.    Public Sub New(owner As Form, Optional Custom_Font As Font = Nothing)
  54.        mOwner = owner
  55.        mFont = Custom_Font
  56.        owner.BeginInvoke(New MethodInvoker(AddressOf findDialog))
  57.    End Sub
  58.  
  59.    Private Sub findDialog()
  60.  
  61.        ' Enumerate windows to find the message box
  62.        If mTries < 0 Then
  63.            Return
  64.        End If
  65.  
  66.        Dim callback As New EnumThreadWndProc(AddressOf checkWindow)
  67.  
  68.        If EnumThreadWindows(GetCurrentThreadId(), callback, IntPtr.Zero) Then
  69.            If System.Threading.Interlocked.Increment(mTries) < 10 Then
  70.                mOwner.BeginInvoke(New MethodInvoker(AddressOf findDialog))
  71.            End If
  72.        End If
  73.  
  74.    End Sub
  75.  
  76.    Private Function checkWindow(hWnd As IntPtr, lp As IntPtr) As Boolean
  77.  
  78.        ' Checks if <hWnd> is a dialog
  79.        Dim sb As New StringBuilder(260)
  80.        GetClassName(hWnd, sb, sb.Capacity)
  81.        If sb.ToString() <> "#32770" Then Return True
  82.  
  83.        ' Got it, get the STATIC control that displays the text
  84.        Dim hText As IntPtr = GetDlgItem(hWnd, &HFFFF)
  85.  
  86.        Dim frmRect As New Rectangle(mOwner.Location, mOwner.Size)
  87.        Dim dlgRect As RECT
  88.        GetWindowRect(hWnd, dlgRect)
  89.        MoveWindow(hWnd, frmRect.Left + (frmRect.Width - dlgRect.Right + dlgRect.Left) \ 2, frmRect.Top + (frmRect.Height - dlgRect.Bottom + dlgRect.Top) \ 2, dlgRect.Right - dlgRect.Left, dlgRect.Bottom - dlgRect.Top, True)
  90.        If hText <> IntPtr.Zero Then
  91.  
  92.            If mFont Is Nothing Then
  93.                ' Get the current font
  94.                mFont = Font.FromHfont(SendMessage(hText, WM_GETFONT, IntPtr.Zero, IntPtr.Zero))
  95.            End If
  96.  
  97.            SendMessage(hText, WM_SETFONT, mFont.ToHfont(), New IntPtr(1))
  98.  
  99.        End If
  100.  
  101.        ' Done
  102.        Return False
  103.  
  104.    End Function
  105.  
  106.    Public Sub Dispose() Implements IDisposable.Dispose
  107.        mTries = -1
  108.        mOwner = Nothing
  109.        If mFont IsNot Nothing Then mFont.Dispose()
  110.    End Sub
  111.  
  112. End Class
8250  Sistemas Operativos / Windows / Re: Problema, mi pc se queda congelado. en: 10 Octubre 2013, 00:50 am
Si veo que falla haré undervolt a la grafica pero al hacer eso pierdo potencia no?

El undervolt si no me equivoco se refiere a los wattios, pero yo no hablo de voltage, sino de frecuencia (megaherzios) del reloj de la GPU y la RAM de la gráfica,
usa el programa que te aconsejé para disminuir un poco (o incluso del todo, es solo para testear) esas frecuencias, que imagino que a su vez disminuirá algo el voltage al usar menos, no sé, no soy un experto en el tema.

pero al hacer eso pierdo potencia no?

Si, claro, la gráfica pierde rendimiento, pero creeme, siendo un "no jugón" no vas a notar ni una pizca la diferencia.

Además, como ya he comentado, si eso te soluciona el problema (como yo pude solucionar en varias ocasiones) deberías reclamar una nueva tarjeta gráfica porque no deberías underclockear para poder utilizarla sin fallos.

PD: Otra cosa que podrías probar (aunque a mi nunca me ha servido para solucionar nada) es modificar el perfil en el panel de control de nVidia, es decir, abres el panel de control de nVidia y usas el perfil "Rendimiento", en vez de usar "Equilibrado" o "Calidad".
Saludos
Páginas: 1 ... 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 [825] 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 ... 1258
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines