untitled

Similar documents
untitled

untitled

個人教室 / 網路硬碟

untitled

untitled

1

untitled

九十三年第三期檔案管理工作研習營學員建議事項答覆情形彙整表

untitled

untitled

了 立 連 立 量 領 來 例 蘭 便 不 數 不 論 更 更 更 力 更 參 例 來 例 見 量 度 量 量 參 論 量 行 量 量 瑩 理 來 錄 量 量 不 力 省 力 立 力 量 量 量 了 量 便 錄 錄 錄 料 說 省 6

untitled

untitled

untitled

untitled

臺灣地區的警察教育現況與展望

地方公共服務績效比較評量之探討—標竿學習策略的觀點

untitled

龍華科技大學

untitled

untitled

第五章 實例個案

血管內裝置感染管制作業規範

untitled

4-04 論文封面(樣式)

untitled

untitled

untitled

人身保險業務員資格測驗方案

untitled

台灣經濟新報資料庫

untitled

untitled

I/O Files讀寫檔案:

中華人民共和國殘疾人保障法(2008年修訂)

untitled

十四、特殊需求的嬰兒

untitled

台南縣全民學區數位學習課程進階班—PhotoImpact 10

untitled

untitled

untitled

untitled

untitled

untitled

untitled

untitled

1-2岁宝宝的游戏和活动指南

嘉義市都市計畫保護區農業區土地使用審查要點(草案)

untitled

untitled

untitled

第五章 鄉鎮圖書館閱讀推廣活動之分析

untitled

移民資料

untitled

untitled

大陸黨報集團化發展之研究

Slide 1

untitled

untitled

國立中山大學學位論文典藏.PDF

untitled

電腦組裝訓練

1209 th New Territories East Group Scout Troop 讀 練 理論 參 立臨 立 療 行 理 量 理 料 留 度 練 理 理 理 冷 練 理 力 理 不 不

富春國小主題統整課程計畫表 每年級(教學群)至少三個主題

untitled

PowerPoint 簡報

untitled

專 題 論 述

untitled

行政院國科會九十一年度專題研究

untitled

untitled

untitled

吃寒天真的能減肥嗎

中華民國第45屆中小學科學展覽會

untitled

untitled

依據教育部八十九年 月 日臺(八九)技(二)字第 號函

隱形眼鏡的世界

第一章 概要

untitled

四湖鄉志纂修

untitled

untitled

untitled

untitled

untitled

untitled

微處理機實習期末專題

國立故宮博物院九十三年提升服務品質績效報告

untitled

untitled

untitled

untitled

untitled

勞工安全衛生組織管理及自動檢查辦法修正條文對照表(草案)

施政計畫管理資訊系統

untitled

Transcription:

1

.NET

sln csproj dll cs aspx 說 料 料 利 來 料 ( 來 )

利 [] [] 來 說 切 切 理

[] [ ] 來 說 拉 類 類

[] [ ] 列 連

Web 行流 來 了 不 不 不 流 立 行

Page 類 Load 理 Click 滑

料 Response 列 料 Response HttpResponse 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx");

(1)

(2) Web Form

aspx

例 sample1-a1 (1) WebForm2.aspx WebForm2.aspx 列 WebForm1.aspx private void Page_Load(object sender, System.EventArgs e) { Response.Redirect("WebForm2.aspx"); }

例 sample1-a1 (2) WebForm2.aspx private void Page_Load(object sender, System.EventArgs e) { Response.Write("!! 臨!!"); }

練 sample1-b1 列 " " 行列 " XXX" 念 HTML 行 <br> 列 行

錄 (1) Web (C:\Inetpub\wwwroot) 料 錄 錄 [ ] [ 理 ] [Internet Information Services]

錄 (2) Internet Information Services 料 [ ] 錄

錄 (3) [ ] 立 錄

錄 (4) 錄 錄 URL http://localhost/aspnet/

錄 (5) 錄

錄 (6)

錄 (7) 錄

立 錄 (1) 錄 錄 錄 錄 列

立 錄 (2) IIS 錄 料 []

立 錄 (3) [ 立 ] 錄 立

行 例 (1) 行 例 更 例 (.sln) (.csproj.webinfo) 錄 例 行 例 sample5-b6 D:\ 行 URL http://localhost/sample/

行 例 (2) 立 錄 sample

行 例 (3) 立 錄 錄 D:\sample5-b6

行 例 (3) 錄 錄 sample

行 例 (4) (.csproj.webinfo) Web URLPath 路

行 例 (5) (.sln) 若 例 立 不

行 例 (6) 行 例 利 例 行 行 若 不 更 例 URL IIS 立 例 URL 錄

練 ch1a 例 錄 ch1a 例 念 錄 (.sln) (.csproj.webinfo)

Response BufferOutput 料 Cache Cookies cookie Write 料 Redirect URL Clear 料 Flush 料

例 sample1-a2 (1) private void Hello() { Response.Write("!!<br>"); Response.Flush(); Response.Write(" Ives!!<br>"); Response.Clear(); }

