C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet601/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   597   598   599   600   601   602   603   604   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

MyClasses.exe

 were found. The 

first one, which in this case was 

MyClass

, was then used to instantiate an object and execute 

methods.

The types in 



MyClasses.exe

 are discovered using this sequence of code, which is near 

the start of 

Main( )

:

// Load the MyClasses.exe assembly.



Assembly asm = Assembly.LoadFrom("MyClasses.exe");

// Discover what types MyClasses.exe contains.

Type[] alltypes = asm.GetTypes();

foreach(Type temp in alltypes)

  Console.WriteLine("Found: " + temp.Name);

You can use such a sequence whenever you need to dynamically load and interrogate an 

assembly.

On a related point, an assembly need not be an 



exe

 file. Assemblies can also be contained 

in dynamic link library (DLL) files that use the 

dll

 extension. For example, if you were to 

compile

MyClasses.cs

 using this command line,

csc /t:library MyClasses.cs

then the output file would be 



MyClasses.dll

. One advantage to putting code into a DLL is 

that no 

Main( )

 method is required. All 



exe

 files require an entry point, such as 



Main( )

, that 


www.freepdf-books.com


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   597   598   599   600   601   602   603   604   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish