© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
110 replies
A Name

❔ Writing to StreamWriter Fails

Hi, I was experimenting with permanently saving things for the first time and ran into problems. Despite the code looking right, it doesn't seem to work. I'm relatively new to this, so it's likely i messed something up, but help would be appericiated
Related code below:
public static StreamWriter UserSaveData = new("C:\\Users\\name\\source\\repos\\AuctionHouseDiscord\\AuctionHouseDiscord\\UserData.txt");
public static StreamWriter UserSaveData = new("C:\\Users\\name\\source\\repos\\AuctionHouseDiscord\\AuctionHouseDiscord\\UserData.txt");

other code
//galleon count is an int
//withing an async task if that matters
UserSaveData.WriteLine(GalleonCount.ToString());
//galleon count is an int
//withing an async task if that matters
UserSaveData.WriteLine(GalleonCount.ToString());
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ StreamWriter not writing to file
C#CC# / help
11mo ago
✅ StreamWriter not writing to file
C#CC# / help
2y ago
StreamWriter writing some lines multiple times
C#CC# / help
2y ago
❔ StreamWriter weird output
C#CC# / help
4y ago