{"id":94816,"date":"2015-12-17T14:45:00","date_gmt":"2015-12-17T10:45:00","guid":{"rendered":"http:\/\/blagovest.org.ru\/?p=94816"},"modified":"2015-12-17T14:45:00","modified_gmt":"2015-12-17T10:45:00","slug":"c","status":"publish","type":"post","link":"https:\/\/blagovest.org.ru\/?p=94816","title":{"rendered":"C#"},"content":{"rendered":"<p>static int Main(string[] args)<br \/> &nbsp; &nbsp; &nbsp; &nbsp;{<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool installed = false;<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string path = string.Format(@&quot;\\{0}rootSecurityCenter2&quot;, Environment.MachineName);<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var searcher = new System.Management.ManagementObjectSearcher(path, &quot;SELECT * FROM AntivirusProduct&quot;);<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.Management.ManagementObjectCollection managementObjectCollection = searcher.Get();<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach (var managementObject in managementObjectCollection)<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (managementObject[&quot;displayName&quot;].ToString() == &quot;avast! Antivirus&quot;)<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(managementObject[&quot;displayName&quot;]);<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;installed = true;<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.ReadLine();<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (installed) return 1;<br \/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else return 0;<br \/> &nbsp; &nbsp; &nbsp; &nbsp;}<\/p>\n<p>\u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 0. \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d avast! (\u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u0430). \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430 avast! \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 1??&nbsp;&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>static int Main(string[] args) &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool installed = false; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string path = string.Format(@&quot;\\{0}rootSecurityCenter2&quot;, Environment.MachineName); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var searcher = new System.Management.ManagementObjectSearcher(path, &quot;SELECT * FROM AntivirusProduct&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.Management.ManagementObjectCollection managementObjectCollection = searcher.Get(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1435],"tags":[779,1253,1460],"class_list":["post-94816","post","type-post","status-publish","format-standard","hentry","category-windows","tag-c-2","tag-net","tag-programmirovanie"],"_links":{"self":[{"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=\/wp\/v2\/posts\/94816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94816"}],"version-history":[{"count":0,"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=\/wp\/v2\/posts\/94816\/revisions"}],"wp:attachment":[{"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blagovest.org.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}