How to use System.Security.Principal.WindowsIdentity in .NET Core 2.1

时间:2018-06-04 17:48:02

标签: c# windows-identity .net-core-2.1

How can we use WindowsIdentity in .NET Core 2.1?

It was available in 2.0

.NET API Browser

1 个答案:

答案 0 :(得分:0)

您可以使用c = Counter('abbccc') s = sum(c.values()) perc = {k: v*100.0/s for k, v in c.items()} # {'a': 16.666666666666668, 'b': 33.333333333333336, 'c': 50.0} 查找当前的Windows用户名。