cyclonebri
Regular
Hey everybody,
Just wondering how one would go about returning the username of the local profile being used as the application is running.
I know the system command -- %username% -- will return what I'm looking for in a command window or certain scripts, and was wondering if I could do this in an application. I am trying to get this information so I can write an xml settings file to the local user profile (the users have no rights on their machines and can only write to certain locations).
I want to open a file as follows:
[CS]
System.IO.StreamWriter myWriter = new System.IO.StreamWriter("C:\\Documents and Settings\\'%username'\\ ...");
[/CS]
Thanks in advance,
Brian
Just wondering how one would go about returning the username of the local profile being used as the application is running.
I know the system command -- %username% -- will return what I'm looking for in a command window or certain scripts, and was wondering if I could do this in an application. I am trying to get this information so I can write an xml settings file to the local user profile (the users have no rights on their machines and can only write to certain locations).
I want to open a file as follows:
[CS]
System.IO.StreamWriter myWriter = new System.IO.StreamWriter("C:\\Documents and Settings\\'%username'\\ ...");
[/CS]
Thanks in advance,
Brian