Site hosted by Angelfire.com: Build your free website today!
Visual Basic


Here are some links to good VB tutorials:

Coderz Site

Microsoft's Tutorials

Planet Source Code

VB Cell

VB Information


Visual Basic is a good language for newbies and programmers that deal with basic to mid level Win32 apps. I recently was involved in a good VB project that used alot of advanced code with simple syntax. HeavenWare Solutions is a software company owned by a friend of Navic's. He hooked me up with a programming job called Homework Heaven. It's pretty cool, check it out here. The basic structure of VB is simple, you have a form which is the graphical part of the program, the source code and extra modules like a class module. You can reference DLLs and add ActiveX components to make more controls available to use.

Personally I like user input alot. I think the best thing is to beable to take user input and do anything with it. AI, in my definition is a program writing code based on input from anything like a keyboard to photosensors, heatsensors, etc. VB can do that very well based on the code files and the compiler. Anyway, theres a cool componet called the Winsock Contol, it's for TCP and UDP protocol communication. You can make a client/server program with that control.

Encrypt

This is a VB 6.0 program that takes user input text and encrypts/decrypts it. There are 2 different projects here, one is a simple encryption and one is a bit harder to crack. The first version just adds 29 to the ASCII value of each character. This is simple to crack when you encrypt 1234567890. There's a pattern there. The second version will determine if it is at an even or odd numbered position in the text. If it is even then an additional operation is perfomed on the charater. Now when you type 1234567890 and encrypt it, the pattern is harder to cypher. All the code is zipped and a compiled program is also included.

Version 1

Version 2

TCP/IP Server And Client

Here we have a client and server program written in VB that uses TCP/IP to connect, send and recieve data. Currently only text can be transmitted like an IM program. I'll update soon for file transfers. The main focus here is the Winsock Control. To activate Winsock, goto Project - Components in VB, and check Microsoft Winsock Control 6.0. Apply and click Ok and you'll notice a new icon on the toolbar to the left next to the OLE object. That's the Winsock control, to use it double click the icon and place it on the form. The user doesn't see the Winsock control so dont worry about where you place it. Now you can use all the Winsock features. For complete reference, use MSDN either online or with the CDROMs. There are alot of bugs as of now, but I put the code up anyway!

Server

Client

 

Artificial Intelligence

AI, the next big thing! Here's how I write programs that use AI. Enumerate user input to form code. Write the code to a file and compile it into the existing file. This way the program re-writes itself based on user input. Sure you can take any kind of input but this example is for computers with a keyboard. The main feature of this program is the Windows OS. VB is interfaced with Windows by API (Application Programming Interface) which gives the programmer access to the functions the OS uses. This way the program can do things a usere would do like change directory. Also with VB you can make a text file. This is good because based on the users input you can create a file with VB code! Here's a simple example:

User types: I hate you.
Program reads: hate
Program reads: you
Program writes to a file:
label1:

loop label1
Program runs:
vb6 /make project1
vb6 /run project1

The program has a table like this:

hate = label1
you = loop label1

This means the program is pissed since the user hates it and writes a file with code to loop for infinity which would freeze the system, uses VB to make the executable file then to run it. The programs revenge for the user hating it.

In this example I used simple terms, but where it gets complicated is the order. The program needs to know what data it is reading and what order it is in. Let's say the user typed: I hate school. I like you computer.
The program needs to know you wasn't right after hate in terms of hating the computer, so the program would not loop forever since the user didn't say they hated the computer.

The table of user data and code would have to be quite complex as well. A simple start would be chuncks of code which relate to a single word of user input.

Unfortunatly I do not have the time to write this program for you, so I wrote a simpler one. This uses check boxes (on off data) to formulate code and recompile. Ideas are big, work is small!

AI Project

 


VB Code To Download

All files are

Controls
This is a program i got from the net that shows how to use different controls in VB

Desktop API
This is an API program that hides the desktop and restores it.

Encrypt
This is a simple encryption/decryption program that encrypts text and decrypts it with a password

Open File
This program uses the FileSystemObject in VB to open a file and read its contents to a text box. There will be many more FileSystemObject exapmles later

Password
A simple password protection program

Win API
Another API program that returns the system directory

Call DLLs for System Info
API program that gives you system information and a sound test, very nice


Home
Programming Page