-2

I have one problem.. I have image converting program so if one user converting image file then his computer name going into file name.'

Something like this I need: John-Doe.23-07-2016.JPG

But at the moment taking computer name like this: John-Doe/John-Doe.23-07-2016.JPG

My code:

string user = File.GetAccessControl(textBox1.Text).GetOwner(typeof(NTAccount)).ToString();

textBox1.Text is place where program choosing folder where is image files.

Gretel R
  • 27
  • 6

1 Answers1

2

You say you want the computer name, yet you use username.

You should look into the values in System.Environment. There you can get the username using System.Environment.UserName, or the computer name using System.Environment.MachineName

TheHvidsten
  • 4,028
  • 3
  • 29
  • 62