分享

写回答

发帖

[提问] godaddy 生成错误

GoDaddy GoDaddy 581 人阅读 | 1 人回复

发表于 2009-9-25 18:10:28 | 显示全部楼层 |阅读模式

<%
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send("")
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function

Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
htmlurl="http://"&Request.ServerVariables("SERVER_NAME")
for i=0 to 8
if i=0 then
txtURL=htmlurl&"/index.asp?acc="&now&""
filename="../index.html"
elseif i=1 then
txtURL=htmlurl&"/contact_us.asp?acc="&now&""
filename="../contact_us.html"
elseif i=2 then
txtURL=htmlurl&"/POLCY.asp?acc="&now&""
filename="../POLICY.html"
elseif i=3 then
txtURL=htmlurl&"/about us.asp?acc="&now&""
filename="../ABOUT_US.html"
elseif i=4 then
txtURL=htmlurl&"/why.asp?acc="&now&""
filename="../why.html"
elseif i=5 then
txtURL=htmlurl&"/SECURITY.asp?acc="&now&""
filename="../SECURITY.html"
elseif i=6 then
txtURL=htmlurl&"/EXCHANGES.asp?acc="&now&""
filename="../EXCHANGES.html"
elseif i=7 then
txtURL=htmlurl&"/payment.asp?acc="&now&""
filename="../payment.html"
elseif i=8 then
txtURL=htmlurl&"/INFORMATION.asp?acc="&now&""
filename="../INFORMATION.html"
end if

sText = getHTTPPage(txtURL)
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set openFile=FileObject.OpenTextfile(server.mapPath(filename),2,true) 'true为不存在自行建立
openFile.writeline(sText)
Set OpenFile=nothing
next

%>
<script>
alert("静态网页生成完毕");
location.href = 'main.asp';
</script>

在本地都好好的
显示78行错误    就是这个了    openFile.writeline(sText)

回答|共 1 个

add.c

发表于 2009-9-25 19:26:45 | 显示全部楼层

貌似是目录没有读写权限
GoDaddy设置权限:http://bbs.idcspy.com/thread-32514-1-1.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则