文章内页类
文章内页类
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:

复制代码 代码如下:

<%

classMyArticle

dimwenzhang_id

dimtitle1,content1

PrivateSubClass_Initialize()

'response.Write"类的初始化事件:Class_Initialize<br>"

endsub

PrivateSubClass_Terminate()

'response.Write"释放对象事件:Class_Terminate<br>"

endsub

PublicPropertyLetid(byvalv)

wenzhang_id=v

EndProperty

PublicSubconn_sub()

Setconn=Server.createObject("ADODB.Connection")

cnnstr="DRIVER={MicrosoftAccessDriver(*.mdb)};"

cnnstr=cnnstr&"DBQ="&Server.MapPath("admin/WataVase/%29to-dream.mdb")

conn.Opencnnstr

sql="Select*FromArticlewhereDeleted=0andArticleID="&wenzhang_id

setrs=Server.CreateObject("adodb.recordset")

rs.opensql,conn,1,1

title1=rs("Title")

content1=rs("Content")

rs.close

setrs=nothing

conn.close

setconn=nothing

endsub

PublicPropertyGettitle()

title=title1

EndProperty

PublicPropertyGetcontent()

content=content1

EndProperty

endclass

'MyArticle类使用说明

'dimwenzhang

'setwenzhang=newMyArticle

'wenzhang.id=3

'callwenzhang.conn_sub()

'response.writewenzhang.title

'response.writewenzhang.content

'setwenzhang=nothing

%>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新ASP教程学习
热门ASP教程学习
编程开发子分类