Hello guys Im newbie and my english is bad pls help me guys
using System.Data;
using System.Drawing;
using System.Diagnostics;
using Microsoft.VisualBasic;
using AxCrystal;
using Microsoft.VisualBasic.Compatibility;
using System;
using System.Collections;
using System.Windows.Forms;
namespace Huvtsas
{
partial class frmLogin : System.Windows.Forms.Form
{
#region Default Instance
public static frmLogin Default
{
get
{
if (defaultInstance == null)
{
defaultInstance = new frmLogin();
defaultInstance.FormClosed += new FormClosedEventHandler(defaultInstance_FormClosed);
}
return defaultInstance;
}
}
static void defaultInstance_FormClosed(object sender, FormClosedEventArgs e)
{
defaultInstance = null;
}
#endregion
public void Command1_Click(System.Object eventSender, System.EventArgs eventArgs)
{
short Index = Command1.GetIndex(eventSender);
switch (Index)
{
case 0:
login();
break;
case 1:
this.Close();
break;
}
}
public void frmLogin_KeyPress(System.Object eventSender, System.Windows.Forms.KeyPressEventArgs eventArgs)
{
short KeyAscii = (short) (Strings.Asc(eventArgs.KeyChar));
if (KeyAscii == 27)
{
this.Close();
}
eventArgs.KeyChar = Strings.Chr(KeyAscii);
if (KeyAscii == 0)
{
eventArgs.Handled = true;
}
}
public void frmLogin_Load(System.Object eventSender, System.EventArgs eventArgs)
{
Text1[0].Text = Interaction.GetSetting("GAMAS", "Settings", "Userh", "");
}
public void Text1_KeyPress(System.Object eventSender, System.Windows.Forms.KeyPressEventArgs eventArgs)
{
short KeyAscii = (short) (Strings.Asc(eventArgs.KeyChar));
short Index = Text1.GetIndex(eventSender);
if (KeyAscii == 13)
{
switch (Index)
{
case 0:
Text1[1].Focus();
break;
case 1:
login();
break;
}
}
eventArgs.KeyChar = Strings.Chr(KeyAscii);
if (KeyAscii == 0)
{
eventArgs.Handled = true;
}
}
private object login()
{
try
{
this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
RDO.rdoResultset rs_login;
modFormat.SQL = "exec free_sp_login \'" + modFormat.l_str((string) (Text1[0].Text)) + "\',\'" + modFormat.l_str((string) (Text1[1].Text)) + "\'";
rs_login = modFormat.cn.OpenResultset(modFormat.SQL, 1, null, null);
this.Cursor = System.Windows.Forms.Cursors.Default;
if (rs_login[0].Value == "0")
{
Interaction.MsgBox("Òà íýâòðýõ ýðõãvé.", MsgBoxStyle.Information, Text);
}
else
{
Interaction.SaveSetting("GAMAS", "Settings", "Userh", (string) (Text1[0].Text));
modFormat.USERID = (string) (rs_login[0].Value);
frmMain.Default.Show();
this.Close();
}
}
catch
{
this.Cursor = System.Windows.Forms.Cursors.Default;
Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.Critical, Text);
}
}
public void Timer1_Tick(System.Object eventSender, System.EventArgs eventArgs)
{
Timer1.Enabled = false;
if (Strings.Trim((string) (Text1[0].Text)) != "")
{
Text1[1].Focus();
}
}
}
}
i converted to visual basic 6. to visual studio 2010
this is my login form
and i still dont understand this pls help
and little reinstatement pls guys