| |
|
10062
|
Programación / .NET (C#, VB.NET, ASP) / Re: Option Strict on no permtite el enlace en tiempo de ejecucion
|
en: 11 Enero 2013, 21:57 pm
|
Si quieres un consejo, usa esto: ' RegCreateKey(Registry.CurrentUser, "Software\MyProgram") ' RegDeleteKey(Registry.CurrentUser, "Software\MyProgram") ' RegDeleteValue(Registry.CurrentUser, "Software\MyProgram", "Value name") ' RegSetValue("HKEY_CURRENT_USER\Software\MyProgram", "Value name", "Data", RegistryValueKind.String) ' Dim RegValue = RegGetValue("HKEY_CURRENT_USER\Software\MyProgram", "Value name")) #Region "Registry Edit" Public Sub RegCreateKey(ByVal RegRoot As Microsoft.Win32.RegistryKey, ByVal RegKey As String) RegRoot.CreateSubKey(RegKey) RegRoot.Close() End Sub Public Sub RegDeleteKey(ByVal RegRoot As Microsoft.Win32.RegistryKey, ByVal RegKey As String) RegRoot.DeleteSubKey(RegKey) RegRoot.Close() End Sub Public Sub RegDeleteValue(ByVal RegRoot As Microsoft.Win32.RegistryKey, ByVal RegKey As String, ByVal RegValue As String) Using key As Microsoft.Win32.RegistryKey = RegRoot.OpenSubKey(RegKey, True) key.DeleteValue(RegValue) key.Close() End Using End Sub Public Sub RegSetValue(ByVal RegKey As String, ByVal RegValue As String, ByVal RegData As String, ByVal RegDataType As RegistryValueKind) My.Computer.Registry.SetValue(RegKey, RegValue, RegData, RegDataType) End Sub Public Function RegGetValue(ByVal RegKey As String, ByVal RegValue As String) Return My.Computer.Registry.GetValue(RegKey, RegValue, Nothing) End Function #End Region
Saludos
|
|
|
|
|
10063
|
Media / Diseño Gráfico / Re: Busco iconos de años (50s,60s,70s,80s,90s,2000,2001,2002,etc...)
|
en: 11 Enero 2013, 20:09 pm
|
lo que quiero es que sigan un estilo de imagen específico Si me bajo una imagen que es complétamente azul cielo, y otra que es todo verde lima, pues el contraste de los botones no cuadra, queda mal y poco profesional, a eso me refiero con seguir un patrón de colores  Creo que jamás conseguiré este tipo de imagenes xD Saludos.
|
|
|
|
|
10067
|
Programación / Scripting / Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
|
en: 11 Enero 2013, 12:42 pm
|
que son snippets? Son trozos de códigos reutilizables, suelen ser funciones o subrutinas que tienen un propósito en especial. Saludos! EDITO: objshell.run """" & appdata & "\Ikillnukes\OPT.hta" & """" No he probado la orden (no me suena que la variable se use de esa manera en VBS), pero vaya esa es la sintaxis para las comillas dobles.
|
|
|
|
|
10068
|
Programación / Scripting / Re: Como puedo hacer un launcher asi, con VBS o con HTML, decidme
|
en: 11 Enero 2013, 11:19 am
|
700 líneas de código para hacer un maldito launcher, y las líneas que faltan para acabarlo... Si es que es una locura de código, como tu dices has cojido varios snippets, los has colocado y los has editado un poco, yo tambíen uso muchas veces snippets de internet para ahorrarme el trabajo de hacerlo a mano, pero joder, hay que saber un poco lo que estás usando, hay código de JS, VBS, CSS y HTML, y no sabes casi nada de ninguno de los 4 lenguajes, lo digo sin ofender, es que no sé para que te metes a usar 4 lenguajes si los desconoces. En fín, es una completa locura de código, como para encontrar el error, aunque alguien te arreglase el código un poco mañana te saldrían 50 errores más por la forma en la que haces las cosas, y aquí estamos para ayudar y enseñar, pero con un arreglo ni aprendes bien ni se arregla  . Te repito mi consejo, hazlo en VB.NET, (en un par de líneas se hace), ya lo habrías terminado, deja de complicarte.
Te voy a decir las cosas que encuentro echándole un vistazo en el editor (no pienso esforzarme mucho en buscar errores) objshell.run appdata & "\Ikillnukes\RUN.bat" objshell.run appdata & "\Ikillnukes\OPT.hta" A menos que cierres el argumento completo con comillas, cualquier usuario que tenga espacios en el nombre de la ruta no le funcionará. Function runear() setTimeout "ejecutar()",1000 End Function Deberías buscar en Google lo que es una función, en tu HTA usas para todo funciones de VBS cuando estas no devuelven ningún valor, funcionar funcionan como un sub, pero es muy incorrecto lo que estás haciendo. Cada pequeño código que veo de VBS lo separas en bloques, ¿Y si empiezas por juntar todos los VBS en un solo bloque?: <script type="text/javascript"> TODOS los códigos de VBS aquí, comentados y organizados. </script> Y lo mismo con los de JS y CSS. Saludos!
|
|
|
|
|
10069
|
Programación / .NET (C#, VB.NET, ASP) / Como veo el standardoutput de la CMD en la própia CMD?
|
en: 11 Enero 2013, 10:29 am
|
Estoy intentando hacer pruebas, Lo que quiero es poder abrir un comando en la CMD y que la consola no se cierre, por ejemplo: My_Process_Info.FileName = "CMD.exe" My_Process_Info.Arguments = "/k pause"
Pero la CMD se cierra. Así que he intentado ejecutar un FOR de Batch muy largo en la CMD para ver si así no se cierra... My_Process_Info.FileName = "CMD.exe" ' Process filename My_Process_Info.Arguments = "/k For /L %a in (1,1,100000) do echo afijgifjigjfgjifjgi" ' Process arguments
y no, no se cierra (Porque el FOR tarda en finalizar, cuando acaba si que se cierra claro xD) pero ahora lo que ocurre además es que el output de la CMD no se muestra en la CMD!, es decir, el FOR no muestra nada. EDITO: Vale, he descubierto que el output no se muestra en la CMD porque al habilitar la propiedad de redireccionar el Standard u Error output, no muestra el output en la CMD. Así que quiero solucionar los dos problemas: 1. Que la CMD no se cierre cuando finaliza la orden, el comando. 2. Que el output se muestre en la CMD cuando habilito la propiedad RedirectStandardOutput = True y/o RedirectStandardError = True Este es el code, es un snippet que estoy intentando hacer: Dim My_Process As New Process() Dim My_Process_Info As New ProcessStartInfo() My_Process_Info.FileName = "CMD.exe" ' Process filename My_Process_Info.Arguments = "/k For /L %a in (1,1,100000) do echo afijgifjigjfgjifjgi" ' Process arguments My_Process_Info.UseShellExecute = False ' Don't use system shell to execute the process My_Process_Info.CreateNoWindow = False ' Show the CMD Window My_Process_Info.RedirectStandardOutput = True ' Redirect (1) Output My_Process_Info.RedirectStandardError = True ' Redirect non (1) Output My_Process.EnableRaisingEvents = True My_Process.StartInfo = My_Process_Info My_Process.Start() ' Run the process My_Process.WaitForExit() ' Wait X miliseconds to kill the process Dim Process_StandardOutput = My_Process.StandardOutput.ReadToEnd() ' Stores the Standard Output (If any) Dim Process_ErrorOutput = My_Process.StandardOutput.ReadToEnd() ' Stores the Error Output (If any) Dim Process_StartTime As String = My_Process.StartTime ' Stores the time when the process was launched Dim Process_EndTime As String = My_Process.ExitTime ' Stores the time when the process was finished Dim ERRORLEVEL = My_Process.ExitCode ' Stores the ExitCode of the process Dim result = Process_StartTime & vbNewLine & Process_EndTime & vbNewLine & ERRORLEVEL MsgBox(result) MsgBox(Process_StandardOutput) MsgBox(Process_ErrorOutput)
|
|
|
|
|
10070
|
Programación / .NET (C#, VB.NET, ASP) / Re: [APORTE] Snippets (ACTUALIZADO 11/01/2013)
|
en: 11 Enero 2013, 09:39 am
|
Para una aplicación necesité dividir el tamaño de unos MEgaBytes entre la capacidad de un DVD5, así que ya puestos he hecho este snippet que divide el tamaño entre varios formatos de discos, para la próxima ocasión. PD: Las medidas están sacadas de la Wikipedia, para los más...  Saludos. ' Usage: ' ' MsgBox(ConvertToDiscSize(737280000, "Bytes", "CD")) ' MsgBox(ConvertToDiscSize(700, "MB", "CD")) ' MsgBox(Math.Ceiling(ConvertToDiscSize(6.5, "GB", "DVD"))) ' MsgBox(ConvertToDiscSize(40, "GB", "BR").ToString.Substring(0, 3) & " Discs") #Region " Convert To Disc Size function" Private Function ConvertToDiscSize(ByVal FileSize As Double, ByVal FileKindSize As String, ByVal To_DiscKindCapacity As String) ' KindSize Measures: ' -------------------------- ' Bytes ' KB ' MB ' GB ' ToDiscKind Measures: ' ----------------------------- ' CD ' CD800 ' CD900 ' DVD ' DVD-DL ' BR ' BR-DL ' BR-3L ' BR-4L ' BR-MD ' BR-MD-DL ' Bytes If FileKindSize.ToUpper = "BYTES" Then If To_DiscKindCapacity.ToUpper = "CD" Then Return FileSize / 737280000 ' CD Standard If To_DiscKindCapacity.ToUpper = "CD800" Then Return FileSize / 829440393.216 ' CD 800 MB If To_DiscKindCapacity.ToUpper = "CD900" Then Return FileSize / 912383803.392 ' CD 900 MB If To_DiscKindCapacity.ToUpper = "DVD" Then Return FileSize / 4700000000 ' DVD Standard (DVD5 If To_DiscKindCapacity.ToUpper = "DVD-DL" Then Return FileSize / 8500000000 ' DVD Double Layer (DVD9) If To_DiscKindCapacity.ToUpper = "BR" Then Return FileSize / 25025314816 ' BluRay Standard If To_DiscKindCapacity.ToUpper = "BR-DL" Then Return FileSize / 50050629632 ' BluRay Double Layer If To_DiscKindCapacity.ToUpper = "BR-3L" Then Return FileSize / 100103356416 ' BluRay x3 Layers If To_DiscKindCapacity.ToUpper = "BR-4L" Then Return FileSize / 128001769472 ' BluRay x4 Layers If To_DiscKindCapacity.ToUpper = "BR-MD" Then Return FileSize / 7791181824 ' BluRay MiniDisc Standard If To_DiscKindCapacity.ToUpper = "BR-MD-DL" Then Return FileSize / 15582363648 ' BluRay MiniDisc Double Layer ' KB ElseIf FileKindSize.ToUpper = "KB" Then If To_DiscKindCapacity.ToUpper = "CD" Then Return FileSize / 720000 ' CD Standard If To_DiscKindCapacity.ToUpper = "CD800" Then Return FileSize / 810000.384 ' CD 800 MB If To_DiscKindCapacity.ToUpper = "CD900" Then Return FileSize / 890999.808 ' CD 900 MB If To_DiscKindCapacity.ToUpper = "DVD" Then Return FileSize / 4589843.75 ' DVD Standard (DVD5) If To_DiscKindCapacity.ToUpper = "DVD-DL" Then Return FileSize / 8300781.25 ' DVD Double Layer (DVD9) If To_DiscKindCapacity.ToUpper = "BR" Then Return FileSize / 24438784 ' BluRay Standard If To_DiscKindCapacity.ToUpper = "BR-DL" Then Return FileSize / 48877568 ' BluRay Double Layer If To_DiscKindCapacity.ToUpper = "BR-3L" Then Return FileSize / 97757184 ' BluRay x3 Layers If To_DiscKindCapacity.ToUpper = "BR-4L" Then Return FileSize / 125001728 ' BluRay x4 Layers If To_DiscKindCapacity.ToUpper = "BR-MD" Then Return FileSize / 7608576 ' BluRay MiniDisc Standard If To_DiscKindCapacity.ToUpper = "BR-MD-DL" Then Return FileSize / 15217152 ' BluRay MiniDisc Double Layer ' MB ElseIf FileKindSize.ToUpper = "MB" Then If To_DiscKindCapacity.ToUpper = "CD" Then Return FileSize / 703.125 ' CD Standard If To_DiscKindCapacity.ToUpper = "CD800" Then Return FileSize / 791.016 ' CD 800 MB If To_DiscKindCapacity.ToUpper = "CD900" Then Return FileSize / 870.117 ' CD 900 MB If To_DiscKindCapacity.ToUpper = "DVD" Then Return FileSize / 4482.26929 ' DVD Standard (DVD5) If To_DiscKindCapacity.ToUpper = "DVD-DL" Then Return FileSize / 8106.23169 ' DVD Double Layer (DVD9) If To_DiscKindCapacity.ToUpper = "BR" Then Return FileSize / 23866 ' BluRay Standard If To_DiscKindCapacity.ToUpper = "BR-DL" Then Return FileSize / 47732 ' BluRay Double Layer If To_DiscKindCapacity.ToUpper = "BR-3L" Then Return FileSize / 95466 ' BluRay x3 Layers If To_DiscKindCapacity.ToUpper = "BR-4L" Then Return FileSize / 122072 ' BluRay x4 Layers If To_DiscKindCapacity.ToUpper = "BR-MD" Then Return FileSize / 7430.25 ' BluRay MiniDisc Standard If To_DiscKindCapacity.ToUpper = "BR-MD-DL" Then Return FileSize / 14860.5 ' BluRay MiniDisc Double Layer ' GB ElseIf FileKindSize.ToUpper = "GB" Then If To_DiscKindCapacity.ToUpper = "CD" Then Return FileSize / 0.68665 ' CD Standard If To_DiscKindCapacity.ToUpper = "CD800" Then Return FileSize / 0.77248 ' CD 800 MB If To_DiscKindCapacity.ToUpper = "CD900" Then Return FileSize / 0.84972 ' CD 900 MB If To_DiscKindCapacity.ToUpper = "DVD" Then Return FileSize / 4.37722 ' DVD Standard (DVD5) If To_DiscKindCapacity.ToUpper = "DVD-DL" Then Return FileSize / 7.91624 ' DVD Double Layer (DVD9) If To_DiscKindCapacity.ToUpper = "BR" Then Return FileSize / 23.30664 ' BluRay Standard If To_DiscKindCapacity.ToUpper = "BR-DL" Then Return FileSize / 46.61328 ' BluRay Double Layer If To_DiscKindCapacity.ToUpper = "BR-3L" Then Return FileSize / 93.22852 ' BluRay x3 Layers If To_DiscKindCapacity.ToUpper = "BR-4L" Then Return FileSize / 119.21094 ' BluRay x4 Layers If To_DiscKindCapacity.ToUpper = "BR-MD" Then Return FileSize / 7.2561 ' BluRay MiniDisc Standard If To_DiscKindCapacity.ToUpper = "BR-MD-DL" Then Return FileSize / 14.51221 ' BluRay MiniDisc Double Layer End If Return Nothing ' Argument measure not found End Function #End Region
|
|
|
|
|
|
| |
|