How do I persist file-independent variables in VSTO that can persist even after the Microsoft Office has closed
I am using VSTO (visual tools for office.) I need to store a variable that is file-independent (so I cannot stored it in a file meta-data as 开发者_运维问答in this question) and can persist after Microsoft office has closed and been restarted. How can I do this?
Note Is there any way built into VSTO? I want registry, XML, or SQL server ce to be the last resort
There are a plenty of ways to do so:
- Store your data as XML serialization in specific file under predefined direcotry (e.g. %appdata% folder).
- Store your data using web service which provides data storage (your own web service or remote database, etc.).
- Store data in system registry as values located in predefined registry key.
精彩评论