//Add these namespaces to your page.
//Put this code in either Page_Load or any other function
string DirectoryName = @"C:\Test"; //Make sure the directory exists.
string Account = @"Domain\username"; //Replace it with your Domain Name and User Name.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
I have one doubt regarding usage of the reflection to get the
private member variables. In one of my assembly through reflection
i am getting private member variables in the same assembly classes.Client can change the Code Access policy to restrict the private member variable right?
Client can only restrict to accessing only private members or any members can restrict?.
if yes than what is the use of reflection...
So usage of reflection in projects how much safe .......? and Reflection is usefull in Unit test drivers only or wht?
Please help in this regard ....
Kiran Kumar Singani
The Dream is not what you see in sleep........Dream is the thing which does not let you sleep
It is not safe because you try to access methods at run time using "reflection".
Use SecurityPermissionAttributes on your private methods for which you want to access.
What is the reason behind accessing a private mthod. Do it public then.
As a design rule, make things non-punlic if you don't neeed them or if you want to secure them.
Have alook at .NET Reflector tool which disassembles any .NET assembly to it's original source code using reflection including of course the private ones. Which means you can access but this tool also shows how unsecure your private methods are. To call these methods, I've not tried actually but as I said, try to make them internal or private and add SecurityAttributes to ptotect.