|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。字符串用两种分歧的办法来务实现数字字符串的最年夜,最小战争均值
<%@LANGUAGE="VBScript"
ENABLESESSIONSTATE=False%>
<%
1.Selectingthenumbersfromastring:
myString="2,4,6,8,10,12"
aValues=Split(myString,",",-1,1)</P><P>FunctionMin(someNumbers)
dblLowestSoFar=Null
ForI=LBound(someNumbers)toUBound(someNumbers)
IfIsNumeric(someNumbers(I))Then
IfCDbl(someNumbers(I))<dblLowestSoFarOrIsNull(dblLowestSoFar)Then
dblLowestSoFar=CDbl(someNumbers(I))
EndIf
EndIf
Next
Min=dblLowestSoFar
EndFunction</P><P>FunctionMax(someNumbers)
dblHighestSoFar=Null
ForI=LBound(someNumbers)toUBound(someNumbers)
IfIsNumeric(someNumbers(I))Then
IfCDbl(someNumbers(I))>dblHighestSoFarOrIsNull(dblHighestSoFar)Then
dblHighestSoFar=CDbl(someNumbers(I))
EndIf
EndIf
Next
Max=dblHighestSoFar
EndFunction</P><P>FunctionAvg(someNumbers)
dblHighestSoFar=Null
ForI=LBound(someNumbers)toUBound(someNumbers)
IfIsNumeric(someNumbers(I))Then
IfCDbl(someNumbers(I))>dblHighestSoFarOrIsNull(dblHighestSoFar)Then
dblHighestSoFar=CDbl(someNumbers(I))+CDbl(someNumbers(I))/
EndIf
EndIf
Next
Avg=dblHighestSoFar
EndFunction</P><P>2.Or,selectingthenumbersfromadatabase:
SetcnDZ=Server.CreateObject("ADODB.Connection")
cnDZ.Open"DSN=myDatabase"
SetrsLo=cnDZ.Execute("SELECTMin(PRICE)ASloPRICEFROMTBLADS")
SetrsHi=cnDZ.Execute("SELECTMax(PRICE)AShiPRICEFROMTBLADS")
SetrsAvg=cnDZ.Execute("SELECTAvg(PRICE)ASavgPRICEFROMTBLADS")
%>
<html>
<body>
1.Selectingthenumbersfromastring:<br>
Thelowestnumberis:<%=Min(aValues)%><br>
Thehighestnumberis:<%=Max(aValues)%><br>
Theaveragenumberis:<%=Avg(aValues)%><br>
<br>
2.Selectingthenumbersfromadatabase:<br>
Thelowestpricedadis:<%=FormatCurrency(Int(rsLo("loPRICE")))%><br>
Thehighestpricedadis:<%=FormatCurrency(Int(rsHi("hiPRICE")))%><br>
Theaveragesellingpriceoftheseadsis:<%=FormatCurrency(Int(rsAvg("avgPRICE")))%>
</body>
</html>
<%
cnDZ.Close
SetcnDZ=Nothing
rsLo.Close
SetrsLo=Nothing
rsHi.Close
SetrsHi=Nothing
rsAvg.Close
SetrsAvg=Nothing
%>
减少客户内IT专业人才缺乏带来的影响。ASP的客户员工利用浏览器进入相关的应用软件,简单易用,无需专业技术支持。 |
|