webservice(自己写的webservice)

来源:互联网 发布:js访问全局变量 编辑:程序博客网 时间:2024/05/22 07:00

[WebMethod]
        public int[] random(int r)
        {
            int[] arr = new int[r];
            for (int i = 0; i < r;i++ )
            {
               arr[i]=ran.Next(0, 101);
            }
            return arr;
        }

  protected void Button1_Click(object sender, EventArgs e)
        {
            WebService1 b = new WebService1();
            int[] r= b.random(3);
            for (int i = 0; i < r.Length;i++ )
            {
                Response.Write(r[i].ToString()+"-");
            }
        }

原创粉丝点击