The use of multi-system webservice solve problems landing

  First a new space projects project1 

  Add a WebForm1 

  Write the following code 

  Private void Page_Load (object sender, System.EventArgs e) 
  ( 
  If (Session [ "UserID"]! = Null) 
  ( 
  This.Response.Write (Session [ "UserName"]. ToString ()); 
  ) 
  Else 
  ( 
  This.Response.Write ( "Your input is the user name or password is not correct!"); 
  ) 
  ) 

  In the project name, in turn, keys, to add a new webservie Login.asmx 

  Code the following documents 

  Using System; 
  Using System.Collections; 
  Using System.ComponentModel; 
  Using System.Data; 
  Using System.Diagnostics; 
  Using System.Web; 
  Using System.Web.Services; 

  Namespace WorkFlow 
  ( 
  / / / <summary> 
  / / / Login explanatory memorandum. 
  / / / </ Summary> 
  Public class Login: System.Web.Services.WebService 
  ( 
  WorkFlowWebUI.PortalLogin.FrameworkService loginService = new WorkFlowWebUI.PortalLogin.FrameworkService (); 
  Public Login () 
  ( 
  / / CODEGEN: The ASP.NET Web service call is necessary for the design 
  InitializeComponent (); 
  ) 

  # Region Component Designer generated code 

  / / Web design services necessary for the 
  Private IContainer components = null; 

  / / / <summary> 
  / / / Designer support of the approach - Do not use the code editor Laws 
  / / / The contents of this method. 
  / / / </ Summary> 
  Private void InitializeComponent () 
  ( 
  ) 

  / / / <summary> 
  / / / Cleaning is the use of all the resources. 
  / / / </ Summary> 
  Protected override void Dispose (bool disposing) 
  ( 
  If (disposing & components! = Null) 
  ( 
  Components.Dispose (); 
  ) 
  Base.Dispose (disposing); 
  ) 
  # Endregion 

  [WebMethod (EnableSession = true)] 
  Public bool LoginMethod (string userName, string password) 
  ( 
  If (userName == "admin" & password == "admin") 
  ( 
  Session [ "userName"] = "admin" 

  Return true; 

  ) 

  Return false; 
  ) 
  )) 

  Then construct a new web project, WebProject1 

  Add Login invoke the web, and webForm1 Calling LoginMethod, if the return value for the true project1 redirected to the WebForm1.aspx 

  Necessary to pay attention to two points here 

  1: webService inside of the need to join the (EnableSession = true) Description 

  Second: If you are now some web project which will not allow you to add a new webservice, this time you have to establish a position in the other webservie document, and then you add the item inside this will be the existing document. 

  Write well, please forgive 

Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Tags:

Releated Articles


0 Comments to “The use of multi-system webservice solve problems landing”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.