本文介绍了储存已储存讯息的最佳地点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在创建一个控制台应用程序,它仅接受我定义的一些命令.问题是我在我创建的称为Messages的静态类上存储了很多错误和通知消息,然后像Messages.ErrorMessage ...这样调用它们.控制台.我想问的是这是否是实现这种行为的好方法,还是应该更改我保留所有这些消息的位置?

I am currently creating a console applications that only accepts some commands defined by me. The thing is I'm storing a lot of error and notification messages on a static class I created called Messages and then just calling them like Messages.ErrorMessage.... ErrorMessage is just a static string that contains w/e I want printed on the console.What I wanted to ask is if that's a good way of implementing such behavior or should I instead change where I'm keeping all of this Messages?

感谢您的帮助!

推荐答案

我想您可以使用资源文件代替静态类.

I guess for your need you can use Resource file instead of static class.

在官方网站上记录

有关更多信息:-

http://msdn.microsoft.com/en-us/library/7k989cfy(v = VS.90).aspx

这篇关于储存已储存讯息的最佳地点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 19:40