|
/* --------------------------------------------------------------------------------------------------------------------
* AUDIO-GALLERY-SUITE
* --------------------------------------------------------------------------------------------------------------------
* Author: Robin Rizvi
* Email: mail@robinrizvi.info
* Website: http://robinrizvi.info/
* Blog: http://blog.robinrizvi.info/
* Copyright: Copyright © 2012, Robin Rizvi
* License: MIT (http://www.opensource.org/licenses/MIT)
* This attribution (header-comment) should remain intact while using, distributing or modifying the source in any way
* -------------------------------------------------------------------------------------------------------------------
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace audiogallery
{
public partial class login : Form
{
public login()
{
InitializeComponent();
softlogiclink.Links.Add(13, 6, "www.robinrizvi.info");
softlogiclink.Links.Add(21, 9, "www.softlogicui.com");
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Enter)
{
loginbtn_Click(this, null);
return false;
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void loginbtn_Click(object sender, EventArgs e)
{
if (unametxt.Text != string.Empty && pwdtxt.Text != string.Empty)
{
userstatuspic.Visible = false;
loginloadingindicator.Visible = true;
loginloadingindicator.Active = true;
unametxt.Enabled = false;
pwdtxt.Enabled = false;
loginbtn.Enabled = false;
Thread loginthread = new Thread(user.login);
string[] unamepwd = { unametxt.Text, pwdtxt.Text };
loginthread.Start(unamepwd);
while (loginthread.IsAlive) Application.DoEvents();
if (user.isvalid)
{
userstatuspic.Image = Properties.Resources.user_accept;
userstatuspic.Visible = true;
loginloadingindicator.Visible = false;
loginloadingindicator.Active = false;
Application.DoEvents();
Thread.Sleep(2000);
main mainfrm = new main();
this.Hide();
mainfrm.ShowDialog();
this.Close();
}
else
{
userstatuspic.Image = Properties.Resources.user_remove;
unametxt.Enabled = true;
pwdtxt.Enabled = true;
loginbtn.Enabled = true;
userstatuspic.Visible = true;
loginloadingindicator.Visible = false;
loginloadingindicator.Active = false;
}
}
else MessageBox.Show("Please fill in all the fields.");
}
private void softlogiclink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(e.Link.LinkData.ToString());
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Currently working as software developer for
Databorough India - Division of
Fresche Legacy.
Developing for the open-source community and writing articles is my way of thanking the community. I have developed commercial as well as non-commercial/open-source projects for the web and windows as my work and hobby. Just trying very hard so that someday I could contribute a little for this world. I would like to send out my regards to all for your rating and comments because these comments keep me going. Thank you all.
Certifications:
Microsoft Certified Professional (Programming in C#)
Microsoft Certified Professional (Programming in HTML5 with JavaScript and CSS3)