0% found this document useful (0 votes)
499 views

C# Notes Unit1to5

The document discusses building C# applications using .NET concepts. It talks about using classes, objects, methods and properties in C# and .NET framework. Examples of building a simple C# console application are provided.

Uploaded by

sahana
Copyright
© © All Rights Reserved
0% found this document useful (0 votes)
499 views

C# Notes Unit1to5

The document discusses building C# applications using .NET concepts. It talks about using classes, objects, methods and properties in C# and .NET framework. Examples of building a simple C# console application are provided.

Uploaded by

sahana
Copyright
© © All Rights Reserved
You are on page 1/ 101

om

.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
C#' PROGRAMMING AND .NET CONCEPTS

VII Sem CSE/ISE

Unit ·2 BUILDING C# APPLICATIONS

111.- cvJ~.fu VUM.a./ ~~"' tl: ts f~ble..


+e c~ .NET ~u ~ c..:tt ~
~ =r': c.sC<(!.~ Ce.~~).
~~.
1../.&,(/ &t~ J

om
~ ~rt<fh...[

.c
~ .$kNe- VOlJ f1sW., () [
up ,
f~' .':>J
ro
} ~o l....1tJ.ili;l-:iA.e.( w~ ...:~
••o
sg

A.

J
nt
de

~ ~ iJl~ i»: ()~!ra4.d.& -fa.~ < CS

=v':": ~, I"
-:
u
st

10 -!he-.. ~~&SI.J.("MJ
ity

~£~) w~-. -the-- ~n4 Cl& '


.c

cu.J reM. ~ ·
w

c.sc, ~. ~
w

if'- '(f
w

An exa: riarrie: ..££t~ • -exs: ~tl &....


~ .t1:l i-he- ~ pcdb · 1h i.I tJk (Q.fV

~ e~ d.iJ.QL~ co-

~
Mrs.Tabassum Ara M.Tech Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore.
[email protected]
www.citystudentsgroup.com CD
~~~hJl~

J~ C5NZ- ~~ ~ do ~

~(f u~u1~
--r-~.k /
~J ~.

It) ihe-joU(W.)1'(f ~,~ ~


CL mP-M.~a?C J 'cL~~02C,~fwwL) ~ LR

LUe.4 ~ tl tb ~ ~ uUl=f
SyJkm ,{~.Fmmt..

om
LUt'Q ~/.eJm. ~J>~J

.c
...:
llit\j ~sh; up Q.
GI
Q

~wu~{ .
ro
chus
sg

~ s/dsPjG. ~ f'o4W..~Jl
nt

~cnc ,~~ ( "tI-clJo~ ");


de

'r
u
st

}
ty

..t~
i
.c

~ c_ompdP.fwn,j aJ:>+he... comman4 -+be-


w
w

~J# mwbk L~/~~


w

c..on~ ~I!- ()e{,1WU~ ~ Ch ~ ~~~

~~h CRmf~ ~ ~~ IS/,..

c.sc, /9.,. ~&r~' ~.1&mv..clli $.~,c.s


Mrs.Tabassum Ara M.Tech Asst. Prof., Dept. ofwww.citystudentsgroup.com
CSE @ HKBKCE, Bangalore.
• = • ,.•••••.••
~ euL_~ f;h-~~ ~ '1~
0'141n"- ~'~j ~ e..an ~ ~

H9lb ...

Output Options of the C# Compiler

om
Output Option Shortcut Meaning Example
lout 10 Used to specify the name of csc /out.a.exe
the assembly to be created. By sample.cs

.c
default, the assembly name is
up
the same as the name of the
initial input *.cs
/target.exe /t.exe To build an executable csc It:exe sample.cs
ro
console application. This is the
sg

default file
output type.
It library csc It library lib.cs
nt

/target: library To build a single-file *.dll


assembly.
de

/target.module /t.module To build a module. Modules csc /t.module mod.cs


are elements of multifile
-:
u

assemblies.
st

/target: winexe /t.winexe It prevents a console window csc /t.winexe s.cs


from appearing in the
ity

background.
Ireference Ir To Reference external csc
.c

assemblies Ir:System.Windows.Fo
rms.dll sample.cs
w
w
w

. ~(~ TYWftp.k. 3~ ~ UJLd:Jh c.sc ex:a;

~ r-r= CLIR- CPmf~ 01> nvd!J;k


'11-. c.s tJ:1~-Iv k=p ~ ~~ CL 17,'/-m~
~.
Mrs.Tabassum Ara M.Tech Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore.
www.citystudentsgroup.com
~ cIhe-~Nj e?es:tnt.(fJ--

ll.M(J- &tdDro:..
:J z: wPl~. ~~ms j

~'C- VtnJ 5 Am.omsjC) L


M~~~ $herw (ltlklW I ~. ~);

j } .

om
LU-I(I 4 s/ffn~
.c
up
cJa.M. Ja+f ..:
ro

a..e
I~(._~__
sg

~~'L ~ ~.()l
."/~:".- [4.1;tt-i
nt

f> ~\(
L.1.:J m-OLt.1 J..-j JUliJ-..LIUl .."""l< j ;J
de

~ h-:=- I\J2.P.J..r fvdlo L J~


u

h.L .:show- ~q;L '\ ,


st

} U ,/~
ty

J
i
.c
w

SdM.L-/hL! ~ -!UMlfh.£6
w
w

f\lClVif NI e.u ~ck ~ ~ -f'tl~ ,

Mrs.Tabassum Ara Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore •


---
M.Tech

..www.citystudentsgroup.com
~ ~~ fMM) --fhCA ~4Ol / F ~~dfu1:
et!

t-'elb ...

Ir
•..
·ok ··..·l)
,~fjffi
..~....
~.'
..•...
MJ'

~e,cj 1t"w1f,p~ ~~ ~~

~~ ~-kJ

om
wC- csiri be.- ~

.c
~ CR-Od-h /~ ~ ~1ioo.
up
Q
ro
~~ i
sg

c.;~ /s: t-~gfpm~Jr1tn~ ,fmru ~CWJ¥~J)!WJ.>tj ,Jlj ~


nt

~~~'~ 1
de

""~

"rr=&).e.s .
u

-,
E
et
st

E
::s
ity

III
III

'10 ~ '1he.- ~uif!:J ~ ~~ ~


.c

J2
~
t-
w

~ ~uJ- &fb~ d.w.t~ ~ ~


w
w

the- r~'fO)) c-# f~~ 'IIx.-~~ ~<T)~

fyla8, =r= ~ ~~ '1~


-uet r D~t-
C--'it ~Uur h. csc- ~.

Mrs.Tabassum Ara Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore.


®
M.Tech
www.citystudentsgroup.com

-
2.
rr----------------------------------------------------------------------------------------

11- is

e~
(..\~\ trtu.uJ~;1\J.e7\rAtUlWP~\V2.0.{;;-O')l~

~~ ~ -/f)u s':; . f)f)~aJ, ~ &vk&


R1~ co~.
# This file contains command-line options that the C# command line
#compiler (CSC) will process as part of every compilation, unless the
#"/noconfig" option is specified.

# Reference the common Framework libraries

om
Ir:Accessibility.dll
Ir:Microsoft. V sa.dll

.c
Ir: System. Configuration.dll
, Ir: System. Configuration.Install.dll up ...:
Q.
Ir: System.Data.dll C
Q)

Ir: System.Data. OracleClient.dll


ro
Ir: System.Data. SqlXml.dll
sg

Ir:System.Deployment.dll
Ir: System.Design.dll
nt

Ir:System.DirectoryServices.dll
Ir:System.dll
de

Ir:System.Drawing.Design.dll
Ir:System.Drawing.dll
u

Ir: System.EnterpriseServices.dll
st

I Ir:System.Management.dll
ty

! Ir:System.Messaging.dll
Ir: System.Runtime.Remoting.dll
i
.c

Ir: System.Runtime. Serialization.F ormatters. Soap .dll


Ir:System.Security.dll
w

Ir: System. ServiceProcess.dll


w

Ir: System. Transactions.dll


w

Ir:System.Web.dll

Mrs.Tabassum Ara M.Tech Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore. ~


• =
www.citystudentsgroup.com
• ,.•.••
"'" ~
we.- i:LV) ako ~ <9U9,.... aw-n ~ tf-&.
~ ~ co-o~ c:.I.li ~ {ng~<huru. -Iv k
tfuJ .&wJ~ 7h-c- ~~ ~ ~

~t Wlc/·1he-e~ ~ 1bU tk ~
'*4~
2)SJ<:.trnpb-

I~~~~ ~/r.L~"-~~.dP1.
/9..-'. &e!.f.em.D~.d1t

om
It ~~?e-'L
.c
.;

i
c.
up
8CW.1L:fhu tf'- ~ CL (}etffiJL rn'f~!owYl.«>~
CP
ro

=r= ff'--to
sg

ctru,f . -Iu ~ 'h;g ~ ~


nt

~ ~ c.D1in'1hQl)c4 ~
de

i
~
<
u

u~@~~.~
st

=r=t':
ty

~ ~ ~J.~/ -:ttxJ illiJ( k ~


i
.c

~. 1'0 nocmf:J ~
w

dtJabI.e.. <:/h1'!, . u.tL


w

c...ommQrrc)
w

Ube: @mAf~~~ I~fu

Mrs.Tabassum Ara M.Tech Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore.


- www.citystudentsgroup.com
..,..........
t:?'
\.l/
Lo-rr,~ LM~ D~ L~to-,~)
7GL -f-se-/ C$J~'~ ~ CL C£>n-Jmattd UJiu, ~

f~ck:,/ ~.fIW} tytf1lJW9~.11-- ~ ~


GfHlJI1j .-1-0 ~ &U0- ~'
!
Lo9.&ba /1 freJ <JUL cWL ~ ~~ /frsf· o
ra
en
c
ra
to
cordbg.exe Command-Line Flags w
U
~
Flag Meaning to
b[reak] Set or display current breakpoints ~
:z:
del[ ete] Remove one or more breakpoints. @)

om
ex [it] Exit the debugger w
tn
g[ol Continue debugging the current process until hitting next breakpoint. U
o [ut] •••o

.c
Step out of the current function.
p[rint] Print all loaded variables (local, arguments, etc.).
.:
up Q.
CII
SI Step into the next line. C
so Step over the next line. ...:
ro
e
D.
'It> ~ cd- ~~ P.ine.. _
sg
nt

~tJb- ~-Jh ~ ~'


de

=r-:
u

I~
st

cs« ~.~/1b~
ty

[J~ if&-- <Lrnfk • pdb.-' ~


i

CL C£lQj~ .& i8
.c
w

~ ~ urm~ ~'n£. ~ '


w

~ ~--lh-.~
w

~L-~ ~~.~

M-f/Ju r+. ~ G>t ~ rtneJ e.


~~~~'
Mrs.Tabassum Ara M.Tech Asst. Prof., Dept. of CSE @ HKBKCE, Bangalore.
.• - www.citystudentsgroup.com
.••....,. \...!!!..}
r<i"
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c

This Notes has been downloaded from www.citystudentsgroup.com


w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
.c
up
ro
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com
om
To Download More Notes

.c
up
Visit

ro
www.citystudentsgroup.com
sg
nt
u de
st
ity
.c
w
w
w

www.citystudentsgroup.com

You might also like