(obj, "k001 ");// Obtain the MyName attributePropertyInfo pi1 = t. GetProperty ("MyName ");// Assign a value to the MyName attributePi1.SetValue (obj, "grayworm", null );PropertyInfo pi2 = t. GetProperty ("MyInfo ");Pi2.SetValue (obj, "hi.baidu.com/grayworm", null );// Obtain the show MethodMethodInfo mi = t. GetMethod ("show ");// Call the show MethodMi. Invoke (obj, null );System. Reflection. Assembly class The Assembly class can obtain the Assembly information, dynamically load the Assembly,
These two days have been a headache for "unable to load one or more of the types in the assembly". I believe that there is a lot of need to use reflection to load assembly and dynamically call ass. gettypes () or ass. friends of GetType (string) or createinstance () may encounter this annoying problem like me. This problem is very concealed. Generally, if you encounter this problem during execution of GetTy
1. Create a DLL for reflection. Create a C # class library project and copySource codeCompile and generate the DLL as follows (if the DLL file name is testreflect. dll) 1 Using System; 2 3 Namespace Webtest 4 { 5 /**/ ///6///Reflecttest abstract description.7/// 8 Public Class Reflecttest 9 { 10 Public Reflecttest () 11 {} 12 13 Public String Writestring ( String S) 14 {15Return"Welcome,"+S;16} 17 18 /**/ /// 19
1. If you want to create an object in an assembly, there are many methods. For example:
System. reflection. Assembly ass
=
System. reflection. Assembly. loadfrom (
@"
D: programsvs. netinterfacecomindebugcom. dll
"
);Type T
=
Ass. GetType (
"
Com. class1
"
);
String
[] Implctorsig
=
{"System. String"}
;Type [] ctorsigarr
=
Type. gettypearray (implctorsig );System.
1. Create a DLL for reflection. Create a C # class library project and copySource codeCompile and generate the DLL as follows (if the DLL file name is testreflect. dll) 1 Using System; 2 3 Namespace Webtest 4 { 5 /**/ ///6///Reflecttest abstract description.7/// 8 Public Class Reflecttest 9 { 10 Public Reflecttest () 11 {} 12 13 Public String Writestring ( String S) 14 {15Return"Welcome,"+S;16} 17 18 /**/ /// 19
Function of reflection:
1. You can use reflection to dynamically create instances of the type, bind the type to an existing object, or obtain the type from an existing object.
2. The application needs to load a specific type from a specific program set at runtime, so that reflection can be used for a task.
3. Reflection main applications and class libraries. These class libraries need to know a type definition to provide more functions.
1. DLL to be reflectedUsing System;Namespace Webtest{Publi
string WriteName (string s)24 {25 return "Welcome," + s;26}2728 public string WriteNoPara ()29 {30 return "you are using a non-parameter method ";31}32}33}
The following is a specific call method:
1 Public void test1 ()2 {3 system. reflection. Assembly ass;4 type;5 object OBJ;6 try7 {8 ass = system. reflection. Assembly. LoadFile (@ "D:/testreflect. dll ");9 type = a
I. Elegant swearing
1. Stop complaining! Don't complain!2. You make me sick! You really make me sick!3. What's wrong with you? What's wrong with you?4. You shouldn't have done that! You really shouldn't do that!5. You're a jerk! You are a waste/asshole!6. Don't talk to me like that! Don't talk to me like that!7. Who do you think you are? Who do you think you are?8. What's your problem? What's wrong with you?9. I hate you! I hate you!10. I don't want to see your face! I don't want to see you agai
Customer
Overlord (nickname of a daughter), born for 10 days. Original requirements
Change diapers for Overlord. Demand refinement
For diapers, wipe your ass clean, not catch the cold, comfortable. Customer Satisfaction
The bully does not cry, and his ass should be clean. Project role
I have worked as an assistant engineer for the first few projects, such as water in the middle of the diaper change pro
command line compile csc/t:library ReflectTest.cs command to generate the ReflectTest.dll library file.
The following procedures are then written:
using System; using System.Reflection; Class TESTAPP { public static void Main () { Assembly ass; Type type; Object obj; //used to test the static method Object any = new object (); //load The DLL //must indicates the whole path of dll Ass = assem
provides access to this attribute metadata.
Fieldinfo obtains information about a "data member" and provides access to the metadata of this "data member.
Eventinfo obtains information about an "Event" and provides access to the "event" metadata.
The access operations for these classes (except parameterinfo) listed above must be completed through a type object. For example, we need to do this to obtain a "member function" for accessories:
System. reflection. Assembly
the ostrich tactics, that is, to conceal problems and difficulties, so that problems and difficulties are accumulated day after day and become bigger and bigger. When the explosion of problems becomes bigger, it is irrecoverable. The project manager was once happy to gain the trust of the boss, but did not expect to get more trust and criticism in the end! The project objectives are unclear, the progress is lagging behind, the necessary organization guarantees and resource support are lacking,
10. WGET, 10 wget
This is a good http://www.cnblogs.com/peida/archive/2013/03/18/2965369.html I have seen.
WGET supports HTTP and FTP protocols, resumable data transfer, and automatic recursion of remote host directories.
It is suitable for downloading online files in batches or creating images for remote Websites, and restoring backups from remote servers to local servers.
-L sets the recursive level. The default value is 5. -L1 is not recursive;-l0 is infinite Recursion
-R recursive d
changed at any time (of course, the interface still needs to be matched), and you do not need to change the project you have created.Sample Code
Class program {static void main (string [] ARGs) {console. writeline ("test thread reflection technology... "); Assembly ass; type; object OBJ; // 1 Load Assembly ass = assembly. loadFile (@ "D: \ myproject \ thread_stu \ dll_reflection \ bin \ debug \ dll_reflect
In LInux, Mplayer subtitles are garbled and Japanese fonts are partially garbled. For details, refer to Linux general technology-Linux technology and application information. If ASS Subtitles cannot be loaded, you need to convert the ASS subtitle encoding from utf16 to utf8.
This can also be used with gedit: iconv-f utf16-t utf8 subtitle_utf16.ass> subtitle_ut
sharing.Brb: be right back, coming back soonTtyl: talk to you later.Bbl: be back later will be back laterKick your ass: Beat your assPpl: peoplePlz, pls: please, pleaseBull ***, ***: NonsenseSorry ass: Poor guy, despisingSo: GeneralCutie: SweetheartD \ * amn: Depends on, he xxSteamed Stuffed bun: Someone is ugly or stupid.Powder: Very, VeryCainiao, prawns, and beginners: New beginnersLaruence, prawns: Mast
are then written:
Copy Code code as follows:
Using System;
Using System.Reflection;
Class TESTAPP
{
public static void Main ()
{
Assembly Ass;
Type type;
Object obj;
Object any = new object ();
Ass = Assembly.loadfile (@ "D:\Source code\00.c# sudy\01.reflection\01\reflecttest.dll");
Type = ass. GetType ("Reflectiontest.writetest");
/*exa
Yii Srbac extension in the "User has been authorized" point drop-down box, when you select a user who has permissions, you cannot list permissions at all.The reason is that srbac the ID in the database table to the number, like 123, but if it's not a number like ' y0f22ffc2fef712fd602a1ef64ab319t '. Then this is not going to come out, then you can only modify the code.Modify the Actionshowassignments method in the \protected\modules\srbac\controllers\authitemcontroller.php fileThe source code is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.