Get IP Address in C Sharp

In below code, we will show how to get the IP address of the same system. public string GetIPAddress() { try { string hostName = Dns.GetHostName(); // Retrive the Name of HOST Console.WriteLine(hostName); // Get the IP string myIP = Dns.GetHostByName(hostName).AddressList[0].ToString(); return myIP; } catch (Exception ex) { throw; } }

Read More

Disable back button

In this example, we will disable back button and try that user can’t go back to the previous. <html> <head > <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js”></script> <script> $(document).ready(function () { function disableBack() { window.history.forward();// this function helps to restrict the user to go back on the previous page } window.onload = disableBack(); window.onpageshow = function (evt) { if (evt.persisted) […]

Read More