Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发 Microsoft Visual C# 2010 Express。我在 Microsoft Access 2007 上使用数据库。现在最后,我必须将所有产品的名称从数据库存储到 INI 文件。请帮我。我是新来的。
不幸的是,Microsoft 认为不推荐使用 ini 文件(请参阅 eg 文档中的注释GetPrivateProfileString),并且在公共语言运行时中没有包含对它们的直接支持。无论如何,使用它们的一种简单方法是使用from导入 Windows SDK 函数Get/SetPrivateProfileString和Get/SetPrivateProfileInt(由 Kernel32.dll 导出)。DllImportAttributeSystem.Runtime.InteropServices
GetPrivateProfileString
Get/SetPrivateProfileString
Get/SetPrivateProfileInt
DllImportAttribute
System.Runtime.InteropServices