资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

关于Asp调用go语言的信息

asp中的call命令是用来干什么的???

Call 语句

创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都网站建设、成都网站设计、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的刚察网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

将控制权传递给 Sub 或 Function 过程。

[Call] name [argumentlist]

参数

Call

可选项关键字。如果指定此关键字,则必须用括号把 argumentlist 括起来。例如:

Call MyProc(0)

name

必选项。要调用的过程名。

argumentlist

可选项。传递给过程的变量、数组或表达式列表,用逗号分隔每一项。

说明

在调用过程时,不必使用 Call 关键字。然而,如果使用 Call 关键字调用要求参数的过程,则必须用括号将 argumentlist 括起来。如果省略 Call 关键字,那么必须也同时省略 argumentlist 参数两边的括号。使用 Call 语法调用内部函数或使用用户自定义函数,函数返回值都会被放弃。

Call MyFunction("Hello World")

Function MyFunction(text)

MsgBox text

End Function

asp中怎么写js

JS的的位置一般要根据你asp语句功能放置,但在下列的一些标签内下是一定的

1、首先script type="text/javascript" 和 /script 就可以告诉浏览器 JavaScript 从何处开始,到何处结束。

2、位于 head 部分的JS:

当脚本被调用时,或者当事件被触发时,脚本就会被执行。当你把脚本放置到 head 部分后,就可以确保在需要使用脚本之前,它已经被载入了。(被调用时执行)

html

head

script type="text/javascript"

....

/script

/head

3、位于 body 部分的JS:

在页面载入时脚本就会被执行。当你把脚本放置于 body 部分后,它就会生成页面的内容。(即直接执行)

html

head

/head

body

script type="text/javascript"

....

/script

/body

/html

asp问题,谁可以帮我看一下

分类: 电脑/网络 程序设计 其他编程语言

问题描述:

我做了一个简单的登录页表,里面有三个文件,登录表单default提交给staff处理,还有一个CONN,数据库名为admin,字段名uname,ucode.看了很多次好像没什么问题,但是就是不行,现在我把所有代码发给你们,你可以放在你那里试一下,帮我改一下哪里错了,好吗,小弟无路可走了,送上全部积分了.

1,conn

%

dim conn

dim connstr

on error resume next

'设置adodb数据源连接

set conn=server.createobject("ADODB.CONNECTION")

'设置SQL连接

