Where to store string messages?
- From: "martin-g" <martin-g@xxxxxxx>
- Date: 20 Oct 2006 00:38:53 -0700
Hi.
Almost every application have to write out some messages to the user.
The question is how to store them. For example, while programming for
Windows in C++ we could store these messages as string resource and
load them using LoadString API function. I'm quite new to C#, and the
best thing I've managed is creating private constant members of a
class. E. g.:
public class ExpandManager
{
....
#region Message declarations
private const string ERR_NOSUCHFILE = "File not found: ";
private const string ERR_EMPTY = "The selected workbook seems to be
empty.";
private const string ERR_LOCATECOL = "Couldn't locate the column
with area codes.";
private const string MSG_OPEN = "Opening source";
private const string MSG_CALCDIMS = "Obtaining ratelist
dimensions";
private const string MSG_PREPAREOUT = "Preparing output workbook";
private const string MSG_EXPAND = "Expanding code intervals";
#endregion
}
Isn't there an elegant way to solve this issue?
Thanks in advance
Martin
.
- Follow-Ups:
- Re: Where to store string messages?
- From: Truong Hong Thi
- Re: Where to store string messages?
- Prev by Date: Re: Thread.Abort()
- Next by Date: Re: Remove network connection
- Previous by thread: sql server 2005, visual studio 2005, Debug database?
- Next by thread: Re: Where to store string messages?
- Index(es):