WWW.DISSERS.RU

菟亘籍誉 殍妬厥陵誉 組阻販凖弊

   廷瘰 闔聳謗矗鴾!


Pages:     || 2 | 3 | 4 | 5 |   ...   | 13 |
免揚冫登冫体 料仞芭太揚 誉喨 侘冪班冓良 堙津仞嵌 兩擁-賄凖仭嗤恥僻 誉嵌陵惜寨柯 煩冕田梁籍屠槃僻 嗟搬登冏凖 藩堽侈赤販様柎 凖嬪遼涼班, 姪媽揚僻 力卮僻 .. 暦蓖鈞 俥苣珀銜袱 關蓚鈕纃蓍 轢 C# 囓縺邇 闔骼瘉 凰迥-纈辮癈鞦 2012 喞 004.655, 004.657, 004.62 .. 暦蓖鈞 俥苣珀銜袱 關蓚鈕纃蓍 轢 C# - 冢: 揚 頒摸, 2012. 118 .

闔骼瘉 蒟諤窶鴆 跂鴈粫繿褂 鼕瑯琿 碼闔謐纃蕈 諤瘤鞐鴈齏 鞐瘤 闔 粫髢蓖謌辣 吶邇謗竏 關釿鞐跛蒡鈞琿.

鞳粱瑯轢纃 粳 髓黻纃鴈, 釶齬珱蔘 闔 碌繻 關銓蓚 闔粃銜鈞褂 痼袱諤碚鈞 轢關珥諷辷: 210700 罷鉅鉤踈辷袱蓆迯 鱚邇謗竏 驤髓繻 驍艾.

倥褌跂辟鈞琿 閻瑩 囓纃 骼矼鴈 琲鼡鱚鰰 罷鉅鉤踈辷袱蓆迯 鱚邇謗竏, 關銜鉅鉉 4 銜 13 粤袱瘰 2011.

2009 竡糂 嚶萵辮驤鱚 髓琺 闔痳粫鱚諷 跋釿鍄鰰闕釿 褌迥齔騾, 鞳苴譛鰰鱚 褌鴈韲竡 鈿鞳粤諷逶 12 矼糂蔘 鼾萵辮驤鱚鴈 們髑蓙, 褌鴈顋 關蔡碆纃 袱鱚竡韆 沃蓆轢譛逶 蔡驪繖鈞瑩繼驫蓍 鼾萵辮驤鱚鮖. 匁辷髓辮髓碆 釶鞐芬矗辷 轢鼕 們髑蓍驫鉗 壹粤鞐蓙 癪諤 齟矼鞴粤轢 關釿鞐跛 繝 鞐艪蓿 轢 20092018 竡糴. 2011 竡糂 嚶萵辮驤鱚 闔謫蓚 轢蓐纃鈞琿蒹 凰迥-纈辮癈鞦驫蓍 轢蓆轢譛逶 蔡驪繖鈞瑩繼驫蓍 鼾萵辮驤鱚 蓁鉋赭蓆迯 鱚邇謗竏, 跂琿蒻 鈿鱶褂.

凰迥-纈辮癈鞦驫蓍 轢蓆轢譛逶 蔡驪繖鈞瑩繼驫蓍 鼾萵辮驤鱚 蓁鉋赭蓆迯 鱚邇謗竏, 跂琿蒻 鈿鱶褂, 2012 ..暦蓖鈞, 2012.

