473,396 Members | 1,961 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,396 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?

Jul 21 '05 #1
7 2089
¿ÉÒÔ˵µÃÇå³þÒ»µãÂð£¿

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?

Jul 21 '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?


Jul 21 '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]
Jul 21 '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]

Jul 21 '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]
Jul 21 '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?

Jul 21 '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?

Jul 21 '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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.