如何在没有dynamic
关键字的 .NET 3.5 中实现此行为。
Guid CLSID_ShellApplication = new Guid("13709620-C279-11CE-A49E-444553540000");
Type shellApplicationType = Type.GetTypeFromCLSID(CLSID_ShellApplication, true);
dynamic shellApplication = Activator.CreateInstance(shellApplicationType);
dynamic windows = shellApplication.Windows();
for (int i = 0; i < windows.Count; i++)
windows.Item(i).Refresh();
我尝试使用
MethodInfo windowsMethod = shellApplicationType.GetMethod("Windows");
但GetMethod
返回null
。