numericupdown.cs

来自「一个包含AJAX所有功能的示例网站以及源代码,非常好学习!」· CS 代码 · 共 32 行

CS
32
字号
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


using System;
using System.Web.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class NumericUpDown : WebService
{
    public NumericUpDown()
    {
        // Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public int NextValue(int current, string tag)
    {
        return new Random().Next(Math.Min(1000, Math.Max(0, current)), 1001);
    }

    [WebMethod]
    public int PrevValue(int current, string tag)
    {
        return new Random().Next(0, Math.Min(1000, Math.Max(0, current)));
    }
}

⌨️ 快捷键说明

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