Maintain user list with WebServices

xiaoxiao2021-03-06  64

Using system; using system.componentmodel; using system.data; using system.web; using system.web.services;

A summary description of Namespace UserList {///

/// service1. /// [WebService (Namespace = "http://www.ehang.com.cn/webservices/")] public class ehangmember: system.web.services.Webservice {public ehangmember () {// codegen : This call is the initializecomponent () () necessary for the ASP.NET Web service designer.

Private system.timers.timer Timer1;

#Region component designer generated code // Web service designer essential private icontainer components = null; ///

/// designer supports the required method - Do not use the code editor to modify /// The content of the method. /// private () {this.timer1 = new system.timers.timer (); (this.timer1)). BeginInit (); // // Timer1 // this.timer1.Enabled = true; this.timer1.Interval = 10000; this.timer1.Elapsed = new System.Timers.ElapsedEventHandler (this.timer1_Elapsed); ((System.ComponentModel.ISupportInitialize) (this.timer1) .Ndinit ();

///

/// Clean all the resources being used. /// Protected Override Void Dispose (Bool Disposing) {IF (Disposing && Components! = NULL) {Components.dispose ();} #ndregion [webmethod] public void clear ) {Base.application.lock (); base.Application.clear (); base.application .unlock ();

[WebMethod] public string [] getusers () {base.application.lock (); string [] user = new string [base.application.count]; user = base.Application.AllKeys; base.application.unlock (); base.Application.unlock (); Return User;} [WebMethod] public fyz.information.users getuser (string uid) {base.Application.lock (); fyz.information.users userinfo = new fyz.information.users (); userinfo = (Fyz.information. Base.Application.Unlock (); return userinfo;} [webmed] public bool info} {base {base.Application.lock (); fyz.information.users userinfo = new Fyz.information.users (); userinfo.lassttime = datetime.now.tostring (); userinfo.name = uid; base.Application.add (uid, userinfo); base.application.unlock (); return true;} catch {return false;}} [WebMethod] public bool insertUser (FYZ.Information.users UserInfo) {try {base.Application.Lock (); UserInfo.LasstTime = DateTime.Now.ToString (); base.Application.Add (UserInfo .na Me, userinfo; base.application.unlock (); return true;} catch {return false;}} [webmethod] public int online () {return base.application.count;}

Private void Timer1_ELAPSED (Object sender, system.timers.elapsendeventargs e) {base.application.remove ("rm"); for (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-89306.html

New Post(0)