yes,the Reflector could do that,but,i want do that with my C# code .
goldli
Posts
-
How to know a EXE file was written by .net language or not? -
How to know a EXE file was written by .net language or not?i think i know the way you said before,but,i do not know the code.
-
How to know a EXE file was written by .net language or not?just wait for the answer.
-
How to know a EXE file was written by .net language or not?i mean use C# to do that
-
How to know a EXE file was written by .net language or not?How to know a EXE file was written by .net language or not?
-
how to use the a interface declared in a dlli know the way you said, and, you see , if i just know the interface'name ,can i have the dllTypeInterface object?
-
how to use the a interface declared in a dllthere are interfaces declared in a dll below -------------------- Encrypt.dll ------------------------- interface IDESCoder { string CreateCode(string IVString,string KeyString,string StringToEncode); string GetCode(string IVString, string KeyString, string StringToDecode); } interface IMD5Encoder { string CreateCode(string StringToEncode); } public class ClsDES : IDESCoder { public string CreateCode(string IVString, string KeyString, string StringToEncode) { } public string GetCode(string IVString, string KeyString, string StringToDecode) { } private Boolean CheckIVKey(string IVString, string KeyString, string StringToEncode) { } } public class CldMD5 : IMD5Encoder { public string CreateCode(string StringToEncode) { } } ----------------------------------------------------------------------- and there is a Host -------------------- test.exe ---------------------------------------- string filepath = @"E:\Encrypt.dll"; Assembly myDllAssembly = Assembly.LoadFrom(filepath); Type dllType = myDllAssembly.GetType("IDESCoder"); if (dllType!=null) { ......?????? } ------------------------------------------------------------------------- then,what should i do next with Reflection if i want to use Interface declared in the dll??
-
using Reflectionthank you. it works.
-
using Reflectionthere is a dll. code below -------------------------- namespace CommonFunctionLibrary { public class ClsMain { public string setValue(string a,ref string b) { b = a; return a; } } } ------------------------------------------------------- and there is a Host -------------------------------------------------------------------- string filepath = @"E:\VS2005_work\CommonFunctionLibrary\CommonFunctionLibrary\bin\Debug\CommonFunctionLibrary.dll"; string s = string.Empty; string p = string.Empty; Assembly myDllAssembly = Assembly.LoadFrom(filepath); Type dllType = myDllAssembly.GetType("CommonFunctionLibrary.ClsMain"); MethodInfo dllMethod = dllType.GetMethod("setValue"); if (dllMethod != null) { Object dllObj = Activator.CreateInstance(dllType); s=(string)dllMethod.Invoke(dllObj, new object[] {"goldli",p }); MessageBox.Show(s+"\r\n"+p); } myDllAssembly = null; ------------------------------------------------------------------------------ question: 1、the Invoke method no need to use "ref" ,why? 2、the "p" parameter has no return value,why?
-
how to make a form behind all the desktop iconsyes , just a window form as the Desktop Background behind other icons ,perhaps,a application running at the same time can notes me something to do throw the form.
-
how to make a form behind all the desktop iconshow to make a form behind all the desktop icons
-
how to draw listbox items with different itemheight when i selected a itemhow to draw listbox items with different itemheight when i select a item? the example pictures at http://goldli.s75.53dns.com/2.jpg http://goldli.s75.53dns.com/1.jpg I know that use MeasureItem and DrawItem Method to draw,but i can only draw same height items.
-
Validating Email Addresshttp://regexlib.com/Search.aspx?k=ip+address code below matchs ip string RegString = @"^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$"; Regex RegObj = new Regex(RegString); if (!RegObj.IsMatch(ipString)) MessageBox.Show("error", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
How to make a listview looks like the windows explorer?How to make a listview looks like the windows explorer? Just look the picture at http://goldli.s75.53dns.com/desktop.jpg the listview item can be splited by http://goldli.s75.53dns.com/desktop1.jpg or http://goldli.s75.53dns.com/desktop2.jpg if you can not see the pictures ,please send me a mail : goldli@tom.com