Results 1 to 2 of 2

Thread: Visual Basic 08/10 Tutorial | Back

  1. #1
    Senior Member
    Join Date
    Mar 2013
    Location
    Russia
    Posts
    240
    Rep Power
    5

    Visual Basic 08/10 Tutorial | Back

    So hey guys, i'm back finally.
    This Tutorial will be awesome because it's small and not hard.
    -------------------------------------
    "Computer Checker"
    -Internet Checker
    -Username Checker
    -Time/Date!
    Made the code in 20 minutes so it's easy to understand and i can't explain it.. lol
    -------------------------------------
    Items we will use:
    -5 Timers
    -1 BackgroundWorker
    -4 Labels.
    -------------------------------------
    1- Change Label1 Text to: "Internet Status:"
    2- Change Label2 Text to: "...."
    3- Change Label3 Text to: 00:00
    4- Change Label4 Text to: "User"
    -------------------------------------
    Now Let's start coding..
    -------------------------------------
    Double Click on Background worker then add this code up "Public Class Form1"
    Code:
    Imports Microsoft.Win32
    After, add this code up Private Sub Background Worker 1
    Code:
    Dim InternetStatus As Boolean
    Now it should be like this:
    Code:
    Imports Microsoft.Win32
    
    Public Class Form1
        Dim InternetStatus As Boolean
        Private Sub BackgroundWorker1_DoWork(blah blah)
    Now Type this code in Background Worker 1 Function or code area..
    Code:
    System.Threading.Thread.Sleep(1000)
            If My.Computer.Network.IsAvailable Then
                InternetStatus = True
            Else
                InternetStatus = False
            End If
    End Sub
    Now Click enter under End Sub and C+P This Code:
    Code:
    Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
    
            If InternetStatus = True Then
                Label2.Text = "Internet Connection Was Found"
                Label2.ForeColor = Color.Lime
            Else
                Label2.Text = "No Internet Connection"
                Label2.ForeColor = Color.Red
            End If
            BackgroundWorker1.RunWorkerAsync()
        End Sub
    Now Double click on your form and type:
    Code:
    BackgroundWorker1.RunWorkerAsync()
    So now we're 35% Done.
    Now Double Click on your Timer1 (Make Sure all of your timers are enabled.)
    Copy that code and paste it there:
    Code:
    If Label2.Text = "No Internet Connection" Then
                Timer1.Stop()
                Console.Beep(1000, 800)
                MsgBox("No Internet Connection!", MsgBoxStyle.Exclamation)
            End If
    Now Double Click on Timer2
    Code:
    Code:
     If Label2.Text = "Internet Connection Was Found" Then
                Timer2.Stop()
                Console.Beep(1000, 200)
                MsgBox("Your Computer Was Connected with a Internet Connection")
            End If
        End Sub
    And you're done!
    Now Easy parts.
    Click on your Timer4 and Write:
    Code:
    Code:
    Label3.Text = Timeofday
    This code for the Time.
    Now Last part of the tutorial
    Double click on your timer5 and write:
    Code:
    label4.text = Environment.UserName
    Only. lol ^^
    So yea hope you understood the tutorial, and if you need any help tell me
    Good Luck.
    Last edited by Karizan; 07-31-2013 at 02:13 AM.

    The Best VPN!
    VVV Click Below VVV


  2. #2
    Member


    kcrossey's Avatar
    Join Date
    Jun 2013
    Location
    Washington
    Posts
    97
    Rep Power
    0
    Awesome man! Thanks for releasing new stuff on SSH! Really helpful tut actually for people who do not know what to do or want something new to try. Thanks man!

    The Best VPN!
    VVV Click Below VVV


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •