문제

My application is something similar to a Contact Manager. Let's say a user can enter contacts with their addresses. I have the code and technology to save my contacts to a file. But where do I save that file?

Considering this is a .NET application running on Windows. Should my file end up in the AppData of the users folder? Should I use the Isolated Storage (as mentioned here)? Something else? What's the recommended practice?

도움이 되었습니까?

해결책

I ended up using the solution Patrick suggested:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

다른 팁

You have a number of options; as you say, Isolated Storage is one of them. You could also use the User Settings framework feature and save the data as a blob of data, or as XML.

You could also take a look at SqlCompact for a very lightweight in-process database. You can then save all user contacts in a single database which could live e.g. in the same directory as the application; you could easily use something like EF4 for your DAL.

That might be a bit more effort though, as it sounds like you are 99% of the way there with your current architecture.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top