Click here to Skip to main content
15,941,071 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello guys Im newbie and my english is bad pls help me guys


C#
using System.Data;
using System.Drawing;
//using AxLVbuttons;
    using System.Diagnostics;
//using AxMSComCtl2;
    using Microsoft.VisualBasic;
using AxCrystal;
using Microsoft.VisualBasic.Compatibility;
using System;
using System.Collections;
//using AxMSFlexGridLib;
    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
Posted
Comments
El_Codero 5-Mar-12 4:00am    
Hi, sorry but what exactly do you not understand? What "your" code does?
OwlMusya 5-Mar-12 4:08am    
its login form and its loading datatable in username password
OriginalGriff 5-Mar-12 4:00am    
What bit do you not understand?
We can't give you a line-by-line explanation:
Do you have any idea how much work explaining code line by line is?
Every single line needs a paragraph of explanation! For example:
int next = r.Next();
Create a new variable called "next" which can hold a integer value. From the previously declared Random instance "r", call the "Next" method to get a new random number, and assign it to the "next" variable.

Can you imagine how long it would take us to explain even a very short code fragment, line by line?
OwlMusya 5-Mar-12 4:04am    
im sorry for asking help tnx
OriginalGriff 5-Mar-12 4:23am    
It's fine to ask for help, but you have to focus it a bit so that we can actually do something useful.
Just asking for an explanation of an entire class file isn't a useful question - the response would have to be ten or so times longer than the code, and would take far, far to long to write.
Instead, ask us about the bits you don't understand - we can probably help with that!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900