2 例諤硅纃蒹 隊繖纃蒹....................................................................................................... 5 摩瘤鞐鴈齏 鞐瘤鰰 1. 剋舮琿蒹 關鉐鴈 C#-關釿鞐跛.................... 6 囂鞐肭纃蒹 1. 剋舮琿蒹 關鉐鴈 關釿鞐跛......................................... 6 囂鞐肭纃蒹 2. 菩跫蓚 艢闢驫 C#-關釿鞐跛 蒟 褌赭辟邇 髓韲褂............................................................. 7 囂鞐肭纃蒹 3. 費闔譛芬矗辷 銜諤糢蒻 Visual Studio.NET............... 7 囂鞐肭纃蒹 4. 廷痼硅纃蒹 C#-關釿鞐跛 釶鞐瘤鵄蒻 蔡裨蓿繼逶 驤鴦瑶蓍............................................... 摩瘤鞐鴈齏 鞐瘤鰰 2. 剋舮琿蒹 蔡闔譛芬矗辷 鞐芟辮逶 鱶闔 籥迯..................................................................................................... 囂鞐肭纃蒹 1. 剋舮琿蒹 閻鞳蔡諷辷.................................................. 囂鞐肭纃蒹 2. 剋舮琿蒹 蔡闔譛芬矗辷 髓頌褞齔.......................... 囂鞐肭纃蒹 3. 廷痼硅纃蒹 碆芟鈕邇髓 矜鈔/碼碆籥....................... 摩瘤鞐鴈齏 鞐瘤鰰 3. 費闔譛芬矗辷 碼鞐聽辷 蔡裨纃蓍.... 囂鞐肭纃蒹 1. 鞳釶鞐芬矗辷 粱 竡籥 籥鴦 鱶閠 跂 - 粤逵.... 囂鞐肭纃蒹 2. 韲矼韋 矜鈔蓐釿 闔譛芬矗鱚諷 芻瑾纃 粱 竡籥................................................................................... 囂鞐肭纃蒹 3. 囓纈 礦骼褌骰 竡粮.................................................. 摩瘤鞐鴈齏 鞐瘤鰰 4. 剋舮琿蒹 蔡闔譛芬矗辷 跂鴈粮............... 囂鞐肭纃蒹 1. 費闔譛芬矗辷 閠鞐跂鴃鈞 跂鴈籥, 碆艪鞐珱蔘 芻瑾纃................................................ 囂鞐肭纃蒹 2. 費闔譛芬矗辷 跂鴈籥 閠鞐跂鴃鈞, 閻鞳籥矗繻 闔 髑謚................................................ 囂鞐肭纃蒹 3. 費闔譛芬矗辷 碆艪鞐璢踵 閠鞐跂鴃鈞 跂鴈籥............................................................................. 摩瘤鞐鴈齏 鞐瘤鰰 5. 剋舮琿蒹 蔡闔譛芬矗辷 赭髑萵鈞............. 囂鞐肭纃蒹 1. 俥瘤鰰 赭髑萵瑕 鞐芟辮逶 鱶闔.......................... 囂鞐肭纃蒹 2. 辮繻邇聽辷 赭鴃蔬................................................... 摩瘤鞐鴈齏 鞐瘤鰰 6. 剋舮琿蒹 蔡闔譛芬矗辷 裨瑜骼................ 囂鞐肭纃蒹 1. 剋舮琿蒹 蔡闔譛芬矗辷 裨瑜騾................................. 囂鞐肭纃蒹 2. 着辣鞐 邇跂韲 痼迥鈞驫蔘 髣纈鈞........................ 囂鞐肭纃蒹 3. 廷痼硅纃蒹 粮闔謐蓿繼逶 public 跂鴈粮.............. 摩瘤鞐鴈齏 鞐瘤鰰 7. 剋舮琿蒹 蔡闔譛芬矗辷 髑謗逶 閻鞳跂迯........................................................................................................ 囂鞐肭纃蒹 1. 廷痼硅纃蒹 跂鴈籥 裹繻闍鞐 籵鼬 閠鞐跂鴃瑕..................................................................... 囂鞐肭纃蒹 2. 令鞐纃蒹 髓韲褂.......................................................... 囂鞐肭纃蒹 3. 剋舮琿蒹 關鈿蔡邇 矼韵蓙 鱚襃鰰 珸諤.................. 囂鞐肭纃蒹 4. 韲矼韋 轢謌 鞳琺蒟瑶蓙 蓁鱚頸繪騾.................. 囂鞐肭纃蒹 5. 俥瘤鰰 蓁鱚頸繪騾跏................................................... 摩瘤鞐鴈齏 鞐瘤鰰 8. 剋舮琿蒹 釶繩鴈 齒鞐硅纃蒹 鞳體韵瑕........................................................................................................... 囂鞐肭纃蒹 1. 俥苣珀銜袱 褌迹鴃鼕鴈韲............................................. 囂鞐肭纃蒹 2. 罷蔬葯謌艢 籥迯 鴈譛褌 粳 鱚辷.................. 囂鞐肭纃蒹 3. 費闔譛芬矗辷 珀謗轢 粳 黻琺纃 釶繩鴈......... 摩瘤鞐鴈齏 鞐瘤鰰 9. 費闔譛芬矗辷 轢驪繖鈞琿 關 鞳琺蒟瑶蓙 蓁鱚頸繪骼.................................................................................. 囂鞐肭纃蒹 1. 鞳釶鞐芬矗辷 蔡鈔邇竡 珸諤 轢 C# 珸 HTML................................................................................ 囂鞐肭纃蒹 2. 鞳釶鞐芬矗辷 蔡鈔邇竡 珸諤 轢 C# 珸 HTML................................................................................ 摩瘤鞐鴈齏 鞐瘤鰰 10. 費闔譛芬矗辷 跪粫蒻瑩鉋 粮髓齒 internal 骼舮琿蒹 驕鉋鉅................................................................................. 囂鞐肭纃蒹 1. 剋舮琿蒹 裨瑜騾 跪粫蒻瑩鉋鉤 internal.................. 囂鞐肭纃蒹 2. 齢窶辷艢 裨瑜骼 驕鉋褥....................................... 摩瘤鞐鴈齏 鞐瘤鰰 11. 辮繝頌芒 鈿辮瑩鉋鈞 蔡闔譛芬矗辷 骼癪鱶............................................................................................................... 囂鞐肭纃蒹 1. 辮繝頌芒 鈿辮瑩鉋鈞 粳 裨瑜騾 BankAccount......... 囂鞐肭纃蒹 2. 麗鞳粤諷辷 蔡闔譛芬矗辷 骼癪鱶....................... 摩瘤鞐鴈齏 鞐瘤鰰 12. 費闔譛芬矗辷 驍鉗髓 蓁粤襃瑩鉋鈞...... 囂鞐肭纃蒹 1. 泌跂辣辷 裨瑜騾 BankAccount..................................... 囂鞐肭纃蒹 2. 泌跂辣辷 裨瑜騾 BankTransaction............................. 囂鞐肭纃蒹 3. 剋舮琿蒹 蔡闔譛芬矗辷 蓁粤襃瑩鉋鈞................... 摩瘤鞐鴈齏 鞐瘤鰰 13. 剋舮琿蒹 蔡闔譛芬矗辷 瑩韆癈鴈........ 囂鞐肭纃蒹 1. 費闔譛芬矗辷 瑩韆癈鰰 Conditional.......................... 囂鞐肭纃蒹 2. 剋舮琿蒹 蔡闔譛芬矗辷 闔譛芬矗鱚譛驫釿 瑩韆癈鰰.......................................................................... 剌蔡鉅 謌鱚鞐鴦顋................................................................................. 韆謗聽辷............................................................................................. 呀瘠蔬 1.1 瑁瑕纈顋 鉋赭鱶韲矗辷 C#....................................... 呀瘠蔬 1.2 羅褌鴈顋 鵆竏 XML......................................................... 呀瘠蔬 1.3 夐珮 褌跫蓚鴈鞐 褌赭辟邇 髓韲褂........................... 隊繖纃蒹 鞳苴譛鰰鱚 蒟齬纃 粫髢蓖謌逶 吶邇謗竏 關釿鞐跛蒡鈞琿 髓黻纃鴿 闔芻琲鉤鴆:



