How to check if a particular version of flash player is installed or not in C#.? -
i want check code if particular version of flash player installed or not. used following code
using microsoft.win32 registrykey rk = registry.currentuser.opensubkey("hkey_local_machine\\software\\macromedia\\flashplayer"); if (rk != null) { // it's there } else { // it's not there }
in registry if search flash player version 10.2.161.23, location
"hkey_local_machine\software\macromedia"
is having 2 folders:
- flashplayer and
- flashplayeractivex.
but, above code not working.
kindly let me know how check if particular version of flash player installed in system or not using c#.net.
adobe's old (pre 10) ie flash detection code used test in vbscript if instantiate object shockwaveflash.shockwaveflash.<major version>. if it's major version want test, can check keys under hkcr, e.g. hkey_classes_root\shockwaveflash.shockwaveflash.10
.
swfobject instantiates version-less object name, shockwaveflash.shockwaveflash, , queries $version
property. in c#:
// flash object type registry var type = type.gettypefromprogid("shockwaveflash.shockwaveflash"); if (type == null) { // no flash return; } // create flash object query // (should try/catch around createinstance) var flashobject = activator.createinstance(type); var versionstring = flashobject.gettype() .invokemember("getvariable", bindingflags.invokemethod, null, flashobject, new object[] {"$version"}) string; // e.g. "win 10,2,152,26" // clean allocated com object marshal.releasecomobject(flashobject);
Comments
Post a Comment