[VB.NET] Links openen in aparte vensters

Pagina: 1
Acties:

  • The Dud3
  • Registratie: Maart 2002
  • Laatst online: 10-07 15:18
Ik heb een progje gescherven dat kijkt of er in het registry een bepaalde entry is, en of hij niet "" is, en dan die entry (een URL) opent in de standard browser.

code:
1
2
3
4
5
6
7
8
9
10
11
        Dim i As Integer
        For i = 1 To 99
            Dim temp As String = registryLookUp(i)
            If temp <> "0" Then
                Try
                    System.Diagnostics.Process.Start(temp)
                Catch
                    MsgBox("Error: " & vbCrLf & vbCrLf & temp & vbCrLf & vbCrLf & "is not a valid URL.")
                End Try
            End If
        Next i


RegistryLookUp() staat dus in een standaardmodule, en retourneert "0" als de registrykey niet bestaat of leeg is.

Het probleem is nu dat hij de pagina's wel opent, maar in het zelfde venster.
Als ik bijvoorbeel www.google.com en www.tweakers.net wil opstarten, dan opent er zich een venster, en zie ik een ogenblijk google, die dan vervangen wordt door t.net.
Ik zou natuurlijk kunnen een nieuw IE venster kunnen maken door
code:
1
Shell("iexplore.exe -new " & temp)
te doen, maar dan zit ik vast aan IE.

Ik wil dus een nieuw venster van de standaardbrowser opennen.

The opinions stated in the above post are purely those of the author,
and do not represent intelligent life of any form.


Verwijderd

Hmm, dat kan volgens mij niet..
Zover ik weet is er in ieder geval geen standaardmethode voor iedere browser.

  • The Dud3
  • Registratie: Maart 2002
  • Laatst online: 10-07 15:18
Verwijderd schreef op 17 september 2003 @ 12:50:
Hmm, dat kan volgens mij niet..
Zover ik weet is er in ieder geval geen standaardmethode voor iedere browser.
Zijn er buiten IE eigenlijk nog andere browsers die dit doen?
Anders stop ik er gewoon een "IE check" in :p

The opinions stated in the above post are purely those of the author,
and do not represent intelligent life of any form.


  • whoami
  • Registratie: December 2000
  • Laatst online: 22:54

https://fgheysels.github.io/


  • The Dud3
  • Registratie: Maart 2002
  • Laatst online: 10-07 15:18
Een beetje, maar ik kan geen VB6 ;)
Ik heb wel dit gevonden, maar dat helpt me ook niet echt :(

The opinions stated in the above post are purely those of the author,
and do not represent intelligent life of any form.


Verwijderd

Kan je niet in het register kijken dan voor de standaardbrowser en die dan starten???? Ik weet het ook niet precies waar dat in het register staat maar misschien kijken met welk programma een .html bestand wordt geopend....

  • The Dud3
  • Registratie: Maart 2002
  • Laatst online: 10-07 15:18
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Dim i As Integer
        For i = 1 To 99
            Dim temp As String = registryLookUp(i)
            If temp <> "0" Then
                Try
                    Dim ExtReg As RegistryKey = Registry.ClassesRoot
                    Dim AppReg As RegistryKey = Registry.ClassesRoot
                    Dim xStr As String

                    ExtReg = ExtReg.OpenSubKey(".HTML")
                    xStr = ExtReg.GetValue("")
                    AppReg = AppReg.OpenSubKey(xStr & "\shell\open\command")

                    Dim SplitArray() As String
                    SplitArray = Split(AppReg.GetValue(""), """")
                    System.Diagnostics.Process.Start(SplitArray(1), temp)
                Catch
                    MsgBox("Error: " & vbCrLf & vbCrLf & temp & vbCrLf & vbCrLf & "is not a valid URL.")
                End Try
            End If
        Next i

Zo werkt het :)
Ty allemaal _/-\o_

The opinions stated in the above post are purely those of the author,
and do not represent intelligent life of any form.

Pagina: 1