按字母顺序排序身份+ c#

时间:2017-08-28 19:31:24

标签: c# sorting sid

我正在处理以下代码片段,其中m_identities [memDesc] .DisplayName是Windows SID DisplayName。显示名称采用LastName,FirstName格式。我需要帮助搞清楚一些事情,

  1. 切换m_identities [memDesc] .DisplayName格式,使其格式为FirstName LastName
  2. 将DisplayName导出为CSV时,按字母顺序对DisplayName进行排序。
  3. 非常感谢任何帮助!

    static void Write(TeamFoundationIdentity group)
    {
        string csv = string.Format("\n Members of group: {0} \n ", group.DisplayName);
        File.AppendAllText(@"C:\MembersLog\QueryMembers" + ".csv", csv);
        string csv1 = string.Format("==================================================\n");
        File.AppendAllText(@"C:\MembersLog\QueryMembers" + ".csv", csv1);
    
        foreach (IdentityDescriptor memDesc in group.Members)
        {
            string csv2 = string.Format(" {0} \n", m_identities[memDesc].DisplayName);
            File.AppendAllText(@"C:\MembersLog\QueryMembers" + ".csv", csv2);
        }
    
        Console.WriteLine();
    }
    

0 个答案:

没有答案