ASP. 資策會教育訓練處 楊宏文 hwyang@iii.org.tw. 何謂 ASP. 全名 Active Server Pages 。 利用 Script 語法,學習無障礙。 可利用 Inter Dev 自動產生程式碼。 語法的大小寫皆可 。 任何瀏覽器均支援。 任何資料庫均支援。. ASP 的使用環境. W indows 9x : PWS 4.0 Windows NT Workstation : PWS 4.0 Windows NT Server : IIS 4.0
An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.Content is provided to you AS IS for your information and personal use only.Download presentation by click this link.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.During download, if you can't get a presentation, the file might be deleted by the publisher.
何謂ASP • 全名Active Server Pages。 • 利用Script 語法,學習無障礙。 • 可利用 Inter Dev 自動產生程式碼。 • 語法的大小寫皆可。 • 任何瀏覽器均支援。 • 任何資料庫均支援。
ASP的使用環境 Windows 9x :PWS 4.0 Windows NT Workstation:PWS 4.0 Windows NT Server:IIS 4.0 Windows 2000 Server/Professional:IIS 5.0 Windows XP Professional:IIS 5.1 Windows 2003:IIS 6.0
軟體來源 – Personal Web Server Windows 9x :PWS 4.0 1.原版光碟中add-ons\pws目錄或NT4.0 Option Pack 中 Win.95目錄。 2.執行 setup.exe 進行安裝。 Windows NT Workstation 4.0:PWS 4.0 1.NT4.0 Option Pack 中 Winnt.wks目錄。 2.執行 setup.exe 進行安裝。
軟體來源 – Internet Information Server Windows NT Server 4.0:IIS 4.0 1.Option Pack 中 Winnt.srv目錄。 2.執行 setup.exe 進行安裝。 Windows 2000 Server/Professional:IIS 5.0 內建即包含 IIS 5.0 Windows XP Professional:IIS 5.1 (內建) Windows 2003:IIS 6.0(內建)
安裝注意事項 – PWS/IIS on NT 4.0 1.升級 NT 到 Service Pack 3 以上版本。 Service Pack 3,檔名為Nt4sp3_i.exe。 Service Pack 4,檔名為sp4i386.exe。 Service Pack 5,檔名為sp5i386.exe。 Service Pack 6,檔名為sp6i386.exe。 2.升級 IE 到 4.01 以上版本。
作業平台安裝步驟 • Win95:IE5.0 Winsock 2.0 PWS 4.0。 • Win98:PWS 4.0。 • Win NT W/S:SP3 IE 5.0 PWS 4.0。 • Win NT Server:SP3 IE 5.0 IIS 4.0。 • Windows 2000:IIS 5.0 • Windows XP:IIS 5.1 • Windows 2003:IIS 6.0
作業平台運作之檢查 -PWS 1.啟動 PWS: 開始 程式集 Internet Explorer Personal Web Server 個人 Web 管理員 2.打開瀏覽器,於網址列輸入IP位址,檢查 是否安裝妥當。
作業平台運作之檢查 -IIS 1.啟動 IIS: 開始 程式集 系統管理工具 Internet Information Server Internet 服務管理員 或 開始 執行 輸入inetmgr 2.打開瀏覽器,利用IP檢查是否安裝妥當。
下載 HTML文件, 由客戶端瀏覽器執行 *.htm *.htm Web Server vs. Browser Web Server Client 端
下載 HTML文件, 由客戶端瀏覽器執行 *.asp *.htm Web Server vs. Browser Web Server 執行 asp 檔案,將結果轉成 HTML 格式 Web Server Client 端
<錯誤> <正確> 撰寫ASP之前… • 所有 ASP 的檔案副檔名應為 asp。 • ASP的程式碼應該存放在 <%…………%> • 標籤之內。 • ASP 檔案的執行,應該透過 asp-enable • 的 web 伺服器編譯,方能執行。
讀出 Cookies 的方式 利用Request.Cookies指明欲讀取的關鍵 字值。 Request.Cookies("關鍵字")
Cookies 範例一 <% Response.Cookies("name")= " hubert" Response.Cookies("name").Expires=Date+365 %> 執行結果:
Cookies 範例二 – Cookies.asp <% '將資訊寫入 Cookies 當中 Response.Cookies("name")="楊宏文" Response.Cookies("name").Expires=Date+365 '從 Cookies 當中將資訊拿出來 UserName=Request.Cookies("name") %> <h1><%=userName%></h1>
使用 Cookies 的注意事項 Response.Cookies 的程式碼必須位於整 份 html 文件的最前面,否則會有如下 的錯誤。
Cookies 範例三 – getCookies.asp <% if Request("Name")<>"" then Response.Cookies("name")=Request("Name") Response.Cookies("name").Expires=Date+365 end if response.write request.Cookies("name") %> <form> <input type=text name=Name> <input type=submit> </form>