当前位置:首页 > 网络编程 > WEB编程 > ASP > 使用JScript.NET创建asp.net页面(七)

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

点击次数:27 次 发布日期:2008-11-26 17:38:49 作者:源代码网
源代码网推荐 例子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"
      }
   }<



源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华