src 调用asp

src 调用asp,第1张

你已经说过调用asp了,所以不能用2htm,应该用2asp

在2asp中写

<%

responseredirect ">

<%

'以下为修改内容

Const UploadDir="/picture/" '存放文件的目录

Const Up="/picture/" '存放文件的目录

Const MaxPerPage=30 '每页显示数量

const Webpage="时尚网页" '标题

'检查组件是否已经安装

Function IsObjInstalled(strClassString)

IsObjInstalled = False

Err = 0

Dim xTestObj

Set xTestObj = ServerCreateObject(strClassString)

If 0 = Err Then IsObjInstalled = True

Set xTestObj = Nothing

Err = 0

End Function

dim strFileName

dim totalPut,CurrentPage,TotalPages

dim TruePath,fso,theFolder,theFile,whichfile,thisfile,FileCount,TotleSize

strFileName=""

if request("page")<>"" then

currentPage=cint(request("page"))

else

currentPage=1

end if

TruePath=ServerMapPath(UploadDir)

If not IsObjInstalled("ScriptingFileSystemObject") Then

ResponseWrite "<b><font color=red>你的服务器不支持 FSO(ScriptingFileSystemObject)! 不能使用本功能</font></b>"

Else

set fso=CreateObject("ScriptingFileSystemObject")

if fsoFolderExists(TruePath)then

FileCount=0

TotleSize=0

Set theFolder=fsoGetFolder(TruePath)

For Each theFile In theFolderFiles

FileCount=FileCount+1

TotleSize=TotleSize+theFileSize

next

totalPut=FileCount

if currentpage<1 then

currentpage=1

end if

if (currentpage-1)MaxPerPage>totalput then

if (totalPut mod MaxPerPage)=0 then

currentpage= totalPut \ MaxPerPage

else

currentpage= totalPut \ MaxPerPage + 1

end if

end if

if currentPage=1 then

showContent

showpage2 strFileName,totalput,MaxPerPage

responsewrite "<br><div align='center'>本页共显示 <b>" & FileCount-1 & "</b> 个,占用 <b>" & TotleSize\1024 & "</b> K</div>"

else

if (currentPage-1)MaxPerPage<totalPut then

showContent

showpage2 strFileName,totalput,MaxPerPage

responsewrite "<br><div align='center'>本页共显示 <b>" & FileCount-1 & "</b> 个,占用 <b>" & TotleSize\1024 & "</b> K</div>"

else

currentPage=1

showContent

showpage2 strFileName,totalput,MaxPerPage

responsewrite "<br><div align='center'>本页共显示 <b>" & FileCount-1 & "</b> 个,占用 <b>" & TotleSize\1024 & "</b> K</div><br><br>"

end if

end if

else

responsewrite "找不到文件夹!可能是配置有误!"

end if

end if

sub showContent()

dim c

FileCount=1

TotleSize=0

%>

<TABLE cellSpacing=5 cellPadding=5 border=0>

<TBODY>

<TR bgColor=#ffffff>

<% For Each theFile In theFolderFiles

c=c+1

if FileCount>MaxPerPage then

exit for

elseif c>MaxPerPage(CurrentPage-1) then %>

<TD align=middle width="138">

<img src=<%=(UploadDir & theFileName)%> border=0><br>

<%

dim str

str=""&(theFileName)&""

str1=str

str2=str

str=replace(str,"jpg","")

if instr(1,str,"/")>0 then

str=split(str,"/")

str1=str(0)

end if

%><%=str%>

</td>

<% if FileCount mod 5 =0 then%>

</TR>

<TR bgColor=#ffffff>

<%end if%>

<% FileCount=FileCount+1

TotleSize=TotleSize+theFileSize

end if

Next

%>

</tr></TBODY></table>

<%

end sub

sub showpage2(sfilename,totalnumber,maxperpage)

dim n, i,strTemp

if totalnumber mod maxperpage=0 then

