注册表或.NET中的等价物? [英] Registry or equivalent in .NET ?

查看:76
本文介绍了注册表或.NET中的等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我写了一个小的C#应用​​程序,它有工具栏,可以隐藏和重新定位
。当程序关闭时,我应该如何记录

工具栏的当前状态,以便它可以在下次运行时以相同的方式显示在

中?


以前在MFC下我会使用注册表来保存这个

配置信息。这仍然是.NET中的首选方法还是

有更好的方法。我有一个模糊的想法,你应该使用meta

数据,但是你会怎么做呢?


谢谢,

Anthony。

解决方案

我继续使用Registry for UI元素位置/大小/等

设置。


我看到配置文件比这更稳定:

偶尔会改变,而且(几乎?)从不通过程序本身。


元数据通常被编译到你的程序中,因此不是一个保存这样设置的适当位置(我是甚至不确定

会起作用)。 :-)


我会抛弃我的


0.02,但等待其他回复。 :)我有一个应用程序

我现在正在努力。它将被放置在系统托盘中,并且具有许多设置选项,以及存储当前/最后的

配置。我计划将当前状态存储在XML配置

文件中。在我的小脑海中,这就是MS推动我们的方式。它从一个

INI文件(在Windows 3.x天)到注册表(Win9x),现在'它'是'

显然回头了到INI类型文件。我不知道是谁制作了这些东西,但显然在设计这些东西方面有工作保障。

:)

我期待这个帖子中的其他输入!


Clint


" Anthony" <一个****** @ rocketmail.com>在留言中写道

news:11 ********************** @ u72g2000cwu.googlegr oups.com ...



我写了一个小型的C#应用​​程序,它有可以隐藏和重新定位的工具栏。当程序关闭时,我应该如何记录
工具栏的当前状态,以便下次运行时能够以相同的方式显示它?

以前在MFC下我会使用注册表来保存这个
配置信息。这仍然是.NET中的首选方法,还是有更好的方法。我有一个模糊的想法你应该使用meta
数据,但是你会怎么做呢?

谢谢,
Anthony。



Hi,

I''ve written a small C# application which has toolbars which can be
hidden and repositioned. How should I record the current state of the
toolbars when the program shuts down so that it can be displayed in the
same way next time its run ?

Previously under MFC I would have used the registry to save this
configuration info. Is this still the preferred method in .NET or is
there a better way. I have a vague idea you''re supposed to use meta
data, but how would you do this in practice ?

Thanks,
Anthony.

解决方案

I continue to use the Registry for UI element position / size / etc
settings.

I see config files as being much more stable than this: something that
is changed occasionally, and (almost?) never by the program itself.

Meta data is typically compiled into your program, and so is not an
appropriate place to save settings like this (I''m not even sure how
that would work). :-)


I''ll throw out my


0.02, but wait for other responses. :) I''ve got an app
that I''m working on right now. It''s gonna sit in the system tray, and have
a number of set-up options, as well as storing the current/last
configuration. I plan on storing the current status in an XML configuration
file. In my little mind, that''s the way MS is pushing us. It went from an
INI file (in the Windows 3.x days) to the registry (Win9x), and now''s it''s
apparently heading back to INI type files. I don''t know who makes these
things up, but apparently there''s job security in architecting these things.
:)

I look forward to other input in this thread!

Clint

"Anthony" <an******@rocketmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...

Hi,

I''ve written a small C# application which has toolbars which can be
hidden and repositioned. How should I record the current state of the
toolbars when the program shuts down so that it can be displayed in the
same way next time its run ?

Previously under MFC I would have used the registry to save this
configuration info. Is this still the preferred method in .NET or is
there a better way. I have a vague idea you''re supposed to use meta
data, but how would you do this in practice ?

Thanks,
Anthony.



这篇关于注册表或.NET中的等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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