A Name
A Name
CC#
Created by A Name on 4/12/2023 in #help
❔ 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());
111 replies
CC#
Created by A Name on 4/7/2023 in #help
❔ Index Out of Bounds Exception
cs
for (int LinesLeft = LinesOfContent.Length-1; LinesLeft >=0; LinesLeft--)
{
SearchStringForInts(LinesOfContent[LinesLeft]);

}
cs
for (int LinesLeft = LinesOfContent.Length-1; LinesLeft >=0; LinesLeft--)
{
SearchStringForInts(LinesOfContent[LinesLeft]);

}
seems to throw an error on this line if needed I can disclose the function, although the log seemed to think it was on this line
12 replies