Click here to Skip to main content
15,909,656 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hard Disk Manufacter Serial Number Pin
Simon Capewell3-Feb-06 6:19
Simon Capewell3-Feb-06 6:19 
GeneralRe: Hard Disk Manufacter Serial Number Pin
Stanciu Vlad3-Feb-06 21:27
Stanciu Vlad3-Feb-06 21:27 
Questionexport text/reports in XLS, HTML, PDF, DBF, XML format Pin
MihaiChioariu3-Feb-06 4:27
MihaiChioariu3-Feb-06 4:27 
AnswerRe: export text/reports in XLS, HTML, PDF, DBF, XML format Pin
malharone3-Feb-06 4:51
malharone3-Feb-06 4:51 
GeneralRe: export text/reports in XLS, HTML, PDF, DBF, XML format Pin
MihaiChioariu3-Feb-06 5:52
MihaiChioariu3-Feb-06 5:52 
GeneralRe: export text/reports in XLS, HTML, PDF, DBF, XML format Pin
malharone3-Feb-06 6:02
malharone3-Feb-06 6:02 
QuestionHelp with Environment.UserName and services Pin
DUKEMAN3-Feb-06 4:04
DUKEMAN3-Feb-06 4:04 
AnswerRe: Help with Environment.UserName and services Pin
Sean Michael Murphy3-Feb-06 5:17
Sean Michael Murphy3-Feb-06 5:17 
DUKEMAN wrote:
But one of the things i need to do is get the current logged in user (i.e. the person who logged into the workstation), but can't seem to get it.


Uhh, I don't think you can get that with 100% certainty. The whole point of services is to insulate your code from requiring a user to be logged in. What would it return when no-one was logged in?

Maybe you could fudge it by iterating over the running processes at some interval and look for User Name not equal to "SYSTEM" or "NETWORK SERVICE" or "LOCAL SERVICE". If someone was logged in, something would be running under their context.

You can get an array of running processes with this code:
C#
System.Diagnostics.Process.GetProcesses()

You can get the contexts of the processes using WMI with code here[^] ( I haven't tried it).

Share and enjoy.
Sean
GeneralRe: Help with Environment.UserName and services Pin
DUKEMAN3-Feb-06 5:33
DUKEMAN3-Feb-06 5:33 
QuestionC# 2.0 & 1.1 interop Pin
ryancrawcour3-Feb-06 3:22
ryancrawcour3-Feb-06 3:22 
AnswerRe: C# 2.0 & 1.1 interop Pin
Sebastian Schneider3-Feb-06 4:22
Sebastian Schneider3-Feb-06 4:22 
AnswerRe: C# 2.0 & 1.1 interop Pin
Daniel Grunwald3-Feb-06 10:07
Daniel Grunwald3-Feb-06 10:07 
QuestionHelp with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 2:55
Martiankeeper3-Feb-06 2:55 
AnswerRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 3:36
mmikey73-Feb-06 3:36 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 3:53
Martiankeeper3-Feb-06 3:53 
GeneralRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 4:11
mmikey73-Feb-06 4:11 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 4:02
Martiankeeper3-Feb-06 4:02 
GeneralRe: Help with Form Load - controls look black before drawing Pin
leppie3-Feb-06 4:14
leppie3-Feb-06 4:14 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 4:24
Martiankeeper3-Feb-06 4:24 
GeneralRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 6:45
mmikey73-Feb-06 6:45 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper5-Feb-06 21:59
Martiankeeper5-Feb-06 21:59 
GeneralRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 7:31
mmikey73-Feb-06 7:31 
Questionquestion about split method c# Pin
fady_sayegh3-Feb-06 0:29
fady_sayegh3-Feb-06 0:29 
AnswerRe: question about split method c# Pin
Ingo3-Feb-06 2:08
Ingo3-Feb-06 2:08 
AnswerRe: question about split method c# Pin
Le centriste3-Feb-06 2:12
Le centriste3-Feb-06 2:12 

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.