如何检查 windows 更新是否在远程计算机中启用

How to check if windows updates are enabled in a remote computer

我想在远程计算机上执行以下代码,以查看 windows 更新是否打开或关闭:

WUApiLib.AutomaticUpdates auc = new WUApiLib.AutomaticUpdates();
bool active = auc.ServiceEnabled;

我该怎么做?

我找到这个:http://www.daveoncsharp.com/2009/10/enumerating-and-controlling-windows-services-with-csharp/

我想这就是你要找的。