当前位置: 移动技术网 > IT编程>开发语言>.net > 手把手教你使用VB来创建ASP组件(7)

手把手教你使用VB来创建ASP组件(7)

2019年01月22日  | 移动技术网IT编程  | 我要评论

f22战斗机中文版,另类人妖,杨鲁豫的第一任妻子

(2)deletecdinformation.程序

  点击每条信息后的删除键就会从表中把该条信息删除,它也调用了我们刚刚注册的。限于篇幅,我只把最重要的几行代码写出:

〈%

dim cd_info

set cd_info =server.createobject(“cd.cd_handle”)

cd_info.delete request.querystring(“id”)

%〉

(3)addcdinformation.html

  本程序是一个纯html文本,只出现一个表单,让你填写新的cd信息,然后再发给insertintodb.asp来加入。

〈html〉

〈head〉

〈meta http-equiv="content-language" content="zh-cn"〉

〈meta http-equiv="content-type" content="text/html; charset=gb2312"〉

〈title〉请您添加一条cd信息〈/title〉

〈/head〉

〈body〉

〈form method="post" action="insertintodb.asp"〉

〈p〉 〈/p〉

〈p〉  请您添加一条cd信息〈/p〉

〈table border="1" cellspacing="1" width="34%" height="109"〉

〈tr〉

〈td width="24%" height="16"〉

〈p align="center"〉cd号〈/td〉

〈td width="76%" height="16"〉〈input type="text" name="id" size="24"〉〈/td〉

〈/tr〉

〈tr〉

〈td width="24%" height="16"〉

〈p align="center"〉cd名〈/td〉

〈td width="76%" height="16"〉〈input type="text" name="name" size="24"〉〈/td〉

〈/tr〉

〈tr〉

〈td width="24%" height="16"〉

〈p align="center"〉作者〈/td〉

〈td width="76%" height="16"〉〈input type="text" name="author" size="24"〉〈/td〉

〈/tr〉

〈tr〉

〈td width="24%" height="16"〉

〈p align="center"〉价格〈/td〉

〈td width="76%" height="16"〉〈input type="text" name="price" size="24"〉〈/td〉

〈/tr〉

〈tr〉

〈td width="24%" height="95"〉

〈p align="center"〉简介〈/p〉

〈p〉 〈/td〉

〈td width="76%" height="95" valign="top"〉〈textarea rows="4" name="information" cols="22"〉〈/textarea〉〈/td〉

〈/tr〉

〈tr〉

〈td width="100%" height="15" colspan="2"〉

〈p align="center"〉〈input type="submit" value="提交" name="b1"〉〈input type="reset" value="取消" name="b2"〉〈/td〉

〈/tr〉

〈/table〉

〈/form〉

〈p〉   〈/p〉

〈/body〉

〈/html〉

(4)insertintodb.asp程序,用到了组件中add方法

〈html〉

〈head〉

〈title〉〈/title〉

〈/head〉

〈body〉

〈%dim insert_cd

set insert_cd =server.createobject("cd.cd_handle")

insert_cd.add request.form("id"),request.form ("name"),request.form("author"),request.form("price"),request.form("information")

%〉

〈p〉您已成功的加入一条书目〈/p〉

〈form name="a" method="post" action="listcdinformation.asp"〉

〈input type="submit" value="返回" name="b1"〉

〈/form〉

〈/body〉

〈/html〉

六、总结

  上面我简要的介绍了组件的定义以及使用vb来编写asp中组件的方法,其实上面所举的例子只是很粗浅的例子,相信大家写出的程序一定会比我的更好,我想如果有机会的话,我还会谢谢如何使用vc++和java来编写com组件,因为我觉得,如果你没有掌握com组件,你也就没有掌握asp的精髓。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网