C#C
C#3y ago
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");

other code
//galleon count is an int
//withing an async task if that matters
UserSaveData.WriteLine(GalleonCount.ToString());
Was this page helpful?