Wednesday 24 October 2018

Disable ways to open Inspect Element in JavaScript and HTML.

Script that disables practically all the ways to access Inspect Element in JavaScript. Here's what it blocks:

  • Right Click
  • F12
  • Ctrl + Shift + I
  • Ctrl + Shift + J
  • Ctrl + U

What you need?

  • Basic JavaScript knowledge
  • HTML editor

What you do?

  • Right Click
  • Copy the HTML below!

Keys :

Copy the JavaScript below!

document.onkeydown = function(e) {
if(event.keyCode == 123) {
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
return false;
}
if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
return false;
}
}


Are You Familiar With 10 Important Google URLs?

Are You Familiar With 10 Important Google URLs?


Everyone would be familiar with Google. No doubt, Google has been ruling on the web since 1998. We love Google due to its user-friendly and simple interface. Google has always tried to provide best user interface and hassle free services.

Well, Google tracks your every activity and stored them privately. All your information and data sync with Gmail. For instance, if you forget “Password” of any account, then what will you do next. In this Article, I’ll be talking about 10 most important Google URLs that may reveal interesting details about you. Let’s drive it.

10 Most Important Google URLs, You should Know

1. passwords.google.com

Google stores your username and passwords in Google Chrome or Android (whenever you login into different websites or apps). Previously, I had explained “How to Access Google Chrome Passwords from any browsers.” In this website you can see all your usernames and passwords.

2. history.google.com

When you search something on Google, it saves your all data (including URLs). You can see here, all your search queries with day by day and month by month. You can delete your history.

3. google.com/settings/ads

Google shows you more relevant ads on your PC or smartphones. But we don’t know how Google sends most relevant ads next to you.

Basically, Google automatically creates a profile of yourself based on your search queries and your age. Using this URL, you can see how Google sees you on the web.

4. takeout.google.com/settings/takeout

Using this URL, you can export all data like Google photos, Google docs, Gmail messages, YouTube videos and much more into your PC. Google allows you to download files as .zip, .tar and .tag.

5. support.google.com/legal
If your contents appearing on other websites/blogs, you can claim on DMCA with Google against that site to remove the content.

6. google.com/maps/timeline

The Google Map on your Android phone or iPhone are reporting your recent location and velocity (how fast are you moving?) to Google. You can find entire location history on Google Maps and you can download it as KML format. You can open KML files with Google Earth or Google drive.

7. google.com/alerts

Google alerts is one of the very useful services from the Google. This URL allows you to create an alters on any topics like celebrity, product, public figure, company or anything you want and get alerts directly in your Gmail.

8. accounts.google.com/signupwithoutgmail

If you don’t have an existing Gmail account that means you can’t create another or new Gmail account. But this URL allows you to create Gmail accounts with any existing email accounts like Hotmail, yahoo mail etc.

9. myaccount.google.com/security

If someone else is using your Gmail or may be hacked, in that case, this URL will show a log of every device that has recently connected with your Gmail. You can also see the IP address and geographic location too. Unfortunately, you can’t remotely log out of a Google session.

10. google.com/android/devicemanager

Have you lost your phone? In that case, you can use the Google Device Manager to find your phone whether it is switched on or connected to the internet connection. You can ring your android phone or erase your entire content remotely from the phone. Even you can find your IMEI Number of lost phones through Google account.

Tuesday 23 October 2018

Keypress event in Textbox for Characters

Using the below code you can only enter characters to the textbox. Here you have to paste this code in the keypress event of the textbox which is there in the property of that textbox.

if (char.IsLetter(e.KeyChar) || e.KeyChar == 8)

            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }

How to disable right click, cut(ctrl+X), copy(ctrl+C), paste(ctrl+V), inspect(ctrl+shift+I)

Using the below mentioned scripts we can disable right click, cut(ctrl+X), copy(ctrl+C), paste(ctrl+V), inspect(ctrl+shift+I). So that we can secure our website getting copied by others.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        window.oncontextmenu = function () {
            return false;
        }
        $(document).keydown(function (event) {
            if (event.keyCode == 123) {
                return false;
            }
            else if ((event.ctrlKey && event.shiftKey && event.keyCode == 73) || (event.ctrlKey && event.shiftKey && event.keyCode == 74)) {
                return false;
            }
        });
    </script>
      <script type="text/javascript">
          function disableselect(e) {
              return false
          }

          function reEnable() {
              return true
          }

          //if IE4+
          document.onselectstart = new Function("return false")
          document.oncontextmenu = new Function("return false")
          //if NS6
          if (window.sidebar) {
              document.onmousedown = disableselect
              document.onclick = reEnable
          }
</script>

Thursday 18 October 2018

Keypress event in TextBox for Number

Using the below code you can only enter numbers to the textbox. Here you have to paste this code in the keypress event of the textbox which is there in the property of that textbox.

e.Handled = char.IsNumber(e.KeyChar) || e.KeyChar == 8 || e.KeyChar == 13 ? false : true;


if (char.IsNumber(e.KeyChar) || (e.KeyChar >= 48 && e.KeyChar <= 57) || (e.KeyChar == 8))
            {

                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }

Keypress event in TextBox for Decimal

Using the below code you can only enter decimal values to the textbox. Here you have to paste this code in the keypress event of the textbox which is there in the property of that textbox.

if (char.IsNumber(e.KeyChar) || (e.KeyChar >= 48 && e.KeyChar <= 57) || (e.KeyChar == 8) || (e.KeyChar == 46))
            {

                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }


if (char.IsNumber(e.KeyChar) || (e.KeyChar == 13) || (e.KeyChar == 8) || (e.KeyChar == 46))
            {

                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }


 e.Handled = char.IsNumber(e.KeyChar) || e.KeyChar == 8 || (e.KeyChar == 46) || e.KeyChar == 13 ? false : true;

Saturday 13 October 2018

Difference between PRIMARY Key, UNIQUE Key and FOREIGN Key

The PRIMARY Key and UNIQUE Key constraints, both are similar and enforce uniqueness of the column on which they are defined.

Primary Key

  • Primary key cannot have a NULL value.
  • Each table can have only one primary key.
  • By default, Primary key is clustered index, and the data in database table is physically organized in the sequence of clustered index.
  • Primary key can be related to another tables as a Foreign Key.
  • We can generate ID automatically with the help of Auto Increment field. Primary key supports Auto Increment value.
  • We can define Primary key constraint on temporary table and table variable. 
  • We can't delete primary key value from the parent table which is used as a foreign key in child table. To delete we first need to delete that primary key value from the child table.

Unique Key

  • Unique Constraint may have a NULL value.
  • Each table can have more than one Unique Constraint.
  • By default, Unique key is a unique non-clustered index.
  • Unique Constraint can not be related with another table's as a Foreign Key.

Foreign Key

  • Foreign key is a field in the table that is Primary key in another table.
  • Foreign key can accept multiple null value.
  • Foreign key do not automatically create an index, clustered or non-clustered. You can manually create an index on foreign key.
  • We can have more than one foreign key in a table.
  • Foreign keys do not automatically create an index, clustered or non-clustered. You must manually create an index on foreign keys.
  • There are actual advantages to having a foreign key be supported with a clustered index, but you get only one per table. What's the advantage? If you are selecting the parent plus all child records, you want the child records next to each other. This is easy to accomplish using a clustered index.
  • Having a null foreign key is usually a bad idea instead of NULL  referred to as "orphan record".
  • We can’t define foreign key constraint on temporary table or table variable.
  • We can delete the foreign key value from the child table even though that refers to the primary key of the parent table.