痼芬碼跏 褌逍繽跏 鱚韭蓁鉉釿蒹 釶繩鴉銕韆纃鱶韲矗迯釿 關釿鞐跛蒡鈞琿;

鉐邇矗跏 驟赭迺蒻 驤迺琲驤騾 茆袱 關釿鞐跛蒡鈞琿 #;

蓁髓頌跂迺琺逶跏 髏繖髓矗跏 鞐苣珀銜褂 關釿鞐跛邇竡 釶繿閻纃;

關蓆瘰纈齟 轢碼褂:

鞐苣珀銜褂 鱚辷繿褂 艢籥辷 轢 關鈬褞蒡鈞琿蒹 關釿鞐跛邇竡 釶繿閻纃;

鞐苣珀銜褂 琺竡韆鳰 鞳琺蒟瑶蓙 關釿鞐跛邇竡 釶繿閻纃 轢 鉐邇矼 骼碚繻纃逶 髏繖髓 Microsoft Visual Studio;

蔡闔譛芬矗辷 髓琿籥頏逶 髏繖髓 銜諤粨 關釿鞐跛.

鉅鉈琿蓙 釶齬纃 髓黻纃鴿 骭釿齟:

闔辷赭鴾 鉐邇硴 諷跂迺.NET Framework 驍苜 # 諷跂迺瑕 闍瑩鉋踵.NET;

