59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
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;
|
|
|
|
namespace ResourceTools
|
|
{
|
|
public partial class PerforceAuthFrm : Form
|
|
{
|
|
public PerforceAuthFrm()
|
|
{
|
|
InitializeComponent();
|
|
label_Info.Text = String.Empty;
|
|
|
|
textBox_Server.Text = ResourceTools.p4Cfg.Port;
|
|
textBox_Login.Text = ResourceTools.p4Cfg.User;
|
|
textBox_Password.Text = ResourceTools.p4Cfg.Password;
|
|
textBox_Client.Text = ResourceTools.p4Cfg.Client;
|
|
|
|
}
|
|
|
|
private void button_OK_Click(object sender, EventArgs e)
|
|
{
|
|
ResourceTools.p4.Disconnect();
|
|
ResourceTools.p4.Port = textBox_Server.Text;
|
|
ResourceTools.p4.User = textBox_Login.Text;
|
|
ResourceTools.p4.Password = textBox_Password.Text;
|
|
ResourceTools.p4Cfg.Password = textBox_Password.Text;
|
|
ResourceTools.p4.Client = textBox_Client.Text;
|
|
ResourceTools.p4.Connect();
|
|
|
|
try
|
|
{
|
|
ResourceTools.p4.Login(textBox_Password.Text);
|
|
if (!PerforceUtils.ClientIsValid(ResourceTools.p4))
|
|
{
|
|
label_Info.Text = "Wrong client.";
|
|
return;
|
|
}
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
label_Info.Text = "Wrong login or password.";
|
|
return;
|
|
}
|
|
this.DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
private void PerforceAuthFrm_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|