WEB开发网
开发学院WEB开发ASP 使用JScript.NET创建asp.net页面(七) 阅读

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

 2001-08-15 11:05:42 来源:WEB开发网   
核心提示:例子2<%@ WebService Language="JScript" class="Weather"%>import Systemimport System.Web.Servicesclass Weather { WebMethodAttribute functi
例子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"
   }
  }
}


Tags:使用 JScript NET

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接