日期:2014-05-17  浏览次数:20858 次

asp生成html 路径的问题,在线等待,急急急急急急!!!!!!!!!1
Function htmll(mulu,htmlmulu,FileName,filefrom,htmla,htmlb,htmlc,htmld)
if mulu="" then mulu="/"
if htmlmulu="" then htmlmulu="/"
mulu=replace(SysRootDir&mulu, "//", "/")
htmlmulu=replace(SysRootDir&htmlmulu, "//", "/")
FilePath=Server.MapPath(mulu)&"\"&FileName
Do_Url="http://"
Do_Url=Do_Url&Request.ServerVariables(name)&htmlmulu&filefrom
Do_Url=Do_Url&"?"&htmla&htmlb&"&"&htmlc&htmld
strUrl=Do_Url
set objXmlHttp=Server.createObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
binFileData=objXmlHttp.responseBody
Set objXmlHttp=Nothing
set objAdoStream=Server.CreateObject("Adodb." & "Stream")
objAdoStream.Type=1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
set objAdoStream=nothing
End Function




call htmll("","",""&ProName&""&Separated&""&ID&"."&HTMLName&"","ProductView.asp","ID=",ID,"","")
Response.Write "<script>bar_img.width="&Fix((Detail_Num/totalrec)*300)&";"
Response.Write "bar_txt1.innerHTML=""已成功生成静态页"&Detail_Num&"页,完成比例:" & formatnumber(Detail_Num/totalrec*100) & """;</script>"
Response.Flush
rs.movenext
Detail_Num=Detail_Num+1
loop
end if
rs.close
set rs=Nothing
conn.close
set conn=Nothing


这两个要怎么改才能正确生成html指定的文件夹里 我的文件 /admin/生成代码 /ch/asp前台文件 我要生成在/ html目录下 http://localhost/html/被生成的文件。 


改了好几次都没改好,那位大虾知道请指教一下,谢谢!

------解决方案--------------------
因为你的参数都为空啊
call htmll("","",""&ProName&""&Separated&""&ID&"."&HTMLName&"","ProductView.asp","ID=",ID,"","")
第一个参数是目录名字,第二个参数就是html文件夹名字,你可以这样修改下试试

call htmll("","html",""&ProName&""&Separated&""&ID&"."&HTMLName&"","ProductView.asp","ID=",ID,"","")

最主要就是前面2个参数,自己调试吧。
------解决方案--------------------
FilePath=Server.MapPath(mulu)&"\"&FileName

改成

FilePath=Server.MapPath("../html")&"\"&FileName

即可实现的的需求

参数不用改,只需改这样一行,固定写入到/html目录了