标签: c++ qt
在c#中可以使用Process.GetCurrentProcess()。SessionId ..来获取Windows中的当前登录用户ID 在QT我们怎么能这样做?
答案 0 :(得分:0)
您应该使用WinAPI。
你在C#中使用的只是糖,包装,因为C#创建用于Windows。 也许你需要的是GetCurrentProcessId方法,你可以找到它here。
但是如果你只需要你的ID,你可以使用qint64 QCoreApplication :: applicationPid()。