鞐瘤鰰鴾 髏繖 鞐苣珀銜褂 Microsoft Visual Studio;

骼舮珥瑩, 銜諤肆矗鴾, 褌跫蓚蒡鈞瑩 碼闔謐鴾 關釿鞐跛;

骼舮珥瑩 蔡闔譛芬矗鴾 閻鞳跂迯;

蔡闔譛芬矗鴾 碼鞐聽辷 茆袱 關蓐纃鴾 釶鞐瘤鳧 蔡裨纃蓍;

骼舮珥瑩 跂鴈糴;

骼舮珥瑩, 蓁蔬葯謌艾韲矗鴾 蔡闔譛芬矗鴾 赭髑萵;

芻瑩 痼芬碼 褌逍繽蓙 鱚韭蓁鉉釿蕈 釶繩鴉銕韆纃鱶韲矗迯釿 關釿鞐跛蒡鈞琿;

骼舮珥瑩, 蓁蔬葯謌艾韲矗鴾 鞐苣齪瑩 釶繩鴿 關釿鞐跛;

骼舮珥瑩 裨瑜髮 蒹鞐頤蓙 裨瑜骼;

鈿鞳粤鴾 鈿辮瑶蓙 骼癪鱶 闔譛芬矗鱚譛驫鉤 裨瑜驟;

鞳琺蒟鈞矗鴾 驍鉗髓矗 蓁粤襃瑩鉋;

蔡闔譛芬矗鴾 髓琿籥頏逶 闔譛芬矗鱚譛驫蒹 瑩韆癈鴿.

帝 碼闔謐纃 齒鞐肭纃蓍 蔡闔譛苴鴆 竡鴈碼 髓瑁鴈碼 關鈬褞. 費鈔逶 珸譖 粳 碼闔謐纃 艢籥辷 轢鈔鴆 驟鱚碆 閠闃 \\atec\student\Work\C#\Console_App. 刳鈿蒡皷鱚 蔘 轢 謗袱譛逑 赭蓁 閻鞳 碼闔謐纃蒹 齒鞐肭纃蓍.

摩瘤鞐鴈齏 鞐瘤鰰 1. 剋舮琿蒹 關鉐鴈 C#-關釿鞐跛 帙譛 鞐瘤鴿 泌齬纃蒹 髓頌褞齔 關釿鞐跛 轢 茆裙 C# 關蓆瘰纈纃蒹 轢碼褌 繞 褌跫蓚蓙 銜諤粨.

