It depends on which way you are going to write. For example, if you are deploying your asp.net website, use the default Network Service account, you must give it the correct permission.
To get the account that you are currently using, you can verify the identity of the application pool for your site.
source share