|
Thanks a lot to everybody!!!!
|
|
|
|
|
Hi
I am having two projects(say dll1,dll2) with the same class name,functions and everything will be same, except the logic implemented in the functions.
An exe application is having reference to one of above specified dll (say dll1), But depends on requirement, at the runtime i would be using either dll1 or dll2. say the user wants to perform different logic that is implemeted in dll2, at run time i will rename and Place the dll2 in application bin directory (with name dll1).
But the application is crashing with dll2.
Is it possible to do like this way or anyother way to achieve this requirement?
|
|
|
|
|
You may want to look at the assemblyBindings section of the config file. Possible you could use bindingRedirect to switch assemblies in the config for each application deployment.
Otherwise you will need to use Reflection to load the proper assembly and runtime.
only two letters away from being an asset
|
|
|
|
|
Hello,
I have a TreeView in my application which I wish to disable once an action was taken. I am using the following line for doing so but the problem is that it also Disables my Scrollbar.
The Code:
treeView1.Enabled = false;
Is there anyway to have Scrollbar active while the TreeView is not selectable?
Thank you for your help.
Khoramdin
|
|
|
|
|
I think the following should work for you assuming that you have the referenced boolean value that indicates whether selections are allowed:
private void treeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
e.Cancel = (_treeDisabled);
}
|
|
|
|
|
|
The Microsoft help says:
Note: This event is new in the .NET Framework version 2.0.
Usually that means there isn't anything like it in 1.1
Still if you want to have your form only do something once then perhaps you should consider the form load event.
Hope that helps.
Ben
|
|
|
|
|
I guess that's what I need.
However I would like to see a graph of all the events fired when a form is loaded.
And the orders of those events
company, work and everything else @ netis
|
|
|
|
|
Here is what is in the Microsoft help file:
Application Startup and Shutdown Events
The Form and Control classes expose a set of events related to application startup and shutdown. When a Windows Forms application starts, the startup events of the main form are raised in the following order:
System.Windows.Forms.Control.HandleCreated
System.Windows.Forms.Control.BindingContextChanged
System.Windows.Forms.Form.Load
System.Windows.Forms.Control.VisibleChanged
System.Windows.Forms.Form.Activated
System.Windows.Forms.Form.Shown
When an application closes, the shutdown events of the main form are raised in the following order:
System.Windows.Forms.Form.Closing
System.Windows.Forms.Form.FormClosing
System.Windows.Forms.Form.Closed
System.Windows.Forms.Form.FormClosed
System.Windows.Forms.Form.Deactivate
The ApplicationExit event of the Application class is raised after the shutdown events of the main form.
Ben
|
|
|
|
|
Thanks that is most helpfull. Do you have a link for that?
As I see this is for .Net > 2.0
company, work and everything else @ netis
|
|
|
|
|
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxmancli/html/e81db09b-4453-437f-b78a-62d7cd5c9829.htm
Ben
|
|
|
|
|
Is there someone who could help me with this please
What I want to do is that:
1) Execute the server on my machine.
2) Through that server, initialize/execute the clients(.exe) on the client machines(known machine-names/IP addresses).
3) Clients will then start communication with the server.
I actually need help with that 2nd step.
PsExec looks to be interesting, but I want that step 2 to be done by my server.
---------------------------------------------------------------------------------------------
Like for example when I do something like this:
Process proc = new Process();
ProcessStartInfo info = new ProcessStartInfo("C:\\client.exe");
proc.Start();
The above will execute the client.exe on my C drive.
But I want to execute this file on other machines residing on the same network (LAN).
Thanks.
Sarfraz.
-- modified at 11:27 Tuesday 27th February, 2007
Sarfraz
|
|
|
|
|
|
This looks like to be some thing that I actually need:
ConnectionOptions objConnectionOptions = new ConnectionOptions();
objConnectionOptions.Impersonation = ImpersonationLevel.Impersonate;
objConnectionOptions.EnablePrivileges = true;
objConnectionOptions.Username = strUserName;
objConnectionOptions.Password = strPassword;
ManagementScope objManagementScope = new ManagementScope(@"\\remote-machine-name\ROOT\CIMV2", objConnectionOptions);
objManagementScope.Connect();
ManagementClass processClassFinal = new ManagementClass(objManagementScope, new ManagementPath("Win32_Process"), null);
ManagementBaseObject inParamsFinal = processClassFinal.GetMethodParameters("Create");
inParamsFinal["CommandLine"] = @"\\remote-machine-name\some-directory\someProgram.exe";
ManagementBaseObject outParamsFinal = processClassFinal.InvokeMethod("Create", inParamsFinal, null);
But for some reason it does not work and I don't know why???????
outParamsFinal["processId"] returns null, instead of a valid processId.
Is there any one who could help me in that..............
Thanks
Sarfraz
|
|
|
|
|
What is the best solution for store html/javascripts scripts?
I want to store alot of html/javascripts codes as a ? maybe array or db or?, what is the best solution for that? I cant use sql unless, I can build it in the program.
If it's possible, then I dont want to do this every line:
html += "<html>\n"
+"<head>\n"
+"<meta........
It most be easy!
Thanks!
PS: It would be great with some code examples because I am neally started on C#/C Sharp
|
|
|
|
|
You could store the html/javascript in resource files.
only two letters away from being an asset
|
|
|
|
|
Thanks for the quick answer!
I have tried that but then a have to call every single code as
"string code = Resource1.String1.ToString();" or is there i better solution for doing that?
Thanks
|
|
|
|
|
Are you saying you want to store each html tag as a different resource then concatentate them together to form a page?
only two letters away from being an asset
|
|
|
|
|
No thats what i dont want to but i very new in C#, so how can i do it more easy?
|
|
|
|
|
Create a complete html or javascript file and store it as a resource.
only two letters away from being an asset
|
|
|
|
|
Sorry i ask agian but how do i load it into the program?
|
|
|
|
|
|
Thanks !
|
|
|
|
|
Files or file segments can also be stored to memo/text fields and assembled on the fly. Generally you would not want to deploy individual JavaScript routines individually, so unless you are archiving them for research, I don't see what the point of separating them would be. What we need to know is what purpose you have. Your design should be driven by that purpose (which indicates available resources, limitations, etc.). The approach to storage and retrieval otherwise is practically unlimited. Given a purpose and working environment, you always want to store as much together as possible. You should not be writing a head tag, meta tags, and finally a head conclusion tag. Write them all together unless there is a purpose that is served by separating them. Even then, separation can be avoided. Build the whole head section for instance with an author field content in it by replacing an author field token in the whole head section. Write the whole result of such a process to a file, and it can be displayed as a page.
A principle of development is to minimize operations. It looks like you are multiplying operations unnecessarily here.
|
|
|
|
|
sorry if i missed to say it... but i doesn't use the html/javascripts in the program.
It just for archive them in the app
|
|
|
|