囂鞐肭纃蒹 1. 剋舮琿蒹 關鉐鴈 關釿鞐跛 鴈 齒鞐肭纃蓙 茸 轢闊蓿 關釿鞐跛 轢 茆裙 C#, 蔡闔譛苴 髏繖 鞐苣珀銜褂 Visual Studio.NET. 韲竦瑕赭 癈粤 髀鞐萵瑩, 袱 退 芬碵 艢鱚 舮鉋鈞瑩 退跏 闔 蓐纃.

剋舮珸鱚 邇碆 褌迹鉉邇 C#-關蓚鈕纃 楳闢髓蓿 Microsoft Visual Studio.NET. (Start All Programs Visual Studio.NET Microsoft Visual Studio.NET).

茸痳韆鱚 闢迥 跂迸 FileNewProject.

沃 閠辣謌 Project Types 碼痳韆鱚 Visual C# Projects.

沃 閠辣謌 Templates 碼痳韆鱚 Console Application.

鱚襃鴈碆 闔諷 Name 矜繖蓿 蓐 關鈬褞 Greetings.

闔諷 Location 鼕琅蓿 袱鰰謗 粳 關鈬褞 install folder\Labs\Lab02 轢肚蓿 OK.

泌跂辷鱚 蓐 裨瑜騾 轢 Greeter.

剋鞐辷鱚 關鈬褞, 碼瘰珥 闢迥 跂迸 FileSave All.

沃闊蓿 褌, 艢關璋萵珱蓍 蓐 闔譛芬矗鱚 關萵纈髓碵蓍 繝 闔 蓐纃.

跂鴈粤 Main 碌鰰磅鱚 驪繖龠龠 髓韲褥 褌籥:

string myName;

沃闊蓿 褌, 艢關璋萵珱蓍 蓐 闔譛芬矗鱚.

沃闊蓿 褌, 髣蓿矗蓍 矜繖纃邇 闔譛芬矗鱚諷 蓐 關蔡矗萵珱蓍 闔謫纃邇 芻瑾纃蒹 髓韲褌碆 閻鞳跂迯鉗 myName.

廷痼磅鱚 褌, 褌鴈顋 癈粤 碼碆粫鴾 轢 褓琿 髓韲褥 Hello myName, 邃 myName 蓐, 矜繖纃邇 闔譛芬矗鱚諷.

避釿鈞 鱚襃 跂鴈籥 Main 粮諞纃 碼站粤鴾 驪繖龠蓐 釶鞐芬:

static void Main(string[ ] args) { string myName;

Console.WriteLine("Please enter your name");

myName = Console.ReadLine( );

Console.WriteLine("Hello {0}", myName);

} 剋鞐辷鱚 關鈬褞.

歴褌跫蓚蒡皷鱚 艢闢髓蓿 關釿鞐跛 茸痳韆鱚 闢迥 跂迸 BuildBuild Solution (蓚 Ctrl+Shift+B).

韆 辣釶鈔蓐鉐鱶 蔡關珥鱚 銹葹褂 銜褌跫蓚蒡皷鱚 關釿鞐跛 艢邇碆.

茸痳韆鱚 闢迥 跂迸 DebugStart Without Debugging (蓚 Ctrl+F5).

闔礦磋繻 鉅辣 矜繖蓿 驍鈬 蓐 轢肚蓿 ENTER.

楳褓鉗鱚 關蓚鈕纃蒹.

囂鞐肭纃蒹 2. 菩跫蓚 艢闢驫 C#-關釿鞐跛 蒟 褌赭辟邇 髓韲褂 鴈 齒鞐肭纃蓙 茸 銜褌跫蓚蒡黼鱚 艢闢髓蓿 退 關釿鞐跛 蒟 褌赭辟邇 髓韲褂.

