Ok now we have weird requirement. The requirement could be realised as follows, even though my requirement is little different. Every product has some documents associated with it. When public user asks for a document, he should be given the file. These files are located on shared drives on network. When ASP.NET Application runs it runs under ASPNET account. This is local account and cannot access network resources. The company does not want to give aspnet account the previledge to access the resources on network drives, they want us to use some predefined user name. So our web app must run under that username. Again the client doesn’t want the app to use the username all the time.
Now, the solution was simple. We need to do impersonation. When the user asks for the file, web app must impersonate as network user, get the file, stream it on to browser and change back to old username.