connstr="DBQ="+server.mappath("admin.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"

conn.open connstr

%

2,default页面

%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%

/head

body

p /p

blockquote

p /p

p /p

table width=754 height=209 border=0 cellpadding="0" cellspacing="0"

tr

td colspan="2"span class="STYLE1"会员登录

/span/td

/tr

form id="form1" name=form1 method="post" action="staff"

tr

td width=200 height=29 align=center用户名:/td

td width=554label

input name=fname type=text id="fname" /

/label /td

/tr

tr

td height=30 align=center密码:/td

tdlabel

input name=fcode type=password id="fcode" /

/label/td

/tr

tr

td height=32 /td

tdlabel

input type=submit name=登录 value="登录" /

input type=reset name=Submit value="重置" /

/label/td

/tr

/form

tr

td colspan="2" align=centerspan class="STYLE2"

欢迎你的到来!/span/td

/tr

tr

td colspan="2" align=center

退出登录/a/td

/tr

/table

p /p

/blockquote

/body

/

3,staff页面

!--#include file="conn"--

%dim name,code

name=request("fname")

code=request("fcode")

if name= or code="" then

response.Write "script LANGUAGE='javascript'alert('您的管理ID或密码有误!');history.go(-1);/script"

response.end

end if

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

sql="select * from admin where uname='"name"' and ucode='"code"' "

rs.open sql,conn,1,1

if not(rs.bof and rs.eof) then

if code=rs("ucode") then

session("okyes")=trim(rs("uname"))

session.Timeout=20

rs.Close

set rs=nothing

response.Redirect "index"

else

response.write "script LANGUAGE='javascript'alert('对不起,登陆失败!');history.go(-1);/script"

end if

else

response.write "script LANGUAGE='javascript'alert('对不起,登陆失败!');history.go(-1);/script"

end if

%

解析:

用下面代码替换掉conn的全部内容,就可以了~

%

on error resume next

connstr="provider=microsoft.jet.oledb.4.0;data source=" server.mappath("admin.mdb")

Set Conn=Server.CreateObject("ADODB.Connection")

conn.Open connstr

If Err Then

err.Clear

Set Conn = Nothing

Response.Write "数据库连接出错,请检查连接字符串"

Response.End

End If

%

一个关于ASP代码的问题

哦,那你可以根据内容字数来进行分页。。。 我帮你找一下代码。。嘻嘻

下面是我的代码。。。你自己分析整理一下啦。。。

------------------------------------

'=================================================

'过程名:ShowArt

'作 用:显示文章内容,可以分页显示

'参 数:无

'=================================================

sub ShowArt()

dim ArticleID

Pay=request("Pay")

ArticleID=md5(trim(request("art_id"))+123)

'ArticleID=trim(request("art_id"))

if rs("Grade")0 then

if UserLoginedTrue then

FoundErr=True

ErrMsg=ErrMsg "font color=red·/font你还没注册?或者没有登录?这篇文章要求至少是本站的注册用户才能阅读!br"

ErrMsg=ErrMsg "font color=red·/font如果你还没注册,请赶紧a href='UserReg.asp' font color=red点此注册/font/a !br"

ErrMsg=ErrMsg "font color=red·/font如果你已经注册但还没登录,请赶紧 a href='index.asp'font color=red点此登录/font/a !brbr"

else

if Hx66_Grade+1RS("Grade") then

FoundErr=True

ErrMsg=ErrMsg "p align='center'brfont color=redb对不起,你的权限不够,不能阅读此文章!/b/font/pbr"

else

if rs("points")0 then

if Request.Cookies("hx66")("Pay_Art" ArticleID)"yes" then

if Hx66_pointsrs("points") then

FoundErr=True

ErrMsg=ErrMsg "p align='center'br对不起,阅读本文需要消耗 bfont color=red" rs("points") "/font/b " moneyname "!"

ErrMsg=ErrMsg "而你目前只有 bfont color=blue" Hx66_points "/font/b " moneyname "可用。" moneyname "不足,无法阅读本文。请与我们联系进行充值。/p"

else

if lcase(trim(request("Pay")))="yes" then

sql="UPDATE [user] SET points = points - "rs("points")" where userid="Hx66_uid

conn.execute (sql)

response.Cookies("hx66")("Pay_Art" ArticleID)="yes"

Response.Cookies("hx66").Expires=date+365

else

FoundErr=True

ErrMsg=ErrMsg "p align='center'br阅读本文需要消耗 bfont color=red" rs("points") "/font/b " moneyname "!"

ErrMsg=ErrMsg "你目前尚有 bfont color=blue" Hx66_points "/font/b " moneyname "可用。阅读本文后,你将剩下 bfont color=green" Hx66_points-rs("points") "/font/b " moneyname ""

ErrMsg=ErrMsg "br你确实愿意花费 bfont color=red" rs("points") "/font/b " moneyname "来阅读本文吗?"

ErrMsg=ErrMsg "brbra href='?Pay=yesart_id=" rs("art_id") "'我愿意/a        a href='index.asp'我不愿意/a/pbr"

end if

end if

end if

end if

end if

end if

end if

if FoundErr=True then

ErrMsg="p align=leftb内容预览:/b/pp align=lefttable style='width:95%' cellpadding=5 cellspacing=1 class=tablegubbTRTD width='100%' bgcolor='#FFFFFF'" left(rs("art_content"),100) "……/td/tr/table/p" ErrMsg

response.write ErrMsg

exit sub

end if

dim PaginationType

PaginationType=rs("PaginationType")

select case PaginationType

case 0 '不分页显示

response.write rs("art_content")

case 1 '自动分页显示

call AutoPagination()

case 2 '手动分页显示

call ManualPagination()

end select

end sub

'=================================================

'过程名:ManualPagination

'作 用:采用手动分页方式显示文章内容

'参 数:无

'=================================================

sub ManualPagination()

dim ArtID,strContent,CurrentPage

dim ContentLen,MaxPerPage,pages,i

dim arrContent

ArtID=rs("art_id")

strContent=rs("art_content")

ContentLen=len(strContent)

CurrentPage=trim(request("Page"))

if Instr(strContent,"[NextPage]")=0 then

response.write strContent

response.write "/pp align='center'font color='red'b[1]/b/font/p"

else

arrContent=split(strContent,"[NextPage]")

pages=Ubound(arrContent)+1

if CurrentPage="" then

CurrentPage=1

else

CurrentPage=Cint(CurrentPage)

end if

if CurrentPage1 then CurrentPage=1

if CurrentPagepages then CurrentPage=pages

response.write arrContent(CurrentPage-1)

response.write "/pp align='center'b"

if CurrentPage1 then

response.write "a href='showart.asp?art_id="ArtID"page="CurrentPage-1"'上一页/a "

end if

for i=1 to pages

if i=CurrentPage then

response.write "font color='red'[" cstr(i) "]/font "

else

response.write "a href='showart.asp?art_id="ArtID"page="i"'[" i "]/a "

end if

next

if CurrentPagepages then

response.write "a href='showart.asp?art_id="ArtID"page="CurrentPage+1"'下一页/a"

end if

response.write "/b/p"

end if

end sub

'=================================================

'过程名:AutoPagination

'作 用:采用自动分页方式显示文章内容

'参 数:无

'=================================================

sub AutoPagination()

dim ArtID,strContent,CurrentPage

dim ContentLen,MaxPerPage,pages,i,lngBound

dim BeginPoint,EndPoint

ArtID=rs("art_id")

strContent=rs("art_content")

ContentLen=len(strContent)

CurrentPage=trim(request("Page"))

if ContentLen=rs("MaxCharPerPage") then

response.write strContent

response.write "/pp align='center'font color='red'b[1]/b/font/p"

else

if CurrentPage="" then

CurrentPage=1

else

CurrentPage=Cint(CurrentPage)

end if

pages=ContentLen\rs("MaxCharPerPage")

if rs("MaxCharPerPage")*pagesContentLen then

pages=pages+1

end if

lngBound=ContentLen '最大误差范围

if CurrentPage1 then CurrentPage=1

if CurrentPagepages then CurrentPage=pages

dim lngTemp

dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3

dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2

dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2

dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2

dim lngTemp5,lngTemp5_1,lngTemp5_2

dim lngTemp6,lngTemp6_1,lngTemp6_2

if CurrentPage=1 then

BeginPoint=1

else

BeginPoint=rs("MaxCharPerPage")*(CurrentPage-1)+1

lngTemp1_1_1=instr(BeginPoint,strContent,"/table",1)

lngTemp1_1_2=instr(BeginPoint,strContent,"/TABLE",1)

lngTemp1_1_3=instr(BeginPoint,strContent,"/Table",1)

if lngTemp1_1_10 then

lngTemp1_1=lngTemp1_1_1

elseif lngTemp1_1_20 then

lngTemp1_1=lngTemp1_1_2

elseif lngTemp1_1_30 then

lngTemp1_1=lngTemp1_1_3

else

lngTemp1_1=0

end if

lngTemp1_2_1=instr(BeginPoint,strContent,"table",1)

lngTemp1_2_2=instr(BeginPoint,strContent,"TABLE",1)

lngTemp1_2_3=instr(BeginPoint,strContent,"Table",1)

if lngTemp1_2_10 then

lngTemp1_2=lngTemp1_2_1

elseif lngTemp1_2_20 then

lngTemp1_2=lngTemp1_2_2

elseif lngTemp1_2_30 then

lngTemp1_2=lngTemp1_2_3

else

lngTemp1_2=0

end if

if lngTemp1_1=0 and lngTemp1_2=0 then

lngTemp1=BeginPoint

else

if lngTemp1_1lngTemp1_2 then

lngtemp1=lngTemp1_2

else

lngTemp1=lngTemp1_1+8

end if

end if

lngTemp2_1_1=instr(BeginPoint,strContent,"/p",1)

lngTemp2_1_2=instr(BeginPoint,strContent,"/P",1)

if lngTemp2_1_10 then

lngTemp2_1=lngTemp2_1_1

elseif lngTemp2_1_20 then

lngTemp2_1=lngTemp2_1_2

else

lngTemp2_1=0

end if

lngTemp2_2_1=instr(BeginPoint,strContent,"p",1)

lngTemp2_2_2=instr(BeginPoint,strContent,"P",1)

if lngTemp2_2_10 then

lngTemp2_2=lngTemp2_2_1

elseif lngTemp2_2_20 then

lngTemp2_2=lngTemp2_2_2

else

lngTemp2_2=0

end if

if lngTemp2_1=0 and lngTemp2_2=0 then

lngTemp2=BeginPoint

else

if lngTemp2_1lngTemp2_2 then

lngtemp2=lngTemp2_2

else

lngTemp2=lngTemp2_1+4

end if

end if

lngTemp3_1_1=instr(BeginPoint,strContent,"/ur",1)

lngTemp3_1_2=instr(BeginPoint,strContent,"/UR",1)

if lngTemp3_1_10 then

lngTemp3_1=lngTemp3_1_1

elseif lngTemp3_1_20 then

lngTemp3_1=lngTemp3_1_2

else

lngTemp3_1=0

end if

lngTemp3_2_1=instr(BeginPoint,strContent,"ur",1)

lngTemp3_2_2=instr(BeginPoint,strContent,"UR",1)

if lngTemp3_2_10 then

lngTemp3_2=lngTemp3_2_1

elseif lngTemp3_2_20 then

lngTemp3_2=lngTemp3_2_2

else

lngTemp3_2=0

end if

if lngTemp3_1=0 and lngTemp3_2=0 then

lngTemp3=BeginPoint

else

if lngTemp3_1lngTemp3_2 then

lngtemp3=lngTemp3_2

else

lngTemp3=lngTemp3_1+5

end if

end if

if lngTemp1lngTemp2 then

lngTemp=lngTemp2

else

lngTemp=lngTemp1

end if

if lngTemplngTemp3 then

lngTemp=lngTemp3

end if

if lngTempBeginPoint and lngTemp=BeginPoint+lngBound then

BeginPoint=lngTemp

else

lngTemp4_1_1=instr(BeginPoint,strContent,"/li",1)

lngTemp4_1_2=instr(BeginPoint,strContent,"/LI",1)

if lngTemp4_1_10 then

lngTemp4_1=lngTemp4_1_1

elseif lngTemp4_1_20 then

lngTemp4_1=lngTemp4_1_2

else

lngTemp4_1=0

end if

lngTemp4_2_1=instr(BeginPoint,strContent,"li",1)

lngTemp4_2_1=instr(BeginPoint,strContent,"LI",1)

if lngTemp4_2_10 then

lngTemp4_2=lngTemp4_2_1

elseif lngTemp4_2_20 then

lngTemp4_2=lngTemp4_2_2

else

lngTemp4_2=0

end if

if lngTemp4_1=0 and lngTemp4_2=0 then

lngTemp4=BeginPoint

else

if lngTemp4_1lngTemp4_2 then

lngtemp4=lngTemp4_2

else

lngTemp4=lngTemp4_1+5

end if

end if

if lngTemp4BeginPoint and lngTemp4=BeginPoint+lngBound then

BeginPoint=lngTemp4

else

lngTemp5_1=instr(BeginPoint,strContent,"img",1)

lngTemp5_2=instr(BeginPoint,strContent,"IMG",1)

if lngTemp5_10 then

lngTemp5=lngTemp5_1

elseif lngTemp5_20 then

lngTemp5=lngTemp5_2

else

lngTemp5=BeginPoint

end if

if lngTemp5BeginPoint and lngTemp5BeginPoint+lngBound then

BeginPoint=lngTemp5

else

lngTemp6_1=instr(BeginPoint,strContent,"br",1)

lngTemp6_2=instr(BeginPoint,strContent,"BR",1)

if lngTemp6_10 then

lngTemp6=lngTemp6_1

elseif lngTemp6_20 then

lngTemp6=lngTemp6_2

else

lngTemp6=0

end if

if lngTemp6BeginPoint and lngTemp6BeginPoint+lngBound then

BeginPoint=lngTemp6+4

end if

end if

end if

end if

end if

if CurrentPage=pages then

EndPoint=ContentLen

else

EndPoint=rs("MaxCharPerPage")*CurrentPage

if EndPoint=ContentLen then

EndPoint=ContentLen

else

lngTemp1_1_1=instr(EndPoint,strContent,"/table",1)

lngTemp1_1_2=instr(EndPoint,strContent,"/TABLE",1)

lngTemp1_1_3=instr(EndPoint,strContent,"/Table",1)

if lngTemp1_1_10 then

lngTemp1_1=lngTemp1_1_1

elseif lngTemp1_1_20 then

lngTemp1_1=lngTemp1_1_2

elseif lngTemp1_1_30 then

lngTemp1_1=lngTemp1_1_3

else

lngTemp1_1=0

end if

lngTemp1_2_1=instr(EndPoint,strContent,"table",1)

lngTemp1_2_2=instr(EndPoint,strContent,"TABLE",1)

lngTemp1_2_3=instr(EndPoint,strContent,"Table",1)

if lngTemp1_2_10 then

lngTemp1_2=lngTemp1_2_1

elseif lngTemp1_2_20 then

lngTemp1_2=lngTemp1_2_2

elseif lngTemp1_2_30 then

lngTemp1_2=lngTemp1_2_3

else

lngTemp1_2=0

end if

if lngTemp1_1=0 and lngTemp1_2=0 then

lngTemp1=EndPoint

else

if lngTemp1_1lngTemp1_2 then

lngtemp1=lngTemp1_2-1

else

lngTemp1=lngTemp1_1+7

end if

end if

lngTemp2_1_1=instr(EndPoint,strContent,"/p",1)

lngTemp2_1_2=instr(EndPoint,strContent,"/P",1)

if lngTemp2_1_10 then

lngTemp2_1=lngTemp2_1_1

elseif lngTemp2_1_20 then

lngTemp2_1=lngTemp2_1_2

else

lngTemp2_1=0

end if

lngTemp2_2_1=instr(EndPoint,strContent,"p",1)

lngTemp2_2_2=instr(EndPoint,strContent,"P",1)

if lngTemp2_2_10 then

lngTemp2_2=lngTemp2_2_1

elseif lngTemp2_2_20 then

lngTemp2_2=lngTemp2_2_2

else

lngTemp2_2=0

end if

if lngTemp2_1=0 and lngTemp2_2=0 then

lngTemp2=EndPoint

else

if lngTemp2_1lngTemp2_2 then

lngTemp2=lngTemp2_2-1

else

lngTemp2=lngTemp2_1+3

end if

end if

lngTemp3_1_1=instr(EndPoint,strContent,"/ur",1)

lngTemp3_1_2=instr(EndPoint,strContent,"/UR",1)

if lngTemp3_1_10 then

lngTemp3_1=lngTemp3_1_1

elseif lngTemp3_1_20 then

lngTemp3_1=lngTemp3_1_2

else

lngTemp3_1=0

end if

lngTemp3_2_1=instr(EndPoint,strContent,"ur",1)

lngTemp3_2_2=instr(EndPoint,strContent,"UR",1)

if lngTemp3_2_10 then

lngTemp3_2=lngTemp3_2_1

elseif lngTemp3_2_20 then

lngTemp3_2=lngTemp3_2_2

else

lngTemp3_2=0

end if

if lngTemp3_1=0 and lngTemp3_2=0 then

lngTemp3=EndPoint

else

if lngTemp3_1lngTemp3_2 then

lngtemp3=lngTemp3_2-1

else

lngTemp3=lngTemp3_1+4

end if

end if

if lngTemp1lngTemp2 then

lngTemp=lngTemp2

else

lngTemp=lngTemp1

end if

if lngTemplngTemp3 then

lngTemp=lngTemp3

end if

if lngTempEndPoint and lngTemp=EndPoint+lngBound then

EndPoint=lngTemp

else

lngTemp4_1_1=instr(EndPoint,strContent,"/li",1)

lngTemp4_1_2=instr(EndPoint,strContent,"/LI",1)

if lngTemp4_1_10 then

lngTemp4_1=lngTemp4_1_1

elseif lngTemp4_1_20 then

lngTemp4_1=lngTemp4_1_2

else

lngTemp4_1=0

end if

lngTemp4_2_1=instr(EndPoint,strContent,"li",1)

lngTemp4_2_1=instr(EndPoint,strContent,"LI",1)

if lngTemp4_2_10 then

lngTemp4_2=lngTemp4_2_1

elseif lngTemp4_2_20 then

lngTemp4_2=lngTemp4_2_2

else

lngTemp4_2=0

end if

if lngTemp4_1=0 and lngTemp4_2=0 then

lngTemp4=EndPoint

else

if lngTemp4_1lngTemp4_2 then

lngtemp4=lngTemp4_2-1

else

lngTemp4=lngTemp4_1+4

end if

end if

if lngTemp4EndPoint and lngTemp4=EndPoint+lngBound then

EndPoint=lngTemp4

else

lngTemp5_1=instr(EndPoint,strContent,"img",1)

lngTemp5_2=instr(EndPoint,strContent,"IMG",1)

if lngTemp5_10 then

lngTemp5=lngTemp5_1-1

elseif lngTemp5_20 then

lngTemp5=lngTemp5_2-1

else

lngTemp5=EndPoint

end if

if lngTemp5EndPoint and lngTemp5EndPoint+lngBound then

EndPoint=lngTemp5

else

lngTemp6_1=instr(EndPoint,strContent,"br",1)

lngTemp6_2=instr(EndPoint,strContent,"BR",1)

if lngTemp6_10 then

lngTemp6=lngTemp6_1+3

elseif lngTemp6_20 then

lngTemp6=lngTemp6_2+3

else

lngTemp6=EndPoint

end if

if lngTemp6EndPoint and lngTemp6EndPoint+lngBound then

EndPoint=lngTemp6

end if

end if

end if

end if

end if

end if

response.write mid(strContent,BeginPoint,EndPoint-BeginPoint)

response.write "/pp align='center'b"

if CurrentPage1 then

response.write "a href='showart.asp?art_id="ArtID"page="CurrentPage-1"'上一页/a "

end if

for i=1 to pages

if i=CurrentPage then

response.write "font color='red'[" cstr(i) "]/font "

else

response.write "a href='showart.asp?art_id="ArtID"page="i"'[" i "]/a "

end if

next

if CurrentPagepages then

response.write "a href='showart.asp?art_id="ArtID"page="CurrentPage+1"'下一页/a"

end if

response.write "/b/p"

end if


本文名称:关于Asp调用go语言的信息
分享URL:http://cdkjz.cn/article/dodehcp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220