studio中新建一个网站,在里面添加一个asp.net的页面,在将html或者asp文件用记事本打开,将html中的<head></head>复制到asp.net中,html中的<body></body>复制到asp.net的
<from></from>中,添加控件的话可以直接在工具栏中拖拽,或者直接把html中的html空间加上<runat="server">弄成服务器控件就OK了,希望能帮到你
ASP生成静态网页的方法
下面的例子是将、index.asp?id=1/index.asp?id=2/index.asp?id=3/这三个动态页面,分别生成ndex1.htm,index2.htm,index3.htm存在根目录下面:
<%
dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url,Html_Temp
Html_Temp="
"For i=1 To 3Html_Temp = Html_Temp&"
"Item_Classid = iFileName = "Index"&Item_Classid&".htm"FilePath = Server.MapPath("/")&"\"&FileNameHtml_Temp = Html_Temp&FilePath&"
"
Do_Url = "http://"
Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/main/index.asp"
Do_Url = Do_Url&"?Item_Classid="&Item_Classid
strUrl = Do_Url
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
Dim binFileData
binFileData = objXmlHttp.responseBody
Dim objAdoStream
set objAdoStream = Server.CreateObject("ADODB.Stream")
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
Next
Html_Temp = Html_Temp&"
"%><%Response.Write ( "成功生成文件:" )Response.Write ( "" )Response.Write Html_Temp%>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)