-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReflection.cs
39 lines (34 loc) · 1011 Bytes
/
Reflection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Reflection;
/*
* C# reflection is a process to get metafata of a type at runtime.
* the System Reflection namespace contains required classes for reflection sunc as
*
* Type, MemberInfo, ConstruicterInfo, MethodInfo, FieldInfo
*/
namespace ConsoleApp76
{
class Program
{
public static void Main()
{
Type test = typeof(System.String);
Console.WriteLine("hello harshal");
var ci = test.GetMethods(BindingFlags.Public | BindingFlags.Instance);
foreach (var variable in ci)
{
Console.WriteLine(variable);
}
var a = 10;
Type t = a.GetType();
Console.Write(t);
Console.WriteLine(t.Assembly);
Console.WriteLine(t.AssemblyQualifiedName);
Console.WriteLine(t.Attributes);
Console.WriteLine(t.ContainsGenericParameters);
Console.WriteLine(t.FullName);
Console.WriteLine(t.IsImport);
Console.WriteLine(t.IsGenericType);
}
}
}