Created
December 28, 2016 10:23
-
-
Save isdaviddong/a54d438a56f99844a05b70178722f52d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class _default : System.Web.UI.Page | |
{ | |
/// <summary> | |
/// 計算BMI | |
/// </summary> | |
/// <param name="height">身高</param> | |
/// <param name="weight">體重</param> | |
/// <returns></returns> | |
[System.Web.Services.WebMethod(enableSession: true)] | |
public static PageMethodDefaultResult<float> BMI(float height, float weight) | |
{ | |
height = (height) / 100; | |
var bmi = weight / (height * height); | |
var result = new PageMethodDefaultResult<float>() | |
{ | |
Data = bmi, | |
isSuccess = true | |
}; | |
return result; | |
} | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment