Introduction to C Programming for the Microsoft NET Platform 1st edition by Administrator pdf download
Introduction to C Programming for the Microsoft NET Platform 1st edition by Administrator pdf download
https://ebookball.com/product/introduction-to-c-programming-for-
the-microsoft-net-platform-1st-edition-by-administrator-15220/
https://ebookball.com/product/introduction-to-c-programming-for-the-
microsoft-net-platform-1st-edition-by-administrator-15220/
https://ebookball.com/product/introduction-to-c-programming-for-the-
microsoft-net-platform-1st-edition-by-administrator-15326/
https://ebookball.com/product/introduction-to-c-programming-for-the-
microsoft-net-platform-1st-edition-by-administrator-15318/
https://ebookball.com/product/introduction-to-c-programming-for-the-
microsoft-net-platform-1st-edition-by-workbook-15360/
Introduction to C Programming for the Microsoft IT And
Computer CLXV 1st Edition by Microsoft Corporation
https://ebookball.com/product/introduction-to-c-programming-for-the-
microsoft-it-and-computer-clxv-1st-edition-by-microsoft-
corporation-15322/
https://ebookball.com/product/microsoft-c-programming-for-the-
absolute-beginner-1st-edition-by-andrew-
harris-1931841160-9781931841160-15246/
https://ebookball.com/product/microsoft-c-programming-for-the-
absolute-beginner-1st-edition-by-andrew-
harris-1931841160-978-1931841160-15316/
Introduction to C# Programming
for the Microsoft .NET Platform ®
(Prerelease)
Workbook
Course Number: 2124A
This course is based on the prerelease Beta 1 version of Microsoft® Visual Studio .NET.
Content in the final release of the course may be different from the content included in this
prerelease version. All labs in the course are to be completed with the Beta 1 version of
Visual Studio .NET.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Other product and company names mentioned herein may be the trademarks of their respective
owners.
Contents
Introduction
Course Materials.......................................................................................... 2
Prerequisites................................................................................................ 3
Course Outline ................................ ................................ ............................ 4
Course Outline (continued) ........................................................................... 5
Course Outline (continued) ........................................................................... 6
Microsoft Certified Professional Program ....................................................... 7
Facilities..................................................................................................... 9
Module 1: Overview of the Microsoft .NET Platform
Overview................................ ................................ ................................ .... 1
Introduction to the .NET Platform.................................................................. 2
Overview of the .NET Framework ................................................................. 4
Benefits of the .NET Framework ................................................................... 5
The .NET Framework Components ................................................................ 7
Languages in the .NET Framework.............................................................. 13
Review ..................................................................................................... 14
Module 2: Overview of C#
Overview................................ ................................ ................................ .... 1
Structure of a C# Program............................................................................. 2
Basic Input/Output Operations....................................................................... 9
Recommended Practices ............................................................................. 15
Compiling, Running, and Debugging............................................................ 22
Lab 2: Creating a Simple C# Program........................................................... 36
Review ..................................................................................................... 45
Module 3: Using Value-Type Variables
Overview................................ ................................ ................................ .... 1
Common Type System ................................................................................. 2
Naming Variables ........................................................................................ 9
Using Built- in Data Types........................................................................... 15
Compound Assignment .............................................................................. 18
Increment and Decrement........................................................................... 20
Creating User-Defined Data Types............................................................... 24
Converting Data Types ............................................................................... 28
Lab 3: Creating and Using Types ................................................................. 32
Review ..................................................................................................... 36
Module 4: Statements and Exceptions
Overview................................ ................................ ................................ .... 1
Introduction to Statements................................ ................................ ............ 2
Using Selection Statements ........................................................................... 6
Using Iteration Statements ................................ ................................ .......... 17
Using Jump Statements............................................................................... 29
Lab 4.1: Using Statements ................................ ................................ .......... 32
Handling Basic Exceptions ......................................................................... 41
Raising Exceptions .................................................................................... 51
iv Introduction to C# Programming for the Microsoft® .NET Platform (Prerelease)
Description
This five-day instructor-led course provides students with the knowledge and
skills needed to develop C# applications for the Microsoft® .NET platform. The
course focuses on C# program structure, language syntax, and implementation
details.
Audience
This course is intended for experienced developers who already have
programming experience in C, C++, Microsoft Visual Basic ®, or Java. These
developers will be likely to develop enterprise business solutions.
Student Prerequisites
This course requires that students meet the following prerequisites:
n Experience programming in C, C++, Visual Basic, Java, or another
programming language
n Familiarity with Microsoft’s .NET strategy as described on
Microsoft’s .NET Web site: http://www.microsoft.com/net/
n Familiarity with the .NET Framework as described in Microsoft MSDN®
Magazine:
http://msdn.microsoft.com/msdnmag/issues/0900/Framework/
Framework. asp
and
http://msdn.microsoft.com/msdnmag/issues/1000/Framework2/
Framework2.asp
viii Introduction to C# Programming for the Microsoft® .NET Platform (Prerelease)
Course Objectives
After completing this course, the student will be able to:
n List the major elements of the .NET Framew ork and explain how C# fits
into the .NET platform.
n Analyze the basic structure of a C# application and be able to debug,
compile, and run a simple application.
n Create, name, and assign values to variables.
n Use common statements to implement flow control, looping, and exception
handling.
n Create methods (functions and subroutines) that can return values and take
parameters.
n Create, initialize, and use arrays.
n Explain the basic concepts and terminology of object-oriented programming.
n Use common objects and references types.
n Create, initialize, and destroy objects in a C# application.
n Build new C# classes from existing classes.
n Create self-contained classes and frameworks in a C# application.
n Define operators and add event specifications.
n Implement properties and indexers.
n Use predefined and custom attributes.
Introduction to C# Programming for the Microsoft® .NET Platform (Prerelease) ix
n Webfiles. This folder contains the files that are required to view the course
Web page. To open the Web page, open Windows Explorer, and in the root
directory of the compact disc, double-click Default.htm or Autorun.exe.
n Wordview. This folder contains the Word Viewer that is used to view any
Word document (.doc) files that are included on the compact disc. If no
Word documents are included, this folder does not appear.
Introduction to C# Programming for the Microsoft® .NET Platform (Prerelease) xi
Document Conventions
The following conventions are used in course materials to distinguish elements
of the text.
Convention Use
u Indicates an introductory page. This symbol appears next
to a topic heading when additional information on the topic
is covered on the page or pages that follow it.
bold Represents commands, command options, and syntax that
must be typed exactly as shown. It also indicates
commands on menus and buttons, dialog box titles and
options, and icon and menu names.
italic In syntax statements or descriptive text, indicates argument
names or placeholders for variable information.
Title Capitals Indicate d omain names, user names, computer names,
directory names, and folder and file names, except when
specifically referring to case-sensitive names. Unless
otherwise indicated, you can use lowercase letters when
you type a directory name or file name in a dialog box or
at a command prompt.
ALL CAPITALS Indicate the names of keys, key sequences, and key
combinations — for example, ALT+SPACEBAR.
monospace Represents code samples or examples of screen text.
[] In syntax statements, enclose optional items. For example,
[filename] in command syntax indicates that you can
choose to type a file name with the command. Type only
the information within the brackets, not the brackets
themselves.
{} In syntax statements, enclose required items. Type only the
information within the braces, not the braces themselves.
| In syntax statements, separates an either/or choice.
å Indicates a procedure with sequential steps.
... In syntax statements, specifies that the preceding item may
be repeated.
. Represents an omitted portion of a code sample.
.
.
THIS PAGE INTENTIONALLY LEFT BLANK
Introduction
Contents
Introduction 1
Course Materials 2
Prerequisites 3
Course Outline 4
Microsoft Certified Professional Program 7
Facilities 9
This course is based on the prerelease Beta 1 version of Microsoft® Visual Studio .NET.
Content in the final release of the course may be different from the content included in
this prerelease version. All labs in the course are to be completed with the Beta 1
version of Visual Studio .NET.
Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, ActiveX, BizTalk, IntelliSense, JScript, Microsoft Press, MSDN, PowerPoint, Visual
Basic, Visual C++, Visual #, Visual Studio, Windows, and Windows Media are either registered
trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.
Other product and company names mentioned herein may be the trademarks of their respective
owners.
Introduction 1
Introduction
n Name
n Company Affiliation
n Title/Function
n Job Responsibility
n Programming Experience
n C, C++, Visual Basic, or Java Experience
n Expectations for the Course
Random documents with unrelated
content Scribd suggests to you:
two killed and sixteen wounded during this night. On the 29th the
position was further improved, the front cleared, and arrangements
made for lighting up the ground over which the tribesmen must
advance.
Chakdara signalled that it was successfully holding out, and the
reinforcements ordered by the military authorities were beginning to
arrive. A squadron 11th Bengal Lancers came in escorting
ammunition, and in the evening the 35th Sikhs and 38th Dogras
reached Dargai, the first-named regiment having lost twenty-one
men from heat apoplexy on its march from Nowshera.
Again, on the night of the 29th–30th, was the attack renewed,
chiefly against the flanks, but was everywhere repulsed with great
loss, and the same may be said of the following night, when the
attack, though repeated, seemed to have lost something of its energy
and fire. On these two nights our losses were one man killed and
nineteen wounded. On the 31st reinforcements, amounting to over
700, reached the Malakand position, and that night the usual attack
was not delivered.
Relief of Chakdara On the 1st August Colonel Meiklejohn
made an attempt at the relief of Chakdara,
but the start was rather delayed, and the enemy showed themselves
in such strength that the orders had to be cancelled. On this date
Major-General Sir Bindon Blood, having been appointed to
command a newly organised Malakand Field Force, arrived in the
position, and approved of a strong force moving out at daybreak on
the 2nd to effect the relief of Chakdara. The relieving force, under
Colonel Meiklejohn, was stoutly opposed all the way, but the
determination of the enemy only made their losses the heavier, the
cavalry getting among them with their lances and the Sikhs with the
bayonet. As the force drew near, the enemy surrounding the fort
began to withdraw, their retirement being hastened by a vigorous
sortie by the garrison. The relieving column had five men killed and
twenty-eight wounded, while the casualties of the Chakdara garrison
only amounted to three killed and nine wounded during their six
days’ close investment, standing continually to their posts by day and
night.
That day the villages of Aladand and Thana were visited, no
opposition being met with, and Colonel Meiklejohn’s column
marched to and remained in camp at Amandara in preparation for
the reconstitution of the field force.
Operations of the Malakand Field Force, 1897.—To punish all the
attacks above described, the Government of India sanctioned the
despatch of a force, to be known as the Malakand Field Force, to
concentrate, the First Brigade at Amandara, the Second at Khar and
Malakand, the Reserve at Rawal Pindi and Mardan.
FIRST BRIGADE.
SECOND BRIGADE.
DIVISIONAL TROOPS.
1. Ismailzai.
2. Mandal.
3. Alizai.
4. Matakai.
5. Gurai.
6. Peghozai.
7. Bimarai.
8. Sinazai.
The Ismailzai is by far the largest and most important clan, and
occupies the right bank of the Swat River and the northern slopes of
the Koh-i-Mohr. The three last-named clans of the tribe live in Totai
on the left bank of the Swat below its junction with the Panjkora,
within Sam Ranizai limits, and separated from the Laman by the
Jhindai Valley. The Laman accommodates a number of other tribes
besides the Utman Khel.
The roads leading from our territory into the Utman Khel country
are all difficult, but there is a good road from Matta, on the
Mohmand border, through Pandiali to Ambahar. The dwellers in
Laman can be easily coerced, but in their time, and particularly
during the first years of British occupation of the frontier country,
they have given a great deal of trouble, raiding the border and
sheltering outlaws.
The Utman Khels are quite a distinct people, being unconnected
with any of the Pathan races which surround them—whether
Mohmands, Bajauris, or Yusafzais; they have more than once waged
war with the Mohmands, but consider themselves to be on specially
friendly terms with the Shinwaris.
OPERATIONS.
In the middle of the last century the favourite raiding ground of
the restless spirits of the Utman Khels was the Hastnagar division.
Early in 1852, they permitted one Ajun Khan, a notoriously
disaffected man, to take up his residence in Utman Khel villages to
the north of the district, and here he gathered together a band of
adventurers like himself to raid upon our border. Finally in April,
Ajun Khan collected some 200 mounted men, attacked Charsada, the
headquarters of the division, plundered the treasury and slew some
of our officials. On the following day he occupied Abazai, and then
visited Pranghar and Nawedand, where he took up his quarters.
Within a week, however, Sir Colin Campbell was moving troops out
against him from Peshawar.
Expedition against the Independent Utman Khels, 1852.—Sir
Colin Campbell established his headquarters at Abazai and there
concentrated the following force:
1. Ismailzai.
2. Isozai.
3. Mamunds,
and of the different valleys into which Bajaur is split up, the Maidan
Valley is occupied by the Ismailzai, the Baraul and Jandol Valleys by
the Isozai, and the valleys of Babukarra, Chaharmung and Watelai by
the Mamunds, who also own a good deal of land across the border in
Afghanistan. Some six or seven alien tribes also live among the
Bajauris—chiefly in the Jandol and Maidan Valleys. Originally
Jandol belonged to Bajaur, but it has within recent years come under
the political control of Dir, whose ruler, however, has little or no
authority over the people of the Jandol Valley.
The Valleys of The Maidan Valley is about ten miles
Bajaur long, rich and fertile and well cultivated,
watered by the Maidan or Kunai River. The Jandol Valley, whose
northern and southern boundaries are the Janbatai Range and the
Rud River, has a total area of some 144 square miles, being about
fourteen miles long, with a breadth ranging from six to ten miles,
and is also rich and well cultivated. The Baraul Valley is divided into
an upper and a lower, the upper including the Janbatai district, and
good crops are raised here, and iron of excellent quality is exported.
The Babukarra Valley is about fifteen miles long, with an average
width of five or six miles; the range of the Hindu Raj divides it from
Asmar on the north, on the east the Takwara spur separates it from
Jandol, on the west is the Mamund or Watelai Valley, while to the
south, on the right bank of the Bajaur River, is the country of the
Utman Khel. The Chaharmung Valley lies between the Mamund
country on the north-east and the Kamangara Valley on the south-
west. The Watelai Valley, occupied by the Mamunds, the most
important section of the Tarkanris or Bajauris, lies between the
valleys of Chaharmung and Babukarra; it is about thirteen miles in
length, with a maximum breadth of ten miles, and is well cultivated,
but has no main river of any importance running through it, and the
bed of the valley is much cut up by deep nullahs. The Mamunds are
probably the most warlike of the Tarkanris, and can put 12,000 men
in the field, all well armed as frontier tribesmen go.
The position of the Khan of Nawagai requires some explanation.
He is the hereditary chief of a branch of the Salarzai sub-division of
the Mamunds, and also of all the Tarkanris, but his authority has of
late years very greatly diminished, although he is still by no means
without influence, even far beyond the borders of his own Khanate.
His actual territory is an irregular tract of country on the left bank of
the Rud River, together with the district of Surkamar; part of his
country was encroached upon some years ago by the Mohmands, and
he has never been sufficiently powerful to regain permanent
possession of it.
The country known as Dir comprises roughly the whole area
drained by the Panjkora River and its affluents, as far south as its
junction with the Rud River of Bajaur. The Upper Panjkora Valley is
known as the Panjkora Kohistan, and is divided into two parts called
Bashkar and Sheringal. The principal subsidiary valleys of Dir are the
Kashkar or Dir, the Baraul and the Maidan on the west, and the
Ushiri and Talash Valleys on the east. The northern limit of Dir is the
crest of the mountain range which divides it from Chitral and Yasin;
the Durand line is the boundary on the west; on the east it is
bounded by Kohistan, and on the south by the valley of Upper Swat
and by Bajaur. From the mass of mountains to the north three giant
spurs or ranges run down towards the south. The easternmost of
these, forming the watershed between the Swat and the Indus Rivers,
runs first due south and then west to the Malakand. The central
forms the watershed between the Panjkora and Swat. The
westernmost range is a continuation of the Hindu Raj, runs south-
westerly, and forms the watershed between the Panjkora and Rud
Rivers on the one side and the Kunar on the other. The most
important pass which crosses it is the Lowari or Laorai (10,250 feet),
open for convoys from April to November; it carries the main road
from India to Chitral.
Description of Dir The four sections of the Malizai sub-
division of the Khwazozai-Akozais resident
in Dir are:
1. Painda Khel.
2. Sultan Khel.
3. Nusrudin Khel.
4. Ausa Khel.
On the Panjkora River, commencing from the north, in the
Kashkar Valley, in which the village of Dir is situated, is the Akhund
Khel sub-section of the Painda Khel Malizais, to which the Khan of
Dir belongs. Below these again, on the left bank of the river, are more
of the Painda Khel, and on the right bank the Sultan Khel; and, still
further down, the Sultan Khel, Nusrudin Khel and Ausa Khel on both
banks of the river.
The route to Chitral from the Swat Valley leads through this
country. Leaving the Swat River at Chakdara, the road turns abruptly
to the west and enters the Uch Valley, passing by the Katgola Pass
(3000 feet) into the Talash Valley, where, as Bellew tells us and as
later travellers have confirmed, there are extensive ruins of massive
fortifications on the south side of the valley and nine or ten miles
from the Panjkora, covering the hills for a distance of several miles.
From here the ascent is very steep to the summit of the Kamrani
Pass, to the north-east of which, in a valley, lies Mundah, the
stronghold of Mian Gul Jan, the quarrelsome younger brother of the
Khan of Dir. The descent from the kotal to Sado or Khungai is very
steep. Turning to the right from Sado, the road passes up the
Panjkora Valley, the river being crossed on the fourth march from
Sado at Chutiatun, whence, a few miles further along the right bank
of the Dir stream, Dir itself is reached. “Here,” writes Enriquez,
“situated on a low hill is the stronghold of the Khan. The fort has
three towers, each surmounted with a loop-holed fighting top.... The
vale of Dir is well cultivated and numbers of chenars are scattered
about it, so that its greenness is refreshing after the wearying aridity
of the Panjkora. The little town of Dir occupies a steep khud abreast
of the fort. Its crazy huts are built one above the other, so that the
roof of one forms the promenade or front garden of the one above.”
Then on up the Dir Valley, via Mirga, to the Lowari Pass and Chitral.
An alternative route, branching off from Sado, runs westward for
some way and then, turning northward again, ascends the bed of the
Jandol River to the Janbatai Pass (7212 feet); after crossing this the
road leads along the Baraul Valley to Chutiatun and Dir, where it
joins the first mentioned road.
The people of Dir and Bajaur are all Sunni Muhammadans,
intensely bigoted, but superstitious rather than religious. Their
country is very much priest-ridden, and the people are unusually
susceptible to the influence of the mullahs, who are able to excite
them to fanaticism more easily and to a greater degree than among
other Pathans. The fighting men in Dir and Bajaur number probably
not less than 80,000; they, and more particularly the men of Dir,
have a very strong sense of discipline; and in the event of a general
fanatical rising the combination of tribes which could be formed
would be by no means one to be despised, since they would probably
receive material assistance, if not indeed open and active help, from
Swat, from the Utman Khels, and very possibly from the men of
Buner.
OPERATIONS.
Umra Khan of It will be convenient here to give some
Jandol account of Umra Khan of Jandol, whose
usurpations were responsible for the formation of the Chitral Relief
Expedition, the operations of which, in the countries of Dir and
Bajaur, are about to be described.
Umra Khan was a younger son of the Khan of Jandol, and a
grandson of the Chief of Bajaur who took up arms against us during
the Ambela campaign. He quarrelled with his father and was
expelled from the country; but returning in 1878 he killed his elder
brother, and later, as the result of a year’s successful fighting, he
made himself master of Jandol, and eventually brought under his
control a tract of country extending from the Dir-Chitral border in
the north to the Swat River in the south, and including the whole of
Dir, the greater part of Bajaur and a portion of Swat. In 1891 and
1892 the Kabul Government undertook certain operations, which
were not particularly successful, to check Umra Khan’s aggressions,
and up to the latter year he seems to have been friendly inclined
towards the British. In 1892, however, when he was being somewhat
pressed, both by the Afghans from without and by rebels within his
kingdom, an appeal which he made to the Government of India for
assistance in the form of arms and ammunition was refused; and in
1893, as a result of the Durand Mission to Kabul, the territory of
Asmar, which he had coveted and seized, and whence he had been
driven, was handed over to Afghanistan. All this gave great offence to
Umra Khan, and it was shortly after these events that he mixed
himself in Chitral affairs—described in their proper place—leading to
the despatch of the Chitral Relief Force in 1895 and the resultant
operations in Dir and Bajaur.
Detail of the Force Chitral Relief Expedition, 1895.—It had
been intended to mobilise the First Division
as being nearest to the scene of operations; but some of the units of
which it was composed were then on service in Waziristan, while the
nature of the country to be operated in precluded the employment of
others. The force was ultimately composed as hereunder detailed,
was placed under the command of Lieutenant-General Sir R. Low,
K.C.B., and its base was fixed at Nowshera.
FIRST BRIGADE.
SECOND BRIGADE.
Brigadier-General Waterfield.
THIRD BRIGADE.
DIVISIONAL TROOPS.
11th Bengal Lancers.
Guides Cavalry.
13th Bengal Infantry.[71]
23rd Pioneers.
15th Field Battery R.A.
No. 8 M.B. Royal Artillery.
4 guns, No. 2 Derajat Mountain Battery.
No. 1 Company Bengal Sappers and Miners.
No. 4 Company Bengal Sappers and Miners.
No. 6 Company Bengal Sappers and Miners.
RESERVE BRIGADE.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookball.com