Les Snippets

Connexion

Lancer une page web (url) avec le navigateur par défaut

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 02/11/2008 17:56:13 et initié par PCPT [Liste]
Date de mise à jour : 02/11/2008 20:59:21
Vue : 9094
Catégorie(s) : API, Réseau & Internet, Trucs & Astuces
Langages dispo pour ce code :
- VB6, VBA
- VBScript
- VB 2005, VB 2008, VB.NET 1.x
- VB 2005, VB 2008, VB.NET 1.x
- C# 1.x, C# 2.x, C# 3.x



Langage : VB6 , VBA
Date ajout : 02/11/2008
Posté par PCPT [Liste]
DateMAJ : 02/11/2008
Private Const SW_SHOWNORMAL As Long 1&
Private Const SW_MAXIMIZE   As Long 3&
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As LongByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As  Long
'
Public Sub RunUrl(ByVal sUrl As StringOptional ByVal bMaximized As Boolean = False)
    ShellExecute 0&"open", sUrl, vbNullString, vbNullString, IIf(bMaximized, SW_MAXIMIZE,  SW_SHOWNORMAL)
End Sub

Langage : VBScript
Date ajout : 02/11/2008
Posté par PCPT [Liste]
DateMAJ : 02/11/2008
Sub RunUrl(sUrl, bMaximized)
 Dim oShell
 Set oShell = WScript.CreateObject("WSCript.shell")
 If bMaximized = True Then
    oShell.run sUrl, 3
 Else
    oShell.run sUrl, 1
 End If
 Set oShell = Nothing
End Sub

Langage : VB.NET 1.x , VB 2005 , VB 2008
Date ajout : 02/11/2008
Posté par PCPT [Liste]
DateMAJ : 02/11/2008
Public Sub RunUrl(ByVal sUrl As String)
    Dim As New System.Diagnostics.Process
    p.Start(sUrl, String.Empty)
    p.Dispose()
End Sub

Langage : VB.NET 1.x , VB 2005 , VB 2008
Date ajout : 02/11/2008
Posté par PCPT [Liste]
DateMAJ : 02/11/2008
<System.Runtime.InteropServices.DllImportAttribute("shell32.dll", SetLastError:=True)> Shared Function ShellExecute(ByVal hwnd As IntPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer
End Function
'
Public Sub RunUrl(ByVal sUrl As StringOptional ByVal bMaximized As Boolean = False)
    ShellExecute(0&"open", sUrl, String.Empty, String.Empty, IIf(bMaximized, 3, 1))
End Sub

Langage : C# 1.x , C# 2.x , C# 3.x
Date ajout : 02/11/2008
Posté par PCPT [Liste]
DateMAJ : 02/11/2008
    [System.Runtime.InteropServices.DllImportAttribute("shell32.dll", SetLastError = true)]
    static extern int ShellExecute(int hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
    //
    public void RunUrl(string sUrl, bool bMaximized)
    {
        ShellExecute(0"open", sUrl, string.Empty, string.Empty, (bMaximized == true) ? 3  : 1);
    }


Snippets en rapport avec : Web, Url, Page, Défaut, Navigateur



Codes sources en rapport avec : Web, Url, Page, Défaut, Navigateur

{Delphi} OUVRIR UNE URL DANS UNE OU PLUSIEURS FENÊTRES, QUEL QUE SOIT LE NAVIGATEUR PAR DÉFAUT
Ouvrir une fenêtre, voire plusieurs dans le navigateur, c'est facile. Mais tout le monde n'a pas Int...

{Visual Basic, VB6, VB.NET, VB 2005} LANCER UNE PAGE WEB À PARTIR DE SON APPLI.
Grâce à ce petit bout de code que déjà beaucoup ont essayé de trouver, vous pouvez permettre à votre...

{Visual Basic, VB6, VB.NET, VB 2005} OUVRIR UNE URL
Comment puis-je Ouvrir une URL dans le navigateur par défaut ? Mettez ce code dans un Module :...

{Javascript / DHTML} ROTATION DES ÉLÉMENTS D'UN PAGE WEB
Je sais que le titre n'est pas très approprier, car ce javascript reprend tous les éléments d'un pag...

{Javascript / DHTML} NAVIGATEUR INTERNET AVEC ONGLETS
C'est un petrit naviagteur internet réalisé à l'aide de plusieurs sources. Ils disposent de la plup...

{Visual Basic, VB6, VB.NET, VB 2005} NAVIGATEUR WEB MODIFIÉ
Bonjours, Je poste ici un navigateur web qui avait déjà été poster sur ce site il y a environ 2 ans...

{C# / C#.NET} NAVIGATEUR WEB SIMPLE
Ce programme est une traduction en C# du programme VB http://www.vbfrance.com/code.aspx?ID=38656 ...

{Visual Basic, VB6, VB.NET, VB 2005} NAVIGATEUR INTERNET A DEUX PAGE
C'est un navigateur internet qui sert à naviguer sur deux page en même temps. Une page en haut, une ...

{Visual Basic, VB6, VB.NET, VB 2005} NAVIGATEUR WEB TRANSPARENT
Cette application est un navigateur web simpliste mais qui a pour originalité d'être transparent, on...

{C# / C#.NET} RÉCUPERER LES LIENS SUR WWW.ALLOSERIES.NET
www.alloseries.net est un site qui propose légalement de télécharger des épisodes de diverses séries...