Código VB6:
Abrir el explorador web, ya sea Chrome, internet explorer o el que tengamos por defecto.
Usaremos el shell de windows para este caso.
Sub Main()
frmAux.Descargar 'ATENCIÓN: DEBE ESTAR SIEMPRE QUE NO SE MUESTRE EL FORMULARIO.
'ChromeUrl
'ExplorerUrl
DefaultExplorer
End Sub
Sub ChromeUrl ()
Dim iURL
Dim objShell
iURL = "www.google.es"
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "chrome.exe", iURL, "", "", 1
End Sub
Sub ExplorerUrl ()
Dim iURL
Dim objShell
iURL = "www.google.es"
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "IExplore.exe", iURL, "", "", 1
End Sub
Sub DefaultExplorer
Set objShell = CreateObject("WScript.Shell")
iURL = "www.google.es"
objShell.run(iURL)
End SubCódigo C#:
Para el ejemplo de C# ejecutaremos únicamente un proceso que abrirá el navegador por defecto.
using System;
using System.Diagnostics;
namespace AhoraScriptsVacia
{
public class Script_57 : AhoraOCX.AhoraBaseScript
{
public void Main()
{
Process.Start(new ProcessStartInfo("https://www.google.es") { UseShellExecute = true });
}
}
}¿Le ha sido útil este artículo?
¡Qué bien!
Gracias por sus comentarios
¡Sentimos mucho no haber sido de ayuda!
Gracias por sus comentarios
Sus comentarios se han enviado
Agradecemos su esfuerzo e intentaremos corregir el artículo