Click here to Skip to main content
15,908,020 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Accessing Printer Settings Not Built Into .NET Pin
Johan Hakkesteegt13-Apr-11 23:01
Johan Hakkesteegt13-Apr-11 23:01 
QuestionWebrequest & GUI Refresh (Threading?) Pin
cipherwar28-Mar-11 22:37
cipherwar28-Mar-11 22:37 
AnswerRe: Webrequest & GUI Refresh (Threading!) Pin
Luc Pattyn28-Mar-11 23:53
sitebuilderLuc Pattyn28-Mar-11 23:53 
GeneralRe: Webrequest & GUI Refresh (Threading!) Pin
cipherwar29-Mar-11 1:58
cipherwar29-Mar-11 1:58 
GeneralRe: Webrequest & GUI Refresh (Threading!) Pin
Luc Pattyn29-Mar-11 2:08
sitebuilderLuc Pattyn29-Mar-11 2:08 
GeneralRe: Webrequest & GUI Refresh (Threading!) Pin
cipherwar30-Mar-11 19:18
cipherwar30-Mar-11 19:18 
GeneralRe: Webrequest & GUI Refresh (Threading!) Pin
Luc Pattyn30-Mar-11 22:08
sitebuilderLuc Pattyn30-Mar-11 22:08 
QuestionHow to Get Login and Log off information in Windows [modified] Pin
εїзεїзεїз27-Mar-11 22:23
εїзεїзεїз27-Mar-11 22:23 
thanks in advance


i got this code while googled but not working , in this code its giving
errors like ManagementScope is not defined , ObjectQuery is not defined ,
I am not preferring this code, any help will be appreciated.



Imports System.Management
 
Public Class Form2
 
    Private Sub Button1_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs _
    ) Handles Button1.Click
 
        Dim ms As New ManagementScope("\root\cimv2")
        Dim oq As New ObjectQuery("Select * from Win32_Session")
        Dim query As New ManagementObjectSearcher(ms, oq)
        Dim queryCollection As ManagementObjectCollection = query.[Get]()
 
        For Each mo As ManagementObject In queryCollection
            If mo("LogonType").ToString().Equals("2") Then
                '  2 - for logged on User
                MessageBox.Show("Started Time: " + mo("StartTime").ToString)
            End If
        Next
    End Sub
 
End Class 





Any suggestions
SOFTDEV

Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
modified on Monday, March 28, 2011 5:29 AM

AnswerRe: How to Get Login and Log off information in Windows Pin
Eddy Vluggen27-Mar-11 22:36
professionalEddy Vluggen27-Mar-11 22:36 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз27-Mar-11 22:44
εїзεїзεїз27-Mar-11 22:44 
GeneralRe: How to Get Login and Log off information in Windows Pin
Richard MacCutchan27-Mar-11 23:14
mveRichard MacCutchan27-Mar-11 23:14 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз27-Mar-11 23:32
εїзεїзεїз27-Mar-11 23:32 
GeneralRe: How to Get Login and Log off information in Windows Pin
Eddy Vluggen28-Mar-11 0:47
professionalEddy Vluggen28-Mar-11 0:47 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз28-Mar-11 3:37
εїзεїзεїз28-Mar-11 3:37 
QuestionRe: How to Get Login and Log off information in Windows Pin
Eddy Vluggen28-Mar-11 4:05
professionalEddy Vluggen28-Mar-11 4:05 
GeneralRe: How to Get Login and Log off information in Windows Pin
imen53228-Mar-11 20:55
imen53228-Mar-11 20:55 
GeneralRe: How to Get Login and Log off information in Windows Pin
Eddy Vluggen29-Mar-11 0:34
professionalEddy Vluggen29-Mar-11 0:34 
AnswerRe: How to Get Login and Log off information in Windows Pin
Luc Pattyn28-Mar-11 3:16
sitebuilderLuc Pattyn28-Mar-11 3:16 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз28-Mar-11 3:29
εїзεїзεїз28-Mar-11 3:29 
AnswerRe: How to Get Login and Log off information in Windows Pin
Luc Pattyn28-Mar-11 3:36
sitebuilderLuc Pattyn28-Mar-11 3:36 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз28-Mar-11 3:40
εїзεїзεїз28-Mar-11 3:40 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз28-Mar-11 3:46
εїзεїзεїз28-Mar-11 3:46 
GeneralRe: How to Get Login and Log off information in Windows Pin
Luc Pattyn28-Mar-11 4:12
sitebuilderLuc Pattyn28-Mar-11 4:12 
GeneralRe: How to Get Login and Log off information in Windows Pin
εїзεїзεїз28-Mar-11 4:35
εїзεїзεїз28-Mar-11 4:35 
AnswerRe: How to Get Login and Log off information in Windows Pin
Dave Kreskowiak28-Mar-11 4:14
mveDave Kreskowiak28-Mar-11 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.