macOS 编程获取当前桌面的登录用户名

一、shell 命令

  id -un

二、C 语言

  getlogin() 函数

  

参考

时常一个人发呆,看到宁静的天空。
原文地址:https://www.cnblogs.com/pinweyshg/p/9782192.html