簡體   English   中英

如何使用 C# 在任務欄中獲取固定應用程序列表

[英]How to get the list of pinned applications in taskbar using C#

我在 c# 中創建了一個 windows 應用程序,其中自動化 windows。 我正在嘗試檢索任務欄中固定應用程序的所有/列表。

我在互聯網上搜索,但沒有找到任何合適的解決方案。

任何人都可以幫助我。

提前致謝。

使用文件瀏覽,您可以在此處找到固定任務欄快捷方式:

%AppData%\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar

歸功於 Cagliostro 和 Steven Penny

來源: https : //superuser.com/questions/171096/where-is-the-list-of-pinned-start-menu-and-taskbar-items-stored-in-windows-7

快速使用將如下所示:

private void DisplayPinnedTaskBarElements()
{
    var pinnedTaskBarItemsPath = Environment.ExpandEnvironmentVariables(@"%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar");
    var pinnedTaskBarFiles = Directory.GetFiles(pinnedTaskBarItemsPath);
    
    foreach (var file in pinnedTaskBarFiles)
    {
        FileInfo fileInfo = new FileInfo(file);
        Console.WriteLine(fileInfo.Name);
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM