${res:Templates.Project.WebService.Name}
C#
ASP.NET
C#.Project.Form
${res:Templates.Project.WebService.Description}
Library
Properties
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
bin\
bin\
/// Logs into the web service
///
/// The User Name to login in as
/// User's password
/// True on successful login.
[WebMethod(EnableSession=true)]
public bool Login(string userName, string password)
{
//NOTE: There are better ways of doing authentication. This is just illustrates Session usage.
UserName = userName;
return true;
}
///
/// Logs out of the Session.
///
[WebMethod(EnableSession=true)]
public void Logout()
{
Context.Session.Abandon();
}
///
/// UserName of the logged in user.
///
private string UserName {
get {return (string)Context.Session["User"];}
set {Context.Session["User"] = value;}
}
}
}
]]>
]]>
]]>