Post: VB Coding Mega Thread!
07-26-2012, 09:43 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hey Guys



Back with an ultimate VB Tutorial for n00bs and some good program you can make. Here We have a console application

go onto your visual basic startpage and click new project.
click console application.

we need to display something on the console, the command for this is console.writeline("Hello World")
this will display Hello World and be waiting to enter text on the next line



this will quickly flash up Hello World and then close the console, to keep it open always write console.readline at the end of your program the program will then end after the enter key is pressed

Now We can get the user to enter a word so we must create a variable, a variable is a group in which we can store data

there are several types of variable :

integer - number (76,97,362)
single - number with decimal (3.67, 7.97)
string - any character or number/letter on the keyboard
while not all these are the most used

to create a variable we must assign it a type and a name we do this is 'dimming'

so to create a variable of someone's name we must write the following code :

Code:
dim yourname as string
you have now created your first variable.

now we must assign the input to the variable

so lets create the program written above
Code:
dim yourname as string

console.writeline("Please Enter Your Name")
yourname = console.readline

console.readline
this program will then give the variable 'yourname' the data that you have entered

to display this data you simply write:
Code:
dim yourname as string

console.writeline("please enter your name")
yourname = console.readline

console.writeline("your name is " & yourname)
console.readline




congratulations you have just written your first console program. this thread will be updated tommorow with more tutorials so keep looking at it !

See you guys later

Snoop

Display

So im back with another tutorial this time creating displays with visual basic!

so open up a new console application and we'll begin!

now everyone knows foreground is what is immediately in front of you and background is well whats is the background

so foreground is the obvious choice when picking to color text. so lets begin, using a diplay name program we are going to display your username 5 times.

so lets start writing the code :
Code:
dim myname as string
myname = "Snoop Dog"
this is writing data to a variable like we did last tutorial now for the color command

Code:
Console.ForegroundColor =
we then must assign a color to it like so :
Code:
ConsoleColor.Cyan
this can be any color within reason so just replace cyan with red or green

so now lets display our name 5 times

Code:
Dim myname As String

myname = "Snoop Dog"

Console.ForegroundColor = ConsoleColor.Cyan
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.Green
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.White
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.Yellow
Console.WriteLine(myname)

Console.ReadLine()
and dont forget the ever-most important readline!


Our First Useful Program
Tutorial 3 is our first useful program is a BMI calculator, in case you don't know what BMI is its a measurement used for how healthy someone is BMI stands for Body Mass Index and can be gained by dividing someone's weight in kilometres by there height in meters(squared).

now this is really throwing you n00bs in at the deep end but i belive you guys should be able to follow so lets start

first we will need 3 variables
height - a single as there height is probably not going to be just 2 or 1
weight - also a single as there weight is probably going to have a decimal place in
sum - also a single as there total BMI is most likely to have decimal places.

so lets firs create the variables :
Code:
dim height as single
dim weight as single
dim sum as single
no we must create a line to get the user to enter there height in meters and their weight in kilo's
Code:

console.writeline("please enter your weight in kilo's")
weight = console.readline
console.writeline("Please Enter your height in meters")
height = console.readline
now we must must create the BMI figure using the sum variable
so
i will using a picture for this one as it is easier for you to understand.
Spoiler:


so now we have created the code lets test it

here are some test data you can use :
81kg
1.92m
BMI = 22.0

50kg
1.75m
BMI = 16.4

so for the first set of test data we should be 22.0



we have got a really long deicmal number that is accurate but aslo right, lets move onto the next tutorial to see how
Formatting

Formatting is when we assign a number a certain number of decimal places or give a a format to follow so with our pervious code of BMI calculator we got a weird 21.97353 number when what we wanted was 22.0 to round up or down to a decimal place we need formatting

so lets import our previous code :



so now we need to format sum so lets go ahead and create a new variable that is still a single called final

lets now do the formatting

the command for formatting is you guessed it format, now to format we just need to assign the newly formatted variable to final
so we use the command :
Code:
final = Format(sum, 0.0)
so lets go through that 'final=' assigning format command, 'Format' command word to format, '(sum,' showing what to format and finally '0.0)' showing to format it to one decimal place.

