gpt4 book ai didi

c# - 你如何以编程方式找到 Vista 的 "Saved Games"文件夹?

转载 作者:行者123 更新时间:2023-12-04 07:08:33 25 4
gpt4 key购买 nike

我正在使用 XNA 并且我想将文件保存到 Vista 的“已保存游戏”文件夹中。

我可以使用 Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) 获得类似“我的文档”这样的特殊文件夹。但我找不到 Saved Games 文件夹的等效项。如何进入这个文件夹?

最佳答案

http://msdn.microsoft.com/en-us/library/bb200105.aspx#ID2EWD

看起来您需要使用 Microsoft.Xna.Framework.Storage 和 StorageLocation 类来执行您需要的操作。

Currently, the title location on a PC is the folder where the executable resides when it is run. Use the TitleLocation property to access the path.

User storage is in the My Documents folder of the user who is currently logged in, in the SavedGames folder. A subfolder is created for each game according to the titleName passed to the OpenContainer method. When no PlayerIndex is specified, content is saved in the AllPlayers folder. When a PlayerIndex is specified, the content is saved in the Player1, Player2, Player3, or Player4 folder, depending on which PlayerIndex was passed to BeginShowStorageDeviceSelector.

关于c# - 你如何以编程方式找到 Vista 的 "Saved Games"文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/732562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com