|
81
|
Programación / Scripting / Saveis si este codigo se puede utilizar para megavideo?
|
en: 25 Marzo 2010, 01:13 am
|
Este codigo es util para controlar los videos en megavideo?. Supuestamente es para youtube. insertamos el video <script type="text/javascript" src="swfobject.js"></script> <div id="ytapiplayer"> Se necesita una versión de Flash Player superior a 8 y javascript, para ver este video. </div>
<script type="text/javascript">
var params = { allowScriptAccess: "always" }; var atts = { id: "myytplayer" }; swfobject.embedSWF("http://www.youtube.com/v/VIDEO_ID&enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "425", "356", "8", null, null, params, atts); </script>
function onYouTubePlayerReady(playerId) { ytplayer = document.getElementById("myytplayer"); }
</script>
<a href="javascript:ytplayer.playVideo()">Reproducir</a> fuente : http://www.polargeek.net/controlar-videos-de-youtube-con-javascript/Ahi forma de hacerlo con megavideo?
|
|
|
85
|
Programación / .NET (C#, VB.NET, ASP) / MSScriptControl
|
en: 19 Febrero 2010, 20:37 pm
|
Tengo un codigo vbs y lo estoy ejecutando desde vb 2005 express con
MSScriptControl.ScriptControlClass
Me tira el error de que falta el objeto wscript
pero si lo ejecuto el vbs sin vb.net si funciona asi que creo que es cosa del vb 2005
Saveis que es lo que pasa?. Por que no reconose a wscript?
|
|
|
86
|
Programación / Scripting / Ayuda con este codigo. error(WScript.scriptfullname)
|
en: 19 Febrero 2010, 15:18 pm
|
Tengo este codigo y lo estoy ejecutando desde vb 2005 express. Me tirava el error de que faltaba el objeto wscript asi que agregue esta linea: Set Wscript = CreateObject("WScript.SHELL") Pero ahora me tira otro error en esta linea Al pareser no es miembro de wscript, Saveis que es lo que pasa?. Por que no reconose a wscript? Que tipo de objeto debo crear? 'RunAs Admin! Set Wscript = CreateObject("WScript.SHELL")
If IsAdmin() = False Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & _ Wscript.ScriptFullName & Chr(34), "", "runas", 1 Wscript.Quit 0 msgbox() End If
'Remove any previous instances and install a fresh version 'Run("cscript uninstall_tap.vbs uac") driver = ScriptPath() & "Windows_" & GetOSArchitecture() driverhelper = Chr(34) & driver & "/driverhelper.exe" & Chr(34) inf = Chr(34) & driver & "/IpopTap.inf" & Chr(34) Run(driverhelper & " Install " & inf & " IpopTap")
res = Run(driverhelper & " Status IpopTap") 'Make sure the device is installed and that it has the correct name! If ChangeNetworkName(res, "tapipop") = 0 Then Wscript.Echo "Installation Successful!" Else Wscript.Echo "Installation Failed! Please uninstall and then reinstall again." End If
'Changes the Network Name given a PnpInstanceID 'Note: Windows does a poor job of cleanup and often times, uninstalled devices will have ' the PnpInstanceID of running devices. Because of this, all devices with a given ' PnpInstanceId will be renamed Function ChangeNetworkName(pnpInstanceID, name) Const HKEY_LOCAL_MACHINE = &H80000002 Const NETWORK_CONNECTIONS = "SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}" Dim oReg, path Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") oReg.EnumKey HKEY_LOCAL_MACHINE, NETWORK_CONNECTIONS, arrSubKeys Set WshShell = WScript.CreateObject("WScript.Shell") ChangeNetworkName = 1 For Each subkey In arrSubKeys path = "HKLM\" & NETWORK_CONNECTIONS & "\" & subkey & "\Connection\" 'Turn error reporting off On Error Goto 0 On Error Resume Next id = wshShell.RegRead(path & "PnpInstanceID") If id = pnpInstanceID Then wshShell.RegWrite path & "Name", name ChangeNetworkName = 0 Exit For End If Next End Function
'Executes the app and returns the first line from StdOut Function Run(app) Dim oExec, WshShell Set WshShell = CreateObject("Wscript.Shell") Set oExec = WshShell.Exec(app)
Do While oExec.Status = 0 Loop Run = OExec.StdOut.ReadLine() End Function
'Returns 32 or 64 for the OS Architecture Function GetOSArchitecture() GetOSArchitecture = "64" On Error Goto 0 On Error Resume Next Set WshShell = WScript.CreateObject("WScript.Shell") Const KEY = "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE" arch = WshShell.RegRead(KEY) If arch = "x86" Then GetOSArchitecture = "32" End If End Function
Function ScriptPath() ScriptPath = Left(WScript.ScriptFullName, _ Len(WScript.ScriptFullName) - Len(WScript.ScriptName)) End Function
Function IsAdmin() IF Instr(1, "XP", Run("%comspec% /c ver | findstr XP"), 0) = 0 Then IsAdmin = True Exit Function End If
'Check for elevated IsAdmin = RunCleanExit("%comspec% /c whoami /all | findstr /I /C:""S-1-16-12288""") End Function
Function RunCleanExit(app) RunCleanExit = False Set oShell = CreateObject("WScript.Shell") Set oExec = oShell.Exec(app)
Do While oExec.Status = 0 Loop If oExec.ExitCode = 0 Then RunCleanExit = True End If End Function
|
|
|
88
|
Programación / .NET (C#, VB.NET, ASP) / Guardar el contenido de un textbox en la configuracion de la aplicacion. (vb.ne)
|
en: 16 Febrero 2010, 21:43 pm
|
Hola gente. Estoy intentando guardar en la configuracion de la aplicacion un textbox, pero nada de nada. Con el checkbox si lo consegui de esta forma. my.settings.checkbox = my.checkbox1.checked
y lo cargo en el load del formulario asi my.checkbox1.checked = my.settings.checkbox
Todo esto declarando my.settings.checkbox como boolean. El problema ahora es el textbox, lo declaro como string y guardo la configuracion asi: my.settings.textbox1 = my.textbox1.text
Y lo cargo al inicio asi: my.textbox1.text = my.settings.textbox1
Pero nada de nada. Alguien save que puede estar pasando?.
|
|
|
89
|
Programación / .NET (C#, VB.NET, ASP) / tabcontrol (vb.net). Cambiar de tab mediante codigo.
|
en: 7 Febrero 2010, 22:59 pm
|
La cuestion es que necesito que al picar en el tab2 examine aver si existe un archivo y si no existe pues vuelbe al tab1 y si existe pues se keda en el tab2. Saveis como llamo nuevamente al tab1?. Private Sub TabPage2_HandleCreated(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabPage2.HandleCreated If File.Exists("c:\fichero.txt") Then MsgBox("Existe", MsgBoxStyle.Information) Else
'Aqui va el codigo que llama al tab1 nuevamente. pero como lo llamo? End If End Sub
Intente con tab1.select(). Pero nada
|
|
|
90
|
Programación / PHP / Llamar a una funcion javascript desde un href de php.
|
en: 7 Febrero 2010, 13:00 pm
|
Esta es la funcion a la que quiero llamar: function fwrite_x(folder,filename,data,mode){ //fwrite_x v1.0 byScriptman //modes: 0:si no existe, regresa false ;1: sobreescribe; 2:append. filename=folder+filename; if(fso.FileExists(filename) == false&&mode==0) return false; if(fso.FileExists(filename) != false&&mode==2) { tf = fso.OpenTextFile(filename,1); var dataold = tf.readall(); tf.close(); } else dataold=""; var tf = fso.CreateTextFile(filename,2); tf.write(dataold+data); tf.close(); return true; }
y la quiero llamar desde aqui: echo "<a class=\"toplinkbox\" href=\"javascript:fwrite_x("c:\","archivo.txt","Prueba de escritura",2);"><b>$customtitle</b></a>";
Saveis que estoy haciendo mal?
|
|
|
|
|
|
|