I think Assembly auto searches assemblies in GAC and application folder. You'd better pass a absolute or relative path to it, rather than setting current directory... ;P
natsuyaki
Posts
-
Current directory issue to load a assembly thru reflection -
Passing Variable to Parent formErr, I see, txtUsername is private huh? define a property:
public string Username { get{return txtUsername.Text;} }
So, in main form:stripLblLoginAs.Text = "Login As :" + login.Username;
-
Passing Variable to Parent formFrmMain frmMain = (FrmMain)this.MdiParent your login form doesn't have a parent, so the frmMain will be null when running. try this: in main form: LoginForm login=new LoginForm(); login.ShowDialog(this); if (login.DialogResult==DialogResult.OK) { this.toolStripStaff.Visible = true; ........ in login form: else if ((txtUsername.Text == username) && (txtPassword.Text == password)) { this.DialogResult=DialogResult.OK; ........
-
Passing Variable to Parent formA dialog is not a MdiChild, so childLogin.MdiParent = this; can be ignored. According to my experience:
childForm child=new childForm(); child.ShowDialog(parent);
works. My code and I is not professional. take careful advantage. -
Passing Variable to Parent formchildForm.ShowDialog(parentForm)
-
Passing Variable to Parent formForms can be shown as dialog and return a DialogResult, that makes things simple.
-
Passing Variable to Parent formWhy don't you the login form as a dialog?
-
Passing Variable to Parent formI admit that it's ugly. But it works.
-
Passing Variable to Parent formset the txtUsername as public, or just define a public variable in child form.
-
MDIFrmMain frmMain = this.MdiParent as FrmMain;
-
meta data and attributeThat's a big work to do.... You may be interested in this book: Applied .Net Attributes by Jason Bock Sorry, here we go. And this could also help:http://www.codeproject.com/KB/cs/attributes.aspx
modified on Monday, May 12, 2008 4:30 AM
-
meta data and attribute1.some like that 2.some attributes reprent for "mark",and some for "deal". That means, some attributes are use for comment the content, some for the compiler that the content will be processed by the mean mentioned in the attributes. So, some keep there and some disappeared. This is my point of view. For the precise definition, please view msdn.
-
Multi-thread form managing [modified]I solved it in a tricky way....:
_CurrentPlugin.Window.ShowDialog(this);
:) -
Multi-thread form managing [modified]Could you please give please give more details? I'm not so good at messages.. ;P Thanks.
-
File header processing... [modified]Sorry for misunderstanding.... ;P I'll check it out whether the method will seek to the Begin and overwrite my header...
-
File header processing... [modified]Thanks a lot. But doing this will cause the header be compressed with the data.
-
File header processing... [modified]thanx boblaw. But the HASH is the hash code of the compressed data.
-
Multi-thread form managing [modified]I've written a plug-in architeture based application. Plugins exist in isolated assemblies and each plugin runs in it's own thread provided by the host application. But these plugins just cannot display their own forms. Exactly, they can, but it's just a "flash". How can I deal with this? Herewith the working model: All the plugins implement the interface IPlugin. The host start the plugin through the method in IPlugin with a new thread. The plugin begin its work as is required(this is where I want the plugin shows its form). The plugin trigger an event while the progress changed. When the task is done, the host will destroy the instance of the plugin. thanks in advance...
modified on Sunday, May 11, 2008 10:57 AM
-
meta data and attribute1. i don't really know, maybe the tool you mentioned can. 2. I wrote a custom attribute PuginAttribute. All the plugins must add this attribute. So, I can get it at runtime by GetCustomAttribute(), if exists, that mean this is a plugin.
[Plugin(true)] public class SamplePlugin:IPlugin { ..... ....
IL code would be displayed like this:.custom instance void [XXXX]aaa.bbb.ccc.PluginAttribute::.ctor(bool) = ( 01 00 00 00 )
-
ManagedRijndael Out of Memory ExceptionYes, if each piece is encrypted with the same key and IV. And remember to use the same size to decrypt. Sample:
//Start the Encryption process FileStream fs = new FileStream(f, FileMode.Open); byte[] data=new byte[1024]; while (true) { int i = fs.Read(data, 0, 1024); if (i <= 0) break; else { CStreamWriter.Write(data, 0, 1024); //OUT OF MEMORY EXCEPTION HERE CStreamWriter.FlushFinalBlock(); } }
modified on Sunday, May 11, 2008 7:19 AM