Friday, April 14, 2006

Fx Cop 1.32

copy this code to VS2005 and run the program and it gives you no errors.
using System;using System.Collections.Generic;using System.IO;using System.Text;
namespace ConsoleApplication1{ public class Movie { string type; //such as drama , sport profile , film ,stage show ,theater string country; // which country does that belong string name; string artist1; string artist2; string artist3; string artist4; string code;
public Movie() { wanted_type(); wanted_country(); wanted_name(); wanted_artist1(); wanted_artist2(); wanted_artist3(); wanted_artist4(); }
public void wanted_type() { int option; Console.WriteLine("Enter type \n\t1.DRAMA\n\t2.FILM\n\t3.SPORT PROFILE\n\t4.STAGE SHOW\n\t5.THEATER\n\t0.EXIT"); option = Convert.ToInt32(Console.ReadLine()); switch (option) { case 1: gstype = "drama"; break; case 2: gstype = "film"; break; case 3: gstype = "sport_profile"; break; case 4: gstype = "stage_show"; break; case 5: gstype = "theater"; break; default: case 0: break; } } public void wanted_country() { int option; Console.WriteLine(gstype + "is \n\t1.Pakistani\n\t2.Indian\n\t3.English\n\t0.Exit"); option = Convert.ToInt32(Console.ReadLine()); switch (option) { case 1: gscountry = "pak"; break; case 2: gscountry = "ind"; break; case 3: gscountry = "eng"; break; default: case 0: break; } } public void wanted_name() { Console.WriteLine("enter the name "); gsname = Console.ReadLine(); } public void wanted_artist1() { Console.WriteLine("name of popular artist#1"); gsartist1 = Console.ReadLine(); } public void wanted_artist2() { Console.WriteLine("name of popular artist#2"); gsartist2 = Console.ReadLine(); } public void wanted_artist3() { Console.WriteLine("name of popular artist#3"); gsartist3 = Console.ReadLine(); } public void wanted_artist4() { Console.WriteLine("name of popular artist#4"); gsartist4 = Console.ReadLine(); } public string gstype { get { return type; } set { type = value; } } public string gscountry { get { return country; } set { country = value; } } public string gsname { get { return name; } set { name = value; } } public string gsartist1 { get { return artist1; } set { artist1 = value; } } public string gsartist2 { get { return artist2; } set { artist2 = value; } } public string gsartist3 { get { return artist3; } set { artist3 = value; } } public string gsartist4 { get { return artist4; } set { artist4 = value; } } public string gscode { get { return code; } set { code = value; } } } public class tester { static void Main(string[] args) { Movie m = new Movie(); m.gscode = "1111"; } }}
After running this code its go fine enough and you find no errors in it. But when you provide the .exe to the FxCop it gives you about34 messages. But do't feel hassel over this issue, these 34 message are not too much HiFi, a newcomer can easily resolves this.Lets try!.

0 Comments:

Post a Comment

<< Home

Mesothelioma
Mesothelioma