Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: Crystal reports Pin
Dave Kreskowiak1-Oct-11 2:46
mveDave Kreskowiak1-Oct-11 2:46 
QuestionUsing SystemParametersInfo() P/Invoke Pin
namelkcip30-Sep-11 19:40
namelkcip30-Sep-11 19:40 
AnswerRe: Using SystemParametersInfo() P/Invoke Pin
OriginalGriff30-Sep-11 21:38
mveOriginalGriff30-Sep-11 21:38 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
namelkcip1-Oct-11 16:31
namelkcip1-Oct-11 16:31 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
OriginalGriff1-Oct-11 21:22
mveOriginalGriff1-Oct-11 21:22 
AnswerRe: Using SystemParametersInfo() P/Invoke Pin
DaveyM691-Oct-11 23:24
professionalDaveyM691-Oct-11 23:24 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
namelkcip5-Oct-11 16:50
namelkcip5-Oct-11 16:50 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
DaveyM696-Oct-11 6:44
professionalDaveyM696-Oct-11 6:44 
QuestionHow to Access Methods and Properties of a Private Class Pin
namelkcip30-Sep-11 19:24
namelkcip30-Sep-11 19:24 
AnswerRe: How to Access Methods and Properties of a Private Class Pin
Dave Kreskowiak1-Oct-11 2:43
mveDave Kreskowiak1-Oct-11 2:43 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
SledgeHammer011-Oct-11 8:18
SledgeHammer011-Oct-11 8:18 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Dave Kreskowiak1-Oct-11 8:41
mveDave Kreskowiak1-Oct-11 8:41 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Eddy Vluggen1-Oct-11 8:42
professionalEddy Vluggen1-Oct-11 8:42 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
SledgeHammer011-Oct-11 9:58
SledgeHammer011-Oct-11 9:58 
AnswerRe: How to Access Methods and Properties of a Private Class Pin
Eddy Vluggen1-Oct-11 11:49
professionalEddy Vluggen1-Oct-11 11:49 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Eddy Vluggen1-Oct-11 12:47
professionalEddy Vluggen1-Oct-11 12:47 
C#
using System;
using System.Diagnostics;
using System.Reflection;
namespace ConsoleApplication7
{
static class Owner
{
    private class SomeClass
    {
        private string SomeMethod()
        { return "Hello world"; }
    }
}
class Program
{
    static int Main(string[] args)
    {
        Type ownerClassType = Type.GetType(
            "ConsoleApplication7.Owner, ConsoleApplication7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
        Type someClassType = ownerClassType.GetNestedType(
            "SomeClass", 
            BindingFlags.Instance | BindingFlags.NonPublic);
        Object someObject = Activator.CreateInstance(someClassType);
        MethodInfo mi = someClassType.GetMethod(
            "SomeMethod",
            BindingFlags.Instance | BindingFlags.NonPublic);
        Object result = mi.Invoke(someObject, null);
        Console.WriteLine(result);
        Console.ReadKey();
        return 0;
    }
}
}

Yup, works Smile | :)
Bastard Programmer from Hell Suspicious | :suss:

GeneralRe: How to Access Methods and Properties of a Private Class Pin
BillWoodruff1-Oct-11 18:30
professionalBillWoodruff1-Oct-11 18:30 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
namelkcip1-Oct-11 16:33
namelkcip1-Oct-11 16:33 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
BillWoodruff1-Oct-11 18:32
professionalBillWoodruff1-Oct-11 18:32 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Dave Kreskowiak2-Oct-11 1:54
mveDave Kreskowiak2-Oct-11 1:54 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
BobJanova2-Oct-11 22:28
BobJanova2-Oct-11 22:28 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
namelkcip5-Oct-11 16:56
namelkcip5-Oct-11 16:56 
AnswerRe: How to Access Methods and Properties of a Private Class Pin
PIEBALDconsult1-Oct-11 4:01
mvePIEBALDconsult1-Oct-11 4:01 
QuestionReceiving Data on Socket Class Pin
Richard Andrew x6430-Sep-11 13:23
professionalRichard Andrew x6430-Sep-11 13:23 
AnswerRe: Receiving Data on Socket Class Pin
André Kraak30-Sep-11 13:48
André Kraak30-Sep-11 13:48 

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.