If I am not mistaken, C# runs behind to do all the fun stuff with the database. I think first you need to find out a way to find out if someone has left, closed, or navigated their browser elsewhere. If so, then you could set C# to trigger (like using a finally block to close a database connection). If that is possible, couldn't you restrict the database to one connection for that user? Then when the connection is closed, the database would allow incoming connections from that user again. If managing the database (triggers, functions, procedures etc.) is not possible, then I would assume that it could be written in C# to listen for (or not) connections from that username. If the refresh rate is set a bit quicker than never, then you could 'simulate' a connection. Although this would put unnecessary load on the server and browser, the problem statement given seemed to indicate that no more than 1 of the same username would be connecting at once. If it is a large amount of usernames to which this same rule applies exists (ie. every one of 30,000 users can only log in with their username from one IP (or one browser) at a time), then that is where the performance would cripple the site, but with that many users, there should be a load-sharing setup already in place - so perhaps a sort of 'adapter' class can be added to do the work? I am just shooting out some thoughts..
On Sep 27, 9:41 am, Stephen Russell <[email protected]> wrote: > On Mon, Sep 27, 2010 at 1:31 AM, VB <[email protected]> wrote: > > Hi, > > I want to restrict user to logged-in on one system at a time...means > > if user logged-in a system then same user will not allow to logged-in > > on another system until logoff from first system... > > I want to know the concept...what should i do ? > > Im using ASP.NET 3.5 with C# > > ------------ > > Others think this is a poor and difficult system in the end. I will > add my vote to theirs > > Or why harass a quality user if they are attempting to assist a pathetic user? > > If this is a university exercise tell the instructor these statements. > The web is stateless so how do I know that they have closed a browser > or run our of memory? > > -- > Stephen Russell > > Sr. Production Systems Programmer > CIMSgts > > 901.246-0159 cell
