Create an empty project 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 ("the user name or password you entered is incorrect! ");
}
}
Click the project name and add a new webservie Login. asmx
The code file is as follows:
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 summary.
/// </Summary>
Public class Login: System. Web. Services. WebService
{
WorkFlowWebUI. PortalLogin. FrameworkService loginService = new WorkFlowWebUI. PortalLogin. FrameworkService ();
Public Login ()
{
// CODEGEN: This call is required by the ASP. NET Web service designer.
InitializeComponent ();
}
# Region Component Designer generated code
// Required by the Web Service designer
Private IContainer components = null;
/// <Summary>
/// The designer supports the required methods-do not use the code editor to modify
/// Content of this method.
/// </Summary>
Private void InitializeComponent ()
{
}
/// <Summary>
/// Clear all resources in use.
/// </Summary>
Protected override void Dispose (bool disposing)
{
If (disposing & components! = Null)