I have a simple string that I would like to save for later use on an ASP.NET server. It is an authorization string for a web service. It mostly stays the same, but may expire every few months. It will be saved programmatically from a code-behind file. Is there a simple place I can save it?
Initial thoughts are:
- File – seems reasonable
- Database – we don’t have one setup and it seems like a lot of overhead to hold a string
- Session – this would be too short lived
- Config file – Based on answer from MK_Dev this would require a web app restart. No go then.
- Somewhere else that I don’t know about, but would be perfect?
Another possibility is to create a custom registry key. Here is an article with some code examples: Manipulating and Editing Registry with .NET.