|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SvnShelve.Model;
namespace SvnShelve.Forms
{
public partial class LoginForm : Form
{
public LoginForm()
{
InitializeComponent();
}
private void _cancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void _ok_Click(object sender, EventArgs e)
{
try
{
if (_userName.Text.Trim().Length == 0 || _password.Text.Trim().Length == 0)
{
throw new Exception("Invalid format for user name or password");
}
SVN.UserName = _userName.Text.Trim();
SVN.Password = _password.Text.Trim();
Properties.Settings.Default.Save();
this.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoginForm_Load(object sender, EventArgs e)
{
_userName.Text = SVN.UserName;
_password.Text = SVN.Password;
}
}
}
|
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.
writing code for the past 20 years, and now decided to share some thoughts.
Also known as Oleg Vorkunov.