Daniel Berger
8/15/2008 4:06:00 PM
On Aug 14, 4:50=A0pm, Mike Johnson <freezingsm...@gmail.com> wrote:
> Hi, all
>
> I am trying to detect the user who's currently login the Windows system.
> Is there way to do it in Ruby?
This is the one function of the 'etc' library that works on Windows:
require 'etc'
puts Etc.getlogin
Or, you can use the sys-admin library, which provides much more
functionality on Windows:
gem install sys-admin
require 'sys/admin'
puts Sys::Admin.get_login
Regards,
Dan