so using our new-found formatting skills lets have a look at the result :


whats this? it still hasnt changed thats bcecuase we have forgotten to change the output of
Code:
console.writeline("Your BMI is " & sum)
to
Code:
console.writeline("Your BMI is " & final)
!!

now lets have a look :



Now your done! carry on to the next tutorial or look over this one to make sure you remeber it!

The IF Statement

So now we are going to learn about the IF statement, to learn the IF statement all you really need is logic so if you dont have logic switch off your PC and go and get a job right now. so in very professional terms a basic IF statement would be :
Code:
IF santa = true then children = happy ELSE children = unhappy
so you have the IF, then the operator then the statement that changes the outcome.

so lets design a program to allow a user to login
we will need several variable to be able to verifiable , NOTE : at the end of every IF statement you need an ELSE or and END IF.
so let create some variables:
Code:
dim password as string
then lets ask the user to login
Code:
console.writeline("Please Enter Your Password")
password = console.readline
then we will begin the verifacation begins what will do is match the user input to our defined password
Code:
IF password = "entry" then console.writeline("You Have Logged In") ELSE console.writeline("Password Incorrect")
so lets put that all together and see the results



Variable Arrays
an array is where you can assign several bits of data to the same variable, you do this by creating a variable as you normally would but after the name you put however many parts you want the variable to be split into in brackets for example :
Code:
dim mylittlearray(6) as string
this will mean your variable has 6 possible places for data.
so say we wanted to create a program to search through a arrray list we woud have to create the following variables.
Code:
dim numberlist(5) as integer
dim search as string
dim index as integer
now i will explain the last two the search is what teh user will search for, the index is a counter, evreytime the data is not found it moves it along so for example :

search = 3 and numberlist(3) = 3 however the program will start the search at numberlist(1) and so index = index + 1 will move the search long to numberlist(2) and then (3) whre it will be found so lets take a look at this code for a saerching program


i hope you enjoyed my tutorials may release more later! i will add some challenges for you guys and some programs you can create

Love You Guys ! :love:

-Snoop

CHALLENGES
BMI Calculator
Create a BMI calculator by letting the user enter their height in m and weight in kilos
(BMI is calculated by dividing the weight by the height squared)
Extensions
create menu system that allows people to enter there height in foot,inches
say that there are underweight if their BMI is under 18.5
say that they are normal if their BMI is between 18.5 and 24.9
say that they are overweight if their BMI is 25 to 29.9
say that they are obese if their BMI is over 30


Calculator
ask the user to enter 1 number then a action and then a second number
add then then display the result
Extension
ask them how many numbers they want to add so they can add three or more numbers




advanced login system
ok im guna just write the code for this one

Code:
Dim passwords(5) As String
Dim login As String
Dim index As Integer
Dim entry As Boolean



entry = False
passwords(1) = "password"
passwords(2) = "entry"
passwords(3) = "access"
passwords(4) = "allow"
passwords(5) = "admin"



Console.WriteLine("please Enter Your password")
login = Console.ReadLine

Do
If login = passwords(index) Then entry = True Else index = index + 1
Loop Until index = 5 Or entry = True

If entry = True Then Console.WriteLine("You Have Logged in")
If entry = False Then Console.WriteLine("Wrong Password")


Console.ReadLine()
Social Engineering Program For Sale!

Hey guys

got a social engineering program for sale and can also sell courses on how to make your own ad make them look believably and professional.

social engineering is where victim is tricked intpo thinking he is the hacker and using a hacking program for lets say Call Of Duty 6 For PS3, we now set up a program to make the User have to connect to his PSN account full with email, password, and even a port for realism. he then enters his details like the little hax0r he is and as soon as he clicks that button, all his details will be sent to you through a gmail account.

simple? the design part is the code part not so much so, so for a small fee of 50kvbux - 100kvbux i will make a program customised to your guys needs.

my courses will also teach you how to make one and sell it off as a real program.

Snoop out
07-27-2012, 06:52 AM #2
Sloth
Banned
Originally posted by Snoop
Hey Guys



