Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
VB.NET
VB.NET General Discussion
Convert Console Application Code to Windows Form Application Code?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Herry Markowitz" data-source="post: 171315" data-attributes="member: 51556"><p>Hi beautiful people,</p><p>Following Console Application code checks if any antivirus program installed or not in your computer. </p><p>[CODE]Imports System.Management</p><p>Namespace ConsoleApplication1</p><p> Class Program</p><p> Public Shared Function AntivirusInstalled() As Boolean</p><p></p><p> Dim wmipathstr As String = "\\" + Environment.MachineName + "\root\SecurityCenter2"</p><p> Try</p><p> Dim searcher As New ManagementObjectSearcher(wmipathstr, "SELECT * FROM AntivirusProduct")</p><p> Dim instances As ManagementObjectCollection = searcher.[Get]()</p><p> Return instances.Count > 0</p><p></p><p></p><p> Catch e As Exception</p><p> Console.WriteLine(e.Message)</p><p> End Try</p><p></p><p></p><p> Return False</p><p> End Function</p><p></p><p></p><p> Public Shared Sub Main(args As String())</p><p> Dim returnCode As Boolean = AntivirusInstalled()</p><p> Console.WriteLine("Antivirus Installed " + returnCode.ToString())</p><p> Console.WriteLine()</p><p> Console.Read()</p><p> End Sub</p><p> End Class</p><p>End Namespace[/CODE]</p><p></p><p></p><p>How to convert above code to Windows Form Application Code?</p><p></p><p>Thanks in advance...</p></blockquote><p></p>
[QUOTE="Herry Markowitz, post: 171315, member: 51556"] Hi beautiful people, Following Console Application code checks if any antivirus program installed or not in your computer. [CODE]Imports System.Management Namespace ConsoleApplication1 Class Program Public Shared Function AntivirusInstalled() As Boolean Dim wmipathstr As String = "\\" + Environment.MachineName + "\root\SecurityCenter2" Try Dim searcher As New ManagementObjectSearcher(wmipathstr, "SELECT * FROM AntivirusProduct") Dim instances As ManagementObjectCollection = searcher.[Get]() Return instances.Count > 0 Catch e As Exception Console.WriteLine(e.Message) End Try Return False End Function Public Shared Sub Main(args As String()) Dim returnCode As Boolean = AntivirusInstalled() Console.WriteLine("Antivirus Installed " + returnCode.ToString()) Console.WriteLine() Console.Read() End Sub End Class End Namespace[/CODE] How to convert above code to Windows Form Application Code? Thanks in advance... [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
VB.NET
VB.NET General Discussion
Convert Console Application Code to Windows Form Application Code?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom