|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
当然了,现在国内CRM厂商的产品与其说是CRM,但从至少从我的角度分析上来看,充其量只是一个大型的进销存而已了,了解尚浅,不够胆详评,这里只提技术问题网页|下载看过一篇关于下载网页中图片的文章,它只能下载以http头的图片,我做了些改善,能够下载网页中的一切毗连资本,并依照网页中的目次布局创建当地目次,寄存资本。
download.asp?url=你要下载的网页
download.asp代码以下
<%
Server.ScriptTimeout=9999
functionSaveToFile(from,tofile)
onerrorresumenext
dimgeturl,objStream,imgs
geturl=trim(from)
Mybyval=getHTTPstr(geturl)
SetobjStream=Server.CreateObject("ADODB.Stream")
objStream.Type=1
objStream.Open
objstream.writeMybyval
objstream.SaveToFiletofile,2
objstream.Close()
setobjstream=nothing
iferr.number0thenerr.Clear
endfunction
functiongeturlencodel(byvalurl)中文文件名转换
Dimi,code
geturlencodel=""
iftrim(Url)=""thenexitfunction
fori=1tolen(Url)
code=Asc(mid(Url,i,1))
ifcode<0Thencode=code+65536
Ifcode>255Then
geturlencodel=geturlencodel&"%"&Left(Hex(Code),2)&"%"&Right(Hex(Code),2)
else
geturlencodel=geturlencodel&mid(Url,i,1)
endif
next
endfunction
functiongetHTTPPage(url)
onerrorresumenext
dimhttp
sethttp=Server.createobject("Msxml2.XMLHTTP")
Http.open"GET",url,false
Http.send()
ifHttp.readystate4thenexitfunction
getHTTPPage=bytes2BSTR(Http.responseBody)
sethttp=nothing
iferr.number0thenerr.Clear
endfunction
Functionbytes2BSTR(vIn)
dimstrReturn
dimi,ThisCharCode,NextCharCode
strReturn=""
Fori=1ToLenB(vIn)
ThisCharCode=AscB(MidB(vIn,i,1))
IfThisCharCode<&H80Then
strReturn=strReturn&Chr(ThisCharCode)
Else
NextCharCode=AscB(MidB(vIn,i+1,1))
strReturn=strReturn&Chr(CLng(ThisCharCode)*&H100+CInt(NextCharCode))
i=i+1
EndIf
Next
bytes2BSTR=strReturn
EndFunction
functiongetFileName(byvalfilename)
ifinstr(filename,"/")>0then
fileExt_a=split(filename,"/")
getFileName=lcase(fileExt_a(ubound(fileExt_a)))
ifinstr(getFileName,"?")>0then
getFileName=left(getFileName,instr(getFileName,"?")-1)
endif
else
getFileName=filename
endif
endfunction
functiongetHTTPstr(url)
onerrorresumenext
dimhttp
sethttp=server.createobject("MSXML2.XMLHTTP")
Http.open"GET",url,false
Http.send()
ifHttp.readystate4thenexitfunction
getHTTPstr=Http.responseBody
sethttp=nothing
iferr.number0thenerr.Clear
endfunction
FunctionCreateDIR(ByValLocalPath)创建目次的程序,假如有多级目次,则一级一级的创立
OnErrorResumeNext
LocalPath=Replace(LocalPath,"","/")
SetFileObject=server.CreateObject("Scripting.FileSystemObject")
patharr=Split(LocalPath,"/")
path_level=UBound(patharr)
ForI=0Topath_level
IfI=0Thenpathtmp=patharr(0)&"/"Elsepathtmp=pathtmp&patharr(I)&"/"
cpath=Left(pathtmp,Len(pathtmp)-1)
IfNotFileObject.FolderExists(cpath)ThenFileObject.CreateFoldercpath
Next
SetFileObject=Nothing
IfErr.Number0Then
CreateDIR=False
Err.Clear
Else
CreateDIR=True
EndIf
EndFunction
functionGetfileExt(byvalfilename)
fileExt_a=split(filename,".")
GetfileExt=lcase(fileExt_a(ubound(fileExt_a)))
endfunction
functiongetvirtual(str,path,urlhead)
ifleft(str,7)="http://"then
url=str
elseifleft(str,1)="/"then
start=instrRev(str,"/")
ifstart=1then
url="/"
else
url=left(str,start)
endif
url=urlhead&url
elseifleft(str,3)="../"then
str1=mid(str,inStrRev(str,"../")+2)
ar=split(str,"../")
lv=ubound(ar)+1
ar=split(path,"/")
url="/"
fori=1to(ubound(ar)-lv)
url=url&ar(i)
next
url=url&str1
url=urlhead&url
else
url=urlhead&str
endif
getvirtual=url
endfunction
示例代码
dimdlpath
virtual="/downweb/"
truepath=server.MapPath(virtual)
ifrequest("url")""then
url=request("url&quo</p>ASP.NET和ASP的比较,技术上比较已经没什么可说的了.新一代在大部分程度来说当然是比旧一代好了.关键看你对所做软件的理解了.因人而定.会写的话也可能比ASP.NET写得更有效率和更方便重用 |
|