|
I have an administrator username/password for each of the machines. I'm trying to remotely update registry values on multiple machines at once.
|
|
|
|
|
What about the RegistryKey.OpenRemoteBaseKey[^] method? Doesn't that do what you want, obviously you'll need to be logged in so presumably if you're a domain administrator then you can just run the code. If you have individual usernames/passwords for each computer then my guess is that you'll have to access the machine through explorer first to "log" onto it. Once that is done then you should be able to update it.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
OpenRemoteBaseKey only takes the hostname as an input. I need to use a username/password, also. I did some more searching and saw this - http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/37d17466c08886cb/935e84260c3a280f?lnk=st&q=c%23+remote+registry+username+password&rnum=9&hl=en#935e84260c3a280f
I'm assuming this is what I'm looking for hopefully.
|
|
|
|
|
That would make sense
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
For example I'm buiding Find/Search function in new form and I want to be able to search for sting in parent form from this child form (child form have text box where user enter word he is looking for)?
Parent form have multi Rich Text Box(es) (in tabs)... menus etc
So this is probably simple I tried few things but none works... I guess I'm just doing something wrong.
Thanks 
|
|
|
|
|
If you have a Form (say mainForm) containing text, and you want an interactive search facility, you could create a dialog using a new Form (say findDialog)
which has mainForm as parent (so it hides when mainForm hides), and which is
shown as modeless dialog (i.e. it can give up focus to other windows in same app).
Now mainForm can have button event handlers attached to the buttons of findDialog,
read an editTextBox on findDialog, and do whatever is required within mainForm.
So the trick is in mainForm attaching event handlers to another form's buttons,
but then it did create that other form (findDialog) so it has a reference to it.
Hence it boils down to one of the following:
- make the Controls on findDialog public (is not what Visual Studio Designer does
by default, but there is a "Modifiers" field on the properties panel)
- add public properties to get access to the non-public controls you need
- add one or more public methods to findDialog to attach an event handler to the
non-public controls you need.
The choice is yours.
Personaly I often create dialogs programmatically (rather than through Designer)
and make all controls public.
-- modified at 14:05 Saturday 6th January, 2007
Luc Pattyn
|
|
|
|
|
OK I like idea, I did change properties to buttons and textbox in child to public, so I can now access them within main form, but how do I add event handler to button from child form in main form?
Sorry for trivial question but I'm new in this.
Also does anyone have idea why I can't access richtextbox in main form from child form it's labeled as public also?
I can for example access text box in child form from main form, but it's of no use, I need to attach that event so it does that on button click not before or after.
|
|
|
|
|
No no, the simplest way is the other way around, it is the main form that does
everything about the text, including the searching, the findDialog's purpose is
to specify and trigger the search, not to perform it.
And the architecture would be something like this (incomplete!):
public class mainForm : Form {
FindDialog findDialog;
public mainForm() {
}
public void btnOpenFind_Click(object sender, EventArgs e) {
findDialog=new FindDialog();
findDialog.btnFind.Click+=new EventHandler(btnFind_Click);
findDialog.btnClose.Click+=new EventHandler(btnClose_Click);
findDialog.ShowDialog();
}
private void btnFind_Click(object sender, EventArgs e) {
}
private void btnClose_Click(object sender, EventArgs e) {
findDialog.Close();
}
}
public class FindDialog : Form {
public Button btnFind;
public Button btnClose;
public TextBox tbSearch;
}
Hope this helps you way forward.
Luc Pattyn
|
|
|
|
|
It works thanks, can someone explain what we did here (I understand basic), so we can add event to current object to instance in another object?
|
|
|
|
|
Event Listeners are another option. Personally I usually use Dialogs, which has already been said.
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Im probably missing something simple but here is my problem.
the app have 1 main form (Form1) with a dataset, dataAdapter and
databinding to some table.
Then i create another form (Form2) that contains a DataGridView
in order to bind the columns in the designer, I must have a new dataset object
another dataAdapter and another binding source.
How to prevent that , the ideia is that i want to call the Form2 in Form1
with something like new Form2(BindingSource), but still be able to use the designer
generated code.
How can i do that besides messing with the autogenerated code ???
|
|
|
|
|
Seperate your code into layers, such as Data Access and Business Logic. If you place the code to access your data into another class with a method that returns a DataSet then you can bind the controls on both forms to the same source, possibly using a ObjectDataSource control.
only two letters away from being an asset
|
|
|
|
|
Hello
I've a problem. I use DShowNet to send view from my camera to panel in C#. I would like to take position from this panel. I try to use "OnMouseMove", but it's not working. Any idea? Thanks, and sorry for my english.
|
|
|
|
|
RockyC# wrote: I would like to take position from this panel.
What exactly do you mean? In case you're interested in the panel's position on the form, the Location property is what you're looking for.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
No. I want to get mouse's position (X and Y) on panel.
|
|
|
|
|
Register an event handler to the MouseMove event of your panel and retrieve the mouse coordinates from the passed MouseEventArgs instance.
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
private void panel1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
int mouseX = e.X;
int mouseY = e.Y;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
But if you use this panel to show view from camera, then that's not working.
|
|
|
|
|
|
Ok, how do you use the panel to show the camera view; did you put some control onto the panel which does that for you? If that's the case and this control has a MouseMove event, subscribe your event handler to this.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I've used this code DirectShow.NET to capture a view.
I think You have right. This code put something on panel, but I don't know what exactly. Maybe it's videoWin (IVideoWindow class), because there is added handle to my panel.
-- modified at 11:34 Sunday 7th January, 2007
|
|
|
|
|
how to import and export favorites using C# code?
chirag surati.
Thanx in Advance!
|
|
|
|
|
Favorite what?
only two letters away from being an asset
|
|
|
|
|
wats an ASSET?
actually i m developing Bookmark Manager!
for tat i need to learn how to import and export favorites from any web browser.
i mean using C# code.
|
|
|
|
|
An asset is something that is of value to you. It's a sig, not a comment to you.
chirag_nine wrote: actually i m developing Bookmark Manager!
for tat i need to learn how to import and export favorites from any web browser.
You need to work out how each browser stores them. I think IE stores them as HTML, so you just need to know where to look for them. There's no central API, you're talking about how different browsers work, you need to research that and then work with the info you find.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a problem while making dll. i write methods in to dll and on my project i give reference and task(i am sure that i have no mistake at using dll part) but i when i use dll method debugger gives me this method is in (ExDll.dll)
how can create a methods in dll, can any one give me step by step solution.
Thanks
Best Regards
|
|
|
|