473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

delcaring variables to share in different methods

Hi I have a c# windows application vs2005 with a main section and two public
static methods.
Anyhow I am using the same variable in the main section as well as the
methods but in each case I had to create a new variable. Is there a way to
have the variable declared and set in Main and usable in the methods without
passing them into the methods? The methods would only need to read the
variable.
Thanks.
--
Paul G
Software engineer.
Aug 12 '08 #1
0 1151

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Larry Woods | last post by:
I am losing Session variables, but only those that are set in the page previous to a redirect to a secure page. Anyone seen ANY situation where Session variables just "disappear?" Note that...
4
by: Rahul Chatterjee | last post by:
Hello All I have 2 websites both using different style sheets (.css). The stylesheets are stored in a session variable and get set at the time the site gets invoked. What is happening is...
5
by: Wysiwyg | last post by:
I'm new to c# programming and can't figure out how to avoid duplicating common code in multiple classes when I'm restricted to using different system base classes.. I'm using c# in asp.net to write...
4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
6
by: tfsmag | last post by:
here is some test code i've set up trying to figure out how to share variables between two different methods. __________________________________________________ Public Class test Inherits...
7
by: Victor | last post by:
I've got two domain names sharing the same IP address that use ASP VBScript If I set a session variable with domain 1, it is only available for domain 1 - this is correct? If I set an...
6
by: Victor | last post by:
I've got a website that displays the same whether it is accessed using www. or not. ex: http://www.mysite.com and http://mysite.com give me exactly the same website (both represent the top...
3
by: Oops-c++ | last post by:
All, I came to know that, we can define #pragma variables to share values between the processes. #pragma data_seg(".shared") var1 variable2 #pragma data_seg()
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a c# windows application vs2005 with a main section and two public static methods. Anyhow I am using the same variable in the main section as well as the methods but in each case I had...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.