473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Getting the network login

Please,

I need to control the user acess into my intranet pages. Is there a way i
can get the current user logged at my network, that is acessing a specific
page?

My idea is to get the user login, if it was nnn let the user access
otherwise block data.

Tks in adv.

Fabiano
Nov 18 '05 #1
2 1435
First, you have to force logon, otherwise the user is IUSR. To do this, turn
off anonymous access. You can now use a variety of methods to pull up the
user Identity. The easiest is Request.ServerVariables["LOGON_USER"]. Since
domain can show up, I use a routine like so:

private string GetUserNumber()
{
// Set up character(s) to split on
char splitChar = '\\';

// Split user to get user ID only
string[] user = Request.ServerVariables["LOGON_USER"].Split(splitChar);
int userArrayMax = user.Length-1;
// This is designed for lookup of user
return user[userArrayMax];
}

You only want the part after the whack for user identity ... unless you also
have multiple domains and need that portion as well.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Fabiano" <fm****@ctf.com.br> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
Please,

I need to control the user acess into my intranet pages. Is there a way i
can get the current user logged at my network, that is acessing a specific
page?

My idea is to get the user login, if it was nnn let the user access
otherwise block data.

Tks in adv.

Fabiano

Nov 18 '05 #2
If you are using Windows authentication in your application, you can invoke
a call to the User property of the Page class to get the current user logged
in.

Dim myUserName as string
If User.Identity.IsAuthenticated then
myUserName = User.Identity.Name
end if

--Michael

"Fabiano" <fm****@ctf.com.br> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
Please,

I need to control the user acess into my intranet pages. Is there a way i
can get the current user logged at my network, that is acessing a specific
page?

My idea is to get the user login, if it was nnn let the user access
otherwise block data.

Tks in adv.

Fabiano

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Wolff | last post by:
Hi, I need to know if its possible to create an ASP page that when requested will display the network id of the requester. Most people have told me to query the...
3
by: Stanley J, Mroczek | last post by:
My disk was replaced and i reload all my software. I think that i named my computer best-si-01 instead of BEST-SI-01 and thats my error? Login failed for user 'NT AUTHORITY\NETWORK SERVICE'....
5
by: owyn | last post by:
One of my coding partners swears you can capture the network login name so that we can use it to set security levels. If that can be done how do you do it. References to articles etc would be...
0
by: Benny Raymond | last post by:
I'm currently writing a time tracking app to replace the one we've had on our intranet for quite some time. I'd like to set this up to communicate with a server side asp page using xml data...
3
by: Dan Nash | last post by:
Hi Any ideas on this... having moved the web app to another server, and setup all the WebApp data (disable anonymous access etc), locally my site still asks me for a Username/Password, even...
3
by: Don | last post by:
I'm using FROMS authentication and want to automate the login. Right now I force the user to manually log in. I would like to detect the users network userName and if they have an account I will...
3
by: Tomdhu | last post by:
As a Newbie I've picked up a heap of tips and tricks from this NG but I have been battling to get the current user's Netwok Login ID recorded on a form at the time a new record is created or...
9
by: =?Utf-8?B?UmF5?= | last post by:
Have SQL server on one machine. Have IIS on another machine in same large intranet. Have website in IIS with Basic Authentication turned on and other options deselected. Have webpage (.aspx) with...
5
by: greatjuli | last post by:
Hi, I am trying to develop intranet for my company as the new web admin. When users log in to the network with their username and password, they do not need to login again into the intranet; a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.