ASP中Server.Execute與Execute的用法
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
首先說明一下,server.execute()和execute是不同的,前者是asp內(nèi)置對(duì)象,后者是vb語句。
[p]1.執(zhí)行過程[br]dim strsubname[br]strsubname="print"[br]execute strsubname[br]sub print()[br] response.write now[br]end sub[/p] [p]2.執(zhí)行帶參數(shù)的過程[br]dim strsubname[br]strsubname="print("""&now&""")"[br]execute strsubname[br]sub print(str)[br] response.write str[br]end sub[/p] [p]3.動(dòng)態(tài)包含文件[br]server.execute("xxx.asp")[/p] [p][br]server.execute和include相異之處:[/p] [p]execute method 是個(gè)呼叫一個(gè).asp 程序并執(zhí)行它,比較類似一般程式語言的 procedure call;而 #include 則僅將所包含的程序插入原程序當(dāng)中。 [/p] [p] [/p] [p]server.execute表示將頁面運(yùn)行過后的html代碼插入當(dāng)前位置:[/p] [p]include表示將頁面的源代碼加入當(dāng)前位置再做為一個(gè)整體運(yùn)行 [/p] [p]比方說你定義一個(gè)變量dim a [br]用server.execute后這個(gè)定義是無效的 [br]include的話,這個(gè)定義有效[/p] 該文章在 2010/6/7 23:43:27 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |