01 | <%@ WebService Language= "VBScript" Class = "TempConvert" %> |
04 | Imports System.Web.Services |
06 | Public Class TempConvert : Inherits WebService |
07 | <WebMethod( )> Public Function FahrenheitToCelsius( |
08 | ByVal Fahrenheit As String ) As String |
10 | fahr = trim( replace( Fahrenheit, "," , "." ) ) |
11 | if fahr = "" or IsNumeric(fahr) = false then return "Error" |
12 | return ( ( ( ( fahr ) - 32 ) / 9 ) * 5 ) |
15 | <WebMethod( )> Public Function CelsiusToFahrenheit( |
16 | ByVal Celsius As String ) As String |
18 | cel = trim( replace( Celsius, "," , "." ) ) |
19 | if cel = "" or IsNumeric(cel) = false then return "Error" |
20 | return ( ( ( ( cel ) * 9 ) / 5 ) + 32 ) |
|