Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can some one please convert this code in vb.net. I tried alot but failure every time.

VB
Dim colUpdate, oUpdate, iTHCount, oWU
            Dim strBuilder As New System.Text.StringBuilder
            ' creating com object
            oWU = CreateObject("Microsoft.Update.Searcher")
            iTHCount = oWU.GetTotalHistoryCount
            If iTHCount > 0 Then
                Dim dr As DataRow
                colUpdate = oWU.QueryHistory(0, iTHCount)
                For Each oUpdate In colUpdate
                    If oUpdate.ResultCode = 2 Then ' only succeeded updates
                        dr = dtUpdates.NewRow()
                        dr("Name") = oUpdate.Title.ToString.Trim
                        dtUpdates.Rows.Add(dr)
                    End If
                Next
            End If


thanks in advance.
Posted
Comments
[no name] 29-Aug-13 9:59am    
What have you tried for yourself? What does "failure every time" even mean?

1 solution

Then you should try this one:
Converting VB Script To VB.Net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900