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

.NET (Core and Framework)

 
AnswerRe: Sending a keystroke to all applications Pin
PIEBALDconsult3-Jun-10 5:59
mvePIEBALDconsult3-Jun-10 5:59 
AnswerRe: Sending a keystroke to all applications [modified] Pin
Hristo-Bojilov3-Jun-10 10:11
Hristo-Bojilov3-Jun-10 10:11 
GeneralRe: Sending a keystroke to all applications Pin
Luc Pattyn3-Jun-10 11:00
sitebuilderLuc Pattyn3-Jun-10 11:00 
GeneralRe: Sending a keystroke to all applications Pin
Hristo-Bojilov3-Jun-10 11:22
Hristo-Bojilov3-Jun-10 11:22 
AnswerRe: Sending a keystroke to all applications Pin
Anshul R9-Jun-10 4:03
Anshul R9-Jun-10 4:03 
QuestionMessage Removed Pin
2-Jun-10 3:44
professionalN_tro_P2-Jun-10 3:44 
AnswerRe: Loading Objects with reflection Pin
Pete O'Hanlon2-Jun-10 4:21
mvePete O'Hanlon2-Jun-10 4:21 
GeneralMessage Removed Pin
2-Jun-10 6:27
professionalN_tro_P2-Jun-10 6:27 
AnswerRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 6:57
sitebuilderLuc Pattyn2-Jun-10 6:57 
GeneralMessage Removed Pin
2-Jun-10 7:22
professionalN_tro_P2-Jun-10 7:22 
AnswerRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 7:30
sitebuilderLuc Pattyn2-Jun-10 7:30 
GeneralMessage Removed Pin
2-Jun-10 8:03
professionalN_tro_P2-Jun-10 8:03 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 8:09
sitebuilderLuc Pattyn2-Jun-10 8:09 
GeneralMessage Removed Pin
2-Jun-10 8:33
professionalN_tro_P2-Jun-10 8:33 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 8:36
sitebuilderLuc Pattyn2-Jun-10 8:36 
GeneralMessage Removed Pin
2-Jun-10 9:16
professionalN_tro_P2-Jun-10 9:16 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 9:25
sitebuilderLuc Pattyn2-Jun-10 9:25 
GeneralMessage Removed Pin
2-Jun-10 9:32
professionalN_tro_P2-Jun-10 9:32 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 9:40
sitebuilderLuc Pattyn2-Jun-10 9:40 
QuestionHow to retrieve the parameter values from MethodInfo? Pin
anand kumar m2-Jun-10 0:32
anand kumar m2-Jun-10 0:32 
AnswerRe: How to retrieve the parameter values from MethodInfo? Pin
Peace ON2-Jun-10 1:18
Peace ON2-Jun-10 1:18 
In most of the forum I found it is not possible
to retrieve parameter value, however it is possible
to retrieve parameter name and type.

Try following code for the same...

C#
class Program
{
        static void Main(string[] args)
        {
                A a = new A();
                a.Go(1);
        }
}

public class A
{
        internal void Go(int x)
        {
                B b = new B();
                b.Go(4);
        }
}


public class B
{

        internal void Go(int y)
        {
                Console.WriteLine(GetStackTrace());

        }
        public static string GetStackTrace()
        {
                StringBuilder sb = new StringBuilder();
                StackTrace st = new StackTrace(true);
                StackFrame[] frames = st.GetFrames();

                foreach (StackFrame frame in frames)
                {
                        MethodBase method = frame.GetMethod();

                        sb.AppendFormat("{0} - {1}",method.DeclaringType, method.Name);
                        ParameterInfo[] paramaters = method.GetParameters();
                        foreach (ParameterInfo paramater in paramaters)
                        {
                                sb.AppendFormat("{0}: {1}", paramater.Name, paramater.ToString());
                        }
                        sb.AppendLine();
                }


                return sb.ToString();
        }

}


For more info. try following links...

http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/1169ad05-8711-4607-98e6-aa6d380bd0ea/[^]

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/fdab69c6-f3b6-440d-a6d9-13d5d059f16f/[^]

http://stackoverflow.com/questions/75076/obtain-parameter-values-from-stackframe-in-net[^]

http://tdanecker.blogspot.com/2007/09/interception-with-proxies.html[^]


HTH
Jinal Desai - LIVE
Experience is mother of sage....

QuestionSession cookie problem with HttpWebRequest Pin
garageoffice1-Jun-10 21:56
garageoffice1-Jun-10 21:56 
QuestionFtp over ssl Pin
mon***z1-Jun-10 0:11
mon***z1-Jun-10 0:11 
AnswerRe: Ftp over ssl Pin
Peace ON1-Jun-10 4:26
Peace ON1-Jun-10 4:26 
QuestionExploding .NET solution Pin
Baconbutty31-May-10 23:30
Baconbutty31-May-10 23:30 

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.