Stephen Foster
Stephen Foster

Reputation: 793

How would I create a file directory relative to a users documents in C#?

I am trying to create a save file directory in XNA, I have an XML serializer setup that stores scores from the game, but when the game first runs I want it to create the file in the users documents in a folder called SaveData. I can create the XML file itsef, but I am not sure how to create it in the users documents, since the username is different every time?

So my question is how would I save in documents relative to any username?

Upvotes: 0

Views: 90

Answers (1)

PinnyM
PinnyM

Reputation: 35533

This should help you get started:

Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

Upvotes: 6

Related Questions