zoukankan      html  css  js  c++  java
  • 如何引用webservice

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

    /// <summary> /// User_WebService 的摘要说明 /// </summary> [System.Diagnostics.DebuggerStepThrough(), System.ComponentModel.DesignerCategory("code"),

      System.Web.Services.WebServiceBinding(Name = "", Namespace = "")]

    public class User_WebService : user_service.Service {    

    //static string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];    

    //static User_WebService SendService = new User_WebService(User_ServiceURL);

            public User_WebService()             : base()         {

                //设置默认webService的地址

                this.Url = "http://localhost:1102/webservice/Service.asmx";

            }

            public User_WebService(string webUrl)             : base()    

         {

                this.Url = webUrl;

            }

            #region 获取用户                

    public static DataSet s_getUser()        

    {     

                        DataSet ds=new DataSet();            

               string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];  

               User_WebService SendService = new User_WebService(User_ServiceURL);

                ds=SendService.GetUser();            

    return ds;        

    }        

    #endregion    

    public static DataSet s_getZzjg()     {               

      DataSet ds = new DataSet();        

    string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];        

    User_WebService SendService = new User_WebService(User_ServiceURL);        

    ds = SendService.GetZzjg();        

    return ds;     }    

    public static DataSet s_getSb()    

    {            

       DataSet ds = new DataSet();        

    string User_ServiceURL = System.Configuration.ConfigurationManager.AppSettings["User_ServiceURL"];        

    User_WebService SendService = new User_WebService(User_ServiceURL);        

    ds = SendService.GetSb();        

    return ds;     }

    }

  • 相关阅读:
    .NET简谈互操作(七:数据封送之介绍)
    C# utf8编码时转换成shiftjis时出现乱码问题的处理
    .NET简谈特性(代码属性)
    著名Channel 9 主持人Robert Green 采访微软一站式示例代码库录像
    SharePoint 2007运行 Edit In DataSheet 时在IE 6下页面卡死的分析和处理方法
    截图工具
    Resharper上手指南
    .NET简谈互操作(三:基础知识之DllImport特性)
    .NET简谈互操作(五:基础知识之提升平台调用性能)
    深度训练(DotNet专场)
  • 原文地址:https://www.cnblogs.com/hbhzz/p/2939700.html
Copyright © 2011-2022 走看看