يجب تسجيل الدخول تسجيل الدخول إذا كنت لا تملك عضوية تسجيل عضوية جديدة معلومات اتصال المُعلن والردود والصور المرفقة والاسعار لا تضهر إلا بعد تسجيل الدخول
Introduction
INI files and the registry are generally things of the past for .NET applications. But what to use? XML seems appropriate, but one look at System.XML is enough to scare most developers off, especially just to store a few fields. Fortunately, there is a very easy way in .NET to solve this, but one that is usually not seen by developers. In this article, I’ll explain how you can easily store and retrieve your application settings with just a few lines of code.
History
In Windows 3.1, developers used INI files to store settings. In general, they worked pretty well for simple settings, but were not appropriate for more complex data. INI files also did not account for multiple users, and thus Microsoft invented the registry.
Along came the registry with Win32. The registry was fast, hierarchical, multi user, and allowed storage of typed data. But unfortunately, the registry was a central system component and was not contained as part of the application install.
Next, XML became popular. XML offers fast, hierarchical storage of typed data. However, XML is so flexible that for most users doing anything simple is quite an undertaking. Fortunately, there are easier ways than using System.XML and handling everything yourself.
Old Ways
Many users have simply resorted to using INI files or the registry. INI files are not supported in .NET. To use INI files, a developer must call the Win32 API directly, or use some prepared classes on the Internet that use the Win32 API. For the registry, classes are available in Microsoft.Win32. XML however is portable and can be easily edited by end users if necessary.
How
The secret to painless XML settings files is to use a typed DataSet. A typed DataSet is actually an in memory dataset for working with ADO.NET, but they have many other uses as well. To add a typed DataSet to your application, right click on the project in the Solution Explorer, and select Add New Item. Now select DataSet, and give the dataset a name.
يجب تسجيل الدخول تسجيل الدخول إذا كنت لا تملك عضوية تسجيل عضوية جديدة معلومات اتصال المُعلن والردود والصور المرفقة لا تضهر إلا بعد تسجيل الدخول
كافة الحقوق محفوظة All rights reserved 2016 - 2025
توثيق المركز السعودي للأعمال رقم 0000052860 رقم الوثيقة FL-569576966 Projects and solutions