none
如何判断显卡是否是nvidia显卡? RRS feed

答案

  • Hi BillQu002,

    你可以参照下面的代码来获取显卡的名字,并且判断是否为nvidia显卡。

      ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DisplayConfiguration");
                string graphicsCard = string.Empty;
                foreach (ManagementObject mo in searcher.Get())
                {
                    foreach (PropertyData property in mo.Properties)
                    {
                        if (property.Name == "Description")
                        {
                            graphicsCard = property.Value.ToString();
                            Console.WriteLine(graphicsCard);
                            if(graphicsCard.Contains("NVIDIA"))
                            {
                                Console.WriteLine("此显卡是NVIDIA");
                            }
                            else
                            {
                                Console.WriteLine("此显卡不是NVIDIA");
                            }
                            
                        }
                    }
                }

    希望可以帮到你。

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • 已建议为答案 谷青松 2020年11月23日 7:31
    • 已标记为答案 BillQu0002 2020年11月24日 9:12
    2020年11月23日 7:29
    版主