n= totalnumber \ maxperpage

else

n= totalnumber \ maxperpage+1

end if

strTemp= "<TABLE cellSpacing=1 cellPadding=1 border=0 align='center'><TR bgColor=#ffffff><form name='showpages' method='Post' action='" & sfilename & "'><td align='center'>"

strTemp=strTemp & "共 <b>" & totalnumber & "</b> 个 "

if CurrentPage<2 then

strTemp=strTemp & "首页 上一页 "

else

strTemp=strTemp & "<a href='" & sfilename & "page=1'>首页</a> "

strTemp=strTemp & "<a href='" & sfilename & "page=" & (CurrentPage-1) & "'>上一页</a> "

end if

if n-currentpage<1 then

strTemp=strTemp & "下一页 尾页"

else

strTemp=strTemp & "<a href='" & sfilename & "page=" & (CurrentPage+1) & "'>下一页</a> "

strTemp=strTemp & "<a href='" & sfilename & "page=" & n & "'>尾页</a>"

end if

strTemp=strTemp & " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "

strTemp=strTemp & " <b>" & maxperpage & "</b>" & "个/页"

strTemp=strTemp & " 转到:<select name='page' size='1' onchange='javascript:submit()'>"

for i = 1 to n

strTemp=strTemp & "<option value='" & i & "'"

if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected "

strTemp=strTemp & ">第" & i & "页</option>"

next

strTemp=strTemp & "</select>"

strTemp=strTemp & "</td></form></tr></table>"

responsewrite strTemp

end sub

%>

以下是写入代码

<%

responsebuffer=true

formsize=requesttotalbytes

formdata=requestbinaryread(formsize)

bncrlf=chrB(13) & chrB(10)

divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)

datastart=instrb(formdata,bncrlf & bncrlf)+4

dataend=instrb(datastart+1,formdata,divider)-datastart

mydata=midb(formdata,datastart,dataend)

set connGraph=serverCreateObject("ADODBconnection")

connGraphConnectionString="driver={Microsoft Access Driver (mdb)};DBQ=" & serverMapPath("imagesmdb") & ";uid=;PWD=;"

connGraphOpen

set rec=servercreateobject("ADODBrecordset")

recOpen "SELECT FROM aa where id is null",connGraph,1,3

recaddnew

rec("img")appendchunk mydata

recupdate

recclose

set rec=nothing

set connGraph=nothing

%>

这是显示代码

<html>

<body>

<center>

<form name="mainForm" enctype="multipart/form-data" action="a1asp" method=post>

<input type=file name=mefile><br>

<input type=submit name=ok value="OK">

</form>

</center>

</body>

</html>

引用的时候直接这样引用

<input type="image" name="imageField" id="imageField" src="showimgaspid=1" />

如果用HTML来实现的话应该这样::

<A href=>

Function RegExp_Execute(postcontent)

Dim regEx, Match, Matches,values '建立变量。

Set regEx = New RegExp '建立正则表达式。

regExPattern = "src\=+\(gif|jpg)" '设置模式。

regExIgnoreCase = true '设置是否区分字符大小写。

regExGlobal = True '设置全局可用性。

Set Matches = regExExecute(postcontent) '执行搜索。

For Each Match in Matches '遍历匹配集合。

values=values&MatchValue&"""|"

Next

RegExp_Execute = values

End Function

意思是这样

用数组来实现 url链接中,都包含有 "/" 用"/"把字符串分割成数组, 名是字符串的最未尾 那就取数组最后一组, 就得到了名称。 dim imgsrc imgsrc = ">

以上就是关于src 调用asp全部的内容,包括:src 调用asp、我查看某asp网站的源码<iframe src的src值为*的,有人能告诉我是怎样做到的吗、asp获取服务器一目录下的所有图片的文件名等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/9446197.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-28
下一篇 2023-04-28

发表评论

登录后才能评论

评论列表(0条)

保存