473,320 Members | 2,180 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,320 software developers and data experts.

Can I get a instance from type?

i konw a type(no class),can i get this type`s instance list?

Nov 16 '05 #1
7 2014
¿ÉÒÔ˵µÃÇå³þÒ»µãÂð£¿

type(no class)£¿Ê²Ã´Òâ˼£¿

--
ÁõÃô
Rustle Liu

http://www.cnblogs.com/rustle/

"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> дÈëÏûÏ¢
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?

Nov 16 '05 #2
ºÇºÇ£¬Ó¢Óï½Ï²î£¬
ÊÇÕâÑùµÄ£¬ÎÒÓÐÒ»¸ö¼Ì³Ð×ÔMarshalByRefµÄÀàSvcControl ler±»×¢²áΪSingleton.
ͬʱ£¬Õâ¸öÀàÔÚ±¾AppDomainÖпÉÄܱ»ÊµÀý»¯Á˶à´Î£¬

ÎÒÏÖÔÚÏëÖªµÀ£¬ÄĸöʵÀýÊDZ»Ô¶³ÌʵÀý»¯µÄ£¬È»ºóÎÒµ÷Óà Õâ¸ö±»Ô¶³ÌʵÀý»¯ ʵÀý µÄ·½
·¨£¬ÒÔ´¥·¢Ò»¸öʼþ֪ͨ¿Í»§¡£

²»Äܵ÷ÓÃËùÓÐʵÀýµÄ£¨ÒòΪÈç¹ûµ÷Óñ¾µØµÄʵÀý£¬»áÒýÆð ÏûÏ¢Ñ*»·£©¡£

Ôõô²ÅÄÜÅжÏÄĸöʵÀýÊDZ»Ô¶³ÌʵÀý»¯µÄÄØ£¿



"ÁõÃô" <ru********@hotmail.com.discuss> дÈëÓʼþ
news:Om**************@TK2MSFTNGP10.phx.gbl...
¿ÉÒÔ˵µÃÇå³þÒ»µãÂð£¿

type(no class)£¿Ê²Ã´Òâ˼£¿

--
ÁõÃô
Rustle Liu

http://www.cnblogs.com/rustle/

"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> дÈëÏûÏ¢
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?


Nov 16 '05 #3
Just a question. What encoding do you use for your messages? I am unable to see your text as the encoding isn't specified in the message.

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #4
SIMPLE CHINESE GB2312

"Morten Wennevik" <Mo************@hotmail.com> ????
news:opr9ddfye1klbvpo@morten_x.edunord...
Just a question. What encoding do you use for your messages? I am unable to see your text as the encoding isn't specified in the message.
--
Happy coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #5
Ah, well, I found a GBK/BG2312 encoding, which will output the text in Chinese, but since I don't know any Chinese beyond "ni hao" I guess it doesn't really matter :)

On Thu, 10 Jun 2004 16:31:14 +0800, ???????-??? <Su********@sina.com> wrote:
SIMPLE CHINESE GB2312

"Morten Wennevik" <Mo************@hotmail.com> ????
news:opr9ddfye1klbvpo@morten_x.edunord...
Just a question. What encoding do you use for your messages? I am unable

to see your text as the encoding isn't specified in the message.

--
Happy coding!
Morten Wennevik [C# MVP]



--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #6
Activator.CreateInstance(Type type)

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> schrieb im Newsbeitrag
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?

Nov 16 '05 #7
No, you can not. There is no way to see what instances of a type exist
in the current app domain. You ^might^ be able to do this through the hooks
that the CLR provides, but I wouldn't recommend it.

If you need this information, I would recommend using a class factory
pattern, where you can keep track of the instances that are created and then
retrieve them when necessary.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> wrote in message
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?

Nov 16 '05 #8

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

Similar topics

4
by: Graeme Matthew | last post by:
Hi all, quick one, I hope I am explaining this properly, I am wanting to do some introspection on custom object instances, for example: import md5 >>> m = md5.new() >>> type(m) <type...
6
by: RT Lange | last post by:
>>> class E1(Exception): pass >>> class E2(E1): pass >>> i = E2('foo') >>> raise E1(i) Traceback (most recent call last): File "<pyshell#5>", line 1, in ? raise E1(i) E1: foo
1
by: Brad Clements | last post by:
I need to dynamically create a new type of class at runtime, based on an oldstyle class and a new style class. I'm using Python 2.3.2 My code: def shipment_from_db_instance(db_shipment):...
3
by: Steph | last post by:
Hi, On my first oracle instance, I have a global type 'productarray' (CREATE OR REPLACE TYPE productarray AS TABLE OF VARCHAR(30)), I have a package procedure having myArray OUT productarray as...
2
by: Andrzej Kaczmarczyk | last post by:
Hi, I have following problem: (warning, quite long post with lots of code) I have an object of a known type like this. class MyClass { public int Property1; public string Property2; }
10
by: John M. Gabriele | last post by:
The following short program fails: ----------------------- code ------------------------ #!/usr/bin/python class Parent( object ): def __init__( self ): self.x = 9 print "Inside...
3
by: wolfgang.lipp | last post by:
some time after posting my `Linkdict recipe`__ to aspn__ -- basically, a dictionary with run-time delegational lookup, but this is not important here -- i thought gee that would be fun to make...
2
by: TEK | last post by:
Hello We're having a issue with a part of our app that is very strange, and I'm unable to see that it should be possible. We have: A collection (ActivityCollection) that is inherited from a...
5
by: JH | last post by:
Hi I found that a type/class are both a subclass and a instance of base type "object". It conflicts to my understanding that: 1.) a type/class object is created from class statement 2.) a...
4
by: Gre7g Luterman | last post by:
I suppose I was lulled into complacency by how Python makes so many things look like classes, but I'm starting to realize that they're not, are they? I'm writing a C program which handles Python...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.