Tuesday, February 14, 2017

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

Solution: 
https://www.google.com/settings/security/lesssecureapps... go to this link and turn on... njoy

disable browser back button

 <script>
        window.onload = function () {
            if (typeof history.pushState === "function") {
                history.pushState("jibberish", null, null);
                window.onpopstate = function () {
                    history.pushState('newjibberish', null, null);
                    // Handle the back (or forward) buttons here
                    // Will NOT handle refresh, use onbeforeunload for this.
                    var url = '@Url.Content("~/Account/LogOff")';
                    $.ajax({
                        url: url,
                        cache: false

                    });
                };
            }
        }
    </script>

Difference between Virtual Path, Absolute Path, Relative path And Physical Path



Virtual Path
 To create a web app in IIS we can place our folder containing application in C:\inetpub\wwwroot or we can point to a location where the application is, like D:\MyApp. When we point an app to another location, then we specify this path. So the app in IIS is pointing to this virtual path.

Absolute Path
When we refer to a location from root like C:\Documents\MyFolder, it is absolute path.

Relative path
When we refer to a location relative where we currently are, it is called relative path. For example, say currently you are at Documents folder in C:\Documents, to refer to MyFolder you have two choices: Absolute (C:\Documents\MyFolder) or relative (\MyFolder).

Physical Path
In ASP.NET physical path refers to the absolute path in terms of windows. In web applications we refer to the web path, which for a web application starts from "/" (root) which is the folder that contains the application. But that root folder must be in IIS, so the path like C:\inetpub\wwwroot\myapp is the physical path.

Difference between int,int16,int32,int64 C#

A number of developers think that int represents a 32-bit integer when the application is running on a 32-bit OS and it represents a 64-bit integer when the application is running on a 64-bit OS. This is absolutely wrong.
    In C# int is a primitive data type and it always mapped to System.Int32 whether the OS is 32-bit or 64-bit.
int

    It is a primitive data type defined in C#.
    It is mapped to Int32 of FCL type.
    It is a value type and represent System.Int32 struct.
    It is signed and takes 32 bits.
    It has minimum -2147483648 and maximum +2147483647 capacity.

Int16

    It is a FCL type.
    In C#, short is mapped to Int16.
    It is a value type and represent System.Int16 struct.
    It is signed and takes 16 bits.
    It has minimum -32768 and maximum +32767 capacity.

Int32

    It is a FCL type.
    In C#, int is mapped to Int32.
    It is a value type and represent System.Int32 struct.
    It is signed and takes 32 bits.
    It has minimum -2147483648 and maximum +2147483647 capacity.

Int64

    It is a FCL type.
    In C#, long is mapped to Int64.
    It is a value type and represent System.Int64 struct.
    It is signed and takes 64 bits.
    It has minimum –9,223,372,036,854,775,808 and maximum 9,223,372,036,854,775,807 capacity