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



Download 21,46 Mb.
Pdf ko'rish
bet187/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   183   184   185   186   187   188   189   190   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

Member

Meaning in Life

Beep()


This method forces the console to emit a beep of a specified frequency and

duration.

BackgroundColor

These properties set the background/foreground colors for the current 

ForegroundColor

output. They may be assigned any member of the ConsoleColor

enumeration.

BufferHeight

These properties control the height/width of the console’s buffer area.

BufferWidth

Title

This property sets the title of the current console.



WindowHeight

These properties control the dimensions of the console in relation to the 

WindowWidth

established buffer.

WindowTop

WindowLeft

Clear()

This method clears the established buffer and console display area.



Basic Input and Output with the Console Class

In addition to the members in Table 3-2, the Console type defines a set of methods to capture input

and output, all of which are static and are therefore called by prefixing the name of the class

C H A P T E R   3  



C O R E   C #   P R O G R A M M I N G   C O N S T R U C T S, PA RT   I



76

8849CH03.qxd  9/24/07  11:07 AM  Page 76




(Console) to the method name. As you have seen, WriteLine() pumps a text string (including a car-

riage return) to the output stream. The Write() method pumps text to the output stream without a

carriage return. ReadLine() allows you to receive information from the input stream up until the

Enter key is pressed, while Read() is used to capture a single character from the input stream.

To illustrate basic I/O using the Console class, create a new Console Application project named

BasicConsoleIO and update your Main() method to call a helper method named GetUserData():

class Program

{

static void Main(string[] args)



{

Console.WriteLine("***** Basic Console I/O *****");

GetUserData();

Console.ReadLine();

}

}

Implement this method within the Program class with logic that prompts the user for some bits



of information and echoes each item to the standard output stream. For example, we could ask the

user for his or her name and age (which we will treat as a text value for simplicity, rather than the

expected numerical value) as follows:

static void GetUserData()

{


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   183   184   185   186   187   188   189   190   ...   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