473,468 Members | 1,315 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Property Question

does a property keep its value even when a program is turned off

for instance if i make a class
account
with a property of account name
will it keep that value when i turn off the program

WStoreyII
Nov 20 '05 #1
5 1085
Only if it returns a constant. Otherwise, no.

To do so you would have to serialize the object and write it to disk (or
another medium for storage)

"WStoreyII" <pa**********@sbcglobal.net> wrote in message
news:E5**********************************@microsof t.com...
does a property keep its value even when a program is turned off?

for instance if i make a class
account
with a property of account name
will it keep that value when i turn off the program ?

WStoreyII

Nov 20 '05 #2
If property is set by the user, than you'd have to persist it somehow,
either serialize it or store it in a DB or the registry to be able to get it
Property values are stored in RAM so once the program closes, that space is
cleared out. So the only way you'd get the value again is if it was
persisted or it always returned the same thing.
"WStoreyII" <pa**********@sbcglobal.net> wrote in message
news:E5**********************************@microsof t.com...
does a property keep its value even when a program is turned off?

for instance if i make a class
account
with a property of account name
will it keep that value when i turn off the program ?

WStoreyII

Nov 20 '05 #3
Hi WStoreyII,

Properties cannot store the values as such. You can refer http://www.dotnetspider.com/Technolo...x?SampleId=221 for further details.

Sadha Sivam S
Malleable Minds Software Pvt Ltd
Nov 20 '05 #4
Hi WStoreyII

When you start your program again a complete "New" object (class) is
created.
You are not connecting to your old program.

Cor
Nov 20 '05 #5
* "CJ Taylor" <cege at the123 dont use this part till here tavayn dot com> scripsit:
Only if it returns a constant. Otherwise, no.


LOL!

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6

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

Similar topics

7
by: jeffbernstein | last post by:
Greetings. I'm reading "How to think like a computer scientist: Learning with Python" and there's a question regarding string operations. The question is, "Can you think of a property that...
7
by: vh | last post by:
Hi, I'm new to C#. Most examples about properties I found are sth like the following: class A{ private int property; public int Property { get { return property; } set { property = value; } }...
2
by: Edward Diener | last post by:
How does one specify in a component that a property is a pointer to another component ? How is this different from a property that is actually an embedded component ? Finally how is one notified in...
62
by: djake | last post by:
Someone can explain me why to use property get and property set to access a value in a class, insted of access the value directly? What's the usefulness of property statements in VB.NET? Thanks
27
by: Just Me | last post by:
I made a Usercontrol that must have AutoScroll set to true when it is used. So I set it to True in the Load event. However the property still shows in the properties window when the control is...
3
by: Mark Jones | last post by:
I am quite new to ASP and .Net development and I am building a web-based multiple choice exam application. The web page displays the questions using a Repeater control and the answers are nested...
15
by: Sam Kong | last post by:
Hello! I got recently intrigued with JavaScript's prototype-based object-orientation. However, I still don't understand the mechanism clearly. What's the difference between the following...
10
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset...
0
ADezii
by: ADezii | last post by:
The motivation for this Tip was a question asked by one of our Resident Experts, FishVal. The question was: How to Declare Default Method/Property in a Class Module? My response to the question was...
8
by: Hussein B | last post by:
Hey, I noted that Python encourage the usage of: -- obj.prop = data x = obj.prop -- to set/get an object's property value. What if I want to run some logic upon setting/getting a property?...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.