Ruby: Get currently logged in user on windows

前端 未结 6 1474
不思量自难忘°
不思量自难忘° 2021-01-13 04:20

In C# I can get the current user of a web app using the HttpContext, however, I can\'t figure out how to do this in Ruby. Is there any way of doing this?

FOR

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-13 04:48

    To get the username of the current user on client machine you can use this

    ENV['USERNAME']

提交回复
热议问题