歴褌跫蓚蒡皷鱚 艢闢髓蓿 退 關蓚鈕纃蒹 蒟 褌赭辟邇 髓韲褂 楳闢髓蓿 Visual Studio.NET Command Prompt. (StartAll ProgramsVisual Studio.NETVisual Studio.NET ToolsVisual Studio.NET Command Prompt) 辮繪粫鱚 袱鰰謗 install folder\Labs\Lab02\Greetings 歴褌跫蓚蒡皷鱚 退 關釿鞐跛, 蔡闔譛苴 驪繖龠龠 褌赭辟:

csc /out:Greet.exe Program1.cs 楳闢髓蓿 關釿鞐跛, 轢瘰珥 褌赭辟邇 髓韲裙 繞 轢艪琿蒹:





Greet 楳褓鉗鱚 鉅邇 褌赭辟邇 髓韲褂.

囂鞐肭纃蒹 3. 費闔譛芬矗辷 銜諤糢蒻 Visual Studio.NET 鴈 艢籥辷 茸 關蓆瘰纈纈 轢碼褂 鞐瘤鴿 蓁鱚竦蒡鈞琿逶 銜諤糢蒻鉤 Visual Studio.NET, 蒟齬蓿 闔粮 銜諤粨 關釿鞐跛 闔 珮瑕 鉅轢 粳 關鉐跪鴃 芻瑾纃 閻鞳跂迯.

鉐鰰磅鱚 鴈褂 鉐鰰邇礪 艢闢髓蓿 闔珮鈞鈬 碼闔謐纃蒹 楳闢髓蓿 Visual Studio.NET, 繿謌 鉈 辣 艢闢纃.

茸痳韆鱚 闢迥 跂迸 FileOpenProject.

歴褓鉗鱚 關鈬褞 Greetings.sln 蒟 閠闃 install folder\Labs\Lab02\Greetings.

鞳籥褞鉋 褌籥 裨瑜騾 Greeter 繼褄蓿 闔 褓珸辣踈 諷碆踈 闔譫 轢 齔鈞辣 髓韲褂 褌籥, 邃 硼辮碼 碌鴃纓璢鴆 褌赭辟 Console.WriteLine.

茸痳韆鱚 闢迥 跂迸 DebugStart (蓚 轢肚蓿 F5).

韲竦瑕赭 艢闢髓蓿 轢 碼闔謐纃蒹, 闔礦鴆 褌迹鉉邇 鉅邇 艢鱚 關釿鞐跛 關辮矼鴆 跂髓 鴈褂 鉐鰰邇礪.

韲骭銜韆鱚 芻瑾纃蒹 閻鞳跂迯鉗 茸痳韆鱚 闢迥 跂迸 Debug WindowsWatchWatch1.

鉅辣 Watch 髀蔡鉅 碼鞐聽辷 粳 跪辷鴈韆辜 粮痼磅鱚 閻鞳跂迯龠 myName.

鉅辣 Watch 闔礦鴆 閻鞳跂迯 myName 鱚褥蓐 芻瑾纃蒹 null.

費闔譛苴蜥 褌赭辟 闔珮鈞釿 碼闔謐纃 帝 碼闔謐纃 閻鞨鉗 褌赭辟 Console.WriteLine 碼痳韆鱚 闢迥 跂迸 DebugStep Over (蓚 轢肚蓿 F10).

帝 碼闔謐纃 驪繖龠繪 髓韲褂 褌籥, 骼粤鞴璞繪 褌赭辟 Console.ReadLine, 骰鈞 轢肚蓿 F10.

代齏蓿繿 褌迹鉉邇 鉅邇, 矜繖蓿 驍鈬 蓐 轢肚蓿 ENTER.

代齏蓿繿 Visual Studio. 吶褥繞 芻瑾纃蒹 閻鞳跂迯鉗 myName 鉅辣 Watch 癈粤 骼粤鞴瑩 退 蓐.

帝 碼闔謐纃 驪繖龠繪 髓韲褂 褌籥, 骼粤鞴璞繪 褌赭辟 Console. WriteLine, 骰鈞 轢肚蓿 F10.

俥艪辮辷鱚 褌迹鉉邇 鉅邇. 呀 闔礦謗髴 關萵纈髓礦.

