VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,355 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,948 people online right now. Registration is fast and FREE... Join Now!




Recognising encrypted websites

 

Recognising encrypted websites, My webbrowser isn't correctly recognising encrypted websites.

conkerbot

29 Jun, 2009 - 04:02 AM
Post #1

New D.I.C Head
*

Joined: 29 Jun, 2009
Posts: 2

Hi.
I'm trying to make a web browser as a project over the summer holidays. It has been going well so far, but I've hit a snag. I'm trying to make it display a padlock symbol when the website is encrypted, and a open padlock symbol when the website is unencrypted. Here is the code I have got so far:

CODE
Private Sub webBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webBrowser.DocumentCompleted
        If WebBrowserEncryptionLevel.Bit128 = 1 Then
            tsslSecure.Visible = 1
            tsslInsecure.Visible = 0
        Else
            tsslSecure.Visible = 0
            tsslInsecure.Visible = 1
        End If
    End Sub


tsslSecure and tsslInsecure are the names of the secure and insecure icons. Anyway, my problem is that it is only displaying the insecure icon, never the secure one. What am I doing wrong? Please help.

Thanks in advance, and sorry if the solution is very simple. I'm just learning.

User is offlineProfile CardPM
+Quote Post


firebolt

RE: Recognising Encrypted Websites

29 Jun, 2009 - 04:39 AM
Post #2

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,463



Thanked: 75 times
Dream Kudos: 1675
My Contributions
This seems like VB.NET. Are you using VB 2003/5/8?
User is offlineProfile CardPM
+Quote Post

conkerbot

RE: Recognising Encrypted Websites

29 Jun, 2009 - 04:46 AM
Post #3

New D.I.C Head
*

Joined: 29 Jun, 2009
Posts: 2

QUOTE(firebolt @ 29 Jun, 2009 - 04:39 AM) *

This seems like VB.NET. Are you using VB 2003/5/8?


It's VB.net 2008. Sorry I posted this in the wrong bit.

This post has been edited by conkerbot: 29 Jun, 2009 - 04:47 AM
User is offlineProfile CardPM
+Quote Post

vb5prgrmr

RE: Recognising Encrypted Websites

29 Jun, 2009 - 05:50 AM
Post #4

D.I.C Regular
***

Joined: 21 Mar, 2009
Posts: 459



Thanked: 30 times
My Contributions
for secure you need to check for https


Good Luck


User is offlineProfile CardPM
+Quote Post

BetaWar

RE: Recognising Encrypted Websites

29 Jun, 2009 - 10:32 PM
Post #5

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,729



Thanked: 269 times
Dream Kudos: 1400
My Contributions
Moved to VB.net
User is offlineProfile CardPM
+Quote Post

Amrykid

RE: Recognising Encrypted Websites

30 Jun, 2009 - 01:47 PM
Post #6

D.I.C Addict
Group Icon

Joined: 16 Dec, 2008
Posts: 899



Thanked: 10 times
Dream Kudos: 350
My Contributions
QUOTE(conkerbot @ 29 Jun, 2009 - 05:02 AM) *

Hi.
I'm trying to make a web browser as a project over the summer holidays. It has been going well so far, but I've hit a snag. I'm trying to make it display a padlock symbol when the website is encrypted, and a open padlock symbol when the website is unencrypted. Here is the code I have got so far:

CODE
Private Sub webBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webBrowser.DocumentCompleted
        If WebBrowserEncryptionLevel.Bit128 = 1 Then
            tsslSecure.Visible = 1
            tsslInsecure.Visible = 0
        Else
            tsslSecure.Visible = 0
            tsslInsecure.Visible = 1
        End If
    End Sub


tsslSecure and tsslInsecure are the names of the secure and insecure icons. Anyway, my problem is that it is only displaying the insecure icon, never the secure one. What am I doing wrong? Please help.

Thanks in advance, and sorry if the solution is very simple. I'm just learning.

try using true or false instead of 1 or 0
User is offlineProfile CardPM
+Quote Post

firebolt

RE: Recognising Encrypted Websites

30 Jun, 2009 - 09:58 PM
Post #7

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,463



Thanked: 75 times
Dream Kudos: 1675
My Contributions
Maybe like this:
CODE

Private Sub webBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webBrowser.DocumentCompleted
        If WebBrowserEncryptionLevel.Bit128 = 1 Then
            tsslSecure.Visible = True
            tsslInsecure.Visible = False
        Else
            tsslSecure.Visible = False
            tsslInsecure.Visible = True
        End If
    End Sub

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 07:28PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month