<%@ WebService Language="VBScript" Class="TempConvert" %>
Imports System
Imports System.Web.Services
Public Class TempConvert :Inherits WebService
<WebMethod( )> Public Function FahrenheitToCelsius(
ByVal Fahrenheit As String ) As String
dim fahr
fahr = trim( replace( Fahrenheit, "," , "." ) )
if fahr = "" or IsNumeric(fahr) = false then return "Error"
return ( ( ( ( fahr ) - 32 ) / 9 ) * 5 )
end Function
<WebMethod( )> Public Function CelsiusToFahrenheit(
ByVal Celsius As String ) As String
dim cel
cel = trim( replace( Celsius, ",", "." ) )
if cel = "" or IsNumeric(cel) = false then return "Error"
return ( ( ( ( cel ) * 9 ) / 5 ) + 32 )
end Function
end Class
|