I believe you are stating that you have a Asp.NET application, and would like to use Node.js to determine the current users username, and then submit it to your Asp.NET application.
I do not develop on Windows though from this question I believe this may be stored as an environment variable. process.env
is a javascript map / dict of environment variables and likely contains the users username.
Alternatively you can parse it from the users home directory as such :
var path = require('path');
var username = path.sep(process.env['USERPROFILE'])[2];
The question I linked above implies that USERPROFILE
resolves to C:\Users\USERNAME\
. I then split the path and take the 3rd element, being the username.
Again, I do not have a windows machine and could not confirm this. Hope this sets you down the right path though.
Cheers.