|
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
|
|
|
|
|
S0FTDEV wrote: i got this code while googled but not working
Yes; Google for working code or try to point out what isn't working
I are Troll
|
|
|
|
|
Nopes ,Need directions/hints/any material which can help me in this regards. i don't like copy paste, just posted for reference
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.
|
|
|
|
|
S0FTDEV wrote: ,Need directions/hints/any material which can help me in this regards.
Like Eddy said, explain what is not working; nobody can guess what is happening on your PC.
|
|
|
|
|
I am not preferring this code, any help will be appreciated. i need any guide line so i can get
User Login and out time.
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.
|
|
|
|
|
S0FTDEV wrote: i need any guide line so i can get User Login and out time.
Asking for help begins with "I tried X and it did Y instead of Z, where am I going wrong?". Try to explain what functionality you're after, as opposed to dropping a snippet with your needs.
Is your computer in a domain (validating your credentials against some Windows Server) or on a workgroup? (local credentials)
Write a console-app that gets launched when the user logs in (put a link in the startup folder). You could keep it running, doing nothing, and write down the time again when Windows closes your application (on shutdown, Windows informs your app why it's being closed)
I'm not sure whether the Active Directory keeps this information around, but the above should work under all circumstances.
I are Troll
|
|
|
|
|
Please read the question i mentioned i googled and code is also there that what problem is in it.
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.
|
|
|
|
|
I have also posted a possible solution to the stated problem. Didn't it work?
I are Troll
|
|
|
|
|
hi plz i have function but i d'ont know declared on program vb.net
function .math
Please help me because I am in very big trouble and I need to have this day
its simple function of diagramme rayonnement
|
|
|
|
|
imen532 wrote: hi plz i have function but i d'ont know declared on program vb.net function .math
Using the functions of the Math class[^]; there's examples on the bottom of that page.
imen532 wrote: Please help me because
You'd get more reactions if you started a new thread, and formulated a specific question on what you want help with ("Math" is a bit general)
imen532 wrote: and I need to have this day
Wrong deadline, especially at this price.
I are Troll
|
|
|
|
|
S0FTDEV wrote: ... an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
I haven't seen much of your dedication yet. Most of the time your message boils down to:
"I found this code. It does not work. Help!"
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for the reply , actually i did this for the first time not most of the time
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.
|
|
|
|
|
I admit there have been times you did not even find code.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
, so you are admitting that i put it for the first time , so from where your 1st statement came :P
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.
|
|
|
|
|
Did i asked for code ever ,,,, MVP
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.
|
|
|
|
|
It often is not clear what you want. You seem to have an idea or a need, don't provide much information, don't tell what you have tried nor what exact problem you encountered, and sometimes you don't even ask a question at all.
example 1[^] example 2[^] example 3[^]
I suggest you improve your enquiring style and show more of what you tried, it will result in more, better, and sooner answers.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
lol, i will try to improve
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.
|
|
|
|
|
You really need to sit down with a beginners book on .NET and work through it.
It appears that you're missing a reference to System.Management.dll.
|
|
|
|
|
well, thanks for reply , definitely to learn , i will even stand
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.
|
|
|
|
|
Dear sir,
Please tell me that how create a serial code in visual basic 2008
|
|
|
|
|
That is entirely dependant on what you want to use as a basis for generating the number.
There are lots of different ways, from simple email to hardware checks.
The simplest is a email address, secret salt and a hash generator.
Search google, there are lots of examples for this. There are even components you can plug into your code to for you, including activation mechanisms etc.
|
|
|
|
|
You could trying randomizing alpha numerical characters based on a set of groups ie saved in an array, 3hsu7-8dm28-cne92 and save them to a list, then have another application randomly pick an element from that array and assign it to the application as well as the end user.
|
|
|
|
|
hw to create a table in a form and den add contents to it usin ExecuteReader rather than usin datagrid.
|
|
|
|
|
Uhhh... WHAT? What are talking about? What are you really trying to do? What you said makes very little sense and you didn't exactly supply any requirements to clarify the question.
|
|
|
|
|
hey man,if you don't know how go about my question,then don't answer.. DA'eh :p
|
|
|
|