AppDataPaths 類別

定義

AppDataPaths 會根據 KNOWNFOLDERID 命名模式,傳回常用應用程式資料夾的路徑。

public ref class AppDataPaths sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppDataPaths final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppDataPaths
Public NotInheritable Class AppDataPaths
繼承
Object Platform::Object IInspectable AppDataPaths
屬性

Windows 需求

裝置系列
Windows 10 Fall Creators Update (已於 10.0.16299.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v5.0 引進)

備註

此類別會傳回一律根據呼叫端內容隔離的路徑。 例如,這會符合過去可能曾使用檔「私人」版本的跨平臺應用程式開發人員的期望。 此類型沒有舊版 COM Interop 介面。

從沒有套件識別的應用程式要求資料夾位置將會失敗 (例如 ,GetDefaultGetForUser 都會傳回 null) 。 如果應用程式相依于共用的個別應用程式位置, (Win32) ,或使用傳統型橋接器時的應用程式路徑變更,這可確保沒有任何移轉問題。

屬性

Cookies

取得應用程式 Cookie 的路徑。

Desktop

取得桌面資料夾的路徑。

Documents

取得檔資料夾的路徑。

Favorites

取得我的最愛資料夾路徑。

History

取得歷程記錄資料夾的路徑。

InternetCache

取得網際網路快取資料夾的路徑。

LocalAppData

取得本機應用程式資料檔案夾。

ProgramData

取得程式資料檔案夾。

RoamingAppData

取得漫遊應用程式資料檔案夾。

方法

GetDefault()

取得使用者各種應用程式資料檔案夾的路徑。 在單一使用者應用程式中使用這個方法。

GetForUser(User)

取得使用者各種應用程式資料檔案夾的路徑。 在多使用者應用程式中使用這個方法。

適用於