Ask a Question related to ASP.NET General, Design and Development.
-
jeff #1
Public Constants
Hi,
what is a good way to implement public common constants. like what we do in
a common header file in C++.
jeff
jeff Guest
-
Sharing Constants in Multiple Applications - Public vs.Private
I use private and public constants throughout my application to store hardcoded WSDL URLs and WebService methods. Many of these are the same in... -
ADO Constants
I'm trying to transfer an intranet app from one server to another. I'm having a problem with the ADO constants on the destination server. Our... -
constants
hi, why should I use constants? thx for help Michael -
ASP Constants
Hi, In order to create an ADO connection and gets it running, I have to declare the ADO constants as : "<!-- METADATA TYPE = "Typelib" File =... -
Using Constants
I'm considering using constants for some predefined paths in my script, like HTML_DIR, INC_DIR. These values won't change and they will be global... -
Natty Gur #2
Re: Public Constants
The c# compiler try to impose OO and dont let you declare variables if
they arnt member of class, delegate, enum, interface, or struct.
you can declare the constans as static readonly members :
public class Consts
{
public static readonly string MyName = "natty";
}
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
abacnet #3
Re: Public Constants
Hi Guys,
Here is my suggestion and how I did it in VB :
1-Create a new Class Library project in VB
2-Delete the default class file
3-Add a new module
4-Here is code of module
Public Module Module1
Public Const MY_CONSTANT As String = "FDSFSD"
End Module
5-Compile the new project called constants2, which will give me a dll
(constants2.dll)
6-Create a new project called Test_constant
7-Add the constants2.dll in the bon directory of project Test_constant and
add reference to constants2.dll
9-And in page load of the starting page of Test_constant
Label1.Text = constants2.Module1.my_constant
And label shows "FDSFSD". So it seems to work.
I have not tried it but I beleive we can also put the dll in the GAC to
share it with all the applications.
"jeff" <i n d i a m e s s e n g e [email]r@yahoo.com[/email]> wrote in message
news:O3OOfswVDHA.384@TK2MSFTNGP12.phx.gbl...in> Hi,
>
> what is a good way to implement public common constants. like what we do> a common header file in C++.
>
> jeff
>
>
abacnet Guest



Reply With Quote