Back with an ultimate VB Tutorial for n00bs and some good program you can make. Here We have a console application

go onto your visual basic startpage and click new project.
click console application.

we need to display something on the console, the command for this is console.writeline("Hello World")
this will display Hello World and be waiting to enter text on the next line



this will quickly flash up Hello World and then close the console, to keep it open always write console.readline at the end of your program the program will then end after the enter key is pressed

Now We can get the user to enter a word so we must create a variable, a variable is a group in which we can store data

there are several types of variable :

integer - number (76,97,362)
single - number with decimal (3.67, 7.97)
string - any character or number/letter on the keyboard
while not all these are the most used

to create a variable we must assign it a type and a name we do this is 'dimming'

so to create a variable of someone's name we must write the following code :

Code:
dim yourname as string
you have now created your first variable.

now we must assign the input to the variable

so lets create the program written above
Code:
dim yourname as string

console.writeline("Please Enter Your Name")
yourname = console.readline

console.readline
this program will then give the variable 'yourname' the data that you have entered

to display this data you simply write:
Code:
dim yourname as string

console.writeline("please enter your name")
yourname = console.readline

console.writeline("your name is " & yourname)
console.readline




congratulations you have just written your first console program. this thread will be updated tommorow with more tutorials so keep looking at it !

See you guys later

Snoop

Display

So im back with another tutorial this time creating displays with visual basic!

so open up a new console application and we'll begin!

now everyone knows foreground is what is immediately in front of you and background is well whats is the background

so foreground is the obvious choice when picking to color text. so lets begin, using a diplay name program we are going to display your username 5 times.

so lets start writing the code :
Code:
dim myname as string
myname = "Snoop Dog"
this is writing data to a variable like we did last tutorial now for the color command

Code:
Console.ForegroundColor =
we then must assign a color to it like so :
Code:
ConsoleColor.Cyan
this can be any color within reason so just replace cyan with red or green

so now lets display our name 5 times

Code:
Dim myname As String

myname = "Snoop Dog"

Console.ForegroundColor = ConsoleColor.Cyan
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.Green
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.White
Console.WriteLine(myname)

Console.ForegroundColor = ConsoleColor.Yellow
Console.WriteLine(myname)

Console.ReadLine()
and dont forget the ever-most important readline!


Our First Useful Program
Tutorial 3 is our first useful program is a BMI calculator, in case you don't know what BMI is its a measurement used for how healthy someone is BMI stands for Body Mass Index and can be gained by dividing someone's weight in kilometres by there height in meters(squared).

now this is really throwing you n00bs in at the deep end but i belive you guys should be able to follow so lets start

first we will need 3 variables
height - a single as there height is probably not going to be just 2 or 1
weight - also a single as there weight is probably going to have a decimal place in
sum - also a single as there total BMI is most likely to have decimal places.

so lets firs create the variables :
Code:
dim height as single
dim weight as single
dim sum as single
no we must create a line to get the user to enter there height in meters and their weight in kilo's
Code:

console.writeline("please enter your weight in kilo's")
weight = console.readline
console.writeline("Please Enter your height in meters")
height = console.readline
now we must must create the BMI figure using the sum variable
so
i will using a picture for this one as it is easier for you to understand.
Spoiler:


so now we have created the code lets test it

here are some test data you can use :
81kg
1.92m
BMI = 22.0

50kg
1.75m
BMI = 16.4

so for the first set of test data we should be 22.0



we have got a really long deicmal number that is accurate but aslo right, lets move onto the next tutorial to see how
Formatting

Formatting is when we assign a number a certain number of decimal places or give a a format to follow so with our pervious code of BMI calculator we got a weird 21.97353 number when what we wanted was 22.0 to round up or down to a decimal place we need formatting

so lets import our previous code :



so now we need to format sum so lets go ahead and create a new variable that is still a single called final

lets now do the formatting

the command for formatting is you guessed it format, now to format we just need to assign the newly formatted variable to final
so we use the command :
Code:
final = Format(sum, 0.0)
so lets go through that 'final=' assigning format command, 'Format' command word to format, '(sum,' showing what to format and finally '0.0)' showing to format it to one decimal place.

