© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
3y ago
•
81 replies
jaydactvyt
❔ I Need help getting the Streamwriter object to write to a text file.
TextWriter sw
= new StreamWriter
(
"
C
:
\
Users
\
Sunwa
\
Desktop
\
Commands
\
Commands
.txt
"
)
;
sw
.Write
(commandEntered
)
;
sw
.Flush
(
)
;
sw
.Close
(
)
;
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Next page
Similar Threads
Write to file not working (StreamWriter)
C
C# / help
4y ago
✅ StreamWriter not writing to file
C
C# / help
11mo ago
✅ StreamWriter not writing to file
C
C# / help
2y ago
❔ how to write strings to text file
C
C# / help
4y ago