Click here to Skip to main content
15,906,335 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
C#

I created login window application and its working successfully .
but i want add one thing in my application , i want to block all access when i run this program . it can not be minimize and maximize login window , it can not be access all drives and data, please help me out this question

my current program is

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;
using System.Data.SqlClient;
namespace Lab_monitoring_system
{
    public partial class loginwnd : Form
    {
        public loginwnd()
        {
            InitializeComponent();
           
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            Form2 ss = new Form2();
            ss.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.timer1.Start();
            SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\NaNo\Documents\nan.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
            SqlDataAdapter sda = new SqlDataAdapter("select count(*) from  registration where name ='" + textBox1.Text + "' and password= '" + textBox2.Text + "'", con);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                wlcm ww = new wlcm(textBox1.Text);
                ww.Show();
            }
            else
            {
                MessageBox.Show("please check your user id or password");
            }
           
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            forgotps ff = new forgotps();
            ff.Show();
            
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            this.progressBar1.Increment(1);
        }
    }
}
Posted
Updated 20-Dec-15 11:04am
v3
Comments
BillWoodruff 20-Dec-15 14:06pm    
If you need to completely block all access to the entire computer while your program handles a log-in ... you better start by describing what stack you are using: ASP.NET ? Win Forms ? ... or ?

Then describe the interaction between user and computer you wish to control: does the user boot the computer and your program is an auto-run ? ... or ?

We can't read your mind.
Dnyanu.shinde 20-Dec-15 16:51pm    
when i run login window form ,then all basic shortcut keys should be diable
Dnyanu.shinde 20-Dec-15 16:54pm    
its window form
Dnyanu.shinde 20-Dec-15 16:54pm    
created in C#
Sergey Alexandrovich Kryukov 20-Dec-15 15:02pm    
Why? Why?!
—SA

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