Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, How can I check for TPM if it's installed on a computer in C#?
I already have Microsoft.TSS and TPM2Lib, I just need to know how I can detect it not do anything else. Thanks.



(Edit: just to clarify C# better)

What I have tried:

googling did nothing I only found how to use tpm not to detect it
Posted
Updated 4-Jan-22 0:01am
v2
Comments
Peter_in_2780 3-Jan-22 23:27pm    
Can't you just try to use it for something trivial, and check to see if you get a "not found" sort of error?

1 solution

You can use DeviceCapabilities API to detect TPM. There is a sample present at the following location.

TSS.MSR/TSS.NET/Samples/GetCapabilities at master · microsoft/TSS.MSR · GitHub[^]
 
Share this answer
 
Comments
j ongamer13 4-Jan-22 8:17am    
Is there a simpler way of doing this since thats almost 300 lines of code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900