Dot Net Notes (Self)
Dot Net Notes (Self)
C# intro
→The .NET framework is an integral window component that supports multiple
programming languages
→The .NET framework consists of the CLR(Common Language Runtime), .NET framework
class library. Which CLR helps to convert human language to Machine language
→.NET Supports more than 60 languages where 11 languages are developed by Microsoft
→Mainly C#,F#,VB .NET is used
• #C vs .NET
➢ C# is a programming language
➢ .NET framework for building applications on windows
• .Net consists of CLR(Common language application), class library
• CLR (Common Language Run-time)
➢ When you compile an application, C# compiler compiles your code to IL
(Intermediate Language) code. IL code is platform agnostics, which makes it
possible to a take a C# program on a different computer with different
hardware architecture and operating system and run it. For this to happen, we
need CLR. When you run a C# application, CLR compiles the IL code into the
native machine code for the computer on which it is running. This process is
called Just-in-time Compilation (JIT).
• Architecture of .Net Applications
➢ In terms of architecture, an application written with C# consists of building
blocks called classes. A class is a container for data (attributes) and methods
(functions). Attributes represent the state of the application. Methods include
code. They have logic. That's where we implement our algorithms and write
code.
➢ A namespace is a container for related classes. So as your application grows in
size, you may want to group the related classes into various namespaces for
better maintainability.
➢ As the number of classes and namespaces even grow further, you may want to
physically separate related namespaces into separate assemblies. An assembly
is a file (DLL or EXE) that contains one or more namespaces and classes. An EXE
file represents a program that can be executed. A DLL is a file that includes
code that can be re-used across different programs
→If you omit the using System line, you would have to write System.Console.WriteLine() to
print/output text.
• First C# program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace helloworld
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World..!");
}
}
}
• Variables and constants (int a; const float pi=3.14f)
• Identifiers
• Name Convensions ( camel case,pascal case,Hungarian Notation)
• Primitive datatypes
➢ Primitive datatyepes→(byte , short ,int, float(1.2f)
,decimal(1.2m),double,Boolean,char)
➢ Non-primitive datatypes→ string, Array, Enum, Class
• Overflowing →byte n=255 →n=n+1; //0 ➔using checked{ //code} we can resolve it.
• Scope →block scope
Intro
using System;
namespace Helloworld
{
class BasicsOfC
{
static void Main(String[] args)
{
Console.WriteLine("Hello World");
String filepath1 = "C:\\Users\\lenovo\\source\\repos\\C#BasicCodes";
String filepath2 = "C:/Users/lenovo/source/repos/C#BasicCodes";
String filepath3 = @"C:\Users\lenovo\source\repos\C#BasicCodes";
Console.WriteLine(filepath1 + "\n" + filepath2 + "\n" + filepath3);
Console.WriteLine("Enter Integer");
int a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter Float");
float b=Convert.ToSingle(Console.ReadLine());
Console.WriteLine("Enter Char");
char d= Convert.ToChar(Console.ReadLine());
float add = a + b ;
float mult = a * b ;
Console.WriteLine("Addition :" + add);
Console.WriteLine("Multiplication :"+mult);
Console.WriteLine("Character : " + d);
//-----------------------
int a1 = 0;
String name = null;
int? b1= null;
Console.WriteLine(a + " - " + b1 + " - " + name + " " + a1);
//Arithmetic opertaors == +,-,*,/
//relational Operators == > < >= <= == !=
//Assignment opertaor a=b;
//logical operators && ,|| ,!
//Null Collesion (??)
Console.WriteLine(name ?? "Null value");
//Ternary operator(?:)
//increment and decrement
Console.ReadKey();
}
}
}
---------------------------------------------------------------------------------------------
using System;
namespace Helloworld
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.WriteLine("Bye");
Console.Write("Hello");
Console.WriteLine("Byyyyyeee");
Console.WriteLine("----");
Console.WriteLine("hello \nworld..!");
Console.WriteLine("----");
Console.WriteLine("hello \tworld..!");
int a = 10;
String name = "teja";
String course = "DotNet";
Console.WriteLine("hello "+ name +a);
Console.WriteLine("Hello {0} you have registered for {1} with id {2} ",name,course,a);
Console.WriteLine($"Hello {name} you have registered for {course} with id {a} ");
//User input
Console.WriteLine("Enter name, salary of employee");
String Ename=Console.ReadLine();
float sal=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Hello" +" "+name+" your salary is "+sal);
Console.ReadKey();
}
}
}
-----------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
class basicconcepts
{
public static void Main(string[] args){
//string vs stringbuilder
//Var dynamic
int val = 10;
//val = 2.3f; -->Gives Error
var val1 = 10; //var can define its type at compile time
//Once we define type we cannot assign another type of data
//if var is used immediately we have to assign a value
// val1 = 2.5f; -->gives error
Console.WriteLine(val1.GetType());//int32
var result1 = "teja";
// result1 = result1 * 10; -->Gives Error at compile time
//-------------------------
//dynamic
dynamic val2 = 10;
val2 = 23.6;
Console.WriteLine(val2.GetType());
val2 = 64;
Console.WriteLine(val2.GetType());
val2 = "tej";
// val2= val2 * 20; -> throws error at run time
Console.WriteLine(val2.GetType());
//Conditional statements
//simple if
//multiple if
//if else
//nested if
//if else if
//switch
//------
//loops
//while , do while , for ,for-each
int a = 100;
Console.WriteLine(a.GetType());//Int32
Console.WriteLine(sizeof(Int32));//4
Console.WriteLine(int.MinValue+ " - "+int.MaxValue);
//Type casting
int v= 100;
long l = v;//Implicit typecasting-->8bytes of long can store 4bytes of int value
short s = (short)v;//Explicit typecasting-->2bytes of short can store 4bytes of int value
//Non-compatible types
String s = "1";
// int i = (int)s;--> Won't compile
int j=Convert.ToInt32(s);
int k=int.Parse(s);
//we can convert to byte,Toint16,Toint32,Toint64
var v = "1234";
// int ii = (int)v; -->will not convert
int ii=Convert.ToInt32(s); //ii is 1234
byte bb=Convert.ToByte(s);//gives system overflow unhandled exception
//boxing
int aa = 10;
object obj = aa; //boxing->Converting anytype to object type
int bb = (int)obj;//unboxing-->Converting object to anytype
//jumping statements
//goto, continue,break
//Array
int[] arr = { 10, 20, 30, 40, 50 };
var index=Array.indexof(arr,2);//returns the index at 2
Console.Writing(index);
The keyword struct is used to create structs in C#. For example, the following is a structure
declaration in C#:
using System
namespace ConsoleApplication
public struct Person
public string Name
public int Age
public int Weight
Structs are best used when representing basic data types, such as integers, strings, or other
simple data types. They are also useful when working with large datasets, such as arrays or
lists, where performance is important.
Structs can also include methods, indexers, and constructors. For example, the following
struct contains an event that notifies subscribers when an action occurs:
CoordinatesChanged event, which will be raised when x or y coordinate changes
----------------------------------------------------------------------------------------------------------------------
ENUM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
enum Gender
{
male,female
}
enum AccontType{
saving=5,Current,Joint
}
enum Employee
{
developer=12,tester=8,Analyst=18
}
class Enum
{
public static void Main(string[] args)
{
Gender gen = Gender.male;
Console.WriteLine("Selected gender :" + gen);
Console.WriteLine("Selected gender :" + (int)gen);
-----------------------------------------------------------------------------------------------------------------------
Tasks
1- Write a program and ask the user to enter a number. The number should be between 1 to
10. If the user enters a valid number, display "Valid" on the console. Otherwise, display
"Invalid". (This logic is used a lot in applications where values entered into input boxes need
to be validated.)
2- Write a program which takes two numbers from the console and displays the maximum
of the two.
3- Write a program and ask the user to enter the width and height of an image. Then tell if
the image is landscape or portrait.
4- Your job is to write a program for a speed camera. For simplicity, ignore the details such
as camera, sensors, etc and focus purely on the logic. Write a program that asks the user to
enter the speed limit. Once set, the program asks for the speed of a car. If the user enters a
value less than the speed limit, program should display Ok on the console. If the value is
above the speed limit, the program should calculate the number of demerit points. For
every 5km/hr above the speed limit, 1 demerit points should be incurred and displayed on
the console. If the number of demerit points is above 12, the program should display
License Suspended.
public static void Main(string[] args)
{
Console.WriteLine("Enter Your Speed ");
var speed=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the distance travelled");
var distance=Convert.ToInt32(Console.ReadLine());
int minspeed = 50;
if (speed <=minspeed)
{
Console.WriteLine("OK......!!");
}
else
{
int value = distance / 5;
int demerit =1*value;
if (demerit >=12)
{
Console.WriteLine("license is suspended");
}
else
{
Console.WriteLine("until demerit points is 12 your license is safe");
}
}
}
a. //WAP read 5nos and show the biggest number using ternary operator
b. //WAP print the current month name(DateTime.now-switch)
c. //WAP read nos and print the given no is how many times in that array
d. //WAP read nos and print the sum if both are positive nos
e. //WAP read and make a menu for add,sub,mul,Div with multiple choices
1- Write a program to count how many numbers between 1 and 100 are divisible by 3 with
no remainder. Display the count on the console.
2- Write a program and continuously ask the user to enter a number or "ok" to exit.
Calculate the sum of all the previously entered numbers and display it on the console.
//2
int input = 0;
int total = 0;
{
Console.WriteLine("Please add an integer value less than 20");
if (test == "ok")
{
break;
}
else
{
input = int.Parse(test);
total = total + input;
}
Console.WriteLine(total);
}
3- Write a program and ask the user to enter a number. Compute the factorial of the
number and print it on the console. For example, if the user enters 5, the program should
calculate 5 x 4 x 3 x 2 x 1 and display it as 5! = 120.
4- Write a program that picks a random number between 1 and 10. Give the user 4 chances
to guess the number. If the user guesses the number, display “You won"; otherwise, display
“You lost". (To make sure the program is behaving correctly, you can display the secret
number on the console first.)
Sol:
public static void Main(string[] args)
{
Random ran= new Random();
var num = ran.Next(1, 10);
// Console.WriteLine(num);
Console.WriteLine("Enter a guess number with random number"); ;
int digit=Convert.ToInt32(Console.ReadLine());
if (num == digit)
{
Console.WriteLine("You Won..!");
}
else
{
Console.WriteLine("You Lost..!");
}
5- Write a program and ask the user to enter a series of numbers separated by comma. Find
the maximum of the numbers and display it on the console. For example, if the user enters
“5, 3, 8, 1, 4", the program should display 8.
1- When you post a message on Facebook, depending on the number of people who like your post,
Facebook displays different information.
Write a program and continuously ask the user to enter different names, until the user presses
Enter (without supplying a name). Depending on the number of names provided, display a
message based on the above pattern.
2- Write a program and ask the user to enter their name. Use an array to reverse the name and
then store the result in a new string. Display the reversed name on the console.
3- Write a program and ask the user to enter 5 numbers. If a number has been previously entered,
display an error message and ask the user to re-try. Once the user successfully enters 5 unique
numbers, sort them and display the result on the console.
4- Write a program and ask the user to continuously enter a number or type "Quit" to exit. The list
of numbers may include duplicates. Display the unique numbers that the user has entered.
5- Write a program and ask the user to supply a list of comma separated numbers (e.g 5, 1, 9, 2,
10). If the list is empty or includes less than 5 numbers, display "Invalid List" and ask the user to
re-try; otherwise, display the 3 smallest numbers in the list.
------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
class methods
{
void hi()
{
//non-static method
Console.WriteLine("Hi");
}
static void byee()
{
//static method
Console.WriteLine("Byee");
}
static void start(String name,int age) { Console.WriteLine("Name :"+name +" "+age); }
static void start(String name, int age,int sal) { Console.WriteLine("Name :" + name +
" " + age+" "+sal); }
static void add(int a, int b) { Console.WriteLine(a + b); }
static void add(int a,int b,int c=0,int d=0,int e=0) //optional parameters
{ Console.WriteLine(a + b + c + d + e); }
//method with return type
static int fun()
{
return 10 + 20;
}
static void Increment(int number)
{
number++;
Console.WriteLine("Inside Increment method: " + number);
}
static void ChangeValue(ref int num)
{
num += 10;
Console.WriteLine("In method " + num);
}
public static void Main(string[] args) //method
{
//to avoid duplication of code
//reusablity of code
//static method can be called directly
//non-static method can be called using object creation
Console.WriteLine("It is main method");
methods m=new methods();
m.hi();
byee();
start("teja", 22);
start("sai", 23, 33333);//method overloading
Console.WriteLine();//these is also called as method overloading
add(1, 2);
add(1, 2, 3);
add(1,2,3,4);
Console.WriteLine("summm = "+ fun());//output when we use return type
//call by value
int value = 10;
Console.WriteLine("Before calling Increment method: " + value);
Increment(value);
Console.WriteLine("After calling Increment method: " + value);
//call by reference
int value1 = 5;
Console.WriteLine("Before: " + value1);
ChangeValue(ref value1);
Console.WriteLine("After: " + value1);
Console.ReadKey();
}
}
}
-----------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
internal class RandomClass
{
public static void Main(String[] args)
{
Random random = new Random();
for(var i=0; i<10; i++)
{
Console.WriteLine(random.Next());
}
Console.WriteLine();
for (var i = 0; i < 10; i++)
{
Console.WriteLine((char)random.Next(97,122));
}
Console.WriteLine();
var buffer = new char[10];
for(var i = 0;i<10; i++)
{
buffer[i] = (char)('a'+random.Next(0, 26));
}
var password=new String(buffer);
Console.WriteLine(password);
}
}
}
------------------------------------------------------------------------------------------
Strings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
internal class strings
{
public static void Main(string[] args)
{
var name = "charan teja ";
Console.WriteLine("Trim : " + name.Trim() + 10);
Console.WriteLine("Trim : " + name.Trim().ToUpper() + 10);
if (string.IsNullOrEmpty(null))
{
Console.WriteLine("Invalid");
}
if (string.IsNullOrWhiteSpace(name))
{
Console.WriteLine("Invalid");
}
if (string.IsNullOrWhiteSpace(name.Trim()))
{
Console.WriteLine("Invalid");
}
var nam = "25";
var con = Convert.ToByte(nam);
Console.WriteLine(con);
}
//string builder
//methods are indexof,lastindexof,contains,startswith
//manipulation methods -->append,insert,remove,replace,clear
//procedural programming
//object oriented programming
//procedural programming-->a programming paradigm that uses a structured approach to
coding to help a device perform tasks.
//It's a type of imperative programming that involves breaking down programs into
named sets of instructions called procedures,
//which are also known as functions or routines.
//These procedures are then called in a hierarchical order to implement the program's
behavior
}
}
Tasks
------
1- Write a program and ask the user to enter a few numbers separated by a hyphen. Work out if
the numbers are consecutive. For example, if the input is "5-6-7-8-9" or "20-19-18-17-16",
display a message: "Consecutive"; otherwise, display "Not Consecutive".
2- Write a program and ask the user to enter a few numbers separated by a hyphen. If the user
simply presses Enter, without supplying an input, exit immediately; otherwise, check to see if
there are duplicates. If so, display "Duplicate" on the console.
3- Write a program and ask the user to enter a time value in the 24-hour time format (e.g.
19:00). A valid time should be between 00:00 and 23:59. If the time is valid, display "Ok";
otherwise, display "Invalid Time". If the user doesn't provide any values, consider it as
invalid time.
4- Write a program and ask the user to enter a few words separated by a space. Use the words
to create a variable name with PascalCase. For example, if the user types: "number of
students", display "NumberOfStudents". Make sure that the program is not dependent on the
input. So, if the user types "NUMBER OF STUDENTS", the program should still display
"NumberOfStudents".
5- Write a program and ask the user to enter an English word. Count the number of vowels (a,
e, o, u, i) in the word. So, if the user enters "inadequate", the program should display 6 on
the console.
-----------------------------------------------------------------------------------------
Files and directories
using System;
using System.IO;
namespace Helloworld
{
internal class FilesDemo
{
public static void Main(string[] args)
{
//system.io-->file,fileinfo,directory,directoryinfo,path
//file,fileinfo-->creates metthods for copying,creating ,deleting ,moving and
opening of files
//file info,directory info provides instance methods
//file,directory provides static methods
//file and fileinfo methods are
create,copy,delete,exists,getAttributes,move,readAllText
//directory and directoryinfo methods are
createdirectory,delete,exists,getcurrentDirectory,getfiles
//move,getLogicalDrives
//path and its methods getdirectoryname,getfilename,getExtension,getTempPath
}
}
Task
1- Write a program that reads a text file and displays the number of words.
2- Write a program that reads a text file and displays the longest word in the file.
----------------------------------------------------------------------------------------------------------------------
Date and Time
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
class dateandtime
{
public static void Main(string[] args)
{
// Date and Time
DateTime dt1 = new DateTime(2024, 05, 10);
DateTime now = DateTime.Now;
Console.WriteLine(dt1);
Console.WriteLine("Time and date today : "+now);
Console.WriteLine("hour :"+now.Hour);
Console.WriteLine("minute "+now.Minute);
Console.WriteLine("Day :" + now.DayOfWeek);
var tommorrow=now.AddDays(1);
var yesterday=now.AddDays(-1);
Console.WriteLine("tommorow is :"+tommorrow);
Console.WriteLine("yesterday is :" + yesterday);
Console.WriteLine(now.ToLongDateString());
Console.WriteLine(now.ToShortDateString());
Console.WriteLine(now.ToLongTimeString());
Console.WriteLine(now.ToShortTimeString());
Console.WriteLine(now.ToString("yyyy--MM-dd HH-mm"));
Console.WriteLine();
//Time Span
TimeSpan timespan = new TimeSpan(12, 2, 20);
var timespan1=new TimeSpan(12,0,0,0);
var timespan2 = TimeSpan.FromHours(1);
Console.WriteLine(timespan);
Console.WriteLine(timespan1);
Console.WriteLine(timespan2);
namespace Helloworld
{
class MethodOverloadingUsingOptionalparamters
{
//for your method parameters only one should be params type
static void Add(params int[] arr)
{
int sum = 0;
foreach(int i in arr)
{
sum += i;
}
Console.WriteLine("sum =" + sum);
}
static void Addition(String s,params int[] arr)
{
int sum = 0;
foreach (int i in arr)
{
sum += i;
}
Console.WriteLine("sum1 =" + sum);
}
public static void Main(string[] args)
{
Add(10, 20);
Add(10,20, 30);
Add(10, 20, 30, 40);
Add(10, 20, 30, 40, 50, 60);
Addition("tej", 10, 20);
Addition("", 89, 91);
Addition(String.Empty, 20, 22);
Console.ReadKey();
}
}
}
------------------------------------------------------------------------------------------
using System.Collections;
using System;
namespace Helloworld
{
class ArraylistCollections
{
public static void Main(string[] args)
{
//array-->is fixed ,insert and remove in middle is diffcult
//collections-->are variable-length (dynamic length),inserting or removing
elements in any position is easy
//present in system.collections
//can read any type of data
//Arraylist,stack,queue,Hashtable
ArrayList al = new ArrayList();
al.Add(10);
al.Add("tej");
al.Add(88.8f);
al.Add('C');
al.Add("tej");
foreach(var item in al)
{
Console.Write(" "+item);
}
Console.WriteLine();
ArrayList al1 = new ArrayList();
al1.Add("charan");
al1.Add("virat");
al.AddRange(al1);
}
Console.WriteLine();
al.Insert(2, "18");
al.InsertRange(0, al1);
foreach (var item1 in al)
{
Console.Write(" " + item1);
}
Console.WriteLine();
al.RemoveAt(5);
al.Remove("tej");
al.RemoveRange(0,2);
foreach (var item1 in al)
{
Console.Write(" " + item1);
}
Console.WriteLine();
Console.WriteLine("Capacity of ArrayList :" +al.Capacity);
//starts capcity from 0-->4-->8-->16
//we can give intial capacity to the arraylist
//default capacity is starts from 0
//methods in arraylist is add,addrange,remove,removerange,removeat,
//insert,insertrange,capacity,clear
Console.ReadKey();
}
}
}
---------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
class ArraylistandArrayTimeComparison
{
public static void Main(string[] args)
{
Stopwatch watch =new Stopwatch();
watch.Start();
ArrayList al=new ArrayList();
for (int i = 0; i <= 1000; i++)
{
al.Add(DateTime.Now.Second);
watch.Stop();
}
Console.WriteLine(watch.Elapsed.TotalMinutes);
//t0 find difference of excution of array and arraylist
Stopwatch watch1 = new Stopwatch();
watch1.Start();
int[] arr = new int[1000];
for(int i=0;i < arr.Length; i++)
{
arr[i]=DateTime.Now.Second;
watch1.Stop();
}
Console.WriteLine(watch1.Elapsed.TotalMinutes);
Console.ReadKey();
}
}
}
---------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
class HashtableCollections
{
public static void Main(String[] args)
{
//index is predefined
//stores data based on index
ArrayList al=new ArrayList();
al.Add(8);
al.Add("Teja");
al.Add("Developer");
al.Add(50000);
al.Add("Male");
Console.WriteLine(al[1] + " your role is " + al[2]);
foreach(var item in al)
{
Console.WriteLine(item);
}
//Index is userdefined
//stores data based o hashing algorithm
Hashtable ht= new Hashtable();
ht.Add("id", 8);
ht.Add("Ename", "Teja");
ht.Add("role", "Developer");
ht.Add("salary", 50000);
ht.Add("Gender", "Male");
Console.WriteLine(ht["Ename"] + " your role is " + ht["role"]);
foreach (var item in ht.Values)
{
Console.WriteLine(item);
}
//hastable methods are add,remove,contains,clear
//arrays(best in terms of execution time)-->arraylist-->hashtable
Console.ReadKey();
}
}
}
-----------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
class StackCollections
{
//first in last out
public static void Main(string[] args)
{
Stack st = new Stack();
st.Push(8);
st.Push("tej");
st.Push('C');
st.Push(22222);
foreach (var item in st)
{
Console.WriteLine(item);
}
Console.WriteLine("Popped Element : "+st.Pop());
foreach (var item in st)
{
Console.WriteLine(item);
}
//Methods in stack push pop peek
Console.ReadKey();
}
}
}
------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloworld
{
//first in first out
class QueueCollections
{
public static void Main(string[] args)
{
Queue qu=new Queue();
qu.Enqueue(8);
qu.Enqueue("Teja");
qu.Enqueue("Developer");
qu.Enqueue(56000);
foreach(var item in qu)
{
Console.WriteLine(item);
}
Console.WriteLine("Deleted Element :"+qu.Dequeue());
foreach (var item in qu)
{
Console.WriteLine(item);
}
Console.ReadKey();
}
}
}
------------------------------------------------------------------------------------------------------------------------