在.NET应用程序中保存应用程序数据的位置 [英] Where to save application data in .NET application

查看:101
本文介绍了在.NET应用程序中保存应用程序数据的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序类似于联系人管理器.假设用户可以输入带有其地址的联系人.我拥有将联系人保存到文件中的代码和技术.但是我应该在哪里保存该文件?

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?

考虑到这是一个在Windows上运行的.NET应用程序.我的文件应该放在用户文件夹的AppData中吗?我是否应该使用隔离存储(如此处所述)?还有别的吗推荐的做法是什么?

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?

推荐答案

我最终使用了Patrick建议的解决方案:

I ended up using the solution Patrick suggested:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

这篇关于在.NET应用程序中保存应用程序数据的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