⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 service.cs

📁 Visual C#2005程序设计教程
💻 CS
字号:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
    public Service () {

        //如果使用设计的组件,请取消注释以下行 
        //InitializeComponent(); 
    }

    
    [WebMethod]
    public double fSin(double a)		//计算正弦函数的方法
    {
        a = a*3.1415926 / 180;      //将用户输入的角度值转换为弧度值
        return Math.Round(Math.Sin(a),4);  //返回保留4位小数的计算结果     
    }
    [WebMethod]
    public double fCos(double a)
    { 
        a = a*3.1415926 / 180;
        return Math.Round(Math.Cos(a),4); 
    }
    [WebMethod]
    public double fTan(double a)
    {
        a = a*3.1415926 / 180;
         
        return Math.Round(Math.Tan(a),4);
    }
    [WebMethod]
    public double fCTan(double a)
    {
        a = a*3.1415926 / 180;
        return Math.Round(1/Math.Tan(a),4);
        
    }


    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -