Getting exe name of installed programs in C#?

后端 未结 3 444
长发绾君心
长发绾君心 2020-12-19 18:21

i am using this to get the program names, but i need the exe names. How do i find them?

string SoftwareKey = \"SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVer         


        
3条回答
  •  清酒与你
    2020-12-19 18:57

    Lacking a clarification on the particulars, you can get the .exe's on local drives as such:

    var allExePaths =
        from drive in Environment.GetLogicalDrives()
        from exePath in Directory.GetFiles(drive, "*.exe", SearchOption.AllDirectories)
        select exePath;
    

    If you're looking for a particular one, please provide more details about what things will determine the one you're looking for. Using the registry to list installed programs doesn't seem to be what you want to do, so please be more specific.

提交回复
热议问题