C#中的共享变量或消息 [英] shared variables or messages in C#
本文介绍了C#中的共享变量或消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨组,
回到我在C下的C和Pascal编程我们曾经有一个
段或外部文件来保存常见消息(错误,警告和...)!
现在是什么?
我如何在一个单元或文件中获得我的消息(与项目相关)?
那么我可以在
项目文件中修改一个文件而不是整个消息吗?
提前感谢
Hi group,
Back to my C and Pascal programming under windows we used to have a
segment or external file to keep common messages (error, warning and ...)!
now what?
how can I have my messages (associated with a project) in a unit or file ?
then I would be able to modifiy just a file instead of the whole messages in
project files ?
thanks in advance
推荐答案
你可以通过拥有一个包含消息,错误等所有静态变量的类来实现同样的目标
public class MessageHolde
public static int Message1 = 10
public static string ErrorMessageXYZ =" Test"
..
Tu-Thac
----- Ramsin Savra写道:----
Hi group
回到我在C和Pascal编程的Windows下,我们曾经有过
段或外部文件来保存com mon消息(错误,警告和......)
现在是什么
如何在单元或文件中获取我的消息(与项目相关)
然后我就可以修改一个文件而不是整个消息我
项目文件
感谢advanc
You can do the same by having a class that holds all static variables to the messages, errors, etc
public class MessageHolde
public static int Message1 = 10
public static string ErrorMessageXYZ = "Test"
..
Tu-Thac
----- Ramsin Savra wrote: ----
Hi group
Back to my C and Pascal programming under windows we used to have
segment or external file to keep common messages (error, warning and ...)
now what
how can I have my messages (associated with a project) in a unit or file
then I would be able to modifiy just a file instead of the whole messages i
project files
thanks in advanc
你可以通过一个包含消息,错误等所有静态变量的类来实现同样的目标。
公共类MessageHolde
public static int Message1 = 10
public static string ErrorMessageXYZ =" Test"
..
Tu-Thac
----- Ramsin Savra写道:----
嗨组
回到我的C和Pascal编程,在windows下我们曾经有过
段或外部文件来保存常见消息(错误,警告和......)
现在是什么
如何在单位或文件中提供我的消息(与项目相关)
然后我会能够修改一个文件,而不是整个消息我
项目文件
感谢advanc
You can do the same by having a class that holds all static variables to the messages, errors, etc
public class MessageHolde
public static int Message1 = 10
public static string ErrorMessageXYZ = "Test"
..
Tu-Thac
----- Ramsin Savra wrote: ----
Hi group
Back to my C and Pascal programming under windows we used to have
segment or external file to keep common messages (error, warning and ...)
now what
how can I have my messages (associated with a project) in a unit or file
then I would be able to modifiy just a file instead of the whole messages i
project files
thanks in advanc
感谢您的帮助。
" Tu-Thach" <一个******* @ discussions.microsoft.com>在消息中写道
新闻:FE ********************************** @ microsof t.com ...
Thanks for your help.
"Tu-Thach" <an*******@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
您可以通过将包含所有静态变量的类保存到
消息,错误等来实现相同目的。
公共类MessageHolder > {
public static int Message1 = 10;
public static string ErrorMessageXYZ =" Test";
...
Tu-Thach
----- Ramsin Savra写道:-----
嗨组,
回到我在Windows下的C和Pascal编程我们曾经有
a段或外部文件来保存常见消息(错误,警告和
....)!现在是什么?
如何在单元或
文件中获取我的消息(与项目相关联)?那么我可以修改一个文件而不是项目文件中的整个
消息吗?
提前感谢
You can do the same by having a class that holds all static variables to the messages, errors, etc.
public class MessageHolder
{
public static int Message1 = 10;
public static string ErrorMessageXYZ = "Test";
...
}
Tu-Thach
----- Ramsin Savra wrote: -----
Hi group,
Back to my C and Pascal programming under windows we used to have a segment or external file to keep common messages (error, warning and ....)! now what?
how can I have my messages (associated with a project) in a unit or file ? then I would be able to modifiy just a file instead of the whole messages in project files ?
thanks in advance
这篇关于C#中的共享变量或消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文