I am trying to make an application that deletes a folder and I cannot seem to find a way to find what user they are on and implement it into the directory deleting. I am coding in c# on Visual Studio
edit: os: windows 10 basically I want to find the username of the computer and set it as a variable than go and delete a certain folder inside of C:/users/(user)
I have a way to get the user which is Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); But I want to set that as a variable and then use that variable to replace
DirectoryInfo di = new DirectoryInfo(@"C:\Users\Desktop
Path\yes");
foreach(FileInfo file in di.GetFiles())
{
file.Delete();
}