ANGULARJS get machine name and name angularjs - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

how to get client machine name and user name using angularjs ?


 11490

Show Result
app.component.html
app.component.ts
app.model.ts
main.ts
config.js
ANGULARJS


8

// you can get a hostname with angular
<!DOCTYPE html>
<html>

<head>
<base href="/Solutions" />
<script type="text/javascript" charset="utf-8">
window.AngularVersionForThisPlunker = '6.0.0-beta.7'
</script>
<script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script>
<script src="https://unpkg.com/zone.js@0.10.3/dist/zone.js"></script>
<script src="https://unpkg.com/zone.js@0.10.3/dist/long-stack-trace-zone.js"></script>
<script src="https://unpkg.com/reflect-metadata@0.1.3/Reflect.js"></script>
<script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script>
<script src="https://unpkg.com/gijgo@1.9.6/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.6/css/gijgo.min.css" rel="stylesheet" type="text/css"/>
<script src="/project/lolo/sl_nC0asxi3Pf20195355/config.js"></script>
<script>
System.import('app')
.catch(console.error.bind(console));
</script>
</head>

<body>
<my-app>
Launching ...
</my-app>
</body>
</html>


By        
The power of the user (%)
10%

ANGULARJS


1

// this is the only solution, works only for IE in intranet or local machine, there is a security reason
// you can try node.js https://net-raft.com/Questions/1567/how-to-get-client-machine-name-and-computer-name-with-nodejs/1567

// important : ActiveXObject works only for IE (new ActiveXObject("ADODB.Connection"))
try
{
var ax = new ActiveXObject("WScript.Network");
alert('User: ' + ax.UserName );
alert('Computer: ' + ax.ComputerName);
}
catch (e)
{
alert('Permission to access computer name is denied');
}

});


By        
The power of the user (%)
18%

ANGULARJS


0

// important : ActiveXObject works only for IE (new ActiveXObject("ADODB.Connection"))

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">

<script src="//code.angularjs.org/snapshot/angular.min.js "></script>

</head>

<body ng-app="getname">

<script>

angular.module('getname', [])
.controller('myname', ['$scope', function ($scope) {
var ax = new ActiveXObject("WScript.Network");
$scope.name = 'User: ' + ax.UserName + ' Computer: ' + ax.ComputerName;
} ]);

</script>

<div ng-controller="myname">

<span>{{name}}</span>

</div>

</body>
</html>


By        
The power of the user (%)
15%



The most helpful ANGULARJS solutions

How to get client ip address using angularjs ?How to get client ip address using angularjs ?ANGULARJS

Click to see more ...

  19.3K     2.8K

How to get city from ip address with angularjs ?How to get city from ip address with angularjs ?ANGULARJS

Click to see more ...

  7.3K     1.4K

how to get client machine name and user name using angularjs ?how to get client machine name and user name using angularjs ?ANGULARJS

Click to see more ...

  11.5K     796

How to get local client ip address using angularjs ?How to get local client ip address using angularjs ?ANGULARJS

Click to see more ...

  5.6K     562

get client country using angularjs ?get client country using angularjs ?ANGULARJS

Click to see more ...

  2.8K     477

get region angularjsget region angularjsANGULARJS

Click to see more ...

  2.3K     414

How to get value from a href using angularjs ?How to get value from a href using angularjs ?ANGULARJS

Click to see more ...

  2K     369

how to fill a list from an another file in json format using angularjs ?how to fill a list from an another file in json format using angularjs ?ANGULARJS

Click to see more ...

  1.9K     352

How to move the value of checkbox to an html element in angular.js ?How to move the value of checkbox to an html element in angular.js ?ANGULARJS

Click to see more ...

  2K     203

get client time zone using angularjs get client time zone using angularjs ANGULARJS

Click to see more ...

  2.1K     201

Welcome aboard!
We are happy you are here and
wish you good net-raft!