gpt4 book ai didi

c# - 检查是否安装了 Adob​​e Reader (C#)?

转载 作者:可可西里 更新时间:2023-11-01 08:32:23 26 4
gpt4 key购买 nike

如何查看系统是否安装了Adobe reader或acrobat?还有如何获取版本? (在 C# 代码中)

最佳答案

using System;
using Microsoft.Win32;

namespace MyApp
{
class Program
{
static void Main(string[] args)
{
RegistryKey adobe = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe");
if(null == adobe)
{
var policies = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Policies");
if (null == policies)
return;
adobe = policies.OpenSubKey("Adobe");
}
if (adobe != null)
{
RegistryKey acroRead = adobe.OpenSubKey("Acrobat Reader");
if (acroRead != null)
{
string[] acroReadVersions = acroRead.GetSubKeyNames();
Console.WriteLine("The following version(s) of Acrobat Reader are installed: ");
foreach (string versionNumber in acroReadVersions)
{
Console.WriteLine(versionNumber);
}
}
}
}
}
}

关于c# - 检查是否安装了 Adob​​e Reader (C#)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/969027/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com