forked from EsaSalmik/IIO13200-OHJELMOINTIKOE
/
F2067_T3.aspx.cs
37 lines (34 loc) · 1007 Bytes
/
F2067_T3.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class F2067_T3 : System.Web.UI.Page
{
Koodari_Auth auth;
protected void Page_Load(object sender, EventArgs e)
{
string xml = ConfigurationManager.AppSettings["koodarit"];
auth = new Koodari_Auth(MapPath(xml));
}
protected void LoginButton_Click(object sender, EventArgs e)
{
try
{
if (auth.authenticate(LoginUser.UserName, LoginUser.Password)){
FormsAuthentication.RedirectFromLoginPage(LoginUser.UserName, false);
}
else
{
lblNotes.Text = "Autentikointi epäonnistui";
}
}
catch (Exception ex)
{
lblNotes.Text = "Autentikointipalvelua ei voi käyttää, yritä hetken päästä uudelleen";
}
}
}