PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → How Can I Get the User and Machine Name
How Can I Get the User and Machine Name
Started by PrinceFemiAdeniyi, Apr., 10 2020 1:42 PM - 11 replies
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on April, 10 2020 - 1:42 PM
Dear All,

How can I get the UserName and Machine Name from a WebDev Application. This is required for Audit-Trail purposes.

Combing through the webdev help files without success. I belief there must be a function or routine to do this.

Many thanks in advance

--
Thanks in advance
Femi
Registered member
50 messages
Popularité : +7 (9 votes)
Posted on April, 11 2020 - 3:17 AM
First of all that is just not possible on the client side (which is what you are saying you want), for many reasons i dont want to discuss here. a web application is something you run on a browser context you dont have access to the local system and APIS like if you had a native application. so using web technologies like javascript and such you are not going to be able to achieve what you want. to do what you want you need to build a native application that runs as an executable on the local machine.
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on April, 12 2020 - 4:29 AM
Many thanks Windevcol.

I m told I nee to do integration with AD or so.

Appreciate the response.

Cheers

--
Thanks in advance
Femi
Registered member
50 messages
Popularité : +7 (9 votes)
Posted on April, 13 2020 - 2:00 AM
you can integrate with AD with server side code no problem at all, but in that case we are talking about 2 different things completely. 1) one thing is the client side code that will run on the browser, most likely javascript 2) and then there is the server side code that is another completely different story but that code will run on the machine where your webserver is and it has nothing to do with the client... Nothing at all.

If you want to do all those things you are mentioning (get username on the machine you are opening the browser on, integration with AD and so on) from your browser just using client side code and nothing else you are out of luck but that is just not possible. you have chosen the wrong architecture for your system then. you could do that using flex or silverlight or other framework like that but then the purpose of using only browser client code and javascript is lost.

So if you have all those requirements and you have to do that ONLY USING CLIENT SIDE CODE forget completely about a web interface and go with a thick client, webservices and socket communication.
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on April, 14 2020 - 11:28 AM
Thanks. I did get the picture.

We already looking at integration with AD

Many thanks

Femi
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on May, 05 2020 - 9:46 PM
Hi Guys,

Turns out WB has the function to get the Windows user running a WB application.

...NetworkUser()

Many thanks to Victoria:thank you:

Thought I should share.

Thank you

--
Thanks in advance
Femi
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on May, 05 2020 - 9:47 PM
Hi Guys,

Turns out WB has the function to get the Windows user running a WB application.

...NetworkUser()

Many thanks to Victoria:thank you:

Thought I should share.

Thank you

--
Thanks in advance
Femi

--
Thanks in advance
Femi
Posted on May, 15 2020 - 11:03 AM
Thanks femi for the attribution in mentioning this. I really appreciate it.
:thank you:

Regards,

Victoria
Registered member
50 messages
Popularité : +7 (9 votes)
Posted on May, 16 2020 - 5:56 AM
Unless: 1) The server its on the same DOMAIN, 2) You are running FULL IIS on that server 3) You are using IE (internet explorer) for the clients to access the solution 4) You have properly configured Windows Authentication on the client machine and the Domain. It will be very difficult because most browsers are designed to block that kind of information and that function will never work, for the reasons i mentioned before. Please read the documentation of that function:

https://help.windev.com/…

Too many IF questions, and if the server is not on the same domain, meaning you are hosting the site else where, that will not work either
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on May, 16 2020 - 8:30 PM
Yes to all
The app runs on same domain.
I ve tested Mozilla firefore and it captured the name
Tks

--
Thanks in advance
Femi
Registered member
30 messages
Popularité : +1 (1 vote)
Posted on May, 16 2020 - 8:30 PM
Mozilla FireFox I mean
Registered member
1 message
Posted on August, 13 2020 - 11:25 AM
I use this to get the machine name also for local debugging.
presented simply:

Procedure PUBLIC GLOBAL getClientHostName()
sClientAddress1 is string = NetIPAddress()
sClientAddress2 is string = BrowserIPAddress()
sClientAddress3 is string = sClientAddress2
IF sClientAddress3 = "127.0.0.1" THEN
sClientAddress3 = sClientAddress1
END
RESULT NetMachineName(sClientAddress3)


WINDEWCOL has already listed the conditions, but I was not able to determine point 3.
For me it works fine with IE, FireFox and Chrome.