| | |
File.Create Question
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
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.
C# Syntax (Toggle Plain Text)
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:
Solved Threads: 6
C# Syntax (Toggle Plain Text)
// 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
C# Syntax (Toggle Plain Text)
// 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
![]() |
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)
Other Threads in the C# Forum
- Previous Thread: Perplexed: Combo Box Not Holding Data
- Next Thread: XML save settings
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# cast check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mailmerge mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox robot save saving serialization server sleep socket sockets sql sql-server statistics stream string stringformatting table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






