views:

69

answers:

2

I'm trying to put together a (real-life) game for my college campus and it'd be really easy if they just go to a website and click a button that says "Sign Me Up!" in which that button would send the username that person is signed in as (Since user names on our school laptops are always firstname.lastname). If there's no way I can grab the person's username, is there a way I can prevent people from submitting multiple forms with more then just a cookie?

+4  A: 

are you looking this...

HttpContext.Current.User.Identity.Name
Muhammad Akhtar
A: 

Are you going to be able to host this site on your College's network? if you are, and you've enabled Windows Authentication rather than Forms Authentication then querying the Current user's Identity will "just work".

If you're going to have to host the site elsewhere, or on a different area of the college network (say a different domain), then using windows authentication won't provide the solution for you.

You'll need to create a simple registration page (you could easily use the standard registration wizard and login controls, talking to the default ASP.NET Membership database - see Introduction to Membership for more details).

In terms of limiting sign-ups to one per user, if you collect (say) a college or similar email address you can check those for uniqueness as well, and ensure that people are only signing up once (admittedly potentially per email address they have).

Zhaph - Ben Duguid