This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.
Here is my reproduce code on .Net6, any suggestions?
using System;
using System.Security.Principal;
namespace ConsoleApp45
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("New param");
var param = new SecurityIdentifier("S-1-5-21-198055498-3910363945-93989812");
SecurityIdentifier sid;
Console.WriteLine("New sid");
foreach (WellKnownSidType type in Enum.GetValues(typeof(WellKnownSidType)))
{
if (type == WellKnownSidType.LogonIdsSid || type == WellKnownSidType.WinLocalLogonSid)
{
// these types can't be created, skip
continue;
}
try
{
sid = new SecurityIdentifier(type, param);
Console.WriteLine(type.ToString());
}
catch (ArgumentException)
{
Console.WriteLine($"The error type is: {type}");
}
}
}
}
Here is my reproduce code on .Net6, any suggestions?
using System; using System.Security.Principal;
namespace ConsoleApp45 { class Program { static void Main(string[] args) { Console.WriteLine("New param");
}