This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy



Download 21,46 Mb.
Pdf ko'rish
bet1009/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1005   1006   1007   1008   1009   1010   1011   1012   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition



Source Code

The CodeBaseClient application can be found under the Chapter 15 subdirectory.



The System.Configuration Namespace

Currently, all of the *.config files shown in this chapter have made use of well-known XML ele-

ments that are read by the CLR to resolve the location of external assemblies. In addition to these

recognized elements, it is perfectly permissible for a client configuration file to contain application-

specific data that has nothing to do with binding heuristics. Given this, it should come as no

surprise that the .NET Framework provides a namespace that allows you to programmatically read

the data within a client configuration file.

The System.Configuration namespace provides a small set of types you may use to read cus-

tom data from a client’s *.config file. These custom settings must be contained within the scope of

an  element. The  element contains any number of  elements that

define a key/value pair to be obtained programmatically.

For example, assume you have an App.config file for a Console Application named

AppConfigReaderApp that defines a database connection string and a point of data named

timesToSayHello:







"Data Source=localhost;Initial Catalog=AutoLot;Integrated Security=True" />







Reading these values for use by the client application is as simple as calling the instance-level

GetValue() method of the System.Configuration.AppSettingsReader type. As shown in the follow-

ing code, the first parameter to GetValue() is the name of the key in the *.config file, whereas the

second parameter is the underlying type of the key (obtained via the C# typeof operator):

using System.Configuration;

class Program

{

static void Main(string[] args)



{

Console.WriteLine("***** Reading Data *****\n");




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1005   1006   1007   1008   1009   1010   1011   1012   ...   1830




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