Click here to Skip to main content
15,910,123 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralList installed screensavers Pin
Ryan McCauley22-Apr-05 12:34
Ryan McCauley22-Apr-05 12:34 
GeneralRe: List installed screensavers Pin
Peter Ritchie24-Apr-05 9:10
Peter Ritchie24-Apr-05 9:10 
GeneralRe: List installed screensavers Pin
Ryan McCauley25-Apr-05 4:55
Ryan McCauley25-Apr-05 4:55 
GeneralRe: List installed screensavers Pin
Peter Ritchie25-Apr-05 5:41
Peter Ritchie25-Apr-05 5:41 
GeneralRe: List installed screensavers Pin
Ryan McCauley25-Apr-05 7:23
Ryan McCauley25-Apr-05 7:23 
GeneralRe: List installed screensavers Pin
Peter Ritchie25-Apr-05 10:27
Peter Ritchie25-Apr-05 10:27 
GeneralGet object name Pin
CSharpDavid22-Apr-05 7:24
CSharpDavid22-Apr-05 7:24 
GeneralRe: Get object name Pin
turbochimp22-Apr-05 8:49
turbochimp22-Apr-05 8:49 
Are you asking how to get an instance variable's name? For instance, if I wrote:

public void DoSomething()<br />
{<br />
    string myFoo = new FooType();<br />
}


would you want to know, at serialization time, that the variable name was 'myFoo'? If so, what advantage does that provide?

In any case, I don't think that's possible at runtime. A quick look at the ILDASM (Intermediate Language) representation of the class above makes it clear that locally scoped member variable names are discarded in the compilation to IL.

It is probably important to note that the names of field-level variables, method names etc., whether public or private, are preserved during compilation, so technically you could use reflection to get the names.

However, if your class(es) implement the ISerializable interface (as opposed, or in addition to being marked with [SerializableAttribute]), then you are free to develop your own serialization and deserialization plans for the class(es). The ISerializable interface exists to deal with just this kind of issue (provide developers with a way to prevent deserialization exceptions caused by versioning), among other things.

Hope this helps.

The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

GeneralRe: Get object name Pin
Peter Ritchie24-Apr-05 9:30
Peter Ritchie24-Apr-05 9:30 
Generalreturn Bitmap.FromStream(new MemoryStream(buffer)) as Bitmap; Pin
rlinder21-Apr-05 11:32
rlinder21-Apr-05 11:32 
GeneralRe: return Bitmap.FromStream(new MemoryStream(buffer)) as Bitmap; Pin
Dave Kreskowiak21-Apr-05 16:04
mveDave Kreskowiak21-Apr-05 16:04 
GeneralRe: return Bitmap.FromStream(new MemoryStream(buffer)) as Bitmap; Pin
Robert Rohde21-Apr-05 19:52
Robert Rohde21-Apr-05 19:52 
GeneralRe: return Bitmap.FromStream(new MemoryStream(buffer)) as Bitmap; Pin
rlinder22-Apr-05 5:31
rlinder22-Apr-05 5:31 
GeneralRe: return Bitmap.FromStream(new MemoryStream(buffer)) as Bitmap; Pin
rlinder22-Apr-05 8:42
rlinder22-Apr-05 8:42 
GeneralRe: return Bitmap.FromStream(new MemoryStream(buffer)) as Bitmap; Pin
[Marc]16-May-05 14:43
[Marc]16-May-05 14:43 
GeneralCrystal Reports.Net Pin
Anonymous21-Apr-05 0:59
Anonymous21-Apr-05 0:59 
GeneralRe: Crystal Reports.Net Pin
Anonymous21-Apr-05 5:03
Anonymous21-Apr-05 5:03 
GeneralRe: Crystal Reports.Net Pin
vertig073021-Apr-05 7:27
vertig073021-Apr-05 7:27 
GeneralRe: Crystal Reports.Net Pin
Anonymous28-Apr-05 1:06
Anonymous28-Apr-05 1:06 
QuestionHow big can be a .NET Application Pin
zkey20-Apr-05 23:41
zkey20-Apr-05 23:41 
AnswerRe: How big can be a .NET Application Pin
Carl Mercier21-Apr-05 15:23
Carl Mercier21-Apr-05 15:23 
AnswerRe: How big can be a .NET Application Pin
Dave Kreskowiak21-Apr-05 15:59
mveDave Kreskowiak21-Apr-05 15:59 
AnswerRe: How big can be a .NET Application Pin
Robert Rohde23-Apr-05 7:53
Robert Rohde23-Apr-05 7:53 
GeneralRe: How big can be a .NET Application Pin
23-Apr-05 9:27
suss23-Apr-05 9:27 
Generalunboxing Pin
ganeshMohan20-Apr-05 21:54
ganeshMohan20-Apr-05 21:54 

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.