Hi Ray,
I think you can not avoid reflection.
You can use ILasm.exe to open you dll, you will see all the member of the
assembly, so the reflection will also can retrieve it.
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "Ray Z" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<#
[email protected]>
<
[email protected]>
| Subject: Re: How could I hide class information in Class Library
| Date: Tue, 14 Oct 2003 10:21:39 -0400
| Lines: 91
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.0
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: x42071bc2.ip.e-nt.net 66.7.27.194
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:191208
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Thanks. Mmm, I solve part of the problem. I put internal keywork in front
of
| the members and functions I do not want user to see. like Jay told me. by
| this way, user can not see the members easily. but, still, they can get
| information when they debug the program which use this dll. Is this called
| reflection? can I avoid it by using factory?
|
| | >
| > Hi Ray,
| >
| > Did you resolve your problem?
| > I think jay's class factory solution is suitable, it is somewhat
similiar
| > to the COM implementation.
| >
| > If you still have any question, please feel free to let met know.
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! -
www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Ray Z" <
[email protected]>
| > | References: <
[email protected]>
| > <
[email protected]>
| > | Subject: Re: How could I hide class information in Class Library
| > | Date: Mon, 13 Oct 2003 17:29:49 -0400
| > | Lines: 39
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.3790.0
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Message-ID: <#
[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: x42071bc2.ip.e-nt.net 66.7.27.194
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:191097
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Thanks again. I get it and forget my last post which really show my
| stupid
| > | and lazy.
| > |
| > message
| > | | > | > Ray,
| > | > Make class A something other than public, such as internal.
| > | >
| > | > Internal means that only that assembly will be able to see the
class.
| > | >
| > | > internal class A : IA
| > | > {
| > | > // ...
| > | > }
| > | >
| > | > Of course this does not protect your class from reflection.
| > | >
| > | > Hope this helps
| > | > Jay
| > | >
| > | > | > | > > hi, there
| > | > > I build a Class Library, I write a class A to implement interface
| IA.
| > | The
| > | > > problem is when I give the dll file to others, thet can get all
| > | > information
| > | > > about not only IA, but also A. They can even see my protected
| members
| > of
| > | > > class A. How could I hide these informations about class A, just
| give
| > | them
| > | > > the interface informations.
| > | > >
| > | > > thanks.
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|