[提问]
asp+ms sql数据库 godaddy生成的html页为什么是空白的?
|
|
asp+ms sql数据库 godaddy生成的html页为什么是空白的?
说明:1.我已经把相应目录权限改成可写入了,能生成html文件,只不过生成的是空白的页面,里面没有内容.
2.我是用的asp+ms sql2005,是不是不存在改成access97的问题?
3.我设置<meta http-equiv="Content-Type" content="text/html; charset=utf-8">后连html文件都生成不了了.
请问哪位高手知道怎么解决? |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2008-9-16 17:30:15
|
显示全部楼层
1。你的是什么程序,有的程序需要另外安装组件的就不可以 。
2.。ms sql数据库就没有改access的问题
3.这个是设置编码的 |
|
|
|
|
|
|
|
|
|
|
wfbhdl
发表于 2008-9-16 17:41:00
|
显示全部楼层
|
我是用的xmlhttp组件和fso组件,godaddy都支持的,没有别的组件了,但就是不能生成有内容的html,生成的全是0k的空白页 |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2008-9-17 09:57:41
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
wfbhdl
发表于 2008-9-17 16:06:57
|
显示全部楼层
原帖由 add.c 于 2008-9-17 09:57 AM 发表 
把目录设置为写权限,并设置其子目录也继承为写权限
我早就设成写的权限了,不然怎么会生成0b的文件呢? |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2008-9-17 16:14:33
|
显示全部楼层
你程序本身的编码是什么,设置为一致的试试看。
对文件的fso操作需要用adodb.stream,而不是scripting.filesystemobject
[ 本帖最后由 add.c 于 2008-9-17 04:54 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
wfbhdl
发表于 2008-9-17 18:12:09
|
显示全部楼层
!
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #E4EDF9;
}
body,td,th {
font-size: 12px;
}
-->
</style>
<%
Function GetPage(url)
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False ', "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body)
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 = "utf-8"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
on error resume next
Url="http://www.google.com"
wstr = GetPage(Url)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(server.MapPath("/index.html"))) Then
fs.DeleteFile(server.MapPath("/index.html"))
End If
Set CrFi=fs.CreateTextFile(server.MapPath("/index.html"))
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>生成网站首页完成!</font>"
%>
------------------------------------------------------------------------------------------------------------------------
所有代码如上,如图,如果采集:"http://www.google.com"这个英文网站及其它英文网站,是没有任何问题的,正常采集到了.但是,如果采集"http://www.baidu.com"这个中文网站或其它中文网站,则采集页是空白!!!也就是说,中文网站不能采集,只能采集英文网站!有些人说是要把编码换成gb2312或utf-8,可是我都换了,还是不能采集中文网站的,不知要换成哪个编码或怎么改才能采集中文网站? |
|
|
|
|
|
|
|
|
|
|
wfbhdl
发表于 2008-9-18 08:41:22
|
显示全部楼层
|
上述代码在国内主机和本地测试是正常的,即采集中文和英文网站都能用,就是在godaddy的空间上不能采集中文网站,只能采集英文网站。 |
|
|
|
|
|
|
|
|
|
|
ivye
发表于 2008-9-18 09:44:30
|
显示全部楼层
兄弟,那个GODADDY的MSSQL数据库是咋整的啊
|
如标题,可以帮下忙嘛?那个CVS格式怎么转我都不清楚~! |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2008-9-18 10:05:35
|
显示全部楼层
回复 7# 9#的帖子
设成GBK编码。
知识库里有相关导入数据库的教程
[ 本帖最后由 add.c 于 2008-9-18 10:07 AM 编辑 ] |
|
|
|
|
|
|
|
|