代齏蓿繿 Visual Studio. 帝 艢矼頽纃 碼闔謐纃 關釿鞐跛 碼痳韆鱚 闢迥 跂迸 DebugContinue (蓚 轢肚蓿 F5).

囂鞐肭纃蒹 4. 廷痼硅纃蒹 C#-關釿鞐跛 釶鞐瘤鵄蒻 蔡裨蓿繼逶 驤鴦瑶蓍 鴈 齒鞐肭纃蓙 茸 轢闊蓿 關釿鞐跛, 褌鴈韲 癈粤 蔡闔譛芬矗鴾 釶鞐瘤鵄蒻 蔡裨蓿繼逶 驤鴦瑶蓍, 褌鴈顋 癈粤 銜諤硅萵瑩 銹葹褂 碚繻纃 碼闔謐纃. 韲竦瑕赭 癈粤 艢關璋萵瑩 闔譛芬矗鱚 籵 繼 蔡諤, 粤謌鴾 閻鞨鈬 蔡謗 轢 碣鉋鈬 碼碆粫鴾 闔謫纃逶 鞳苴譛鰰.

剋舮珸鱚 邇碵 C#-關釿鞐跛 楳闢髓蓿 Visual Studio.NET, 繿謌 鉈 辣 艢闢纃.

茸痳韆鱚 闢迥 跂迸 FileNewProject 沃 閠辣謌 Project Types 碼痳韆鱚 Visual C# Projects.

沃 閠辣謌 Templates 碼痳韆鱚 Console Application.

鱚襃鴈碆 闔諷 Name 矜繖蓿 蓐 關鈬褞 Divider.

闔諷 Location 鼕琅蓿 袱鰰謗 粳 關鈬褞 install folder\Labs\Lab02 轢肚蓿 OK.

泌跂辷鱚 蓐 裨瑜騾 轢 DivideIt.

剋鞐辷鱚 關鈬褞, 碼瘰珥 闢迥 跂迸 FileSave All.

沃闊蓿 褌, 艢關璋萵珱蓍 闔譛芬矗鱚 籵 繼 蔡諤.

跂鴈粤 Main() 轢闊蓿 褌, 艢關璋萵珱蓍 闔譛芬矗鱚 閻鞨鈬 繼鈬 蔡謗.

沃闊蓿 褌, 髣蓿矗蓍 矜繖纃邇 闔譛芬矗鱚諷 蔡謗 關蔡矗萵珱蓍 闔謫纃邇 芻瑾纃蒹 閻鞳跂迯鉗 temp 鱶閠 string.

廷痼磅鱚 褌, 褌鴈顋 閻鞳矼粤 芻瑾纃蒹 閻鞳跂迯鉗 temp 蒟 鱶閠 籥迯 string int 骼鞐辷 闔謫纃逶 鞳苴譛鰰 閻鞳跂迯鉗 i:

int i = Int32.Parse(temp);

尖琺釿蔟逶 釶鞐芬 骼舮珸鱚 驪繖龠蓍 褌:

o 楳關鉐蓿 闔譛芬矗鱚 碣鉋鈬 繼鈬 蔡謗.

o 剽蓿珸鱚 矜繖纃邇 闔譛芬矗鱚諷 蔡謗 關蔡碆蜥 闔謫纃邇 芻瑾纃蒹 閻鞳跂迯鉗 temp.

o 辮繧繖蓿 芻瑾纃蒹 閻鞳跂迯鉗 temp 鱶 籥迯 int 骼鞐辷鱚 闔謫纃逶 鞳苴譛鰰 閻鞳跂迯鉗 j.

避釿鈞 鱚襃 關釿鞐跛 粮諞纃 碼站粤鴾 驪繖龠蓐 釶鞐芬:

Console.WriteLine("Please enter the first integer");

string temp = Console.ReadLine( );

int i = Int32.Parse(temp);

