Click here to Skip to main content
15,888,218 members
Home / Discussions / C#
   

C#

 
GeneralRe: Managed C# Compiler question Pin
LongRange.Shooter13-Mar-03 10:53
LongRange.Shooter13-Mar-03 10:53 
GeneralRe: Managed C# Compiler question Pin
LongRange.Shooter19-Mar-03 10:29
LongRange.Shooter19-Mar-03 10:29 
QuestionSending commands between Windows applications? Pin
Kryal13-Mar-03 6:13
Kryal13-Mar-03 6:13 
AnswerRe: Sending commands between Windows applications? Pin
Davy Mitchell13-Mar-03 22:02
Davy Mitchell13-Mar-03 22:02 
QuestionHow to create global variables in C#? Pin
Vitaliy Vorontsov13-Mar-03 6:10
Vitaliy Vorontsov13-Mar-03 6:10 
AnswerRe: How to create global variables in C#? Pin
leppie13-Mar-03 6:36
leppie13-Mar-03 6:36 
AnswerRe: How to create global variables in C#? Pin
Xiangyang Liu 刘向阳13-Mar-03 6:40
Xiangyang Liu 刘向阳13-Mar-03 6:40 
AnswerRe: How to create global variables in C#? Pin
kaschimer13-Mar-03 6:40
kaschimer13-Mar-03 6:40 
You could create an abstract super class that defines the variables that need to be global, then derive all of your classes from that one class.

Alternatively, If you don't need to update the value of the variable, then you could define it in a .config file, and then read the config file from the classes that need to access the variable. If you need to change it or share it between application types (web, windows, windows services, etc.), then define an XML document somewhere on your system and then read from and update it in the classes where you use it.

I'm sure there is probably a better way to do it, but this is my 2c.

RabidK
AnswerRe: How to create global variables in C#? Pin
Robert Hinrichs13-Mar-03 7:45
Robert Hinrichs13-Mar-03 7:45 
GeneralRe: How to create global variables in C#? Pin
Jeff J13-Mar-03 8:16
Jeff J13-Mar-03 8:16 
AnswerRe: How to create global variables in C#? Pin
Adam Turner13-Mar-03 11:02
Adam Turner13-Mar-03 11:02 
QuestionHow to update a Windows Service Pin
Chris Hansson13-Mar-03 5:55
Chris Hansson13-Mar-03 5:55 
AnswerRe: How to update a Windows Service Pin
Xiangyang Liu 刘向阳13-Mar-03 6:27
Xiangyang Liu 刘向阳13-Mar-03 6:27 
GeneralDefault argument values Pin
Alexandru Savescu13-Mar-03 4:23
Alexandru Savescu13-Mar-03 4:23 
GeneralRe: Default argument values Pin
Daniel Turini13-Mar-03 4:45
Daniel Turini13-Mar-03 4:45 
GeneralRe: Default argument values Pin
Alexandru Savescu13-Mar-03 5:00
Alexandru Savescu13-Mar-03 5:00 
GeneralRe: Default argument values Pin
Daniel Turini13-Mar-03 5:17
Daniel Turini13-Mar-03 5:17 
GeneralRe: Default argument values Pin
Alexandru Savescu13-Mar-03 5:28
Alexandru Savescu13-Mar-03 5:28 
GeneralRe: Default argument values Pin
Andy Smith13-Mar-03 6:46
Andy Smith13-Mar-03 6:46 
GeneralRe: Default argument values Pin
Nick Parker13-Mar-03 8:22
protectorNick Parker13-Mar-03 8:22 
GeneralCasting userdefined parameter class Pin
Venkatraman12-Mar-03 20:18
Venkatraman12-Mar-03 20:18 
GeneralRe: Casting userdefined parameter class Pin
leppie13-Mar-03 6:19
leppie13-Mar-03 6:19 
GeneralSynchronized collections Pin
Don Miguel12-Mar-03 19:47
Don Miguel12-Mar-03 19:47 
GeneralRe: Synchronized collections Pin
Kannan Kalyanaraman12-Mar-03 21:24
Kannan Kalyanaraman12-Mar-03 21:24 
GeneralRe: Synchronized collections Pin
James T. Johnson13-Mar-03 11:33
James T. Johnson13-Mar-03 11:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.