ASP.NET Questions about using shared methods
I did some searching and wasn't getting any clear answers. I have four pages of an ASP.NET website use the exact same code to do the following:
- decrypt a file on the web server
- read from the decrypted file
- delete the decrypted file
- create a cookie
- select from a database
- redirect to another page
It's also important to note that several of the above functions make use of the Response property of the page. I was thinking since the code is exactly the same in all 4 places, I should just move it to a class file and call it from there instead. Assuming I don't use shared variables, is it safe to use Shared methods in this way (passing in the Response as a parameter)? If two users of the site hit the methods at the same time, could any of their information get crossed? Could the file operations result in some kind of lock? Thanks in advance.
0 comments:
Post a Comment