• 0

Nooby Wanting to Learn VB. :-<


Question

Hi, I know almost nothing about VB. I have spent a little time with .BAT having alot fun with it. I want to be more serious with my skill as a STARTING programmer and build a solid foundation to build on. I learn best from fallowing examples, and then re-doing it on my own, but when necessary, I am more than willing to learn textbook principals. I am a Freshman in HS, next year is the first year I will be allowed to take a full on programming course (It's Java), and I just wanted to prep. myself with some type of foundation to have a little bit of prior knowledge to build off of. I have tried starting my own little projects, and go to Youtube and such to find examples of programs to learn what does what (Teach myself basically). It seem it's too much for me to just "Dive In"(which I'm normally fine with), and to be 100% honest, I don't know where to start. I started by trying to create a simple program I call, "The Log". This is a personal KeyLogger for my personal use only, I have alot of questions, and can't find the answers to most of them. I mean, I get the basics, so I absolutely hate it when there's a person on a Tut., saying, "OK, now, you will need to click "New Project", in order to start making your new project.", or when it's SUPER NOOBY, for example, when you start VB 2008 Express, and it give you the start page with these annoying as hell guides. I mean I'm a very bright person (All Honors, no effort, A+)and when a guide is written for the average person, it bugs me alot! With all of that said, does anyone know guides that would be appropriate for me? BTW, I'm definitely visual!

Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0

I've been using vb professionally since version 2.0 and it has it's benefits and.... However since you are going to take a Java class next year I would recommend looking into C#, the change from that to Java will be much easier (I had a friend on the C# team back when I lived in Seattle)

I also think that your plan for learning by creating apps is a great way to go (ok, so that's how I learned SO many years ago)

You didn't ask for anything specific, so it's difficult to be of any specific help. What I can say that will be a good help to you is:

1) Learn a naming convention (lookup Hungarian Naming Conventions)

2) ALWAYS use exception handling. I've fired many a developer who thought, incorrectly, that their code was perfect (Makes me laugh even to think about it) Besides, even if YOUR code is perfect, the next person to change or add to your code may not be as good as you.

3) Comment your code. Add the date you created the function and why it exists

4) Before you code, create a specification for what you app should do. It'll help you. Really.

So, best of luck to you. We're around when you have a question.

Peace,

James

New York City

Link to comment
Share on other sites

  • 0

Thanks guy, this is great! I have a few Code Questions to finish up "The Log" (I can't just start somthing without finishing what I started, so, lol. :->)

Ok, Here's what I did. I have taken out the old "Exit" button, and substituted it with my own! Now I can't find a code segment to close the application on "click". Also upon clicking the new exit button, (before it exits) I would like it to auto save a .txt (of the text in"textbox") file to a specific location(C:\Users\Public\Log\) with a randomized name. Here's the segment that codes for the button:

 Private Sub btnstop_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstop.Click
		Dim Save As New SaveFileDialog()
		Dim myStreamWriter As System.IO.StreamWriter
		Save.Filter = "Text [*.txt*]|*.txt|All Files [*.*]|*.*"
		Save.CheckPathExists = True
		Save.Title = "Save to exit!"
		Save.FileName = " i "					   '&lt;--Here's where the file name is and I can't get it to randomize...
		Save.ShowDialog(Me)
		Save.AddExtension = True
		Save.DefaultExt = ".TxT"
		Try
			myStreamWriter = System.IO.File.AppendText(Save.FileName)
			myStreamWriter.Write(TextBox1.Text)
			myStreamWriter.Flush()
		Catch ex As Exception

		End Try


	End Sub

If I'm correct I will need to create a new sub for this to close upon click.

Link to comment
Share on other sites

  • 0

You have your "random" value as a quote i unquote. Since I don't know where "i" is being set (that sentence is SO gramatically f'ed up!) I cant say how to make it random. Though I don't see the value of a random file name... but that's my problem. If you want something more random, look into creating a GUID. A GUID is a Global Unique IDentifier. It's a 32 to 34 length string that is VERY unique. I'm in system hell at work but you can find how to create one with a quick google search.

To close the app use:

Me.Close

End

Best of luck.

Link to comment
Share on other sites

  • 0

http://www.codeproject.com/

you should visit this websites.

Tons of tuts and source code for all levels.

You should also learn to use google a lot.

Having 2 instances of firefox with 10 tabs open each when I search something is common for me.

The reason is that I compare the websites on the same subject because in programming there isn't one way to do one thing.

So I can decide which one is better. Also different people explaine differently too.

Also please learn to use enter and space.

It's difficut to read your post and one thing that a programmer has to learn is writting a clean code so that others can read it.

I would also suggest to learn C# like others did. C++ is always the best to know but also the more difficult to learn.

Link to comment
Share on other sites

  • 0
Also please learn to use enter and space.

It's difficult to read your post and one thing that a programmer has to learn is writing a clean code so that others can read it.

