George Steeves

electricfarms.com - Germinating the seeds of ideas for rural living through, agriculture, art, craft, and appropriate technology

Home
Contact Me
Barn Raising
Programming About
Net Vis 2005 programming
MG sharp programs
NE Fern Identifier
HIP Home Inspection
Computer Updates
Plants About
Plants Vegetables
Plants Perennials
Plants Gesneriads
Stonework
Food
Shelter
Energy
Music
Photography
Chess
Photo Gallery
Links
This site is being replaced with my new site:
 
This site has not been updated in several years now as it has been replaced with my new sites:
 
To see my new rural living site:
 
For information related to stonework:
 
For information relating to plants and planting:
 
For information relating to C# programming see:
http://electriac.googlepages.com/home
 
 
 
 
Well I finally got fed up with MS Office Live which I used to build my web site.  I started to use Office Live when it was in beta development and I had hoped it would improve in time.  Instead of improving it kept getting worse.  I would contact MS ( in India ) and relate my problems and would receive profuse apologies with a boiler plate answers to unasked questions.   If MS is going to transfer their programming work to India they are in trouble as a company.

Google has recently created a new service similar to Office Live which allows anyone to create their own website.  I have only been a member for two days and I am saying syanora MS.  The editing and functionality of GooglePages is so good I have completely transferred all of my Office Live site to this new site in less than 16hrs of work.  I will retain my old site for a while and use it to redirect people to my new site as the old site has considerable prominence on the web.

To see my new site:
 
This is a collection of material relating to:
Visual Studio .Net 2005

 

 

 

 

 

It seems that MS is getting smarter.  They are now offering a free compiler to would be programmers.  This makes sense, as after all if you want people to create programs for your operating system you shouldn't charge them for the effort.  Linux has always supplied a free compiler with their operating system.  Since this file is quite large you will have to have high speed internet connection to download.  There is a smaller version, which I was able to download on dialup but I want to update to the full version, which will require uninstalling the brief version and removal of the .Net framework 2.0.  Therefore I suggest getting the full version before doing an installation. This is the link to download the ISO image from which you can create an installation CD. 

 

 

 

http://msdn.microsoft.com/vstudio/express/support/install/

 

 

 

I have now been using Visual Studio 2005 for C# for several weeks and except for some minor differences it seems to work as well as Visual 2003.  New programs under Visual 2005 however do require an update of the .Net framework to version 2.0.  The main incentive to go to this new compiler is that it allows you to keep current with operating system developments.  I think MS is to be commended for making this software available free and if you have never programmed a free compiler is a real incentive to give it a try.

 

 

 

2005 requires .Net framework 2.0 so it is important to include a solution for this in any distribution.  I include this distributable package (26mb) on each of my distribution disks.

 

 

 

http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en

 

     

 

Various C# Tutorials

 

--------------------

 

Through the years I have learned many programming languages.  I have a preference for bare bones simple code when I am first learning a language rather than a piece of code that illustrates 20 ideas.  MSDN is a good example of the confusing tutorial as their code is always bloated with irrelevant alternatives.  These programs I wrote for a group of aspiring programmers 12-15 years old.  Each program "cuts to the chase" and accomplishes a specific task using an absolute minimum of code.  The kids are amazed when they can write six lines of code and play their MP3 files. I have also noted the addition of System.<includes> as I always had to ferret out which ones were used for what.

 

 

 

This is what I wish I had when I started with C#.

 

 

 

These downloads demonstrate some very simple C# concepts for the beginner.  They were all written under the .Net Studio 2005 and require the .Net framework 2.0.  Each ZIP contains a working .exe in the root folder, which allows a student to see the program work prior to delving into the source code.   I have now re-written these programs using .NET Visual 2005 so the resulting files are in that format rather than the format of a .Net Studio 2003 file that has been converted.

 

 

 

I have now consolidated all the tutorials into a single .ZIP file.

 

 

 

For download:  http://www.mediafire.com/?8r2zdjgtmoi

 

 

 

tutor 01 - "Hello World" 

 

 

 

 

One of the first exercises for an aspiring programmer is the program "Hello World".  In each language I have attempted this as my first project.  All it does is sends the string "Hello World" to the screen.  Here this is in C# in several incarnations. 

 

 

 

 tutor 02 - A simple directory reader

 

 

 

 

This program demonstrates how to use C# to read directories, read files, read drives, change directories, and change drives.  To do this requires the inclusion of System.IO;

 

 

 

 tutor 03 - Display Picture

 

 

 

 

One of the most powerful features of C# is the ability to display pictures.  This little program demonstrates how to load and display a picture.

 

 

 

tutor 04 - Search

 

 

 

 

This program demonstrates how to do a search.  When I first started with C# I had a big problem with this as I could not find a substitute for the "C plus plus" strstr(); command.  Using "IndexOf" is not very intuitive for a beginner but once you get familiar with its use it becomes a powerful tool as it tells the programmer at what character the string was found. 

 

 

 

tutor 05 - Play MP3

 

 

 

 

This program demonstrates a simple way to play an MP3 sound file.

 

 

 

tutor 06 - Recursive search of directories

 

 

 

 

Recently while writing my new MP3 player I wanted to do a recursive search of

 

a drive to find all the MP3 files.  I downloaded the code from MSN and after thinking I had a working program I discovered that the file count was incorrect.  At that point I suspected that I was running to a limitation of a memory array or perhaps the list Box.  With the help "Code Project" friends we solved the problem.

 

 

 

/*

 

This code was originally was downloaded from MSDN and the code did not read properly.  I want to thank Luc Pattyn for his rewrite, which works properly.  I have tested this code on my .mp3 collection and it puts 17,223 in the listbBox.  This is the exact number of files on the drive.

 

 

 

At first I thought the problem had to do with limitations in the number of lines in an array or perhaps a limitation of the listBox.  To test this I created a program to write 80,000 lines of 256 characters to an array and then populate the listBox from the array.  There must be an eventual limitation but I did not find it. I can't visualize a need beyond this test for my simple needs.

 

 

 

To see the thread relating to solving this problem see:

 

http://www.codeproject.com/script/comments/forums.asp?forumid=1649&select=1845947&df=100&msg=1845947

 

*/

 

 

 

tutor 07 - Spawn a child process

 

 

 

 

This program runs the child process "Notepad.exe" and waits to receive the

 

return code.

 

 

 

tutor 08 - Detect screen resolution and display full screen

 

 

 

 

This program does a nice job of displaying camera pictures.  It always uses full

 

screen and resets according to the resolution being used.

 

 

 

tutor 09 - Generate a random number

 

 

 

 

 

 

tutor 10 – Copy image in clipboard to a file

 

 

 

 

A little known feature of windows is the ability to save a screen image to the clipboard.  This is done by pressing the “PrintScreen” key which saves the desktop image to the clipboard.  You can also hold down the “Alt” key and press the “Print Screen” key which will copy an image of the currently active window to the clipboard.  This little program takes the process to the next step by writing the clipboard image to a file.  I use this program a lot to capture graphics from the internet for my music collection.  

 

 

 

tutor 11 – Retrieve information about drives attached to the system.

 

 

 

tutor12 – Force user to select Yes or No

 

 

 

tutor 21 - Use the GDI to draw rectangles and text on a .tif graphic.