例 sample1-a2 (2) private void Page_Load(object sender, System.EventArgs e) { Response.Write(" <br>"); Hello(); } Response.Write("<br> <br>"); Response.BufferOutput = false; Hello();

Label Label 來 Text ForeColor Visible

Button Button Text Visible Click

MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/

例 sample1-a3 列 private void submitbtn_click(object sender, system.eventargs e) { string[] fatestr = new string[5] {""," "," "," ",""}; Random rnd = new Random(); fatelb.text = fatestr[rnd.next(0,5)]; }

TextBox TextBox 料 Text ReadOnly MaxLength 度 TextMode SingleLine 行 MultiLine 行 Password TextChanged 更

練 sample1-b2 易 留 料 念 立 利 料 利 Response.Redirect 料

料 理 不 錄 料 行 錄 料 URL 參數 Cookie Session

Request Request HttpRequest 類 Cookies cookie Form 行 post 料 QueryString get 料 QueryString 錄 料 Response.Redirect("abc.aspx?name=ives") 料 Request.QueryString["name"]

例 sample1-a4 (1) WebForm1.aspx private void rightbtn_click(object sender, System.EventArgs e) { Response.Redirect("WebForm2.aspx?ans=yes"); } private void wrongbtn_click(object sender, System.EventArgs e) { Response.Redirect("WebForm2.aspx?ans=no"); }

例 sample1-a4 (2) WebForm2.aspx private void Page_Load(object sender, System.EventArgs e) { if(request.querystring["ans"]=="yes") Response.Write("!! 了!!"); else Response.Write("!! 了!!"); }

練 sample1-b3 易 列 念 利 Request.QueryString 來

Page 類 IsPostBack 料 Session session Load 理 IsPostBack if(!ispostback) {... }

Cookie 念 Cookie Cookie

Cookie 利 Request 來 來 Cookie Response 來 Cookie 讀 Cookie Request.Cookies[ "Cookie " ].Value Cookie Cookie Response.Cookies[ "Cookie " ].Value Cookie Response.Cookies ["Cookie " ].Expires Cookie DateTime.MaxValue; DateTime.Now.AddMonths(2); ( Cookie DateTime.Now)

例 sample1-a5 (1) 錄 數 private void Page_Load(object sender, System.EventArgs e) { if(request.cookies["count"]==null) { Response.Cookies["count"].Value = "0"; }

例 sample1-a5 (2) } else { Response.Cookies["count"].Value = (int.parse(request.cookies["count"].value)+1).tostring(); } Response.Cookies["count"].Expires = DateTime.MaxValue; Response.Write(" 臨!! "); Response.Write(Response.Cookies["count"].Value); Response.Write(" 參!!");

練 sample1-b4 易 錄 欄 念 利 Cookie 來 錄 Cookie 利 IsPostBack

Session 念 連 Session ID 料 料 Server Request 都 Session ID Server ID 來索 Session

Session Session.SessionID 來識 Session ID Session.Timeout Session () Session.Clear() Session Session.Add(string name, object value) Session

Session 立 Session.Add(string name, object value) Session.Add("name", "Alice"); Session["name"] = "Alice"; Session[string name] Label1.Text = Session["name"].ToString();

例 sample1-a6 (1) 列 WebForm1.aspx private void loginbtn_click(object sender, System.EventArgs e) { if((idtb.text == "alice" && pwtb.text == "alice") (idtb.text == "bob" && pwtb.text == "bob")) { Session.Add("id",idTB.Text); Response.Redirect("WebForm2.aspx"); } }

例 sample1-a6 (2) WebForm2.aspx private void Page_Load(object sender, System.EventArgs e) { Response.Write(Session["id"].ToString()); Response.Write(" 臨!!"); }

列 列 WebForm2.aspx 不 若 離 Session

練 sample1-b5 列 念 Session 不 Session 料

(1) 了!? Session 利

(2) Response.Cache.SetNoStore(); 不 Page_Load

練 sample1-b6 sample1-b5 " " 念 利 Response.Cache.SetNoStore();

Application Application HttpApplicationState 類 來 數 Cookie Session Application Application 狀 料 Applicaion 狀 料 Application.Lock(); 料 Application[ "" ]; Application.UnLock();

例 sample1-a7 (1) 數 private void Page_Load(object sender, System.EventArgs e) { count1lb.text = initialstate("item1"); count2lb.text = initialstate("item2"); }

例 sample1-a7 (2) private string initialstate(string itemname) { if(application[itemname] == null) { Application.Lock(); Application[itemName] = 0; Application.UnLock(); } return Application[itemName].ToString(); }

例 sample1-a7 (3) private void order1btn_click(object sender, System.EventArgs e) { count1lb.text = updatestate("item1"); } private void order2btn_click(object sender, System.EventArgs e) { count2lb.text = updatestate("item2"); }

例 sample1-a7 (4) private string updatestate(string itemname) { Application.Lock(); Application[itemName] = int.parse(application[itemname].tostring()) + 1; Application.UnLock(); } return Application[itemName].ToString();

練 sample1-b7 錄 參 數 念 利 Application 來 數