(that sentence is SO gramatically f'ed up!)

You guys are talking about my code structure, right?

I just copied it off of my VB Code View, it aligns it for me. I guess when I look back at the Code View, it is alot more spaced out.

If you were talking about my English grammar, I just forgot a coma and a word. :-\

"Here's what* the file name is,* and I can't get it to randomize", or basically, " i " is the default file name (right now), and I want to know how to get it to randomize (or add a 1,2,3,4, ect. to the end of the new file, if the current file name is already taken).

Sorry about my grammar, :-/, it was late last-night when I posted that. I could also be the Shakespeare I'm reading in Literature, lol. :p

Link to comment
Share on other sites

  • 0

I wasn't refering to your code structure but to your first post in this thread.

I was just saying if you did wrote your code the same way, it would be tough for others to read it.

It need more space but your other posts are fine.

Edited by coderomega
Link to comment
Share on other sites

  • 0

Not your grammer, mine. (it's a ref to the sentence prior to the comment.)

Your code structure is fine for ME...

The function you are looking for to randomize a number is; RND

However there will be an issue using that as you can end up with multiple files with the same name. I don't know why you are using a random name for your file, but I still think that greating a GUID will solve your problem.

Dim sFileName as String = System.Guid.NewGuid

Link to comment
Share on other sites

  • 0
Anyways, C is alot better,makes more sense.

Yeah, I have started just today on C#. I have down the basics.

Event Handler(When this happens...)

Event (This happens to this, or this changes)

I also know about Strings, and how they change with numeric values (int. and double)

That's just in about an hour though. Here's my Thanks App. dedicated to you guys.

namespace The Thanks App!
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void form1_Load(object sender, EventArgs e)
		{
			String STOP;
			STOP = "Can't Do that, I havn't thanked you enough!";

			MessageBox.Show("Thank You!");
			MessageBox.Show("Would you like to Exit?");
			MessageBox.Show(STOP);
			MessageBox.Show("Thank You!");
			MessageBox.Show("Thank You!");
			textBox1.Text ("Click the Start button to Start!")
		}


	   private void form1_Close(object sender, EventArgs e)
		{
			String STOP;
			STOP = "Can't Do that, I havn't thanked you enough!";
				   MessageBox.Show("STOP");
		}


	   private void button1_MouseOver(object sender, EventArgs e)
	   {
		  textBox1.Text ("CLICK THE START BUTTON!");
	   }


	   private void button1_Click(object sender, EventArgs e)
	   {
		  textBox1.Text ("Ok, I just wanted to say thanks!");
	   }


	}
	}

Lol. There are probably SOO many errors it's incredible.

Link to comment
Share on other sites

  • 0
Yeah, I have started just today on C#. I have down the basics.
C# is pretty much VB with curly braces, so learning these two languages together isn't that much of an overhead. C (plain old 'C') is quite another beast. But I suggest you stick with a language or two until you are comfortable with most of its concepts and have done a few little applications with it, instead of spreading too much. VB and C# are nice choices.

Your code looks fine at first sight.

Link to comment
Share on other sites

  • 0

First figure out what .NET "is". Try this link: http://www.csharp-station.com/

Don't worry about going through all the tutorials right now.

Once you have a good idea on how the .NET Framework is comprised and how it works, start looking for free code examples. E.G., search for a .NET keylogger and examine the source. If you have questions about the code samples, post them and we would surely assist in helping you understand it.

Here are three more helpful sites:

http://www.asp.net/

http://codeplex.com

http://codeproject.com

Link to comment
Share on other sites

  • 0

Wow, thanks guys for all the support. This is wonderful! I Finished my VB KeyLogger! It's meaty, but works well. Now I am going to move on to all of your suggestions. :-)

UPDATES:

OK, I have downloaded Visual C# 2008 Express Edition. I have also watched a few videos just touching the foundation of coding for C#(Definitely Basics).

Now, I am going to review the .NET for C#, which is the structure of the code, correct?

_________________________________________________________________________________________

Just to start getting ideas generated, what should my next simple application be in C#? You could think of it as my next integrated learning project.

BTW don't think up something with literally no meaning, like a program that is nonfunctional. Like if I press a button, then the text Box will show certain text. :-\

I'm always up for the next challenge! - Keep'em comin...

__________________________________________________________________________________________

EDIT:

I just started looking for .NET info, and it has been an epic fail on my part. Here are a few questions I should have asked before I started on this quest.

What exactly is .NET, like I said above, is it the structure of some codes?

Also, when I went to start, I was overwhelmed with an abundance of references to sites that I had no clue as to what specifically I was looking for. Help?! Lol.

That leads me to this question. What is the most efficient way to learn a language well? Like what order should I learn key elements in, code then structure or the other way?

Also, as I went on to make some really simple programs, I forgot some of the basic structures and elements I had learned. I guess it's not going to stick with me until I use it alot?

Edited by PVVnT(0)L
Link to comment
Share on other sites

  • 0

.NET is the platform you're targeting when you code in VB or C#. That means that instead of coding for Windows or for Linux, you code for a software layer that sits on top of the OS. .NET can run on multiple different OSes.

.NET manages the low-level aspects of your applications as they run, and it also provides a vast array of classes; all those System.This and System.That are all part of .NET.

Contrast this with Java, where you target the Java platform, or system languages like C or C++ where you write directly for the OS and do more grunt work yourself.

Link to comment
Share on other sites

  • 0

I took QuickBasic, VB, C++, and Java along with HTML/Dynamic HTML, ASP, SQL, and PL/SQL.

*shudders* NOT my thing!

I'm more of networking-specialized. I took System Development, Windows and Linux (*shudders* at Linux) Admin, Firewalls/Network Security, Info Systems, and even Computer Forensics.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.