Saturday, 5 October 2013

Code for validation c#

Code for validation c#


private void txtP_Fname_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar == '\b'))
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }
        }

c# Code for retrive data from database

c# Code for retrive data from database


private void txtEID_Leave(object sender, EventArgs e)
        {
            DialogResult resp;
          
            string mailID, str = null, domain = null;
            int j = 0;
            if (txtEID.Text == "")
            {
 MessageBox.Show("Some of the required fields are left blank please fill them first!\nCODE ", "CHEMINOVA");
              txtEID.Focus();
            }
            else
            {
                SqlCommand mycmd = new SqlCommand();
 string cmd = "select * from EMP_PERS WHERE EMP_CODE='" + txtEID.Text+ "'
                mycmd.CommandText = cmd;
                DataSet ds1 = new DataSet();
                mycon = new SqlConnection(dh.Properties.Settings.Default.CheminovaConnectionString.ToString());
                mycmd.Connection = mycon;
                try
                {
                    myad.SelectCommand = mycmd;
                    mycon.Open();
                    myad.Fill(ds1, "EMP_PERS");
                    mycon.Close();

                    if (ds1.Tables["EMP_PERS"].Rows.Count <= 0)
                    {

                        getempdetails();
                      
                    }
                    else
                    {
                        for (int i = 0; i < ds1.Tables["EMP_PERS"].Rows.Count; i++)
                        {

                            if (txtEID.Text == ds1.Tables["EMP_PERS"].Rows[i]["EMP_CODE"].ToString
 {
                                this.txtEID.Text = ds1.Tables["EMP_PERS"].Rows[i]["EMP_CODE"].ToString();
                                //
                                this.txt_Fname.Text = ds1.Tables["EMP_PERS"].Rows[i]["EMP_FNAME"].ToString();
                                this.txt_Mname.Text = ds1.Tables["EMP_PERS"].Rows[i]["EMP_MNAME"].ToString();
                                this.txt_Lname.Text = ds1.Tables["EMP_PERS"].Rows[i]["EMP_LNAME"].ToString();
                                this.txtDOB.Text = ds1.Tables["EMP_PERS"].Rows[i]["D_O_B"].ToString();
                                this.txtP_Add.Text = ds1.Tables["EMP_PERS"].Rows[i]["PRE_ADDR"].ToString();
                                this.txtP_City.Text = ds1.Tables["EMP_PERS"].Rows[i]["PRE_CITY"].ToString();
                                this.txtP_State.Text = ds1.Tables["EMP_PERS"].Rows[i]["PRE_STATE"].ToString();
                                this.txtP_PerAdd.Text = ds1.Tables["EMP_PERS"].Rows[i]["PER_ADDR"].ToString();
                                this.txtP_PerCity.Text = ds1.Tables["EMP_PERS"].Rows[i]["PER_CITY"].ToString();
                                this.txtP_PerState.Text = ds1.Tables["EMP_PERS"].Rows[i]["PER_STATE"].ToString();
                                this.lblP_Age.Text = ds1.Tables["EMP_PERS"].Rows[i]["AGE"].ToString();

                                this.cmbMst.Text = ds1.Tables["EMP_PERS"].Rows[i]["MARITAL_STATUS"].ToString();
                                this.txtP_Phr.Text = ds1.Tables["EMP_PERS"].Rows[i]["CONTACT_R"].ToString();
                                this.txtP_Phm.Text = ds1.Tables["EMP_PERS"].Rows[i]["CONTACT_M"].ToString();
                                this.cmbGender.Text = ds1.Tables["EMP_PERS"].Rows[i]["GENDER"].ToString();
                                this.txtP_PExpr.Text = ds1.Tables["EMP_PERS"].Rows[i]["PRE_EXPR"].ToString();
                                this.cmbP_Bg.Text = ds1.Tables["EMP_PERS"].Rows[i]["BLOOD_GRP"].ToString();
                                mailID = ds1.Tables["EMP_PERS"].Rows[i]["EMAIL_ID"].ToString();
                                while (mailID[j] != '@')
                                {
                                    str += mailID[j];
                                    j++;
                                }
                                j++;
                                while (j < mailID.Length)
                                {
                                    domain += mailID[j];
                                    j++;
                                }
                                txtP_Mailid.Text = str;
                                comboBox1.Text = domain;
                            }
                        }
                        resp=MessageBox.Show("The Data already exists.......... Do you want to DELETE or UPDATE the data?", "DATA EXISTS....", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (resp == DialogResult.No)
                        {
                            clearFields();
                        }
                    }
                }
                catch (SqlException sx)
                {
                    MessageBox.Show(sx.Message, "SQL EXCEPTION !");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "OTHER EXCEPTION !");
                }
            }
           }

        private void getempdetails()
        {
            string sel = "select * from RECRUIT_PERSONAL";
            //mycon.ConnectionString = source;
            mycon = new SqlConnection(dh.Properties.Settings.Default.CheminovaConnectionString.ToString());
            SqlCommand select = new SqlCommand(sel, mycon);
            myad.SelectCommand = select;
            DataSet ds1 = new DataSet();
          
try
            {
                mycon.Open();
                myad.Fill(ds1, "RECRUIT_PERSONAL");
                mycon.Close();
            }
            catch (SqlException sx)
            {
                MessageBox.Show(sx.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            int cnt = ds1.Tables["RECRUIT_PERSONAL"].Rows.Count;
            if (cnt > 0 && this.txtEID.Text != "")
            {

                for (int i = 0; i < cnt; i++)
                {
                    if (this.txtEID.Text == ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EMP_CODE"].ToString())
                    {
                        this.txtEID.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EMP_CODE"].ToString();
                        //
                        this.txt_Fname.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EMP_FNAME"].ToString();
                        this.txt_Mname.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EMP_MNAME"].ToString();
                        this.txt_Lname.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EMP_LNAME"].ToString();
                        this.txtDOB.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["D_O_B"].ToString();
                        this.txtP_Add.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["ADD_PRES"].ToString();
                        this.txtP_City.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["CITY_PRES"].ToString();
                        this.txtP_State.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["STATE_PRES"].ToString();
                        this.txtP_PerAdd.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["ADD_PERM"].ToString();
                        this.txtP_PerCity.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["CITY_PERM"].ToString();
                        this.txtP_PerState.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["STATE_PERM"].ToString();
                        //this.txtP_Qual.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EQ_QUALIF"].ToString();
                        //this.txtP_DO.Text = ds.Tables["EMP_PERS"].Rows[i]["D_0_B"].ToString();
                        this.lblP_Age.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["AGE"].ToString();

                        this.cmbMst.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["MARITAL_STATUS"].ToString();
                        this.txtP_Phr.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["PH_PRES"].ToString();
                        this.txtP_Phm.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["PH_PERM"].ToString();
                        this.cmbGender.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["GENDER"].ToString();
                        this.txtP_PExpr.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["EX_PERIOD"].ToString();
                        this.cmbP_Bg.Text = ds1.Tables["RECRUIT_PERSONAL"].Rows[i]["BLOOD_GRP"].ToString();

                        MessageBox.Show("THE CODE ALREADY EXISTS........YOU CAN EITHER DELETE OR UPDATE");
                    }
                }
            }
            mycon.Close();
        }

c# Simple SQL queries (insert

c# Simple SQL queries (insert


private void btnSave_Click(object sender, EventArgs e)
        {
 myad.InsertCommand = new SqlCommand("INSERT INTO EMP_PERS" +
                "(EMP_CODE,EMP_FNAME,EMP_MNAME,EMP_LNAME,PRE_ADDR,PRE_CITY,PRE_STATE,PER_ADDR,PER_CITY,PER_STATE,QUALIFICATION,D_O_B,AGE,MARITAL_STATUS,CONTACT_R,CONTACT_M,GENDER,PRE_EXPR,BLOOD_GRP,EMAIL_ID) VALUES" +
                "(@EMP_CODE,@EMP_FNAME,@EMP_MNAME,@EMP_LNAME,@PRE_ADDR,@PRE_CITY,@PRE_STATE,@PER_ADDR,@PER_CITY,@PER_STATE,@QUALIFICATION,@D_O_B,@AGE,@MARITAL_STATUS,@CONTACT_R,@CONTACT_M,@GENDER,@PRE_EXPR,@BLOOD_GRP,@EMAIL_ID)", mycon);

            SqlParameter myparm = null;

 myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@EMP_CODE", SqlDbType.NVarChar));
            myparm.SourceColumn = "EMP_CODE";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@EMP_FNAME", SqlDbType.NVarChar));
            myparm.SourceColumn = "EMP_FNAME";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@EMP_MNAME", SqlDbType.NVarChar));
            myparm.SourceColumn = "EMP_MNAME";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@EMP_LNAME", SqlDbType.NVarChar));
            myparm.SourceColumn = "EMP_LNAME";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PRE_ADDR", SqlDbType.NVarChar));
            myparm.SourceColumn = "PRE_ADDR";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PRE_CITY", SqlDbType.NVarChar));
            myparm.SourceColumn = "PRE_CITY";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PRE_STATE", SqlDbType.NVarChar));
            myparm.SourceColumn = "PRE_STATE";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PER_ADDR", SqlDbType.NVarChar));
            myparm.SourceColumn = "PER_ADDR";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PER_CITY", SqlDbType.NVarChar));
            myparm.SourceColumn = "PER_CITY";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PER_STATE", SqlDbType.NVarChar));
            myparm.SourceColumn = "PER_STATE";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@QUALIFICATION", SqlDbType.NVarChar));
            myparm.SourceColumn = "QUALIFICATION";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@D_O_B", SqlDbType.DateTime));
            myparm.SourceColumn = "D_O_B";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@AGE", SqlDbType.Int));
            myparm.SourceColumn = "AGE";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@MARITAL_STATUS", SqlDbType.NVarChar));
            myparm.SourceColumn = "MARITAL_STATUS";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@CONTACT_R", SqlDbType.Int));
            myparm.SourceColumn = "CONTACT_R";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@CONTACT_M", SqlDbType.Int));
            myparm.SourceColumn = "CONTACT_M";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@GENDER", SqlDbType.NVarChar));
            myparm.SourceColumn = "GENDER";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@PRE_EXPR", SqlDbType.Int));
            myparm.SourceColumn = "PRE_EXPR";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@BLOOD_GRP", SqlDbType.NVarChar));
            myparm.SourceColumn = "BLOOD_GRP";
            myparm.SourceVersion = DataRowVersion.Current;

            myparm = myad.InsertCommand.Parameters.Add(new SqlParameter("@EMAIL_ID", SqlDbType.NVarChar));
            myparm.SourceColumn = "EMAIL_ID";
            myparm.SourceVersion = DataRowVersion.Current;

            DataSet myDS = new DataSet();
            myad.SelectCommand = new SqlCommand("select * from EMP_PERS",mycon);
            myad.Fill(myDS, "EMP_PERS");

            DataRow newRow = myDS.Tables["EMP_PERS"].NewRow();

            newRow[0] = this.txtEID.Text;
            newRow[1] = this.txt_Fname.Text;
            newRow[2] = this.txt_Mname.Text;
            newRow[3] = this.txt_Lname.Text;
            newRow[4] = this.txtP_Add.Text;
            newRow[5] = this.txtP_City.Text;
            newRow[6] = this.txtP_State.Text;
            newRow[7] = this.txtP_PerAdd.Text;
            newRow[8] = this.txtP_PerCity.Text;
            newRow[9] = this.txtP_PerState.Text;
            newRow[10] = "";
            try
            {
                        newRow[11] = this.txtDOB.Text;
            }
            catch (SqlException sx2)
            {
                MessageBox.Show(sx2.Message, "SQL EXCEPTION OF DATE !");
            }
            catch (Exception ex1)
            {
                MessageBox.Show(ex1.Message, "OTHER EXCEPTION OF DATE !");
            }
            newRow[12] = int.Parse(this.lblP_Age.Text);//age;//this.txtp_age;
            newRow[13] = this.cmbMst.Text;
            newRow[14] = int.Parse(this.txtP_Phr.Text);
            newRow[15] = int.Parse(this.txtP_Phm.Text);
            newRow[16] = this.cmbGender.Text;
            newRow[17] = int.Parse(this.txtP_PExpr.Text);
            newRow[18] = this.cmbP_Bg.Text;
            newRow[19] = this.txtP_Mailid.Text + "@" + comboBox1.Text;
            try
            {
                myDS.Tables["EMP_PERS"].Rows.Add(newRow);
            }
            catch (SqlAlreadyFilledException sx)
            {
                MessageBox.Show(sx.Message, "SQL ERROR ALREADY FILLED!");
            }
            catch (SqlException sx1)
            {
                MessageBox.Show(sx1.Message, "SQL EXCEPTION ON INSERT !");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "INSERT ERROR ON INSERT !!");
            }
            finally
            {
                myad.Update(myDS, "EMP_PERS");
                MessageBox.Show("NEW DATA IS INSERTED !!", "INSERT COMMAND");
            }
            clearFields();
        }

        private void clearFields()
        {
            this.txtEID.Text = "";
        }

c# Code for delete data from database

c# Code for delete data from database


Print the report using the custom print controller in vb.net

Print the report using the custom print controller in vb.net


Public Function GetPapersizeID(ByValPrinterNameAsString,ByValPaperSizeNameAsString)AsInteger
Dim doctoprint As New System.Drawing.Printing.PrintDocument()
Dim PaperSizeID As Integer=0
Dim ppname As String=""
Dim s As String=""
doctoprint.PrinterSettings.PrinterName=PrinterName'(ex."EpsonSQ-1170ESC/P2")
For i As Integer=0 To doctoprint.PrinterSettings.PaperSizes.Count-1
Dim raw Kind As Integer
ppname=PaperSizeName
If doctoprint.PrinterSettings.PaperSizes(i).PaperName=ppnameThen
rawKind=CInt(doctoprint.PrinterSettings.PaperSizes(i).GetType().GetField("kind",
Reflection.BindingFlags.InstanceOrReflection.BindingFlags.NonPublic).GetValue(doctoprint.PrinterSettings.PaperSizes(i)))
PaperSizeID=rawKind
ExitFor
EndIf
Next
Return PaperSizeID
End Function

Dim repOptions As CrystalDecisions.CrystalReports.Engine.PrintOptions
With ReportDocument
repOptions=.PrintOptions
.Load(ReportPath,CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
.SetDataSource(ds.Tables(0))
With rep Options
.PaperOrientation= CrystalDecision.Shared.PaperOrientation.Portrait
.PaperSize= GetPapersizeID("EPSON LX-300+II", "CEPCRP")
.PrinterName= "EPSON LX-300+II"
End With
.Refresh()
.PrintToPrinter(NumberOFCopies,Collated,StartPage,EndPage)
End With

key generation code in vb.net

key generation code in vb.net


Public Class key_gen
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dd As Long = (Today.Date.Day)
Dim mm As Long = (Today.Date.Month)
Dim yy As Long = (Today.Date.Year)
Dim key1 As String
key1 = CStr(((yy - dd) * 4 - mm * dd * 4 + 50 + dd * 23) Mod 99999) + "-" + CStr(((dd Mod 6) * 8 * (yy - dd - mm - 1000)) Mod 99999) + "-" + CStr((yy * 7 - 1234 - dd * 12 + (mm * 20 * yy)) Mod 99999) + "-" + CStr(((mm * dd * 541) - yy - 1234 + (((yy - dd) * 3) - mm * 13)) Mod 99999)
TextBox1.Text = key1
End Sub
End Class

How To Remove and Add Right-Click Menu Items from Files and Folders

How To Remove and Add Right-Click Menu Items from Files and Folders


A lot of programs you install will add themselves to the right-click menu of your files and/or folders. And most times, you have no choice in the matter and, as a result, your right-click menu can get very long with added items you don't even use. The last person I was helping with this had a right context menu so long that the Rename option was no longer visible!
Fortunately, you can easily remove those unwanted menu items, if you know the registry values to edit. And it's not at all difficult once you know the keys responsible for the additions.

For Files, the secret lies in the "context menu handlers" under the shellex subkey for "All Files" which, in the registry, is nothing but an asterisk - like a dos wildcard, which means the values entered apply to all files. It is at the very top of the Root key, right here:

HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers

Click the the + sign next to the ContextMenuHandlers key, to expand it.
Now you will see some of the programs that have added items to your right-click menu. Simply delete the program keys you don't want.
Yup! It's that simple. If deleting makes you uneasy, just export the key before deleting it. Or, instead of deleting the values, disable them. Simply double click the default value for the program on the right hand pane and rename the clsid value by placing a period or dash in front of it.
ie; - {b5eedee0-c06e-11cf-8c56-444553540000}
Then exit the registry, refresh, and right click a file to see if the item was removed from the menu.
Some programs - like WinZip or WinRar - will add several items to your right click menu but all of them will be removed by deleting or disabling their one context menu handler.

Note that the above key only applies to the right click menu of files.
To remove entries from the right click context menu of folders, you need to navigate to the Folder and Drive keys:

HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers
HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers


All you have to do is follow the same procedure as for Files - either disable or delete items you wish to remove.
Adding Items
Adding Items to the right click menu of Files and Folders is also fairly simple using the Registry. It just involves the creation of a few new keys for each item you wish to add. You edit the same keys used for removing items. Let's use Notepad as an example of an item you'd like to add to the right click menu of all your files or folders.

For folders, go to this key:
HKEY_CLASSES_ROOT\Folder
Click the + sign next to Folder and expand it so that the Shell key is visible. Right click the Shell key and choose New>Key and name the key Notepad or whatever else you'd prefer (whatever the key is named is what will appear in the right-click menu). Now right click the new key you made and create another key named Command. Then, in the right hand pane, double click "Default" and enter Notepad.exe as the value.
Exit the registry, refresh, and right click any folder. Notepad should now be on the context menu.


For files, go here again:

HKEY_CLASSES_ROOT\*
Expand the * key and see if a Shell key exists. If it does exist, follow the same procedure as for folders. If it does not exist, you'll have to create a new Shell first. Just right click the * key and choose New>Key and name it Shell. Then right click the Shell key and continue on the same way you did for adding items to the right click menu of folders.
Once done, Notepad should appear as an option in the right click menu of all your files

How to hack Windows XP Admin Passwords the easy way

How to hack Windows XP Admin Passwords the easy way


This hack will only work if the person that owns the machine
has no intelligence. This is how it works:
When you or anyone installs Windows XP for the first time your
asked to put in your username and up to five others.
Now, unknownst to a lot of other people this is the only place in
Windows XP that you can password the default Administrator Diagnostic
Account. This means that to by pass most administrators accounts
on Windows XP all you have to do is boot to safe mode by pressing F8
during boot up and choosing it. Log into the Administrator Account
and create your own or change the password on the current Account.
This only works if the user on setup specified a password for the
Administrator Account.

This has worked for me on both Windows XP Home and Pro.
-----------------------------------------------------------------------------
Now this one seems to be machine dependant, it works randomly(don't know why)

If you log into a limited account on your target machine and open up a dos prompt
then enter this set of commands Exactly:
(this appeared on www.astalavista.com a few days ago but i found that it wouldn't work
on the welcome screen of a normal booted machine)
-----------------------------------------------------------------------------
cd\ *drops to root
cd\windows\system32 *directs to the system32 dir
mkdir temphack *creates the folder temphack
copy logon.scr temphack\logon.scr *backsup logon.scr
copy cmd.exe temphack\cmd.exe *backsup cmd.exe
del logon.scr *deletes original logon.scr
rename cmd.exe logon.scr *renames cmd.exe to logon.scr
exit *quits dos
-----------------------------------------------------------------------------
Now what you have just done is told the computer to backup the command program
and the screen saver file, then edits the settings so when the machine boots the
screen saver you will get an unprotected dos prompt with out logging into XP.
Once this happens if you enter this command minus the quotes
"net user password"
If the Administrator Account is called Frank and you want the password blah enter this
"net user Frank blah"
and this changes the password on franks machine to blah and your in.

Have fun

Hacking Password Protected Website

Hacking Password Protected Website


There are many ways to defeat java-script protected websites. Some are very simplistic, such as hitting
[ctl-alt-del ]when the password box is displayed, to simply turning offjava capability, which will dump you into the default page.You can try manually searching for other directories, by typing the directory name into the url address box of your browser, ie: you want access to www.target.com .

         Try typing www.target.com/images .(almost ever y web site has an images directory) This will put you into the images directory,and give you a text list of all the images located there. Often, the title of an image will give you a clue to the name of another directory. ie: in     www.target.com/images,    there is a .gif named gamestitle.gif . There is a good chance then, that there is a 'games' directory on the site,so you would then type in    www.target.com/games,   and if it isa valid directory, you again get a text listing of all the files available there.

          For a more automated approach, use a program like WEB SNAKE from anawave, or Web Wacker. These programs will create a mirror image of an entire web site, showing all director ies,or even mirror a complete server. They are indispensable for locating hidden files and directories.What do you do if you can't get past an opening "PasswordRequired" box? . First do an WHOIS Lookup for the site. In our example, www.target.com . We find it's hosted by www.host.com at 100.100.100. 1.

     We then go to 100.100.100.1, and then launch \Web Snake, and mirror the entire server. Set Web Snake to NOT download anything over about 20K. (not many HTML pages are bigger than this) This speeds things up some, and keeps you from getting a lot of files and images you don't care about. This can take a long time, so consider running it right before bed time. Once you have an image of the entire server, you look through the directories listed, and find  /target.  When we open that directory, we find its contents, and all of its sub-directories listed. Let's say we find    /target/games/zip/zipindex.html .  This would be the index page that would be displayed had you gone through the password procedure, and allowed it to redirect you here.By simply typing in the url    www.target.com/games/zip/zipindex.html   you will be onthe index page and ready to follow the links for downloading.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
(DISCLAIMER)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The Info Above Is Lame!!!. I Dont Condone The Use Of This Document In A Malisous Manner. I Suggest That U Dont Do it But U Do What Ever U Want. I Will Not Be Responsible For Any Thing That Might Happen To U If U Use This.  :)

Multipal delete in vb.net

Multipal delete in vb.net


Private Sub chkall_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkall.CheckedChanged
        If chkall.CheckState = CheckState.Checked Then
            For i As Integer = 0 To dgvfacultyassign.Rows.Count - 1
                dgvfacultyassign.Item(0, i).Value = True
            Next
        Else
            For i As Integer = 0 To dgvfacultyassign.Rows.Count - 1
                dgvfacultyassign.Item(0, i).Value = False
            Next
        End If
    End Sub
Private Sub btdelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btdelete.Click
        Try
            For i As Integer = 0 To dgvfacultyassign.Rows.Count - 1
                If dgvfacultyassign.Item(0, i).Value = True Then
                    exedelete("delete FROM assignsubject where Streamname= '" & dgvfacultyassign.Item(1, i).Value & "' and subjectname='" & dgvfacultyassign.Item(2, i).Value & "' ")
                End If
            Next
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        If Not d = 0 Then
            frmmsg.lblmsg.Text = "Delete Successfully..."
            frmmsg.ShowDialog()
        Else
            MsgBox("Check Recored As You Want To Delete")
        End If
        d = 0
        fill()
    End Sub

How To Hide computer Drives

How To Hide computer Drives


Go to Start->Run. 
Type DISKPART and press Enter. 
In the console type list volume to see all the drives available on your PC. 
Now select the drive which you want to hide. Suppose you want to hide D see the volume number opposite to Ltr D. 
In My PC it is volume 4 for drive D(might be different in your computer) . 
Now to hide drive D type Select volume 4 .(Select the appropriate number according to your system) 
Then type remove letter d , this will hide your drive. 
Now to get your drive back type Select volume 4 and then type assign letter d . 
See this image