In this test code, the username should be outputted. I've tested this with IE and Chrome on a networked device and this appears to work. Interestingly Chrome will only supply the username over SSL though - worth noting. I ran this with GlassFish and didn't need any of the JavaScript - this should happily work on its own. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question.
Asked 10 years, 4 months ago. Active 2 years, 5 months ago. Viewed 19k times. A solution in Java would be ideal if anyone got something? There seems to be some kind of solution in javascript : How to get the windows user name using javascript in google chrome browser for google chrome extension But nothing is said about IE8 and the Chrome solution seems quite a bit of work.
Thanks in advance. Please, also provide a minimum explanation. I think that is self explanatory: — Annia Martinez. This answer is already provided by Eonasdan. He explains that this makes sense only in Razor cshtml only and how to pass it in a script outside of the view. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. Name will return the Windows username — Greg. Dagg Nabbit Dagg Nabbit 71k 18 18 gold badges silver badges bronze badges. The browser does indeed have access to the system's username or any system info for that matter - however, the browser doesn't expose that to the JS engine. Network" ; document.
MarredCheese Kosmi Kosmi 21 1 1 bronze badge. This doesn't really add any information that stackoverflow. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.
Linked 0. Opening Balance. Ms access. Follow us! Get the Latest Bytes Updates. By using this site, you agree to our Privacy Policy and Terms of Use. How to get windows username using javascripts? Mar 14 '07 reply abhishekitb 8 Hi. Mar 15 '07 reply acoder 16, Expert Mod 8TB How can you be so sure it's possible unless you've seen it? Oct 4 '07 reply gits 5, Expert Mod 4TB hi Oct 4 '07 reply acoder 16, Expert Mod 8TB I'm afraid I know nothing about Javascript except that I would guess there is some similarity to Java ; JavaScript was named after Java, but otherwise they're very different.
Very few users are so computer illiterate nowadays that they don't know how to change an environment variable, which is all it takes to confuse that code into treating you as an adminstrator or the company CEO. Nevertheless, this method should be treated with caution as there is a fairly straightforward method to beat it.
Oct 15 '07 reply Eldann 1 Far too late to help abhishekitb , but it can be used by somebody else who asks the same question.
Still worth posting :- Mar 29 '14 reply Message. Cancel Changes. Javascript disable firefox drag feature using javascripts 1 post views Thread by vickygoelk last post: by. Javascript windows username to ms access 4 posts views Thread by orajat last post: by. Java Problem in getting windows username 8 posts views Thread by tiijnar last post: by.
General How to use Nuget assembly as files with visual studio community reply views Thread by xarzu last post: by.
0コメント