Wednesday, June 12, 2013

Java Script: Get user name of login person


Sometime you may have requirement to show message like Welcome User for some type of application and If that application is not authenticated then we can pull user name from window credentials using java script.

    <script type="text/javascript">
      function currentUser() {
        var ntw = new ActiveXObject("WScript.Network");
        <meta http-equiv="Content-Type"
              content="text/html; charset=windows-1252"/>
      <body onload="currentUser();">

No comments:

Post a Comment