Console.WriteLine("Please enter the second integer");

temp = Console.ReadLine( );

int j = Int32.Parse(temp);

剋鞐辷鱚 關鈬褞.

俥舮繼蓿 閻鞨鈬 蔡謗 轢 碣鉋鈬 碼矼粫鱚 鞳苴譛鰰 轢 褓琿 沃闊蓿 褌, 骼舮珱蓍 邇碵 閻鞳跂迯龠 k 鱶閠 int, 褌鴈頌 癈粤 艢邇驤鴾 鞳苴譛鰰 粤諷辷 蔡諤 i 轢 j, 闔跂髓蓿 繝 闔驪 褌籥, 骼舮琿邇竡 關繖糂繻 闢迥鱚.

int k = i / j;

廷痼磅鱚 褌, 碼碆蓍 芻瑾纃蒹 k 轢 褓琿.

剋鞐辷鱚 關鈬褞.

韲鱚髓蒡皷鱚 關釿鞐跛 茸痳韆鱚 闢迥 跂迸 DebugStart Without Debugging (蓚 Ctrl+F5).

隊繖蓿 閻鞨鈬 蔡謗 10 轢肚蓿 ENTER.

隊繖蓿 碣鉋鈬 蔡謗 5 轢肚蓿 ENTER.

韲矼顫鱚, 鴈 碼碆粫跪 芻瑾纃蒹 k 癈粤 鞐硴 2.

剄鈞 艢闢髓蓿 關釿鞐跛 轢 碼闔謐纃蒹, 轢聳 Ctrl+F5.

隊繖蓿 閻鞨鈬 蔡謗 10 轢肚蓿 ENTER.

隊繖蓿 碣鉋鈬 蔡謗 0 轢肚蓿 ENTER.

關釿鞐跛 碆芻蒻辣 蔡裨蓿繼轢 驤鴦瑶 (粤諷辷 轢 邇譛).

帝 鋏蔡鳧 鉅轢 粫琺釿 Just-In-Time Debugging 碼痳韆鱚 No.

廷痼磅鱚 關釿鞐跛 釶鞐瘤鵄蒻 蔡裨蓿繼逶 驤鴦瑶蓍 鉤繿鱶鱚 褌 跂鴈籥 Main() 硴齟顫 瘠鉅 try 驪繖龠蓐 釶鞐芬:

try { Console.WriteLine (...);

...

int k = i / j;

Console.WriteLine(...);

} 跂鴈粤 Main() 闔驪 瘠鉅 try 粮痼磅鱚 瘠鉅 catch, 硴齟韆 褌鴈韲竡 粮諞邇 碼碆粫鴾 褓瑩褌 骼釶纃蒹 釶 銹葹裙:

catch(Exception e) { Console.WriteLine("An exception was thrown: {0}", e);

}...

剋鞐辷鱚 關鈬褞.

避釿鈞 鱚襃 跂鴈籥 Main 粮諞纃 碼站粤鴾 驪繖龠蓐 釶鞐芬:

public static void Main(string[ ] args) { try { Console.WriteLine ("Please enter the first integer");

string temp = Console.ReadLine( );

int i = Int32.Parse(temp);

Console.WriteLine ("Please enter the second integer");

Pages:     || 2 | 3 | 4 | 5 |   ...   | 13 |










2011 www.dissers.ru - 槽髀諤鴉 諷褞韲迯 瘉瘠蓆鱚袱

尤鱚韆琺 鴈竡 騾蜥 鞐芟纖纃 粳 鈑轢褌跌纃, 碌 關珥 關蓁珞諷聳 蔘 珥鴈鞐.
淘謌 茸 辣 骼站瑜逶 鱚, 鴈 退 赭鱚韆琺 鞐芟纖誤 轢 鴈 騾蜥, 闔聳謫蜻鰰, 轢闊蓿 轢, 踵 鱚纃蓙 1-2 鞐瘤蔘 粱繪 黻琺蓐 繝.