Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TUTORIAL] Introduction Into VB.NET
#1
NEED ACTIVATION CODES? GO HERE: http://www.itsmods.com/forum/Thread-Acti...T-Etc.html

Introduction to VB.NET


Visual Basic .NET (VB.NET), is an object-oriented computer programming language that can be viewed as an evolution of the classic Visual Basic (VB), which is implemented on the .NET Framework. Microsoft currently supplies two major implementations of Visual Basic: Microsoft Visual Studio 2010, which is commercial software and Visual Basic Express Edition 2010, which is free of charge.



System Requirements

Software Requirements
  • Visual Studio 2010 can be installed on the following operating systems:
    • Windows XP (x86) with Service Pack 3 - all editions except Starter Edition
    • Windows Vista (x86 & x64) with Service Pack 2 - all editions except Starter Edition
    • Windows 7 (x86 & x64)
    • Windows Server 2003 (x86 & x64) with Service Pack 2
    • Windows Server 2003 R2 (x86 & x64)
    • Windows Server 2008 (x86 & x64) with Service Pack 2
    • Windows Server 2008 R2 (x64)

Hardware Requirements
  • Computer that has a 1.6GHz or faster processor
  • 1 GB (32 Bit) or 2 GB (64 Bit) RAM (Add 512 MB if running in a virtual machine)
  • 3GB of available hard disk space
  • DirectX 9 capable video card running at 1024 x 768 or higher-resolution display
  • DVD-ROM Drive



Downloading an IDE

The first thing we're going to need to do is download an IDE (Integrated Development Environment) for Visual Basic.

There are not that many that I could find except for the one that ICSharpCode has developed and the one that Microsoft provides (recommended).

Once you're done downloading that, let's continue onto step 2...




Namespaces and Classes

Let's think of all these things like a toolbox. Inside this tool box you have all your various tools to fix your problems, in this case, to make your application accomplish what you need it too.

Take a look at this diagram:


[Image: namespacesandclasses.png]

As you can see the namespace is the actual toolbox, which holds your various classes, subs, and functions. (I know everyone is jelly of my mad paint skillz, I offer lessons, of course. ;3)

Namespaces are the actually container, which offers nothing but organization for everything else. While your classes, subs and functions are your actual 'tools' to 'fix' your 'problems'.

Here is an example of a namespace:

Code:
Namespace YourNamespace

End Namespace

That is how you declare a namespace. Pretty simple.

Now we'll get down to the classes. Here is how you declare a class within your namespace:

Code:
Namespace YourNamespace

  <Public/Private Keyword> Class YourClass

  End Class

End Namespace

A class is somewhat like a...mini-namespace I guess you could say, except some classes actually have a purpose and can be used to call other various items.

When you declare a class, unlike a namespace, you will notice in the IDE how it changes to a specific color:

[Image: pcpsXDwBlLbEhfBDGqGD.png]

That just makes it easier on the developer to quickly find classes. You can also change the colors of various items by viewing the end of this article where miscellaneous items are classified.

There are 2 different keywords you can use while declaring a class, one is "Public" and the other is "Private". The "Public" keyword allows your class(es) to be called anywhere in your project. There are no limits to where they can be called if it is declared as public. On the other hand, the "Private" keyword makes elements only accessible from within their declaration context. So, if I declare a class in the namespace "YourNamespace" -- I cannot call it from "YourOtherNamespace" if it is declared Private -- but if it is declared Public, I could.




Subs and Functions


Now lets take the previous diagram we used and add in the subs and functions:

[Image: namespacediagramvbnet.png]

You may notice how some of the boxes are bigger than the others, that it because, obviously, some subs and functions are larger than the others (code wise).

Now, you might be asking yourself, "What is the difference between subs and functions?", if you're not, then you just did. ;3

The main difference is Functions, while they don't necessarily have to, usually return a value. Subs are just for carrying out different tasks and they do not, and cannot, return a value.

This is how you declare a Function:

Code:
Namespace YourNamespace

  <Public/Private Keyword> Class YourClass
    <Public/Private Keyword> Function TheFuntionsName(<ByVal/ByRef> SomeArgumentName As <Object/Variable Type>)
  'Do Something
  Return "SomeThing"
    End Function
  End Class

End Namespace

You might've noticed something new in their that we have not gone over yet, that would be the ByVal and ByRef keyword. These keywords are specifically used for declaring arguments in Subs and Functions. The different between the 2 is that ByVal will not allow you to change the value of the argument within the body of the Function while ByRef will.
Credits:
SomeWhiteGuy - Original Post
[Image: uCZ3X.gif]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  TUTORIAL CHEAT ENGINE for mw3 [HARD] Tony. 5 4,708 10-24-2013, 15:22
Last Post: Tomsen1410
Question Tutorial addon! [HARD] Tony. 2 2,904 04-30-2013, 13:55
Last Post: [HARD] Tony.
  [TUTORIAL] Various Statements KrypTiK 2 2,958 01-07-2013, 21:00
Last Post: kokole
  Help Game Programming Tutorial Ich1994 8 4,857 01-01-2013, 21:21
Last Post: Ich1994
  [TUTORIAL] C# Introduction KrypTiK 4 3,378 12-30-2012, 10:06
Last Post: KrypTiK
  [TUTORIAL] Basic Syntax KrypTiK 0 2,019 12-29-2012, 20:33
Last Post: KrypTiK
  [TUTORIAL] Handling Errors in VB.NET KrypTiK 0 1,936 12-29-2012, 20:28
Last Post: KrypTiK
  [TUTORIAL] Getting to know your way around the IDE KrypTiK 0 1,960 12-29-2012, 20:23
Last Post: KrypTiK
  Help C# Tutorial on how to reset a string DidUknowiPwn 7 5,058 10-11-2012, 15:04
Last Post: DidUknowiPwn
  [Request] Tutorial mods Maurizio 0 2,016 10-04-2012, 00:18
Last Post: Maurizio

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.