当前位置:开发者网络 >> 技术教程 >> .NET教程 >> Asp.Net开发 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
使用JScript.NET创建asp.net页面(七)
作者:未知
日期:2003-07-12
人气:
投稿:Andy.m(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:
例子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"
      }
   }
}
相关文章: