•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,623 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,177 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 7066 | Replies: 2
![]() |
Ok so i want to create a file
I want it to be able to detect the user that is on so it automatically creates it on there desktop. Is this possible.
File.Create("..."):
I want it to be able to detect the user that is on so it automatically creates it on there desktop. Is this possible.
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
•
•
Join Date: Dec 2003
Posts: 55
Reputation:
Rep Power: 5
Solved Threads: 6
// Creates a file called "test.txt" on the currently logged-in
// user's desktop
File.Create(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\testfile.txt");
// Or if you only want to find out the user that is currently logged in
String userName = Environment.GetEnvironmentVariable("username");•
•
•
•
Originally Posted by r0ckbaer
// Creates a file called "test.txt" on the currently logged-in // user's desktop File.Create(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\testfile.txt"); // Or if you only want to find out the user that is currently logged in String userName = Environment.GetEnvironmentVariable("username");
Ok, Thank that was easy enough.
Thanks
-T
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Need help in create file php (PHP)
- search for file extension (Visual Basic 4 / 5 / 6)
- Question about debugging .class file (Java)
- UDP File Transfer Question (Java)
- Doubt regarding creating “*.dll� file by visual studio 6.0. (C++)
- Browser's File Interpreters (Computer Science and Software Design)
Other Threads in the C# Forum
- Previous Thread: Perplexed: Combo Box Not Holding Data
- Next Thread: XML save settings



Linear Mode