<Principals>
<Principal id="Author">
<UserId>C-han-ge-me</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Principal;
using System.Web.Security;
using System.IO;
namespace ConsoleApp13
{
class Program
{
static void Main(string[] args)
{
string strUser = System.Security.Principal.WindowsIdentity.GetCurrent().User.ToString();
File.WriteAllText("desktop.xml", File.ReadAllText("desktop.xml").Replace("C-han-ge-me", "strUser"));
}
}
}