asp性能测试报告
在服务器上生成动态内容是使用ASP最主要的原因之一,所以我们选择的第一个测试项目是确定把动态内容发送到应答流使用什么方法最好。基本的选择有两种(以及它们的一些变化):使用内嵌ASP标记,使用Response.Write语句。
为测试这些不同的方法,我们创建了一个简单的ASP页面,页面先定义一些变量然后把它们插入到表格。虽然这个页面很简单,而且没有实际用途,但它足以让我们分离和测试各个问题。
2.1 使用ASP内嵌标记
第一个测试是使用ASP的内嵌标记< %= x % >,其中x是一个变量。这是使用最方便的方法,而且它可以让页面的HTML部分变得更容易阅读和维护。
< % OPTION EXPLICIT
Dim FirstName
Dim LastName
Dim MiddleInitial
Dim Address
Dim City
Dim State
Dim PhoneNumber
Dim FaxNumber
Dim EMail
Dim BirthDate
FirstName = "John"
MiddleInitial = "Q"
LastName = "Public"
Address = "100 Main Street"
City = "New York"
State = "NY"
PhoneNumber = "1-212-555-1234"
FaxNumber = "1-212-555-1234"
EMail = "john@public.com"
BirthDate = "1/1/1950"
% >
< HTML >
< HEAD >
< TITLE >Response Test< / TITLE >
< /HEAD >
< BODY >
< H1 >Response Test< /H1 >
< TABLE >
< tr >< td >< b >First Name:< /b >< /td >< td >< %= FirstName % >< /td >< /tr >
< tr >< td >< b >Middle Initial:< /b >< /td >< td >< %= MiddleInitial % >< /td >< /tr >
< tr >< td >< b >Last Name:< /b >< /td >< td >< %= LastName % >< /td >< /tr >
< tr >< td >< b >Address:< /b >< /td >< td >< %= Address % >< /td >< /tr >
< tr >< td >< b >City:< /b >< /td >< td >< %= City % >< /td >< /tr >
< tr >< td >< b >State:< /b >< /td >< td >< %= State % >< /td >< /tr >
< tr >< td >< b >Phone N
相关文档:
<%
'日期函数包DataPackage
%>
<script language="javascript">
function IsDateString(Str)
<!--
{
// 校验是否YYYY-MM-DD格式的日期型数据,返回值为True成功,否则返回False
// 如果传递的是空字符串则返回False
// 定义分隔符
var sSplit="-"
var iYearPos=Str.indexOf(sSplit);
if (iYearP ......
Excel导出函数
<%
Sub ExportToExcel
Response.ContentType = "application/vnd.ms-Excel"
Response.AddHeader "Content-Disposition", "attachment;Filename=Results.xls"
Response.Write ......
asp导出EXCEL数字格式及自动适应宽度的问题
下面直接进行代码演示:
<%
If Response.IsClientConnected Then
Response.Flush
Else
Response.End
End If
Set xlApplication = Server.CreateObject("Excel.Application")
xlApplication.Visible = False
xlApplication.Workbooks.Add
Set xlWorksheet = xl ......
<!--#include file="../conn.asp"-->
<%
dim s,sql,filename,fs,myfile,x
Set fs = server.CreateObject("scripting.filesystemobject")
'--假设你想让生成的EXCEL文件做如下的存放
filename = Server.MapPath("users.xls")
'--如果原来的EXCEL文件存在的话删除它
if fs.FileExists(filename) then ......
开发环境:VS2008
WEB服务器:IIS7.0
为何在调试时,可正常显示报表内容,可生成后,运行时,只显示报表框架,并不能正常显示报表内容.
我把浏览器所有限制选项都取消了,还是一样的问题,不知为何.正在寻找答案................... ......