I have knowledge of programing with C#. But i'm not sure about how I can better my skills in this programming language. Can anyone suggest me a point to start? Or, if anyone requires any help with their projects, please let me know.
Thnaks.
Printable View
I have knowledge of programing with C#. But i'm not sure about how I can better my skills in this programming language. Can anyone suggest me a point to start? Or, if anyone requires any help with their projects, please let me know.
Thnaks.
Write more code. The best way to learn is to do. Think of an interesting problem and solve it.
Hey Dragster93
if you really want to improve your skill, check out what you think you can't do, and try to do it.
This way you will research some stuff, learn and improve your skill. Just recently I learned how to correctly connect to SQL using LINQ and do whatever I want to the SQL stuff. I know there is way more to learn but this is how I learn, 1 thing at a time, master it and then move to the next thing ;)
Hope this helps you,
ClayC
Yes indeed it did help out A LOT!!!! =)
Thank You ClayC and BigEd781!!! =)
Hey could you guys help me out???
I'm gonna start out by creating all kiddish stuff in the starting because it's be a few months since I created a prgram. For each of the programs that I develope, if you guys have any suggestions, then feel free to post them!!!! ;)
I will post the description of each program that I develope.
hmmm, to get back on track you might want to start by doing a calculator. This should take an hour or so, just so you don't feel rusty anymore. Then you should move on to maybe a basic windows media player thing.
that should get you going well, but it all depends on the time you have and also the final project, if I knew those I could help you out alot more ;)
ClayC
Well at the moment, I've got all the time in the world because I'm currently searching for a job as a C# Software Developer so until I get the job, I'm gonna be free all the time! Ofcourse, I'm not gonna spend all the 24 hours of my day doing programming only!
And yes, you could'nt be more right! A claculator should'nt take more than an hour or so. I shall start with that only. Thanks for the idea! =)
Btw, the WMP might be a little tricky because this is the first time I'm making a media player. Or maybe I feel that it might be complicated because I've never made one before! :P
I shall start working on the calculator at night and will post a message over here when I'm done.
As far as the final project is concerned, I have 2 objectives - Better my skills in overall C# Software Developement, Better my skills in XNA Game Developement using C#.
The overall C# Software Development is my main concern because I need to better my skills if I ever hope to get a job as a Software Developer. (Especially in the place where I live!!! ;) )
The game developeent is just like a side project that I wish to do. But if I could get a job a game developer, IT WOULD BE AWESOME! =)
Well the media player can get really frastrating to create as it requires lots of steps etc.. but the one I said is pretty straight forward stuff.
A couple of buttons, maybe a couple of labels, and some events, have a folder dialog so people can select the folder they wanna focus on and then in a list box show all the files in that folder.
on double click for the list box just check the selected and throw the data to the windows media player control. basically axWindowsMediaPlayer1.URL = folder + file;
I think that doing the media player will get you started again, then maybe add more stuff to it, like an sql database, let them add the songs to it and have a library, playlists, etc...
When you're at that point I might have some more ideas for you :P
basically I am trying to get you going on every single aspect, basics, advanced etc... cause if you find a job, you don't wanna be rusty there ;)
and I am 100% sure the last thing you need after work is to do programming :P
anyways wish you all the best and good luck finding the job :D
ClayC
Any time ;)
yo clayc, my apologies for the late reply....I had to download Visual C# Express Edition 2008 since I lost my Visual Studio 2005 DVD....The first download was ****! And after that, everything just started to go downhill! But anyways, I'm back on track now....
So, now I'm having a small problem in that Calculator you told me to create.
Here's my code:
public partial class Form1 : Form
{
int num1, num2;
Form1 frmCalc = new Form1();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void btn_0_Click(object sender, EventArgs e)
{
frmCalc.txt_Calc.Text = "0";
}
}
While compiling, it throws an exception saying "An unhandled exception of type 'System.StackOverflowException' occurred in WindowsFormsApplication1.exe"
When I checked online, the help said that this usually means that your calling something that was used to call the thing that you're using now. So basically, infinite loop.
Please help.
You are running out of stack space because you creating new instances of the form within it self.
When the program starts you create an instance of the form in the application.Run command. The form gets instantiated but since one of it's fields is an instance of itself, it tries to create another Form1 instance, which creates an instance of itself and keeps on going until it runs out of stack space.Code:
public partial class Form1 : Form
{
int num1, num2;
Form1 frmCalc = new Form1();
...
}
The bottom line: just comment out the line in red above.
Thanks for explaining that to me Arjay! It really helped in clearing my doubt! :)
Actually the reason why I created that object was so that I can access the control located in 'Form1'.
But I just realised how stupidly I was doing things in the wrong way! :P
Ok, now I've got another small problem.
Here's my code:
public partial class Form1 : Form
{
int num1, num2;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void btn_0_Click(object sender, EventArgs e)
{
txt_Calc.Text = "0";
}
private void btn_1_Click(object sender, EventArgs e)
{
txt_Calc.Text = "1";
}
private void btn_2_Click(object sender, EventArgs e)
{
txt_Calc.Text = "3";
}
private void btn_3_Click(object sender, EventArgs e)
{
txt_Calc.Text = "4";
}
private void btn_5_Click(object sender, EventArgs e)
{
txt_Calc.Text = "5";
}
private void btn_6_Click(object sender, EventArgs e)
{
txt_Calc.Text = "6";
}
private void btn_7_Click(object sender, EventArgs e)
{
txt_Calc.Text = "7";
}
private void btn_8_Click(object sender, EventArgs e)
{
txt_Calc.Text = "8";
}
private void btn_9_Click(object sender, EventArgs e)
{
txt_Calc.Text = "9";
}
private void btn_add_Click(object sender, EventArgs e)
{
int.TryParse(txt_Calc.Text, out num1);
MessageBox.Show(num1.ToString());
}
}
With this code I'm able to click on each NUMBERED button and display it's value in the textbox. But each time I click on another NUMBERED button, the previous value in the textbox gets replaced by the current number. So basically, I can only enter one number.
Please help.
Start by watching these: http://www.youtube.com/watch?v=PlPX44yxdZM
Ok this is gonna sound stupid, but how do I get the program to work on a pc that doesn't have .net framework??? :P
Could somebody please answer my question???
Create a setup program for your application, detect if the .net framework is present on the target machine and install it if it doesn't exist. This is pretty much built-in if you create a Visual Studio setup project.
Hi Dragster93, before all, sorry for my bad english.
This is my first post in this forum.
If your application was compiled (your solution generated) in Visual Studio 2003/2005/2008, will not work on a pc that haven't the .Net Framework installed.
Do what Arjay says. You can detect if a system have installed the framework by the application installer, with a few lines of code (in my case, I use NSIS to generate the installer package).
Your calc replaces the content of txt_Calc.Text, because you put the code this way:
txt_Calc.Text = "9";
instead of:
txt_Calc.Text += "9";
doing
txt_Calc.Text += "9";
is the same thing that doing
txt_Calc.Text = txt_Calc.Text + "9";
I hope it can be understandable and useful.
Alright, I've started out with the design of the media player. But, I have no idea about how to start the coding. I've never made a Media Player before so I don't know how to start or WHERE to start! Could someone give me some ideas?
Any help will be appreciated. :)
A good idea is to design the UI in a view editor and then hook it up later on.
Get basic functionality working (Play, Pause, Stop). Have 'Play' just start a hard coded song at first. Then, move on to more difficult tasks (displaying the list of songs in the UI, adding volume adjustment (tying a slider control to the volume of the song playback).
Before you know it, you'll have a functioning media player. Look at Windows Media Player and iTunes for examples of where to get started.
Since you're just starting with this, you may consider using WPF rather than WinForms.
WPF will give you more options for app skinning, transparency, etc.
Guys, I've already added the media player control. I now need to know how to play the selected file in the Media Player Control.
While this is good advice, I actually recommend sticking to .Net 2.x and WinForms as a beginner to C#. and UI development. I use WPF everyday at work and wouldn't recommend starting on it without a basic understanding and foundation in WinForm development first.
Dragster, I thought you were creating your own Media Player :)
If you're using the stock control, there is PLENTY of documentation on MSDN and all around the internet for how to plug it in and use it.
Also, intellisense is your friends. Look around and see what you find there. I'm sure it's as easy as calling Play and Stop and etc...
I would like to start from scratch. I don't care if it takes me days to create the form and get it up and running! I'll do it!
Since the programming models between WinForms and WPF are quite different, I don't believe there is any need to start with WinForms before moving to WPF. Since WPF offers features that are typically associated with a media app, it might be beneficial to the OP to start with WPF rather than starting with WinForms and running into a dead end.
Actually dude, since I started learning C#, all my programs have been created on WinForms only! So I have quite a bit of knowledge when it comes to WinForms. On the other hand, if I go to WPF app, I can't understand squat!
I would prefer sticking with WinForms for now. But dude, would you be willing to help me out in starting newly? I wanna build it from scratch! :)
Dude, if you want help, you'll need to ask specific questions.
How far along are you in your media player project?
What would you like to do, but are having trouble with?
Oh. My apologies. I wish to create a Media Player from scratch (meaning basically, everything has to be built). I can design the interface. But I have no idea about how to start the coding. Any suggestions???
Any suggestions at all???
What do you mean "design the interface"?
Does that mean you can design it on paper or in code with the Winforms editor?
I gave you pretty good advice before.
Start with just designing the UI in the WinForm designer view. Put _BASIC_ controls on your form (Play, Stop). Add event handlers for those buttons. Make the click event for Play start a hard coded song. Make the Stop event stop the song.
Create the UI, and hook up the backend behind it.
Yes, I know. I can prepare the interface with the events and stuff within no time. But I dont know what to write in the code! Do I need to create an object of System.Media.SoundPlayer??? or do i need to create some kind of file reader??? and then how will I Play, Pause or Stop a particular file??? I have no idea!!!
Thats why I wanted some help with the code. In the code I don't know what to start with!! :P
This page might help you: http://www.daniweb.com/code/snippet217151.html#
You could just copy the PlayMP3(string Location) function from that page. Then you can have your "Play"-button call that function.
That'd be an app that lets you play a certain song. Which is pretty useless but gets you started. :) (I hope)Code:public partial class Form1 : Form
{
public static void PlayMP3(String Location)
{
music = new Microsoft.DirectX.AudioVideoPlayback.Audio(Location);
music.Play();
}
private void btnPLAY_Click(object sender, EventArgs e)
{
// This is where you are taken if you double click the button in the WinForm editor.
PlayMP3("C:\\my_music_folder\\a_great_song.mp3");
}
}
Some advice:
1) When you're referring to a user interface, don't use the term "interface" in conversations. "interface" in software development refers to a contract that classes can choose to abide by, and implement. Use the term "user interface", or "UI" instead.
2) There are a plethora of web pages out there describing how to build media players in C#. The question to YOU is, do you want to create one from scratch or do you want to use a bare bone control that gives you all the necessities needed to start making one.
You need to answer that question first, then we can guide you further. I personally suggest creating your own from scratch... There's really only a couple of buttons in a basic media player, and a list of songs to choose, or a file browser dialog... Like I said before... Create the UI! Then, once you have basic buttons on there, research each one and how you would hook it up to do what it should. IE: How to make the Play button start playing a song...
Thanks dude!! :)
Actually, your explanation helped me better in understanding, rather than the explanation in the link that you gave.
And I have a small problem. VC# 2008 shows error in "Microsoft.DirectX.AudioVideoPlayback.Audio(Location)"
by saying that there's no reference. I tried searching for the reference but all I could find was "
"DirectX 7 for Visual Studio Library" & "DirectX 8 for Visual Studio Library". And neither of them have helped. Where can I find the reference???
Did you install DirectX SDK? It's included in the binaries with that I'm assuming.
what online install lol?. you should google this, i did and found a lot of solutions.
http://www.microsoft.com/express/vcsharp/#webInstall
visit this link. this is what you call an online install.
Alright, I've kept the media player thing on hold for now because the DirectX SDK is 553 MB, which is kinda a big file to download at a 256kbps connection. :P
And I've started a new project. A simple FileBackup program.
I know what I'm supposed to do, and require a little assistance with a few things.
First of all, how do I generate an event that will get activated when I click OK in a FolderDialogue?
Second of all, "using System.???". What should be used if I want to work with FileHandling??
Somebody please answer my question.
The easiest way is to open the form in the resource editor, select the button and then double click on it. This will create a click handler for you.
What you need to do is learn how to use the Msdn free online library.
Also, you need to learn how effectively search google. Asking questions on a forum like this is okay, but you can find the answer way faster yourself if you know how to search. For example search google for "How to open a file in .net C#", gives several hits. The first one, FileStream Open File [C#] looks promissing according to the description: "This example shows how to open files for reading or writing, how to load and save files using FileStream in C#."
As a beginner what you need to do is actually try the code examples that you find on the internet. It's natural to want to try to stick the code snippet directly in your project, but I'd recommend that you create a separate test project, put the code snippet into it, debug it and get it running before moving the code into the real project.
With regard to msdn, for file operations, check out the classes in the System.IO namespace.
Keep in mind that folks on this forum are volunteers. As such we aren't really required to answer any questions, and there definitely isn't any time limit if we decide to answer.
If you are looking for a quick answer, the best thing I can tell you is to follow my advice in #48 and learn how to effectively use msdn and search in google. If you are able to do this, then you'll be able to find the answers to 99% of your questions on your own, and won't be bugged when someone doesn't respond fast enough.
Thanks for the tip dude! :)
And I'm sorry but, I didn't mean to rush anyone into answering my question....I'm patient enough to wait for the answer.... :)
Actually, I did try searching on google but didn't get any help from there....the thing is that I couldn't find a way to generate an event for when the OK button in the FolderBrowserDialogue is clicked....
But yes, what you said is correct....I shouldn't come around asking for help for every single problem that I have.... :)