You are viewing our Forum Archives. To view or take place in current topics click here.
[C#] Post your code snippets here!
Posted:
[C#] Post your code snippets here!Posted:
Status: Offline
Joined: Feb 22, 201113Year Member
Posts: 4
Reputation Power: 0
Basically I am taking the step which some people wonder on, switching from VB - C#!
Therefore I am in need of some basic codes, from message box - login!
Give me what you have please guys I will be very thankful, hopefully I'll be able to stick it out on C# I know all the benefits it's just getting into it all I guess...
Anyway thanks for your time, Robbo.
Therefore I am in need of some basic codes, from message box - login!
Give me what you have please guys I will be very thankful, hopefully I'll be able to stick it out on C# I know all the benefits it's just getting into it all I guess...
Anyway thanks for your time, Robbo.
#2. Posted:
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Nice to see some people switch.
Well, anyway, in C#, you need to tell the computer what it execute by doing this
private void button1_Click (EventArgs, e)
{
*PUT YOUR CODE HERE*
}
And, at the end of every statement, you put a ';' so the computer knows when to stop.
A message Box would look like this.
Hope I helped.
Well, anyway, in C#, you need to tell the computer what it execute by doing this
private void button1_Click (EventArgs, e)
{
*PUT YOUR CODE HERE*
}
And, at the end of every statement, you put a ';' so the computer knows when to stop.
A message Box would look like this.
private void button1_Click (EventArgs, e)
{
MessageBox.Show("i_r_Trolling is the best!");
}
Hope I helped.
- 2useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
I have like 19 C# tuts on my channel [ Register or Signin to view external links. ] .
But here are some code snippets:
In C#, instead of using things like "then" and "end if" you use {}
So an if statement would look something like this:
And when creating new things like variables or BinaryWriters, you don't use "Dim"
It would look like this:
Hope that helped
But here are some code snippets:
In C#, instead of using things like "then" and "end if" you use {}
So an if statement would look something like this:
if (textBox1.Text == "")
{
button1.Enabled = false;
MessageBox.Show("You need to input text in order to continue!", "Error");
}
And when creating new things like variables or BinaryWriters, you don't use "Dim"
It would look like this:
string myString = "Hello World.";
OpenFileDialog ofd = new OpenFileDialog(); //that "formula" works for all those
Hope that helped
- 2useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Also, in declaring shizzle, in VB you would use Dim.
In C# it looks like this.
In C# it looks like this.
OpenFileDialog ofd = new OpenFileDialog();
- 0useful
- 1not useful
#5. Posted:
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Well you shouldn't even learn c# if you already know vb.net. You should move onto a harder langauge that would benifit you a lot more like c++ or lua or some non .net dependency language.
- 0useful
- 1not useful
#6. Posted:
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
RDCAx wrote Well you shouldn't even learn c# if you already know vb.net. You should move onto a harder langauge that would benifit you a lot more like c++ or lua or some non .net dependency language.
Actually, C# is a very good switch from VB, as it helps to understand more about how C Programming works.
- 2useful
- 0not useful
#7. Posted:
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
i_r_Trolling wroteIts more of a waste of time. Your supposed to chose a beginner language then move onto something harder, not onto something of the same skill level.RDCAx wrote Well you shouldn't even learn c# if you already know vb.net. You should move onto a harder langauge that would benifit you a lot more like c++ or lua or some non .net dependency language.
Actually, C# is a very good switch from VB, as it helps to understand more about how C Programming works.
- 0useful
- 1not useful
#8. Posted:
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
RDCAx wrotei_r_Trolling wroteIts more of a waste of time. Your supposed to chose a beginner language then move onto something harder, not onto something of the same skill level.RDCAx wrote Well you shouldn't even learn c# if you already know vb.net. You should move onto a harder langauge that would benifit you a lot more like c++ or lua or some non .net dependency language.
Actually, C# is a very good switch from VB, as it helps to understand more about how C Programming works.
Actually, C# isnt the same skill level. C Programming is a lot more harder than VB and C#, C++ evolves off of the C Programming language. And how are you 'suppose' to pick a harder language? You can pick what ever feels better to learn. In my opinion, and a lot of others opinion, C# is a very good move as it will help you if you decide to learn C++.
- 1useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.