




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、本科生畢業(yè)論文(設(shè)計)冊作者姓名:楊蕾指導(dǎo)教師:孫慧所在學(xué)部:信息工程學(xué)部專 業(yè):計算機(jī)科學(xué)與技術(shù)班級(屆):2014屆二一四年五月十日學(xué)位論文原創(chuàng)性聲明本人所提交的學(xué)位論文基于asp.net的博客系統(tǒng),是在導(dǎo)師的指導(dǎo)下,獨(dú)立進(jìn)行研究工作所取得的原創(chuàng)性成果。除文中已經(jīng)注明引用的內(nèi)容外,本論文不包含任何其他個人或集體已經(jīng)發(fā)表或撰寫過的研究成果。本聲明的法律后果由本人承擔(dān)。論文作者(簽名):楊蕾指導(dǎo)教師確認(rèn)(簽名):2014年 5月 10日年 月 日學(xué)位論文版權(quán)使用授權(quán)書本學(xué)位論文作者完全了解河北師范大學(xué)匯華學(xué)院有權(quán)保留并向國家有關(guān)部門或機(jī)構(gòu)送交學(xué)位論文的復(fù)印件和磁盤,允許論文被查閱和借閱。本人授
2、權(quán)河北師范大學(xué)匯華學(xué)院可以將學(xué)位論文的全部或部分內(nèi)容編入有關(guān)數(shù)據(jù)庫進(jìn)行檢索,可以采用影印、縮印或其它復(fù)制手段保存、匯編學(xué)位論文。(保密的學(xué)位論文在 年解密后適用本授權(quán)書)論文作者(簽名):楊蕾指導(dǎo)教師(簽名):2014年 5月 10日年 月 日河北師范大學(xué)匯華學(xué)院本科畢業(yè)論文(設(shè)計)任務(wù)書編 號:2014230301041 論文(設(shè)計)題目: 基于asp.net的博客系統(tǒng) 學(xué) 部: 信息工程學(xué)部 專業(yè): 計算機(jī)科學(xué)與技術(shù) 班級:2010級 學(xué)生姓名:楊蕾 學(xué)號:2010512498 指導(dǎo)教師:孫慧 職稱:副教授 1、論文(設(shè)計)研究目標(biāo)及主要任務(wù)目標(biāo)是實現(xiàn)個人網(wǎng)絡(luò)日志管理,網(wǎng)絡(luò)交友,學(xué)習(xí)交流。
3、本文實現(xiàn)了博客網(wǎng)站的動態(tài)管理,使得對博客信息的管理更加及時,靈活,提高了工作效率。同時對系統(tǒng)的背景需求,系統(tǒng)的功能特點(diǎn)和設(shè)計方案進(jìn)行了介紹。2、論文(設(shè)計)的主要內(nèi)容本文首先針對博客系統(tǒng)的實現(xiàn)過程進(jìn)行了簡單剖析。本系統(tǒng)以microsoft的asp.net技術(shù)作開發(fā),采用sql作為數(shù)據(jù)庫系統(tǒng),使用c#為開發(fā)語言,為開發(fā)功能強(qiáng)大的動態(tài)網(wǎng)站提供了一種簡單,高效的途徑。實現(xiàn)了博客網(wǎng)站的動態(tài)管理,使得對博客信息的管理更加及時,靈活,提高了工作效率。同時對系統(tǒng)的背景需求,系統(tǒng)的功能特點(diǎn)和設(shè)計方案進(jìn)行了介紹。3、論文(設(shè)計)的基礎(chǔ)條件及研究路線本系統(tǒng)使用.net框架作為程序運(yùn)行平臺,采用sql作為數(shù)據(jù)庫系統(tǒng)
4、,使用c#編程語言開發(fā)系統(tǒng)。sql數(shù)據(jù)庫管理系統(tǒng)是強(qiáng)大的企業(yè)級數(shù)據(jù)庫管理系統(tǒng),它完全能夠為應(yīng)用程序提供穩(wěn)定、高效的后臺數(shù)據(jù)管理,.net平臺是穩(wěn)定的應(yīng)用程序運(yùn)行平臺,采用c/s程序架構(gòu)構(gòu)建快速的應(yīng)用程序。并以“標(biāo)準(zhǔn)性、安全性、兼容性、高效性、保密性、可維護(hù)性”為標(biāo)準(zhǔn)。4、主要參考文獻(xiàn)1 watson k. c# 入門經(jīng)典m. 清華大學(xué)出版社, 2002. 2 watson k, nagel c, pedersen j h, et al. beginning visual c# 2010m. john wiley & sons, 2010. 3matthew macdonald,adam fre
5、emanasp.net高級程序設(shè)計人民郵電出版社.5、計劃進(jìn)度階段起止日期1撰寫開題報告,查詢資料2014.1.20-2014.1.312建立設(shè)計框架,編寫程序2014.2.1-2014.2.203充實設(shè)計內(nèi)容,整理論文2014.2.21-2014.3.214設(shè)計內(nèi)容修改和完善2014.3.22-2014.4.305完成畢業(yè)設(shè)計2014.5.1-2014.5.10指 導(dǎo) 教師: 年 月 日教研室主任: 年 月 日河北師范大學(xué)匯華學(xué)院本科生畢業(yè)論文(設(shè)計)開題報告書 信息工程 學(xué)部 計算機(jī)科學(xué)與技術(shù) 專業(yè) 2014 屆學(xué)生姓名楊蕾論文(設(shè)計)題目基于asp.net的博客系統(tǒng)指導(dǎo)教師孫慧專業(yè)職稱副
6、教授所屬教研室計算機(jī)應(yīng)用研究方向圖像處理課題論證: 隨著計算機(jī)技術(shù)的發(fā)展和普及,博客得到了極大的發(fā)展。博客,是weblog的簡稱。博客是一種新的生活方式、新的工作方式、新的學(xué)習(xí)方式和交流方式。它是繼e-mail、bbs、icq、之后出現(xiàn)的第4種網(wǎng)絡(luò)交流方式。博客主要應(yīng)用于3個方面:一是新的人際交流方式;二是以個人為中心的信息摘選和知識管理;三是以個人為中心的傳播出版。(見附錄)方案設(shè)計:數(shù)據(jù)庫為sqlserver2008,整個系統(tǒng)界面采用microsoft visual studio 2010開發(fā)。系統(tǒng)用c#語言實現(xiàn)。服務(wù)器與數(shù)據(jù)庫的連接使用sql server提供程序的sqlconnecti
7、on對象進(jìn)行連接。系統(tǒng)分成兩部分,普通用戶操作界面,功能包括:查看、發(fā)表和刪除文章,發(fā)表評論,上傳和刪除圖片。游客操作界面,管理員通過登錄進(jìn)入管理界面,功能包括:分類管理,文章管理,評論。 普通注冊用戶通過瀏覽器,可以實現(xiàn)對自己文章的管理(對文章的各種信息進(jìn)行瀏覽、增加、刪除、修改等)、未注冊游客對文章信息只能閱讀。游客可以注冊為普通用戶。進(jìn)度計劃:2014.1.20-2014.1.31撰寫開題報告,查詢資料 2014.2.1-2014.2.20建立設(shè)計框架 ,編寫程序2014.2.21-2014.3.21充實設(shè)計內(nèi)容 ,整理論文2014.3.22-2014.4.30設(shè)計內(nèi)容修改和完善2014
8、.5.1-2014.5.10完成畢業(yè)設(shè)計指導(dǎo)教師意見:指導(dǎo)教師簽名: 年 月 日教研室意見: 教研室主任簽名: 年 月 日附錄博客作為個人的一種學(xué)習(xí)工具,簡單易用,吸引人的興趣。博客在教育方面得到了很大的發(fā)展,它將互聯(lián)網(wǎng)從過去的通訊功能,資料功能、交流功能等進(jìn)一步強(qiáng)化,使其更加個性化、開放化、實時化、全球化,把信息共享發(fā)展到資源共享、思想共享、生命歷程共享。博客已經(jīng)成為一種繼課件、積件、資源庫、教育主題網(wǎng)站等信息化教學(xué)模式之后,新的網(wǎng)絡(luò)應(yīng)用模式。它是應(yīng)時代的需求而興起的,也是應(yīng)時代需求不斷進(jìn)步的。博客以個人為中心傳播出版有影響力的消息、新聞、事件等,鮮明的個人特色引人矚目,它以獨(dú)特的視角、敏銳
9、的觀察力,不斷的沖擊傳統(tǒng)媒體。傳統(tǒng)的博客已經(jīng)滿足不了社會的需要,擁有更多更新功能的blog急需走上舞臺。在進(jìn)行動態(tài)網(wǎng)頁制作的時候,由于asp使用方便,操作簡單,很多網(wǎng)頁設(shè)計者一直都使用asp。asp集成在html和腳本語言中,其工作界面簡單,因此,asp相對于其他網(wǎng)頁制作軟件來說,易學(xué)易用,是網(wǎng)頁制作初學(xué)者的入門軟件。同時配合數(shù)據(jù)庫的操作,使個人網(wǎng)站具有更好的網(wǎng)絡(luò)平臺和交互性。本文首先針對博客系統(tǒng)的實現(xiàn)過程進(jìn)行了簡單剖析。本系統(tǒng)以microsoft的asp.net技術(shù)作開發(fā),使用c#為開發(fā)語言,為開發(fā)功能強(qiáng)大的動態(tài)網(wǎng)站提供了一種簡單,高效的途徑。實現(xiàn)了博客網(wǎng)站的動態(tài)管理,使得對博客信息的管理更
10、加及時,靈活,提高了工作效率。同時對系統(tǒng)的背景需求,系統(tǒng)的功能特點(diǎn)和設(shè)計方案進(jìn)行了介紹。本系統(tǒng)使用.net框架作為程序運(yùn)行平臺,采用sql作為數(shù)據(jù)庫系統(tǒng),使用c#編程語言開發(fā)系統(tǒng)。sql數(shù)據(jù)庫管理系統(tǒng)是強(qiáng)大的企業(yè)級數(shù)據(jù)庫管理系統(tǒng),它完全能夠為應(yīng)用程序提供穩(wěn)定、高效的后臺數(shù)據(jù)管理,.net平臺是穩(wěn)定的應(yīng)用程序運(yùn)行平臺,采用c/s程序架構(gòu)構(gòu)建快速的應(yīng)用程序。本博客的設(shè)計以“標(biāo)準(zhǔn)性、安全性、兼容性、高效性、保密性、可維護(hù)性”為標(biāo)準(zhǔn),在著眼于當(dāng)前實用的基礎(chǔ)上,為博客的擴(kuò)展,升級留有余地。軟件的開發(fā)應(yīng)能在較長時間內(nèi)滿足博客用戶的需要。河北師范大學(xué)匯華學(xué)院本科生畢業(yè)論文(設(shè)計)文獻(xiàn)綜述一、研究現(xiàn)狀博客日漸
11、成為網(wǎng)民網(wǎng)絡(luò)生活的主流。你還沒有自己的博客嗎?聽到這種問話,好像低人一等似的,沒有博客,好似白在網(wǎng)絡(luò)混了一樣。有人甚至在好幾家網(wǎng)站都開通了自己的博客,那些名人博客或博客專欄,在許多知名網(wǎng)站上更是隨處可見讓我們來看一些統(tǒng)計數(shù)據(jù): 截止到2005年11月底,在中文互聯(lián)網(wǎng)領(lǐng)域,blog站點(diǎn)達(dá)到3682萬,blogger 人數(shù)達(dá)到1600萬,平均每個blogger 擁有大概2.3個blog。 中國大陸blog服務(wù)商已達(dá)到658家,注冊用戶超過千人的服務(wù)商達(dá)到了330家。 這是05年的數(shù)據(jù),現(xiàn)在的博客人數(shù)可想而知。可以預(yù)言,未來的網(wǎng)絡(luò)發(fā)展方向,當(dāng)屬博客的天下!二、發(fā)展趨勢1、全球化傳播全球化的過程,對于
12、互聯(lián)網(wǎng)就是一個無國界的傳播過程。博客就是適應(yīng)了這種傳播的需要而產(chǎn)生。一個開放的社會,實際上,就是一個虛擬世界中更真實的面對現(xiàn)實社會的選擇。在未來中國互聯(lián)網(wǎng)未來的趨勢中,博客將要占據(jù)更重要的發(fā)展生機(jī)2、網(wǎng)絡(luò)架構(gòu)完善化不同的網(wǎng)站都以自己獨(dú)特的創(chuàng)造性,整合博客技術(shù)初級化的缺陷,在綜合的基礎(chǔ)之上,人們感受到更加完善的博客應(yīng)用系統(tǒng),被開發(fā)出來。進(jìn)行博客技術(shù)開發(fā)應(yīng)用,無疑對中國互聯(lián)網(wǎng)全面推進(jìn)博客走近百姓日常生活起到了非常重要的作用,因而,博客門戶網(wǎng)站的整體架構(gòu)的完善。3、交流平臺的大眾化 未來將會是一個人們更多關(guān)注博客作為自媒體轉(zhuǎn)變時期。隨著交流平臺的綜合性業(yè)務(wù)開展,博客技術(shù)還將變臉,人們會創(chuàng)新更適合交流
13、的商務(wù)、企業(yè)、管理、通訊的博客平臺,這一操作系統(tǒng)將深入到每一個上網(wǎng)人的生活之中。它將整個改變了人類精神交流和文化傳播的模式。4、運(yùn)營模式的商業(yè)化 隨著電訊、數(shù)字化電視和互聯(lián)網(wǎng)絡(luò)三位一體的整合,人類可能更快的實現(xiàn)博客網(wǎng)絡(luò)商業(yè)化運(yùn)行模式。網(wǎng)絡(luò)才是未來整個數(shù)字化社會的平臺,從現(xiàn)有的數(shù)字化電視和通訊來看,這些功能都是可以在網(wǎng)絡(luò)上進(jìn)行整合,網(wǎng)絡(luò)平臺才是未來其它兩個方面主要基礎(chǔ)。5、促進(jìn)傳媒與出版業(yè)的相應(yīng)變革 博客在網(wǎng)絡(luò)社會帶給人們的變化是巨大的,即時性的閱讀和新聞傳播,節(jié)約了資源和紙張,也同時獲得了快捷的知識和信息,人們再也不需要滯后和信息,人們需要的是更快捷和更多樣的文化和精神產(chǎn)品。如果能夠有更多的專
14、業(yè)新聞博客,或者說有更多出版社的博客,人們可以會徹底改變目前這種對于新聞和出版滯后的情景。 6、為中國互聯(lián)網(wǎng)提供重要機(jī)遇 博客不僅是中國互聯(lián)網(wǎng)未來核心和互動作用的關(guān)鍵技術(shù)所在,而且是中國三位一體電訊、數(shù)字化電視和網(wǎng)絡(luò)資源整合之后的基礎(chǔ)管理平臺之一,它同時還聯(lián)結(jié)著相關(guān)方面的經(jīng)濟(jì)增長點(diǎn)、相關(guān)產(chǎn)業(yè)鏈的發(fā)生,這些都可能從博客發(fā)展未來中獲得收益。博客的經(jīng)濟(jì)增長點(diǎn)就是拉動了整個服務(wù)業(yè)產(chǎn)業(yè)化,網(wǎng)絡(luò)經(jīng)濟(jì)化服務(wù)的個性化。河北師范大學(xué)匯華學(xué)院本科生畢業(yè)論文(設(shè)計)翻譯文章.net framework的含義.net framework(現(xiàn)在是版本4)是microsoft為開發(fā)應(yīng)用程序而創(chuàng)建的一個具有革命意義的平臺。
15、這句話最有趣的地方在于它的廣義性,但這是有原因的。首先,注意這句話沒有說“在windows操作系統(tǒng)上開發(fā)應(yīng)用程序”。盡管.net framework 的microsoft版本運(yùn)行在windows操作系統(tǒng)上,但以后將推出運(yùn)行在其他操作系統(tǒng)上的版本,例如mono,它是.net framework 的開源版本(包含c#編譯器),該版本可以運(yùn)行在幾個操作系統(tǒng)上,包括各種linux版本和mac os。另外,還可以在個人數(shù)字助手(pda)類設(shè)備和一些智能電話上使用microsoft .net compact framework(基本上是完整.net framework的一個子集)。使用.net frame
16、work的一個重要原因是它可以作為集成各種操作系統(tǒng)的方式。另外,上面給出的.net framework定義并未限制應(yīng)用程序的類型。這是因為本來就沒有限制。可以使用.net framework創(chuàng)建windows應(yīng)用程序、web應(yīng)用程序、web服務(wù)和其他各種類型的應(yīng)用程序。另外注意,對于web應(yīng)用程序,按照定義,它們是多平臺的應(yīng)用程序,因為任何帶web瀏覽器的系統(tǒng)都可以訪問它們。最近新增了silverlight,這種類別還包含運(yùn)行在客戶瀏覽器內(nèi)部的應(yīng)用程序,以及僅以html格式顯示web內(nèi)容的應(yīng)用程序。.net framework 的設(shè)計方式確保它可以用于各種語言,包括本書介紹的c#語言,以及c+
17、、visual basic、jscript,甚至一些舊的語言,如cobol。為此,還推出了這些語言的.net版本,目前還在不斷推出更多版本。所有這些語言都可以訪問.net framework,它們彼此之間還可以通信。c#開發(fā)人員可以使用visual basic程序員編寫的代碼,反之亦然。所有這些提供了意想不到的多樣性,這也是.net framework具有誘人前景的部分原因。1.1 .net framework的內(nèi)容.net framework主要包含一個非常大的代碼庫,可以在客戶語言(如c#)中通過面向?qū)ο缶幊碳夹g(shù)(oop)來使用這些代碼。這個庫分為多個不同的模塊,這樣就可以根據(jù)希望得到的結(jié)
18、果來選擇使用其中的各個部分。例如,一個模塊包含windows應(yīng)用程序的構(gòu)件,另一個模塊包含網(wǎng)絡(luò)編程的代碼塊,還有一個模塊包含web開發(fā)的代碼塊。一些模塊還分為更具體的子模塊,例如,在web開發(fā)模塊中,有用于建立web服務(wù)的子模塊。其目的是,不同操作系統(tǒng)可以根據(jù)自己的特性,支持其中的部分或全部模塊。例如,pda支持所有的核心.net功能,但不需要某些更高級的模塊。部分.net framework庫定義了一些基本類型。類型是數(shù)據(jù)的一種表達(dá)方式,指定其中最基礎(chǔ)的部分(如32位帶符號的整數(shù)),以便使用.net framework在各種語言之間進(jìn)行交互操作。這稱為通用類型系統(tǒng)(common type s
19、ystem,cts)。除了提供這個庫以外,.net framework 還包含.net 公共語言運(yùn)行庫(common language runtime,clr),它負(fù)責(zé)管理用.net庫開發(fā)的所有應(yīng)用程序的執(zhí)行。1.2 使用.net framework編寫應(yīng)用程序使用.net framework編寫應(yīng)用程序,就是使用.net代碼庫編寫代碼(使用支持framework的任何一種語言)。本書用vs和vce進(jìn)行開發(fā),vs是一種強(qiáng)大的集成開發(fā)環(huán)境,支持c#(以及托管和非托管c+、visual basic和其他一些語言)。vce是vs的一個刪節(jié)版本(免費(fèi)),僅支持c#。這些環(huán)境的優(yōu)點(diǎn)是便于把.net 功能
20、集成到代碼中。我們創(chuàng)建的代碼完全是c#代碼,但使用了.net framework,并在需要時利用了vs和vce中的其他工具。為了執(zhí)行c#代碼,必須把它們轉(zhuǎn)換為目標(biāo)操作系統(tǒng)能夠理解的語言,即本機(jī)代碼(native code)。這種轉(zhuǎn)換稱為編譯代碼,由編譯器執(zhí)行。但在.net framework下,此過程包括兩個階段。1. cil和jit 在編譯使用.net framework庫的代碼時,不是立即創(chuàng)建專用于操作系統(tǒng)的本機(jī)代碼,而是把代碼編譯為通用中間語言(common intermediate language,cil)代碼,這些代碼并非專門用于任何一種操作系統(tǒng),也非專門用于c#。其他.net語言
21、,如visual basic .net也可以在第一階段編譯為這種語言,開發(fā)c#應(yīng)用程序時,這個編譯步驟由vs或vce完成。顯然,要執(zhí)行應(yīng)用程序,必須完成更多工作,這是just-in-time(jit)編譯器的任務(wù),它把cil編譯為專用于os和目標(biāo)機(jī)器結(jié)構(gòu)的本機(jī)代碼。這樣os才能執(zhí)行應(yīng)用程序。這里編譯器的名稱just-in-time反映了cil代碼僅在需要時才編譯的事實。過去,常常需要把代碼編譯為幾個應(yīng)用程序,每個應(yīng)用程序都用于特定的操作系統(tǒng)和cpu結(jié)構(gòu)。這通常是一種優(yōu)化形式(例如,為了讓代碼在amd芯片組上運(yùn)行得更快),而且有時是非常重要的(例如,對于工作在win9x和winnt/2000環(huán)境
22、下的應(yīng)用程序)。現(xiàn)在就不必要了,因為顧名思義,jit編譯器使用cil代碼,而cil代碼是獨(dú)立于計算機(jī)、操作系統(tǒng)和cpu的。目前有幾種jit編譯器,每種編譯器都用于不同的結(jié)構(gòu),我們總能找到一個合適的編譯器創(chuàng)建所需的本機(jī)代碼。這樣,用戶需要做的工作就比較少了。實際上,可以忽略與系統(tǒng)相關(guān)的細(xì)節(jié),把注意力集中在代碼的功能上就夠了。2. 程序集在編譯應(yīng)用程序時,所創(chuàng)建的cil代碼存儲在一個程序集中。程序集包括可執(zhí)行的應(yīng)用程序文件(這些文件可以直接在windows上運(yùn)行,不需要其他程序,其擴(kuò)展名是.exe)和其他應(yīng)用程序使用的庫(其擴(kuò)展名是.dll)。除了包含cil外,程序集還包含元信息(即程序集中包含的
23、數(shù)據(jù)的信息,也稱為元數(shù)據(jù))和可選的資源(cil 使用的其他數(shù)據(jù),例如,聲音文件和圖片)。元信息允許程序集是完全自描述的。不需要其他信息就可以使用程序集,也就是說,我們不會遇到下述情形:不能把需要的數(shù)據(jù)添加到系統(tǒng)注冊表中,而這種情形在使用其他平臺進(jìn)行開發(fā)時常常出現(xiàn)。因此,部署應(yīng)用程序就非常簡單了,只需把文件復(fù)制到遠(yuǎn)程計算機(jī)上的目錄下即可。因為不需要目標(biāo)系統(tǒng)上的其他信息,所以只需從該目錄中運(yùn)行可執(zhí)行文件即可(假定安裝了.net clr)。當(dāng)然,不必把運(yùn)行應(yīng)用程序需要的所有信息都安裝到一個地方。可以編寫一些代碼來執(zhí)行多個應(yīng)用程序所要求的任務(wù)。此時,通常把這些可重用的代碼放在所有應(yīng)用程序都可以訪問的地
24、方。在.net framework中,這個地方是全局程序集緩存(global assembly cache,gac),把代碼放在這個緩存中是很簡單的,只需把包含代碼的程序集放在包含該緩存的目錄中即可。3. 托管代碼在將代碼編譯為cil,再用jit編譯器將它編譯為本機(jī)代碼后,clr的任務(wù)還沒有全部完成,還需要管理正在執(zhí)行的用.net framework 編寫的代碼(這個執(zhí)行代碼的階段通常稱為運(yùn)行時(runtime)。即clr管理著應(yīng)用程序,其方式是管理內(nèi)存、處理安全性以及允許進(jìn)行跨語言調(diào)試等。相反,不受clr控制運(yùn)行的應(yīng)用程序?qū)儆诜峭泄茴愋停承┱Z言如c+可以用于編寫這類應(yīng)用程序,例如,訪問操作
25、系統(tǒng)的低級功能。但是在c#中,只能編寫在托管環(huán)境下運(yùn)行的代碼。我們將使用clr的托管功能,讓.net自己與操作系統(tǒng)進(jìn)行交互。4. 垃圾回收托管代碼最重要的一個功能是垃圾回收(garbage collection)。這種.net方法可確保應(yīng)用程序不再使用某些內(nèi)存時,就會完全釋放這些內(nèi)存。在.net推出以前,這項工作主要由程序員負(fù)責(zé),代碼中的幾個簡單錯誤會把大塊內(nèi)存分配到錯誤的地方,使這些內(nèi)存神秘失蹤。這通常意味著計算機(jī)的速度逐漸減慢,最終導(dǎo)致系統(tǒng)崩潰。.net垃圾回收會定期檢查計算機(jī)內(nèi)存,從中刪除不再需要的內(nèi)容。它不設(shè)置時間幀,可能一秒鐘內(nèi)會進(jìn)行上千次的檢查,也可能幾秒鐘才檢查一次,或者隨時進(jìn)行
26、檢查,但一定會進(jìn)行檢查。這里要給程序員一些提示。因為在不可預(yù)知的時間執(zhí)行這項工作,所以在設(shè)計應(yīng)用程序時,必須留意這一點(diǎn)。需要許多內(nèi)存才能運(yùn)行的代碼應(yīng)自己執(zhí)行這樣的檢查,而不是坐等垃圾回收,但這不像聽起來那樣難。英文原文what is the .net framework?the .net framework (now at version 4) is a revolutionary platform created by microsoftfor developing applications. the most interesting thing about this statement i
27、s how vague it is but there are good reasons for this. for a start, note that it doesnt develop applications on the windows operating system. although the microsoft release of the .net framework runs on the windows operating system, it is possible to find alternative versions that will work on other
28、systems. one example of this is mono, an open-source version of the .net framework (including a c# compiler) that runs on several operating systems, including various flavors of linux and mac os. in addition, you can use the microsoft .net compactframework (essentially a subset of the full .net fram
29、ework) on personal digital assistant (pda) class devices and even some smartphones. one of the key motivations behind the .net framework is its intended use as a means of integrating disparate operating systems. in addition, the preceding definition of the .net framework includes no restriction on t
30、he type of applications that are possible. thats because there is no restriction the .net framework enables the creation of windows applications, web applications, web services, and pretty much anything else you can think of. also, with web applications its worth noting that these are, by definition
31、, multiplatform applications, since any system with a web browser can access them. with the recent addition of silverlight, this category also includes applications that run inside browsers on the client, as well as applications that merely render web content in the form of html.the .net framework h
32、as been designed so that it can be used from any language, including c# (the subject of this book) as well as c+, visual basic, jscript, and even older languages such as cobol. for this to work, .net-specific versions of these languages have also appeared, and more are being released all the time. n
33、ot only do all of these haveaccess to the .net framework, but they can also communicate with each other. it is perfectly possible for c# developers to make use of code written by visual basic programmers, and vice versa. all of this provides an extremely high level of versatility and is part of what
34、 makes using the .net framework such an attractive prospect.whats in the .net framework?the .net framework consists primarily of a gigantic library of code that you use from your client languages (such as c#) using object-oriented programming (oop) techniques. this library is categorized into differ
35、ent modules you use portions of it depending on the results you want to achieve. for example, one module contains the building blocks for windows applications, another for network programming, and another for web development. some modules are divided into more specific submodules, such as a module f
36、or building web services within the module for web development.the intention is for different operating systems to support some or all of these modules, depending on their characteristics. a pda, for example, would include support for all the core .net functionality but is unlikely to require some o
37、f the more esoteric modules. part of the .net framework library defines some basictypes. a type is a representation of data, and specifying some of the most fundamental of these (such as a 32-bit signed integer) facilitates interoperability between languages using the .net framework. this is called
38、thecommon type system (cts).as well as supplying this library, the .net framework also includes the .netcommon language runtime (clr), which is responsible for maintaining the execution of all applications developed using the .net library.writing applications using the .net frameworkwriting an appli
39、cation using the .net framework means writing code (using any of the languages that support the framework) using the .net code library. in this book you use vs and vce for your development. vs is a powerful, integrated development environment that supports c# (as well as managed and unmanaged c+, vi
40、sual basic, and some others). vce is a slimmed down (and free) version of vs that supports c# only. the advantage of these environments is the ease with which .net features can be integrated into your code. the code that you create will be entirely c# but use the .net framework throughout, and youll
41、 make use of the additional tools in vs and vce where necessary.in order for c# code to execute, it must be converted into a language that the target operating system understands, known asnative code. this conversion is calledcompilingcode, an act that is performed by acompiler. under the .net frame
42、work, this is a two-stage process.cil and jitwhen you compile code that uses the .net framework library, you dont immediately create operating-system-specific native code. instead, you compile your code intocommon intermediate language (cil)code. this code isnt specific to any operating system (os)
43、and isnt specific to c#. other .net languages visual basic .net, for example also compile to this language as a first stage. this compilation step is carried out by vs or vce when you develop c# applications.obviously, more work is necessary to execute an application. that is the job of ajust-in-tim
44、e (jit) compiler, which compiles cil into native code that is specific to the os and machine architecture being targeted. only at this point can the os execute the application. thejust-in-timepart of the name reflects the fact that cil code is compiled only when it is needed. in the past, it was oft
45、en necessary to compile your code into several applications, each of which targeted a specific operating system and cpu architecture. typically, this was a form of optimization (to get code to run faster on an amd chipset, for example), but at times it was critical (for applications to work in both
46、win9xand winnt/2000 environments, for example). this is now unnecessary, because jit compilers (as their name suggests) use cil code, which is independent of the machine, operating system, and cpu. several jit compilers exist, each targeting a different architecture, and the appropriate one is used
47、to create the native code required.the beauty of all this is that it requires a lot less work on your part in fact, you can forget about system-dependent details and concentrate on the more interesting functionality of your code.assemblieswhen you compile an application, the cil code created is stor
48、ed in anassembly. assemblies include both executable application files that you can run directly from windows without the need for any other programs (these have a.exefile extension) and libraries (which have a.dllextension) for use by other applications.in addition to containing cil, assemblies als
49、o includemetainformation (that is, information about the information contained in the assembly, also known as metadata) and optionalresources(additional data used by the cil, such as sound files and pictures). the meta information enables assemblies to be fully self-descriptive. you need no other in
50、formation to use an assembly, meaning you avoid situations such as failing to add required data to the system registry and so on, which was often a problem when developing with other platforms.this means that deploying applications is often as simple as copying the files into a directory on a remote
51、 computer. because no additional information is required on the target systems, you can just run an executable file from this directory and (assuming the .net clr is installed) youre good to go.of course, you wont necessarily want to include everything required to run an application in one place. yo
52、u might write some code that performs tasks required by multiple applications. in situations like that, it is often useful to place the reusable code in a place accessible to all applications. in the .net framework, this is the global assembly cache (gac). placing code in the gac is simple you just
53、place the assembly containing the code in the directory containing this cache.managed codethe role of the clr doesnt end after you have compiled your code to cil and a jit compiler has compiled that to native code. code written using the .net framework ismanagedwhen it is executed (a stage usually r
54、eferred to asruntime). this means that the clr looks after your applications by managing memory, handling security, allowing cross-language debugging, and so on. by contrast, applications that do not run under the control of the clr are said to beunmanaged,and certain languages such as c+ can be use
55、d to write such applications, which, for example, access low-level functions of the operating system. however, in c# you can write only code that runs in a managed environment. you will make use of the managed features of the clr and allow .net itself to handle any interaction with the operating sys
56、tem.garbage collectionone of the most important features of managed code is the concept ofgarbage collection. this is the .net method of making sure that the memory used by an application is freed up completely when the application is no longer in use. prior to .net this was mostly the responsibility of programmers, and a few simple errors in code could result in large blocks of memory mysteriously disappearing as a result of being allocated to the wrong place in memory. that usually meant a progressive slowdown of your computer fo
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 工業(yè)自動化設(shè)備維護(hù)與管理
- 工業(yè)自動化與智能制造成長關(guān)系研究
- 工作中的自我管理與領(lǐng)導(dǎo)力培養(yǎng)
- 工業(yè)設(shè)計在產(chǎn)品創(chuàng)新中的作用與價值
- 工業(yè)風(fēng)與極簡風(fēng)辦公室對比分析
- 工作效率提升與團(tuán)隊協(xié)作技巧
- 工業(yè)領(lǐng)域智慧能源管理案例
- 工作效率工具使用經(jīng)驗分享
- 工廠企業(yè)消防安全檢查標(biāo)準(zhǔn)
- 工廠生產(chǎn)線的日常巡檢要點(diǎn)與技巧
- 2024年黃岡團(tuán)風(fēng)縣招聘城區(qū)社區(qū)工作者真題
- 2025圖解《政務(wù)數(shù)據(jù)共享條例》V1.0學(xué)習(xí)解讀
- 2025電商平臺店鋪轉(zhuǎn)讓合同模板
- 2025年人教版(2024)初中英語七年級下冊期末考試測試卷及答案
- (2025)事業(yè)編考試題庫(附含答案)
- 女性美學(xué)課堂企業(yè)制定與實施新質(zhì)生產(chǎn)力項目商業(yè)計劃書
- 部編版2024-2025學(xué)年四年級下冊語文期末測試卷(含答案)
- 2025年醫(yī)保政策考試題庫及答案:基礎(chǔ)解讀與醫(yī)保政策法規(guī)試題試卷
- 2025至2030年中國液化設(shè)備行業(yè)投資前景及策略咨詢研究報告
- 礦產(chǎn)資源儲量報告編制和評審中常見問題及其處理意見
- (精華版)國家開放大學(xué)電大本科《小學(xué)數(shù)學(xué)教學(xué)研究》單項選擇題題庫及答案.doc
評論
0/150
提交評論