How to get Current Username

Page 1 of 1

9 Replies - 656 Views - Last Post: 10 July 2012 - 03:10 PM Rate Topic: -----

#1 SwaroopH  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 10-July 12

How to get Current Username

Posted 10 July 2012 - 01:22 PM

Hallo friends, am new with C#,

My Question is how can i grab a username from my LAN network where atleast 50 PC's are connected.
i am able to get my username using this code :

 Lable1=System.Environment.Username; 


how can i get a username from Other Computer..please suggest a resolution.. :helpsmilie:

Thanks in Advance

Is This A Good Question/Topic? 0
  • +

Replies To: How to get Current Username

#2 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4559
  • View blog
  • Posts: 7,980
  • Joined: 08-June 10

Re: How to get Current Username

Posted 10 July 2012 - 01:42 PM

You basically can't. You want to get the logged on user of a computer that your program is not running on? That's either management software or malware.
Was This Post Helpful? 1
  • +
  • -

#3 SwaroopH  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 10-July 12

Re: How to get Current Username

Posted 10 July 2012 - 02:24 PM

I just want to make a Attendence System based on those LAN computers and there User's.
for that reason i want those all username's which are connected to my LAN.
If there is any other better way to make this software then please let me know.

Thanks Curtis Rutland..for answering..
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3652
  • View blog
  • Posts: 11,421
  • Joined: 05-May 12

Re: How to get Current Username

Posted 10 July 2012 - 02:40 PM

Well, if you are managing those machines, you can have a small program on each machine's StartUp folder that phones home to say that the user logged in. But then that also smells a lot like malware. Oh wait, the IT department of the company I work for already does something very similar... So it must be management software and not malware in that context. :lol:

Actually, if your LAN is using Active Directory (assuming you have a PC based network), then I believe that the AD logs will tell you who is on which machine.
Was This Post Helpful? 1
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5632
  • View blog
  • Posts: 12,080
  • Joined: 02-June 10

Re: How to get Current Username

Posted 10 July 2012 - 02:43 PM

I think you lack and understanding of networking.
You don't log into "the network". You log into a PC. You can connect to a shared drive on a server: Either with the same login as the PC or a different set of credentials.

As Curtis pointed out this method sounds a LOT like malware. If you want to create an attendance system then you should make a small client/server set of programs and have the employee 'clock in' through that package.
Was This Post Helpful? 1
  • +
  • -

#6 SwaroopH  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 10-July 12

Re: How to get Current Username

Posted 10 July 2012 - 02:46 PM

Any other way to make a Attendence system on LAN Where i get a specific information like Username and Machine name. if so then please let me know.

Any New Idea is appreciated..

Thanks ...Skydiver ..for not to declare this as a Malware...its a really a management Sofware to track the Username and Machine name for Attendance purpose only..
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5632
  • View blog
  • Posts: 12,080
  • Joined: 02-June 10

Re: How to get Current Username

Posted 10 July 2012 - 03:00 PM

Other than the existing suggestion you mean?

View PosttlhIn`toq, on 10 July 2012 - 03:43 PM, said:

If you want to create an attendance system then you should make a small client/server set of programs and have the employee 'clock in' through that package.


What is wrong with that suggestion? Its the right way to do it. That you want to NOT do it that way makes me think you don't have permission to install software on those machines: IE You are not part of the approved IT department - IE: This is unapproved/malware.
Was This Post Helpful? 0
  • +
  • -

#8 SwaroopH  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 10-July 12

Re: How to get Current Username

Posted 10 July 2012 - 03:00 PM

View PosttlhIn`toq, on 10 July 2012 - 02:43 PM, said:

I think you lack and understanding of networking.
You don't log into "the network". You log into a PC. You can connect to a shared drive on a server: Either with the same login as the PC or a different set of credentials.

As Curtis pointed out this method sounds a LOT like malware. If you want to create an attendance system then you should make a small client/server set of programs and have the employee 'clock in' through that package.



Yup because am new to C# already and Netwoking as well..thts why i need a good suggestion.
Would be better sir if you give me or suggest me an idea..

What need to code and where?...because i am confused..Or else i will drop this idea to make a attendence Programmee. :innocent:
Was This Post Helpful? 0
  • +
  • -

#9 SwaroopH  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 10-July 12

Re: How to get Current Username

Posted 10 July 2012 - 03:06 PM

View PosttlhIn`toq, on 10 July 2012 - 03:00 PM, said:

Other than the existing suggestion you mean?

View PosttlhIn`toq, on 10 July 2012 - 03:43 PM, said:

If you want to create an attendance system then you should make a small client/server set of programs and have the employee 'clock in' through that package.


What is wrong with that suggestion? Its the right way to do it. That you want to NOT do it that way makes me think you don't have permission to install software on those machines: IE You are not part of the approved IT department - IE: This is unapproved/malware.



Lol...your suggestion is very good Mr....and FYI..i have the rights to install anything on whole network system...but dont know how to implement your idea (if u write it down in brief thn may be i will understand) (actually dont knw what to write down in code ..nothing else). and would be nice if u stop declaring it as a Malware..please. :whatsthat:
Was This Post Helpful? 0
  • +
  • -

#10 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5632
  • View blog
  • Posts: 12,080
  • Joined: 02-June 10

Re: How to get Current Username

Posted 10 July 2012 - 03:10 PM

View PosttlhIn`toq, on 10 July 2012 - 02:43 PM, said:

If you want to create an attendance system then you should make a small client/server set of programs and have the employee 'clock in' through that package.


View PostSkydiver, on 10 July 2012 - 03:40 PM, said:

Well, if you are managing those machines, you can have a small program on each machine's StartUp folder that phones home to say that the user logged in.


View PostSwaroopH, on 10 July 2012 - 04:00 PM, said:

Yup because am new to C# already and Netwoking as well..thts why i need a good suggestion.
Would be better sir if you give me or suggest me an idea..


We have already given you a good suggestion several times.

View PostSwaroopH, on 10 July 2012 - 04:00 PM, said:

What need to code and where?...because i am confused..Or else i will drop this idea to make a attendence Programmee. :innocent:


Ohhhhh.... You want us to write your program for you - THat's your idea of a 'suggestion'.

It doesn't work that way. We aren't your code monkeys;

Attached Image


You need to make an attempt to write your own software and we will help you with specific problems.

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.


If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Mar 2012
Spoiler

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1