·建站首页 ·钻石 ·繁體
您的位置: 中国建站之家 -> 网站开发设计 -> .Net教程 -> 使用JScript.NET创建asp.net页面(七)

使用JScript.NET创建asp.net页面(七)

作者:佚名  来源:转载  发布时间:2005-7-18 15:01:34  发布人:acx


例子2
<%@ WebService Language="Jscript" class="Weather"%>
import System
import System.Web.Services
class Weather {
WebMethodAttribute function getConditions(strCity : String) : String
{
var now = new Date();
switch (strCity.toUpperCase())
{
case "LONDON":
if (now.getMonth() <= 7||now.getMonth() >=9)
{
return "overcast"
}
if
{
return "partly overcast"
}
break;
case "SEATTLE":
if (now.getMonth() == 7 && now.getDay()==4)
{
return "torrential rain"
}
else
{
return "rain"
}
break;
case "LA":
return "smoggy"
break;
case "PHOENIX":
return "damn hot"
break;
default:
return "partly cloudy with a chance of showers"
}
}
}

将本文收藏到QQ书签与更多好友分享