2
< system.web >

< authorization >

< allow roles = " User " />

< deny users = " * " />

</ authorization >

</ system.web >

In which section I write code and what I write to configure that only 10 users access the asp.net website

Sumit Kumar
  • 15
  • 1
  • 4

3 Answers3

2

There's no built-in ASP.NET feature for that; you will have to write your own code.

A good starting point will be to count the number of current users in Session_Start and Session_End, but note that you cannot reliably detect the fact that a user closed his browser without "logging out".


EDIT: If you use the ASP.NET Membership provider, Membership.GetNumberOfUsersOnline can give you an estimate of how many users are currently using your application. It reports "the number of users for the current [application] where the last-activity date is greater than the current time less [some configurable time window]."

Community
  • 1
  • 1
Heinzi
  • 167,459
  • 57
  • 363
  • 519
  • Note: Session_end just triggered in InProc mode .if you use SQL mode u just use another strategy like save IP and last activity time – Ali Foroughi Apr 10 '12 at 06:54
0

you can set maxconnection in in machine config

Krishnanunni Jeevan
  • 1,719
  • 1
  • 15
  • 24
0

Do you want to limit number of users or number of sessions both. ASP.NET membership provider is good option for restricting number of users.

You can limit maximum number of session allowed in web.config.

<system.webServer> 
  <asp>
    <session max =""/>
  </asp>
</system.webServer>

Hhere is a link that describes session configuration in IIS too.

userGS
  • 220
  • 1
  • 7