title: In ASP.NET, under which credentials does the code run?
body: <p>1)   I want to know suppose we are using an ASP.NET web application in debug mode in VS, then, the code runs under which user account?</p>
  
  <p>2)   I also want to know, suppose we publish this to the IIS and then, set it up to use WBA/FBA, then, the username/password of logged in user is used to authenticate user to the ASP.NET site, however, the code <em>(SQL query, etc)</em> runs under credentials of apppool account. <em>Further, which credential is used to access resources on server like files?</em> What is your view on this point?</p>