asp中with End with
來源:易賢網(wǎng) 閱讀:2432 次 日期:2014-08-26 09:41:20
溫馨提示:易賢網(wǎng)小編為您整理了“asp中with End with”,方便廣大網(wǎng)友查閱!

在看高手寫的asp代碼中看到asp代碼用with來表示對象,其asp結(jié)構(gòu)形式 with ...End with.

代碼如下:

<%

sql = "select * from table"

set rs = server.createObject("adodb.recordset")

with rs

.open sql,foraspcn,1,1

if .eof or .bof then

response.write "沒有asp關(guān)于with end with 內(nèi)容"

.close

else

response.write "有相關(guān)asp中with end with的內(nèi)容"

.close

end if

end with

%>

上面是關(guān)于with 的一個例子.查詢微軟官方網(wǎng)站制作學(xué)習(xí)網(wǎng)

with ..end with 執(zhí)行重復(fù)引用單個對象或結(jié)構(gòu)的一系列語句。

參考地址:http://msdn.microsoft.com/zh-cn/library/wc500chb(VS.80).aspx

其實也很好理解with ..end with的意思

就是在下面的語句中省略了with 后參數(shù).可以直接調(diào)用其.方法的形式

再次舉例

<%

Class forasp'定義一個類

Public webname

Public weburl

End class

Set foraspcn = new forasp'設(shè)置foraspcn為一個對象

with foraspcn

.webname= "這里是網(wǎng)站制作學(xué)習(xí)網(wǎng)"

.weburl = "http://20hl.cn/"

end with

response.write foraspcn.weburl

%>

更多信息請查看IT技術(shù)專欄

更多信息請查看網(wǎng)絡(luò)編程
上一篇:asp輸出xml
易賢網(wǎng)手機網(wǎng)站地址:asp中with End with

2026國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)