so using our new-found formatting skills lets have a look at the result :


whats this? it still hasnt changed thats bcecuase we have forgotten to change the output of
Code:
console.writeline("Your BMI is " & sum)
to
Code:
console.writeline("Your BMI is " & final)
!!

now lets have a look :



Now your done! carry on to the next tutorial or look over this one to make sure you remeber it!

The IF Statement

So now we are going to learn about the IF statement, to learn the IF statement all you really need is logic so if you dont have logic switch off your PC and go and get a job right now. so in very professional terms a basic IF statement would be :
Code:
IF santa = true then children = happy ELSE children = unhappy
so you have the IF, then the operator then the statement that changes the outcome.

so lets design a program to allow a user to login
we will need several variable to be able to verifiable , NOTE : at the end of every IF statement you need an ELSE or and END IF.
so let create some variables:
Code:
dim password as string
then lets ask the user to login
Code:
console.writeline("Please Enter Your Password")
password = console.readline
then we will begin the verifacation begins what will do is match the user input to our defined password
Code:
IF password = "entry" then console.writeline("You Have Logged In") ELSE console.writeline("Password Incorrect")
so lets put that all together and see the results



Variable Arrays
an array is where you can assign several bits of data to the same variable, you do this by creating a variable as you normally would but after the name you put however many parts you want the variable to be split into in brackets for example :
Code:
dim mylittlearray(6) as string
this will mean your variable has 6 possible places for data.
so say we wanted to create a program to search through a arrray list we woud have to create the following variables.
Code:
dim numberlist(5) as integer
dim search as string
dim index as integer
now i will explain the last two the search is what teh user will search for, the index is a counter, evreytime the data is not found it moves it along so for example :

search = 3 and numberlist(3) = 3 however the program will start the search at numberlist(1) and so index = index + 1 will move the search long to numberlist(2) and then (3) whre it will be found so lets take a look at this code for a saerching program


i hope you enjoyed my tutorials may release more later! i will add some challenges for you guys and some programs you can create

Love You Guys ! :love:

-Snoop

CHALLENGES
BMI Calculator
Create a BMI calculator by letting the user enter their height in m and weight in kilos
(BMI is calculated by dividing the weight by the height squared)
Extensions
create menu system that allows people to enter there height in foot,inches
say that there are underweight if their BMI is under 18.5
say that they are normal if their BMI is between 18.5 and 24.9
say that they are overweight if their BMI is 25 to 29.9
say that they are obese if their BMI is over 30


Calculator
ask the user to enter 1 number then a action and then a second number
add then then display the result
Extension
ask them how many numbers they want to add so they can add three or more numbers




advanced login system
ok im guna just write the code for this one

Code:
Dim passwords(5) As String
Dim login As String
Dim index As Integer
Dim entry As Boolean



entry = False
passwords(1) = "password"
passwords(2) = "entry"
passwords(3) = "access"
passwords(4) = "allow"
passwords(5) = "admin"



Console.WriteLine("please Enter Your password")
login = Console.ReadLine

Do
If login = passwords(index) Then entry = True Else index = index + 1
Loop Until index = 5 Or entry = True

If entry = True Then Console.WriteLine("You Have Logged in")
If entry = False Then Console.WriteLine("Wrong Password")


Console.ReadLine()
Social Engineering Program For Sale!

Hey guys

got a social engineering program for sale and can also sell courses on how to make your own ad make them look believably and professional.

social engineering is where victim is tricked intpo thinking he is the hacker and using a hacking program for lets say Call Of Duty 6 For PS3, we now set up a program to make the User have to connect to his PSN account full with email, password, and even a port for realism. he then enters his details like the little hax0r he is and as soon as he clicks that button, all his details will be sent to you through a gmail account.

simple? the design part is the code part not so much so, so for a small fee of 50kvbux - 100kvbux i will make a program customised to your guys needs.

my courses will also teach you how to make one and sell it off as a real program.

Snoop out


Hey nice guides but use
    Poop
Code tags around your bits of code
"[code.]CODE HERE[/code.]" remove the " and .
Last edited by Sloth ; 07-27-2012 at 06:55 AM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo